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.
Files changed (99) hide show
  1. package/.idea/m-play.iml +12 -0
  2. package/.idea/modules.xml +8 -0
  3. package/.idea/vcs.xml +6 -0
  4. package/dist/domain/SubscribeDatagramResult.d.ts +5 -0
  5. package/dist/package.json +18 -0
  6. package/{service → dist/service}/GtcClient.d.ts +3 -2
  7. package/dist/service/IGtcService.js +2 -0
  8. package/{service → dist/service}/MPlay.d.ts +3 -2
  9. package/{service → dist/service}/MPlay.js +4 -3
  10. package/package.json +1 -1
  11. package/src/domain/AtsLoadResponse.ts +4 -0
  12. package/src/domain/DiDo.ts +6 -0
  13. package/src/domain/GtcCallBackMsg.ts +11 -0
  14. package/src/domain/JsonRpcConstant.ts +21 -0
  15. package/src/domain/JsonRpcError.ts +7 -0
  16. package/src/domain/JsonRpcRequest.ts +14 -0
  17. package/src/domain/JsonRpcResponse.ts +16 -0
  18. package/src/domain/NodeInfo.ts +14 -0
  19. package/src/domain/OutMsg.ts +11 -0
  20. package/src/domain/ProductInfo.ts +4 -0
  21. package/src/domain/ReadDataDO.ts +10 -0
  22. package/src/domain/SubscribeDatagramResult.ts +5 -0
  23. package/src/domain/VinChnl.ts +12 -0
  24. package/src/domain/enums/ConnectStatusEnum.ts +7 -0
  25. package/src/domain/enums/JsonRpcEventEnum.ts +10 -0
  26. package/src/domain/enums/JsonRpcMethodEnum.ts +67 -0
  27. package/src/domain/enums/JsonRpcResponseCodeEnum.ts +22 -0
  28. package/src/domain/enums/MsgEventTypeEnum.ts +7 -0
  29. package/src/domain/enums/MsgSourceEnum.ts +4 -0
  30. package/src/domain/enums/RunStateEnum.ts +9 -0
  31. package/src/domain/enums/ServiceTypeEnum.ts +7 -0
  32. package/src/index.ts +15 -0
  33. package/src/service/GtcClient.ts +461 -0
  34. package/src/service/GtcServiceFactory.ts +18 -0
  35. package/src/service/GtcServiceSocketIOImpl.ts +98 -0
  36. package/src/service/IGtcService.ts +24 -0
  37. package/src/service/MPlay.ts +175 -0
  38. package/src/utils/IdGenerator.ts +12 -0
  39. package/src/utils/PubSubUtil.ts +22 -0
  40. package/src/utils/TaskSynchronizer.ts +23 -0
  41. package/src/utils/enums/SubKeyEnum.ts +15 -0
  42. package/tsconfig.json +109 -0
  43. /package/{domain → dist/domain}/AtsLoadResponse.d.ts +0 -0
  44. /package/{domain → dist/domain}/AtsLoadResponse.js +0 -0
  45. /package/{domain → dist/domain}/DiDo.d.ts +0 -0
  46. /package/{domain → dist/domain}/DiDo.js +0 -0
  47. /package/{domain → dist/domain}/GtcCallBackMsg.d.ts +0 -0
  48. /package/{domain → dist/domain}/GtcCallBackMsg.js +0 -0
  49. /package/{domain → dist/domain}/JsonRpcConstant.d.ts +0 -0
  50. /package/{domain → dist/domain}/JsonRpcConstant.js +0 -0
  51. /package/{domain → dist/domain}/JsonRpcError.d.ts +0 -0
  52. /package/{domain → dist/domain}/JsonRpcError.js +0 -0
  53. /package/{domain → dist/domain}/JsonRpcRequest.d.ts +0 -0
  54. /package/{domain → dist/domain}/JsonRpcRequest.js +0 -0
  55. /package/{domain → dist/domain}/JsonRpcResponse.d.ts +0 -0
  56. /package/{domain → dist/domain}/JsonRpcResponse.js +0 -0
  57. /package/{domain → dist/domain}/NodeInfo.d.ts +0 -0
  58. /package/{domain → dist/domain}/NodeInfo.js +0 -0
  59. /package/{domain → dist/domain}/OutMsg.d.ts +0 -0
  60. /package/{domain → dist/domain}/OutMsg.js +0 -0
  61. /package/{domain → dist/domain}/ProductInfo.d.ts +0 -0
  62. /package/{domain → dist/domain}/ProductInfo.js +0 -0
  63. /package/{domain → dist/domain}/ReadDataDO.d.ts +0 -0
  64. /package/{domain → dist/domain}/ReadDataDO.js +0 -0
  65. /package/{domain/VinChnl.js → dist/domain/SubscribeDatagramResult.js} +0 -0
  66. /package/{domain → dist/domain}/VinChnl.d.ts +0 -0
  67. /package/{service/IGtcService.js → dist/domain/VinChnl.js} +0 -0
  68. /package/{domain → dist/domain}/enums/ConnectStatusEnum.d.ts +0 -0
  69. /package/{domain → dist/domain}/enums/ConnectStatusEnum.js +0 -0
  70. /package/{domain → dist/domain}/enums/JsonRpcEventEnum.d.ts +0 -0
  71. /package/{domain → dist/domain}/enums/JsonRpcEventEnum.js +0 -0
  72. /package/{domain → dist/domain}/enums/JsonRpcMethodEnum.d.ts +0 -0
  73. /package/{domain → dist/domain}/enums/JsonRpcMethodEnum.js +0 -0
  74. /package/{domain → dist/domain}/enums/JsonRpcResponseCodeEnum.d.ts +0 -0
  75. /package/{domain → dist/domain}/enums/JsonRpcResponseCodeEnum.js +0 -0
  76. /package/{domain → dist/domain}/enums/MsgEventTypeEnum.d.ts +0 -0
  77. /package/{domain → dist/domain}/enums/MsgEventTypeEnum.js +0 -0
  78. /package/{domain → dist/domain}/enums/MsgSourceEnum.d.ts +0 -0
  79. /package/{domain → dist/domain}/enums/MsgSourceEnum.js +0 -0
  80. /package/{domain → dist/domain}/enums/RunStateEnum.d.ts +0 -0
  81. /package/{domain → dist/domain}/enums/RunStateEnum.js +0 -0
  82. /package/{domain → dist/domain}/enums/ServiceTypeEnum.d.ts +0 -0
  83. /package/{domain → dist/domain}/enums/ServiceTypeEnum.js +0 -0
  84. /package/{index.d.ts → dist/index.d.ts} +0 -0
  85. /package/{index.js → dist/index.js} +0 -0
  86. /package/{service → dist/service}/GtcClient.js +0 -0
  87. /package/{service → dist/service}/GtcServiceFactory.d.ts +0 -0
  88. /package/{service → dist/service}/GtcServiceFactory.js +0 -0
  89. /package/{service → dist/service}/GtcServiceSocketIOImpl.d.ts +0 -0
  90. /package/{service → dist/service}/GtcServiceSocketIOImpl.js +0 -0
  91. /package/{service → dist/service}/IGtcService.d.ts +0 -0
  92. /package/{utils → dist/utils}/IdGenerator.d.ts +0 -0
  93. /package/{utils → dist/utils}/IdGenerator.js +0 -0
  94. /package/{utils → dist/utils}/PubSubUtil.d.ts +0 -0
  95. /package/{utils → dist/utils}/PubSubUtil.js +0 -0
  96. /package/{utils → dist/utils}/TaskSynchronizer.d.ts +0 -0
  97. /package/{utils → dist/utils}/TaskSynchronizer.js +0 -0
  98. /package/{utils → dist/utils}/enums/SubKeyEnum.d.ts +0 -0
  99. /package/{utils → dist/utils}/enums/SubKeyEnum.js +0 -0
@@ -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>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/m-play.iml" filepath="$PROJECT_DIR$/.idea/m-play.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,5 @@
1
+ export interface SubscribeDatagramResult {
2
+ maxScaleList: Array<number>;
3
+ unitCodeList: Array<number>;
4
+ unitNameList: Array<string>;
5
+ }
@@ -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<string[]>;
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<null>;
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
  *
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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<void>;
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<void>;
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
- // PubSubUtil.publish(SubKeyEnum.ATS_JUMP_ACTION, { instId, ctrlIndex });
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langjie-m-play",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -0,0 +1,4 @@
1
+ export interface AtsLoadResponse<K extends string, V> {
2
+ atsHandle: number;
3
+ atsParam: Record<K, V>;
4
+ }
@@ -0,0 +1,6 @@
1
+ export interface DiDo {
2
+ LastVal: number;
3
+ ValArray: number[];
4
+ BindHandle: number;
5
+ Caption: string;
6
+ }
@@ -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,7 @@
1
+ import {JsonRpcResponseCodeEnum} from "./enums/JsonRpcResponseCodeEnum";
2
+
3
+ export interface JsonRpcError<E> {
4
+ code: JsonRpcResponseCodeEnum;
5
+ message: string;
6
+ data: E;
7
+ }
@@ -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,14 @@
1
+ import {ConnectStatusEnum} from "./enums/ConnectStatusEnum";
2
+
3
+ export interface NodeInfo {
4
+
5
+ /**
6
+ * 节点状态
7
+ */
8
+ nodeStatus: ConnectStatusEnum;
9
+
10
+ /**
11
+ * 节点id
12
+ */
13
+ instId: string | null;
14
+ }
@@ -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,4 @@
1
+ export interface ProductInfo {
2
+ dSn: number;
3
+ device: string;
4
+ }
@@ -0,0 +1,10 @@
1
+ import {VinChnl} from "./VinChnl";
2
+ import {DiDo} from "./DiDo";
3
+
4
+ export interface ReadDataDO {
5
+ ChannelList: Array<VinChnl>;
6
+ DiList: Array<DiDo>;
7
+ DoList: Array<DiDo>;
8
+ TimeArr: number[];
9
+ DataGramList: Array<string[]>;
10
+ }
@@ -0,0 +1,5 @@
1
+ export interface SubscribeDatagramResult {
2
+ maxScaleList: Array<number>;
3
+ unitCodeList: Array<number>;
4
+ unitNameList: Array<string>;
5
+ }
@@ -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,7 @@
1
+ /**
2
+ * 服务器联机状态
3
+ */
4
+ export enum ConnectStatusEnum {
5
+ DISCONNECT = 0,
6
+ CONNECTED = 1,
7
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 事件类型
3
+ */
4
+ export enum JsonRpcEventEnum {
5
+ CALL = "R_CALL_PACK",
6
+ REPLY = "R_REPLY_PACK",
7
+ EVENT = "R_EVENT_PACK",
8
+ DATAGRAM = "R_GRAM_LIST",
9
+ ANALYZE_GRAM = "R_ANALYZE_GRAM",
10
+ }
@@ -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
+ }
@@ -0,0 +1,7 @@
1
+ export enum MsgEventTypeEnum {
2
+ ReadData = 1, // 读数据
3
+ NotifyMsg = 2, // 其他通知消息
4
+ GtMsg = 3, // mgt驱动发出的消息
5
+ StateChanged = 4,
6
+ FreshWatchParam = 5 //可以刷新WatchParam
7
+ }
@@ -0,0 +1,4 @@
1
+ export enum MsgSourceEnum {
2
+ CallBack,
3
+ RecvMsg
4
+ }
@@ -0,0 +1,9 @@
1
+ export enum RunStateEnum {
2
+ INIT = 1,
3
+ RUN_GT = 2,
4
+ WAIT_OK = 3,
5
+ BIND_GT = 4,
6
+ WORKING = 5,
7
+ WAIT_GT_CLOSE = 6,
8
+ CLOSED = 7
9
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 服务类型
3
+ */
4
+ export enum ServiceTypeEnum {
5
+ MGT = 1,
6
+ VTC = 2,
7
+ }
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';