studio icon indicating copy to clipboard operation
studio copied to clipboard

Dashboard: Add the $event structures to the expression builder

Open fietser28 opened this issue 1 year ago • 3 comments

Several widgets produce events with there own structure (named $...). I would like the definition of these structures to be present in the expression builder so I can use the data present in these events.

(I now looked into the source code to find the right name of a struct member)

fietser28 avatar Sep 11 '23 06:09 fietser28

If you want to access this event values you need to define input of type struct:$... in some action or widget. When you do that in the expression builder you can see the members of these structures, for example:

image

mvladic avatar Sep 18 '23 09:09 mvladic

Thanks for your answer. Please add this to the documentation of the expression builder.

It is important to realize the expression builder is very context sensitive. The current explaination on https://www.envox.eu/eez-studio-docs/15-variables/ is not very explicit about this.

I did not realize it not just takes global/local variables but also the input, outputs and went looking for the struct member name in the source code.

Maybe also make the title of the expression builder dynamic to show its context:

Expression builder:  projectname:page/action:component:field

fietser28 avatar Sep 18 '23 10:09 fietser28

It is working but, while testing this one I found 1 edge case:

image

Here the SCPI command field doesn't have an expression builder 'thingy', but the fields are used here. This also relates to #287 and might be considered separate from this issue.

fietser28 avatar Sep 18 '23 16:09 fietser28