Facility Control

 View Only
  • 1.  Lookup table in a separate file

    Posted 04-14-2020 16:33

    Hi

    I'd like to put my configuration lookup table into a separate file that multiple grid files (all on the same machine in the same folder) can access. Just means I can have 1 central file with all the IP addresses etc

    I can't see how to do this. Tried using the api tag, but none of the entries seem accessible.

    This is the table as it exists in the separate file. No other tags around the lookup tag.

    Is this even possible?

    Thanks

    Simon

    <lookup id="globalvariables" name="globalvariables">

    <entry key="CHANGETHESEVARIABLES">Change these Variables to reflect the current System (Values Below).</entry>
    <!-- CHANGEME! IP for new Carbonite -->
    <entry key="carboniteip">127.0.0.1</entry>
    <!-- CHANGEME! objectid for new Carbonite -->
    <entry key="carbonitemac">Carbonite 00:0F:9B:02:E9:11&lt;br&gt;Slot 0&lt;br&gt;Carbonite</entry>

    </lookup>


  • 2.  RE: Lookup table in a separate file

    Posted 04-14-2020 18:27

    Hi Simon

    We added a feature to help with internationalization of custom panels that will also work for what you're trying to do. You can use a standard Java properties file (key=value) to populate a lookup table in DashBoard.

    Panel:

    <abs contexttype="opengear">
    <meta>
    <lookup id="hosts" src="hosts.properties"/>
    </meta>
    <button buttontype="push" height="132" left="30" name="Send To Device 1" top="32" width="183">
    <task tasktype="rosstalk">rosstalk.sendMessage(ogscript.getPrivateString('hosts', 'My_Device.host'), parseInt(ogscript.getPrivateString('hosts', 'My_Device.port')), 'SEQI 12:1');</task>
    </button>
    <button buttontype="push" height="132" left="225" name="Send To Device 2" top="31" width="183">
    <task tasktype="rosstalk">rosstalk.sendMessage(ogscript.getPrivateString('hosts', 'My_Other_Device.host'), parseInt(ogscript.getPrivateString('hosts', 'My_Other_Device.port')), 'SEQO 4');</task>
    </button>
    </abs>

    Properties ("hosts.properties"):

    My_Device.host=blah
    My_Device.port=1234
    My_Other_Device.host=BLAHBLAH
    My_Other_Device.port=4321

    Cheers

    James


    #DashBoard


  • 3.  RE: Lookup table in a separate file

    Posted 04-15-2020 10:11

    That works a treat!

    Thank you


    #DashBoard