Angular directive
sra-text-gauge source template
This widget is a generic implementation of a Text Gauge.
All of the Text Gauges simply use this widget by passing in the different parameters.
It is configured using the available arguments.
All sizes are in pixels relative to 320x120.
If a gauge is resized, it will automatically adjust these values.
Example of how the Tachometer uses this:
<sra-text-gauge
class = "SIMRacingApps-Widget-TextGauge-Tachometer"
data-sra-args-text-gauge = "Tachometer"
data-sra-args-gauge-value = "Current"
data-sra-args-round-to = "10"
data-sra-args-decimals = "0"
data-sra-args-show-text-label = "{{sraShowTextLabel}}"
data-sra-args-interval = "{{sraArgsInterval||sraInterval}}"
></sra-text-gauge>
Dependencies:
Name | Type | Description |
---|---|---|
data-sra-args-text-gauge | string | The name of the gauge that the SIM will use to send the values from. See, Gauges, for avaiLabel values. Defaults to "Generic". |
data-sra-args-gauge-value | string | Either the "Current" or "Next" values. Defaults to "Current". |
data-sra-args-use-speedometer | boolean | The condition, true or false, to get the Tachometer to use the speed to determine the states relating to pit road speed. Defaults to true. If set to false, it uses the RPMs while in 2nd Gear that the SIM returns. if your app or widget implements a way for the user to set it (like in the real stock cars), then calling "/SIMRacingApps/Data/Car/REFERENCE/setRPMPitRoadSpeed/{RPM}" will set it for that session. Otherwise, it will use the default from Car.json or the car specific json files for each SIM where it can be defined by track. (NOTE: As of version 1.0, the json files have not been updated and the default is 3950.) |
data-sra-args-show-text-label | string | The title of the gauge. Defaults to the gauge's label1 and lable2 values. |
data-sra-args-round-to | double | The value to round the digital values to. Defaults to 1.0. |
data-sra-args-decimals | integer | The number of decimals places to show the digital value. |
data-sra-args-uom | string | The unit of measure to show the entire gauge in. |
data-sra-args-flash-rate | milliseconds | The rate to flash when CRITICAL state is reached. |
data-sra-args-flash-on-critical | boolean | Enable or disable the flash on critical. Defaults to true. |