5353 </ div >
5454
5555 < footer class ="mt-auto bg-zinc-900 text-grey-color mx-2 ">
56- < div class ="container-lg pt-2 ">
57- < span class ="text-muted float-left " id ="connection ">
56+ < div class ="container-lg pt-2 flex items-center justify-between ">
57+ < span class ="text-muted inline " id ="connection ">
5858 < pre
59- class ="text-grey-color text-sm inline "> < img class ="mr-5 w-[20px] inline " src ="{{ url_for('static', path='img/cross_red_circle.svg') }} " /> </ pre >
59+ class ="text-grey-color text-sm "> < img class ="mr-5 w-[20px] " src ="{{ url_for('static', path='img/cross_red_circle.svg') }} " /> </ pre >
6060 </ span >
6161 {% if robot_id != 0 %}
62- < span class ="text-muted float-right inline " id ="state ">
62+ < span class ="text-muted text-sm inline " id ="state ">
6363 < pre id ="state_robot "> </ pre >
6464 < pre id ="order_robot "> </ pre >
6565 </ span >
66+ < span class ="text-muted text-sm z-10 " id ="starter ">
67+ < label >
68+ < input type ="checkbox " class ="checked:accent-red-cogip checked:border-red-cogip " disabled > Starter
69+ </ label >
70+ </ span >
6671 {% endif %}
6772 </ div >
6873 </ footer >
@@ -147,9 +152,13 @@ <h5 class="text-lg font-medium text-grey-color">Score</h5>
147152 socket . on ( "connect" , function ( ) {
148153 socketModule . onConnection ( this ) ;
149154 } )
150- . on ( "disconnect" , function ( ) {
155+ . on ( "disconnect" , function ( ) {
151156 socketModule . onDisconnect ( ) ;
152157 } )
158+ . on ( "virtual" , function ( robot_id , msg ) {
159+ console . log ( ! msg )
160+ document . querySelector ( "#starter input" ) . disabled = ! msg ;
161+ } )
153162 . on ( "tool_menu" , function ( menu ) {
154163 socketModule . onMenu ( menu , "tool" , this ) ;
155164 virtualKeyboard . _actualize ( ) ;
@@ -178,8 +187,16 @@ <h5 class="text-lg font-medium text-grey-color">Score</h5>
178187 } )
179188 . on ( "obstacles" , function ( robot_id , msg ) {
180189 drawModule . updateObstacles ( robot_id , msg ) ;
190+ } )
191+ . on ( "starter_changed" , function ( robot_id , pushed ) {
192+ document . querySelector ( "#starter input" ) . checked = pushed ;
181193 } ) ;
182194
195+ // add event listener on click for starter input
196+ document . querySelector ( "#starter input" ) . addEventListener ( "click" , function ( ) {
197+ socket . emit ( "starter_changed" , this . checked ) ;
198+ } ) ;
199+
183200 if ( robotId !== 0 ) {
184201 import ( "../static/js/scoreModule.js" ) . then ( ( scoreModule ) => {
185202 socket . on ( "score" , function ( score ) {
@@ -218,11 +235,10 @@ <h5 class="text-lg font-medium text-grey-color">Score</h5>
218235 console . log ( `Delete robot ${ robot_id } dashboard` ) ;
219236 drawModule . deleteTab ( robot_id ) ;
220237 } )
221-
222238 }
223239 } ) ;
224240
225241 </ script >
226242</ body >
227243
228- </ html >
244+ </ html >
0 commit comments