Skip to content

Commit

Permalink
chore: update to canboat v2
Browse files Browse the repository at this point in the history
  • Loading branch information
sbender9 committed Dec 22, 2023
1 parent 715d2c2 commit db69cb6
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 25 deletions.
12 changes: 6 additions & 6 deletions conversions/ais.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ module.exports = (app, plugin) => {
"pgn": 129038,
"dst": 255,
"fields": {
"Message ID": 1,
"Message ID": "Scheduled Class A position report",
"User ID": 367301250,
"Longitude": -76.3947165,
"Latitude": 39.1296167,
Expand All @@ -139,7 +139,7 @@ module.exports = (app, plugin) => {
"pgn": 129794,
"dst": 255,
"fields": {
"Message ID": 5,
"Message ID": "Static and voyage related data",
"User ID": 367301250,
"Callsign": "",
"Name": "SOME BOAT",
Expand All @@ -150,8 +150,8 @@ module.exports = (app, plugin) => {
"Draft": 4.2,
"Destination": "BALTIMORE",
"AIS version indicator": "ITU-R M.1371-1",
"DTE": "available",
"Reserved1": "1",
"DTE": "Available",
"Reserved1": 1,
"AIS Transceiver information": "Channel A VDL reception"
}
}]
Expand Down Expand Up @@ -200,13 +200,13 @@ module.exports = (app, plugin) => {
"Longitude": -76.4313882,
"Latitude": 38.5783333,
"Position Accuracy": "Low",
"AIS RAIM Flag": "in use",
"RAIM": "not in use",
"Time Stamp": "0",
"AtoN Type": "Fixed beacon: starboard hand",
"Off Position Indicator": "Yes",
"Virtual AtoN Flag": "Yes",
"Assigned Mode Flag": "Assigned mode",
"AIS Spare": "1",
"Spare": 1,
"AtoN Name": "78A"
}
}]
Expand Down
2 changes: 1 addition & 1 deletion conversions/battery.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ module.exports = (app, plugin) => {
"DC Type": "Battery",
"State of Charge": 93,
"State of Health": 60,
"Time Remaining": 12340,
"Time Remaining": "03:26:00",
"Ripple Voltage": 12
}
}]
Expand Down
16 changes: 9 additions & 7 deletions conversions/engineParameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,15 @@ module.exports = (app, plugin) => {
"Discrete Status 1": [],
"Discrete Status 2": [],
"Percent Engine Load": engLoad === null ? undefined : engLoad * 100,
"Percent Engine Torque": engTorque === null ? undefined : engTorque * 100
"Engine Load": engLoad === null ? undefined : engLoad * 100,
"Percent Engine Torque": engTorque === null ? undefined : engTorque * 100,
"Engine Torque": engTorque === null ? undefined : engTorque * 100
}]
},
tests: [{
input: [ 102733, 210, 220, 13.1, 100, 201123, 202133, 11111, 10, 20 ],
input: [ 102733, 210, 220, 13.1, 100, 201123, 202133, 11111111, 0.5, 1.0 ],
expected: [{
"prio": 2,
"prio": 2,
"pgn": 127489,
"dst": 255,
"fields": {
Expand All @@ -166,13 +168,13 @@ module.exports = (app, plugin) => {
"Temperature": 220,
"Alternator Potential": 13.1,
"Fuel Rate": -2355.2,
"Total Engine hours": 201123,
"Total Engine hours": "55:52:03",
"Coolant Pressure": 2000,
"Fuel Pressure": 111,
"Fuel Pressure": 111000,
"Discrete Status 1": [],
"Discrete Status 2": [],
"Percent Engine Load": -24,
"Percent Engine Torque": -48
"Engine Load": 50,
"Engine Torque": 100
}
}]
}]
Expand Down
2 changes: 1 addition & 1 deletion conversions/navigationdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ module.exports = (app, plugin) => {
"Course/Bearing reference": "True",
"Perpendicular Crossed": "Yes",
"Arrival Circle Entered": "No",
"Calculation Type": "Rhumb Line",
"Calculation Type": "Rhumbline",
"Bearing, Origin to Destination Waypoint": 3.1,
"Bearing, Position to Destination Waypoint": 1.23,
"Destination Waypoint Number": 5,
Expand Down
12 changes: 6 additions & 6 deletions conversions/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ module.exports = (app, plugin) => {
"Data Source Instance": 0,
"Data Source Index-Source": 0,
"Alert Occurrence Number": 0,
"Temporary Silence Status": "Not Temporary Silence",
"Acknowledge Status": "Acknowledged",
"Escalation Status": "Not Escalated",
"Temporary Silence Support": "Supported",
"Acknowledge Support": "Supported",
"Escalation Support": "Not Supported",
"Temporary Silence Status": "No",
"Acknowledge Status": "Yes",
"Escalation Status": "No",
"Temporary Silence Support": "Yes",
"Acknowledge Support": "Yes",
"Escalation Support": "No",
"Trigger Condition": "Auto",
"Threshold Status": "Threshold Exceeded",
"Alert Priority": 0,
Expand Down
6 changes: 3 additions & 3 deletions conversions/raymarineAlarms.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ module.exports = (app, plugin) => {
]}]
}],
expected: [{
"prio": 2,
"prio": 2,
"pgn": 65288,
"dst": 255,
"fields": {
"Manufacturer Code": "Raymarine",
"Industry Code": "Marine Industry",
"SID": "1",
"SID": 1,
"Alarm Status": "Alarm condition met and not silenced",
"Alarm ID": "Deep Anchor",
"Alarm Group": "Instrument",
"Alarm Priority": "1"
"Alarm Priority": 1
}
}]
}]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"url": "https://github.com/SignalK/signalk-to-nmea2000"
},
"devDependencies": {
"@canboat/canboatjs": "1.x",
"@canboat/canboatjs": "2.x",
"@signalk/github-create-release": "^1.2.1",
"chai": "^4.1.2",
"chai-json-equal": "^0.0.1",
Expand Down

0 comments on commit db69cb6

Please sign in to comment.