cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Autocomplete in script code to remind commands

SOLVED
Granite

Autocomplete in script code to remind commands

Hi, if I write my code on the composer is there a way to have suggests like, for example, on eclipse which gives you a dropdown menu with all the options?

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Autocomplete in script code to remind commands

Not on the code itself, you should go to Snippets tab or Entities.

View solution in original post

4 REPLIES 4

Re: Autocomplete in script code to remind commands

Not on the code itself, you should go to Snippets tab or Entities.

View solution in original post

Re: Autocomplete in script code to remind commands

Ok. But, for example, if I have a thing and I want to create a TimerThing I know I can do this

var params = {

  name: 'MyTimer' /* STRING */,

  description: undefined /* STRING */,

  thingTemplateName: 'Timer' /* THINGTEMPLATENAME */,

  tags: undefined /* TAGS */

};

Resources["EntityServices"].CreateThing(params);

but I don't understand, through Snippets, how I can change the Update Rate in configuration

Re: Autocomplete in script code to remind commands

You have to go to the TW Documentation.

Or Through Entities, select the Created Timer, and look on the available services, for TimerThing in particular it will be harder... as you have to go to Configuration Table

Here you have the needed code:

var updateRate = 50000;

var timer = Things[timerName];

if (timer) {

    var actualValues = timer.GetConfigurationTable({ tableName: "Settings" });

    if (actualValues.rows.length) {

        actualValues.rows[0].updateRate = updateRate;

        var params = {

            configurationTable: actualValues ,

            persistent: true,

            tableName: "Settings"

        };

        // no return

        timer.SetConfigurationTable(params);

    }

    // -- A Full Restart it's needed, just doing a Disable/Enable doesn't works

    timer.RestartThing();

}

Re: Autocomplete in script code to remind commands

Thank you very much

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________