Skip to content

Commit

Permalink
공백제거
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaJinK committed Aug 30, 2023
1 parent 3d69669 commit 7f6b6d3
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions app/modules/robotry_parodule.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { values } = require('lodash');
const BaseModule = require('./robotry');
class Parodule extends BaseModule {
// 클래스 내부에서 사용될 필드들을 이곳에서 선언합니다.

Check warning on line 3 in app/modules/robotry_parodule.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Expected indentation of 4 spaces but found 2. Raw Output: {"ruleId":"indent","severity":1,"message":"Expected indentation of 4 spaces but found 2.","line":3,"column":1,"nodeType":"Line","messageId":"wrongIndentation","endLine":3,"endColumn":3,"fix":{"range":[77,79],"text":" "}}
Expand All @@ -10,13 +9,11 @@ class Parodule extends BaseModule {
ANALOG: 1,

Check warning on line 9 in app/modules/robotry_parodule.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Expected indentation of 12 spaces but found 6. Raw Output: {"ruleId":"indent","severity":1,"message":"Expected indentation of 12 spaces but found 6.","line":9,"column":1,"nodeType":"Identifier","messageId":"wrongIndentation","endLine":9,"endColumn":7,"fix":{"range":[207,213],"text":" "}}
STRING: 2,

Check warning on line 10 in app/modules/robotry_parodule.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Expected indentation of 12 spaces but found 6. Raw Output: {"ruleId":"indent","severity":1,"message":"Expected indentation of 12 spaces but found 6.","line":10,"column":1,"nodeType":"Identifier","messageId":"wrongIndentation","endLine":10,"endColumn":7,"fix":{"range":[224,230],"text":" "}}
};

Check warning on line 11 in app/modules/robotry_parodule.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Expected indentation of 8 spaces but found 4. Raw Output: {"ruleId":"indent","severity":1,"message":"Expected indentation of 8 spaces but found 4.","line":11,"column":1,"nodeType":"Punctuator","messageId":"wrongIndentation","endLine":11,"endColumn":5,"fix":{"range":[241,245],"text":" "}}

this.UNKNOWN = 207;

Check warning on line 12 in app/modules/robotry_parodule.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Expected indentation of 8 spaces but found 4. Raw Output: {"ruleId":"indent","severity":1,"message":"Expected indentation of 8 spaces but found 4.","line":12,"column":1,"nodeType":"Keyword","messageId":"wrongIndentation","endLine":12,"endColumn":5,"fix":{"range":[248,252],"text":" "}}
this.NONE = 208;
this.LED = 209;
this.MOTOR = 210;
this.BUZZER = 211;

this.paroduleData = {
SENSOR: {
'0': 0,
Expand All @@ -30,14 +27,11 @@ class Parodule extends BaseModule {
'2': 0,
'3': 0,
},

MODULE1: "LED",
MODULE2: "LED",
MODULE3: "LED",
MODULE4: "LED",

};

this.isConnect = false;
this.cmdTime = 0;
this.portTimeList = [0, 0, 0, 0, 0];
Expand All @@ -58,12 +52,10 @@ class Parodule extends BaseModule {
this.handler = handler;
this.config = config;
}

setSerialPort(sp) {
var self = this;
this.sp = sp;
}

afterConnect(that, cb) {
that.connected = true;
if (cb) {
Expand All @@ -73,7 +65,6 @@ class Parodule extends BaseModule {
connect() {
this.isConnect = true;
}

/*
연결 후 초기에 송신할 데이터가 필요한 경우 사용합니다.
requestInitialData 를 사용한 경우 checkInitialData 가 필수입니다.
Expand All @@ -82,17 +73,14 @@ class Parodule extends BaseModule {
requestInitialData() {
return this.paroduleEntry;
}

// 연결 후 초기에 수신받아서 정상연결인지를 확인해야하는 경우 사용합니다.
checkInitialData(data, config) {
return true;
}

// 주기적으로 하드웨어에서 받은 데이터의 검증이 필요한 경우 사용합니다.
validateLocalData(data) {
return true;
}

/*
하드웨어 기기에 전달할 데이터를 반환합니다.
slave 모드인 경우 duration 속성 간격으로 지속적으로 기기에 요청을 보냅니다.
Expand All @@ -102,7 +90,6 @@ class Parodule extends BaseModule {
if (!this.isConnect) {
return;
}

if (this.sendBuffers.length > 0) {
if (this.sp) {
this.sp.write(this.sendBuffers.shift(), () => {
Expand Down Expand Up @@ -160,7 +147,6 @@ class Parodule extends BaseModule {
}
});
}

// 엔트리로 전달할 데이터
requestRemoteData(handler) {
var self = this;
Expand All @@ -175,7 +161,6 @@ class Parodule extends BaseModule {
}
});
}

// 엔트리에서 받은 데이터에 대한 처리
handleRemoteData(handler) {
const interval = 60000; // 1분에 한번씩 연결된 모듈 데이터 호출
Expand All @@ -188,7 +173,6 @@ class Parodule extends BaseModule {
var buffer = new Buffer([]);
// 입력 모듈일 경우
if (getDatas) {

}
// 출력 모듈일 경우
if (setDatas) {
Expand All @@ -211,8 +195,6 @@ class Parodule extends BaseModule {
});

}


// 커맨드 명령어
if (cmdDatas) {
if (self.cmdTime < cmdDatas.time) {
Expand All @@ -226,7 +208,6 @@ class Parodule extends BaseModule {
}
}
}

if (buffer.length) {
this.sendBuffers.push(buffer);
}
Expand All @@ -238,7 +219,6 @@ class Parodule extends BaseModule {
}
}
}

// recentCheckData 리스트에 있는 경우 true 반환 아니면 false
isRecentData(port, type, data) {
var isRecent = false;
Expand All @@ -248,7 +228,6 @@ class Parodule extends BaseModule {
isRecent = true;
}
}

return isRecent;
}

Expand All @@ -259,7 +238,6 @@ class Parodule extends BaseModule {
else {
this.terminal[port] = this.recentCheckData[port].data;
}

}
makeOutputBuffer(dataType, data) {
var buffer;
Expand All @@ -278,11 +256,9 @@ class Parodule extends BaseModule {
]);
}
else {

}
return buffer;
}

// '\r\n' 을 기준으로 버퍼를 자른다
getDataByBuffer(buffer) {
var datas = [];
Expand All @@ -295,7 +271,6 @@ class Parodule extends BaseModule {
});
return datas;
}

// 연결 해제되면 시리얼 포트 제거
disconnect(connect) {
const spClose = this.paroduleClose;
Expand All @@ -309,10 +284,8 @@ class Parodule extends BaseModule {
})
}
}

// 리셋
reset() {
}
}

module.exports = new Parodule();

0 comments on commit 7f6b6d3

Please sign in to comment.