Facility Control

 View Only
  • 1.  Accessing Dashboard Custom Controls Using Python

    Posted 06-24-2019 20:23

    Hi There,

    I have built an application in Python that receives SERCOM strings in ASCII using the 'sockets' module... Essentially taking an ASCII string from an Automation playlist.. I would like to know how I would go about passing these strings to dashboard?

     

    The strings would be received 'as is' per Dashboard's Rosstalk protocol,

    e.i. "RossTalk: CC [bcc] (BankCC 101) on Graphite"

    Any thoughts on the best way to do this...?

     



  • 2.  RE: Accessing Dashboard Custom Controls Using Python

    Posted 06-24-2019 21:02

    Hi Joshua.

    If they are similar to the RossTalk strings, then they are terminated by a linefeed, right?

    If so, you can use a <listener/> tag in a CustomPanel and set the message delimiter to newline.  Inside the task for your listener, you would gain access to your string with:

    if (event.isMessageEvent())
    {
    var str = event.getBytesAsString();
    ogscript.debug("GOT: " + str); //just to write it to the "openGear Debug Information View" for testing
    }

    #DashBoard


  • 3.  RE: Accessing Dashboard Custom Controls Using Python

    Posted 06-25-2019 11:43

    Hi James, thanks for the response. 

    I should have prefaced my initial comment with 'I am relatively new to Dashboard...' In the past I have created CustomPanels in Dashboard with custom 'buttons' which invoke already built 'Custom Controls' - So really nothing too complex...This is my first crack at building an external application (in Python) that will do what my custom buttons have done in the past but without manual intervention, ie. An Operator physically interacting with the CustomPanel. Rather the RossTalk strings are sent from a Master Control automation list (via SERCOM) to my application, which will live locally on a Ross Graphite.

    Based on what you have stated, I need to create a new CustomPanel (.grid file) within Dashboard and then use the <listener/>tag somewhere... Where in my CustomPanel am I doing this? My experience with Dashboard limits my knowledge to just building 'buttons' in CustomPanels...Thanks in advance for you help and patience...

     


    #DashBoard


  • 4.  RE: Accessing Dashboard Custom Controls Using Python

    Posted 06-28-2019 19:54

    Hi Joshua.

    Yes, you would want to do this with a new custom panel. Once you create the panel and go into "Edit Mode", you'll want to double-click anywhere in the panel to go into the source editor. At the top of the tree on the left of the editor, you'll see a small toolbar for inserting "non-UI tags" - one of these options is the <listener/>.

    Once you click on the <listener/>, you'll have the option to configure different options for it such as whether it runs as a server or connects as a client, what your message delimiter is, whether the listener should automatically start, etc.

    You can find a reference for the tag in the "OGLML Reference" section of the DashBoard User Guide.

    Cheers.

    James


    #DashBoard


  • 5.  RE: Accessing Dashboard Custom Controls Using Python

    Posted 07-04-2019 13:13

    Hi James,

    I am able to pass a UTF-8 encoded string using a custom panel by way of the listener non-UI tag. I have set this as a 'UDP listener'.

    That being said once the panel has received this string how do I get it to invoke a custom control? The strings would be received in the 'Ross Talk' format for invoking custom controls, ie. "RossTalk: CC [bcc] (BankCC 101) on Graphite"

    Thoughts?...


    #DashBoard


  • 6.  RE: Accessing Dashboard Custom Controls Using Python

    Posted 07-04-2019 20:01

    Hi Joshua.

    Your easiest method would be to use rosstalk.sendMessage('host', port, message, callback);

    If you have a prefix on your incoming message, you'd need to strip it off using str.substring(...) (the standard JavaScript substring function)

    James


    #DashBoard


  • 7.  RE: Accessing Dashboard Custom Controls Using Python

    Posted 07-09-2019 11:52

    Hey James,

    Thanks for the direction. I actually just ended up issuing the command for the custom control directly via Rosstalk port 7788.

    Cheers and thanks again for all the help.

    Joshua


    #DashBoard