Skip to content

Commit b73a696

Browse files
authored
Merge pull request #620 from entrylabs/develop-hw
1.9.39 버전업
2 parents 513fc68 + ccf3e66 commit b73a696

File tree

11 files changed

+30
-26
lines changed

11 files changed

+30
-26
lines changed

app/modules/0uboard.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ Module.prototype.setSerialPort = function (sp) {
9090

9191
// Module.prototype.lostController = function () {};
9292

93-
Module.prototype.requestInitialData = function() {
93+
Module.prototype.requestInitialData = function(sp) {
94+
this.sp = sp;
95+
this.sp.binding.openOptions.hupcl=false;
96+
this.sp.set({ dtr: false, rts: true });
97+
this.sp.set({ dtr: false, rts: false });
9498
return this.makeSensorReadBuffer(this.sensorTypes.ANALOG, 0);
9599
};
96100

app/modules/0uboard.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"duration": 32,
3030
"vendor": ["Arduino", "wch.cn", "FTDI"],
3131
"baudRate": 57600,
32-
"lostTimer": 1000,
32+
"lostTimer": 5000,
3333
"firmwarecheck": false
3434
}
3535
}

app/modules/iCOBOT.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ function Module()
4242
Left_IR: 0,
4343
Real_T: 0,
4444
Real_H: 0,
45+
Motor_F: 0,
4546
},
4647
Brightness: 0,
4748
BLeft_IR: 0,
@@ -360,7 +361,7 @@ Module.prototype.handleRemoteData = function(handler)
360361
switch(data.type)
361362
{
362363
case 2: // 모터제어
363-
if((port != pre_port_motor) || (data.data.value != pre_data_value_motor) || (data.data.mode != pre_data_mode_motor))
364+
if((port != pre_port_motor) || (data.data.value != pre_data_value_motor) || (data.data.mode != 4) || (data.data.mode != pre_data_mode_motor))
364365
{
365366
//console.log("Motor: ", port, pre_port_motor, data.data.value, pre_data_value_motor, data.data.mode, pre_data_mode_motor);
366367
buffer = Buffer.concat([buffer, self.makeOutputBuffer(data.type, port, data.data)]);
@@ -396,7 +397,7 @@ Module.prototype.handleRemoteData = function(handler)
396397
break;
397398
case 5: // Tone 제어
398399
//console.log("Tone: ", data.data.value, pre_data_value_tone, data.data.duration, pre_data_time_tone);
399-
if((data.data.value != pre_data_value_tone) || (data.data.duration != pre_data_time_tone))
400+
if((data.data.value != pre_data_value_tone) || (7 != pre_data_time_tone))
400401
{
401402
buffer = Buffer.concat([buffer, self.makeOutputBuffer(data.type, port, data.data)]);
402403
pre_data_value_tone = data.data.value;

app/modules/microbit2.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"type": "serial",
3535
"control": "slave",
3636
"delimiter": "\r\n",
37-
"duration": 64,
37+
"duration": 128,
3838
"vendor": "",
3939
"baudRate": 115200,
4040
"commType": "ascii"

app/server/mac/server.txt

-8 Bytes
Binary file not shown.

app/server/win/server.exe

-8 Bytes
Binary file not shown.

app/src/main/electron/index.ts

-13
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import registerGlobalShortcut from './functions/registerGlobalShortcut';
1313
import checkUpdate from './functions/checkUpdate';
1414
import MainRouter from '../mainRouter.build';
1515
import createLogger from './functions/createLogger';
16-
import isValidAsarFile from './modifyValidator';
1716

1817
const logger = createLogger('electron/index.ts');
1918

@@ -128,18 +127,6 @@ if (!app.requestSingleInstanceLock()) {
128127
mainRouter.selectHardware(autoOpenHardwareId);
129128
}, 1000);
130129
}
131-
132-
setTimeout(async () => {
133-
try {
134-
const result = await isValidAsarFile();
135-
if (!result) {
136-
mainWindow?.webContents.send('invalidAsarFile');
137-
}
138-
} catch (e) {
139-
console.log(e);
140-
mainWindow?.webContents.send('invalidAsarFile');
141-
}
142-
}, 2000);
143130
});
144131

145132
ipcMain.on('hardwareForceClose', () => {

app/src/main/mainRouter.ts

+13-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import directoryPaths from './core/directoryPaths';
1313
import BaseScanner from './core/baseScanner';
1414
import BaseConnector from './core/baseConnector';
1515
import SerialConnector from './core/serial/connector';
16+
import isValidAsarFile from './electron/modifyValidator';
1617

1718
const nativeNodeRequire = require('./nativeNodeRequire.js');
1819
const logger = createLogger('core/mainRouter.ts');
@@ -239,7 +240,7 @@ class MainRouter {
239240
if (connector) {
240241
logger.info(
241242
`[Device Info] ${config.id} | ${
242-
config?.name?.ko || config?.name?.en || 'noname'
243+
config?.name?.ko || config?.name?.en || 'noname'
243244
}`
244245
);
245246
this.connector = connector;
@@ -536,11 +537,21 @@ class MainRouter {
536537
this.flasher.kill();
537538
this.config && this.startScan(this.config);
538539
});
540+
ipcMain.handle('isValidAsarFile', async (event) => {
541+
try {
542+
const result = await isValidAsarFile();
543+
console.log("isValidAsarFile : ", result);
544+
return result;
545+
} catch (e) {
546+
console.log(e);
547+
return false;
548+
}
549+
})
539550
ipcMain.on('getSharedObject', (e) => {
540551
e.returnValue = global.sharedObject;
541552
});
542553
ipcMain.on('canShowCustomButton', (e) => {
543-
if(this.hwModule && this.hwModule.canShowCustomButton) {
554+
if (this.hwModule && this.hwModule.canShowCustomButton) {
544555
e.returnValue = this.hwModule.canShowCustomButton();
545556
} else {
546557
e.returnValue = false;

app/src/renderer/react/main/components/IpcRendererWatchComponent.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ class IpcRendererWatchComponent extends React.PureComponent<IProps> {
2727
ipcRenderer.removeAllListeners('portListScanned');
2828
ipcRenderer.removeAllListeners('cloudMode');
2929
ipcRenderer.removeAllListeners('socketConnected');
30-
ipcRenderer.removeAllListeners('invalidAsarFile');
3130

32-
ipcRenderer.on('invalidAsarFile', () => {
33-
props.invalidateBuild();
34-
});
31+
ipcRenderer.invoke('isValidAsarFile').then((result: boolean) => {
32+
if(!result){
33+
props.invalidateBuild();
34+
}
35+
})
3536

3637
ipcRenderer.on('console', (event, ...args: any[]) => {
3738
console.log(...args);

build/entry-hw.nsi

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
!define PRODUCT_NAME "Entry_HW"
1515
!define PROTOCOL_NAME "entryhw"
1616
!define APP_NAME "Entry_HW.exe"
17-
!define PRODUCT_VERSION "1.9.38"
17+
!define PRODUCT_VERSION "1.9.39"
1818
!define PRODUCT_PUBLISHER "EntryLabs"
1919
!define PRODUCT_WEB_SITE "https://www.playentry.org/"
2020

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "entry-hw",
3-
"version": "1.9.38",
3+
"version": "1.9.39",
44
"description": "엔트리 하드웨어 연결 프로그램",
55
"author": "EntryLabs",
66
"main": "./app/src/index.bundle.js",

0 commit comments

Comments
 (0)