diff --git a/README.md b/README.md index 7de0435a94a3a9144b2583f9118c5b0c742fa1c4..4d3b970fe534bec0d4f8bcdbc00436ec30bea09f 100644 --- a/README.md +++ b/README.md @@ -69,11 +69,16 @@ eg * `soar.*.*.*.to_platform.*` - all messages outbound to platforms (hermes) * `soar.*.slocum.#` - all messages relating to a slocum platform type -## Run Docs -Run the command below and go to `http://127.0.0.1:5000` +## Run Docs & Save Schema When Updating Message Formats +1. Run the command below and go to `http://127.0.0.1:5000` ``` python3 generate_schema_config.py ``` + +2. Copy the schema generated `http://127.0.0.1:5000/soar_protocol.json` into the `backbone-message-format/project/<project_name>/swagger.json` + +3. In the json copied, remove the key `"definitions"` from the schema and save this. + ## Run Tests Run both tests below: 1. Test 1 diff --git a/examples/autonomy_engine_adapter/survey.json b/examples/autonomy_engine_adapter/survey.json index e715942a2c7e532dd2ae7a3098c88bd6b9967634..21ee23f9f4b6ef155fb8830abc6f1d647027ddf0 100644 --- a/examples/autonomy_engine_adapter/survey.json +++ b/examples/autonomy_engine_adapter/survey.json @@ -15,6 +15,12 @@ "longitude_A": -10.122, "latitude_B": 178.2, "longitude_B": -10.122, + "latitude_C": 177.9, + "longitude_C": -10.122, + "latitude_D": 178.2, + "longitude_D": -11.122, + "latitude_E": 179.2, + "longitude_E": -11.122, "platform_ID": "ecosub-2", "track_ID": 12 } diff --git a/examples/ecosub_adapter/survey.json b/examples/ecosub_adapter/survey.json new file mode 100644 index 0000000000000000000000000000000000000000..21ee23f9f4b6ef155fb8830abc6f1d647027ddf0 --- /dev/null +++ b/examples/ecosub_adapter/survey.json @@ -0,0 +1,28 @@ +{ + "header": { + "message_ID": "e1237003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2023-03-16T00:00:00Z", + "version": 2, + "source": "ecosub.ecosub-c2", + "destination": "soar.planet-ocean.ecosub.ecosub-2.from_platform.survey", + "delivery_type": "publish", + "encoded": false + }, + "payload": { + "message_type": "survey", + "timestamp": "2026-12-21T00:00:00Z", + "latitude_A": 188.1, + "longitude_A": -10.122, + "latitude_B": 178.2, + "longitude_B": -10.122, + "latitude_C": 177.9, + "longitude_C": -10.122, + "latitude_D": 178.2, + "longitude_D": -11.122, + "latitude_E": 179.2, + "longitude_E": -11.122, + "platform_ID": "ecosub-2", + "track_ID": 12 + } +} + \ No newline at end of file diff --git a/examples/ecosub_adapter/survey_encoded.json b/examples/ecosub_adapter/survey_encoded.json new file mode 100644 index 0000000000000000000000000000000000000000..19eaf7b6c9871c3e9b503e05bcb588bb3934208b --- /dev/null +++ b/examples/ecosub_adapter/survey_encoded.json @@ -0,0 +1,19 @@ +{ + "header": { + "message_ID": "t1237003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2023-03-16T00:00:00Z", + "version": 2, + "source": "hermes.ecosub-2", + "destination": "soar.noc.autosub.alr-52.from_platform.survey_encoded", + "delivery_type": "publish", + "encoded": true + }, + "payload": { + "message_type": "survey_encoded", + "data": "HWYFBAAD+zwBySUAAAADVek72v1N2lUAAAAA9P2cP166ab+9cg==", + "file_name": "ecosub2-survey-data_03837434286438.sbd", + "mime_type": "application/gzip", + "is_binary": true + } + } + \ No newline at end of file diff --git a/formats/survey.py b/formats/survey.py index c73dcd29c0564d63fa23fe422918dee3146951a6..ed59a5de1626ddaba154e65ce2246398a8272cf3 100644 --- a/formats/survey.py +++ b/formats/survey.py @@ -48,6 +48,60 @@ survey_schema = { ), "example": -10.122, }, + "latitude_C": { + "type": "number", + "format": "float", + "description": ( + "Latitude of point C(intersection of normal)" + + "from waypoint C to survey line" + ), + "example": 178.2, + }, + "longitude_C": { + "type": "number", + "format": "float", + "description": ( + "Longitude of point C(intersection of normal)" + + "from waypoint C to survey line" + ), + "example": -10.122, + }, + "latitude_D": { + "type": "number", + "format": "float", + "description": ( + "Latitude of point D(intersection of normal)" + + "from waypoint D to survey line" + ), + "example": 178.2, + }, + "longitude_D": { + "type": "number", + "format": "float", + "description": ( + "Longitude of point D(intersection of normal)" + + "from waypoint D to survey line" + ), + "example": -10.122, + }, + "latitude_E": { + "type": "number", + "format": "float", + "description": ( + "Latitude of point E(intersection of normal)" + + "from waypoint E to survey line" + ), + "example": 178.2, + }, + "longitude_E": { + "type": "number", + "format": "float", + "description": ( + "Longitude of point E(intersection of normal)" + + "from waypoint E to survey line" + ), + "example": -10.122, + }, "platform_ID": { "type": "string", "description": "Unique identifier for this platform", diff --git a/project/soar/swagger.json b/project/soar/swagger.json index 01f985f1d91cee1b6489f4931e523c6b22b7e6b6..e99a8438b8cde2fb7ee15d4c516a1289fcd2e55d 100644 --- a/project/soar/swagger.json +++ b/project/soar/swagger.json @@ -896,6 +896,24 @@ "format":"float", "type":"number" }, + "latitude_C":{ + "description":"Latitude of point C(intersection of normal)from waypoint C to survey line", + "example":178.2, + "format":"float", + "type":"number" + }, + "latitude_D":{ + "description":"Latitude of point D(intersection of normal)from waypoint D to survey line", + "example":178.2, + "format":"float", + "type":"number" + }, + "latitude_E":{ + "description":"Latitude of point E(intersection of normal)from waypoint E to survey line", + "example":178.2, + "format":"float", + "type":"number" + }, "longitude_A":{ "description":"Longitude of point A(intersection of normal)from waypoint A to survey line", "example":-10.122, @@ -908,6 +926,24 @@ "format":"float", "type":"number" }, + "longitude_C":{ + "description":"Longitude of point C(intersection of normal)from waypoint C to survey line", + "example":-10.122, + "format":"float", + "type":"number" + }, + "longitude_D":{ + "description":"Longitude of point D(intersection of normal)from waypoint D to survey line", + "example":-10.122, + "format":"float", + "type":"number" + }, + "longitude_E":{ + "description":"Longitude of point E(intersection of normal)from waypoint E to survey line", + "example":-10.122, + "format":"float", + "type":"number" + }, "platform_ID":{ "description":"Unique identifier for this platform", "example":"ecosub-2",