Skip to content

Commit

Permalink
Update main and tutorial home pages, other misc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dsand47 committed Jun 9, 2021
1 parent 6fa7135 commit 65c9d15
Show file tree
Hide file tree
Showing 14 changed files with 1,147 additions and 1,792 deletions.
1,653 changes: 130 additions & 1,523 deletions help/en/html/tools/logixng/LogixNG.shtml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion help/en/html/tools/logixng/SidebarToolLocalPart.shtml
Expand Up @@ -32,7 +32,7 @@
<li><em style="padding-left: 1em;">Tools:</em>
<ul>
<li><a href="/help/en/package/jmri/jmrit/logixng/LogixNGInitializationTable.shtml">Initialization Table</a>
<li><a href="/help/en/package/jmri/jmrit/logixng/LogixImport.shtml">Logix Import</a>
<li><a href="/help/en/package/jmri/jmrit/logixng/LogixImport.shtml">Import Logix</a>
<li><a href="/help/en/package/jmri/jmrit/logixng/LogixNGBrowser.shtml">LogixNG Browser</a>
</ul>
</li>
Expand Down
127 changes: 119 additions & 8 deletions help/en/html/tools/logixng/Tutorial/chapter3.shtml
Expand Up @@ -39,14 +39,68 @@

<dl>
<dt>Execute delayed</dt>

<dd>Delay the execution of the following action for a specified amount of time.
This is the same as the Logix <strong>Delayed Set ...</strong>. The main
difference is that this can be used with any action, such as signals. The
time delay units are milliseconds, seconds, minutes and hours.

<div style="margin-left: 2em">
<a href="images/chapter3/execute_delay.png">
<img src="images/chapter3/execute_delay.png"
alt="Chapter 3 execute_delay" width="535" height="329">
</a>
</div>
<dd>

<dt>For</dt>
<dd>
For is a for-loop. It has four children.
<ul>
<li><strong>Init</strong> - this action is executed only one time. It's
used to initialize the loop, for example setting a Memory to a particular
value.</li>

<li><strong>While</strong> - this expression decides if the loop
should run one lap more. The loop will continue to run until this
condition will be <strong>false</strong>.</li>

<li><strong>AfterEach</strong> - this action is executed at the end of the
loop. It can for example be used to increment a counter in a Memory.</li>

<li><strong>Do</strong> - this action is executed in each loop. It
does the main work.</li>
</ul>

<p>When For is executed, the Init action is run once. After that, the
Condition expression is evaluated. If the condition returns <strong>true</strong>,
the Do action is executed and at last the AfterEach action is executed. Then
the process is repeated, except that the Init action is only executed once.</p>
</dd>

<dt>If Then Else</dt>
<dd>Reads a digital child expression and if the answer is <strong>true</strong>
it executes the <strong>then</strong> child action, else it executes the
<strong>else</strong> child action.</dd>

<dt>Many</dt>
<dd>The Many action executes many child actions.</dd>

<dt>Read analog and set analog</dt>
<dd>Read an analog child expression and execute an analog child action.</dd>

<dt>Read string and set string</dt>
<dd>Read a string child expression and execute a string child action.</dd>

<dt>Sequence</dt>
<dd>-- pending --</dd>

<dt>Table: For each</dt>
<dd>-- pending --</dd>

<dt>Timer</dt>
<dd>The Timer action executes a child action after some time.</dd>

</dl>

<h3>Display</h3>
Expand Down Expand Up @@ -74,7 +128,11 @@

<dl>
<dt>Clear loconet slots</dt>
<dd>-- pending --</dd>

<dt>Update loconet slots</dt>
<dd>-- pending --</dd>

</dl>

<h3>Other</h3>
Expand All @@ -88,16 +146,31 @@

<dl>
<dt>Call module</dt>
<dd>-- pending --</dd>

<dt>Listen on beans</dt>
<dd>-- pending --</dd>

<dt>Log local variables</dt>
<dd>-- pending --</dd>

<dt>Logix</dt>
<dd>LogixNG has an action called Logix that emulates how JMRI Logix works.
The action Logix has one expression and a number of boolean actions. A
boolean action is an action that takes a boolean value (true/false) and then
decides what to do. The action Logix was added mainly to support import of
JMRI Logix to LogixNG.</dd>
<dd>LogixNG has an action called Logix that emulates how JMRI Logix works.
The action Logix has one expression and a number of boolean actions. A
boolean action is an action that takes a boolean value (true/false) and then
decides what to do. The action Logix was added mainly to support import of
JMRI Logix to LogixNG.</dd>

<dt>Shutdown</dt>
<dd>The ShutdownComputer action either shutdown or restarts the computer.
This action is mainly included to demonstrate the possibilities of LogixNG,
but it may be useful in some cases, for example when a Raspberry Pi computer
runs the layout and there is no keyboard and mouse connected to the Raspberry
Pi computer. It's then possible to use a sensor to shutdown the computer.</dd>

<dt>Web browser</dt>
<dd>-- pending --</dd>

</dl>


Expand All @@ -120,28 +193,36 @@
<dt>And</dt>
<dd>And evaluates the child expressions and if all of them returns true, the
And expression returns true as well.</dd>

<dt>Antecedent</dt>
<dd>The Antecedent expression is mainly included to make import from Logix
to LogixNG simple. It works exactly as Antecedent in Logix. It has a number
of child expressions and an antecedent that defines how the evaluation of the
expressions should be done. Each child expression is referenced in the
antecedent by R1, R2, R3, ..., there R1 is the first child expression, R2 is
the second child expression, and so on. Note that this differ from other
expressions in LogixNG, there other LogixNG expressions uses the socket name,
the second child expression, and so on. Note that this differs from other
expressions in LogixNG, other LogixNG expressions uses the socket name,
but since the Antecedent expression is included to work as Antecedent works
in Logix, the antecedent has been kept from Logix Antecedent as well.
<em>Note: Antecedent is included for compability with Logix but it's
recommended to use Formula instead. Formula is much more powerful, uses the
socket names and also works with numbers and strings.</em></dd>

<dt>Digital Formula</dt>
<dd>Formula is the next generation of Antecedent. It supports many operators,
like ==, !=, &lt;=, >=, &lt;, >, +, -, *, / and %. It
supports local variables, memories and functions. It supports all the types
of expressions, digital, analog and string expressions.</dd>

<dt>Not</dt>
<dd>The Not expression has one child expression and answers <strong>true</strong>
if the child expression answers <strong>false</strong>, and <strong>false</strong>
if the child expression answers <strong>true</strong>.</dd>

<dt>Or</dt>
<dd>Or evaluates the child expressions and if at least one of them returns
true, the And expression returns true as well.</dd>
true, the Or expression returns true as well.</dd>

</dl>

<h3>LocoNet</h3>
Expand All @@ -155,6 +236,15 @@

<dl>
<dt>Slot Usage</dt>
<dd>Evaluate the LocoNet slot usage.

<div style="margin-left: 2em">
<a href="images/chapter3/loconet_slot_usage.png">
<img src="images/chapter3/loconet_slot_usage.png"
alt="Chapter 3 loconet slot usage" width="962" height="505">
</a>
</div>
</dd>
</dl>

<h3>Other</h3>
Expand All @@ -168,11 +258,32 @@

<dl>
<dt>Always false</dt>
<dd>The False expression always answers <strong>false</strong>.</dd>

<dt>Always true</dt>
<dd>The True expression always answers <strong>true</strong>.</dd>

<dt>Call module</dt>
<dd>Call a module and and return its true/false response.
See <a href="chapter10.shtml">Chapter 10 - Modules</a></dd>

<dt>Hold</dt>
<dd>The Hold expression has two child expressions, one trigger expression and
one hold expression. For this expression to become <strong>true</strong>, both
the trigger expression and the hold expression must answer <strong>true</strong>.
But then it stays <strong>true</strong> as long as the hold expression stays
<strong>true</strong>.</dd>

<dt>Last result of digital expression</dt>
<dd>-- pending --</dd>

<dt>Trigger once</dt>
<dd>The TriggerOnce expression answers <strong>true</strong> one single
time and then <strong>false</strong> until JMRI is restarted. It's
designed to be used when something needs to be done exactly one time,
for example set some turnouts to a specified inital state or to set
some memories to some predefined values.</dd>

</dl>

<hr>
Expand Down
10 changes: 10 additions & 0 deletions help/en/html/tools/logixng/Tutorial/chapter5.shtml
Expand Up @@ -93,7 +93,17 @@
<dt>Sensor</dt>
<dt>Signal head</dt>
<dt>Signal mast</dt>

<dt>Throttle</dt>
<dd>The Throttle action controls a throttle. It has child expressions
for loco address, loco speed and loco direction. For now, an analog
memory expression or an analog constant expression can be used to
control the loco address and the loco speed, but once JMRI has
support for AnalogIO devices, an AnalogIO may be used to control
loco address and/or loco speed.</dd>



<dt>Turnout</dt>
<dt>Turnout, lock</dt>
<dt>Warrant</dt>
Expand Down
57 changes: 57 additions & 0 deletions help/en/html/tools/logixng/Tutorial/chapter7.shtml
Expand Up @@ -108,6 +108,63 @@

<p>Tables are described in <a href="chapter11.shtml">Chapter 11 - Tables</a>.</p>



<a name="indirect_accessing" id="indirect_accessing"></a>

<h2>Indirect adressing of NamedBeans</h2>

<p>In some cases, it may be useful to use indirect addressing of NamedBeans.</p>

<p>This can be done in two ways:</p>
<ul>
<li>Using a Memory that has the name of the NamedBean</li>
<li>Using a NamedBeanMap to lookup the name of the NamedBean</li>
</ul>

<p>Using a Memory that has the name of the NamedBean</p>

<p>Lets say we have an ActionTurnout that should throw a particulat turnout.
But we wnat to be able to select which turnout to throw at a later time.
We can solve that by storing the system name or user name in a Memory.
We then tell the ActionTurnout to read the Memory and lookup the turnout
on the fly.</p>

<p>Since LogixNG fully supports string manipulation and calculations of both
integers and floating point values, where are plenty of possibilities here.</p>

<h3>Warning</h3>

<p>There is one major drawback with this. Since LogixNG doesn't know in
advance which NamedBeans will be accessed indirectly, it's not possible
for LogixNG to automaticly register listeners to the named beans that
should trigger on change. For example, an ExpressionTurnout registers
a listener on the turnout, if the name of the turnout is given, but if
the ExpressionTurnout is using indirect addressing of the turnout, it's
not able to do that.</p>

<p>The solution is to use the ActionListenOnBeans and tell this action
which beans to listen on. Any time any property of any of the named
beans this action listen to, the ConditionalNG will be executed.</p>

<p>Example:</p>
<p>A ConditionalNG is using turnouts IT1, IT2, IT3, IT4 and IT5 in it's
expressions and wants each of them to trigger on change. Turnouts
IT1 and IT3 and IT4 are directly accessed in expressions and IT2, IT3
and IT5 is indirect accessed.</p>

<p>Each turnout that is directly addressed in an expression will the
ConditionalNG listen to automaticly, so IT1, IT3 and IT4 will be listen
to. But in order to listen on turnouts IT2 and IT5, the
ActionListenOnBeans needs to be used.</p>

<p>The ActionListenOnBeans can be placed anythere in the ConditionalNG
tree, as long as it and its parents are enabled. If you disable this
action, or any of its parent actions, the ActionListenOnBeans will not
listen on its named beans.</p>



<hr>
<p><a href="index.shtml">Return to the Tutorial TOC</a>
<span style="padding-left: 6em"><a href="chapter8.shtml">Chapter 8 - Local Variables</a></span></p>
Expand Down

0 comments on commit 65c9d15

Please sign in to comment.