diff --git a/app/drivers/Easy_Down_Entry/PROBO_Easy_Down_Entry_ver8.38_install.exe b/app/drivers/Easy_Down_Entry/PROBO_Easy_Down_Entry_ver8.38_install.exe new file mode 100644 index 000000000..ffbf80f65 Binary files /dev/null and b/app/drivers/Easy_Down_Entry/PROBO_Easy_Down_Entry_ver8.38_install.exe differ diff --git a/app/drivers/robotry/Parodule_Firmware.exe b/app/drivers/robotry/Parodule_Firmware.exe new file mode 100644 index 000000000..0ddbfd37b Binary files /dev/null and b/app/drivers/robotry/Parodule_Firmware.exe differ diff --git a/app/firmwares/0uboard.bin b/app/firmwares/0uboard.bin index 4cbab3067..b48712e74 100644 Binary files a/app/firmwares/0uboard.bin and b/app/firmwares/0uboard.bin differ diff --git a/app/firmwares/examples/0uboard.bin b/app/firmwares/examples/0uboard.bin new file mode 100644 index 000000000..6eefe7669 Binary files /dev/null and b/app/firmwares/examples/0uboard.bin differ diff --git a/app/modules/0uboard.js b/app/modules/0uboard.js index 58e2bcf8b..10f24364a 100644 --- a/app/modules/0uboard.js +++ b/app/modules/0uboard.js @@ -13,7 +13,7 @@ function Module() { OLED: 241, COM: 242, NEOPIXEL: 243, - //ULTRASONIC_COUNTER: 244, + ULTRASONIC_COUNTER: 244, DOTMATRIX: 245 } @@ -80,6 +80,7 @@ function Module() { } var sensorIdx = 0; +var cnt =0; Module.prototype.init = function(handler, config) { }; @@ -560,21 +561,22 @@ Module.prototype.makeOutputBuffer = function(device, port, data) { var brig = new Buffer(1); //var msgLength = data.length + 3; - mode[0] = data.mode; //네오픽셀 모드 - index[0] = data.index; //네오픽셀 인덱스 - value[0] = data.value; //갯수 + mode[0] = data.mode; //네오픽셀 모드 7 + index[0] = data.index; //네오픽셀 인덱스 8 + value[0] = data.value; //갯수 9 pos[0] = data.pos; //위치 red[0] = data.red; //빨강 blue[0] = data.blue; //파랑 green[0] = data.green; //녹색 brig[0] = data.brig; //밝기 + + if(mode[0] == 1) { buffer = new Buffer([255, 85, 7, sensorIdx, this.actionTypes.SET, device, port]); buffer = Buffer.concat([buffer, mode, index, value, dummy]); } - else if (mode[0] ==2) { buffer = new Buffer([255, 85, 11, sensorIdx, this.actionTypes.SET, device, 0]); buffer = Buffer.concat([buffer, mode, index, pos, red, green, blue, brig, dummy]); @@ -585,10 +587,50 @@ Module.prototype.makeOutputBuffer = function(device, port, data) { } else { buffer = new Buffer([255, 85, 06, sensorIdx, this.actionTypes.SET, device, 0, 4, 1]); } + // //buffer = new Buffer([255, 85, 11, sensorIdx, this.actionTypes.SET, device, 0, 2, 1, 5, 255, 1, 1, 55]); break; } + // case this.sensorTypes.DOTMATRIX: { + + // var mode = new Buffer(1); + // var index = new Buffer(1); + // var value = new Buffer(1); + // var pos = new Buffer(1); + // var red = new Buffer(1); + // var add_value = new Buffer(1); + + // //var msgLength = data.length + 3; + // mode[0] = data.mode; //네오픽셀 모드 7 + // index[0] = data.index; //네오픽셀 인덱스 8 + // value[0] = data.value; //갯수 9 + // pos[0] = data.pos; //위치 + // red[0] = data.red; //빨강 + + // if (mode[0] == 3) { + // if(cnt < 8) + // { + // add_value[0] =+ red[0]; + // cnt++ + // } + + // if(cnt == 7) + // { + // buffer = new Buffer([255, 85, 10, sensorIdx, this.actionTypes.SET, device, 0]); + // buffer = Buffer.concat([buffer, mode, index, add_value, dummy]); + // cnt = 0; + // }else { + // buffer = new Buffer([255, 85, 06, sensorIdx, this.actionTypes.SET, device, 0, 4, 1]); + + // } + // } + + // // + // //buffer = new Buffer([255, 85, 11, sensorIdx, this.actionTypes.SET, device, 0, 2, 1, 5, 255, 1, 1, 55]); + // break; + // } + } return buffer; diff --git a/app/modules/ProboConnect.js b/app/modules/ProboConnect.js index dd4655c19..3c4e76e76 100644 --- a/app/modules/ProboConnect.js +++ b/app/modules/ProboConnect.js @@ -60,7 +60,28 @@ class ProboConnect extends BaseModule { EC:0, EEPR2:0, EEPR1:0 + }, + Infinite:{ + ROTATION_1:0, + ROTATION_2:0, + ROTATION_3:0, + ROTATION_4:0 + }, + Acceler:{ + AXIS_X1:0, + AXIS_X2:0, + AXIS_X3:0, + AXIS_X4:0, + AXIS_Y1:0, + AXIS_Y2:0, + AXIS_Y3:0, + AXIS_Y4:0, + AXIS_Z1:0, + AXIS_Z2:0, + AXIS_Z3:0, + AXIS_Z4:0, } + }; this.RemoteData = { @@ -87,6 +108,10 @@ class ProboConnect extends BaseModule { ASET1:0 }; + // this.Infinite_Buff = { AA1: 0, AA2: 0, AA3: 0, AA4: 0 }, + // this.Infinite_Count = { AA1: 0, AA2: 0, AA3: 0, AA4: 0 }, + // this.Infinite_Start = { AA1: 0, AA2: 0, AA3: 0, AA4: 0 }, + this.OutputData = new Buffer(22); this.OutputData[0] = 0xAD; @@ -273,6 +298,27 @@ class ProboConnect extends BaseModule { this.InputData.EEPROM.EC = data[13]; this.InputData.EEPROM.EEPR2 = data[14]; this.InputData.EEPROM.EEPR1 = data[15]; + + this.InputData.Infinite.ROTATION_1 = (data[16]>>6)&0xC; + this.InputData.Infinite.ROTATION_2 = (data[16]>>4)&0xC; + this.InputData.Infinite.ROTATION_3 = (data[16]>>2)&0xC; + this.InputData.Infinite.ROTATION_4 = (data[16]>>0)&0xC; + + this.InputData.Acceler.AXIS_X1 = data[4]; + this.InputData.Acceler.AXIS_X2 = data[5]; + this.InputData.Acceler.AXIS_X3 = data[6]; + this.InputData.Acceler.AXIS_X4 = data[7]; + + this.InputData.Acceler.AXIS_Y1 = data[17]; + this.InputData.Acceler.AXIS_Y2 = data[19]; + this.InputData.Acceler.AXIS_Y3 = data[21]; + this.InputData.Acceler.AXIS_Y4 = data[23]; + + this.InputData.Acceler.AXIS_Z1 = data[18]; + this.InputData.Acceler.AXIS_Z2 = data[20]; + this.InputData.Acceler.AXIS_Z3 = data[22]; + this.InputData.Acceler.AXIS_Z4 = data[24]; + } else console.count('CheckSum Err'); @@ -280,6 +326,25 @@ class ProboConnect extends BaseModule { //this.sensors = data; } + // 커스텀 버튼을 사용자에게 보여줄지 여부 + canShowCustomButton() { + return true; + } + + // 커스텀 버튼 클릭시 동작할 로직 + customButtonClicked(key) { + switch (key) { + case "case1": + //버튼 1 로직 + break; + case "case2": + //버튼 2 로직 + break; + default: + console.log(key); + } + } + } module.exports = new ProboConnect(); diff --git a/app/modules/ProboConnect.json b/app/modules/ProboConnect.json index 765282771..f5b22ba9f 100644 --- a/app/modules/ProboConnect.json +++ b/app/modules/ProboConnect.json @@ -4,16 +4,20 @@ "en": "ProboConnect", "ko": "프로보커넥트" }, - "category": "module", "platform": ["win32"], "icon" : "ProboConnect.png", "module": "ProboConnect.js", - "driver": { + "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", + "translate": "드라이버 설치"}, + { + "win32-ia32": "Easy_Down_Entry/PROBO_Easy_Down_Entry_ver8.38_install.exe", + "win32-x64": "Easy_Down_Entry/PROBO_Easy_Down_Entry_ver8.38_install.exe", + "translate": "펌웨어 설치"} + ], "url": "https://www.probo.kr/", - "email": "alswn5609@naver.com", + "email": "tkddnjs10@naver.com", "reconnect": true, "selectPort": true, "hardware": { @@ -30,4 +34,5 @@ "delimiter" : "", "flowControl" : "Connect" } -} + +} \ No newline at end of file diff --git a/app/modules/ProboConnect.png b/app/modules/ProboConnect.png index ad12f3b8e..d40b0e344 100644 Binary files a/app/modules/ProboConnect.png and b/app/modules/ProboConnect.png differ diff --git a/app/modules/neo.js b/app/modules/neo.js index f494ce6bd..83b77015c 100644 --- a/app/modules/neo.js +++ b/app/modules/neo.js @@ -16,7 +16,8 @@ const FrameCode = { }; const PduConnectionCode = { - PAIRING_START: 0x01, + MANUAL_PAIRING: 0x00, + AUTO_PAIRING: 0x01, PAIRING_INFO: 0x03, PAIRING_REMOVE: 0x06, NOTIFY_LIVE: 0x07, @@ -24,17 +25,18 @@ const PduConnectionCode = { const PduBasicCode = { SENSOR_DATA: 0x01, + CONTROLLER_CMD: 0x02, BASIC: 0x10, EXTEND_1: 0x11, + EXTEND_2: 0x12, + EXTEND_3: 0x13, }; const SensorKind = { CONTROLLER: 0x00, ANALOG: 0x01, - COLOR: 0x02, - DISTANCE: 0x03, - TEMPERATURE: 0x04, - GYRO: 0x05, + DIGITAL: 0x02, + COLOR: 0x03, }; const UnitId = { @@ -42,12 +44,11 @@ const UnitId = { CONTROLLER_IN1: 0x01, CONTROLLER_IN2: 0x02, CONTROLLER_IN3: 0x03, - SENSOR_STICK: 0x10, - SENSOR_STICK_IN1: 0x11, - IOT: 0x80, CONTROLLER_OUT1: 0x81, CONTROLLER_OUT2: 0x82, - CONTROLLER_OUT3: 0x83, + CONTROLLER_OUT12: 0x83, + CONTROLLER_OUT3: 0x84, + CONTROLLER_OUT123: 0x87, }; class Neo extends BaseModule { @@ -72,9 +73,6 @@ class Neo extends BaseModule { in2Values: [0, 0, 0, 0], in3Kind: 0, in3Values: [0, 0, 0, 0], - sensorStickBattery: 0, - in4Kind: 0, - in4Values: [0, 0, 0, 0], }; } @@ -295,13 +293,10 @@ class Neo extends BaseModule { this.logPdu(this.byteArrayToHex(pdu)); - const responseData = this.parseResponsePdu(pdu); - if (responseData && responseData.blockId) { - if (this.pendingList[responseData.blockId]) { - if (responseData.result === 0x02) { - this.pendingList[responseData.blockId].state = 'pending'; - } - if (responseData.result === 0x01) { + if (pdu[IDX_PDU_CODE] >= PduBasicCode.BASIC) { + const responseData = this.parseResponsePdu(pdu); + if (responseData && responseData.blockId) { + if (this.pendingList[responseData.blockId]) { this.pendingList[responseData.blockId].state = 'completed'; } } @@ -336,7 +331,7 @@ class Neo extends BaseModule { } else if (unitId === UnitId.CONTROLLER_IN3) { this.sensorValues.in3Values = [analogValue, 0, 0, 0]; } - } else if (sensorDataKind === SensorKind.COLOR) { + } else if (sensorDataKind === SensorKind.DIGITAL || sensorDataKind === SensorKind.COLOR) { const value1 = new Buffer(value.slice(0, 2)).readInt16LE(); const value2 = new Buffer(value.slice(2, 4)).readInt16LE(); const value3 = new Buffer(value.slice(4, 6)).readInt16LE(); @@ -361,8 +356,8 @@ class Neo extends BaseModule { */ parseResponsePdu(pdu) { return { - blockId: pdu[IDX_PDU_CODE + 1], - result: pdu[IDX_PDU_CODE + 2], + blockId: pdu[IDX_ACK_NUM], + result: pdu[IDX_ACK_NUM + 1], }; } diff --git a/app/modules/robotry_parodule.js b/app/modules/robotry_parodule.js new file mode 100644 index 000000000..147fab309 --- /dev/null +++ b/app/modules/robotry_parodule.js @@ -0,0 +1,304 @@ +const BaseModule = require('./robotry'); +class Parodule extends BaseModule { + // 클래스 내부에서 사용될 필드들을 이곳에서 선언합니다. + constructor() { + super(); + this.sp = null; + this.controlTypes = { + DIGITAL: 0, + ANALOG: 1, + STRING: 2, + }; + this.UNKNOWN = 207; + this.NONE = 208; + this.PIXEL = 209; + this.MOTOR = 210; + this.BUZZER = 211; + this.paroduleData = { + SENSOR: { + '0': 0, + '1': 0, + '2': 0, + '3': 0, + }, + MODULE: { + '0': 0, + '1': 0, + '2': 0, + '3': 0, + }, + MODULE1: '픽셀', + MODULE2: '픽셀', + MODULE3: '픽셀', + MODULE4: '픽셀', + }; + this.isConnect = false; + this.cmdTime = 0; + this.portTimeList = [0, 0, 0, 0, 0]; + this.terminal = [0xee, 0xee, 0xee, 0xee, '\n']; // 터미널 버퍼 저장 공간 + this.moduleOff = [0xff, 0x55, 0xc8, 0xc8, 0xc8, 0xc8, '\n']; // 모듈 종료 인터럽트 + // this.bleDisconCode = new Buffer('123\r\n'); + this.paroduleEntry = new Buffer('entry\r\n'); // 엔트리 모듈 내부 셰이킹 + this.paroduleInit = [0xff, 0x55, 0xff, 0xff, 0xff, 0xff, 0x0a]; // 엔트리용 모듈 인식 코드 + this.paroduleClose = new Buffer('spclose\r\n'); // 시리어 포트 종료 신호 + this.isSend = true; + this.pre_time = 0; + } + /* + 최초에 커넥션이 이루어진 후의 초기 설정. + handler 는 워크스페이스와 통신하 데이터를 json 화 하는 오브젝트입니다. (datahandler/json 참고) + config 은 module.json 오브젝트입니다. + */ + init(handler, config) { + this.handler = handler; + this.config = config; + } + setSerialPort(sp) { + let self = this; + this.sp = sp; + } + afterConnect(that, cb) { + that.connected = true; + if (cb) { + cb('connected'); + } + } + connect() { + this.isConnect = true; + } + /* + 연결 후 초기에 송신할 데이터가 필요한 경우 사용합니다. + requestInitialData 를 사용한 경우 checkInitialData 가 필수입니다. + 이 두 함수가 정의되어있어야 로직이 동작합니다. 필요없으면 작성하지 않아도 됩니다. + */ + requestInitialData() { + return this.paroduleEntry; + } + // 연결 후 초기에 수신받아서 정상연결인지를 확인해야하는 경우 사용합니다. + checkInitialData(data, config) { + if (data) { + return true; + } + else { + return false; + } + + } + // 주기적으로 하드웨어에서 받은 데이터의 검증이 필요한 경우 사용합니다. + validateLocalData(data) { + return true; + } + /* + 하드웨어 기기에 전달할 데이터를 반환합니다. + slave 모드인 경우 duration 속성 간격으로 지속적으로 기기에 요청을 보냅니다. + */ + requestLocalData() { + // 하드웨어로 보낼 데이터 로직 + if (!this.isConnect) { + return; + } + if (this.sendBuffers.length > 0) { + if (this.sp) { + this.sp.write(this.sendBuffers.shift(), () => { + this.sp.drain(() => { + }); + }); + } + } + return null; + } + + // 하드웨어에서 온 데이터 처리 + handleLocalData(data) { + let self = this; + let datas = this.getDataByBuffer(data); + // 데이터 처리 로직 + datas.forEach((data) => { + // 센서 데이터만 걸러냄 + if (data.length < 6) { + return; + } + else if (data[0] == 0xff && data[1] == 0x44) { + //console.log(data); + let temp = ['', '', '', '']; + let readData = data.subarray(2, data.length); + for (let i = 0; i < 4; i++) { + self.paroduleData.MODULE[i] = readData[i]; + } + for (let i = 0; i < 4; i++) { + let value = self.paroduleData.MODULE[i]; + if (value == this.PIXEL) { + temp[i] = '픽셀'; + } + else if (value == this.MOTOR) { + temp[i] = '모터'; + } + else if (value == this.BUZZER) { + temp[i] = '부저'; + } + else if (value == this.NONE) { + temp[i] = '없음'; + } else { + temp[i] = '모름'; + } + } + self.paroduleData.MODULE1 = temp[0]; + self.paroduleData.MODULE2 = temp[1]; + self.paroduleData.MODULE3 = temp[2]; + self.paroduleData.MODULE4 = temp[3]; + } + else if (data[0] == 0xff && data[1] == 0x66) { + let readData = data.subarray(2, data.length); + for (let i = 0; i < 4; i++) { + self.paroduleData.SENSOR[i] = readData[i]; + } + } + }); + } + // 엔트리로 전달할 데이터 + requestRemoteData(handler) { + let self = this; + if (!self.paroduleData) { + return; + } + this.lastSendTime = this.lastTime; + Object.keys(this.paroduleData).forEach(function (key) { + if (self.paroduleData[key] != undefined) { + handler.write(key, self.paroduleData[key]); + self.canSendData = false; + } + }); + } + // 엔트리에서 받은 데이터에 대한 처리 + handleRemoteData(handler) { + let self = this; + let cmdDatas = handler.read('CMD'); + let getDatas = handler.read('GET'); + let setDatas = handler.read('SET'); + let time = handler.read('TIME'); + let buffer = new Buffer([]); + // 입력 모듈일 경우 + if (getDatas) { + } + // 출력 모듈일 경우 + if (setDatas) { + let setKey = Object.keys(setDatas); + setKey.forEach(function (port) { + let data = setDatas[port]; + if (data) { + if (self.portTimeList[port] < data.time) { + self.portTimeList[port] = data.time + if (!self.isRecentData(port, data.type, data.data)) { + self.recentCheckData[port] = { + type: data.type, + data: data.data + } + self.updateTerminalBuffer(port); + buffer = new Buffer(self.makeOutputBuffer(data.type, null)); + } + } + } + }); + + } + // 커맨드 명령어 + if (cmdDatas) { + if (self.cmdTime < cmdDatas.time) { + self.cmdTime = cmdDatas.time; + + if (!self.isRecentData(cmdDatas.data)) { + self.recentCheckData = { + data: cmdDatas.data + } + buffer = new Buffer(cmdDatas.data); + } + } + } + if (buffer.length) { + this.sendBuffers.push(buffer); + } + else { + buffer = new Buffer([0xff, 0x55, 0xff, 0xff, 0xff, 0xff, 0x0a]); + if (this.isSend) { + this.isSend = false; + this.sendBuffers.push(buffer); + } + } + } + // recentCheckData 리스트에 있는 경우 true 반환 아니면 false + isRecentData(port, type, data) { + let isRecent = false; + const interval = 1000; + + if (port in this.recentCheckData) { + if (this.recentCheckData[port].type === type && this.recentCheckData[port].data === data) { + isRecent = true; + if (Date.now() - this.pre_time > interval) { // 같은 데이터가 연속인 경우 1초에 한번만 전송 + this.pre_time = Date.now(); + isRecent = false; + } + else { + isRecent = true; + } + } + } + return isRecent; + } + + updateTerminalBuffer(port) { + if (this.recentCheckData[port].data === 0) { + this.terminal[port] = 238; + } + else { + this.terminal[port] = this.recentCheckData[port].data; + } + } + makeOutputBuffer(dataType, data) { + let buffer; + if (dataType == this.controlTypes.STRING) { + buffer = new Buffer(data); + } + else if (dataType == this.controlTypes.DIGITAL) { + buffer = new Buffer([ + 0xff, + 0x55, + this.terminal[0], + this.terminal[1], + this.terminal[2], + this.terminal[3], + 0x0a + ]); + } + else { + } + return buffer; + } + // '\r\n' 을 기준으로 버퍼를 자른다 + getDataByBuffer(buffer) { + let datas = []; + let lastIndex = 0; + buffer.forEach(function (value, idx) { + if (value == 13 && buffer[idx + 1] == 10) { + datas.push(buffer.subarray(lastIndex, idx)); + lastIndex = idx + 2; + } + }); + return datas; + } + // 연결 해제되면 시리얼 포트 제거 + disconnect(connect) { + const spClose = this.paroduleClose; + if (this.sp) { + this.sp.write(spClose, () => { + this.sp.drain(() => { + connect.close(); + this.isConnect = false; + }) + }) + } + } + // 리셋 + reset() { + } +} +module.exports = new Parodule(); \ No newline at end of file diff --git a/app/modules/robotry_parodule.json b/app/modules/robotry_parodule.json new file mode 100644 index 000000000..8509bb458 --- /dev/null +++ b/app/modules/robotry_parodule.json @@ -0,0 +1,29 @@ +{ + "id": "4B0201", + "name": { + "en": "Parodule", + "ko": "파로듈" + }, + "category": "board", + "platform": ["win32", "darwin"], + "icon": "robotry_parodule.png", + "module": "robotry_parodule.js", + "url": "http://parob.io", + "email": "hee.kim6133@robotry.co.kr", + "reconnect": true, + "driver": [{ + "win32-x64": "robotry/Parodule_Firmware.exe", + "translate": "펌웨어 업데이트" + }], + "hardware": { + "type": "serial", + "control": "slave", + "duration": 25, + "pnpId": "1001", + "flowControl": "hardware", + "baudRate": 115200, + "lostTimer": 1000, + "byteDelimiter": [13, 10], + "firmwarecheck": false + } +} \ No newline at end of file diff --git a/app/modules/robotry_parodule.png b/app/modules/robotry_parodule.png new file mode 100644 index 000000000..5837c68a3 Binary files /dev/null and b/app/modules/robotry_parodule.png differ diff --git a/app/modules/robotry_robitStage.js b/app/modules/robotry_robitStage.js index a903f15b6..41e86adbc 100644 --- a/app/modules/robotry_robitStage.js +++ b/app/modules/robotry_robitStage.js @@ -19,11 +19,11 @@ class robitStage extends BaseModule { }; } - setSerialPort(sp){ + setSerialPort(sp) { var self = this; this.sp = sp; }; - + afterConnect(that, cb) { that.connected = true; if (cb) { @@ -33,7 +33,7 @@ class robitStage extends BaseModule { requestInitialData() { return this.makeSensorReadBuffer(this.sensorTypes.ANALOG, 0); } - + /* 하드웨어 기기에 전달할 데이터를 반환합니다. slave 모드인 경우 duration 속성 간격으로 지속적으로 기기에 요청을 보냅니다. @@ -44,9 +44,9 @@ class robitStage extends BaseModule { if (!this.isDraing && this.sendBuffers.length > 0) { this.isDraing = true; - this.sp.write(this.sendBuffers.shift(), function() { + this.sp.write(this.sendBuffers.shift(), function () { if (self.sp) { - self.sp.drain(function() { + self.sp.drain(function () { self.isDraing = false; }); } @@ -62,7 +62,7 @@ class robitStage extends BaseModule { var self = this; var datas = this.getDataByBuffer(data); - datas.forEach(function(data) { + datas.forEach(function (data) { if (data.length <= 4 || data[0] !== 255 || data[1] !== 85) { return; } @@ -122,7 +122,7 @@ class robitStage extends BaseModule { return; } this.lastSendTime = this.lastTime; - Object.keys(this.sensorData).forEach(function(key) { + Object.keys(this.sensorData).forEach(function (key) { if (self.sensorData[key] != undefined) { handler.write(key, self.sensorData[key]); self.canSendData = false; @@ -141,7 +141,7 @@ class robitStage extends BaseModule { if (getDatas) { var keys = Object.keys(getDatas); - keys.forEach(function(key) { + keys.forEach(function (key) { var isSend = false; var dataObj = getDatas[key]; if (typeof dataObj.port === 'string' || typeof dataObj.port === 'number') { @@ -151,13 +151,13 @@ class robitStage extends BaseModule { self.digitalPortTimeList[dataObj.port] = dataObj.time; } } else if (Array.isArray(dataObj.port)) { - isSend = dataObj.port.every(function(port) { + isSend = dataObj.port.every(function (port) { var time = self.digitalPortTimeList[port]; return dataObj.time > time; }); if (isSend) { - dataObj.port.forEach(function(port) { + dataObj.port.forEach(function (port) { self.digitalPortTimeList[port] = dataObj.time; }); } @@ -177,7 +177,7 @@ class robitStage extends BaseModule { if (setDatas) { var setKeys = Object.keys(setDatas); - setKeys.forEach(function(port) { + setKeys.forEach(function (port) { var data = setDatas[port]; if (data) { if (self.digitalPortTimeList[port] < data.time) { @@ -212,7 +212,7 @@ class robitStage extends BaseModule { return isRecent; } - + /* GET인 경우 SensorType 에 따라 버퍼를 생성 ff 55 len idx action device port slot data a @@ -263,7 +263,7 @@ class robitStage extends BaseModule { if (sensorIdx > 254) { sensorIdx = 0; } - + return buffer; } //0xff 0x55 0x6 0x0 0x1 0xa 0x9 0x0 0x0 0xa @@ -313,7 +313,7 @@ class robitStage extends BaseModule { case this.sensorTypes.TONE: { } } - + return buffer; } @@ -321,7 +321,7 @@ class robitStage extends BaseModule { getDataByBuffer(buffer) { var datas = []; var lastIndex = 0; - buffer.forEach(function(value, idx) { + buffer.forEach(function (value, idx) { if (value == 13 && buffer[idx + 1] == 10) { datas.push(buffer.subarray(lastIndex, idx)); lastIndex = idx + 2; @@ -335,13 +335,13 @@ class robitStage extends BaseModule { disconnect(connect) { var self = this; connect.close(); - if(self.sp) { + if (self.sp) { delete self.sp; } } // 리셋 - reset(){ + reset() { this.lastTime = 0; this.lastSendTime = 0; this.sensorData.PULSEIN = {} diff --git a/build/entry-hw.nsi b/build/entry-hw.nsi index 681e7a1ad..58465da0b 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.45" +!define PRODUCT_VERSION "1.9.46" !define PRODUCT_PUBLISHER "EntryLabs" !define PRODUCT_WEB_SITE "https://www.playentry.org/" diff --git a/package.json b/package.json index 3d6054650..7b8632db1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "entry-hw", - "version": "1.9.45", + "version": "1.9.46", "description": "엔트리 하드웨어 연결 프로그램", "author": "EntryLabs", "main": "./app/src/index.bundle.js",