-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmapping.schema.json
More file actions
117 lines (117 loc) · 3.19 KB
/
Copy pathmapping.schema.json
File metadata and controls
117 lines (117 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://spaceteam.at/ferroflow/schemas/mapping.schema.json",
"title": "FerroFlow Mapping",
"description": "TOML schema for FerroFlow node mapping files.",
"type": "object",
"required": ["mapping"],
"additionalProperties": false,
"properties": {
"mapping": {
"type": "object",
"description": "Mappings grouped by LiquidCAN node/device name.",
"minProperties": 1,
"additionalProperties": false,
"patternProperties": {
".+": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/$defs/mappingEntry"
}
}
}
}
},
"$defs": {
"mappingEntry": {
"type": "object",
"additionalProperties": false,
"required": ["name", "type", "raw_field"],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "Unique application-facing mapping name."
},
"type": {
"type": "string",
"enum": ["telemetry", "parameter"],
"description": "Whether the raw field is telemetry or a writable parameter."
},
"raw_field": {
"type": "string",
"minLength": 1,
"description": "Raw LiquidCAN field name on the enclosing node."
},
"value": {
"$ref": "#/$defs/valueParams"
},
"logical": {
"type": "array",
"description": "Logical labels for mapped numeric ranges. Runtime validation requires these ranges to be non-overlapping.",
"items": {
"$ref": "#/$defs/logicalRule"
}
}
}
},
"valueParams": {
"type": "object",
"additionalProperties": false,
"required": ["slope", "offset"],
"properties": {
"slope": {
"type": "number",
"not": { "const": 0 },
"default": 1.0,
"description": "Linear conversion slope: mapped = raw * slope + offset."
},
"offset": {
"type": "number",
"default": 0.0,
"description": "Linear conversion offset: mapped = raw * slope + offset."
},
"unit": {
"type": "string",
"default": ""
}
}
},
"logicalRule": {
"type": "object",
"additionalProperties": false,
"required": ["range", "value"],
"properties": {
"range": {
"$ref": "#/$defs/logicalRange"
},
"value": {
"description": "Logical value returned when the mapped numeric value is inside the range."
}
}
},
"logicalRange": {
"type": "object",
"additionalProperties": false,
"properties": {
"min": {
"type": "number",
"description": "Lower bound. Omit for an unbounded lower range."
},
"max": {
"type": "number",
"description": "Upper bound. Omit for an unbounded upper range."
},
"min_inclusive": {
"type": "boolean",
"default": true
},
"max_inclusive": {
"type": "boolean",
"default": false
}
}
}
}
}