Facility Control

 View Only
  • 1.  Search by DataLinq content from Dashboard

    Posted 03-09-2020 18:36

    I have a large Town Meeting coming up at the end of this month where 150 elected town reps are able to come up to a microphone at any moment to ask questions, debate, etc. I'm trying to figure out a way, using Dashboard to bring a graphic to air for those people. The data is DataLinq'd from an Excel file that has "name" and "precinct."

    It's not a complex graphic, but since we don't recognize all of the reps on sight, we have to wait until they introduce themselves and then do a search. Cross-referencing this with a list of Take-ID's is obviously too slow, and I'd like to have a second operator run this from a laptop with Dashboard, if possible, but I can't come up with an easy way of doing this.

    It's literally a 2-column Excel file with "Name" and "Precinct" as column headings and then 150ish names below.


    Does anyone have any ideas?



  • 2.  RE: Search by DataLinq content from Dashboard

    Posted 03-10-2020 11:25

    Hi Dan,

    you can load csv files into DashBoard to get the data into a table to display the list of delegates. You can also fire take commands via RossTalk to bring a selected take id on air in XPression.

    It's also possible to save the Excel file as a CSV and bring it into XPression, you can do this in the DataLinq Server by adding a 'ADODB Data Linq Source'  and from the template menu select 'Excel ( Mixed numeric / text Data )' then add the path to the CSV file.

    It's preferable to do it this way as you can then have one data source file which is loaded into XPression and DashBoard and any changes will be reflected in both.

    The only missing piece is the mapping of the delegate to a take id. The easiest although less dynamic way of doing this would be to add a take id column to the excel file and have a take id per delegate.

    To sum all this up from the DashBoard side; you load in the CSV, parse the data into params and display this in a table. From the table you can select a delegate to go on air, this will also give you the predefined take id, then you can fire a RossTalk command to bring the take on air.

    You can also add a search to the table to make this even easier for the DashBoard user to find a delegate.

    Is this what you're looking for?

    If it is I can send you a basic example panel showing you how to load and parse the CSV file to get you up and running.

    Thanks

    Colin.

     

     

     

     

     

     

     


    #DashBoard


  • 3.  RE: Search by DataLinq content from Dashboard

    Posted 03-10-2020 12:40

    If it is a simple excel spreadsheet, then you can “Save As” and change the file type to “XML Spreadsheet 2003” .xml. This following code is referencing a spreadsheet of 2 columns and 4 rows. Column 1 has names and column 2 has numbers. Good luck!

    <abs contexttype="opengear" style="">
    <meta>
    <params>
    <param access="1" constrainttype="INT_NULL" name="elementsFound" oid="elementsFound" precision="0" type="INT16" value="8" widget="default"/>
    <param access="1" maxlength="0" name="finalReturnedXML" oid="finalReturnedXML" precision="0" type="STRING_ARRAY" value="Bob;76;Tom;52;Larry;64;Mike;23" widget="default">
    <value>Bob</value>
    <value>76</value>
    <value>Tom</value>
    <value>52</value>
    <value>Larry</value>
    <value>64</value>
    <value>Mike</value>
    <value>23</value>
    </param>
    <param access="1" maxlength="0" name="returnedString" oid="returnedString" type="STRING" value="Mike 23" widget="text-display"/>
    <param access="1" maxlength="0" name="searchName" oid="searchName" type="STRING" value="Mike" widget="text"/>
    </params>
    </meta>
    <tab height="595" left="5" top="6" width="641">
    <abs id="RepSearch" name="RepSearch">
    <button buttontype="push" height="38" id="GetReps" left="486" name="Get Reps" top="25" width="114">
    <task tasktype="ogscript">var xmlPath = "file:///C:/DashBoard/Practice_Panel_01/searchWidget/RepList.xml"; //this defines the path of the xml file

    var testXML = ogscript.parseXML(xmlPath); //this variable stores all the parsed xml in Dashboard


    // check parse worked
    if (testXML == null) {
    // if parse failed debug msg
    ogscript.debug('Failed to read file');

    } else {
    // if parse worked
    ogscript.debug('Parsing XML');

    var Tags = "Data"; //this sets the search string

    var searchName = params.getValue('searchName', 0); //set search name


    var dataTags = testXML.getElementsByTagName(Tags); // seperates the testXML data by the searchTag(s) in an array called dataTags.

    if (dataTags.length == 0)
    {
    // if parse failed debug msg
    ogscript.debug('Failed to find that tag');
    } else {

    ogscript.debug("items found: " + dataTags.length); // degub msg dataTags array length

    params.setValue('elementsFound', 0, dataTags.length); // set param, elementsFound, to dataTags length

    var myString = " "; //create an empty string to later add our results to
    var NamesNums = new Array();
    // loop through dataTags array and return only text content in new array,
    for (xmlData = 0; xmlData &lt; dataTags.length; xmlData++) {

     


    var node = dataTags.item(xmlData); //making variable of the current node for this loop through the dataTags array
    var xmlDataTagsText = node.getTextContent(); // making variable for the Text Content in this node
    ogscript.debug("No. " + xmlData + " contains: " + xmlDataTagsText); // debug msg for Text value returned
    NamesNums[xmlData] = xmlDataTagsText;
    params.setValue('finalReturnedXML', xmlData, xmlDataTagsText); // set a finalReturnedXML param value for text returned in dataTag
    myString += xmlDataTagsText + ', '; //appending current node's text content to our outputstring
    }


    //params.setValue('returnedString', 0, myString); //output string to output textbox
    for (index = 0; index &lt; dataTags.length; index++)
    {
    if (NamesNums[index] == searchName)
    {
    var adjust = index + 1;
    var results = NamesNums[index] + " " + NamesNums[adjust];
    params.setValue('returnedString', 0, results); //output string to output textbox

    }
    }

    }
    }</task>
    </button>
    <param expand="true" height="315" left="70" oid="finalReturnedString" top="98" width="273"/>
    <param expand="true" height="277" left="226" oid="returnedString" top="187" width="273"/>
    <param expand="true" height="46" left="227" oid="searchName" top="122" width="172"/>
    <label height="40" left="128" name="Search name:" style="txt-align:west" top="127" width="92"/>
    <label height="40" left="129" name="Results:" style="txt-align:west;" top="199" width="90"/>
    </abs>
    </tab>
    </abs>


    #DashBoard