Guest User

Protocol

a guest
Apr 5th, 2022
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 26.54 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3.  
  4. ****************************************************************************
  5. *  Copyright (c) 2022,  Skyline Communications NV  All Rights Reserved.    *
  6. ****************************************************************************
  7.  
  8. By using this driver, you expressly agree with the usage terms and
  9. conditions set out below.
  10. This driver and all related materials are protected by copyrights and
  11. other intellectual property rights that exclusively belong
  12. to Skyline Communications.
  13.  
  14. A user license granted for this driver is strictly for personal use only.
  15. This driver may not be used in any way by anyone without the prior
  16. written consent of Skyline Communications. Any sublicensing of this
  17. driver is forbidden.
  18.  
  19. Any modifications to this driver by the user are only allowed for
  20. personal use and within the intended purpose of the driver,
  21. and will remain the sole responsibility of the user.
  22. Skyline Communications will not be responsible for any damages or
  23. malfunctions whatsoever of the driver resulting from a modification
  24. or adaptation by the user.
  25.  
  26. The content of this driver is confidential information.
  27. The user hereby agrees to keep this confidential information strictly
  28. secret and confidential and not to disclose or reveal it, in whole
  29. or in part, directly or indirectly to any person, entity, organization
  30. or administration without the prior written consent of
  31. Skyline Communications.
  32.  
  33. Any inquiries can be addressed to:
  34.  
  35.     Skyline Communications NV
  36.     Ambachtenstraat 33
  37.     B-8870 Izegem
  38.     Belgium
  39.     Tel.    : +32 51 31 35 69
  40.     Fax.    : +32 51 31 01 29
  41.     E-mail  : info@skyline.be
  42.     Web     : www.skyline.be
  43.     Contact : Ben Vandenberghe
  44.  
  45. -->
  46. <Protocol xmlns="http://www.skyline.be/protocol">
  47.     <Name>LiveBoothBoxConnections</Name>
  48.     <Description>Connects boxes and live booths</Description>
  49.     <Version>0.0.0.3</Version>
  50.     <IntegrationID>DMS-DRV-0100</IntegrationID>
  51.     <Provider>A</Provider>
  52.     <Vendor>A</Vendor>
  53.     <VendorOID>1.3.6.1.4.1.8813.2.00</VendorOID>
  54.     <DeviceOID>00</DeviceOID>
  55.     <ElementType>Virtual Router</ElementType>
  56.     <Type relativeTimers="true">virtual</Type>
  57.     <Display defaultPage="General" pageOrder="General" wideColumnPages=""/>
  58.     <SNMP includepages="true">auto</SNMP>
  59.     <Params>
  60.         <Param id="2">
  61.             <Name>AfterStartup</Name>
  62.             <Description>After Startup</Description>
  63.             <Type>dummy</Type>
  64.         </Param>
  65.         <Param id="100">
  66.             <Name>liveBooths</Name>
  67.             <Description>Live Booths</Description>
  68.             <Type>array</Type>
  69.             <ArrayOptions index="0" options="naming=/102">
  70.                 <ColumnOption idx="0" pid="101" type="custom" options=""/>
  71.                 <ColumnOption idx="1" pid="102" type="custom" options=";save"/>
  72.                 <ColumnOption idx="2" pid="103" type="custom" options=";save"/>
  73.                 <ColumnOption idx="3" pid="104" type="custom" options=";save"/>
  74.                 <ColumnOption idx="4" pid="105" type="custom" options=";save"/>
  75.                 <ColumnOption idx="5" pid="106" type="custom" options=";save"/>
  76.                 <ColumnOption idx="6" pid="107" type="custom" options=";save"/>
  77.                 <ColumnOption idx="7" pid="108" type="custom" options=";save"/>
  78.             </ArrayOptions>
  79.             <Display>
  80.                 <RTDisplay>true</RTDisplay>
  81.                 <Positions>
  82.                     <Position>
  83.                         <Page>General</Page>
  84.                         <Column>0</Column>
  85.                         <Row>1</Row>
  86.                     </Position>
  87.                 </Positions>
  88.             </Display>
  89.             <Measurement>
  90.                 <Type options="tab=columns:101|0-102|1-103|2-104|3-105|4-106|5-107|6-108|7,width:109-148-100-100-100-100-100-100,sort:STRING-STRING|ASC-STRING-STRING-STRING-STRING-INT-INT,lines:0,filter:true">table</Type>
  91.             </Measurement>
  92.         </Param>
  93.         <Param id="101" trending="false">
  94.             <Name>liveBoothsBoothID</Name>
  95.             <Description>Live Booth ID</Description>
  96.             <Type>read</Type>
  97.             <Information>
  98.             </Information>
  99.             <Interprete>
  100.                 <RawType>other</RawType>
  101.                 <Type>string</Type>
  102.                 <LengthType>next param</LengthType>
  103.             </Interprete>
  104.             <Display>
  105.                 <RTDisplay>true</RTDisplay>
  106.             </Display>
  107.             <Measurement>
  108.                 <Type>number</Type>
  109.             </Measurement>
  110.         </Param>
  111.         <Param id="102" trending="false">
  112.             <Name>liveBoothsName</Name>
  113.             <Description>Live Booth Name [IDX]</Description>
  114.             <Type>read</Type>
  115.             <Information>
  116.             </Information>
  117.             <Interprete>
  118.                 <RawType>other</RawType>
  119.                 <Type>string</Type>
  120.                 <LengthType>next param</LengthType>
  121.             </Interprete>
  122.             <Display>
  123.                 <RTDisplay>true</RTDisplay>
  124.             </Display>
  125.             <Measurement>
  126.                 <Type>string</Type>
  127.             </Measurement>
  128.         </Param>
  129.         <Param id="103" trending="false">
  130.             <Name>liveBoothsDisplayName</Name>
  131.             <Description>Display Name</Description>
  132.             <Type>read</Type>
  133.             <Information>
  134.             </Information>
  135.             <Interprete>
  136.                 <RawType>other</RawType>
  137.                 <Type>string</Type>
  138.                 <LengthType>next param</LengthType>
  139.             </Interprete>
  140.             <Display>
  141.                 <RTDisplay>true</RTDisplay>
  142.             </Display>
  143.             <Measurement>
  144.                 <Type>string</Type>
  145.             </Measurement>
  146.         </Param>
  147.         <Param id="104" trending="false">
  148.             <Name>liveBoothsSources</Name>
  149.             <Description>Sources</Description>
  150.             <Type>read</Type>
  151.             <Information>
  152.             </Information>
  153.             <Interprete>
  154.                 <RawType>other</RawType>
  155.                 <Type>string</Type>
  156.                 <LengthType>next param</LengthType>
  157.             </Interprete>
  158.             <Display>
  159.                 <RTDisplay>true</RTDisplay>
  160.             </Display>
  161.             <Measurement>
  162.                 <Type>string</Type>
  163.             </Measurement>
  164.         </Param>
  165.         <Param id="204" setter="true">
  166.             <Name>liveBoothsSources</Name>
  167.             <Description>Sources</Description>
  168.             <Type>write</Type>
  169.             <Interprete>
  170.                 <RawType>other</RawType>
  171.                 <Type>string</Type>
  172.                 <LengthType>next param</LengthType>
  173.             </Interprete>
  174.             <Display>
  175.                 <RTDisplay>true</RTDisplay>
  176.             </Display>
  177.             <Measurement>
  178.                 <Type>string</Type>
  179.             </Measurement>
  180.         </Param>
  181.         <Param id="105" trending="false">
  182.             <Name>liveBoothsDestinations</Name>
  183.             <Description>Destinations</Description>
  184.             <Type>read</Type>
  185.             <Information>
  186.             </Information>
  187.             <Interprete>
  188.                 <RawType>other</RawType>
  189.                 <Type>string</Type>
  190.                 <LengthType>next param</LengthType>
  191.             </Interprete>
  192.             <Display>
  193.                 <RTDisplay>true</RTDisplay>
  194.             </Display>
  195.             <Measurement>
  196.                 <Type>string</Type>
  197.             </Measurement>
  198.         </Param>
  199.         <Param id="106" trending="false">
  200.             <Name>liveBoothsPip</Name>
  201.             <Description>PIP</Description>
  202.             <Type>read</Type>
  203.             <Information>
  204.                 <Includes>
  205.                     <Include>units</Include>
  206.                     <Include>steps</Include>
  207.                 </Includes>
  208.             </Information>
  209.             <Interprete>
  210.                 <RawType>numeric text</RawType>
  211.                 <Type>double</Type>
  212.                 <LengthType>next param</LengthType>
  213.             </Interprete>
  214.             <Display>
  215.                 <RTDisplay>true</RTDisplay>
  216.             </Display>
  217.             <Measurement>
  218.                 <Type>number</Type>
  219.             </Measurement>
  220.         </Param>
  221.         <Param id="107" trending="false">
  222.             <Name>liveBoothsMix</Name>
  223.             <Description>Mix</Description>
  224.             <Type>read</Type>
  225.             <Information>
  226.             </Information>
  227.             <Interprete>
  228.                 <RawType>numeric text</RawType>
  229.                 <Type>double</Type>
  230.                 <LengthType>next param</LengthType>
  231.             </Interprete>
  232.             <Display>
  233.                 <RTDisplay>true</RTDisplay>
  234.             </Display>
  235.             <Measurement>
  236.                 <Type>number</Type>
  237.             </Measurement>
  238.         </Param>
  239.         <Param id="108" trending="false">
  240.             <Name>liveBoothsLogo</Name>
  241.             <Description>Logo</Description>
  242.             <Type>read</Type>
  243.             <Information>
  244.             </Information>
  245.             <Interprete>
  246.                 <RawType>numeric text</RawType>
  247.                 <Type>double</Type>
  248.                 <LengthType>next param</LengthType>
  249.             </Interprete>
  250.             <Display>
  251.                 <RTDisplay>true</RTDisplay>
  252.             </Display>
  253.             <Measurement>
  254.                 <Type>number</Type>
  255.             </Measurement>
  256.         </Param>
  257.         <Param id="208" setter="true">
  258.             <Name>liveBoothsLogo</Name>
  259.             <Description>Logo</Description>
  260.             <Type>write</Type>
  261.             <Interprete>
  262.                 <RawType>numeric text</RawType>
  263.                 <Type>double</Type>
  264.                 <LengthType>next param</LengthType>
  265.             </Interprete>
  266.             <Display>
  267.                 <RTDisplay>true</RTDisplay>
  268.             </Display>
  269.             <Measurement>
  270.                 <Type>number</Type>
  271.             </Measurement>
  272.         </Param>
  273.         <Param id="207" setter="true">
  274.             <Name>liveBoothsMix</Name>
  275.             <Description>Mix</Description>
  276.             <Type>write</Type>
  277.             <Interprete>
  278.                 <RawType>numeric text</RawType>
  279.                 <Type>double</Type>
  280.                 <LengthType>next param</LengthType>
  281.             </Interprete>
  282.             <Display>
  283.                 <RTDisplay>true</RTDisplay>
  284.             </Display>
  285.             <Measurement>
  286.                 <Type>number</Type>
  287.             </Measurement>
  288.         </Param>
  289.         <Param id="206" setter="true">
  290.             <Name>liveBoothsPip</Name>
  291.             <Description>PIP</Description>
  292.             <Type>write</Type>
  293.             <Interprete>
  294.                 <RawType>numeric text</RawType>
  295.                 <Type>double</Type>
  296.                 <LengthType>next param</LengthType>
  297.             </Interprete>
  298.             <Display>
  299.                 <RTDisplay>true</RTDisplay>
  300.             </Display>
  301.             <Measurement>
  302.                 <Type>number</Type>
  303.             </Measurement>
  304.         </Param>
  305.         <Param id="205" setter="true">
  306.             <Name>liveBoothsDestinations</Name>
  307.             <Description>Destinations</Description>
  308.             <Type>write</Type>
  309.             <Interprete>
  310.                 <RawType>other</RawType>
  311.                 <Type>string</Type>
  312.                 <LengthType>next param</LengthType>
  313.             </Interprete>
  314.             <Display>
  315.                 <RTDisplay>true</RTDisplay>
  316.             </Display>
  317.             <Measurement>
  318.                 <Type>string</Type>
  319.             </Measurement>
  320.         </Param>
  321.         <Param id="203" setter="true">
  322.             <Name>liveBoothsDisplayName</Name>
  323.             <Description>Display Name</Description>
  324.             <Type>write</Type>
  325.             <Interprete>
  326.                 <RawType>other</RawType>
  327.                 <Type>string</Type>
  328.                 <LengthType>next param</LengthType>
  329.             </Interprete>
  330.             <Display>
  331.                 <RTDisplay>true</RTDisplay>
  332.             </Display>
  333.             <Measurement>
  334.                 <Type>string</Type>
  335.             </Measurement>
  336.         </Param>
  337.         <Param id="202" setter="true">
  338.             <Name>liveBoothsName</Name>
  339.             <Description>Live Booth Name [IDX]</Description>
  340.             <Type>write</Type>
  341.             <Interprete>
  342.                 <RawType>other</RawType>
  343.                 <Type>string</Type>
  344.                 <LengthType>next param</LengthType>
  345.             </Interprete>
  346.             <Display>
  347.                 <RTDisplay>true</RTDisplay>
  348.             </Display>
  349.             <Measurement>
  350.                 <Type>string</Type>
  351.             </Measurement>
  352.         </Param>
  353.         <Param id="110">
  354.             <Name>liveBoxes</Name>
  355.             <Description>Commentators Boxes</Description>
  356.             <Type>array</Type>
  357.             <ArrayOptions index="0" options="naming=/112">
  358.                 <ColumnOption idx="0" pid="111" type="autoincrement" options=""/>
  359.                 <ColumnOption idx="1" pid="112" type="retrieved" options=";save"/>
  360.                 <ColumnOption idx="2" pid="113" type="retrieved" options=";save"/>
  361.                 <ColumnOption idx="3" pid="114" type="retrieved" options=";save"/>
  362.             </ArrayOptions>
  363.             <Measurement>
  364.                 <Type options="tab=columns:111|0-112|1-113|2-114|3,width:71-124-127-123,sort:INT-STRING|ASC-INT-STRING,lines:0,filter:true">table</Type>
  365.             </Measurement>
  366.             <Display>
  367.                 <RTDisplay>true</RTDisplay>
  368.                 <Positions>
  369.                     <Position>
  370.                         <Page>General</Page>
  371.                         <Column>1</Column>
  372.                         <Row>1</Row>
  373.                     </Position>
  374.                 </Positions>
  375.             </Display>
  376.         </Param>
  377.         <Param id="111" trending="false">
  378.             <Name>liveBoxesID</Name>
  379.             <Description>Box ID</Description>
  380.             <Type>read</Type>
  381.             <Information>
  382.                 <Subtext>Box primary key</Subtext>
  383.             </Information>
  384.             <Interprete>
  385.                 <RawType>other</RawType>
  386.                 <Type>string</Type>
  387.                 <LengthType>next param</LengthType>
  388.             </Interprete>
  389.             <Display>
  390.                 <RTDisplay>true</RTDisplay>
  391.             </Display>
  392.             <Measurement>
  393.                 <Type>number</Type>
  394.             </Measurement>
  395.         </Param>
  396.         <Param id="112" trending="false">
  397.             <Name>liveBoxesName</Name>
  398.             <Description>Box Name [IDX]</Description>
  399.             <Type>read</Type>
  400.             <Information>
  401.                 <Subtext>Box Name</Subtext>
  402.             </Information>
  403.             <Interprete>
  404.                 <RawType>other</RawType>
  405.                 <Type>string</Type>
  406.                 <LengthType>next param</LengthType>
  407.             </Interprete>
  408.             <Display>
  409.                 <RTDisplay>true</RTDisplay>
  410.             </Display>
  411.             <Measurement>
  412.                 <Type>string</Type>
  413.             </Measurement>
  414.         </Param>
  415.         <Param id="113" trending="false">
  416.             <Name>liveBoxesConnectedBooth</Name>
  417.             <Description>Connected Live Booth</Description>
  418.             <Type>read</Type>
  419.             <Information>
  420.             </Information>
  421.             <Interprete>
  422.                 <RawType>other</RawType>
  423.                 <Type>string</Type>
  424.                 <LengthType>next param</LengthType>
  425.             </Interprete>
  426.             <Display>
  427.                 <RTDisplay>true</RTDisplay>
  428.             </Display>
  429.             <Measurement>
  430.                 <Type>number</Type>
  431.             </Measurement>
  432.         </Param>
  433.         <Param id="114" trending="false">
  434.             <Name>liveBoxesMonitors</Name>
  435.             <Description>Monitor Destinations</Description>
  436.             <Type>read</Type>
  437.             <Information>
  438.             </Information>
  439.             <Interprete>
  440.                 <RawType>other</RawType>
  441.                 <Type>string</Type>
  442.                 <LengthType>next param</LengthType>
  443.             </Interprete>
  444.             <Display>
  445.                 <RTDisplay>true</RTDisplay>
  446.             </Display>
  447.             <Measurement>
  448.                 <Type>string</Type>
  449.             </Measurement>
  450.         </Param>
  451.         <Param id="214" setter="true">
  452.             <Name>liveBoxesMonitors</Name>
  453.             <Description>Monitor Destinations</Description>
  454.             <Type>write</Type>
  455.             <Interprete>
  456.                 <RawType>other</RawType>
  457.                 <Type>string</Type>
  458.                 <LengthType>next param</LengthType>
  459.             </Interprete>
  460.             <Display>
  461.                 <RTDisplay>true</RTDisplay>
  462.             </Display>
  463.             <Measurement>
  464.                 <Type>string</Type>
  465.             </Measurement>
  466.         </Param>
  467.         <Param id="213" setter="true">
  468.             <Name>liveBoxesConnectedBooth</Name>
  469.             <Description>Connected Live Booth</Description>
  470.             <Type>write</Type>
  471.             <Interprete>
  472.                 <RawType>other</RawType>
  473.                 <Type>string</Type>
  474.                 <LengthType>next param</LengthType>
  475.             </Interprete>
  476.             <Display>
  477.                 <RTDisplay>true</RTDisplay>
  478.             </Display>
  479.             <Measurement>
  480.                 <Type>number</Type>
  481.             </Measurement>
  482.         </Param>
  483.         <Param id="212" setter="true">
  484.             <Name>liveBoxesName</Name>
  485.             <Description>Box Name [IDX]</Description>
  486.             <Type>write</Type>
  487.             <Interprete>
  488.                 <RawType>other</RawType>
  489.                 <Type>string</Type>
  490.                 <LengthType>next param</LengthType>
  491.             </Interprete>
  492.             <Display>
  493.                 <RTDisplay>true</RTDisplay>
  494.             </Display>
  495.             <Measurement>
  496.                 <Type>string</Type>
  497.             </Measurement>
  498.         </Param>
  499.         <Param id="300">
  500.             <Name>createBox</Name>
  501.             <Type>write</Type>
  502.             <Information>
  503.                 <Subtext>Create new commentators box</Subtext>
  504.             </Information>
  505.             <Interprete>
  506.                 <RawType>numeric text</RawType>
  507.                 <Type>double</Type>
  508.                 <LengthType>next param</LengthType>
  509.             </Interprete>
  510.             <Display>
  511.                 <RTDisplay>true</RTDisplay>
  512.                 <Positions>
  513.                     <Position>
  514.                         <Page>General</Page>
  515.                         <Column>1</Column>
  516.                         <Row>0</Row>
  517.                     </Position>
  518.                 </Positions>
  519.             </Display>
  520.             <Measurement>
  521.                 <Type width="110">button</Type>
  522.                 <Discreets>
  523.                     <Discreet>
  524.                         <Display>Create New Box...</Display>
  525.                         <Value>newBox</Value>
  526.                     </Discreet>
  527.                 </Discreets>
  528.             </Measurement>
  529.         </Param>
  530.         <Param id="301">
  531.             <Name>createBooth</Name>
  532.             <Type>write</Type>
  533.             <Information>
  534.                 <Subtext>Create live booth</Subtext>
  535.             </Information>
  536.             <Interprete>
  537.                 <RawType>numeric text</RawType>
  538.                 <Type>double</Type>
  539.                 <LengthType>next param</LengthType>
  540.             </Interprete>
  541.             <Display>
  542.                 <RTDisplay>true</RTDisplay>
  543.                 <Positions>
  544.                     <Position>
  545.                         <Page>General</Page>
  546.                         <Column>0</Column>
  547.                         <Row>0</Row>
  548.                     </Position>
  549.                 </Positions>
  550.             </Display>
  551.             <Measurement>
  552.                 <Type width="110">button</Type>
  553.                 <Discreets>
  554.                     <Discreet>
  555.                         <Display>Create Live Booth...</Display>
  556.                         <Value>newBooth</Value>
  557.                     </Discreet>
  558.                 </Discreets>
  559.             </Measurement>
  560.         </Param>
  561.     </Params>
  562.     <QActions>
  563.         <QAction id="1" name="Precompiled Code" encoding="csharp" options="precompile">
  564.             <![CDATA[namespace Skyline.Protocol
  565. {
  566.     using System;
  567.     using System.Collections.Generic;
  568.     using System.Globalization;
  569.     using System.IO;
  570.     using System.Text;
  571.     using Skyline.DataMiner.Scripting;
  572.  
  573.     namespace MyExtension
  574.     {
  575.         #region Enumerations
  576.         #endregion
  577.  
  578.         #region Structs
  579.         #endregion
  580.  
  581.         #region Classes
  582.  
  583.         public class Utilitiy
  584.         {
  585.             public static void SaveTable(SLProtocol protocol, int tableID, string filename)
  586.             {
  587.                 string[] keys = protocol.GetKeys(tableID);
  588.                 var tableContents = new List<string>();
  589.  
  590.                 foreach (string key in keys)
  591.                 {
  592.                     object[] rowData = (object[])protocol.GetRow(tableID, key);
  593.                     tableContents.Add(string.Join(",", rowData));
  594.                 }
  595.  
  596.                 File.WriteAllLines(filename, tableContents);
  597.             }
  598.         }
  599.         public class MyClass
  600.         {
  601.             #region Fields
  602.             #endregion
  603.  
  604.             #region Constructors
  605.             #endregion
  606.  
  607.             #region Enumerations
  608.             #endregion
  609.  
  610.             #region Properties
  611.             #endregion
  612.  
  613.             #region Methods
  614.             #endregion
  615.  
  616.             #region Structs
  617.             #endregion
  618.         }
  619.  
  620.  
  621.         #endregion
  622.     }
  623. }]]>
  624.         </QAction>
  625.         <QAction id="2" name="After Startup" encoding="csharp" triggers="2">
  626.             <![CDATA[using System;
  627. using System.IO;
  628. using System.Linq;
  629. using Skyline.DataMiner.Scripting;
  630.  
  631. /// <summary>
  632. /// DataMiner QAction Class: After Startup.
  633. /// </summary>
  634. public static class QAction
  635. {
  636.     /// <summary>
  637.     /// The QAction entry point.
  638.     /// </summary>
  639.     /// <param name="protocol">Link with SLProtocol process.</param>
  640.     public static void Run(SLProtocol protocol)
  641.     {
  642.         int boothTableID = 100;
  643.         int boxTableID = 110;
  644.  
  645.         try
  646.         {
  647.             // Init tables
  648.             protocol.DeleteRow(boothTableID,protocol.GetKeys(boothTableID,NotifyProtocol.KeyType.Index));
  649.             protocol.DeleteRow(boxTableID, protocol.GetKeys(boxTableID, NotifyProtocol.KeyType.Index));
  650.  
  651.             // Load boxes
  652.             const string boxFileName = "C:\\Skyline_data\\boxFile.csv";
  653.             if (File.Exists(boxFileName))
  654.             {
  655.                 string[] fileRows = File.ReadAllLines(boxFileName);
  656.                 foreach (string row in fileRows)
  657.                 {
  658.                     if (!string.IsNullOrEmpty(row))
  659.                     {
  660.                         object[] rowValues = row.Split(',').Select(v => v == "null" ? null : v).ToArray<object>();
  661.                         protocol.AddRow(boxTableID, rowValues);
  662.                     }
  663.                 }
  664.             }
  665.  
  666.             // Load booths
  667.             const string boothFileName = "C:\\Skyline_data\\boothFile.csv";
  668.             if (File.Exists(boothFileName))
  669.             {
  670.                 string[] fileRows = File.ReadAllLines(boothFileName);
  671.                 foreach (string row in fileRows)
  672.                 {
  673.                     if (!string.IsNullOrEmpty(row))
  674.                     {
  675.                         object[] rowValues = row.Split(',').Select(v => v == "null" ? null : v).ToArray<object>();
  676.                         protocol.AddRow(boothTableID, rowValues);
  677.                     }
  678.                 }
  679.             }
  680.         }
  681.         catch (Exception ex)
  682.         {
  683.             protocol.Log("QA" + protocol.QActionID + "|" + protocol.GetTriggerParameter() + "|Run|Exception thrown:" + Environment.NewLine + ex, LogType.Error, LogLevel.NoLogging);
  684.         }
  685.     }
  686. }]]>
  687.         </QAction>
  688.         <QAction id="3" name="Create New Box" encoding="csharp" triggers="300">
  689.             <![CDATA[using System;
  690. using System.Collections.Generic;
  691. using System.Globalization;
  692. using System.Text;
  693.  
  694. using Skyline.DataMiner.Scripting;
  695. using Skyline.DataMiner.Net.Messages;
  696. using System.IO;
  697. using System.Linq;
  698. using Skyline.DataMiner.Net.Messages.SLDataGateway;
  699.  
  700. /// <summary>
  701. /// DataMiner QAction Class: Create New Box.
  702. /// </summary>
  703. public static class QAction
  704. {
  705.     /// <summary>
  706.     /// The QAction entry point.
  707.     /// </summary>
  708.     /// <param name="protocol">Link with SLProtocol process.</param>
  709.     public static void Run(SLProtocol protocol)
  710.     {
  711.         int tableID = Skyline.DataMiner.Scripting.Parameter.Liveboxes.tablePid;//110;
  712.        
  713.         try
  714.         {
  715.             var executeScriptMessage = new ExecuteScriptMessage
  716.             {
  717.                 ScriptName = "CreateLiveBoxParent",
  718.                 Options = new SA(new string[] { "OPTIONS:0", "DEFER:FALSE" }),
  719.             };
  720.  
  721.             ExecuteScriptResponseMessage executeScriptResponseMessage = protocol.ExecuteScript(executeScriptMessage);
  722.             bool succeeded = executeScriptResponseMessage != null && !executeScriptResponseMessage.HadError;
  723.  
  724.             if (succeeded)
  725.             {
  726.                 try
  727.                 {
  728.                     Dictionary<string, string> scriptOutput = executeScriptResponseMessage.ScriptOutput;
  729.                     if (scriptOutput["BoxName"].Length > 0)
  730.                     {
  731.                         string newRowPK = protocol.AddRowReturnKey(tableID);
  732.                         string[] newRow = new string[] { newRowPK, scriptOutput["BoxName"], "0", scriptOutput["Monitors"] };
  733.  
  734.                         const string boxFileName = "C:\\Skyline_data\\boxFile.csv";
  735.  
  736.                         File.AppendAllLines(boxFileName, new string[] { string.Join(",", newRow.Select(v => v ?? "null").ToArray()) });
  737.  
  738.                         newRow[0] = null;
  739.                         protocol.SetRow(tableID, newRowPK, newRow.ToArray<object>());
  740.                     }
  741.                 }
  742.                 catch (Exception e)
  743.                 {
  744.                     protocol.ShowInformationMessage($"ERROR: Could not save new box: {e.Message}\nPlease try again.");
  745.                     return;
  746.                 }
  747.             }
  748.         }
  749.         catch (Exception ex)
  750.         {
  751.             protocol.Log("QA" + protocol.QActionID + "|" + protocol.GetTriggerParameter() + "|Run|Exception thrown:" + Environment.NewLine + ex, LogType.Error, LogLevel.NoLogging);
  752.         }
  753.     }
  754. }]]>
  755.         </QAction>
  756.         <QAction id="4" name="Create New Booth" encoding="csharp" triggers="301">
  757.             <![CDATA[using System;
  758. using System.Collections.Generic;
  759. using System.Globalization;
  760. using System.Text;
  761.  
  762. using Skyline.DataMiner.Scripting;
  763. using Skyline.DataMiner.Net.Messages;
  764. using System.IO;
  765. using System.Linq;
  766.  
  767. /// <summary>
  768. /// DataMiner QAction Class: Create New Booth.
  769. /// </summary>
  770. public static class QAction
  771. {
  772.     /// <summary>
  773.     /// The QAction entry point.
  774.     /// </summary>
  775.     /// <param name="protocol">Link with SLProtocol process.</param>
  776.     public static void Run(SLProtocol protocol)
  777.     {
  778.         try
  779.         {
  780.             var executeScriptMessage = new ExecuteScriptMessage
  781.             {
  782.                 ScriptName = "CreateLiveBoothParent",
  783.                 Options = new SA(new string[] { "OPTIONS:0", "DEFER:FALSE" }),
  784.             };
  785.  
  786.             ExecuteScriptResponseMessage executeScriptResponseMessage = protocol.ExecuteScript(executeScriptMessage);
  787.             bool succeeded = executeScriptResponseMessage != null && !executeScriptResponseMessage.HadError;
  788.  
  789.             if (succeeded)
  790.             {
  791.                 int tableID = Skyline.DataMiner.Scripting.Parameter.Livebooths.tablePid;//100;
  792.                 try
  793.                 {
  794.                     Dictionary<string, string> scriptOutput = executeScriptResponseMessage.ScriptOutput;
  795.                     if (scriptOutput["BoothName"].Length > 0)
  796.                     {
  797.                         string newRowPK = protocol.AddRowReturnKey(tableID);
  798.                         string[] newRow = new string[] {
  799.                             newRowPK,
  800.                             scriptOutput["BoothName"],
  801.                             scriptOutput["DisplayName"],
  802.                             scriptOutput["Sources"],
  803.                             scriptOutput["Destinations"],
  804.                             scriptOutput["Pip"],
  805.                             scriptOutput["Mix"],
  806.                             scriptOutput["Logo"]
  807.                         };
  808.                         newRow = newRow.Select(s => s.Replace(',', ';')).ToArray();
  809.                         const string boxFileName = "C:\\Skyline_data\\boothFile.csv";
  810.  
  811.                         File.AppendAllLines(boxFileName, new string[] { string.Join(",", newRow.Select(v => v ?? "null").ToArray()) });
  812.  
  813.                         newRow[0] = null;
  814.                         protocol.SetRow(tableID, newRowPK, newRow.ToArray<object>());
  815.                     }
  816.                 }
  817.                 catch (Exception e)
  818.                 {
  819.                     protocol.ShowInformationMessage($"ERROR: Could not save new box: {e.Message}\nPlease try again.");
  820.                     return;
  821.                 }
  822.             }
  823.         }
  824.         catch (Exception ex)
  825.         {
  826.             protocol.Log("QA" + protocol.QActionID + "|" + protocol.GetTriggerParameter() + "|Run|Exception thrown:" + Environment.NewLine + ex, LogType.Error, LogLevel.NoLogging);
  827.         }
  828.     }
  829. }]]>
  830.         </QAction>
  831.         <QAction id="10" name="BoothSave" dllImport="[ProtocolName].[ProtocolVersion].QAction.1.dll" encoding="csharp" row="true" triggers="202;203;204;205;206;207;208">
  832.             <![CDATA[using System;
  833.  
  834. using Skyline.DataMiner.Scripting;
  835. using Skyline.Protocol.MyExtension;
  836.  
  837. /// <summary>
  838. /// DataMiner QAction Class: BoothSave.
  839. /// </summary>
  840. public static class QAction
  841. {
  842.     /// <summary>
  843.     /// The QAction entry point.
  844.     /// </summary>
  845.     /// <param name="protocol">Link with SLProtocol process.</param>
  846.     public static void Run(SLProtocol protocol)
  847.     {
  848.         try
  849.         {
  850.             const string fileName = "C:\\Skyline_data\\boothFile.csv";
  851.             const int tableID = Skyline.DataMiner.Scripting.Parameter.Livebooths.tablePid;//100;
  852.  
  853.             Utilitiy.SaveTable(protocol, tableID, fileName);
  854.         }
  855.         catch (Exception ex)
  856.         {
  857.             protocol.Log("QA" + protocol.QActionID + "|" + protocol.GetTriggerParameter() + "|Run|Exception thrown:" + Environment.NewLine + ex, LogType.Error, LogLevel.NoLogging);
  858.         }
  859.     }
  860. }]]>
  861.         </QAction>
  862.         <QAction id="11" name="BoxSave" encoding="csharp" dllImport="[ProtocolName].[ProtocolVersion].QAction.1.dll" row="true" triggers="212;213;214">
  863.             <![CDATA[using System;
  864. using System.Collections.Generic;
  865. using System.Globalization;
  866. using System.Text;
  867.  
  868. using Skyline.DataMiner.Scripting;
  869. using Skyline.Protocol.MyExtension;
  870.  
  871. /// <summary>
  872. /// DataMiner QAction Class: BoxSave.
  873. /// </summary>
  874. public static class QAction
  875. {
  876.     /// <summary>
  877.     /// The QAction entry point.
  878.     /// </summary>
  879.     /// <param name="protocol">Link with SLProtocol process.</param>
  880.     public static void Run(SLProtocol protocol)
  881.     {
  882.         try
  883.         {
  884.             const string fileName = "C:\\Skyline_data\\boxFile.csv";
  885.             const int tableID = 110;
  886.  
  887.             Utilitiy.SaveTable(protocol, tableID, fileName);
  888.         }
  889.         catch (Exception ex)
  890.         {
  891.             protocol.Log("QA" + protocol.QActionID + "|" + protocol.GetTriggerParameter() + "|Run|Exception thrown:" + Environment.NewLine + ex, LogType.Error, LogLevel.NoLogging);
  892.         }
  893.     }
  894. }]]>
  895.         </QAction>
  896.     </QActions>
  897.     <Groups>
  898.         <Group id="2">
  899.             <Name>After Startup</Name>
  900.             <Description>After Startup</Description>
  901.             <Type>poll action</Type>
  902.             <Content>
  903.                 <Action>2</Action>
  904.             </Content>
  905.         </Group>
  906.     </Groups>
  907.     <Triggers>
  908.         <Trigger id="1">
  909.             <Name>After Startup</Name>
  910.             <On>protocol</On>
  911.             <Time>after startup</Time>
  912.             <Type>action</Type>
  913.             <Content>
  914.                 <Id>1</Id>
  915.             </Content>
  916.         </Trigger>
  917.     </Triggers>
  918.     <Actions>
  919.         <Action id="1">
  920.             <Name>After Startup Group</Name>
  921.             <On id="2">group</On>
  922.             <Type>execute next</Type>
  923.         </Action>
  924.         <Action id="2">
  925.             <Name>After Startup QAction</Name>
  926.             <On id="2">parameter</On>
  927.             <Type>run actions</Type>
  928.         </Action>
  929.     </Actions>
  930.     <VersionHistory>
  931.         <Branches>
  932.             <Branch id="1">
  933.                 <Comment>Main Branch</Comment>
  934.                 <SystemVersions>
  935.                     <SystemVersion id="0">
  936.                         <MajorVersions>
  937.                             <MajorVersion id="0">
  938.                                 <MinorVersions>
  939.                                     <MinorVersion id="1">
  940.                                         <Date>2022-03-24</Date>
  941.                                         <Provider>
  942.                                             <Author>A A</Author>
  943.                                             <Company>A</Company>
  944.                                         </Provider>
  945.                                         <Changes>
  946.                                             <NewFeature>Initial version</NewFeature>
  947.                                         </Changes>
  948.                                     </MinorVersion>
  949.                                 </MinorVersions>
  950.                             </MajorVersion>
  951.                         </MajorVersions>
  952.                     </SystemVersion>
  953.                 </SystemVersions>
  954.             </Branch>
  955.             <Branch id="0">
  956.                 <Comment/>
  957.                 <SystemVersions>
  958.                     <SystemVersion id="0">
  959.                         <MajorVersions>
  960.                             <MajorVersion id="0">
  961.                                 <MinorVersions>
  962.                                     <MinorVersion id="3">
  963.                                         <Date>2022-03-31</Date>
  964.                                         <Provider>
  965.                                             <Author>A A</Author>
  966.                                             <Company>A</Company>
  967.                                         </Provider>
  968.                                         <Changes/>
  969.                                     </MinorVersion>
  970.                                 </MinorVersions>
  971.                             </MajorVersion>
  972.                         </MajorVersions>
  973.                     </SystemVersion>
  974.                 </SystemVersions>
  975.             </Branch>
  976.         </Branches>
  977.     </VersionHistory>
  978.     <Compliancies>
  979.         <MinimumRequiredVersion>10.0.5.0 - 9164</MinimumRequiredVersion>
  980.     </Compliancies>
  981. </Protocol>
  982.  
Add Comment
Please, Sign In to add comment