langjie-m-play 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/domain/SubscribeDatagramResult.d.ts +6 -0
- package/domain/ats/event/AtsActionEnteredEventContent.d.ts +6 -0
- package/domain/ats/event/AtsCapturedEventContent.d.ts +5 -0
- package/domain/ats/event/AtsCapturedEventContent.js +2 -0
- package/domain/ats/event/AtsLoadEventContent.d.ts +4 -0
- package/domain/ats/event/AtsLoadEventContent.js +2 -0
- package/domain/ats/event/BaseAtsEvent.d.ts +7 -0
- package/domain/ats/event/BaseAtsEvent.js +2 -0
- package/domain/enums/AtsEventEnum.d.ts +8 -0
- package/domain/enums/AtsEventEnum.js +12 -0
- package/{dist/domain → domain}/enums/MsgEventTypeEnum.d.ts +2 -1
- package/{dist/domain → domain}/enums/MsgEventTypeEnum.js +2 -1
- package/package.json +1 -1
- package/{dist/service → service}/GtcClient.d.ts +12 -2
- package/{dist/service → service}/GtcClient.js +12 -1
- package/{dist/service → service}/GtcServiceSocketIOImpl.js +7 -1
- package/service/IGtcService.js +2 -0
- package/{dist/service → service}/MPlay.d.ts +5 -2
- package/{dist/service → service}/MPlay.js +21 -1
- package/{dist/utils → utils}/enums/SubKeyEnum.d.ts +1 -0
- package/{dist/utils → utils}/enums/SubKeyEnum.js +1 -0
- package/.idea/m-play.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/dist/domain/SubscribeDatagramResult.d.ts +0 -5
- package/dist/package.json +0 -18
- package/src/domain/AtsLoadResponse.ts +0 -4
- package/src/domain/DiDo.ts +0 -6
- package/src/domain/GtcCallBackMsg.ts +0 -11
- package/src/domain/JsonRpcConstant.ts +0 -21
- package/src/domain/JsonRpcError.ts +0 -7
- package/src/domain/JsonRpcRequest.ts +0 -14
- package/src/domain/JsonRpcResponse.ts +0 -16
- package/src/domain/NodeInfo.ts +0 -14
- package/src/domain/OutMsg.ts +0 -11
- package/src/domain/ProductInfo.ts +0 -4
- package/src/domain/ReadDataDO.ts +0 -10
- package/src/domain/SubscribeDatagramResult.ts +0 -5
- package/src/domain/VinChnl.ts +0 -12
- package/src/domain/enums/ConnectStatusEnum.ts +0 -7
- package/src/domain/enums/JsonRpcEventEnum.ts +0 -10
- package/src/domain/enums/JsonRpcMethodEnum.ts +0 -67
- package/src/domain/enums/JsonRpcResponseCodeEnum.ts +0 -22
- package/src/domain/enums/MsgEventTypeEnum.ts +0 -7
- package/src/domain/enums/MsgSourceEnum.ts +0 -4
- package/src/domain/enums/RunStateEnum.ts +0 -9
- package/src/domain/enums/ServiceTypeEnum.ts +0 -7
- package/src/index.ts +0 -15
- package/src/service/GtcClient.ts +0 -461
- package/src/service/GtcServiceFactory.ts +0 -18
- package/src/service/GtcServiceSocketIOImpl.ts +0 -98
- package/src/service/IGtcService.ts +0 -24
- package/src/service/MPlay.ts +0 -175
- package/src/utils/IdGenerator.ts +0 -12
- package/src/utils/PubSubUtil.ts +0 -22
- package/src/utils/TaskSynchronizer.ts +0 -23
- package/src/utils/enums/SubKeyEnum.ts +0 -15
- package/tsconfig.json +0 -109
- /package/{dist/domain → domain}/AtsLoadResponse.d.ts +0 -0
- /package/{dist/domain → domain}/AtsLoadResponse.js +0 -0
- /package/{dist/domain → domain}/DiDo.d.ts +0 -0
- /package/{dist/domain → domain}/DiDo.js +0 -0
- /package/{dist/domain → domain}/GtcCallBackMsg.d.ts +0 -0
- /package/{dist/domain → domain}/GtcCallBackMsg.js +0 -0
- /package/{dist/domain → domain}/JsonRpcConstant.d.ts +0 -0
- /package/{dist/domain → domain}/JsonRpcConstant.js +0 -0
- /package/{dist/domain → domain}/JsonRpcError.d.ts +0 -0
- /package/{dist/domain → domain}/JsonRpcError.js +0 -0
- /package/{dist/domain → domain}/JsonRpcRequest.d.ts +0 -0
- /package/{dist/domain → domain}/JsonRpcRequest.js +0 -0
- /package/{dist/domain → domain}/JsonRpcResponse.d.ts +0 -0
- /package/{dist/domain → domain}/JsonRpcResponse.js +0 -0
- /package/{dist/domain → domain}/NodeInfo.d.ts +0 -0
- /package/{dist/domain → domain}/NodeInfo.js +0 -0
- /package/{dist/domain → domain}/OutMsg.d.ts +0 -0
- /package/{dist/domain → domain}/OutMsg.js +0 -0
- /package/{dist/domain → domain}/ProductInfo.d.ts +0 -0
- /package/{dist/domain → domain}/ProductInfo.js +0 -0
- /package/{dist/domain → domain}/ReadDataDO.d.ts +0 -0
- /package/{dist/domain → domain}/ReadDataDO.js +0 -0
- /package/{dist/domain → domain}/SubscribeDatagramResult.js +0 -0
- /package/{dist/domain → domain}/VinChnl.d.ts +0 -0
- /package/{dist/domain → domain}/VinChnl.js +0 -0
- /package/{dist/service/IGtcService.js → domain/ats/event/AtsActionEnteredEventContent.js} +0 -0
- /package/{dist/domain → domain}/enums/ConnectStatusEnum.d.ts +0 -0
- /package/{dist/domain → domain}/enums/ConnectStatusEnum.js +0 -0
- /package/{dist/domain → domain}/enums/JsonRpcEventEnum.d.ts +0 -0
- /package/{dist/domain → domain}/enums/JsonRpcEventEnum.js +0 -0
- /package/{dist/domain → domain}/enums/JsonRpcMethodEnum.d.ts +0 -0
- /package/{dist/domain → domain}/enums/JsonRpcMethodEnum.js +0 -0
- /package/{dist/domain → domain}/enums/JsonRpcResponseCodeEnum.d.ts +0 -0
- /package/{dist/domain → domain}/enums/JsonRpcResponseCodeEnum.js +0 -0
- /package/{dist/domain → domain}/enums/MsgSourceEnum.d.ts +0 -0
- /package/{dist/domain → domain}/enums/MsgSourceEnum.js +0 -0
- /package/{dist/domain → domain}/enums/RunStateEnum.d.ts +0 -0
- /package/{dist/domain → domain}/enums/RunStateEnum.js +0 -0
- /package/{dist/domain → domain}/enums/ServiceTypeEnum.d.ts +0 -0
- /package/{dist/domain → domain}/enums/ServiceTypeEnum.js +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/service → service}/GtcServiceFactory.d.ts +0 -0
- /package/{dist/service → service}/GtcServiceFactory.js +0 -0
- /package/{dist/service → service}/GtcServiceSocketIOImpl.d.ts +0 -0
- /package/{dist/service → service}/IGtcService.d.ts +0 -0
- /package/{dist/utils → utils}/IdGenerator.d.ts +0 -0
- /package/{dist/utils → utils}/IdGenerator.js +0 -0
- /package/{dist/utils → utils}/PubSubUtil.d.ts +0 -0
- /package/{dist/utils → utils}/PubSubUtil.js +0 -0
- /package/{dist/utils → utils}/TaskSynchronizer.d.ts +0 -0
- /package/{dist/utils → utils}/TaskSynchronizer.js +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AtsEventEnum = void 0;
|
|
4
|
+
var AtsEventEnum;
|
|
5
|
+
(function (AtsEventEnum) {
|
|
6
|
+
AtsEventEnum[AtsEventEnum["EVENT_ID_AtsLoaded"] = 39950] = "EVENT_ID_AtsLoaded";
|
|
7
|
+
AtsEventEnum[AtsEventEnum["EVENT_ID_TestStarted"] = 40732] = "EVENT_ID_TestStarted";
|
|
8
|
+
AtsEventEnum[AtsEventEnum["EVENT_ID_TestEnded"] = 62117] = "EVENT_ID_TestEnded";
|
|
9
|
+
AtsEventEnum[AtsEventEnum["EVENT_ID_TestAborted"] = 54598] = "EVENT_ID_TestAborted";
|
|
10
|
+
AtsEventEnum[AtsEventEnum["EVENT_ID_ActionEntered"] = 16330] = "EVENT_ID_ActionEntered";
|
|
11
|
+
AtsEventEnum[AtsEventEnum["EVENT_ID_Captured"] = 413] = "EVENT_ID_Captured";
|
|
12
|
+
})(AtsEventEnum || (exports.AtsEventEnum = AtsEventEnum = {}));
|
|
@@ -7,5 +7,6 @@ var MsgEventTypeEnum;
|
|
|
7
7
|
MsgEventTypeEnum[MsgEventTypeEnum["NotifyMsg"] = 2] = "NotifyMsg";
|
|
8
8
|
MsgEventTypeEnum[MsgEventTypeEnum["GtMsg"] = 3] = "GtMsg";
|
|
9
9
|
MsgEventTypeEnum[MsgEventTypeEnum["StateChanged"] = 4] = "StateChanged";
|
|
10
|
-
MsgEventTypeEnum[MsgEventTypeEnum["FreshWatchParam"] = 5] = "FreshWatchParam";
|
|
10
|
+
MsgEventTypeEnum[MsgEventTypeEnum["FreshWatchParam"] = 5] = "FreshWatchParam";
|
|
11
|
+
MsgEventTypeEnum[MsgEventTypeEnum["ATS"] = 6] = "ATS";
|
|
11
12
|
})(MsgEventTypeEnum || (exports.MsgEventTypeEnum = MsgEventTypeEnum = {}));
|
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import { VinChnl } from "../domain/VinChnl";
|
|
|
6
6
|
import { OutMsg } from "../domain/OutMsg";
|
|
7
7
|
import { AtsLoadResponse } from "../domain/AtsLoadResponse";
|
|
8
8
|
import { SubscribeDatagramResult } from "../domain/SubscribeDatagramResult";
|
|
9
|
+
import { BaseAtsEvent } from "../domain/ats/event/BaseAtsEvent";
|
|
9
10
|
/**
|
|
10
11
|
* 提供给前端接口调用
|
|
11
12
|
*/
|
|
@@ -26,12 +27,21 @@ export declare class GtcClient {
|
|
|
26
27
|
/**
|
|
27
28
|
* 监听事件
|
|
28
29
|
*
|
|
29
|
-
* @param slaveInstId
|
|
30
|
+
* @param slaveInstId 从机id
|
|
30
31
|
* @param serviceType 服务类型
|
|
31
32
|
* @param ctrlIndex 卡索引
|
|
32
33
|
* @param fn 回调函数
|
|
33
34
|
*/
|
|
34
35
|
static listenEventMsg(slaveInstId: string | null, serviceType: ServiceTypeEnum, ctrlIndex: number, fn: (result: GtcCallBackMsg) => void): void;
|
|
36
|
+
/**
|
|
37
|
+
* 监听ATS事件
|
|
38
|
+
*
|
|
39
|
+
* @param slaveInstId 从机id
|
|
40
|
+
* @param serviceType 服务类型
|
|
41
|
+
* @param ctrlIndex 卡索引
|
|
42
|
+
* @param fn 回调函数
|
|
43
|
+
*/
|
|
44
|
+
static listenAtsEventMsg(slaveInstId: string | null, serviceType: ServiceTypeEnum, ctrlIndex: number, fn: (result: Array<BaseAtsEvent>) => void): void;
|
|
35
45
|
/**
|
|
36
46
|
* 监听数据流
|
|
37
47
|
*
|
|
@@ -89,7 +99,7 @@ export declare class GtcClient {
|
|
|
89
99
|
* @param serviceType 服务类型
|
|
90
100
|
* @param tags 通道列表 Time,Event,Disp,Load
|
|
91
101
|
*/
|
|
92
|
-
static subscribeForDatagram(slaveInstId: string | null, serviceType: ServiceTypeEnum, tags: string): Promise<SubscribeDatagramResult
|
|
102
|
+
static subscribeForDatagram(slaveInstId: string | null, serviceType: ServiceTypeEnum, tags: string): Promise<Array<SubscribeDatagramResult>>;
|
|
93
103
|
/**
|
|
94
104
|
* 取消订阅通道数据流
|
|
95
105
|
*
|
|
@@ -64,7 +64,7 @@ class GtcClient {
|
|
|
64
64
|
/**
|
|
65
65
|
* 监听事件
|
|
66
66
|
*
|
|
67
|
-
* @param slaveInstId
|
|
67
|
+
* @param slaveInstId 从机id
|
|
68
68
|
* @param serviceType 服务类型
|
|
69
69
|
* @param ctrlIndex 卡索引
|
|
70
70
|
* @param fn 回调函数
|
|
@@ -72,6 +72,17 @@ class GtcClient {
|
|
|
72
72
|
static listenEventMsg(slaveInstId, serviceType, ctrlIndex, fn) {
|
|
73
73
|
PubSubUtil_1.PubSubUtil.subscribe(slaveInstId + ":" + SubKeyEnum_1.SubKeyEnum.GTC_EVENT_KEY + ":" + serviceType + ":" + ctrlIndex, '0', fn);
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* 监听ATS事件
|
|
77
|
+
*
|
|
78
|
+
* @param slaveInstId 从机id
|
|
79
|
+
* @param serviceType 服务类型
|
|
80
|
+
* @param ctrlIndex 卡索引
|
|
81
|
+
* @param fn 回调函数
|
|
82
|
+
*/
|
|
83
|
+
static listenAtsEventMsg(slaveInstId, serviceType, ctrlIndex, fn) {
|
|
84
|
+
PubSubUtil_1.PubSubUtil.subscribe(slaveInstId + ":" + SubKeyEnum_1.SubKeyEnum.GTC_ATS_EVENT_KEY + ":" + serviceType + ":" + ctrlIndex, '0', fn);
|
|
85
|
+
}
|
|
75
86
|
/**
|
|
76
87
|
* 监听数据流
|
|
77
88
|
*
|
|
@@ -9,6 +9,7 @@ const JsonRpcMethodEnum_1 = require("../domain/enums/JsonRpcMethodEnum");
|
|
|
9
9
|
const PubSubUtil_1 = require("../utils/PubSubUtil");
|
|
10
10
|
const SubKeyEnum_1 = require("../utils/enums/SubKeyEnum");
|
|
11
11
|
const socket_io_client_1 = __importDefault(require("socket.io-client"));
|
|
12
|
+
const MsgEventTypeEnum_1 = require("../domain/enums/MsgEventTypeEnum");
|
|
12
13
|
/**
|
|
13
14
|
* 远程gtc服务socketIO实现
|
|
14
15
|
*/
|
|
@@ -76,7 +77,12 @@ class GtcServiceSocketIOImpl {
|
|
|
76
77
|
}
|
|
77
78
|
event(response) {
|
|
78
79
|
// 处理事件
|
|
79
|
-
|
|
80
|
+
if (response.result.msgEventType === MsgEventTypeEnum_1.MsgEventTypeEnum.ATS) {
|
|
81
|
+
PubSubUtil_1.PubSubUtil.publish(response.slaveInstId + ":" + SubKeyEnum_1.SubKeyEnum.GTC_ATS_EVENT_KEY + ":" + response.result.serviceType + ":" + response.result.ctrlIndex, response.result.data);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
PubSubUtil_1.PubSubUtil.publish(response.slaveInstId + ":" + SubKeyEnum_1.SubKeyEnum.GTC_EVENT_KEY + ":" + response.result.serviceType + ":" + response.result.ctrlIndex, response.result.data);
|
|
85
|
+
}
|
|
80
86
|
}
|
|
81
87
|
dataGram(response) {
|
|
82
88
|
// 处理数据流
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ServiceTypeEnum } from "../domain/enums/ServiceTypeEnum";
|
|
2
2
|
import { AtsLoadResponse } from "../domain/AtsLoadResponse";
|
|
3
3
|
import { SubscribeDatagramResult } from "../domain/SubscribeDatagramResult";
|
|
4
|
+
import { BaseAtsEvent } from "../domain/ats/event/BaseAtsEvent";
|
|
4
5
|
export declare class MPlay {
|
|
5
6
|
private readonly instId;
|
|
6
7
|
private readonly serviceType;
|
|
7
8
|
private readonly ctrlIndex;
|
|
8
9
|
private dataGramCallBack;
|
|
10
|
+
private atsEventCallbackMap;
|
|
9
11
|
private atsHandleNameMap;
|
|
10
12
|
private atsStartedMark;
|
|
11
13
|
/**
|
|
@@ -28,7 +30,7 @@ export declare class MPlay {
|
|
|
28
30
|
* @param tags The channel tags to subscribe.
|
|
29
31
|
* @param fn The callback function to handle the datagram.
|
|
30
32
|
*/
|
|
31
|
-
subscribeForDatagram(tags: string, fn: (data: Array<Array<string>>) => void): Promise<SubscribeDatagramResult
|
|
33
|
+
subscribeForDatagram(tags: string, fn: (data: Array<Array<string>>) => void): Promise<Array<SubscribeDatagramResult>>;
|
|
32
34
|
/**
|
|
33
35
|
* Unsubscribe datagram from the MPlay server.
|
|
34
36
|
*/
|
|
@@ -37,9 +39,10 @@ export declare class MPlay {
|
|
|
37
39
|
* Load ATS script to the MPlay server.
|
|
38
40
|
*
|
|
39
41
|
* @param atsScriptName The name of the ATS script to load.
|
|
42
|
+
* @param fn The callback function to handle the ATS event.
|
|
40
43
|
* @return atsLoadResponse The response of the ATS load request.
|
|
41
44
|
*/
|
|
42
|
-
load<K extends string, V>(atsScriptName: string): Promise<AtsLoadResponse<K, V>>;
|
|
45
|
+
load<K extends string, V>(atsScriptName: string, fn: (msg: BaseAtsEvent) => void): Promise<AtsLoadResponse<K, V>>;
|
|
43
46
|
/**
|
|
44
47
|
* Start ATS script to the MPlay server by ATS handle.
|
|
45
48
|
*
|
|
@@ -15,6 +15,7 @@ const ServiceTypeEnum_1 = require("../domain/enums/ServiceTypeEnum");
|
|
|
15
15
|
const PubSubUtil_1 = require("../utils/PubSubUtil");
|
|
16
16
|
const SubKeyEnum_1 = require("../utils/enums/SubKeyEnum");
|
|
17
17
|
const TaskSynchronizer_1 = require("../utils/TaskSynchronizer");
|
|
18
|
+
const AtsEventEnum_1 = require("../domain/enums/AtsEventEnum");
|
|
18
19
|
class MPlay {
|
|
19
20
|
/**
|
|
20
21
|
* Connect to the MPlay server.
|
|
@@ -35,6 +36,7 @@ class MPlay {
|
|
|
35
36
|
*/
|
|
36
37
|
constructor(instId, serviceType, ctrlIndex) {
|
|
37
38
|
this.ctrlIndex = 0;
|
|
39
|
+
this.atsEventCallbackMap = {};
|
|
38
40
|
this.atsHandleNameMap = {};
|
|
39
41
|
this.atsStartedMark = {};
|
|
40
42
|
if (instId) {
|
|
@@ -89,6 +91,22 @@ class MPlay {
|
|
|
89
91
|
delete this.atsHandleNameMap[hAts];
|
|
90
92
|
}
|
|
91
93
|
});
|
|
94
|
+
GtcClient_1.GtcClient.listenAtsEventMsg(this.instId, this.serviceType, this.ctrlIndex, (msgList) => {
|
|
95
|
+
msgList.forEach(msg => {
|
|
96
|
+
for (const key in AtsEventEnum_1.AtsEventEnum) {
|
|
97
|
+
const value = AtsEventEnum_1.AtsEventEnum[key];
|
|
98
|
+
// @ts-ignore
|
|
99
|
+
if (value == msg.eventId) {
|
|
100
|
+
msg.eventTag = key;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const fn = this.atsEventCallbackMap[msg.atsHandle];
|
|
105
|
+
if (fn) {
|
|
106
|
+
fn(msg);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
});
|
|
92
110
|
}
|
|
93
111
|
/**
|
|
94
112
|
* Subscribe datagram to the MPlay server.
|
|
@@ -114,9 +132,10 @@ class MPlay {
|
|
|
114
132
|
* Load ATS script to the MPlay server.
|
|
115
133
|
*
|
|
116
134
|
* @param atsScriptName The name of the ATS script to load.
|
|
135
|
+
* @param fn The callback function to handle the ATS event.
|
|
117
136
|
* @return atsLoadResponse The response of the ATS load request.
|
|
118
137
|
*/
|
|
119
|
-
load(atsScriptName) {
|
|
138
|
+
load(atsScriptName, fn) {
|
|
120
139
|
return __awaiter(this, void 0, void 0, function* () {
|
|
121
140
|
const atsLoadResponse = yield GtcClient_1.GtcClient.atsLoad(this.instId, this.serviceType, this.ctrlIndex, atsScriptName);
|
|
122
141
|
const atsHandle = atsLoadResponse.atsHandle;
|
|
@@ -125,6 +144,7 @@ class MPlay {
|
|
|
125
144
|
}
|
|
126
145
|
this.atsStartedMark[atsHandle] = false;
|
|
127
146
|
this.atsHandleNameMap[atsHandle] = atsScriptName;
|
|
147
|
+
this.atsEventCallbackMap[atsHandle] = fn;
|
|
128
148
|
// @ts-ignore
|
|
129
149
|
return atsLoadResponse;
|
|
130
150
|
});
|
|
@@ -4,6 +4,7 @@ exports.SubKeyEnum = void 0;
|
|
|
4
4
|
var SubKeyEnum;
|
|
5
5
|
(function (SubKeyEnum) {
|
|
6
6
|
SubKeyEnum["GTC_EVENT_KEY"] = "GTC_EVENT_SUB_KEY";
|
|
7
|
+
SubKeyEnum["GTC_ATS_EVENT_KEY"] = "GTC_ATS_EVENT_KEY";
|
|
7
8
|
SubKeyEnum["GTC_DATA_GRAM_KEY"] = "GTC_DATA_GRAM_KEY";
|
|
8
9
|
SubKeyEnum["GTC_ANALYZE_GRAM_KEY"] = "GTC_ANALYZE_GRAM_KEY";
|
|
9
10
|
SubKeyEnum["NODE_INFO_LIST_KEY"] = "NODE_INFO_LIST_KEY";
|
package/.idea/m-play.iml
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="WEB_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager">
|
|
4
|
-
<content url="file://$MODULE_DIR$">
|
|
5
|
-
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
6
|
-
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
7
|
-
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
-
</content>
|
|
9
|
-
<orderEntry type="inheritedJdk" />
|
|
10
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
-
</component>
|
|
12
|
-
</module>
|
package/.idea/modules.xml
DELETED
package/.idea/vcs.xml
DELETED
package/dist/package.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "langjie-m-play",
|
|
3
|
-
"version": "0.0.7",
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"types": "index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc"
|
|
9
|
-
},
|
|
10
|
-
"author": "",
|
|
11
|
-
"license": "ISC",
|
|
12
|
-
"publishConfig": {
|
|
13
|
-
"registry": "https://registry.npmjs.org/"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"socket.io-client": "^2.1.1"
|
|
17
|
-
}
|
|
18
|
-
}
|
package/src/domain/DiDo.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {MsgSourceEnum} from "./enums/MsgSourceEnum";
|
|
2
|
-
import {RunStateEnum} from "./enums/RunStateEnum";
|
|
3
|
-
|
|
4
|
-
export interface GtcCallBackMsg {
|
|
5
|
-
hSrc: number;
|
|
6
|
-
msgId: number;
|
|
7
|
-
ms: number;
|
|
8
|
-
msg: string;
|
|
9
|
-
source: MsgSourceEnum;
|
|
10
|
-
runState: RunStateEnum;
|
|
11
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* rpc通讯参数常量
|
|
3
|
-
*/
|
|
4
|
-
export class JsonRpcConstant {
|
|
5
|
-
public static readonly SLAVE_INST_ID = "slaveInstId";
|
|
6
|
-
public static readonly CTRL_INDEX = "ctrlIndex";
|
|
7
|
-
public static readonly SERVICE_TYPE = "serviceType";
|
|
8
|
-
public static readonly CHANNEL_HANDLE = "channelHandle";
|
|
9
|
-
public static readonly SPEED = "speed";
|
|
10
|
-
public static readonly LOW_LIMIT = "lowLimit";
|
|
11
|
-
public static readonly UP_LIMIT = "upLimit";
|
|
12
|
-
public static readonly VALUE = "value";
|
|
13
|
-
public static readonly SWITCH_CODE = "switchCode";
|
|
14
|
-
public static readonly OPEN_STATUS = "openStatus";
|
|
15
|
-
public static readonly ATS_SCRIPT = "atsScript";
|
|
16
|
-
public static readonly ATS_HANDLE = "atsHandle";
|
|
17
|
-
public static readonly ATS_BUTTON_CODE = "atsButtonCode";
|
|
18
|
-
public static readonly ATS_PARAM_KEYS = "atsParamKeys";
|
|
19
|
-
public static readonly ATS_PARAM_VALUES = "atsParamValues";
|
|
20
|
-
public static readonly VIN_TAGS = "vinTags";
|
|
21
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {JsonRpcMethodEnum} from "./enums/JsonRpcMethodEnum";
|
|
2
|
-
import {JsonRpcEventEnum} from "./enums/JsonRpcEventEnum";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 请求对象
|
|
6
|
-
*/
|
|
7
|
-
export interface JsonRpcRequest<T> {
|
|
8
|
-
id: string;
|
|
9
|
-
method: JsonRpcMethodEnum;
|
|
10
|
-
params: T;
|
|
11
|
-
timestamp: number;
|
|
12
|
-
event: JsonRpcEventEnum;
|
|
13
|
-
slaveInstId: string | null;
|
|
14
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {JsonRpcMethodEnum} from "./enums/JsonRpcMethodEnum";
|
|
2
|
-
import {JsonRpcEventEnum} from "./enums/JsonRpcEventEnum";
|
|
3
|
-
import {JsonRpcError} from "./JsonRpcError";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 响应对象
|
|
7
|
-
*/
|
|
8
|
-
export interface JsonRpcResponse<T, E> {
|
|
9
|
-
id: string;
|
|
10
|
-
method: JsonRpcMethodEnum;
|
|
11
|
-
result: T;
|
|
12
|
-
error: JsonRpcError<E>,
|
|
13
|
-
timestamp: number;
|
|
14
|
-
event: JsonRpcEventEnum;
|
|
15
|
-
slaveInstId: string;
|
|
16
|
-
}
|
package/src/domain/NodeInfo.ts
DELETED
package/src/domain/OutMsg.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {MsgEventTypeEnum} from "./enums/MsgEventTypeEnum";
|
|
2
|
-
import {ServiceTypeEnum} from "./enums/ServiceTypeEnum";
|
|
3
|
-
|
|
4
|
-
export interface OutMsg<T> {
|
|
5
|
-
serviceType: ServiceTypeEnum;
|
|
6
|
-
ctrlIndex: number;
|
|
7
|
-
// 用于多轴对齐
|
|
8
|
-
batchId: string;
|
|
9
|
-
msgEventType: MsgEventTypeEnum;
|
|
10
|
-
data: T;
|
|
11
|
-
}
|
package/src/domain/ReadDataDO.ts
DELETED
package/src/domain/VinChnl.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface VinChnl {
|
|
2
|
-
LastVal: number;
|
|
3
|
-
SnapshotValArray: number[];
|
|
4
|
-
SnapshotNum: number;
|
|
5
|
-
Caption: string;
|
|
6
|
-
Dot: number;
|
|
7
|
-
BindHandle: number;
|
|
8
|
-
WavePeak: number[];
|
|
9
|
-
WaveValley: number[];
|
|
10
|
-
WaveEndIndexArr: number[];
|
|
11
|
-
GtWaveCount: number;
|
|
12
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import {JsonRpcEventEnum} from "./JsonRpcEventEnum";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 远程调用方法
|
|
5
|
-
*/
|
|
6
|
-
export enum JsonRpcMethodEnum {
|
|
7
|
-
CALL_GET_NODE_INFO = JsonRpcEventEnum.CALL + ".getNodeInfo",
|
|
8
|
-
REPLY_GET_NODE_INFO = JsonRpcEventEnum.REPLY + ".getNodeInfo",
|
|
9
|
-
CALL_GET_CONFIG = JsonRpcEventEnum.CALL + ".getConfig",
|
|
10
|
-
REPLY_GET_CONFIG = JsonRpcEventEnum.REPLY + ".getConfig",
|
|
11
|
-
CALL_SAVE_CONFIG = JsonRpcEventEnum.CALL + ".saveConfig",
|
|
12
|
-
REPLY_SAVE_CONFIG = JsonRpcEventEnum.REPLY + ".saveConfig",
|
|
13
|
-
CALL_START_TESTING = JsonRpcEventEnum.CALL + ".startTesting",
|
|
14
|
-
REPLY_START_TESTING = JsonRpcEventEnum.REPLY + ".startTesting",
|
|
15
|
-
|
|
16
|
-
EVENT_LOG = JsonRpcEventEnum.EVENT + ".log",
|
|
17
|
-
DATAGRAM_LIVE_DATA = JsonRpcEventEnum.DATAGRAM + ".liveData",
|
|
18
|
-
DATAGRAM_ANALYZE_DATA = JsonRpcEventEnum.DATAGRAM + ".analyzeData",
|
|
19
|
-
CALL_GET_DLL_VER = JsonRpcEventEnum.CALL + ".getDllVer",
|
|
20
|
-
REPLY_GET_DLL_VER = JsonRpcEventEnum.REPLY + ".getDllVer",
|
|
21
|
-
CALL_GET_CARD_NUMBER = JsonRpcEventEnum.CALL + ".getCardNumber",
|
|
22
|
-
REPLY_GET_CARD_NUMBER = JsonRpcEventEnum.REPLY + ".getCardNumber",
|
|
23
|
-
CALL_LAUNCH = JsonRpcEventEnum.CALL + ".launch",
|
|
24
|
-
REPLY_LAUNCH = JsonRpcEventEnum.REPLY + ".launch",
|
|
25
|
-
CALL_GET_DIGITAL_LIST = JsonRpcEventEnum.CALL + ".getDigitalList",
|
|
26
|
-
CALL_GET_SWITCH_LIST = JsonRpcEventEnum.CALL + ".getSwitchList",
|
|
27
|
-
REPLY_GET_DIGITAL_LIST = JsonRpcEventEnum.REPLY + ".getDigitalList",
|
|
28
|
-
REPLY_GET_SWITCH_LIST = JsonRpcEventEnum.REPLY + ".getSwitchList",
|
|
29
|
-
CALL_GET_VIN_CHNLS = JsonRpcEventEnum.CALL + ".getVinChnls",
|
|
30
|
-
REPLY_GET_VIN_CHNLS = JsonRpcEventEnum.REPLY + ".getVinChnls",
|
|
31
|
-
CALL_SET_REF_GEN_SLOPE= JsonRpcEventEnum.CALL + ".setRefGenSlope",
|
|
32
|
-
REPLY_SET_REF_GEN_SLOPE = JsonRpcEventEnum.REPLY + ".setRefGenSlope",
|
|
33
|
-
CALL_OPEN_LOOP_STOP = JsonRpcEventEnum.CALL + ".openLoopStop",
|
|
34
|
-
CALL_CLOSE_LOOP_STOP = JsonRpcEventEnum.CALL + ".closeLoopStop",
|
|
35
|
-
CALL_RESET_WAVE_COUNT = JsonRpcEventEnum.CALL + ".resetWaveCount",
|
|
36
|
-
REPLY_OPEN_LOOP_STOP = JsonRpcEventEnum.REPLY + ".openLoopStop",
|
|
37
|
-
REPLY_CLOSE_LOOP_STOP = JsonRpcEventEnum.REPLY + ".closeLoopStop",
|
|
38
|
-
REPLY_RESET_WAVE_COUNT = JsonRpcEventEnum.REPLY + ".resetWaveCount",
|
|
39
|
-
CALL_GET_MAX_SCALE = JsonRpcEventEnum.CALL + ".getMaxScale",
|
|
40
|
-
REPLY_GET_MAX_SCALE = JsonRpcEventEnum.REPLY + ".getMaxScale",
|
|
41
|
-
CALL_SET_PROTECTED_LIMIT = JsonRpcEventEnum.CALL + ".setProtectLimit",
|
|
42
|
-
REPLY_SET_PROTECTED_LIMIT = JsonRpcEventEnum.REPLY + ".setProtectLimit",
|
|
43
|
-
CALL_CLEAR_TO_ZERO = JsonRpcEventEnum.CALL + ".clearToZero",
|
|
44
|
-
REPLY_CLEAR_TO_ZERO = JsonRpcEventEnum.REPLY + ".clearToZero",
|
|
45
|
-
CALL_SWITCH_DIGITAL_OUT = JsonRpcEventEnum.CALL + ".switchDigitalOut",
|
|
46
|
-
REPLY_SWITCH_DIGITAL_OUT = JsonRpcEventEnum.REPLY + ".switchDigitalOut",
|
|
47
|
-
CALL_CLOSE = JsonRpcEventEnum.CALL + ".close",
|
|
48
|
-
REPLY_CLOSE = JsonRpcEventEnum.REPLY + ".close",
|
|
49
|
-
CALL_GET_PRODUCT_INFO = JsonRpcEventEnum.CALL + ".getProductInfo",
|
|
50
|
-
REPLY_GET_PRODUCT_INFO = JsonRpcEventEnum.REPLY + ".getProductInfo",
|
|
51
|
-
CALL_ATS_LOAD = JsonRpcEventEnum.CALL + ".atsLoad",
|
|
52
|
-
CALL_ATS_START = JsonRpcEventEnum.CALL + ".atsStart",
|
|
53
|
-
CALL_ATS_TERMINATE = JsonRpcEventEnum.CALL + ".atsTerminate",
|
|
54
|
-
CALL_ATS_SET_PARAM = JsonRpcEventEnum.CALL + ".atsSetParam",
|
|
55
|
-
CALL_ATS_GET_PARAM = JsonRpcEventEnum.CALL + ".atsGetParam",
|
|
56
|
-
CALL_ATS_PUSH_BUTTON = JsonRpcEventEnum.CALL + ".atsPushButton",
|
|
57
|
-
REPLY_ATS_LOAD = JsonRpcEventEnum.REPLY + ".atsLoad",
|
|
58
|
-
REPLY_ATS_START = JsonRpcEventEnum.REPLY + ".atsStart",
|
|
59
|
-
REPLY_ATS_TERMINATE = JsonRpcEventEnum.REPLY + ".atsTerminate",
|
|
60
|
-
REPLY_ATS_SET_PARAM = JsonRpcEventEnum.REPLY + ".atsSetParam",
|
|
61
|
-
REPLY_ATS_GET_PARAM = JsonRpcEventEnum.REPLY + ".atsGetParam",
|
|
62
|
-
REPLY_ATS_PUSH_BUTTON = JsonRpcEventEnum.REPLY + ".atsPushButton",
|
|
63
|
-
CALL_SUBSCRIBE_FOR_DATA_GRAM = JsonRpcEventEnum.CALL + ".subscribeForDatagram",
|
|
64
|
-
REPLY_SUBSCRIBE_FOR_DATA_GRAM = JsonRpcEventEnum.REPLY + ".subscribeForDatagram",
|
|
65
|
-
CALL_UNSUBSCRIBE_FOR_DATA_GRAM = JsonRpcEventEnum.CALL + ".unsubscribeForDatagram",
|
|
66
|
-
REPLY_UNSUBSCRIBE_FOR_DATA_GRAM = JsonRpcEventEnum.REPLY + ".unsubscribeForDatagram",
|
|
67
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 错误码
|
|
3
|
-
*/
|
|
4
|
-
export enum JsonRpcResponseCodeEnum {
|
|
5
|
-
CALL_OK = 0,
|
|
6
|
-
CALL_CANCELLED = 1,
|
|
7
|
-
CALL_UNKNOWN = 2,
|
|
8
|
-
CALL_INVALID_ARGUMENT = 3,
|
|
9
|
-
CALL_DEADLINE_EXCEEDED = 4,
|
|
10
|
-
CALL_NOT_FOUND = 5,
|
|
11
|
-
CALL_ALREADY_EXISTS = 6,
|
|
12
|
-
CALL_PERMISSION_DENIED = 7,
|
|
13
|
-
CALL_RESOURCE_EXHAUSTED = 8,
|
|
14
|
-
CALL_FAILED_PRECONDITION = 9,
|
|
15
|
-
CALL_ABORTED = 10,
|
|
16
|
-
CALL_OUT_OF_RANGE = 11,
|
|
17
|
-
CALL_UNIMPLEMENTED = 12,
|
|
18
|
-
CALL_INTERNAL = 13,
|
|
19
|
-
CALL_UNAVAILABLE = 14,
|
|
20
|
-
CALL_DATA_LOSS = 15,
|
|
21
|
-
CALL_UNAUTHENTICATED = 16,
|
|
22
|
-
}
|