From 0235cfe8f5296b57d4dae9206d290543c7994a06 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Sun, 23 Sep 2018 19:31:10 +0200 Subject: [PATCH] added more functionality when connected to the base station --- qml/main.qml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/qml/main.qml b/qml/main.qml index 02af994..7a329c4 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -135,8 +135,6 @@ Window { else if(type === "raw"){ return(time) } - - } } @@ -147,17 +145,28 @@ Window { interval: 1 onTriggered: { if(root.state === "RUNNING"){ + var baseReactTime = parseInt(baseConn.sendCommand("GET_REACTTIME")) + if(baseReactTime !== 0){ + root.last_run.react_time = baseReactTime + } time.text = baseConn.getTime("readable") + " sec" if(baseConn.sendCommand("GET_TIMER_STATE") === "STOPPED"){ root.stop("manual") } } if(root.state === "STARTING"){ - if(baseConn.sendCommand("GET_TIMER_STATE") === "RUNNING"){ + var baseReactTime = parseInt(baseConn.sendCommand("GET_REACTTIME")) + if(baseReactTime !== 0){ + root.last_run.react_time = baseReactTime + } + var baseState = baseConn.sendCommand("GET_TIMER_STATE") + if(baseState === "RUNNING"){ root.state = "RUNNING"; } + else if(baseState === "STOPPED"){ + root.state = "STOPPED" + } } - start() } } @@ -777,6 +786,7 @@ Window { root.stoppedTime = baseConn.getTime("raw") time.text = (root.stoppedTime / 1000).toFixed(3) + " sec" + baseConn.sendCommand("CMD_STOP_TIMER") root.state = "STOPPED" return } @@ -787,6 +797,7 @@ Window { break case "false": //the cancel button was pressed + root.last_run.reaction_time = parseInt(baseConn.sendCommand("GET_REACTTIME")) root.stoppedTime = 0 time.text = "false start" root.state = "STOPPED"