langjie-m-play 0.0.6 → 0.0.7
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/.idea/m-play.iml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/dist/domain/SubscribeDatagramResult.d.ts +5 -0
- package/dist/package.json +18 -0
- package/{service → dist/service}/GtcClient.d.ts +3 -2
- package/dist/service/IGtcService.js +2 -0
- package/{service → dist/service}/MPlay.d.ts +3 -2
- package/{service → dist/service}/MPlay.js +4 -3
- package/package.json +1 -1
- package/src/domain/AtsLoadResponse.ts +4 -0
- package/src/domain/DiDo.ts +6 -0
- package/src/domain/GtcCallBackMsg.ts +11 -0
- package/src/domain/JsonRpcConstant.ts +21 -0
- package/src/domain/JsonRpcError.ts +7 -0
- package/src/domain/JsonRpcRequest.ts +14 -0
- package/src/domain/JsonRpcResponse.ts +16 -0
- package/src/domain/NodeInfo.ts +14 -0
- package/src/domain/OutMsg.ts +11 -0
- package/src/domain/ProductInfo.ts +4 -0
- package/src/domain/ReadDataDO.ts +10 -0
- package/src/domain/SubscribeDatagramResult.ts +5 -0
- package/src/domain/VinChnl.ts +12 -0
- package/src/domain/enums/ConnectStatusEnum.ts +7 -0
- package/src/domain/enums/JsonRpcEventEnum.ts +10 -0
- package/src/domain/enums/JsonRpcMethodEnum.ts +67 -0
- package/src/domain/enums/JsonRpcResponseCodeEnum.ts +22 -0
- package/src/domain/enums/MsgEventTypeEnum.ts +7 -0
- package/src/domain/enums/MsgSourceEnum.ts +4 -0
- package/src/domain/enums/RunStateEnum.ts +9 -0
- package/src/domain/enums/ServiceTypeEnum.ts +7 -0
- package/src/index.ts +15 -0
- package/src/service/GtcClient.ts +461 -0
- package/src/service/GtcServiceFactory.ts +18 -0
- package/src/service/GtcServiceSocketIOImpl.ts +98 -0
- package/src/service/IGtcService.ts +24 -0
- package/src/service/MPlay.ts +175 -0
- package/src/utils/IdGenerator.ts +12 -0
- package/src/utils/PubSubUtil.ts +22 -0
- package/src/utils/TaskSynchronizer.ts +23 -0
- package/src/utils/enums/SubKeyEnum.ts +15 -0
- package/tsconfig.json +109 -0
- /package/{domain → dist/domain}/AtsLoadResponse.d.ts +0 -0
- /package/{domain → dist/domain}/AtsLoadResponse.js +0 -0
- /package/{domain → dist/domain}/DiDo.d.ts +0 -0
- /package/{domain → dist/domain}/DiDo.js +0 -0
- /package/{domain → dist/domain}/GtcCallBackMsg.d.ts +0 -0
- /package/{domain → dist/domain}/GtcCallBackMsg.js +0 -0
- /package/{domain → dist/domain}/JsonRpcConstant.d.ts +0 -0
- /package/{domain → dist/domain}/JsonRpcConstant.js +0 -0
- /package/{domain → dist/domain}/JsonRpcError.d.ts +0 -0
- /package/{domain → dist/domain}/JsonRpcError.js +0 -0
- /package/{domain → dist/domain}/JsonRpcRequest.d.ts +0 -0
- /package/{domain → dist/domain}/JsonRpcRequest.js +0 -0
- /package/{domain → dist/domain}/JsonRpcResponse.d.ts +0 -0
- /package/{domain → dist/domain}/JsonRpcResponse.js +0 -0
- /package/{domain → dist/domain}/NodeInfo.d.ts +0 -0
- /package/{domain → dist/domain}/NodeInfo.js +0 -0
- /package/{domain → dist/domain}/OutMsg.d.ts +0 -0
- /package/{domain → dist/domain}/OutMsg.js +0 -0
- /package/{domain → dist/domain}/ProductInfo.d.ts +0 -0
- /package/{domain → dist/domain}/ProductInfo.js +0 -0
- /package/{domain → dist/domain}/ReadDataDO.d.ts +0 -0
- /package/{domain → dist/domain}/ReadDataDO.js +0 -0
- /package/{domain/VinChnl.js → dist/domain/SubscribeDatagramResult.js} +0 -0
- /package/{domain → dist/domain}/VinChnl.d.ts +0 -0
- /package/{service/IGtcService.js → dist/domain/VinChnl.js} +0 -0
- /package/{domain → dist/domain}/enums/ConnectStatusEnum.d.ts +0 -0
- /package/{domain → dist/domain}/enums/ConnectStatusEnum.js +0 -0
- /package/{domain → dist/domain}/enums/JsonRpcEventEnum.d.ts +0 -0
- /package/{domain → dist/domain}/enums/JsonRpcEventEnum.js +0 -0
- /package/{domain → dist/domain}/enums/JsonRpcMethodEnum.d.ts +0 -0
- /package/{domain → dist/domain}/enums/JsonRpcMethodEnum.js +0 -0
- /package/{domain → dist/domain}/enums/JsonRpcResponseCodeEnum.d.ts +0 -0
- /package/{domain → dist/domain}/enums/JsonRpcResponseCodeEnum.js +0 -0
- /package/{domain → dist/domain}/enums/MsgEventTypeEnum.d.ts +0 -0
- /package/{domain → dist/domain}/enums/MsgEventTypeEnum.js +0 -0
- /package/{domain → dist/domain}/enums/MsgSourceEnum.d.ts +0 -0
- /package/{domain → dist/domain}/enums/MsgSourceEnum.js +0 -0
- /package/{domain → dist/domain}/enums/RunStateEnum.d.ts +0 -0
- /package/{domain → dist/domain}/enums/RunStateEnum.js +0 -0
- /package/{domain → dist/domain}/enums/ServiceTypeEnum.d.ts +0 -0
- /package/{domain → dist/domain}/enums/ServiceTypeEnum.js +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{service → dist/service}/GtcClient.js +0 -0
- /package/{service → dist/service}/GtcServiceFactory.d.ts +0 -0
- /package/{service → dist/service}/GtcServiceFactory.js +0 -0
- /package/{service → dist/service}/GtcServiceSocketIOImpl.d.ts +0 -0
- /package/{service → dist/service}/GtcServiceSocketIOImpl.js +0 -0
- /package/{service → dist/service}/IGtcService.d.ts +0 -0
- /package/{utils → dist/utils}/IdGenerator.d.ts +0 -0
- /package/{utils → dist/utils}/IdGenerator.js +0 -0
- /package/{utils → dist/utils}/PubSubUtil.d.ts +0 -0
- /package/{utils → dist/utils}/PubSubUtil.js +0 -0
- /package/{utils → dist/utils}/TaskSynchronizer.d.ts +0 -0
- /package/{utils → dist/utils}/TaskSynchronizer.js +0 -0
- /package/{utils → dist/utils}/enums/SubKeyEnum.d.ts +0 -0
- /package/{utils → dist/utils}/enums/SubKeyEnum.js +0 -0
package/.idea/m-play.iml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
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/vcs.xml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
}
|
|
@@ -5,6 +5,7 @@ import { ReadDataDO } from "../domain/ReadDataDO";
|
|
|
5
5
|
import { VinChnl } from "../domain/VinChnl";
|
|
6
6
|
import { OutMsg } from "../domain/OutMsg";
|
|
7
7
|
import { AtsLoadResponse } from "../domain/AtsLoadResponse";
|
|
8
|
+
import { SubscribeDatagramResult } from "../domain/SubscribeDatagramResult";
|
|
8
9
|
/**
|
|
9
10
|
* 提供给前端接口调用
|
|
10
11
|
*/
|
|
@@ -88,7 +89,7 @@ export declare class GtcClient {
|
|
|
88
89
|
* @param serviceType 服务类型
|
|
89
90
|
* @param tags 通道列表 Time,Event,Disp,Load
|
|
90
91
|
*/
|
|
91
|
-
static subscribeForDatagram(slaveInstId: string | null, serviceType: ServiceTypeEnum, tags: string): Promise<
|
|
92
|
+
static subscribeForDatagram(slaveInstId: string | null, serviceType: ServiceTypeEnum, tags: string): Promise<SubscribeDatagramResult>;
|
|
92
93
|
/**
|
|
93
94
|
* 取消订阅通道数据流
|
|
94
95
|
*
|
|
@@ -246,7 +247,7 @@ export declare class GtcClient {
|
|
|
246
247
|
* @param keys 参数keys
|
|
247
248
|
* @param values 参数values
|
|
248
249
|
*/
|
|
249
|
-
static atsSetParam(slaveInstId: string | null, serviceType: ServiceTypeEnum, ctrlIndex: number, atsHandle: number, keys: string[], values: Array<string | number>): Promise<
|
|
250
|
+
static atsSetParam<K extends string, V>(slaveInstId: string | null, serviceType: ServiceTypeEnum, ctrlIndex: number, atsHandle: number, keys: string[], values: Array<string | number>): Promise<Record<K, V>>;
|
|
250
251
|
/**
|
|
251
252
|
* 获取ats参数
|
|
252
253
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ServiceTypeEnum } from "../domain/enums/ServiceTypeEnum";
|
|
2
2
|
import { AtsLoadResponse } from "../domain/AtsLoadResponse";
|
|
3
|
+
import { SubscribeDatagramResult } from "../domain/SubscribeDatagramResult";
|
|
3
4
|
export declare class MPlay {
|
|
4
5
|
private readonly instId;
|
|
5
6
|
private readonly serviceType;
|
|
@@ -27,7 +28,7 @@ export declare class MPlay {
|
|
|
27
28
|
* @param tags The channel tags to subscribe.
|
|
28
29
|
* @param fn The callback function to handle the datagram.
|
|
29
30
|
*/
|
|
30
|
-
subscribeForDatagram(tags: string, fn: (data: Array<Array<string>>) => void): Promise<
|
|
31
|
+
subscribeForDatagram(tags: string, fn: (data: Array<Array<string>>) => void): Promise<SubscribeDatagramResult>;
|
|
31
32
|
/**
|
|
32
33
|
* Unsubscribe datagram from the MPlay server.
|
|
33
34
|
*/
|
|
@@ -64,5 +65,5 @@ export declare class MPlay {
|
|
|
64
65
|
* @param atsHandle The handle of the ATS script.
|
|
65
66
|
* @param param The parameter to set.
|
|
66
67
|
*/
|
|
67
|
-
atsSetParam(atsHandle: number, param: Record<string, number>): Promise<
|
|
68
|
+
atsSetParam(atsHandle: number, param: Record<string, number>): Promise<Record<string, number>>;
|
|
68
69
|
}
|
|
@@ -73,7 +73,8 @@ class MPlay {
|
|
|
73
73
|
}
|
|
74
74
|
else if (msg.msgId >= 0x0700 && msg.msgId < 0x0800) {
|
|
75
75
|
// ats跳转到指定步骤
|
|
76
|
-
|
|
76
|
+
const hAts = msg.msgId & 0x00F0 >> 4;
|
|
77
|
+
PubSubUtil_1.PubSubUtil.publish(SubKeyEnum_1.SubKeyEnum.ATS_JUMP_ACTION, { instId, ctrlIndex, hAts, step: msg.msg });
|
|
77
78
|
}
|
|
78
79
|
else if (msg.msgId >= 0x0800 && msg.msgId < 0x0900) {
|
|
79
80
|
// ats异常停止
|
|
@@ -97,8 +98,8 @@ class MPlay {
|
|
|
97
98
|
*/
|
|
98
99
|
subscribeForDatagram(tags, fn) {
|
|
99
100
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
yield GtcClient_1.GtcClient.subscribeForDatagram(this.instId, this.serviceType, tags);
|
|
101
101
|
this.dataGramCallBack = fn;
|
|
102
|
+
return yield GtcClient_1.GtcClient.subscribeForDatagram(this.instId, this.serviceType, tags);
|
|
102
103
|
});
|
|
103
104
|
}
|
|
104
105
|
/**
|
|
@@ -184,7 +185,7 @@ class MPlay {
|
|
|
184
185
|
for (const key in param) {
|
|
185
186
|
values.push(param[key]);
|
|
186
187
|
}
|
|
187
|
-
yield GtcClient_1.GtcClient.atsSetParam(this.instId, this.serviceType, this.ctrlIndex, atsHandle, keys, values);
|
|
188
|
+
return yield GtcClient_1.GtcClient.atsSetParam(this.instId, this.serviceType, this.ctrlIndex, atsHandle, keys, values);
|
|
188
189
|
});
|
|
189
190
|
}
|
|
190
191
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { SubKeyEnum } from './utils/enums/SubKeyEnum';
|
|
2
|
+
export { PubSubUtil } from './utils/PubSubUtil';
|
|
3
|
+
|
|
4
|
+
export { VinChnl } from './domain/VinChnl';
|
|
5
|
+
export { ReadDataDO } from './domain/ReadDataDO';
|
|
6
|
+
export { ProductInfo } from './domain/ProductInfo';
|
|
7
|
+
export { OutMsg } from './domain/OutMsg';
|
|
8
|
+
export { NodeInfo } from './domain/NodeInfo';
|
|
9
|
+
export { DiDo } from './domain/DiDo';
|
|
10
|
+
export { ConnectStatusEnum } from './domain/enums/ConnectStatusEnum';
|
|
11
|
+
export { ServiceTypeEnum } from './domain/enums/ServiceTypeEnum';
|
|
12
|
+
|
|
13
|
+
export { GtcClient } from './service/GtcClient';
|
|
14
|
+
|
|
15
|
+
export { MPlay } from './service/MPlay';
|