Skip to content
Snippets Groups Projects
Commit 8bf6a766 authored by Fernando Herrero's avatar Fernando Herrero
Browse files

Update html

parent ae3ebf43
No related branches found
No related tags found
No related merge requests found
var timer_running = false; 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 // Convert time to a format of hours, minutes, seconds, and milliseconds
function timeToString(time) { function timeToString(time) {
...@@ -42,6 +42,7 @@ function startStop() ...@@ -42,6 +42,7 @@ function startStop()
{ {
timer_running = true; timer_running = true;
start(); start();
timer_string = "00:00:00";
document.getElementById("startStop").innerHTML = "STOP"; document.getElementById("startStop").innerHTML = "STOP";
document.getElementById('startStop').style.backgroundColor="#e23047"; document.getElementById('startStop').style.backgroundColor="#e23047";
document.getElementById('clear_timer_button').disabled=true; document.getElementById('clear_timer_button').disabled=true;
...@@ -51,7 +52,7 @@ function startStop() ...@@ -51,7 +52,7 @@ function startStop()
{ {
timer_running = false; timer_running = false;
clearInterval(timerInterval); clearInterval(timerInterval);
attempt_time_param.set(time_string); attempt_time_param.set(timer_string);
elapsedTime = 0; elapsedTime = 0;
document.getElementById("startStop").innerHTML = "START"; document.getElementById("startStop").innerHTML = "START";
document.getElementById('startStop').style.backgroundColor="SeaGreen"; document.getElementById('startStop').style.backgroundColor="SeaGreen";
...@@ -64,10 +65,10 @@ function start() { ...@@ -64,10 +65,10 @@ function start() {
startTime = Date.now() - elapsedTime; startTime = Date.now() - elapsedTime;
timerInterval = setInterval(function printTime() { timerInterval = setInterval(function printTime() {
elapsedTime = Date.now() - startTime; elapsedTime = Date.now() - startTime;
time_string = timeToString(elapsedTime); timer_string = timeToString(elapsedTime);
print(timeToString(elapsedTime)); print(timeToString(elapsedTime));
localStorage.setItem('attempt_time', time_string); localStorage.setItem('attempt_time', timer_string);
attempt_time_param.set(time_string); attempt_time_param.set(timer_string);
}, 10); }, 10);
//showButton("PAUSE"); //showButton("PAUSE");
} }
...@@ -79,10 +80,10 @@ function pause() { ...@@ -79,10 +80,10 @@ function pause() {
function reset() { function reset() {
//clearInterval(timerInterval); //clearInterval(timerInterval);
time_string = "00:00:00"; timer_string = "00:00:00";
print(time_string); print(timer_string);
localStorage.setItem('attempt_time', time_string); localStorage.setItem('attempt_time', timer_string);
attempt_time_param.set(time_string); attempt_time_param.set(timer_string);
elapsedTime = 0; elapsedTime = 0;
//showButton("PLAY"); //showButton("PLAY");
} }
......
...@@ -131,21 +131,21 @@ ...@@ -131,21 +131,21 @@
var set_building1_service_client = new ROSLIB.Service({ var set_building1_service_client = new ROSLIB.Service({
ros : ros, ros : ros,
name : '/jury/set_building1', name : '/jury/hospital_light',
serviceType : 'std_srvs/SetBool' serviceType : 'std_srvs/SetBool'
}); });
var set_building2_service_client = new ROSLIB.Service({ var set_building2_service_client = new ROSLIB.Service({
ros : ros, ros : ros,
name : '/jury/set_building2', name : '/jury/seat_home_light',
serviceType : 'std_srvs/SetBool' serviceType : 'std_srvs/SetBool'
}); });
var set_building3_service_client = new ROSLIB.Service({ var set_building3_service_client = new ROSLIB.Service({
ros : ros, ros : ros,
name : '/jury/set_building3', name : '/jury/school_light',
serviceType : 'std_srvs/SetBool' serviceType : 'std_srvs/SetBool'
}); });
...@@ -565,7 +565,7 @@ ...@@ -565,7 +565,7 @@
{ {
if(text!=last_feedback_line) if(text!=last_feedback_line)
{ {
var time = "[" + time_string + "]: "; var time = "[" + timer_string + "]: ";
feedback_text = time + text + '\n' + feedback_text ; feedback_text = time + text + '\n' + feedback_text ;
document.getElementById("feedback_text").innerHTML = feedback_text; document.getElementById("feedback_text").innerHTML = feedback_text;
...@@ -1177,10 +1177,10 @@ ...@@ -1177,10 +1177,10 @@
<main role="main" class="mycontainer" > <main role="main" class="mycontainer" >
<div class="row"> <div class="row">
<div style="width: 40%"> <div style="width: 40%">
Team &nbsp &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <label>Team</label>
<input type="number" id="team_input" min="0" max="4" step="1" style="width: 2em" value="1" onchange="update_team()"> <input type="number" id="team_input" min="0" max="4" step="1" style="width: 2em" value="1" onchange="update_team()">
<!--<br>--> <!--<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()"> <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"> <select id="challenge_input2" name="challenge_input2">
...@@ -1276,15 +1276,15 @@ ...@@ -1276,15 +1276,15 @@
<hr> <hr>
<div class="row"> <div class="row">
<div style="width: 50%"> <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-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> <button class="btn btn-dark btn-semaphore" id="building1_off" onclick="building1_off()">off</button>
<br> <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-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> <button class="btn btn-dark btn-semaphore" id="building2_off" onclick="building2_off()">off</button>
<br> <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-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> <button class="btn btn-dark btn-semaphore" id="building3_off" onclick="building3_off()">off</button>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment