@abi-software/simulationvuer 3.0.10 → 3.0.11
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/dist/simulationvuer.js +1689 -1678
- package/dist/simulationvuer.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/SimulationVuer.vue +44 -1
package/package.json
CHANGED
|
@@ -274,7 +274,8 @@ export default {
|
|
|
274
274
|
|
|
275
275
|
this.activeSubscriptions.push(payload);
|
|
276
276
|
|
|
277
|
-
//
|
|
277
|
+
// Ask OpenCOR to track the simulation data associated with the subscription's component and variable (and the
|
|
278
|
+
// VOI, if requested).
|
|
278
279
|
|
|
279
280
|
const modelParameters = [];
|
|
280
281
|
|
|
@@ -292,6 +293,48 @@ export default {
|
|
|
292
293
|
* @arg `subscriptionId `
|
|
293
294
|
*/
|
|
294
295
|
removeDataSubscription(subscriptionId) {
|
|
296
|
+
// Ask OpenCOR to stop tracking the simulation data associated with the subscription's component and variable (and
|
|
297
|
+
// the VOI, if requested and unless it's requested by another subscription).
|
|
298
|
+
|
|
299
|
+
const subscription = this.activeSubscriptions.find((activeSubscription) => {
|
|
300
|
+
return activeSubscription.windowId === subscriptionId;
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
if (!subscription) {
|
|
304
|
+
console.warn(`removeDataSubscription: no active subscription found for id ${subscriptionId}.`);
|
|
305
|
+
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const isVoiTrackedByAnotherSubscription = this.activeSubscriptions.some((activeSubscription) => {
|
|
310
|
+
return activeSubscription.windowId !== subscriptionId && activeSubscription.withVOI;
|
|
311
|
+
});
|
|
312
|
+
const isModelParameterTrackedByAnotherSubscription = this.activeSubscriptions.some((activeSubscription) => {
|
|
313
|
+
return (
|
|
314
|
+
activeSubscription.windowId !== subscriptionId &&
|
|
315
|
+
activeSubscription.component === subscription.component &&
|
|
316
|
+
activeSubscription.variable === subscription.variable
|
|
317
|
+
);
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
if (!isVoiTrackedByAnotherSubscription || !isModelParameterTrackedByAnotherSubscription) {
|
|
321
|
+
const modelParameters = [];
|
|
322
|
+
|
|
323
|
+
if (subscription.withVOI && !isVoiTrackedByAnotherSubscription) {
|
|
324
|
+
modelParameters.push('VOI');
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if (!isModelParameterTrackedByAnotherSubscription) {
|
|
328
|
+
modelParameters.push(`${subscription.component}/${subscription.variable}`);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (modelParameters.length) {
|
|
332
|
+
this.$refs.opencorRef?.untrackSimulationData(modelParameters);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// Remove the subscription from our list of active subscriptions.
|
|
337
|
+
|
|
295
338
|
this.activeSubscriptions = this.activeSubscriptions.filter((activeSubscription) => {
|
|
296
339
|
return activeSubscription.windowId !== subscriptionId;
|
|
297
340
|
});
|