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.

gui composer button widget question

Other Parts Discussed in Thread: CCSTUDIO

Hi,  

I am using Code Composer Studio Version: 6.1.1.00022

For my application, i am using windows based touch screen computer and running gui composer on it. In gui composer, i need a button which is value become 1 when i press on it on a touch screen, and i need it is value become 0 when i do not touch on it.

It should not be like clicking on the button, because when i click on the button, it's value become 1, but if i want to make it's value 0, i need to click on the button again. What i want is, when i click on the button it's value become 1, and when i leave my finger over the button, it's value become 0 again.

Is this possible with existing gui composer widgets?

Thanks in advance.

  • Hi,

    You can try to to handle the onmousedown event and onmouseup event for the button and call a DSS script to write to the target variable.

    Patrick

  • Hi, thank you for your reply.

    For DSS script, i am following below link

    ://processors.wiki.ti.com/index.php/GUI_Composer/DSS_Scripts

    Code Composer Studio Version: 6.1.1.00022

    Gui Composer and Java Script Developments Tools installed and uptodate

    Launchpad F28377S

    I am getting below error,

    ERROR : sun.org.mozilla.javascript.internal.WrappedException:

    Wrapped com.ti.ccstudio.scripting.enviroment.ScriptingException:

    com.ti.debug.engine.scripting.SourceStep.over(): operation not allowed at current location (#10) in at line number 10

    Could you please advise

    thank you

  • The target is probably not accepting source step over while it is running. You should try to use DSS to write to the global variable instead when the button is pressed.

    Patrick

  • Hi, thank you for your reply.

    As you said, when i suspended the target, example is working as expected.

    I am trying to write to a global variable now, while the target is running. i checked below post.

    ://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/414244

    this is my dsScript.js

    //------------------------------------------------------------------------------------------------------------------------------

    importPackage(Packages.com.ti.ccstudio.scripting.environment)
    function myStepOver( steps) {
    if(!$active_context_name) {
    throw "An active Debug Session is required for myStepOver()";
    }
    var debugServer = ScriptingEnvironment.instance().getServer('DebugServer.1');
    var session = debugServer.openSession($active_context_name);

    session.memory.writeRegister("FrequencyIncreaseGuiInput", 1);

    }//------------------------------------------------------------------------------------------------------------------------------

    "FrequencyIncreaseGuiInput" is a global variable decleared in main.c as Uint16.

    I am getting below error while target is running,

    Register FrequencyIncreaseGuiInput not found.

    I am a beginner for dss scripting, i know that i am missing something. Could you please advise?

    and also could you please advise some kind of document for how to use of APIs.

    thank you

  • Use the memory write API if you are intending to write to memory. Or you can use session.expression.evaluate("FrequencyIncreaseGuiInput = 1");

    See this wiki page for DSS documentation: DSS WIKI

    Patrick

  • I can change my variable with session.expression.evaluate("FrequencyIncreaseGuiInput = 1");
    My problem is solved, thank you