Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Communications Backbone System
backbone-message-format
Commits
9bf07ff3
Verified
Commit
9bf07ff3
authored
1 year ago
by
Dan Jones
Browse files
Options
Download
Email Patches
Plain Diff
lint: run black
parent
0bc01bdd
2 merge requests
!30
Resolve "Release v0.2"
,
!29
Resolve "SPINE Support"
Pipeline
#181851
passed with stages
in 1 minute and 3 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
21 deletions
+17
-21
formats/alert.py
formats/alert.py
+5
-5
formats/platform_status.py
formats/platform_status.py
+3
-5
tests/fixtures/schemas.py
tests/fixtures/schemas.py
+9
-11
No files found.
formats/alert.py
View file @
9bf07ff3
...
...
@@ -10,7 +10,7 @@ alert_schema = {
"example"
:
"alert"
,
"enum"
:
[
"alert"
],
},
"code"
:
{
# changed from alert_ID because reasons
"code"
:
{
# changed from alert_ID because reasons
"type"
:
"integer"
,
"description"
:
"Alert code"
,
"example"
:
345
,
...
...
@@ -26,10 +26,10 @@ alert_schema = {
"description"
:
"Timestamp for onboard platform status message"
,
"example"
:
"2022-12-21T00:00:00Z"
,
},
"subsystem"
:
{
# changed from suggested "source" could be device / subsystem or something
"subsystem"
:
{
# changed from suggested "source" could be device / subsystem or something
"type"
:
"string"
,
"description"
:
"System that generated the alert"
,
"example"
:
"Onboard Fault Monitor"
,
"example"
:
"Onboard Fault Monitor"
,
},
"summary"
:
{
"type"
:
"string"
,
...
...
@@ -39,8 +39,8 @@ alert_schema = {
"details"
:
{
"type"
:
"string"
,
"description"
:
"Detailed reason for the alert "
,
"example"
:
"Discrepancy between rudder and actuator positions"
+
" : Rudder Pos=10.31°, Steering Actuator Pos=28.65°, Discrepancy=18.33°"
,
"example"
:
"Discrepancy between rudder and actuator positions"
+
" : Rudder Pos=10.31°, Steering Actuator Pos=28.65°, Discrepancy=18.33°"
,
},
"severity"
:
{
"type"
:
"string"
,
...
...
This diff is collapsed.
Click to expand it.
formats/platform_status.py
View file @
9bf07ff3
...
...
@@ -170,9 +170,8 @@ platform_status_schema = {
"description"
:
"Battery remaining % provided by respective C2"
,
"example"
:
80.2
,
},
# Battery power (kw / float)
"battery_output"
:
{
# changed from battery_power
"battery_output"
:
{
# changed from battery_power
"type"
:
"number"
,
"format"
:
"float"
,
"description"
:
"Battery output in kW"
,
...
...
@@ -180,7 +179,7 @@ platform_status_schema = {
},
# Bunkers remaining capacity (litres, float)
# Bunkers percentage full (percentage, float)
# battery_remaining_capacity is % full if we want both these fields
# battery_remaining_capacity is % full if we want both these fields
# these names are going to cause confusion
"fuel_remaining_capacity"
:
{
"type"
:
"number"
,
...
...
@@ -198,11 +197,10 @@ platform_status_schema = {
"endurance"
:
{
"type"
:
"number"
,
"format"
:
"float"
,
"description"
:
"Estimate of hours of operation remaining "
"description"
:
"Estimate of hours of operation remaining "
+
"based on present output or performance"
,
"example"
:
7.4
,
},
"sensor_config"
:
sensor_schema
,
},
"required"
:
[
...
...
This diff is collapsed.
Click to expand it.
tests/fixtures/schemas.py
View file @
9bf07ff3
...
...
@@ -592,9 +592,8 @@ platform_status_schema = {
"description"
:
"Battery remaining % provided by respective C2"
,
"example"
:
80.2
,
},
# Battery power (kw / float)
"battery_output"
:
{
# changed from battery_power
"battery_output"
:
{
# changed from battery_power
"type"
:
"number"
,
"format"
:
"float"
,
"description"
:
"Battery output in kW"
,
...
...
@@ -602,7 +601,7 @@ platform_status_schema = {
},
# Bunkers remaining capacity (litres, float)
# Bunkers percentage full (percentage, float)
# battery_remaining_capacity is % full if we want both these fields
# battery_remaining_capacity is % full if we want both these fields
# these names are going to cause confusion
"fuel_remaining_capacity"
:
{
"type"
:
"number"
,
...
...
@@ -620,11 +619,10 @@ platform_status_schema = {
"endurance"
:
{
"type"
:
"number"
,
"format"
:
"float"
,
"description"
:
"Estimate of hours of operation remaining "
"description"
:
"Estimate of hours of operation remaining "
+
"based on present output or performance"
,
"example"
:
7.4
,
},
"sensor_config"
:
sensor_schema
,
},
"required"
:
[
...
...
@@ -646,7 +644,7 @@ alert_schema = {
"example"
:
"alert"
,
"enum"
:
[
"alert"
],
},
"code"
:
{
# changed from alert_ID because reasons
"code"
:
{
# changed from alert_ID because reasons
"type"
:
"integer"
,
"description"
:
"Alert code"
,
"example"
:
345
,
...
...
@@ -662,10 +660,10 @@ alert_schema = {
"description"
:
"Timestamp for onboard platform status message"
,
"example"
:
"2022-12-21T00:00:00Z"
,
},
"subsystem"
:
{
# changed from suggested "source" could be device / subsystem or something
"subsystem"
:
{
# changed from suggested "source" could be device / subsystem or something
"type"
:
"string"
,
"description"
:
"System that generated the alert"
,
"example"
:
"Onboard Fault Monitor"
,
"example"
:
"Onboard Fault Monitor"
,
},
"summary"
:
{
"type"
:
"string"
,
...
...
@@ -675,8 +673,8 @@ alert_schema = {
"details"
:
{
"type"
:
"string"
,
"description"
:
"Detailed reason for the alert "
,
"example"
:
"Discrepancy between rudder and actuator positions"
+
" : Rudder Pos=10.31°, Steering Actuator Pos=28.65°, Discrepancy=18.33°"
,
"example"
:
"Discrepancy between rudder and actuator positions"
+
" : Rudder Pos=10.31°, Steering Actuator Pos=28.65°, Discrepancy=18.33°"
,
},
"severity"
:
{
"type"
:
"string"
,
...
...
@@ -691,4 +689,4 @@ alert_schema = {
"code"
,
"severity"
,
],
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment