How-To: Create a simple machine park view

From FactorityWiki

Jump to: navigation, search

Contents

Purpose

This How-To demonstrates how a view can be added to the FACTORITY machine park. Whereas this view provides the data comming from the WireWare interface (see references below).


Source

Machine park view (W2Demo.lzx)

 <canvas>
 
    <include href="../../factority.lzx" />
    <include href="../../wireware.lzx" />
 
    <class name="AppTest" extends="FyApplet" caption="Test">
 
      <W2Server />
 
      <W2Machine name="mymachine" w2name="Test" dataset="true">
        <W2DatapointInt name="test1" />
        <W2DatapointInt name="test2" />
        <W2DatapointBool name="test3">
          <method name="updateValue" args="valueStr">
            super.updateValue(valueStr);
            classroot.rect.setVisible(value);
          </method>
        </W2DatapointBool>
      </W2Machine>
 
      <text x="10" y="10" datapath="local:classroot.mymachine.ds:/test1/text()" />
      <text x="10" y="30" datapath="local:classroot.mymachine.ds:/test2/text()" />
      <view name="rect" x="10" y="50" width="100" height="15" bgcolor="#ffffff" />
 
    </class>
 
    <AppTest />
 
 </canvas>



Installing the sample

  • Connect to the application server using Eclipse and the AS+ Plugin
  • Create a new package named "com.factority.core.ui.floor.machinepark" in the "src" folder.
  • Place the file "W2Demo.lzx" in the new package


Running the sample

  • Log on into the partition
  • Run the file "com.factority.core.ui.floor.machinepark.W2Demo" by manually entering the name into the navigation tree.


References

Personal tools