Repository navigation
User JSON SpeedTextIndicator
Back to list | Indicator page | Русский
This page describes the JSON template of the speedText indicator for editing .vttp by hand: which fields exist and which values are allowed.
{
"name": "com.velitask.plagin.official.speedText",
"data": {
"maket": { "preset": "auto" },
"properties": {
"Speed": {},
"font": {
"name": "Dialog",
"style": 0,
"size": 48,
"color": { "r": 255, "g": 255, "b": 255, "a": 255 }
},
"textAlign": { "value": 4 },
"measurement": {
"system": { "value": 0 },
"format": { "value": 0 },
"speed": { "value": "KMH" }
},
"textTemplate": {
"template": "{currNum} {currUnit}",
"vars": {
"currNum": "%.1f",
"currUnit": "%s"
}
}
}
}
}Chooses the speed sensor. Leave it empty in a template: the sensor is picked automatically when the indicator is added to a project.
{
"Speed": {}
}| Field | Values | What it does |
|---|---|---|
sourceId |
{"value": number} |
The source identifier in the project. Not specified in a template. |
sensorId |
{"value": number} |
The sensor identifier in the source. Not specified in a template. |
The font and color of the text.
{
"font": {
"name": "Dialog",
"style": 0,
"size": 48,
"color": { "r": 255, "g": 255, "b": 255, "a": 255 }
}
}| Field | Values | What it does |
|---|---|---|
name |
a string | The font name. |
style |
0, 1, 2
|
The style: 0 plain, 1 bold, 2 italic. |
size |
1..999 |
The font size. |
color.r |
0..255 |
Red channel. |
color.g |
0..255 |
Green channel. |
color.b |
0..255 |
Blue channel. |
color.a |
0..255 |
Transparency: 0 fully transparent, 255 opaque. |
The position of the text inside the layer.
{
"textAlign": {
"value": 4
}
}| Field | Values | What it does |
|---|---|---|
value |
0..8 |
The index of the text position. |
value |
Position |
|---|---|
0 |
top left |
1 |
top center |
2 |
top right |
3 |
center left |
4 |
centered (default) |
5 |
center right |
6 |
bottom left |
7 |
bottom center |
8 |
bottom right |
The system of measurement, the unit label format and the speed unit ("Units").
{
"measurement": {
"system": { "value": 0 },
"format": { "value": 0 },
"speed": { "value": "KMH" }
}
}| Field | Values | What it does |
|---|---|---|
system.value |
0..4 |
The system of measurement. |
format.value |
0..3 |
The unit label format. |
speed.value |
KMH, MPS, MPH, KNOTS, FPS
|
The speed unit. |
system.value |
System |
|---|---|
0 |
From global settings (default) |
1 |
Metric |
2 |
Imperial |
3 |
Nautical |
4 |
Mixed |
format.value |
Label format |
|---|---|
0 |
Full |
1 |
Normal |
2 |
Short |
3 |
Symbol |
speed.value |
Unit |
|---|---|
KMH |
kilometers per hour |
MPS |
meters per second |
MPH |
miles per hour |
KNOTS |
knots |
FPS |
feet per second |
The allowed units depend on the system: metric is KMH, MPS; imperial is MPH, FPS; nautical is KNOTS, MPS; mixed is any of the five. With system 0, the speed field is not used: the unit is taken from the application's global settings. If you set speed together with system 1–3, choose a unit from that system's list; if the unit is not in the list, the system switches to "Mixed".
A string that is assembled from the current speed.
{
"textTemplate": {
"template": "{currNum} {currUnit}",
"vars": {
"currNum": "%.1f",
"currUnit": "%s"
}
}
}| Field | Values | What it does |
|---|---|---|
template |
a string | The resulting text with variables in curly braces. |
vars |
an object | The variable formats. |
| Variable | Default format | What it shows |
|---|---|---|
{currNum} |
%.1f |
The current speed, already converted to the selected unit. |
{currUnit} |
%s |
The speed unit label for {currNum}. |
The "Compact" skin replaces template with {currNum}{currUnit}; the formats do not change.