File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -220,6 +220,23 @@ class Entry {
220220 }
221221
222222 Calculation ( ) {
223+ if ( this . data [ 0 ] [ 0 ] == '0' ) {
224+ if ( this . data [ 1 ] == '0' ) {
225+ document . getElementById ( "refree" ) . innerHTML = "INIT"
226+ }
227+ if ( this . data [ 1 ] == '1' ) {
228+ document . getElementById ( "refree" ) . innerHTML = "READY"
229+ }
230+ else if ( this . data [ 1 ] == '2' ) {
231+ document . getElementById ( "refree" ) . innerHTML = "SET"
232+ }
233+ else if ( this . data [ 1 ] == '3' ) {
234+ document . getElementById ( "refree" ) . innerHTML = "PLAY"
235+ }
236+ else if ( this . data [ 1 ] == '4' ) {
237+ document . getElementById ( "refree" ) . innerHTML = "FINISH"
238+ }
239+ }
223240 if ( this . data [ 0 ] [ 0 ] == '1' ) {
224241
225242 if ( this . statusActive == "on" ) {
Original file line number Diff line number Diff line change @@ -452,6 +452,7 @@ <h2 >Robot 5</h2>
452452 return socket ;
453453 }
454454 setInterval ( function ( ) {
455+ ws . send ( JSON . stringify ( { Num : 0 } ) ) ; // get callback for refereebox
455456 ws . send ( JSON . stringify ( { Num : 1 } ) ) ;
456457 ws . send ( JSON . stringify ( { Num : 2 } ) ) ;
457458 ws . send ( JSON . stringify ( { Num : 3 } ) ) ;
Original file line number Diff line number Diff line change @@ -168,7 +168,11 @@ func WSResponse(conn *websocket.Conn) {
168168
169169 t := time .Now ()
170170
171- if m .Num == 1 {
171+ if m .Num == 0 {
172+ dataResponse = "00," //for referee
173+ dataResponse = dataResponse + strconv .Itoa (* ref )
174+
175+ } else if m .Num == 1 {
172176 var status string
173177
174178 if times .timeR1 + timeout > t .Unix () {
You can’t perform that action at this time.
0 commit comments