Intro_Course_4_3_5 - nasa/gunns GitHub Wiki

Intro Course 4.3.5: Links & Help Pages

Naming

Links have a name, which is displayed next to the link shape in the network.

  • This name is the link object’s name in the exported network code.
  • When you drag a new link from a shape library into your network, it will initially have no name. You must give it one.
  • To name the link, select the link and simply type the name.
  • Once the link has a name label, you can also double-click the label to edit it.
  • Since this is a C++ variable name in the exported code, this has the restrictions that apply to C variable names (no dashes, spaces or special characters, can’t start with a number, etc.)
  • All links must be given names that are unique among all the objects in the network (including Spotter, FluidState & other miscellaneous objects).
  • It is a good idea to give links names descriptive of the simulated things they represent.

A freshly-added Fluid Conductor with no name:

…and after given a name:

Initialization Order

In some circumstances, links need to be run-time initialized in a certain order relative to each other. We can control this order in the drawing.

Links are defined in the exported network code, and run-time initialized, in the order in which they are drawn in the GunnsDraw drawing. Draw.io draws things “back to front”, so things in the back are drawn first, and things in front are drawn last. This order is initially set by the order in which shapes are added to the drawing. This can be changed by the To Front and To Back buttons in the Arrange tab of the Format panel in Draw.io:

  • Sending a link to the front in the drawing makes it initialize last in the network.
  • Likewise, sending a link to the back makes it initialize first.
  • Copy-pasting or dropping a new link in the network puts it in front, so it initializes last. So if a newly added link needs to initialize first, then send it to the back.

Shape Data & Help Pages

All objects have what we call “shape data”, which is viewed by right-clicking on a shape and selecting Edit Data… from the pop-up window. This data configures each instance of a shape in your network.

Links have lots of shape data. Fortunately, most links have help pages that explain this shape data & give recommendations.

Previous Page / Next Page

⚠️ **GitHub.com Fallback** ⚠️