OpenMarine
start clock / start line dashboard - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: Node Red (https://forum.openmarine.net/forumdisplay.php?fid=15)
+--- Thread: start clock / start line dashboard (/showthread.php?tid=3412)



start clock / start line dashboard - Accablant - 2021-04-27

I have been planning to make simple start clock / start line dashboard with node red, so that both input through touch and info could be shared btw multiple screens (at least by mast and by the helm, possibly also on mobiles synced to same network). Dash T already has this kind of functionality but to me its approach seems a bit too complex for a typical beer can race use. The same things can be found from SailRacer.net but there the usage is limited to an app. The timer part should not be too hard and Turf.js has tools for measuring distance to a line etc, but maybe getting this easily done is just wishful thinking. The info can be shared through Signal K, although just accessing the same dashboard on multiple devices could do the trick. Any advises / thoughts on this?


RE: start clock / start line dashboard - Accablant - 2021-04-29

The first crude version of the start clock done. Needs visual polishing (e.g. bigger size of numbers) but even this would do I think. The code below if some on is interested. 



****

[{"id":"a1ce90e8.3919c","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"a8a4805c.a7da4","type":"ui_button","z":"a1ce90e8.3919c","name":"5 Min","group":"abc45751.2dc208","order":2,"width":"2","height":"2","passthru":false,"label":"5 Min","tooltip":"","color":"blue","bgcolor":"White","icon":"","payload":"true","payloadType":"bool","topic":"topic","topicType":"msg","x":70,"y":80,"wires":[["f4bcbabc.3308b8","32ab5b2a.e9fc24"]]},{"id":"f4bcbabc.3308b8","type":"countdown","z":"a1ce90e8.3919c","name":"","topic":"","payloadTimerStart":"true","payloadTimerStartType":"bool","payloadTimerStop":"false","payloadTimerStopType":"bool","timer":"300","resetWhileRunning":true,"setTimeToNewWhileRunning":true,"startCountdownOnControlMessage":false,"x":650,"y":80,"wires":[["63cae013.f34dc"],["d3ad6b0b.bf2598"]]},{"id":"d3ad6b0b.bf2598","type":"function","z":"a1ce90e8.3919c","name":"fmtMSS","func":"function fancyTimeFormat(duration)\n{   \n    // Hours, minutes and seconds\n    var hrs = ~~(duration / 3600);\n    var mins = ~~((duration % 3600) / 60);\n    var secs = ~~duration % 60;\n\n    // Output like \"1:01\" or \"4:03:59\" or \"123:03:59\"\n    var ret = \"\";\n\n    if (hrs > 0) {\n        ret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\n    }\n\n    ret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\n    ret += \"\" + secs;\n    return ret;\n}\n\nmsg.payload = fancyTimeFormat(msg.payload);\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":900,"y":200,"wires":[["63cae013.f34dc"]]},{"id":"63cae013.f34dc","type":"ui_text","z":"a1ce90e8.3919c","group":"abc45751.2dc208","order":1,"width":"6","height":"3","name":"","label":"","format":"{{msg.payload}}","layout":"row-spread","x":855,"y":320,"wires":[],"l":false},{"id":"8cc3911e.095d4","type":"ui_button","z":"a1ce90e8.3919c","name":"","group":"abc45751.2dc208","order":5,"width":"6","height":"1","passthru":false,"label":"Reset","tooltip":"","color":"White","bgcolor":"Red","icon":"","payload":"false","payloadType":"bool","topic":"topic","topicType":"msg","x":70,"y":420,"wires":[["32ab5b2a.e9fc24","f016ab6d.094c68","38b1119.c2328ee"]]},{"id":"3a006463.b7f62c","type":"ui_button","z":"a1ce90e8.3919c","name":"4 Min","group":"abc45751.2dc208","order":3,"width":"2","height":"2","passthru":false,"label":"4 Min","tooltip":"","color":"White","bgcolor":"Blue","icon":"","payload":"true","payloadType":"bool","topic":"topic","topicType":"msg","x":70,"y":160,"wires":[["45fd8c79.dbfdc4","f016ab6d.094c68"]]},{"id":"45fd8c79.dbfdc4","type":"countdown","z":"a1ce90e8.3919c","name":"","topic":"","payloadTimerStart":"true","payloadTimerStartType":"bool","payloadTimerStop":"false","payloadTimerStopType":"bool","timer":"240","resetWhileRunning":false,"setTimeToNewWhileRunning":true,"startCountdownOnControlMessage":false,"x":650,"y":160,"wires":[[],["d3ad6b0b.bf2598"]]},{"id":"f016ab6d.094c68","type":"change","z":"a1ce90e8.3919c","name":"Stop countd 2","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":220,"wires":[["f4bcbabc.3308b8","4f03cb31.cd4864"]]},{"id":"32ab5b2a.e9fc24","type":"change","z":"a1ce90e8.3919c","name":"Stop countd 1","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":120,"wires":[["45fd8c79.dbfdc4","4f03cb31.cd4864"]]},{"id":"e8daa4f8.c30738","type":"ui_button","z":"a1ce90e8.3919c","name":"1 Min","group":"abc45751.2dc208","order":4,"width":"2","height":"2","passthru":false,"label":"1 Min","tooltip":"","color":"White","bgcolor":"green","icon":"","payload":"true","payloadType":"bool","topic":"topic","topicType":"msg","x":70,"y":260,"wires":[["4f03cb31.cd4864","38b1119.c2328ee"]]},{"id":"4f03cb31.cd4864","type":"countdown","z":"a1ce90e8.3919c","name":"","topic":"","payloadTimerStart":"true","payloadTimerStartType":"bool","payloadTimerStop":"false","payloadTimerStopType":"bool","timer":"60","resetWhileRunning":false,"setTimeToNewWhileRunning":true,"startCountdownOnControlMessage":false,"x":650,"y":260,"wires":[[],["d3ad6b0b.bf2598"]]},{"id":"38b1119.c2328ee","type":"change","z":"a1ce90e8.3919c","name":"Stop Countd 3","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":320,"wires":[["45fd8c79.dbfdc4","f4bcbabc.3308b8"]]},{"id":"abc45751.2dc208","type":"ui_group","name":"Timer buttons","tab":"923e6acb.6645f8","order":1,"disp":false,"width":"6","collapse":false},{"id":"923e6acb.6645f8","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]