diff --git a/app/modules/alux_connect.json b/app/modules/alux_connect.json index 8cbfe19dd..836b56c5c 100644 --- a/app/modules/alux_connect.json +++ b/app/modules/alux_connect.json @@ -7,32 +7,34 @@ "platform": ["win32"], "icon" : "alux_connect.png", "module": "alux_connect.js", - "driver": [{ - "win32-ia32": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.exe", - "win32-x64": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.exe", - "translate": "드라이버 설치1"}, + "driver": [ { - "win32-ia32": "Easy_Down_Entry/PROBO Easy Down Entry ver8.41.msi", - "win32-x64": "Easy_Down_Entry/PROBO Easy Down Entry ver8.41.msi", - "translate": "드라이버 설치2"} - ], + "win32-ia32": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.exe", + "win32-x64": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.exe", + "translate": "CH34x 드라이버" + }, + { + "win32-ia32": "Easy_Down_Entry/PROBO Easy Down Entry ver8.41.msi", + "win32-x64": "Easy_Down_Entry/PROBO Easy Down Entry ver8.41.msi", + "translate": "Easy Down Entry 드라이버" + } + ], "url": "https://www.probo.kr/", - "email": "tkddnjs10@naver.com", + "email": " contact@imssam.me", "reconnect": true, "selectPort": true, "hardware": { - "type": "serial", - "control": "slave", - "duration": 32, - "baudRate": 115200 , - "vendor": "Probo", - "firmwarecheck": true, - "parity" : "none", - "dataBits" : 8, - "stopBits" : 1, - "bufferSize" : 255, - "delimiter" : "", - "flowControl" : "Connect" + "type": "serial", + "control": "slave", + "duration": 32, + "baudRate": 115200, + "vendor": "Probo", + "firmwarecheck": true, + "parity" : "none", + "dataBits" : 8, + "stopBits" : 1, + "bufferSize" : 255, + "delimiter" : "", + "flowControl" : "Connect" } - } \ No newline at end of file diff --git a/app/modules/alux_technic_normal.json b/app/modules/alux_technic_normal.json index f99c1660e..99bb73eb5 100644 --- a/app/modules/alux_technic_normal.json +++ b/app/modules/alux_technic_normal.json @@ -11,12 +11,12 @@ { "win32-ia32": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.exe", "win32-x64": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.exe", - "translate": "드라이버 설치1" + "translate": "CH34x 드라이버" }, { "win32-ia32": "Easy_Down_Entry/PROBO Easy Down Entry ver8.41.msi", "win32-x64": "Easy_Down_Entry/PROBO Easy Down Entry ver8.41.msi", - "translate": "드라이버 설치2" + "translate": "Easy Down Entry 드라이버" } ], "url": "https://www.aluxonline.com/", @@ -32,4 +32,4 @@ "softwareReset": false, "firmwarecheck": false } -} \ No newline at end of file +} diff --git a/app/modules/alux_technic_power.json b/app/modules/alux_technic_power.json index 393f91db3..da937d1d6 100644 --- a/app/modules/alux_technic_power.json +++ b/app/modules/alux_technic_power.json @@ -11,12 +11,12 @@ { "win32-ia32": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.exe", "win32-x64": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.exe", - "translate": "드라이버 설치1" + "translate": "CH34x 드라이버" }, { "win32-ia32": "Easy_Down_Entry/PROBO Easy Down Entry ver8.41.msi", "win32-x64": "Easy_Down_Entry/PROBO Easy Down Entry ver8.41.msi", - "translate": "드라이버 설치2" + "translate": "Easy Down Entry 드라이버" } ], "url": "https://www.aluxonline.com/", @@ -32,4 +32,4 @@ "softwareReset": false, "firmwarecheck": false } -} \ No newline at end of file +} diff --git a/app/modules/iotsmartfarm.js b/app/modules/iotsmartfarm.js new file mode 100644 index 000000000..be89615b8 --- /dev/null +++ b/app/modules/iotsmartfarm.js @@ -0,0 +1,318 @@ +function Module() { + this.tx_d = new Array(22); + this.rx_d = new Array(22); + this.timeCheck = null; + + this.sensordata = { + hum: 0, + heatertemp: 0, + temp: 0, + soil: 0, + cds: 0, + switch1: 0, + switch2: 0, + switch3: 0 + }; + + + this.motordata = { + control: 0, + led1: 0, + led2: 0, + led3: 0, + led4: 0, + led5: 0, + led6: 0, + display1: 0, + display2: 0, + display3: 0, + display4: 0, + display5: 0, + display6: 0, + display7: 0, + display8: 0, + display9: 0, + isSend: 0, + switch: 0 + }; +} + +var IOTSMARTFARM = { + CONTROL: 'control', + LED1: 'led1', + LED2: 'led2', + LED3: 'led3', + LED4: 'led4', + LED5: 'led5', + LED6: 'led6', + DISPLAY1: 'display1', + DISPLAY2: 'display2', + DISPLAY3: 'display3', + DISPLAY4: 'display4', + DISPLAY5: 'display5', + DISPLAY6: 'display6', + DISPLAY7: 'display7', + DISPLAY8: 'display8', + DISPLAY9: 'display9', + SWITCH: 'switch' +}; + +Module.prototype.init = function(handler, config) { + //console.log(this.motoring.lcdTxt); +}; + +Module.prototype.lostController = function() {} + +Module.prototype.eventController = function(state) { + if (state === 'connected') { + clearInterval(this.sensing); + } +} + +Module.prototype.setSerialPort = function(sp) { + this.sp = sp; +}; + + +Module.prototype.requestInitialData = function(sp) { + var tx_d = this.tx_d; + tx_d[0] = 0x02; // Start + tx_d[1] = 16; // Data length + tx_d[2] = 0; // Checksum + tx_d[3] = 0; // Comm ID H + tx_d[4] = 0; // Comm ID L + tx_d[5] = 0; // Control Field + tx_d[6] = 0; // bit 0~3 : LED 1 R, bit 4~7 : LED 1 G + tx_d[7] = 0; // bit 0~3 : LED 1 B, bit 4~7 : LED 2 R + tx_d[8] = 0; // bit 0~3 : LED 2 G, bit 4~7 : LED 2 B + tx_d[9] = 0; // bit 0~3 : LED 3 R, bit 4~7 : LED 3 G + tx_d[10] = 0; // bit 0~3 : LED 3 B, bit 4~7 : LED 4 R + tx_d[11] = 0; // bit 0~3 : LED 4 G, bit 4~7 : LED 4 B + tx_d[12] = 0; // Display + tx_d[13] = 0; // Display + tx_d[14] = 0; // Display + tx_d[15] = 0; // Display + tx_d[16] = 0; // Display + tx_d[17] = 0; // Display + tx_d[18] = 0; // Display + tx_d[19] = 0; // Display + tx_d[20] = 0; // Display + tx_d[21] = 0x03; // End + return tx_d; +}; + +Module.prototype.checkInitialData = function(data, config) { + return true; +}; + + +// 하드웨어 데이터 처리 +Module.prototype.handleLocalData = function(data) { // data: Native Buffer + var sensordata = this.sensordata; + var motordata = this.motordata; + + for (var i = 0; i < data.length; i++) { + var str = data[i]; + this.rx_d[i] = parseInt(str, 10); + } + + if(this.rx_d[1] == 16) { + if((this.rx_d[17] == 0) && (this.rx_d[18] == 0) && (this.rx_d[19] == 0) && (this.rx_d[20] == 0)) { + if((this.rx_d[0] == 0x02) && (this.rx_d[21] == 0x03)) + { + if((this.rx_d[3] == 0x01) && (this.rx_d[4] == 0x01)) { + sensordata.hum = ((this.rx_d[6] << 8) | this.rx_d[5]) / 100; + sensordata.heatertemp = ((this.rx_d[8] << 8) | this.rx_d[7]) / 100; + sensordata.temp = ((this.rx_d[10] << 8) | this.rx_d[9]) / 100; + sensordata.soil = ((this.rx_d[12] << 8) | this.rx_d[11]); + sensordata.cds = ((this.rx_d[14] << 8) | this.rx_d[13]); + sensordata.switch1 = (this.rx_d[16] & 0x01) == 0x01 ? 1 : 0; + sensordata.switch2 = (this.rx_d[16] & 0x02) == 0x02 ? 1 : 0; + sensordata.switch3 = (this.rx_d[16] & 0x04) == 0x04 ? 1 : 0; + } + } + } + } +}; + +// Web Socket(엔트리)에 전달할 데이터 +Module.prototype.requestRemoteData = function(handler) { + var sensordata = this.sensordata; + for (var key in sensordata) { + handler.write(key, sensordata[key]); + } +}; + +// Web Socket 데이터 처리 +Module.prototype.handleRemoteData = function(handler) { + var motordata = this.motordata; + var newValue; + + if (handler.e(IOTSMARTFARM.CONTROL)) { + newValue = handler.read(IOTSMARTFARM.CONTROL); + + if (motordata.control != newValue) { + motordata.control = newValue; + } + } + + if (handler.e(IOTSMARTFARM.LED1)) { + newValue = handler.read(IOTSMARTFARM.LED1); + + if (motordata.led1 != newValue) { + motordata.led1 = newValue; + } + } + + if (handler.e(IOTSMARTFARM.LED2)) { + newValue = handler.read(IOTSMARTFARM.LED2); + + if (motordata.led2 != newValue) { + motordata.led2 = newValue; + } + } + + if (handler.e(IOTSMARTFARM.LED3)) { + newValue = handler.read(IOTSMARTFARM.LED3); + if (motordata.led3 != newValue) { + motordata.led3 = newValue; + } + } + + if (handler.e(IOTSMARTFARM.LED4)) { + newValue = handler.read(IOTSMARTFARM.LED4); + + if (motordata.led4 != newValue) { + motordata.led4 = newValue; + } + } + + if (handler.e(IOTSMARTFARM.LED5)) { + newValue = handler.read(IOTSMARTFARM.LED5); + + if (motordata.led5 != newValue) { + motordata.led5 = newValue; + } + } + + if (handler.e(IOTSMARTFARM.LED6)) { + newValue = handler.read(IOTSMARTFARM.LED6); + + if (motordata.led6 != newValue) { + motordata.led6 = newValue; + } + } + + if (handler.e(IOTSMARTFARM.DISPLAY1)) { + newValue = handler.read(IOTSMARTFARM.DISPLAY1); + if (motordata.display1 != newValue) { + motordata.display1 = newValue; + } + } + + if (handler.e(IOTSMARTFARM.DISPLAY2)) { + newValue = handler.read(IOTSMARTFARM.DISPLAY2); + + if (motordata.display2 != newValue) { + motordata.display2 = newValue; + } + } + + if (handler.e(IOTSMARTFARM.DISPLAY3)) { + newValue = handler.read(IOTSMARTFARM.DISPLAY3); + + if (motordata.display3 != newValue) { + motordata.display3 = newValue; + } + } + + if (handler.e(IOTSMARTFARM.DISPLAY4)) { + newValue = handler.read(IOTSMARTFARM.DISPLAY4); + + if (motordata.display4 != newValue) { + motordata.display4 = newValue; + } + } + + if (handler.e(IOTSMARTFARM.DISPLAY5)) { + newValue = handler.read(IOTSMARTFARM.DISPLAY5); + + if (motordata.display5 != newValue) { + motordata.display5 = newValue; + } + } + + if (handler.e(IOTSMARTFARM.DISPLAY6)) { + newValue = handler.read(IOTSMARTFARM.DISPLAY6); + + if (motordata.display6 != newValue) { + motordata.display6 = newValue; + } + } + + if (handler.e(IOTSMARTFARM.DISPLAY7)) { + newValue = handler.read(IOTSMARTFARM.DISPLAY7); + + if (motordata.display7 != newValue) { + motordata.display7 = newValue; + } + } + + if (handler.e(IOTSMARTFARM.DISPLAY8)) { + newValue = handler.read(IOTSMARTFARM.DISPLAY8); + + if (motordata.display8 != newValue) { + motordata.display8 = newValue; + } + } + + if (handler.e(IOTSMARTFARM.DISPLAY9)) { + newValue = handler.read(IOTSMARTFARM.DISPLAY9); + + if (motordata.display9 != newValue) { + motordata.display9 = newValue; + } + } +}; + +// 하드웨어에 전달할 데이터 +Module.prototype.requestLocalData = function() { + var motordata = this.motordata; + var tx_d = this.tx_d; + + tx_d[0] = 0x02; // Start + tx_d[1] = 16; // Data length + tx_d[2] = 0; // Checksum + tx_d[3] = 0x01; // Comm ID H + tx_d[4] = 0x01; // Comm ID L + tx_d[5] = motordata.control; // Control Field + tx_d[6] = motordata.led1; // bit 0~3 : LED 1 R, bit 4~7 : LED 1 G + tx_d[7] = motordata.led2; // bit 0~3 : LED 1 B, bit 4~7 : LED 2 R + tx_d[8] = motordata.led3; // bit 0~3 : LED 2 G, bit 4~7 : LED 2 B + tx_d[9] = motordata.led4; // bit 0~3 : LED 3 R, bit 4~7 : LED 3 G + tx_d[10] = motordata.led5; // bit 0~3 : LED 3 B, bit 4~7 : LED 4 R + tx_d[11] = motordata.led6; // bit 0~3 : LED 4 G, bit 4~7 : LED 4 B + tx_d[12] = motordata.display1; // Display + tx_d[13] = motordata.display2; // Display + tx_d[14] = motordata.display3; // Display + tx_d[15] = motordata.display4; // Display + tx_d[16] = motordata.display5; // Display + tx_d[17] = motordata.display6; // Display + tx_d[18] = motordata.display7; // Display + tx_d[19] = motordata.display8; // Display + tx_d[20] = motordata.display9; // Display + tx_d[21] = 0x03; // End + + var checksum = 0; + for(var i = 3; i < 21; i++){ + checksum += tx_d[i]; + } + + tx_d[2] = checksum & 0xFF; + return tx_d; +}; + +Module.prototype.reset = function () { +}; + +module.exports = new Module(); diff --git a/app/modules/iotsmartfarm.json b/app/modules/iotsmartfarm.json new file mode 100644 index 000000000..8f34e8619 --- /dev/null +++ b/app/modules/iotsmartfarm.json @@ -0,0 +1,22 @@ +{ + "id": "180301", + "name": { + "en": "IOT SmartFarm", + "ko": "IOT스마트팜" + }, + "category": "robot", + "platform": ["win32", "darwin"], + "icon": "iotsmartfarm.png", + "module": "iotsmartfarm.js", + "url": "http://saeon.co.kr/", + "email": "saeon@saeon.co.kr", + "reconnect": true, + "selectPort": true, + "hardware": { + "type": "serial", + "control": "slave", + "vendor": "Microsoft", + "duration": 100, + "baudRate": 115200 + } +} diff --git a/app/modules/iotsmartfarm.png b/app/modules/iotsmartfarm.png new file mode 100644 index 000000000..25d8294a7 Binary files /dev/null and b/app/modules/iotsmartfarm.png differ diff --git a/app/modules/pingpong_g1.json b/app/modules/pingpong_g1.json index 55309e917..2534d6c0d 100644 --- a/app/modules/pingpong_g1.json +++ b/app/modules/pingpong_g1.json @@ -29,7 +29,7 @@ "type": "bluetooth", "control": "slave", "duration": 50, - "lostTimer": 1000, + "lostTimer": 4000, "vendor": "Microsoft", "firmwarecheck": false, "baudRate": 115200 diff --git a/app/modules/pingpong_g2.json b/app/modules/pingpong_g2.json index 056b216fc..b8d42c2c3 100644 --- a/app/modules/pingpong_g2.json +++ b/app/modules/pingpong_g2.json @@ -29,7 +29,7 @@ "type": "bluetooth", "control": "slave", "duration": 50, - "lostTimer": 1000, + "lostTimer": 4000, "vendor": "Microsoft", "baudRate": 115200 } diff --git a/app/modules/pingpong_g3.json b/app/modules/pingpong_g3.json index 0c210f479..3398ea5c6 100644 --- a/app/modules/pingpong_g3.json +++ b/app/modules/pingpong_g3.json @@ -29,7 +29,7 @@ "type": "bluetooth", "control": "slave", "duration": 50, - "lostTimer": 1000, + "lostTimer": 4000, "vendor": "Microsoft", "baudRate": 115200 } diff --git a/app/modules/pingpong_g4.json b/app/modules/pingpong_g4.json index c6a57cd74..fb62c9aa4 100644 --- a/app/modules/pingpong_g4.json +++ b/app/modules/pingpong_g4.json @@ -29,7 +29,7 @@ "type": "bluetooth", "control": "slave", "duration": 50, - "lostTimer": 1000, + "lostTimer": 4000, "vendor": "Microsoft", "baudRate": 115200 } diff --git a/app/modules/robolink_ZumiMini.json b/app/modules/robolink_ZumiMini.json index df5911abd..c30036100 100644 --- a/app/modules/robolink_ZumiMini.json +++ b/app/modules/robolink_ZumiMini.json @@ -5,12 +5,13 @@ "ko": "로보링크 주미 미니" }, "category": "robot", - "platform": ["win32"], + "platform": ["win32", "darwin"], "icon": "robolink_ZumiMini.png", "module": "robolink_ZumiMini.js", "driver": { "win32-ia32": "CH34x_install_Windows_v3_4/CH34x_install_Windows_v3_4.EXE", - "win32-x64": "CH34x_install_Windows_v3_4/CH34x_install_Windows_v3_4.EXE" + "win32-x64": "CH34x_install_Windows_v3_4/CH34x_install_Windows_v3_4.EXE", + "darwin-x64": "https://entrylabs.github.io/docs/files/drivers/CH34x_Install_MAC_10_9_AND_ABOVE/CH34x_Install_V1.3.pkg" }, "url": "https://www.robolink.co.kr/", "email": "asteam@robolink.co.kr", diff --git a/app/modules/whalesbot_eagle_1001.js b/app/modules/whalesbot_eagle_1001.js index bda48fae1..3bf0e6a48 100644 --- a/app/modules/whalesbot_eagle_1001.js +++ b/app/modules/whalesbot_eagle_1001.js @@ -5,7 +5,7 @@ class WhalebotsEagle1001 extends BaseModule { // Declare the fields to be used inside the class. constructor() { super(); - + this.sp = null; this.isConnect = false; @@ -38,18 +38,18 @@ class WhalebotsEagle1001 extends BaseModule { 'Stop': 2, } this.runCode = [ - 0x77,0x78,0x66,0x1,0x2,0x2,0x3,0x3,0x4,0x4,0x5,0x5, - 0x6,0x6,0x7,0x7,0x8,0x8,0x9,0x9,0xa,0xa,0xb,0xb,0xc,0xc, + 0x77,0x78,0x66,0x1,0x2,0x2,0x3,0x3,0x4,0x4,0x5,0x5, + 0x6,0x6,0x7,0x7,0x8,0x8,0x9,0x9,0xa,0xa,0xb,0xb,0xc,0xc, 0xd,0xd,0xe,0xe,0xf,0xf,0x10,0x10,0x11,0x11,0x12,0x12,0x13, - 0x13,0x14,0x14,0x15,0x15,0x16,0x16,0x17,0x17,0x18,0x18, - 0x19,0x19,0x1a,0x1a,0x1b,0x1b,0x1c,0x1c,0x1d,0x1d,0x1e,0x1e, - 0x1f,0x1f,0x20,0x20,0x21,0x21,0x22,0x22,0x23,0x23,0x24,0x24, - 0x25,0x25,0x26,0x26,0x27,0x27,0x28,0x28,0x29,0x29,0x2a,0x2a, - 0x2b,0x2b,0x2c,0x2c,0x2d,0x2d,0x2e,0x2e,0x2f,0x2f,0x30,0x30, - 0x31,0x31,0x32,0x32,0x33,0x33,0x34,0x34,0x35,0x35,0x36,0x36, - 0x37,0x37,0x38,0x38,0x39,0x39,0x3a,0x3a,0x3b,0x3b,0x3c,0x3c, - 0x3d,0x3d,0x3e,0x3e,0x3f,0x3f,0x40,0x40,0x41,0x41,0x42,0x42, - 0x43,0x43,0x44,0x44,0x45,0x45,0x46,0x46,0x47,0x47,0x48,0x48, + 0x13,0x14,0x14,0x15,0x15,0x16,0x16,0x17,0x17,0x18,0x18, + 0x19,0x19,0x1a,0x1a,0x1b,0x1b,0x1c,0x1c,0x1d,0x1d,0x1e,0x1e, + 0x1f,0x1f,0x20,0x20,0x21,0x21,0x22,0x22,0x23,0x23,0x24,0x24, + 0x25,0x25,0x26,0x26,0x27,0x27,0x28,0x28,0x29,0x29,0x2a,0x2a, + 0x2b,0x2b,0x2c,0x2c,0x2d,0x2d,0x2e,0x2e,0x2f,0x2f,0x30,0x30, + 0x31,0x31,0x32,0x32,0x33,0x33,0x34,0x34,0x35,0x35,0x36,0x36, + 0x37,0x37,0x38,0x38,0x39,0x39,0x3a,0x3a,0x3b,0x3b,0x3c,0x3c, + 0x3d,0x3d,0x3e,0x3e,0x3f,0x3f,0x40,0x40,0x41,0x41,0x42,0x42, + 0x43,0x43,0x44,0x44,0x45,0x45,0x46,0x46,0x47,0x47,0x48,0x48, 0x49,0x49,0x4a,0x4a,0x4b,0x4b,0x0,0x56 ]; @@ -278,7 +278,7 @@ class WhalebotsEagle1001 extends BaseModule { requestLocalData() { return null; } - + // Data processing from hardware handleLocalData(data) { // console.log("data received: ",data); @@ -287,7 +287,7 @@ class WhalebotsEagle1001 extends BaseModule { this.checkGetState(data) return; } - + this.waitRevData(data); } @@ -303,7 +303,7 @@ class WhalebotsEagle1001 extends BaseModule { isLockGetState(){ return this.lock; } - + connectDrone(){ this.getStateInterval = setInterval(()=>{ if(this.countDroneConnectionAttempt == 0 || !this.isLockGetState()){ @@ -313,7 +313,7 @@ class WhalebotsEagle1001 extends BaseModule { if( this.countDroneConnectionAttempt == 4){ // console.log("Connection failed"); this.countDroneConnectionAttempt = 0 ; - clearInterval(this.getStateInterval); + clearInterval(this.getStateInterval); return } } @@ -322,7 +322,7 @@ class WhalebotsEagle1001 extends BaseModule { // console.log("Drone is connected") this.isDroneConnection = true; this.countDroneConnectionAttempt = 0 ; - clearInterval(this.getStateInterval); + clearInterval(this.getStateInterval); } } },this.getStateTimeSleep) @@ -430,8 +430,8 @@ class WhalebotsEagle1001 extends BaseModule { { for(let i=0;i<=chunkData.length-1;i++) { - if(chunkData[i] == 0xff - && chunkData[i+1] == 0x42 + if(chunkData[i] == 0xff + && chunkData[i+1] == 0x42 && chunkData[i+2] == 0x43 && chunkData[i+3] == 0x43 && chunkData[i+4] == 0x44 @@ -460,7 +460,7 @@ class WhalebotsEagle1001 extends BaseModule { ret[this.BT_INDEX_CMD_SEND] = this.BT_CMD_DOWNLOAD; ret[this.BT_INDEX_DATA_SEND] = nowdwpack & 0x000000ff; ret[this.BT_INDEX_DATA_SEND + 1] = ((nowdwpack & 0x0000ff00) / 256) | 0; - + if (nowdwpack * this.packlen > Picocode.length) { ret[this.BT_INDEX_CMD_SEND] = this.BT_CMD_DOWNLOAD_END; } @@ -499,16 +499,16 @@ class WhalebotsEagle1001 extends BaseModule { Errcode2Msg(ErrorCode) { return this.errorMessages[ErrorCode] || "" } - + ErrFly2String(ErrFly) { let msg="" - const ERR_NONE =0 - const ERR_LOWBATT =this.BIT0 - const ERR_CODE =this.BIT1 - const ERR_TEMP =this.BIT3 - const ERR_SENSORS =this.BIT4 - const ERR_LOADER =this.BIT5 - const ERR_ANGLE =this.BIT6 + const ERR_NONE =0 + const ERR_LOWBATT =this.BIT0 + const ERR_CODE =this.BIT1 + const ERR_TEMP =this.BIT3 + const ERR_SENSORS =this.BIT4 + const ERR_LOADER =this.BIT5 + const ERR_ANGLE =this.BIT6 if (ErrFly == ERR_NONE){ msg=msg +"NO_Error" @@ -536,25 +536,25 @@ class WhalebotsEagle1001 extends BaseModule { Sensor2String() { let SPLIT_STRING = "------------------------------------\n" - let msg = "STATE_PITCH= " + (Math.round(this.sensor.Pitch, 3)).toString() + "\n" - msg = msg + "STATE_ROLL= " + (Math.round(this.sensor.Roll, 3)).toString() + "\n" - msg = msg + "STATE_YAW= " + (Math.round(this.sensor.Yaw, 3)).toString() + "\n" + let msg = "STATE_PITCH= " + (Math.round(this.sensor.Pitch, 3)).toString() + "\n" + msg = msg + "STATE_ROLL= " + (Math.round(this.sensor.Roll, 3)).toString() + "\n" + msg = msg + "STATE_YAW= " + (Math.round(this.sensor.Yaw, 3)).toString() + "\n" msg = msg + SPLIT_STRING - - msg = msg + "STATE_TEMP= " + (Math.round(this.sensor.SPL06_temp, 3)).toString() + "\n" - - msg = msg + "FusedHeight= " + (Math.round(this.sensor.FusedHeight, 3)).toString() + "\n" - - msg = msg + "BATTERY= " + (Math.round(this.sensor.Battery, 3)).toString() + "\n" - - msg = msg + "VER= " + this.VERSTR() + "\n" + + msg = msg + "STATE_TEMP= " + (Math.round(this.sensor.SPL06_temp, 3)).toString() + "\n" + + msg = msg + "FusedHeight= " + (Math.round(this.sensor.FusedHeight, 3)).toString() + "\n" + + msg = msg + "BATTERY= " + (Math.round(this.sensor.Battery, 3)).toString() + "\n" + + msg = msg + "VER= " + this.VERSTR() + "\n" msg = msg + SPLIT_STRING - msg = msg + "FLY_ERR= " + this.ErrFly2String(parseInt(this.sensor.ErrFly)) + "\n" - msg = msg + "LINE_NO= " + (this.sensor.LineNo) + "\n" - msg = msg + "ERROR_NO= " + (this.sensor.LineError) + "\n" - msg = msg + "ERROR_MSG= " + this.Errcode2Msg(this.sensor.ErrorCode) + "\n" - - msg = msg + "DEBUG1= " + (Math.round(this.sensor.Debug_0, 6)).toString() + "\n" + msg = msg + "FLY_ERR= " + this.ErrFly2String(parseInt(this.sensor.ErrFly)) + "\n" + msg = msg + "LINE_NO= " + (this.sensor.LineNo) + "\n" + msg = msg + "ERROR_NO= " + (this.sensor.LineError) + "\n" + msg = msg + "ERROR_MSG= " + this.Errcode2Msg(this.sensor.ErrorCode) + "\n" + + msg = msg + "DEBUG1= " + (Math.round(this.sensor.Debug_0, 6)).toString() + "\n" msg = msg + "DEBUG2= " + (Math.round(this.sensor.Debug_1, 6)).toString() + "\n" msg = msg + "DEBUG3= " + (Math.round(this.sensor.Debug_2, 6)).toString() + "\n" msg = msg + "DEBUG4= " + (Math.round(this.sensor.Debug_3, 6)).toString() + "\n" @@ -566,12 +566,12 @@ class WhalebotsEagle1001 extends BaseModule { byte2float(offset) { let buffer = new ArrayBuffer(4); let view = new DataView(buffer); - + view.setUint8(3, this.revdata[offset + 0]); view.setUint8(2, this.revdata[offset + 1]); view.setUint8(1, this.revdata[offset + 2]); view.setUint8(0, this.revdata[offset + 3]); - + return view.getFloat32(0, false); } @@ -588,7 +588,7 @@ class WhalebotsEagle1001 extends BaseModule { } } } - } + } if (revdata[this.BT_INDEX_CMD_REV] === this.BT_CMD_DOWNLOAD || revdata[this.BT_INDEX_CMD_REV] === this.BT_CMD_DOWNLOAD_END) { let isrevsame = true; @@ -634,11 +634,11 @@ class WhalebotsEagle1001 extends BaseModule { this.sensor.M2 = parseInt(revdata[this.BT_INDEX_DATA_REV + 17 * 4 + 1]) this.sensor.M3 = parseInt(revdata[this.BT_INDEX_DATA_REV + 17 * 4 + 2]) this.sensor.M4 = parseInt(revdata[this.BT_INDEX_DATA_REV + 17 * 4 + 3]) - + this.sensor.state_velocity_x = this.byte2float(this.BT_INDEX_DATA_REV + 18 * 4) this.sensor.state_velocity_y = this.byte2float(this.BT_INDEX_DATA_REV + 19 * 4) this.sensor.state_velocity_z = this.byte2float(this.BT_INDEX_DATA_REV + 20 * 4) - + this.sensor.Debug_0 = this.byte2float(this.BT_INDEX_DATA_REV + 21 * 4) this.sensor.Debug_1 = this.byte2float(this.BT_INDEX_DATA_REV + 22 * 4) this.sensor.Debug_2 = this.byte2float(this.BT_INDEX_DATA_REV + 23 * 4) @@ -646,9 +646,9 @@ class WhalebotsEagle1001 extends BaseModule { this.sensor.Debug_4 = this.byte2float(this.BT_INDEX_DATA_REV + 25 * 4) this.sensor.Debug_5 = this.byte2float(this.BT_INDEX_DATA_REV + 26 * 4) this.sensor.FusedHeight = this.byte2float(this.BT_INDEX_DATA_REV + 27 * 4) - + this.sensor.VER = parseInt(revdata[this.BT_INDEX_DATA_REV + 28 * 4 + 0]) - this.sensor.ErrFly = parseInt(revdata[this.BT_INDEX_DATA_REV + 28 * 4 + 1]) + this.sensor.ErrFly = parseInt(revdata[this.BT_INDEX_DATA_REV + 28 * 4 + 1]) let msg = this.Sensor2String(); // console.log(msg); } @@ -706,7 +706,7 @@ class WhalebotsEagle1001 extends BaseModule { } // processing of data received from the entry - handleRemoteData(handler) { + async handleRemoteData(handler) { const cmd = handler.serverData.cmd; if (!cmd) { @@ -728,7 +728,12 @@ class WhalebotsEagle1001 extends BaseModule { this.HandleRun(); break; default: - this.downloadCode(cmd); + await this.handleClean(); + await this.sleep(3000); + await this.downloadCode(cmd); + await this.sleep(4000); + await this.HandleRun(); + await this.sleep(3000); break; } } catch (error) { diff --git a/build/entry-hw.nsi b/build/entry-hw.nsi index 571e71774..530a9a8e1 100644 --- a/build/entry-hw.nsi +++ b/build/entry-hw.nsi @@ -14,7 +14,7 @@ !define PRODUCT_NAME "Entry_HW" !define PROTOCOL_NAME "entryhw" !define APP_NAME "Entry_HW.exe" -!define PRODUCT_VERSION "1.9.59" +!define PRODUCT_VERSION "1.9.60" !define PRODUCT_PUBLISHER "EntryLabs" !define PRODUCT_WEB_SITE "https://www.playentry.org/" diff --git a/package.json b/package.json index 850b7f2fc..52e2f37cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "entry-hw", - "version": "1.9.59", + "version": "1.9.60", "description": "엔트리 하드웨어 연결 프로그램", "author": "EntryLabs", "main": "./app/src/index.bundle.js",