langjie-m-play 0.0.4 → 0.0.5
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/package.json +1 -1
- package/service/MPlay.d.ts +1 -0
- package/service/MPlay.js +6 -0
package/package.json
CHANGED
package/service/MPlay.d.ts
CHANGED
package/service/MPlay.js
CHANGED
|
@@ -36,6 +36,7 @@ class MPlay {
|
|
|
36
36
|
constructor(instId, serviceType, ctrlIndex) {
|
|
37
37
|
this.ctrlIndex = 0;
|
|
38
38
|
this.atsHandleNameMap = {};
|
|
39
|
+
this.atsStartedMark = {};
|
|
39
40
|
if (instId) {
|
|
40
41
|
this.instId = instId;
|
|
41
42
|
}
|
|
@@ -120,6 +121,7 @@ class MPlay {
|
|
|
120
121
|
if (atsHandle === 0) {
|
|
121
122
|
throw new Error("Failed to load ATS script");
|
|
122
123
|
}
|
|
124
|
+
this.atsStartedMark[atsHandle] = false;
|
|
123
125
|
this.atsHandleNameMap[atsHandle] = atsScriptName;
|
|
124
126
|
return atsHandle;
|
|
125
127
|
});
|
|
@@ -137,6 +139,7 @@ class MPlay {
|
|
|
137
139
|
yield GtcClient_1.GtcClient.atsStart(this.instId, this.serviceType, this.ctrlIndex, atsHandle, this.atsHandleNameMap[atsHandle]);
|
|
138
140
|
yield atsStartSynchronizer.waitAll();
|
|
139
141
|
PubSubUtil_1.PubSubUtil.unsubscribe(SubKeyEnum_1.SubKeyEnum.ATS_START_OK, atsHandle.toString());
|
|
142
|
+
this.atsStartedMark[atsHandle] = true;
|
|
140
143
|
});
|
|
141
144
|
}
|
|
142
145
|
/**
|
|
@@ -150,6 +153,9 @@ class MPlay {
|
|
|
150
153
|
if (!this.atsHandleNameMap[atsHandle]) {
|
|
151
154
|
throw new Error("Please load ATS script first");
|
|
152
155
|
}
|
|
156
|
+
if (!this.atsStartedMark[atsHandle]) {
|
|
157
|
+
yield this.start(atsHandle);
|
|
158
|
+
}
|
|
153
159
|
yield GtcClient_1.GtcClient.atsPushButton(this.instId, this.serviceType, this.ctrlIndex, atsHandle, buttonName);
|
|
154
160
|
});
|
|
155
161
|
}
|