From b0189c04da813e539c8df67cd3ac768deaea42a0 Mon Sep 17 00:00:00 2001 From: Teppo Kurki Date: Thu, 30 Dec 2021 10:05:31 +0200 Subject: [PATCH 1/2] feature: additional sensors.ais.class values Implemented as pattern for value/values structure. --- schemas/groups/sensors.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schemas/groups/sensors.json b/schemas/groups/sensors.json index 43f552e0..046935d7 100644 --- a/schemas/groups/sensors.json +++ b/schemas/groups/sensors.json @@ -32,8 +32,8 @@ "class": { "$ref": "../definitions.json#/definitions/stringValue", - "pattern_": "^[AB]\\Z", - "description": "AIS transponder class in sensors.ais.class, A or B" + "pattern_": "^[AB]$|^ATON$|^SAR$|^BASE$", + "description": "AIS transponder class in sensors.ais.class" } } } From 65ba70f2c158e48864ca16960987491412ddf4ca Mon Sep 17 00:00:00 2001 From: Teppo Kurki Date: Thu, 30 Dec 2021 10:09:42 +0200 Subject: [PATCH 2/2] feature: additional AtoN fields Add virtual and offPosition flags. Add booleanValue value/values definition. --- schemas/aton.json | 9 +++++++ schemas/definitions.json | 39 ++++++++++++++++++++++++++++ test/data/full-valid/ais.json | 48 +++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) diff --git a/schemas/aton.json b/schemas/aton.json index bc447c35..5edc0b91 100644 --- a/schemas/aton.json +++ b/schemas/aton.json @@ -193,6 +193,15 @@ } ] }, + "virtual": { + "$ref": "./definitions.json#/definitions/booleanValue", + "description": "Virtual AtoN flag" + }, + + "offPosition": { + "$ref": "./definitions.json#/definitions/booleanValue", + "description": "Off position flag" + }, "name": { "type": "string", "description": "The aton name", diff --git a/schemas/definitions.json b/schemas/definitions.json index 5ead5550..c205d2d4 100644 --- a/schemas/definitions.json +++ b/schemas/definitions.json @@ -414,6 +414,45 @@ } }, + "booleanValue": { + "type": "object", + "description": "Data should be of type boolean.", + "allOf": [{ + "$ref": "#/definitions/commonValueFields" + }, { + "properties": { + "value": { + "type": "boolean" + }, + "values": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/valuesBooleanValue" + } + } + } + } + }] + }, + + "valuesBooleanValue": { + "type": "object", + "properties": { + "value": { + "type": "boolean" + }, + "timestamp": { + "$ref": "#/definitions/timestamp" + }, + "pgn": { + "type": "number" + }, + "sentence": { + "type": "string" + } + } + }, "datetimeValue": { "type": "object", diff --git a/test/data/full-valid/ais.json b/test/data/full-valid/ais.json index a62eab5d..e7b3ae43 100644 --- a/test/data/full-valid/ais.json +++ b/test/data/full-valid/ais.json @@ -95,6 +95,54 @@ } } }, + "aton": { + "urn:mrn:imo:mmsi:993672315": { + "mmsi": "993672315", + "name": "SW @", + "navigation": { + "position": { + "value": { + "longitude": -76.3847132, + "latitude": 38.99384 + }, + "$source": ".43", + "timestamp": "2017-03-14T19:02:40.451Z", + "pgn": 129041 + } + }, + "atonType": { + "value": { + "id": 13, + "name": "Beacon, Port Hand" + }, + "$source": ".43", + "timestamp": "2017-03-14T19:02:40.451Z", + "pgn": 129041 + }, + "virtual": { + "value": true, + "$source": ".43", + "timestamp": "2017-03-14T19:02:40.451Z", + "pgn": 129041 + }, + "offPosition": { + "value": false, + "$source": ".43", + "timestamp": "2017-03-14T19:02:40.451Z", + "pgn": 129041 + }, + "sensors": { + "ais": { + "class": { + "value": "ATON", + "$source": ".43", + "timestamp": "2017-03-14T19:02:40.451Z", + "pgn": 129041 + } + } + } + } + }, "self": "urn:mrn:imo:mmsi:246326000", "version": "0.1.0", "sources": {