diff --git a/html/js/timer.js b/html/js/timer.js index c633048c836603731f90af0c2f0d7a446501e61d..5ff2fb9b81cd3e03e8d9f371ae8f44e5344a12ef 100644 --- a/html/js/timer.js +++ b/html/js/timer.js @@ -1,5 +1,5 @@ var timer_running = false; -var time_string="00:00:00"; +var timer_string="00:00:00"; // Convert time to a format of hours, minutes, seconds, and milliseconds function timeToString(time) { @@ -42,6 +42,7 @@ function startStop() { timer_running = true; start(); + timer_string = "00:00:00"; document.getElementById("startStop").innerHTML = "STOP"; document.getElementById('startStop').style.backgroundColor="#e23047"; document.getElementById('clear_timer_button').disabled=true; @@ -51,7 +52,7 @@ function startStop() { timer_running = false; clearInterval(timerInterval); - attempt_time_param.set(time_string); + attempt_time_param.set(timer_string); elapsedTime = 0; document.getElementById("startStop").innerHTML = "START"; document.getElementById('startStop').style.backgroundColor="SeaGreen"; @@ -64,10 +65,10 @@ function start() { startTime = Date.now() - elapsedTime; timerInterval = setInterval(function printTime() { elapsedTime = Date.now() - startTime; - time_string = timeToString(elapsedTime); + timer_string = timeToString(elapsedTime); print(timeToString(elapsedTime)); - localStorage.setItem('attempt_time', time_string); - attempt_time_param.set(time_string); + localStorage.setItem('attempt_time', timer_string); + attempt_time_param.set(timer_string); }, 10); //showButton("PAUSE"); } @@ -79,10 +80,10 @@ function pause() { function reset() { //clearInterval(timerInterval); - time_string = "00:00:00"; - print(time_string); - localStorage.setItem('attempt_time', time_string); - attempt_time_param.set(time_string); + timer_string = "00:00:00"; + print(timer_string); + localStorage.setItem('attempt_time', timer_string); + attempt_time_param.set(timer_string); elapsedTime = 0; //showButton("PLAY"); } diff --git a/html/jury.html b/html/jury.html index 1f778abd8f01292fdf5f0f3bfa4ef9a0aba379b4..783e8dda107a99252d735a1726ba77f4852da79e 100644 --- a/html/jury.html +++ b/html/jury.html @@ -131,21 +131,21 @@ var set_building1_service_client = new ROSLIB.Service({ ros : ros, - name : '/jury/set_building1', + name : '/jury/hospital_light', serviceType : 'std_srvs/SetBool' }); var set_building2_service_client = new ROSLIB.Service({ ros : ros, - name : '/jury/set_building2', + name : '/jury/seat_home_light', serviceType : 'std_srvs/SetBool' }); var set_building3_service_client = new ROSLIB.Service({ ros : ros, - name : '/jury/set_building3', + name : '/jury/school_light', serviceType : 'std_srvs/SetBool' }); @@ -565,7 +565,7 @@ { if(text!=last_feedback_line) { - var time = "[" + time_string + "]: "; + var time = "[" + timer_string + "]: "; feedback_text = time + text + '\n' + feedback_text ; document.getElementById("feedback_text").innerHTML = feedback_text; @@ -1177,10 +1177,10 @@ <main role="main" class="mycontainer" > <div class="row"> <div style="width: 40%"> - Team          + <label>Team</label> <input type="number" id="team_input" min="0" max="4" step="1" style="width: 2em" value="1" onchange="update_team()"> <!--<br>--> - Challenge + <label>Challenge</label> <input type="number" id="challenge_input" min="0" max="4" step="1" style="width: 2em" value="1" onchange="update_challenge()"> <!-- <select id="challenge_input2" name="challenge_input2"> @@ -1276,15 +1276,15 @@ <hr> <div class="row"> <div style="width: 50%"> - Building 1 + <label style="width: 80px;">Hospital</label> <button class="btn btn-light btn-semaphore" id="building1_on" onclick="building1_on()">on</button> <button class="btn btn-dark btn-semaphore" id="building1_off" onclick="building1_off()">off</button> <br> - Building 2 + <label style="width: 80px;">SEAT</label> <button class="btn btn-light btn-semaphore" id="building2_on" onclick="building2_on()">on</button> <button class="btn btn-dark btn-semaphore" id="building2_off" onclick="building2_off()">off</button> <br> - Building 3 + <label style="width: 80px;">School</label> <button class="btn btn-light btn-semaphore" id="building3_on" onclick="building3_on()">on</button> <button class="btn btn-dark btn-semaphore" id="building3_off" onclick="building3_off()">off</button> </div>