https://kotlinlang.org logo
#science
Title
# science
b

bjonnh

12/15/2019, 6:03 PM
what I want is either the GUI knows how to deal with that device and display something like a graphical representation of states etc, or it doesn't know
a

altavir

12/15/2019, 6:06 PM
I've done widgets for boolean state and toggles as well as drop-boxes.
b

bjonnh

12/15/2019, 6:07 PM
yeah that's the advantage of Vue and Vuetify, they all already exist
it is really easy to integrate most of them are a one liner
you have a model with a JS object (boolean, string, number…) and you just attach it to the widget
a

altavir

12/15/2019, 6:07 PM
Such widgets exist everywhere. But we need to bind it to device, not some property. Also it must be automatically updated on device state change
b

bjonnh

12/15/2019, 6:08 PM
<v-checkbox v-model="mybooleanvalue"/>
and your checkbox is reactive to that variable now (both ways in that case)
yeah that's why I want that properties abstraction layer
I have that for properties now, but not actions
a

altavir

12/15/2019, 6:09 PM
I was using JavaFX property bindings, but even in that case there are some complications. For example, physical states are not updated immediately
Tango has the concept of actions. I DF-controls I've implemented actions as a change of special properties. But it is quite easy to doe standalone actions like
fun action(actionName: String, meta: Meta)
b

bjonnh

12/15/2019, 6:10 PM
yep for my measurements I have expected and measured
so every property has two states. GUI can work on expected (and tell the user that it is what is expected of that property, not necessarily the real value)
a

altavir

12/15/2019, 6:12 PM
I've hidden internal state and organized synchronization logic to properly update properties on fast change. Probably both approaches are valid.
b

bjonnh

12/15/2019, 8:52 PM
Yeah that's something I was thinking about as well, what to do with ultrafast devices
which also makes channels unusable for these
you need to make sure something listens
and if it isn't fast enough it would just hang
a

altavir

12/16/2019, 4:53 AM
Fast daq is a different matter and requires different solutions. You do not evaluate each incoming value, but accumulate them and produce binary Bunches of data. As for slow listeners, one could use conflated channels or smoothers. Done that as well.
3 Views