This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Streaming GuiComposer



I have installed the example project as explained here.  http://processors.wiki.ti.com/index.php/Streaming_GuiComposer   The project runs.  I have been able to modify the javascript to communicate with my target board (MPS-EXP430FR4133).  I am trying to modify the layout, but I get this error on the top of the GUI Composer window:   "Unable to parse HTML source.  See console for error.  Please switch to "Display Source" mode and correct the error."  I've reinstalled the project and tried going to Display Source, but I get the same error.

I also am trying to go at the problem from the other side.  I created a basic layout with the port enable check box, the baud rate drop down, the com port drop down, and the send button.  When I try to send a command to the demo board, I get a Send Command Error that says "ERROR: Port is in use."  I don't really believe that as I can send commands thru DOS command line using the "echo x >COM3" command.

Any ideas on how I can modify this project either using the example or my own?

  • Hi Tyler,

    I moved this to the CCS forum since it looks like your question is about using GUI composer.

    Regards,
    Katie
  • Can you attach your version of the modified example with the HTML parsing error here?

    Patrick
  • HTML

    <!DOCTYPE html>
    <html>
    <!-- Do not remove or modify this line --><head data-gc-version="1.5.201501051800">
    <meta charset="utf-8"/>
    <title>Untitled</title>
    <script type="text/javascript" src="lib/davinci.dojo_1_8/WebContent/dojo/dojo/dojo.js" data-dojo-config="'parseOnLoad':true,'async':true,'packages':[{'name':'gc','location':'../../../../davinci.gc_1_5/WebContent/gc'},{'name':'maqetta','location':'../../../../davinci.gc_1_5/WebContent/maqetta'}]"></script>
    <script type="text/javascript">
    require([
      "dijit/dijit",
      "dojo/parser",
      "maqetta/space",
      "maqetta/AppStates",
      "gc/dijit/Button",
      "gc/dijit/Select",
      "gc/dijit/TextBox",
      "gc/dijit/Label",
      "gc/dijit/CheckBox",
      "gc/dijit/libs/steelseries/tween.amd.min",
      "gc/dijit/libs/steelseries/steelseries.amd.min"
    ]);
    </script>
    <style>@import "lib/davinci.dojo_1_8/WebContent/maqetta/themes/claro/document.css";@import "lib/davinci.dojo_1_8/WebContent/maqetta/themes/claro/claro.css";@import "lib/davinci.dojo_1_8/WebContent/dojo/dojo/resources/dojo.css";@import "lib/davinci.gc_1_5/WebContent/gc/dijit/libs/css/widgets.css";@import "app.css";
    </style>
    <script type="text/javascript" src="app.js"></script>
    <script type="text/javascript" src="lib/davinci.gc_1_5/WebContent/gc/backplane/guiComposer.js"></script>
    </head>
    <body data-maq-flow-layout="false" data-maq-comptype="desktop" class="claro" data-maq-ws="collapse" id="myapp" data-maq-appstates="{}">
     <input id="widget_send_command" type="button" data-dojo-type="gc.dijit.Button" intermediateChanges="false" label="SEND" iconClass="dijitNoIcon" visible="true" style="position: absolute; z-index: 900; left: 317px; top: 233.79839992523193px;" onclick="sendUserCommand"></input>
     <select id="widget_bauds" data-dojo-type="gc.dijit.Select" type="text" value="item1" intermediateChanges="false" emptyLabel="&amp;#160;" scrollOnFocus="true" autoWidth="true" maxHeight="0" dropDownPosition="below,above" buttonPosition="right" visible="true" labels="item1,item2,item3" sort="none" style="position: absolute; z-index: 900; left: 79px; top: 192px;"></select>
     <select id="widget_ports" data-dojo-type="gc.dijit.Select" type="text" value="item1" intermediateChanges="false" emptyLabel="&amp;#160;" scrollOnFocus="true" autoWidth="true" maxHeight="0" dropDownPosition="below,above" buttonPosition="right" visible="true" labels="item1,item2,item3" sort="none" style="position: absolute; z-index: 900; left: 79px; top: 150px;"></select>
     <input id="widget_rx_data" type="text" data-dojo-type="gc.dijit.TextBox" intermediateChanges="false" trim="false" uppercase="false" lowercase="false" propercase="false" selectOnClick="false" visible="true" style="position: absolute; z-index: 900; left: 117px; top: 274px;"></input>
     <input id="widget_tx_data" type="text" data-dojo-type="gc.dijit.TextBox" intermediateChanges="false" trim="false" uppercase="false" lowercase="false" propercase="false" selectOnClick="false" visible="true" style="position: absolute; z-index: 900; left: 117px; top: 238px;"></input>
     <label id="widget_23839" data-dojo-type="gc.dijit.Label" label="Ports" visible="true" style="position: absolute; z-index: 900; left: 31px; top: 154px;"></label>
     <label id="widget_10597" data-dojo-type="gc.dijit.Label" label="Baud" visible="true" style="position: absolute; z-index: 900; left: 31px; top: 196px;"></label>
     <label id="widget_15325" data-dojo-type="gc.dijit.Label" label="TX_DATA" visible="true" style="position: absolute; z-index: 900; left: 31px; top: 242px;"></label>
     <label id="widget_10321" data-dojo-type="gc.dijit.Label" label="RX_DATA" visible="true" style="position: absolute; z-index: 900; left: 31px; top: 278px;"></label>
     <input id="widget_opened" type="checkbox" data-dojo-type="gc.dijit.CheckBox" intermediateChanges="false" iconClass="dijitNoIcon" visible="true" style="position: absolute; z-index: 900; left: 79px; top: 118px;" onclick="onCheck"></input>
     <label id="widget_18090" data-dojo-type="gc.dijit.Label" label="Enabled" visible="true" style="position: absolute; z-index: 900; left: 31px; top: 119.5px;"></label>
     <input id="widget_sent" type="text" data-dojo-type="gc.dijit.TextBox" intermediateChanges="false" trim="false" uppercase="false" lowercase="false" propercase="false" selectOnClick="false" visible="true" style="position: absolute; z-index: 900; left: 459px; top: 274px;"></input>
    </body>
    </html>
    

  • JavaScript

    /*
    * This file is provided for custom JavaScript logic that your HTML files might need.
    * GUI Composer includes this JavaScript file by default within HTML pages authored in GUI Composer.
    */
    require(["dojo/ready"], function(ready){
    ready(function(){
    // logic that requires that Dojo is fully initialized should go here

    });
    });

    function onSendCompleted(result, operationId) {
    if( result.status && result.status.type == "ERROR") {
    $TI.helper.showError( "Send Commnad Error", result.status.message);
    }
    }

    function sendCmd( cmd) {
    var msg = {
    sendBuffer : cmd,
    response_length : -1,
    };

    $TI.guiComposerServer.executeAsynchOperation("streams.$send", msg, onSendCompleted, null);
    }

    function sendUserCommand() {
    var tmp = dijit.byId("widget_tx_data").get("value");
    //var aRay = tmp.split("");
    sendCmd( String("0x"+tmp.charCodeAt(0).toString(16))); //Convert Character from ASCII to Hex and then to a string
    /*dijit.byId("widget_sent").set("value","");
    var v = dijit.byId("widget_sent").get("value");
    for (i=0;i<aRay.length; i++) {
    sendCmd( String("0x"+aRay[i].charCodeAt(0).toString(16))); //Convert Character from ASCII to Hex and then to a string
    v = dijit.byId("widget_sent").get("value");
    dijit.byId("widget_sent").set("value",v+aRay[i]);
    }
    sendCmd( "0x0D"); //Send Carriage Return*/
    }

    function onStreamInPropertyChanged( propertyName, newValue, oldValue) {
    updateTraceEditBox( newValue);
    }

    function updateTraceEditBox( newValue) {
    var w = dijit.byId("widget_rx_data");

    if(newValue == 0x0D)
    w.set("value", "");
    else
    w.set("value", v + String.fromCharCode(newValue));
    }

    function onCheck( ) {
    dijit.byId("widget_sent").set("value",streams.port[streams.$ports.active]);
    }
  • Can you zip up your project? and attach the zip file here?

    Thanks,
    Patrick