02-14-2018 03:54 PM
Hi
I have a state machine and in the init state I am putting all controls in my app (many, more than 50) into a big cluster that I pass into a SR and through the states. This init state is ugly with all the controls there and takes a lot of real estate. Is there a different way to do that ?
Thanks
Solved! Go to Solution.
02-14-2018 03:57 PM
Hard to give more specific advice without seeing your code (or a simplified version of it). 😄
02-14-2018 04:07 PM
Hi
Thanks for answering. I attach a piece of code but I don't think is relevant. For the clusters, I find them ugly and besides, I need to initialize the clusters too.
The array of controls might be a solution (if thery are of the same type), can I use different labels for elements ? Otherwise it will be a pain to remember that control(15) means "temperature', for instance..
regards
n
02-14-2018 04:13 PM
@nitad54448 wrote:
For the clusters, I find them ugly and besides, I need to initialize the clusters too.
Cluster containers can be made transparent and the containing controls arranged the same as they are now. Overall, it will just look as pretty or ugly as it was before :D. While the FP would not look any different, the diagram would replace N terminals with a single cluster terminal for N times simpler code. Make the big cluster a cluster of arrays and clusters.
02-14-2018 04:25 PM
OK, I got it..
But if I want to change a value in a cluster that itself is in the big cluster, I need to unbundle twice ?
02-14-2018 04:36 PM - edited 02-14-2018 04:55 PM
@nitad54448 wrote:
OK, I got it..
But if I want to change a value in a cluster that itself is in the big cluster, I need to unbundle twice ?
No. You can drill down in a single unbundle (or bundle) node as long as you do it "by name".
And if all elements have nice names, it also makes very readable and self-documenting code. 😉