I often run into the issue that I have one event case that I need to execute for multiple controls. Most of the times I simply read out the terminals and most of times I get the "NewVal" from the terminal. Some times however that's not the case. I'm currently having the issue that I use a property node of a control to trigger the event and every other time the terminal gives out the "OldVal".
I believe the proper way to solve this issue would be to go by the reference. I find this blows up the code more than it should do. Looking around in the community I've found two other ideas suggesting different solutions for this issue:
The first has multiple boolean controls triggering the same event. SectorEffector's solution was asking for a reference case structure, which might be a great idea, especially when the event is triggered by different data types. When I have multiple boolean triggering one event I almost always build an array from the terminals and convert the array to an integer, so that a case structure or other code can deal with the value. But again I'd have to deal with fiddling the new value from the triggering control and the other control values together.
The second mentions actually two ideas. The actual idea of rcpacini is to have an enum indicating which control triggered the event. This is a similar approach to what SectorEffector suggested. They're both aiming at using a case structure with a different cases for each event source. The alternative idea of rcpacini was to have event data elements for each control. The is more similar to my idea, but I would like to have the values of all registered event sources clustered together.
Here a side by side of the current solution and what I'd suggest:
The order of the events would determine the order of the values in the cluster, so a way to arrange the events like a move up and move down button would be helpful:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.