Open eckhchri opened 9 years ago
Make such code obsolete: if (APIMODE == "DS"){ aDrivers = Receive_DS_data(DsServerURL, DsPort, 2000, "GETDRIVERDATE"); }else{ aDrivers = Receive_DS_data(CRESTServerURL, CRESTPort, 2000, "GETCRESTDRIVERDATA"); }
better to use:
aDrivers = Receive_DS_data(aAPIMODEMAPPING[APIMODE] [url], aAPIMODEMAPPING[APIMODE] [port] , aAPIMODEMAPPING[APIMODE] [delay], aAPIMODEMAPPING[APIMODE][driverdata]);
use API MODE Object:
aAPIMODEMAPPING = {
'DS' : { 'driverdata' : GETDRIVERDATE, 'tracklist' : GETTRACKLIST, 'url' : 'www.eckhchri.de', 'port' : '80' 'delay' : 2000, 'firstdelay' : 100, 'svgduration' 600 }, 'CREST' { 'driverdate' : GETCRESTDRIVERDATA, 'tracklist' : GETTRACKLIST, 'url' : 'localhost', 'port' : '8080' 'delay' : 100, 'firstdelay' : 10 'svgduration' 200 } }
Make such code obsolete: if (APIMODE == "DS"){ aDrivers = Receive_DS_data(DsServerURL, DsPort, 2000, "GETDRIVERDATE"); }else{ aDrivers = Receive_DS_data(CRESTServerURL, CRESTPort, 2000, "GETCRESTDRIVERDATA"); }
better to use:
aDrivers = Receive_DS_data(aAPIMODEMAPPING[APIMODE] [url], aAPIMODEMAPPING[APIMODE] [port] , aAPIMODEMAPPING[APIMODE] [delay], aAPIMODEMAPPING[APIMODE][driverdata]);
use API MODE Object:
aAPIMODEMAPPING = {