Skip to content

GForceIndicator JSON

roosit edited this page Nov 15, 2026 · 1 revision

GForceIndicator JSON

Up | Code | Русский

Purpose

This page describes the persisted format of the gforce indicator in a project, in Mixel and in templates. For the user instructions on manually editing .vttp, see the page G-force JSON.

Two save modes

  • toJSON(false) — the real Mixel state: it contains the selected source and sensor, the current property values, and the size and position of the layer.
  • toJSON(true) — the template state: it contains the values that can be carried between projects. The sensor property (GForce) is saved in a template as an empty object {}: the source and sensor are picked when the indicator is added to a project.

Common indicator wrapper

The layer identifier is built from the plugin uid and the indicator name:

{
  "name": "com.velitask.plagin.official.gforce",
  "data": {
    "properties": {}
  }
}
Part Value
plugin uid com.velitask.plagin.official
indicator name gforce

Besides properties, data contains the common layer fields (visibility, transparency, nested layers, etc.); they do not belong to the indicator and are not described here. The indicator does not declare or save figures.

Real mixel state

In a real Mixel the size and position of the layer are stored next to properties. The exact shape of these State fields depends on the current runtime, so they are shown in abbreviated form. The values sourceId.value and sensorId.value are the numeric identifiers of the project source and sensor, given below as an example.

{
  "name": "com.velitask.plagin.official.gforce",
  "data": {
    "size": { "...": "layer size state" },
    "positionInParent": { "...": "layer position state" },
    "properties": {
      "GForce": {"sourceId":{"value":1},"sensorId":{"value":4}},
      "measurement": {"system":{"value":0},"format":{"value":0},"acceleration":{"value":0}},
      "scale": {"value":1},
      "direction": {"value":0},
      "trailSec": {"value":2},
      "pause": {"value":0},
      "showPeak": {"value":false},
      "fractionDigits": {"value":2},
      "background": {"color":{"r":0,"g":0,"b":0,"a":255},"transparency":{}},
      "rings": {"color":{"r":167,"g":171,"b":179,"a":255},"transparency":{}},
      "point": {"r":74,"g":144,"b":226,"a":255},
      "trail": {"r":74,"g":144,"b":226,"a":255},
      "peak": {"r":245,"g":194,"b":66,"a":255},
      "font": {"name":"Dialog","style":0,"size":30,"color":{"r":230,"g":231,"b":234,"a":255}}
    }
  }
}

Template state

In a template, maket (here auto) is stored instead of the size and position, and the sensor property is empty. The property values match the default values in the code. An unset transparency is written as an empty object {} and gives the default value when read (65 for background, 55 for rings).

{
  "name": "com.velitask.plagin.official.gforce",
  "data": {
    "maket": { "preset": "auto" },
    "properties": {
      "GForce": {},
      "measurement": {"system":{"value":0},"format":{"value":0},"acceleration":{"value":0}},
      "scale": {"value":1},
      "direction": {"value":0},
      "trailSec": {"value":2},
      "pause": {"value":0},
      "showPeak": {"value":false},
      "fractionDigits": {"value":2},
      "background": {"color":{"r":0,"g":0,"b":0,"a":255},"transparency":{}},
      "rings": {"color":{"r":167,"g":171,"b":179,"a":255},"transparency":{}},
      "point": {"r":74,"g":144,"b":226,"a":255},
      "trail": {"r":74,"g":144,"b":226,"a":255},
      "peak": {"r":245,"g":194,"b":66,"a":255},
      "font": {"name":"Dialog","style":0,"size":30,"color":{"r":230,"g":231,"b":234,"a":255}}
    }
  }
}

Properties

JSON key Java property SDK type User meaning Default
GForce mGForce GForceAtomProperty The selected G-force sensor. An empty object in a template; sourceId/sensorId in a project.
measurement mUnits MeasurementProperty The measurement system, the unit caption format and the acceleration unit. system 0, format 0, acceleration 0 (g).
scale mScale EnumArrayProperty<Scale> The circle limit. 1 (G1_5, 1.5 g).
direction mDirection EnumArrayProperty<Direction> The point direction. 0 (FELT, felt force).
trailSec mTrailSec IntegerSliderProperty The trail length, seconds. 2, range 0..10.
pause mPause EnumArrayProperty<GForcePause> Behavior in a recording pause. 0 (CENTER).
showPeak mShowPeak BooleanProperty Show the peak marker. false.
fractionDigits mFractionDigits IntegerSliderProperty Digits after the decimal point in the captions. 2, range 0..3.
background mBackground TransparentColorProperty The color of the circle and its transparency. Color 0, 0, 0, 255, transparency 65.
rings mRings TransparentColorProperty The color of the rings, axes and captions and the transparency of the lines. Color 167, 171, 179, 255, transparency 55.
point mPoint ColorProperty The point color. 74, 144, 226, 255.
trail mTrail ColorProperty The trail color. 74, 144, 226, 255.
peak mPeak ColorProperty The peak marker color. 245, 194, 66, 255.
font mText FontColorProperty Font and color of the captions. name = Dialog, style = 0, size = 30, color 230,231,234,255.

Formats of the nested values:

  • scale, direction, pause — {"value": N}, where N is the ordinal of the enum constant: Scale — 0 G1 (1 g), 1 G1_5 (1.5 g), 2 G2 (2 g), 3 G3 (3 g); Direction — 0 FELT, 1 ACCELERATION; GForcePause — 0 CENTER, 1 LAST (see GForcePause). The initial list index of scale and pause is the one shown above; direction does not set an initial value and takes the index 0.
  • trailSec, fractionDigits — {"value": N}; the setRange range limits the value only when it is entered in the settings panel; when JSON is read, the value is not clamped to the range, so it is better to stay within the bounds.
  • showPeak — {"value": true|false}.
  • background, rings — a composite property: the nested color (an object r, g, b, a) and transparency ({"value": 0..100}; 0 is opaque, 100 is fully transparent). Opacity when drawing: (100 - transparency) / 100; it is applied to color.a as a multiplier.
  • point, trail, peak — a flat object r, g, b, a, each 0..255 (without a nested color).
  • font — a flat object: name (string), style (number: 0 plain, 1 bold, 2 italic), size (integer, 1..999) and color (r, g, b, a, each 0..255).
  • measurement — a composite property without a unit key. The child keys in order: system, format, acceleration.
Key Type Values
system {"value": int} 0 from global settings, 1 metric, 2 imperial, 3 nautical, 4 mixed
format {"value": int} 0 full, 1 normal, 2 short, 3 symbol
acceleration {"value": int} the ordinal of AccelerationSystem: 0 — G (g), 1 — MPS2 (m/s²)

While system is 0, acceleration is not used: the unit is taken from the general application settings. Choosing system from 1 to 3 substitutes the default unit (G); if the saved unit differs from it, the system automatically switches to "mixed" (4).

The indicator uses neither a text template nor skins.

Examples

Limit 3 g, the "Acceleration" mode, a 5-second trail, the peak marker, no fractional part, a yellow point:

{
  "name": "com.velitask.plagin.official.gforce",
  "data": {
    "maket": { "preset": "auto" },
    "properties": {
      "GForce": {},
      "measurement": {"system":{"value":0},"format":{"value":0},"acceleration":{"value":0}},
      "scale": {"value":3},
      "direction": {"value":1},
      "trailSec": {"value":5},
      "pause": {"value":1},
      "showPeak": {"value":true},
      "fractionDigits": {"value":0},
      "background": {"color":{"r":0,"g":0,"b":0,"a":255},"transparency":{"value":40}},
      "rings": {"color":{"r":167,"g":171,"b":179,"a":255},"transparency":{}},
      "point": {"r":255,"g":214,"b":10,"a":255},
      "trail": {"r":74,"g":144,"b":226,"a":255},
      "peak": {"r":245,"g":194,"b":66,"a":255},
      "font": {"name":"Dialog","style":0,"size":30,"color":{"r":230,"g":231,"b":234,"a":255}}
    }
  }
}

Compatibility

  • VelitaskPlagin.getUID() (com.velitask.plagin.official) must not be changed without migrating saved projects.
  • Indicator.getName() (gforce) must not be changed without a migration.
  • The property names (GForce, measurement, scale, direction, trailSec, pause, showPeak, fractionDigits, background, rings, point, trail, peak, font) must not be renamed without a migration: loading goes by names.
  • The order of the Scale, Direction and GForcePause constants defines the saved indexes: the constants must not be reordered or inserted in the middle without a migration.
  • The order of the properties mostly affects the interface; renaming is more dangerous than reordering.

Clone this wiki locally