Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- startEvent = function () {
- var ws = new WebSocket("ws://127.0.0.1:5678/");
- ws.onmessage = function (event) {
- obj = JSON.parse(event.data);
- if ($('#Start').text() !== 'Start') {
- fio2 = parseFloat(obj.type.Ossimetro.property.O2);
- }
- if ($('#Start').text() === 'Start') {
- obj = [];
- fio2 = 0;
- }
- console.log("FIO2 ORIGINALE: ", fio2);
- if (fio2>= 90){
- startTime = null;
- }
- if (fio2<90 && !startTime) {
- startTime = Date.now()
- console.log("starttime: ",startTime)
- }
- if ((Date.now() - startTime) > 30000) {
- console.log("errore");
- startTime = null;
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement