Facility Control

 View Only
Expand all | Collapse all

Nk Router and Dashboard

  • 1.  Nk Router and Dashboard

    Posted 03-27-2017 20:29
    I am looking to create custom panels for the NK router using dashboard and am struggling to find any information on this in comparison to the carbonite which had lots of info. Has anyone had any luck doing anything similar that they would mind me having a look at?

    Im just trying to create basic switch panels!


  • 2.  RE: Nk Router and Dashboard

    Posted 03-28-2017 13:02

    Hi Kai.
    There are a few tricks involved with NK Router Custom Panels but we can probably get you going.

    Here is an example of custom panel that performs a number of different switch commands on the selected router using the nk.doSwitch command.

    The NK scripting object is only available within an NK Custom Panel or a part of a panel specified as an "nk-router" context type (you'll see that happening in the top line of the example)

    <abs contexttype="nk-router" objectid="YOU CAN SPECIFY AN IPS SERIAL HERE">
       <simplegrid height="71" left="9" rows="1" style="bg#dark;bdr:etched;" top="12" width="687">
          <ipslist style="style:toggleButton;"/>
          <nkfunction function="config"/>
       </simplegrid>
       <button buttontype="push" height="54" left="8" name="Run Switch Commands" top="83" width="695">
          <task tasktype="nk">nk.doSwitch(0, 15, 1);</task>
          <task tasktype="pause">500</task>
          <task tasktype="nk">nk.doSwitch(1, 14, 1);</task>
          <task tasktype="nk">nk.doSwitch(2, 13, 1);</task>
          <task tasktype="pause">500</task>
          <task tasktype="nk">nk.doSwitch(3, 12, 1);</task>
          <task tasktype="pause">500</task>
          <task tasktype="nk">nk.doSwitch(4, 11, 1);</task>
          <task tasktype="pause">500</task>
          <task tasktype="nk">nk.doSwitch(5, 10, 1);</task>
          <task tasktype="pause">500</task>
          <task tasktype="nk">nk.doSwitch(6, 9, 1);</task>
          <task tasktype="pause">500</task>
          <task tasktype="nk">nk.doSwitch(7, 8, 1);</task>
          <task tasktype="pause">500</task>
          <task tasktype="nk">nk.doSwitch(8, 7, 1);</task>
          <task tasktype="pause">500</task>
          <task tasktype="nk">nk.doSwitch(9, 6, 1);</task>
          <task tasktype="pause">500</task>
          <task tasktype="nk">nk.doSwitch(10, 5, 1);</task>
          <task tasktype="pause">500</task>
          <task tasktype="nk">nk.doSwitch(11, 4, 1);</task>
          <task tasktype="pause">500</task>
          <task tasktype="nk">nk.doSwitch(12, 3, 1);</task>
          <task tasktype="pause">500</task>
          <task tasktype="nk">nk.doSwitch(13, 2, 1);</task>
          <task tasktype="pause">500</task>
          <task tasktype="nk">nk.doSwitch(14, 1, 1);</task>
          <task tasktype="pause">500</task>
          <task tasktype="nk">nk.doSwitch(15, 0, 1);</task>
       </button>
       <lvlstatus dst="all" height="467" left="9" scroll="vertical" showlabel="true" style="font:mono;size:small;bg#efffbe;fg#000000;t:bg#c8d5a0;t:fg#000000;" top="139" width="693"/>
    </abs>

    You can embed a context/component like this inside of another non-NK Custom Panel to gain access to other regular Custom Panel features like parameters.

    Take a look at the code in the example and see if that moves you closer to what you're trying to do. If you want any clarification on anything that is being done or have specific questions, we can continue to help you along in your project.

    Cheers.

    James


    #DashBoard


  • 3.  RE: Nk Router and Dashboard

    Posted 12-25-2017 03:54
    Dear James, could you please help us with a video tutorial in Dashboard to build a virtual control panel for basic switching? We are using NK-D16-75 router. Thank you so much!
    #DashBoard


  • 4.  RE: Nk Router and Dashboard

    Posted 12-28-2017 16:48
    We are currently working to revise and add to our selection of video tutorials. I don't currently have one I can point you towards for controlling an NK router but, in the meantime, I am happy to answer any questions you might have. I can also let you know when a video becomes available.

    James
    #DashBoard


  • 5.  RE: Nk Router and Dashboard

    Posted 12-29-2017 08:19
    Dear James,

    Thank you for your reply!
    My first question is how can I use your above code? I am new fish to Dashboard and Ross products!
    #DashBoard


  • 6.  RE: Nk Router and Dashboard

    Posted 01-02-2018 15:08



    If you create a new Custom Panel, you can open it in edit mode, double-click anywhere in the custom panel, and select the "source" tab at the top to paste-in the example code.

     


    #DashBoard


  • 7.  RE: Nk Router and Dashboard

    Posted 01-03-2018 03:16
    Thank you James! That's great!
    #DashBoard


  • 8.  RE: Nk Router and Dashboard

    Posted 01-08-2018 13:07
    Hi James,

    I was just wondering about the syntax of the nk.doSwitch statement. Do the variables contained in this follow the pattern nk.doSwitch(output, vidinput, audioinput) and if this is the case if i just want to work in the SDI and embedded domain do I need to specify anything different?

    Thanks,
    Kai
    #DashBoard


  • 9.  RE: Nk Router and Dashboard

    Posted 01-08-2018 20:47
    Hi KaiB.
    The signature is nk.doSwitch(output, input, levelMask); Where levelMask is a 32-bit bit field.
    Level 1: 1 : 0000 0000 0000 0000 0000 0000 0000 0001
    Level 2: 2 : 0000 0000 0000 0000 0000 0000 0000 0010
    Level 1 & 2: 3 : 0000 0000 0000 0000 0000 0000 0000 0011
    Level 3: 4 : 0000 0000 0000 0000 0000 0000 0000 0100
    ...

    Alternatively, you can also use nk.doSwitchWithLabels(outputName, inputName, levelName);

    James
    #DashBoard


  • 10.  RE: Nk Router and Dashboard

    Posted 01-09-2018 15:01

    Hi James,

    does this have to be done from an nk custom panel or can i use the tcp string control function to allow me to use parameters?

    Currently my panel is based around the idea that I could use:

    <button buttontype="push" height="64" id="TAKE" left="797" name="TAKE" top="552" width="150">
          <task tasktype="ogscript">
    rosstalk.sendMessage("param_DESTNK IP ADDRESS", "TBC", "nk.doSwitch(param_DESTDestination, param_DESTSource, 1)", null);
    </task>
       </button>

    With other buttons that set the destination and source parameters?

    I don't have access to an NK right now but was hoping this would work?


    #DashBoard


  • 11.  RE: Nk Router and Dashboard

    Posted 01-09-2018 15:19
    Hi KaiB.
    Currently, the only way to send NK commands is from within an NK Custom Panel.

    You can combine the 2 panel types (NK and "opengear") to get parameters you can access inside of your nk.doSwitch code by embedding the NK context inside of the openGear context.

    I have an example of embedding the 2 contexts in this post:
    https://discussions.rossvideo.com/forum/default-forum-gc1/dashboard-gc43/14557-dashboard-webcontrol

    Cheers.

    James
    #DashBoard


  • 12.  RE: Nk Router and Dashboard

    Posted 01-09-2018 17:45

    Hi James,

    Im trying to make sense of this and it is going straight over my head at the moment.

    If I create an NK panel I can still create parameters using OG and declaring these

    <params>
             <param access="1" constrainttype="INT_NULL" name="Source" oid="0x2" precision="0" stateless="true" type="INT16" value="1" widget="default"/>
             <param access="1" constrainttype="INT_NULL" name="Destination" oid="0x3" precision="0" stateless="true" type="INT16" value="1" widget="default"/>
          </params>

    Then buttons to set these parameters to numbers and then from this a separate button with

    <task tasktype="nk">nk.doSwitch(param_DESTDestination, param_DESTSource, 1);</task>

    although I think i have to use the OID's for these instead of names?

    Thanks,
    Kai


    #DashBoard


  • 13.  RE: Nk Router and Dashboard

    Posted 01-09-2018 18:12

    Hi Kai.
    Here is an example panel that uses a "Destination" and "Source" parameter.

    <abs contexttype="opengear" virtualheight="914" virtualwidth="1408">
       <meta>
          <params>
             <param access="1" constraint="0.0;100.0;0.0;100.0;1" constrainttype="INT_STEP_RANGE" name="Dest" oid="Dest" precision="0" type="INT32" value="0" widget="spinner"/>
             <param access="1" constraint="0.0;100.0;0.0;100.0;1" constrainttype="INT_STEP_RANGE" name="Source" oid="Source" precision="0" type="INT32" value="0" widget="spinner"/>
          </params>
       </meta>
       <abs bottom="0" contexttype="nk-router" left="0" right="0" top="0" virtualheight="914" virtualwidth="1408">
          <simplegrid height="83" left="2" right="8" rows="1" top="4">
             <ipslist/>
          </simplegrid>
          <lvlstatus dst="all" height="732" left="843" right="8" scroll="vertical" showlabel="true" style="font:mono;size:small;bg#efffbe;fg#000000;t:bg#c8d5a0;t:fg#000000;" top="88"/>
          <label height="33" left="16" name="Destination: " style="txt-align:east" top="98" width="110"/>
          <label height="33" left="16" name="Source: " style="txt-align:east;" top="147" width="110"/>
          <param expand="true" height="47" left="133" oid="Dest" top="94" width="122"/>
          <param expand="true" height="45" left="133" oid="Source" top="149" width="123"/>
          <button buttontype="push" height="104" left="267" name="Go!" top="94" width="123">
             <task tasktype="ogscript">nk.doSwitch(params.getValue('Dest', 0), params.getValue('Source', 0), 1);</task>
          </button>
       </abs>
    </abs>

    Your code was close, you just needed to get the parameter value:

    <task tasktype="ogscript">nk.doSwitch(params.getValue('Dest', 0), params.getValue('Source', 0), 1);</task>

    James


    #DashBoard