[Settings]

The settings section enables you to define some application wide variables whose value will be maintained between starts of the application, provided that you have a controlled shutdown. The controlled shutdown is a requirement because SDC keeps these settings in memory until the application is terminated, at which point it writes the latest values back to the SDC.ini file. If you just pull the power, SDC doesn’t get the chance to save anything.

Settings are defined as follows:

[settings]
<settingname>=<id>,<value>,<min>,<max>,<delta>,<wraparound>

Where:

<id> is a unique numeric id for the setting

<value> is the current value of the setting

<min> is the minimum value the setting can have. This limit only applies to the “increment” and “decrement” touch actions. If you assign a value in a script, the minimum is ignored.

<max> is the maximum value the setting can have. This limit only applies to the “increment” and “decrement” touch actions. If you assign a value in a script, the maximum is ignored.

<delta> is the amount that the value will be changed by when either the “increment” or “decrement” touch actions are executed.

<wraparound> can be 0 or 1. If 1 is specified, then when the setting is incremented or decremented using a touch action, the value will wrap around to either the <min> or <max> value respectively. If 0 is specified, the value will stop when it reaches the relevant limit when either increment or decrement is applied.

Example:

[settings]
lastusedpage=14,9,0,100,1,0

This is a setting SDC uses internally to store the last used page, so that the same page can be opened next time SDC is booted. The Id of the setting is 14, current value 9 (represents page 9 from the XML), Min value zero, Max value 100, delta is 1 (but is never used for this setting), and wraparound is zero (also never used).

Changing Settings in Scripts

You can access a setting in a script by referencing the name of the setting. Settings can either be used for their current values or can even be updated.

The uses for this are relatively limited but there are some scenarios where it may make sense. For example, the shift lights example I have provided in the writing scripts section can actually use settings instead of definitions for the base rpm points. This is actually how it is implemented in the demo. This is because it is based on my own cluster arrangement which has a separate control screen with a page that can adjust the sport and track shift light start rpm. The two are stored as settings to make them both adjustable and also to make it possible for the values to be saved after the ignition is turned off. Adjustments are performed using the ‘increment’ and ‘decrement’ touch actions attached to some touch gauges.

Canbus broacast of settings

Whenever a setting is changed, it is broadcast over the canbus if one is connected. This makes sure all devices retain the same value for the setting. An exception to this is that if a setting is changed using a script it will not be broadcast on the canbus. This means settings use in scripts is best limited to local settings that you do not need other devices to see.