Copyright VirtualSim 2004-2020 - All rights reserved
Group
A Group is a Logic object that gathers and hide a group of Logic objects defining something specific. A Group is a kind of encapsulation of a specific process or complex logic. A Group is a kind of abstraction that can be manipulated as a new named object that contains own variables and methods.
A Group can be seen as a sub Logic in a sense that, once activated, its content is running independently. It simplifies the drawing and its comprehension.
Several groups can run concurrently inside a same logic.
A Group is represented like a Task with a shadow. The Task is cycling a runtime code and a Group is cycling a bench of objects.
To create a Group, select all objects that must belong to the group and click thebutton. All selected object should disappear from the Diagram and be replaced by the Group symbol (see above). If the button seems not to work, it is because conditions for making a Group out of the selected objects are not met. Selected objects must not have Connectors or Transitions going outside of the selected set.
To see the content of a Group, double click the Group. To go back one level up, double click the diagram background (if inside a Group) of use thebutton.
To ungroup a Group and release all its content, select the Group symbol and use thebutton. All objects of the Group will be dropped down to the upper group or the base.
Code Hints
scen() or S: is a macro that returns a pointer to the Scenario instance that holds the Entity instance that holds the Logic instance that holds the current Group.
ent() or E: is a macro that returns a pointer to the Entity instance that holds the Logic instance that holds the current Group.
logk() or L: is a macro that returns a pointer to the Logic instance that holds the current Group.
group() or G: is a macro that returns a pointer to the current Group, if any, that holds the current Group. NULL if none.