Skip to content

Commit

Permalink
renamed plugin to Tidal Dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
marcobergman committed Mar 28, 2022
1 parent 739e76a commit afa33f5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
9 changes: 4 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>SignalK Waterlevels</title>
<title>SignalK Tidal Dashboard</title>
<style>
* {font-family: Consolas, monospace}
#data tr:nth-child(odd) { background-color: #f2f2f2;}
Expand Down Expand Up @@ -89,7 +89,7 @@


function printSignalkTable(signalkData) {
var result = "<table border=0><tr><td><b>Station<td width=100><b>Astro<td width=100><b>Level (MSL)<td width=100 colspan=2><b>Trend/10min<td></tr>";
var result = "<table border=0><tr><td><b>Station<td width=100><b>Astro<td width=100><b>Level (MSL)<td width=100 colspan=2><b>Trend/10min<td><b>Next</tr>";

total = 0.0
divider = 0.0
Expand All @@ -109,7 +109,7 @@
divider += weighingFactor
}
average = total / divider
result += "<tr><td><b>THIS SHIP "+formatTimestamp(Date.now())+"<td><td><b>" + average.toFixed(2) + "</td></tr>"
result += "<tr><td><b>THIS SHIP "+formatTimestamp(Date.now())+"<td><td><b><h1>" + average.toFixed(2) + "</td></tr>"

result += "</table>";
dataDiv.innerHTML = result;
Expand Down Expand Up @@ -143,8 +143,7 @@
longitude: schema[key].navigation.position.value['longitude'],
nextExtreme: schema[key].environment.nextExtreme.value,
tidalTrend: schema[key].environment.tidalTrend.value,
waterlevel: "",
trend: "" }
waterlevel: schema[key].environment.depth.belowSurface.value }
stations[key] = position
} catch (error) {console.log(schema, error)}

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/


const PLUGIN_ID = 'sk-waterlevels';
const PLUGIN_ID = 'sk-tidal-dashboard';
const _ = require("lodash");

const {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "sk-waterlevels",
"name": "sk-tidal-dashboard",
"version": "1.0.1",
"description": "SignalK node server plugin that reads tidal data from the internet and displays it in a web app.",
"main": "index.js",
Expand All @@ -17,5 +17,5 @@
"dateformat": "^5.0.3",
"fast-csv": "^4.3.6"
},
"repository": "https://github.com/marcobergman/sk-waterlevels"
"repository": "https://github.com/marcobergman/sk-tidal-dashboard"
}
4 changes: 2 additions & 2 deletions postInstall.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

const fs = require("fs");

const TARGET = "../../plugin-config-data/sk-waterlevels.json";
const SOURCE = "./sk-waterlevels.json";
const TARGET = "../../plugin-config-data/sk-tidal-dashboard.json";
const SOURCE = "./sk-tidal-dashboard.json";

if (fs.existsSync(TARGET)) {
console.log(TARGET, "exists");
Expand Down
2 changes: 1 addition & 1 deletion tidaldata.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function updateStations(app) {
}
if (streamState[stationName].status == LOOKING_FOR_NEXT_EXTREME)
if (tide != currentTide) {
nextExtreme = streamState[stationName].previousTimeStamp + " " + currentTide + " " + streamState[stationName].previousWaterLevel
nextExtreme = currentTide + " " + streamState[stationName].previousTimeStamp + " " + streamState[stationName].previousWaterLevel
console.log(stationName, "nextExtreme", nextExtreme)
app.handleMessage('my-signalk-plugin', {context: 'aton.' + stationName, updates: [ {values:
[ { path: 'environment.nextExtreme', value: nextExtreme } ]
Expand Down

0 comments on commit afa33f5

Please sign in to comment.