Skip to content
Snippets Groups Projects
operatorpanels.html 5.67 KiB
Newer Older
  • Learn to ignore specific revisions
  • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    
    <!--
     Documentation of Operator Panels.
     
     @author doebber
     @ConQAT.Rating GREEN Hash: 1AD0DACCFE1952099B4C434F3D2F9138
    -->
     
    <html>
    <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    	<title>OperatorPanels in AutoFOCUS3 (AF3)</title>
    </head>
    <body>
    
    <h2><u><font color="#336699">Interaction with the Environment</font></u></h2>
    
    <h4><font color="#336699">Creating an Operator Panel Specification</font></h4>
    
    In order to create an Operator Panel you first have to create an appropriate component to contain it. 
    In most cases it is ideal to create the enclosing component next to your actual model and then connect this component's outputs to your model's inputs and vice versa.
    
    <br>
    <br>
    <img src ="./pictures/op-compcreation.png">
    <br>
    <br>
    
    Afterwards right click on the newly created component in the model tree on the left and add an "Operator Panel".
    <br>
    <br>
    <img src ="./pictures/op-speccreation.png">
    <br>
    <br>
    
    <h4><font color="#336699">Populating the Operator Panel with items</font></h4>
    
    Once you have added an operator panel to your component and opened it, you may drag & drop an item from the Model Elements View on the right.
    Place and size the items to your needs and use labels to annotate your widgets. Aside from buttons these will be the only text displayed later during simulation. 
    <br>
    <br>
    There are two type of operator panel items:
    <br>
    <UL>
    <LI><i>Input Operator Panel Items:</i> These items display data that is input data to the enclosing component, which in general is output data from your model.
    <LI><i>Output Operator Panel Items:</i> These items create output from the enclosing component that can be input to your model.
    </UL>
    
    
    <h4><font color="#336699">Push Button</font></h4>
    <img src ="./pictures/op-pushbtneditor.png">
    &nbsp;
    <img src ="./pictures/op-pushbtnsim.png">
    <br>
    <br>
    In the property section you can enter the text displayed on the button using the comments text field. More importantly you can enter one or multiple outputs to be performed
    upon button selection. In all other times the output assigned will be <code>NoVal</code>.
    
    <h4><font color="#336699">Toggle Button</font></h4>
    <img src ="./pictures/op-togglebtneditor.png">
    &nbsp;
    <img src ="./pictures/op-togglebtnsim.png">
    <br>
    <br>
    The property section of the toggle button allows entering two output patterns which are performed on selection or deselection respectiveley.
    <br>
     The state behavior flag unchecked causes 
    these outputs to be performed only once upon de-/selection and in all other times <code>NoVal</code> will be assigned. If the state behavior is checked the appropriate output is held until
    the user toggles the button and the other pattern is performed and held.
    
    <h4><font color="#336699">Term Input</font></h4>
    <img src ="./pictures/op-iterminputeditor.png">
    &nbsp;
    <img src ="./pictures/op-iterminputsim.png">
    <br>
    <br>
    The term input item offers a text field to specify input during simulation.
    The user's input is evaluated as an expression term, e.g., Present() or 5, and assigned as an output port value.
    The type of the expression and the output pattern are specified when defining the item in the operator panel editor.
    The variable <code>_this</code> holds the value of the text field and can be assigned the port directly
    or as part of a more complex output pattern. 
    <br>
    <br>
    Say the specified type is <code>int</code> then the following output pattern would be possible:
    <br>
    <code>port1 = _this; port2 = _this * 2; port3 = _this / 3</code> 
    
    <h4><font color="#336699">Color Display</font></h4>
    <img src ="./pictures/op-colordisplayeditor.png">
    &nbsp;
    <img src ="./pictures/op-colordisplaysim.png">
    <br>
    <br>
    This item allows you to assign colors to certain input patterns. Switch to the <i>Reactions</i> tab inside the property section and add lines by clicking the Add button.
    In the guards column you can specify the input pattern and in the color column you can open the system color picker.
    <br>
    Use the Up and Down buttons to rearrange multiple rows as the input patterns are evaluated top down and the first matching pattern's color will be displayed.
    
    <h4><font color="#336699">Text Display</font></h4>
    <img src ="./pictures/op-textdisplayeditor.png">
    &nbsp;
    <img src ="./pictures/op-textdisplaysim.png">
    <br>
    <br>
    This item allows you to textually display output data. Multiple patterns can be entered using the Reactions tab in the property section and again mind the order of your patterns as they will 
    be evaluated top down.
    <br>
    For simply displaying a port's value leave blank the guard column and enter the port's name in the Item input column.
    <br>
    But more complex assignments - even taking multiple ports into account - are possible as well. For a port of type <code>int</code> the following set of guards and item inputs would be possible:
    <br>
    <table>
    <tr>
    <td><i>Guard</i></td>
    <td> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </td>
    <td><i>Item input</i></td>
    </tr>
    <tr>
    <td>port >0 && port < 10</td>
    <td> &nbsp; </td>
    <td>port</td>
    </tr>
    <tr>
    <td>port >= 10 && port < 100</td>
    <td> &nbsp; </td>
    <td>port / 10</td>
    </tr>
    <tr>
    <td>port >= 100 && port < 1000</td>
    <td> &nbsp; </td>
    <td>port / 100</td>
    </tr>
    </table> 
    
    <h4><font color="#336699">Using the Operator Panel in a simulation</font></h4>
    
    Switch to a new simulation and unfold the tree until you see the enclosing component with the operator panel icon. You can either double click or use the context menu to open the operator panel.
    
    <br>
    <br>
    <img src ="./pictures/op-opensimview.png">
    <br>
    <br>
    
    Now you can either run or step through your simulation, alter your model's inputs and observe its behavior.
    <br>
    <br>
    <img src ="./pictures/op-simview.png">
    <br>
    <br>
    
    
    
    </body>
    </html>