Menu

use of scripts

2019-04-22
2019-04-22
  • Travis Lytle

    Travis Lytle - 2019-04-22

    Hi,

    I've created a script and it decodes text as I want in the script console (not the main console). Would this be the normal method of using the program? I don't need to modify anything on the serial port, just decode and occasionally send a sequence.

    The reason I ask is because I don't see a way to modify the script console very much. Changing colors, fonts, logging to a file.

     
  • Stefan Zieker

    Stefan Zieker - 2019-04-22

    Hi Travis,

    I think you should create a GUI which contains only a script console and add this console to the main window (then you can change for example the color). You can find an example in exampleScripts\WorkerScripts\MainWindowConsole\Utf8Console.

    Regards,
    Stefan

     
  • Travis Lytle

    Travis Lytle - 2019-04-22

    Hi Stefan,

    Thanks, that looks exactly like what I want, but is a bit complicated for me. I'm not used to javascript, but more python and C code, so I am on a learning curve here.

    You previously provided a simple example of processing a singleByte. I have combined that script with the MainWindowConsole Utf8Console script. I get the tab window to popup but no data in the console, only the script console. I've used the addDataToConsole() to push data, but nothing shows up. What am I doing incorrectly?

    Thanks,
    Travis

     
  • Stefan Zieker

    Stefan Zieker - 2019-04-22

    Hi Travis,

    the name of the console object is UI_TextEdit1 (chapter 'Script text edit' in the manual). If you want to append text after a new line then you can use UI_TextEdit1.append. If you want append text without a new line then you can use UI_TextEdit1.insert.
    If you use the ScriptCommunicator ScriptEditor then you get a description of these functions when you enter the dot after UI_TextEdit1.

    PS: If the name of the script is test.js then the name of the UI file must be test.ui (or ScriptCommuncator will not load the UI file automatically).

    Regards,
    Stefan

     

    Last edit: Stefan Zieker 2019-04-22

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.