langjie-m-play 0.0.1

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 (57) hide show
  1. package/domain/DiDo.d.ts +6 -0
  2. package/domain/DiDo.js +2 -0
  3. package/domain/GtcCallBackMsg.d.ts +10 -0
  4. package/domain/GtcCallBackMsg.js +2 -0
  5. package/domain/JsonRpcConstant.d.ts +21 -0
  6. package/domain/JsonRpcConstant.js +25 -0
  7. package/domain/JsonRpcError.d.ts +6 -0
  8. package/domain/JsonRpcError.js +2 -0
  9. package/domain/JsonRpcRequest.d.ts +13 -0
  10. package/domain/JsonRpcRequest.js +2 -0
  11. package/domain/JsonRpcResponse.d.ts +15 -0
  12. package/domain/JsonRpcResponse.js +2 -0
  13. package/domain/NodeInfo.d.ts +11 -0
  14. package/domain/NodeInfo.js +2 -0
  15. package/domain/OutMsg.d.ts +9 -0
  16. package/domain/OutMsg.js +2 -0
  17. package/domain/ProductInfo.d.ts +4 -0
  18. package/domain/ProductInfo.js +2 -0
  19. package/domain/ReadDataDO.d.ts +9 -0
  20. package/domain/ReadDataDO.js +2 -0
  21. package/domain/VinChnl.d.ts +12 -0
  22. package/domain/VinChnl.js +2 -0
  23. package/domain/enums/ConnectStatusEnum.d.ts +7 -0
  24. package/domain/enums/ConnectStatusEnum.js +11 -0
  25. package/domain/enums/JsonRpcEventEnum.d.ts +10 -0
  26. package/domain/enums/JsonRpcEventEnum.js +14 -0
  27. package/domain/enums/JsonRpcMethodEnum.d.ts +62 -0
  28. package/domain/enums/JsonRpcMethodEnum.js +67 -0
  29. package/domain/enums/JsonRpcResponseCodeEnum.d.ts +22 -0
  30. package/domain/enums/JsonRpcResponseCodeEnum.js +26 -0
  31. package/domain/enums/MsgEventTypeEnum.d.ts +7 -0
  32. package/domain/enums/MsgEventTypeEnum.js +11 -0
  33. package/domain/enums/MsgSourceEnum.d.ts +4 -0
  34. package/domain/enums/MsgSourceEnum.js +8 -0
  35. package/domain/enums/RunStateEnum.d.ts +9 -0
  36. package/domain/enums/RunStateEnum.js +13 -0
  37. package/domain/enums/ServiceTypeEnum.d.ts +7 -0
  38. package/domain/enums/ServiceTypeEnum.js +11 -0
  39. package/index.d.ts +12 -0
  40. package/index.js +15 -0
  41. package/package.json +18 -0
  42. package/service/GtcClient.d.ts +249 -0
  43. package/service/GtcClient.js +473 -0
  44. package/service/GtcServiceFactory.d.ts +9 -0
  45. package/service/GtcServiceFactory.js +18 -0
  46. package/service/GtcServiceSocketIOImpl.d.ts +21 -0
  47. package/service/GtcServiceSocketIOImpl.js +86 -0
  48. package/service/IGtcService.d.ts +16 -0
  49. package/service/IGtcService.js +2 -0
  50. package/service/MPlay.d.ts +10 -0
  51. package/service/MPlay.js +51 -0
  52. package/utils/IdGenerator.d.ts +7 -0
  53. package/utils/IdGenerator.js +15 -0
  54. package/utils/PubSubUtil.d.ts +7 -0
  55. package/utils/PubSubUtil.js +20 -0
  56. package/utils/enums/SubKeyEnum.d.ts +14 -0
  57. package/utils/enums/SubKeyEnum.js +18 -0
@@ -0,0 +1,6 @@
1
+ export interface DiDo {
2
+ LastVal: number;
3
+ ValArray: number[];
4
+ BindHandle: number;
5
+ Caption: string;
6
+ }
package/domain/DiDo.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import { MsgSourceEnum } from "./enums/MsgSourceEnum";
2
+ import { RunStateEnum } from "./enums/RunStateEnum";
3
+ export interface GtcCallBackMsg {
4
+ hSrc: number;
5
+ msgId: number;
6
+ ms: number;
7
+ msg: string;
8
+ source: MsgSourceEnum;
9
+ runState: RunStateEnum;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,21 @@
1
+ /**
2
+ * rpc通讯参数常量
3
+ */
4
+ export declare class JsonRpcConstant {
5
+ static readonly SLAVE_INST_ID = "slaveInstId";
6
+ static readonly CTRL_INDEX = "ctrlIndex";
7
+ static readonly SERVICE_TYPE = "serviceType";
8
+ static readonly CHANNEL_HANDLE = "channelHandle";
9
+ static readonly SPEED = "speed";
10
+ static readonly LOW_LIMIT = "lowLimit";
11
+ static readonly UP_LIMIT = "upLimit";
12
+ static readonly VALUE = "value";
13
+ static readonly SWITCH_CODE = "switchCode";
14
+ static readonly OPEN_STATUS = "openStatus";
15
+ static readonly ATS_SCRIPT = "atsScript";
16
+ static readonly ATS_HANDLE = "atsHandle";
17
+ static readonly ATS_BUTTON_CODE = "atsButtonCode";
18
+ static readonly ATS_PARAM_KEYS = "atsParamKeys";
19
+ static readonly ATS_PARAM_VALUES = "atsParamValues";
20
+ static readonly VIN_TAGS = "vinTags";
21
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JsonRpcConstant = void 0;
4
+ /**
5
+ * rpc通讯参数常量
6
+ */
7
+ class JsonRpcConstant {
8
+ }
9
+ exports.JsonRpcConstant = JsonRpcConstant;
10
+ JsonRpcConstant.SLAVE_INST_ID = "slaveInstId";
11
+ JsonRpcConstant.CTRL_INDEX = "ctrlIndex";
12
+ JsonRpcConstant.SERVICE_TYPE = "serviceType";
13
+ JsonRpcConstant.CHANNEL_HANDLE = "channelHandle";
14
+ JsonRpcConstant.SPEED = "speed";
15
+ JsonRpcConstant.LOW_LIMIT = "lowLimit";
16
+ JsonRpcConstant.UP_LIMIT = "upLimit";
17
+ JsonRpcConstant.VALUE = "value";
18
+ JsonRpcConstant.SWITCH_CODE = "switchCode";
19
+ JsonRpcConstant.OPEN_STATUS = "openStatus";
20
+ JsonRpcConstant.ATS_SCRIPT = "atsScript";
21
+ JsonRpcConstant.ATS_HANDLE = "atsHandle";
22
+ JsonRpcConstant.ATS_BUTTON_CODE = "atsButtonCode";
23
+ JsonRpcConstant.ATS_PARAM_KEYS = "atsParamKeys";
24
+ JsonRpcConstant.ATS_PARAM_VALUES = "atsParamValues";
25
+ JsonRpcConstant.VIN_TAGS = "vinTags";
@@ -0,0 +1,6 @@
1
+ import { JsonRpcResponseCodeEnum } from "./enums/JsonRpcResponseCodeEnum";
2
+ export interface JsonRpcError<E> {
3
+ code: JsonRpcResponseCodeEnum;
4
+ message: string;
5
+ data: E;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { JsonRpcMethodEnum } from "./enums/JsonRpcMethodEnum";
2
+ import { JsonRpcEventEnum } from "./enums/JsonRpcEventEnum";
3
+ /**
4
+ * 请求对象
5
+ */
6
+ export interface JsonRpcRequest<T> {
7
+ id: string;
8
+ method: JsonRpcMethodEnum;
9
+ params: T;
10
+ timestamp: number;
11
+ event: JsonRpcEventEnum;
12
+ slaveInstId: string | null;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ import { JsonRpcMethodEnum } from "./enums/JsonRpcMethodEnum";
2
+ import { JsonRpcEventEnum } from "./enums/JsonRpcEventEnum";
3
+ import { JsonRpcError } from "./JsonRpcError";
4
+ /**
5
+ * 响应对象
6
+ */
7
+ export interface JsonRpcResponse<T, E> {
8
+ id: string;
9
+ method: JsonRpcMethodEnum;
10
+ result: T;
11
+ error: JsonRpcError<E>;
12
+ timestamp: number;
13
+ event: JsonRpcEventEnum;
14
+ slaveInstId: string;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { ConnectStatusEnum } from "./enums/ConnectStatusEnum";
2
+ export interface NodeInfo {
3
+ /**
4
+ * 节点状态
5
+ */
6
+ nodeStatus: ConnectStatusEnum;
7
+ /**
8
+ * 节点id
9
+ */
10
+ instId: string | null;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import { MsgEventTypeEnum } from "./enums/MsgEventTypeEnum";
2
+ import { ServiceTypeEnum } from "./enums/ServiceTypeEnum";
3
+ export interface OutMsg<T> {
4
+ serviceType: ServiceTypeEnum;
5
+ ctrlIndex: number;
6
+ batchId: string;
7
+ msgEventType: MsgEventTypeEnum;
8
+ data: T;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface ProductInfo {
2
+ dSn: number;
3
+ device: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import { VinChnl } from "./VinChnl";
2
+ import { DiDo } from "./DiDo";
3
+ export interface ReadDataDO {
4
+ ChannelList: Array<VinChnl>;
5
+ DiList: Array<DiDo>;
6
+ DoList: Array<DiDo>;
7
+ TimeArr: number[];
8
+ DataGramList: Array<string[]>;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 服务器联机状态
3
+ */
4
+ export declare enum ConnectStatusEnum {
5
+ DISCONNECT = 0,
6
+ CONNECTED = 1
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConnectStatusEnum = void 0;
4
+ /**
5
+ * 服务器联机状态
6
+ */
7
+ var ConnectStatusEnum;
8
+ (function (ConnectStatusEnum) {
9
+ ConnectStatusEnum[ConnectStatusEnum["DISCONNECT"] = 0] = "DISCONNECT";
10
+ ConnectStatusEnum[ConnectStatusEnum["CONNECTED"] = 1] = "CONNECTED";
11
+ })(ConnectStatusEnum || (exports.ConnectStatusEnum = ConnectStatusEnum = {}));
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 事件类型
3
+ */
4
+ export declare 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,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JsonRpcEventEnum = void 0;
4
+ /**
5
+ * 事件类型
6
+ */
7
+ var JsonRpcEventEnum;
8
+ (function (JsonRpcEventEnum) {
9
+ JsonRpcEventEnum["CALL"] = "R_CALL_PACK";
10
+ JsonRpcEventEnum["REPLY"] = "R_REPLY_PACK";
11
+ JsonRpcEventEnum["EVENT"] = "R_EVENT_PACK";
12
+ JsonRpcEventEnum["DATAGRAM"] = "R_GRAM_LIST";
13
+ JsonRpcEventEnum["ANALYZE_GRAM"] = "R_ANALYZE_GRAM";
14
+ })(JsonRpcEventEnum || (exports.JsonRpcEventEnum = JsonRpcEventEnum = {}));
@@ -0,0 +1,62 @@
1
+ /**
2
+ * 远程调用方法
3
+ */
4
+ export declare enum JsonRpcMethodEnum {
5
+ CALL_GET_NODE_INFO = "R_CALL_PACK.getNodeInfo",
6
+ REPLY_GET_NODE_INFO = "R_REPLY_PACK.getNodeInfo",
7
+ CALL_GET_CONFIG = "R_CALL_PACK.getConfig",
8
+ REPLY_GET_CONFIG = "R_REPLY_PACK.getConfig",
9
+ CALL_SAVE_CONFIG = "R_CALL_PACK.saveConfig",
10
+ REPLY_SAVE_CONFIG = "R_REPLY_PACK.saveConfig",
11
+ CALL_START_TESTING = "R_CALL_PACK.startTesting",
12
+ REPLY_START_TESTING = "R_REPLY_PACK.startTesting",
13
+ EVENT_LOG = "R_EVENT_PACK.log",
14
+ DATAGRAM_LIVE_DATA = "R_GRAM_LIST.liveData",
15
+ DATAGRAM_ANALYZE_DATA = "R_GRAM_LIST.analyzeData",
16
+ CALL_GET_DLL_VER = "R_CALL_PACK.getDllVer",
17
+ REPLY_GET_DLL_VER = "R_REPLY_PACK.getDllVer",
18
+ CALL_GET_CARD_NUMBER = "R_CALL_PACK.getCardNumber",
19
+ REPLY_GET_CARD_NUMBER = "R_REPLY_PACK.getCardNumber",
20
+ CALL_LAUNCH = "R_CALL_PACK.launch",
21
+ REPLY_LAUNCH = "R_REPLY_PACK.launch",
22
+ CALL_GET_DIGITAL_LIST = "R_CALL_PACK.getDigitalList",
23
+ CALL_GET_SWITCH_LIST = "R_CALL_PACK.getSwitchList",
24
+ REPLY_GET_DIGITAL_LIST = "R_REPLY_PACK.getDigitalList",
25
+ REPLY_GET_SWITCH_LIST = "R_REPLY_PACK.getSwitchList",
26
+ CALL_GET_VIN_CHNLS = "R_CALL_PACK.getVinChnls",
27
+ REPLY_GET_VIN_CHNLS = "R_REPLY_PACK.getVinChnls",
28
+ CALL_SET_REF_GEN_SLOPE = "R_CALL_PACK.setRefGenSlope",
29
+ REPLY_SET_REF_GEN_SLOPE = "R_REPLY_PACK.setRefGenSlope",
30
+ CALL_OPEN_LOOP_STOP = "R_CALL_PACK.openLoopStop",
31
+ CALL_CLOSE_LOOP_STOP = "R_CALL_PACK.closeLoopStop",
32
+ CALL_RESET_WAVE_COUNT = "R_CALL_PACK.resetWaveCount",
33
+ REPLY_OPEN_LOOP_STOP = "R_REPLY_PACK.openLoopStop",
34
+ REPLY_CLOSE_LOOP_STOP = "R_REPLY_PACK.closeLoopStop",
35
+ REPLY_RESET_WAVE_COUNT = "R_REPLY_PACK.resetWaveCount",
36
+ CALL_GET_MAX_SCALE = "R_CALL_PACK.getMaxScale",
37
+ REPLY_GET_MAX_SCALE = "R_REPLY_PACK.getMaxScale",
38
+ CALL_SET_PROTECTED_LIMIT = "R_CALL_PACK.setProtectLimit",
39
+ REPLY_SET_PROTECTED_LIMIT = "R_REPLY_PACK.setProtectLimit",
40
+ CALL_CLEAR_TO_ZERO = "R_CALL_PACK.clearToZero",
41
+ REPLY_CLEAR_TO_ZERO = "R_REPLY_PACK.clearToZero",
42
+ CALL_SWITCH_DIGITAL_OUT = "R_CALL_PACK.switchDigitalOut",
43
+ REPLY_SWITCH_DIGITAL_OUT = "R_REPLY_PACK.switchDigitalOut",
44
+ CALL_CLOSE = "R_CALL_PACK.close",
45
+ REPLY_CLOSE = "R_REPLY_PACK.close",
46
+ CALL_GET_PRODUCT_INFO = "R_CALL_PACK.getProductInfo",
47
+ REPLY_GET_PRODUCT_INFO = "R_REPLY_PACK.getProductInfo",
48
+ CALL_ATS_LOAD = "R_CALL_PACK.atsLoad",
49
+ CALL_ATS_START = "R_CALL_PACK.atsStart",
50
+ CALL_ATS_TERMINATE = "R_CALL_PACK.atsTerminate",
51
+ CALL_ATS_SET_PARAM = "R_CALL_PACK.atsSetParam",
52
+ CALL_ATS_PUSH_BUTTON = "R_CALL_PACK.atsPushButton",
53
+ REPLY_ATS_LOAD = "R_REPLY_PACK.atsLoad",
54
+ REPLY_ATS_START = "R_REPLY_PACK.atsStart",
55
+ REPLY_ATS_TERMINATE = "R_REPLY_PACK.atsTerminate",
56
+ REPLY_ATS_SET_PARAM = "R_REPLY_PACK.atsSetParam",
57
+ REPLY_ATS_PUSH_BUTTON = "R_REPLY_PACK.atsPushButton",
58
+ CALL_SUBSCRIBE_FOR_DATA_GRAM = "R_CALL_PACK.subscribeForDatagram",
59
+ REPLY_SUBSCRIBE_FOR_DATA_GRAM = "R_REPLY_PACK.subscribeForDatagram",
60
+ CALL_UNSUBSCRIBE_FOR_DATA_GRAM = "R_CALL_PACK.unsubscribeForDatagram",
61
+ REPLY_UNSUBSCRIBE_FOR_DATA_GRAM = "R_REPLY_PACK.unsubscribeForDatagram"
62
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JsonRpcMethodEnum = void 0;
4
+ const JsonRpcEventEnum_1 = require("./JsonRpcEventEnum");
5
+ /**
6
+ * 远程调用方法
7
+ */
8
+ var JsonRpcMethodEnum;
9
+ (function (JsonRpcMethodEnum) {
10
+ JsonRpcMethodEnum["CALL_GET_NODE_INFO"] = "R_CALL_PACK.getNodeInfo";
11
+ JsonRpcMethodEnum["REPLY_GET_NODE_INFO"] = "R_REPLY_PACK.getNodeInfo";
12
+ JsonRpcMethodEnum["CALL_GET_CONFIG"] = "R_CALL_PACK.getConfig";
13
+ JsonRpcMethodEnum["REPLY_GET_CONFIG"] = "R_REPLY_PACK.getConfig";
14
+ JsonRpcMethodEnum["CALL_SAVE_CONFIG"] = "R_CALL_PACK.saveConfig";
15
+ JsonRpcMethodEnum["REPLY_SAVE_CONFIG"] = "R_REPLY_PACK.saveConfig";
16
+ JsonRpcMethodEnum["CALL_START_TESTING"] = "R_CALL_PACK.startTesting";
17
+ JsonRpcMethodEnum["REPLY_START_TESTING"] = "R_REPLY_PACK.startTesting";
18
+ JsonRpcMethodEnum["EVENT_LOG"] = "R_EVENT_PACK.log";
19
+ JsonRpcMethodEnum["DATAGRAM_LIVE_DATA"] = "R_GRAM_LIST.liveData";
20
+ JsonRpcMethodEnum["DATAGRAM_ANALYZE_DATA"] = "R_GRAM_LIST.analyzeData";
21
+ JsonRpcMethodEnum["CALL_GET_DLL_VER"] = "R_CALL_PACK.getDllVer";
22
+ JsonRpcMethodEnum["REPLY_GET_DLL_VER"] = "R_REPLY_PACK.getDllVer";
23
+ JsonRpcMethodEnum["CALL_GET_CARD_NUMBER"] = "R_CALL_PACK.getCardNumber";
24
+ JsonRpcMethodEnum["REPLY_GET_CARD_NUMBER"] = "R_REPLY_PACK.getCardNumber";
25
+ JsonRpcMethodEnum["CALL_LAUNCH"] = "R_CALL_PACK.launch";
26
+ JsonRpcMethodEnum["REPLY_LAUNCH"] = "R_REPLY_PACK.launch";
27
+ JsonRpcMethodEnum["CALL_GET_DIGITAL_LIST"] = "R_CALL_PACK.getDigitalList";
28
+ JsonRpcMethodEnum["CALL_GET_SWITCH_LIST"] = "R_CALL_PACK.getSwitchList";
29
+ JsonRpcMethodEnum["REPLY_GET_DIGITAL_LIST"] = "R_REPLY_PACK.getDigitalList";
30
+ JsonRpcMethodEnum["REPLY_GET_SWITCH_LIST"] = "R_REPLY_PACK.getSwitchList";
31
+ JsonRpcMethodEnum["CALL_GET_VIN_CHNLS"] = "R_CALL_PACK.getVinChnls";
32
+ JsonRpcMethodEnum["REPLY_GET_VIN_CHNLS"] = "R_REPLY_PACK.getVinChnls";
33
+ JsonRpcMethodEnum["CALL_SET_REF_GEN_SLOPE"] = "R_CALL_PACK.setRefGenSlope";
34
+ JsonRpcMethodEnum["REPLY_SET_REF_GEN_SLOPE"] = "R_REPLY_PACK.setRefGenSlope";
35
+ JsonRpcMethodEnum["CALL_OPEN_LOOP_STOP"] = "R_CALL_PACK.openLoopStop";
36
+ JsonRpcMethodEnum["CALL_CLOSE_LOOP_STOP"] = "R_CALL_PACK.closeLoopStop";
37
+ JsonRpcMethodEnum["CALL_RESET_WAVE_COUNT"] = "R_CALL_PACK.resetWaveCount";
38
+ JsonRpcMethodEnum["REPLY_OPEN_LOOP_STOP"] = "R_REPLY_PACK.openLoopStop";
39
+ JsonRpcMethodEnum["REPLY_CLOSE_LOOP_STOP"] = "R_REPLY_PACK.closeLoopStop";
40
+ JsonRpcMethodEnum["REPLY_RESET_WAVE_COUNT"] = "R_REPLY_PACK.resetWaveCount";
41
+ JsonRpcMethodEnum["CALL_GET_MAX_SCALE"] = "R_CALL_PACK.getMaxScale";
42
+ JsonRpcMethodEnum["REPLY_GET_MAX_SCALE"] = "R_REPLY_PACK.getMaxScale";
43
+ JsonRpcMethodEnum["CALL_SET_PROTECTED_LIMIT"] = "R_CALL_PACK.setProtectLimit";
44
+ JsonRpcMethodEnum["REPLY_SET_PROTECTED_LIMIT"] = "R_REPLY_PACK.setProtectLimit";
45
+ JsonRpcMethodEnum["CALL_CLEAR_TO_ZERO"] = "R_CALL_PACK.clearToZero";
46
+ JsonRpcMethodEnum["REPLY_CLEAR_TO_ZERO"] = "R_REPLY_PACK.clearToZero";
47
+ JsonRpcMethodEnum["CALL_SWITCH_DIGITAL_OUT"] = "R_CALL_PACK.switchDigitalOut";
48
+ JsonRpcMethodEnum["REPLY_SWITCH_DIGITAL_OUT"] = "R_REPLY_PACK.switchDigitalOut";
49
+ JsonRpcMethodEnum["CALL_CLOSE"] = "R_CALL_PACK.close";
50
+ JsonRpcMethodEnum["REPLY_CLOSE"] = "R_REPLY_PACK.close";
51
+ JsonRpcMethodEnum["CALL_GET_PRODUCT_INFO"] = "R_CALL_PACK.getProductInfo";
52
+ JsonRpcMethodEnum["REPLY_GET_PRODUCT_INFO"] = "R_REPLY_PACK.getProductInfo";
53
+ JsonRpcMethodEnum["CALL_ATS_LOAD"] = "R_CALL_PACK.atsLoad";
54
+ JsonRpcMethodEnum["CALL_ATS_START"] = "R_CALL_PACK.atsStart";
55
+ JsonRpcMethodEnum["CALL_ATS_TERMINATE"] = "R_CALL_PACK.atsTerminate";
56
+ JsonRpcMethodEnum["CALL_ATS_SET_PARAM"] = "R_CALL_PACK.atsSetParam";
57
+ JsonRpcMethodEnum["CALL_ATS_PUSH_BUTTON"] = "R_CALL_PACK.atsPushButton";
58
+ JsonRpcMethodEnum["REPLY_ATS_LOAD"] = "R_REPLY_PACK.atsLoad";
59
+ JsonRpcMethodEnum["REPLY_ATS_START"] = "R_REPLY_PACK.atsStart";
60
+ JsonRpcMethodEnum["REPLY_ATS_TERMINATE"] = "R_REPLY_PACK.atsTerminate";
61
+ JsonRpcMethodEnum["REPLY_ATS_SET_PARAM"] = "R_REPLY_PACK.atsSetParam";
62
+ JsonRpcMethodEnum["REPLY_ATS_PUSH_BUTTON"] = "R_REPLY_PACK.atsPushButton";
63
+ JsonRpcMethodEnum["CALL_SUBSCRIBE_FOR_DATA_GRAM"] = "R_CALL_PACK.subscribeForDatagram";
64
+ JsonRpcMethodEnum["REPLY_SUBSCRIBE_FOR_DATA_GRAM"] = "R_REPLY_PACK.subscribeForDatagram";
65
+ JsonRpcMethodEnum["CALL_UNSUBSCRIBE_FOR_DATA_GRAM"] = "R_CALL_PACK.unsubscribeForDatagram";
66
+ JsonRpcMethodEnum["REPLY_UNSUBSCRIBE_FOR_DATA_GRAM"] = "R_REPLY_PACK.unsubscribeForDatagram";
67
+ })(JsonRpcMethodEnum || (exports.JsonRpcMethodEnum = JsonRpcMethodEnum = {}));
@@ -0,0 +1,22 @@
1
+ /**
2
+ * 错误码
3
+ */
4
+ export declare 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,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JsonRpcResponseCodeEnum = void 0;
4
+ /**
5
+ * 错误码
6
+ */
7
+ var JsonRpcResponseCodeEnum;
8
+ (function (JsonRpcResponseCodeEnum) {
9
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_OK"] = 0] = "CALL_OK";
10
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_CANCELLED"] = 1] = "CALL_CANCELLED";
11
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_UNKNOWN"] = 2] = "CALL_UNKNOWN";
12
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_INVALID_ARGUMENT"] = 3] = "CALL_INVALID_ARGUMENT";
13
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_DEADLINE_EXCEEDED"] = 4] = "CALL_DEADLINE_EXCEEDED";
14
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_NOT_FOUND"] = 5] = "CALL_NOT_FOUND";
15
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_ALREADY_EXISTS"] = 6] = "CALL_ALREADY_EXISTS";
16
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_PERMISSION_DENIED"] = 7] = "CALL_PERMISSION_DENIED";
17
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_RESOURCE_EXHAUSTED"] = 8] = "CALL_RESOURCE_EXHAUSTED";
18
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_FAILED_PRECONDITION"] = 9] = "CALL_FAILED_PRECONDITION";
19
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_ABORTED"] = 10] = "CALL_ABORTED";
20
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_OUT_OF_RANGE"] = 11] = "CALL_OUT_OF_RANGE";
21
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_UNIMPLEMENTED"] = 12] = "CALL_UNIMPLEMENTED";
22
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_INTERNAL"] = 13] = "CALL_INTERNAL";
23
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_UNAVAILABLE"] = 14] = "CALL_UNAVAILABLE";
24
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_DATA_LOSS"] = 15] = "CALL_DATA_LOSS";
25
+ JsonRpcResponseCodeEnum[JsonRpcResponseCodeEnum["CALL_UNAUTHENTICATED"] = 16] = "CALL_UNAUTHENTICATED";
26
+ })(JsonRpcResponseCodeEnum || (exports.JsonRpcResponseCodeEnum = JsonRpcResponseCodeEnum = {}));
@@ -0,0 +1,7 @@
1
+ export declare enum MsgEventTypeEnum {
2
+ ReadData = 1,// 读数据
3
+ NotifyMsg = 2,// 其他通知消息
4
+ GtMsg = 3,// mgt驱动发出的消息
5
+ StateChanged = 4,
6
+ FreshWatchParam = 5
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MsgEventTypeEnum = void 0;
4
+ var MsgEventTypeEnum;
5
+ (function (MsgEventTypeEnum) {
6
+ MsgEventTypeEnum[MsgEventTypeEnum["ReadData"] = 1] = "ReadData";
7
+ MsgEventTypeEnum[MsgEventTypeEnum["NotifyMsg"] = 2] = "NotifyMsg";
8
+ MsgEventTypeEnum[MsgEventTypeEnum["GtMsg"] = 3] = "GtMsg";
9
+ MsgEventTypeEnum[MsgEventTypeEnum["StateChanged"] = 4] = "StateChanged";
10
+ MsgEventTypeEnum[MsgEventTypeEnum["FreshWatchParam"] = 5] = "FreshWatchParam"; //可以刷新WatchParam
11
+ })(MsgEventTypeEnum || (exports.MsgEventTypeEnum = MsgEventTypeEnum = {}));
@@ -0,0 +1,4 @@
1
+ export declare enum MsgSourceEnum {
2
+ CallBack = 0,
3
+ RecvMsg = 1
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MsgSourceEnum = void 0;
4
+ var MsgSourceEnum;
5
+ (function (MsgSourceEnum) {
6
+ MsgSourceEnum[MsgSourceEnum["CallBack"] = 0] = "CallBack";
7
+ MsgSourceEnum[MsgSourceEnum["RecvMsg"] = 1] = "RecvMsg";
8
+ })(MsgSourceEnum || (exports.MsgSourceEnum = MsgSourceEnum = {}));
@@ -0,0 +1,9 @@
1
+ export declare 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,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RunStateEnum = void 0;
4
+ var RunStateEnum;
5
+ (function (RunStateEnum) {
6
+ RunStateEnum[RunStateEnum["INIT"] = 1] = "INIT";
7
+ RunStateEnum[RunStateEnum["RUN_GT"] = 2] = "RUN_GT";
8
+ RunStateEnum[RunStateEnum["WAIT_OK"] = 3] = "WAIT_OK";
9
+ RunStateEnum[RunStateEnum["BIND_GT"] = 4] = "BIND_GT";
10
+ RunStateEnum[RunStateEnum["WORKING"] = 5] = "WORKING";
11
+ RunStateEnum[RunStateEnum["WAIT_GT_CLOSE"] = 6] = "WAIT_GT_CLOSE";
12
+ RunStateEnum[RunStateEnum["CLOSED"] = 7] = "CLOSED";
13
+ })(RunStateEnum || (exports.RunStateEnum = RunStateEnum = {}));
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 服务类型
3
+ */
4
+ export declare enum ServiceTypeEnum {
5
+ MGT = 1,
6
+ VTC = 2
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ServiceTypeEnum = void 0;
4
+ /**
5
+ * 服务类型
6
+ */
7
+ var ServiceTypeEnum;
8
+ (function (ServiceTypeEnum) {
9
+ ServiceTypeEnum[ServiceTypeEnum["MGT"] = 1] = "MGT";
10
+ ServiceTypeEnum[ServiceTypeEnum["VTC"] = 2] = "VTC";
11
+ })(ServiceTypeEnum || (exports.ServiceTypeEnum = ServiceTypeEnum = {}));
package/index.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ export { SubKeyEnum } from './utils/enums/SubKeyEnum';
2
+ export { PubSubUtil } from './utils/PubSubUtil';
3
+ export { VinChnl } from './domain/VinChnl';
4
+ export { ReadDataDO } from './domain/ReadDataDO';
5
+ export { ProductInfo } from './domain/ProductInfo';
6
+ export { OutMsg } from './domain/OutMsg';
7
+ export { NodeInfo } from './domain/NodeInfo';
8
+ export { DiDo } from './domain/DiDo';
9
+ export { ConnectStatusEnum } from './domain/enums/ConnectStatusEnum';
10
+ export { ServiceTypeEnum } from './domain/enums/ServiceTypeEnum';
11
+ export { GtcClient } from './service/GtcClient';
12
+ export { MPlay } from './service/MPlay';
package/index.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MPlay = exports.GtcClient = exports.ServiceTypeEnum = exports.ConnectStatusEnum = exports.PubSubUtil = exports.SubKeyEnum = void 0;
4
+ var SubKeyEnum_1 = require("./utils/enums/SubKeyEnum");
5
+ Object.defineProperty(exports, "SubKeyEnum", { enumerable: true, get: function () { return SubKeyEnum_1.SubKeyEnum; } });
6
+ var PubSubUtil_1 = require("./utils/PubSubUtil");
7
+ Object.defineProperty(exports, "PubSubUtil", { enumerable: true, get: function () { return PubSubUtil_1.PubSubUtil; } });
8
+ var ConnectStatusEnum_1 = require("./domain/enums/ConnectStatusEnum");
9
+ Object.defineProperty(exports, "ConnectStatusEnum", { enumerable: true, get: function () { return ConnectStatusEnum_1.ConnectStatusEnum; } });
10
+ var ServiceTypeEnum_1 = require("./domain/enums/ServiceTypeEnum");
11
+ Object.defineProperty(exports, "ServiceTypeEnum", { enumerable: true, get: function () { return ServiceTypeEnum_1.ServiceTypeEnum; } });
12
+ var GtcClient_1 = require("./service/GtcClient");
13
+ Object.defineProperty(exports, "GtcClient", { enumerable: true, get: function () { return GtcClient_1.GtcClient; } });
14
+ var MPlay_1 = require("./service/MPlay");
15
+ Object.defineProperty(exports, "MPlay", { enumerable: true, get: function () { return MPlay_1.MPlay; } });
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "langjie-m-play",
3
+ "version": "0.0.1",
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
+ }