SignalGenerator

Type: SignalGenerator

Extends View

Script class of the Signal Generator view.

Properties

PropertyDescription
Since version 4.04.23, Named properties may be accessed directly instead of requiring getViewProperty / setViewProperty. The property ID may be identified in the Properties view.
enabled Enables/disables the view.
frequency Get/Set the signal generator frequency, in Hz.
isOutputEnabled Enables/disables the output of the generator.
numCells Get/Set the number of cells in the waveform.
pullupResistance Get/Set the pullup resistance value, in ohms.
waveform Get the waveform object, a table of type EcuObjectScaled. This enables editing of waveform values.

View Properties

Properties defined by the view that are normally editable via properties editor.

PropertyNameDescription
title Title The title of the window.
id Script ID The scripting ID of the window. Can be used as an alternative to the title for searching for windows from scripts.
tooltip Tool Tip Window tool tip.
display_units_text Display Units Show units after the number on the view.
display_units_label Display Units (Label) Show units after the label on the view.
prefix_text Prefix Text Text to display before the value.
postfix_text Postfix Text Text to display after the value.
limits Limits Set up alarm limits for this gauge.
show_value Show Value
show_label Show Label
label_font Label Font
value_font Value Font
value_height_percent Value Height % A value of zero disables auto font size fitting if Value Height Max is set
value_height_max_dp Value Height Max [dp] Maximum font height of the value text, in device pixels
label_height_percent Label Height %
label_height_max_dp Label Height Max [dp] Maximum font height of the label, in device pixels
label_text Label Text
label_align Label Align
label_valign Label Vertical Align
value_align Value Align
value_valign Value Vertical Align
low_limit_text Low Limit Text
high_limit_text High Limit Text
value_text Value Override Text
max_length_text Max length Text Leave blank for auto
bg_colour Background Background colour
text_colour Text Text colour
alarm_low_bg_colour Alarm Low Background Alarm Lower Limit Background colour
alarm_low_text_colour Alarm Low Text Alarm Lower Limit Text colour
alarm_high_bg_colour Alarm High Background Alarm Upper Limit Background colour
alarm_high_text_colour Alarm High Text Alarm Upper Limit Text colour
parameter Input Value The source of the value that will be displayed by the gauge.
update_rate Update Rate Rate at which the input value is requested from the ECU.
decimal_places Decimal Places Set to -1 for auto

Methods

MethodDescription
callListener(eventName, [args]) Calls all event listeners for the given event name, useful for testing.
getViewProperties() Returns an array of objects containing the view properties. Each element has the fields 'name', 'id', 'value', 'hint'. If the property is a category then it will also have an array field 'properties'. These properties are the ones normally editable via the properties view.
getViewProperty(id) Gets a property value from the view, given the property ID. Property IDs can be listed using getViewProperties. These properties are the ones normally editable via the properties view.
on(eventName, callback) Adds an event listener for the given event name. e.g. view.on("click", function() { ... });
removeAllListeners([eventName]) Removes all event listeners for the given event name. If the event name is not given then all listeners for all events are removed.
removeListener(eventName, callback) Removes an event listener for the given event name. e.g. let callback = function() { ... }; view.on("click", callback); view.removeListener("click", callback);
setViewProperty(id, value) Sets a property on the view, given the property ID and value. Property IDs can be listed using getViewProperties These properties are the ones normally editable via the properties view.

Events

EventDescription
onFrequencyChanged()

Called when the frequency of the generator has been changed.

External scripts can bind to the 'frequency_changed' event to be notified when the user clicks the Button.

view.on("frequency_changed", function(frequency) { ... });

The frequency parameter is the new frequency of the generator, in Hz.