Lesson 5

Captions, live values, pictures

A caption typed by hand is out of date after the first change of the scheme. A caption that reads its number out of the calculation never is. This lesson labels the open pipe of lesson 1 with its own flow and cost, warns when its pressure is too high, and puts a plant layout under the scheme.

Time about 25 minutes You need the calculated scheme from lesson 1 You finish with a scheme that explains itself

Open the file from lesson 1 and press Calculate. In it the open pipe is ID1 and the compressor ID2 — the IDs are given in the order the items were placed. Click an item and look at the ID box on the item bar if yours differ, and read your IDs wherever this lesson says ID1 or ID2.

  1. Give the pipe a name you can read

    Text refers to items by ID, and ID1 says nothing to the next person who opens the file. Click the pipe, press F2 (or right-click it and choose Rename ID…) and type BLOW1. Rename the compressor to Comp the same way — the pictures of this lesson show it so.

    An ID starts with a Latin letter and holds only Latin letters, digits, _ and -, up to 30 characters; upper and lower case count as the same letter. Zone is reserved (lesson 13). The ID box on the item bar does the same: type the new ID and press Enter.

    Renaming is safe at any stage. Connections, captions, references in texts, other scenarios and the measurements of a compressor all follow the new ID, and the calculation results stay valid. When anything besides the item itself was changed, a message says how many references were updated.

  2. Put a plain caption on the sheet

    Open the Text tab in the lower half of the right panel. Leave the switch on Create, type Blow-off, station 1 in the box and click the sheet above the pipe. The block is placed where you clicked; drag it like any other object.

    Font opens the usual dialog — typeface, size, style, colour — and the Angle box turns the block in 45° steps about its own centre, so the lines of a multi-line block stay aligned.

    The Text tab and a free caption on the sheet.
  3. Let the caption read a result

    Select the caption, and in the Text tab add a second line:

    Blow-off, station 1
    Flow BLOW1.Qn

    The sheet now shows the number the calculation found, with its unit:

    You typedThe sheet shows
    Flow BLOW1.Qn Flow 1048 NL/min

    A reference is element ID, a full stop, row name. The row is found as in the Item table — by its name up to the bracket, ignoring case — and the value is shown in the units of the Units tab, rounded to about four significant digits: 1048.25 becomes 1048. A large number keeps all its whole digits — 22293.9 becomes 22294. Write it in braces, {BLOW1.Qn}, when it is glued to other text, and always when the row name has spaces in it:

    Air {Comp.Cs} a year, {Comp.Electricity consumption}
    A caption that reads its numbers from the calculation. On the right, the rows of the compressor it reads them from.

    Check

    The flow is Qn of the pipe from lesson 1, 1048.25 NL/min, rounded. The cost is Cs of the compressor, 2898.2 €, and the energy its Electricity consumption, 22293.9 kWh. Switch Air consumption on the Units tab to m3/h: the caption turns into about 62.9 Nm³/h by itself, and back again when you switch back.

  4. See what an uncalculated scheme shows

    Press Clear under the panels. Every value in the caption turns into a dash –: there is no result to show. Press Calculate and the numbers come back. Two other things can appear in place of a value:

    The sheet showsMeaning
    –No value yet: the scheme is not calculated, or the row is empty.
    #ERRA mistake you can fix — an element in a formula that does not exist, a typing error, division by zero. Shown before the calculation too, so a typo is seen at once.
    the text as typedIt is not a reference: no element has that ID, or the element has no such row. 5.5, e.g. and a full stop at the end of a sentence are never taken for references.

    The Text tab and the file always keep what you typed; only the sheet, the report and the Visio export show the values.

  5. Work something out: variables and formulas

    Replace the text of the block with:

    $Cost = Comp.Cs
    $PerHour = $Cost / 1920
    $PerN = BLOW1.Qn / BLOW1.F
    Blow-off, station 1
    Flow BLOW1.Qn, $PerN:1 per newton
    Costs $Cost:0 a year, $PerHour:2 an hour
    Drop to the pipe {=Comp.Pout - BLOW1.Pin}

    A line $Name = formula defines a variable and is not shown on the sheet. {=…} is a formula right in the line. :2 after a variable sets the number of decimals, # drops the unit.

    LineExpected
    per newton125.9 1048.25 / 8.3257 — normal litres a minute for each newton of force. NL/min divided by N is a mix of units, so the number is shown bare
    a year2898 € Cs of the compressor
    an hour1.51 € 2898.2 / 1920 hours; dividing by a plain number keeps the unit
    Drop to the pipe0 bar the connection has no loss — lesson 7 puts pipes in it

    The unit of a formula is found when it is unambiguous: a sum of values in one unit, or a value multiplied or divided by a plain number, keeps the unit; the ratio of two values in one unit has none; anything else is shown as a plain number. Values in formulas are in the display units — 5 means 5 bar while pressure is shown in bar.

    In a block without any definition the $ sign is plain text, so an old caption like Cost, $USD is left alone. In a block with definitions, write $$ for a dollar sign.

  6. Show a line only when it matters

    Make a second text block next to the pipe:

    $P = BLOW1.Pin
    $Alarm = font(bold, red, +2)
    if $P > 4 then {$Alarm}Turn it down:{$} $P:1 is more than it needs
    else Pressure $P:1

    With Pin at 6 bar the sheet shows Turn it down: 6.0 bar is more than it needs, with Turn it down: in bold red and the rest in the block's own font. Set Pin of the pipe to 4, calculate, and the block reads Pressure 4.0 bar. Set it back to 6 and calculate again.

    • if … then … else shows one line at most — the branch whose condition is true. else if builds a chain; an empty line ends the statement.
    • Before the calculation neither branch is shown, so a warning does not flash up on an uncalculated scheme. The block can still be selected — click where its text would be.
    • font(…) takes size, +2, 150%, style words, a colour name or #RRGGBB, and a typeface in quotes. {$Alarm} switches to it, {$} goes back to the block's own font.
    A condition and a font switch: the caption that nags. Its code is in the Text tab below.
  7. Tie captions to the item

    A free caption stays where it is when the pipe moves. To make it travel with the pipe, select the caption, switch the Text tab to Link and click the pipe. Now drag the pipe: the caption goes along, and deleting the pipe deletes it. An item can carry several captions; to tie several at once, Ctrl+click them all, then Link and click the item.

    When the current block is tied, the switch reads Untie. Untie all texts (N) in the context menu of the item releases all its captions at once.

    Auto-signature (the pen button on the item bar, the Item menu and the context menu) puts a caption with the item's ID next to it — the Comp over the compressor in the pictures of this lesson — where it covers neither the symbol nor its neighbours; a second press removes it. With Preferences → Create with sign on, every new item gets one straight away.

    Check

    Press F2 on the pipe and rename it BLOW-1. Look at the Text tab: your references now read "BLOW-1".Pin in formulas — an ID with a hyphen goes in double quotes there — and the sheet shows the same numbers as before. Rename it back to BLOW1.

  8. Put a plant layout under the scheme

    An audit is far easier to read drawn over the floor plan of the plant. Open the Picture tab, press Load and choose an image — a photo, a scan of the layout, a company logo. It appears in the preview; click the sheet to place it.

    ControlWhat it does
    Create newOn: each click places a new picture. Off: the next click replaces the picture of the current object.
    AlphaOpacity from 1 to 100 — the number box right of Create new; its hint reads Transparent. Around 25–30 a layout reads as a background and the scheme stands out over it.

    Scale it with Ctrl+Shift+wheel until the plan fits the scheme. Then right-click the picture and choose Pin as background: the picture becomes the wallpaper of the sheet. It drops under every item and every line, and the mouse no longer sees it: it cannot be selected, dragged or caught in a rubber band, so you draw, select and drag the scheme on top of it without picking up the plan by mistake.

    To release it, rest the pointer over the picture: an anchor appears in its top right corner, and a click on the anchor unpins it. A right click on the pinned picture does the same — its menu has one entry, Unpin picture.

    The context menu of a picture. Pin as background turns it into the wallpaper of the sheet.
    A picture pinned as background at an Alpha of about 30, the scheme drawn over it.

    A picture is rotated in 45° steps and resampled at every step, so turning it back to zero gives the original quality. Like everything else it is stored inside the .gf9 file — the image file itself is no longer needed.

  9. Save it

    File → Save as under a new name, lesson5.gf9. Lessons 6 and 7 start from the plain scheme of lesson 1 again; this file is the one to come back to when you label your own networks.

When it does not work

What you seeWhyWhat to do
The reference is shown as typedNo element has that ID, or it has no such row — or the row name has spaces and is not in braces.Check the ID on the item bar; write {ID.Row name}.
Every value is a dashThe scheme is not calculated, or an edit has cleared the results.Press Calculate.
#ERRA formula refers to an element that does not exist, divides by zero, or has a typing error.Hover the block; fix the line in the Text tab.
A $ line is shown as typed$ before a digit is always text; and a block of definitions only is shown as typed so you can select it. Add a line that uses the variable.
The if line is shown as textNo then, the condition is not a formula, or else has no if.Read it as Pascal would; if and then are whole words.
Rename ID is refusedThe ID is taken in some scenario of the file, starts with a digit or has a character other than letters, digits, _, -. Choose another ID.
Auto-signature is missing from the item barThe current object is a text or a picture.Select a catalog item.
The layout picture cannot be selected or movedIt is pinned as background.Click the anchor in its corner, or right-click it and choose Unpin picture.

Try this next

Related help topics: