Quantcast
Channel: Tools
Viewing all articles
Browse latest Browse all 91752

Forum Post: RE: GUI Composer - passing a string from a text box to char array

$
0
0

Yarden,

I don't recall when executing a DSS script from an action is implemented, I think it is CCSv6. This method is no as trivial as binding the text box to an array of char.

I don't think binding to an array of char for writing to the target is implemented yet. I have filed a CQ request for bi-directional binding. See SDSCM00049786.

Now, to implement a DSS scripting binding with a button. You need to create a text box, give it an id 'textBox'. Create a dsScript.js file and place it in the project. Add this snippet to the dsScript.js file.

importPackage(Packages.com.ti.ccstudio.scripting.environment)

function update(value) {
    var debugServer = ScriptingEnvironment.instance().getServer("DebugServer.1");
    var session = debugServer.openSession("*", "*");

    for (var i = 0; i < value.length; ++i) {
        session.expression.evaluate('test[' + i + '] = \'' + value[i] + '\'');
    }
}

For the button that you want to perform a target write, add this line to the onclick event handler of the widget: TI.DSS('update', dijit.byId('textBox').value)

Regards,
Patrick


Viewing all articles
Browse latest Browse all 91752

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>