@@ -257,111 +257,23 @@ $(document).ready(function () {
257257 socket . emit ( "services switch" , { "name" : "rtcm_svr" , "active" : switchStatus } ) ;
258258 } )
259259
260- // #################### RTCM TCP client service Switch #########################
261-
262- var rtcmClientSwitch = $ ( '#rtcm_client-switch' ) ;
263- // set the switch to on/off depending of the service status
264- if ( servicesStatus [ 5 ] . active === true ) {
265- //document.querySelector("#main-switch").bootstrapToggle('on');
266- rtcmClientSwitch . bootstrapToggle ( 'on' , true ) ;
267- } else {
268- //document.querySelector("#main-switch").bootstrapToggle('off');
269- rtcmClientSwitch . bootstrapToggle ( 'off' , true ) ;
270- }
271- //console.log(servicesStatus[3]);
272- if ( servicesStatus [ 5 ] . btn_color ) {
273- rtcmClientSwitch . bootstrapToggle ( 'setOnStyle' , servicesStatus [ 5 ] . btn_color ) ;
274- }
275- if ( servicesStatus [ 5 ] . btn_off_color ) {
276- rtcmClientSwitch . bootstrapToggle ( 'setOffStyle' , servicesStatus [ 5 ] . btn_off_color ) ;
277- }
278-
279- // event for switching on/off service on user mouse click
280- //TODO When the switch changes its position, this event seems attached before
281- //the switch finish its transition, then fire another event.
282- $ ( "#rtcm_client-switch" ) . one ( "change" , function ( e ) {
283- var switchStatus = $ ( this ) . prop ( 'checked' ) ;
284- //console.log(" e : " + e);
285- //console.log("RTCM Client SwitchStatus : " + switchStatus);
286- socket . emit ( "services switch" , { "name" : "rtcm_client" , "active" : switchStatus } ) ;
287- } )
288-
289- // #################### RTCM UDP server service Switch #########################
290-
291- var rtcmUdpSvrSwitch = $ ( '#rtcm_udp_svr-switch' ) ;
292- // set the switch to on/off depending of the service status
293- if ( servicesStatus [ 6 ] . active === true ) {
294- //document.querySelector("#main-switch").bootstrapToggle('on');
295- rtcmUdpSvrSwitch . bootstrapToggle ( 'on' , true ) ;
296- } else {
297- //document.querySelector("#main-switch").bootstrapToggle('off');
298- rtcmUdpSvrSwitch . bootstrapToggle ( 'off' , true ) ;
299- }
300- //console.log(servicesStatus[3]);
301- if ( servicesStatus [ 6 ] . btn_color ) {
302- rtcmUdpSvrSwitch . bootstrapToggle ( 'setOnStyle' , servicesStatus [ 6 ] . btn_color ) ;
303- }
304- if ( servicesStatus [ 6 ] . btn_off_color ) {
305- rtcmUdpSvrSwitch . bootstrapToggle ( 'setOffStyle' , servicesStatus [ 6 ] . btn_off_color ) ;
306- }
307-
308- // event for switching on/off service on user mouse click
309- //TODO When the switch changes its position, this event seems attached before
310- //the switch finish its transition, then fire another event.
311- $ ( "#rtcm_udp_svr-switch" ) . one ( "change" , function ( e ) {
312- var switchStatus = $ ( this ) . prop ( 'checked' ) ;
313- //console.log(" e : " + e);
314- //console.log("RTCM UDP Server SwitchStatus : " + switchStatus);
315- socket . emit ( "services switch" , { "name" : "rtcm_udp_svr" , "active" : switchStatus } ) ;
316- } )
317-
318- // #################### RTCM UDP client service Switch #########################
319-
320- var rtcmUdpClientSwitch = $ ( '#rtcm_udp_client-switch' ) ;
321- // set the switch to on/off depending of the service status
322- if ( servicesStatus [ 6 ] . active === true ) {
323- //document.querySelector("#main-switch").bootstrapToggle('on');
324- rtcmUdpClientSwitch . bootstrapToggle ( 'on' , true ) ;
325- } else {
326- //document.querySelector("#main-switch").bootstrapToggle('off');
327- rtcmUdpClientSwitch . bootstrapToggle ( 'off' , true ) ;
328- }
329- //console.log(servicesStatus[3]);
330- if ( servicesStatus [ 6 ] . btn_color ) {
331- rtcmUdpClientSwitch . bootstrapToggle ( 'setOnStyle' , servicesStatus [ 6 ] . btn_color ) ;
332- }
333- if ( servicesStatus [ 6 ] . btn_off_color ) {
334- rtcmUdpClientSwitch . bootstrapToggle ( 'setOffStyle' , servicesStatus [ 6 ] . btn_off_color ) ;
335- }
336-
337- // event for switching on/off service on user mouse click
338- //TODO When the switch changes its position, this event seems attached before
339- //the switch finish its transition, then fire another event.
340- $ ( "#rtcm_udp_client-switch" ) . one ( "change" , function ( e ) {
341- var switchStatus = $ ( this ) . prop ( 'checked' ) ;
342- //console.log(" e : " + e);
343- //console.log("RTCM UDP Client SwitchStatus : " + switchStatus);
344- socket . emit ( "services switch" , { "name" : "rtcm_udp_client" , "active" : switchStatus } ) ;
345- } )
346-
347-
348260 // #################### Serial RTCM service Switch #########################
349261
350262 var rtcmSerialSwitch = $ ( '#rtcm_serial-switch' ) ;
351263 // set the switch to on/off depending of the service status
352- if ( servicesStatus [ 8 ] . active === true ) {
264+ if ( servicesStatus [ 5 ] . active === true ) {
353265 //document.querySelector("#main-switch").bootstrapToggle('on');
354266 rtcmSerialSwitch . bootstrapToggle ( 'on' , true ) ;
355267 } else {
356268 //document.querySelector("#main-switch").bootstrapToggle('off');
357269 rtcmSerialSwitch . bootstrapToggle ( 'off' , true ) ;
358270 }
359271 //console.log(servicesStatus[4]);
360- if ( servicesStatus [ 8 ] . btn_color ) {
361- rtcmSerialSwitch . bootstrapToggle ( 'setOnStyle' , servicesStatus [ 8 ] . btn_color ) ;
272+ if ( servicesStatus [ 5 ] . btn_color ) {
273+ rtcmSerialSwitch . bootstrapToggle ( 'setOnStyle' , servicesStatus [ 5 ] . btn_color ) ;
362274 }
363- if ( servicesStatus [ 8 ] . btn_off_color ) {
364- rtcmSerialSwitch . bootstrapToggle ( 'setOffStyle' , servicesStatus [ 8 ] . btn_off_color ) ;
275+ if ( servicesStatus [ 5 ] . btn_off_color ) {
276+ rtcmSerialSwitch . bootstrapToggle ( 'setOffStyle' , servicesStatus [ 5 ] . btn_off_color ) ;
365277 }
366278
367279 // event for switching on/off service on user mouse click
@@ -378,19 +290,19 @@ $(document).ready(function () {
378290
379291 var fileSwitch = $ ( '#file-switch' ) ;
380292 // set the switch to on/off depending of the service status
381- if ( servicesStatus [ 9 ] . active === true ) {
293+ if ( servicesStatus [ 6 ] . active === true ) {
382294 //document.querySelector("#main-switch").bootstrapToggle('on');
383295 fileSwitch . bootstrapToggle ( 'on' , true ) ;
384296 } else {
385297 //document.querySelector("#main-switch").bootstrapToggle('off');
386298 fileSwitch . bootstrapToggle ( 'off' , true ) ;
387299 }
388300 //console.log(servicesStatus[5]);
389- if ( servicesStatus [ 9 ] . btn_color ) {
390- fileSwitch . bootstrapToggle ( 'setOnStyle' , servicesStatus [ 9 ] . btn_color ) ;
301+ if ( servicesStatus [ 6 ] . btn_color ) {
302+ fileSwitch . bootstrapToggle ( 'setOnStyle' , servicesStatus [ 6 ] . btn_color ) ;
391303 }
392- if ( servicesStatus [ 9 ] . btn_off_color ) {
393- fileSwitch . bootstrapToggle ( 'setOffStyle' , servicesStatus [ 9 ] . btn_off_color ) ;
304+ if ( servicesStatus [ 6 ] . btn_off_color ) {
305+ fileSwitch . bootstrapToggle ( 'setOffStyle' , servicesStatus [ 6 ] . btn_off_color ) ;
394306 }
395307
396308 // event for switching on/off service on user mouse click
0 commit comments