Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
647eb18215 | ||
|
|
390068eaf7 |
@@ -94,9 +94,10 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
SinewaveLimitProvider.prototype.getLimits = function (domainObject) {
|
SinewaveLimitProvider.prototype.getLimits = function (domainObject) {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
limits: function () {
|
limits: function () {
|
||||||
return {
|
return Promise.resolve({
|
||||||
WARNING: {
|
WARNING: {
|
||||||
low: {
|
low: {
|
||||||
cssClass: "is-limit--lwr is-limit--yellow",
|
cssClass: "is-limit--lwr is-limit--yellow",
|
||||||
@@ -118,8 +119,30 @@ define([
|
|||||||
cssClass: "is-limit--upr is-limit--red",
|
cssClass: "is-limit--upr is-limit--red",
|
||||||
...RED
|
...RED
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
CRITICAL: {
|
||||||
|
low: {
|
||||||
|
cssClass: "is-limit--lwr is-limit--red",
|
||||||
|
sin: -RED.sin,
|
||||||
|
cos: -RED.cos
|
||||||
|
},
|
||||||
|
high: {
|
||||||
|
cssClass: "is-limit--upr is-limit--red",
|
||||||
|
...RED
|
||||||
|
}
|
||||||
|
},
|
||||||
|
SEVERE: {
|
||||||
|
low: {
|
||||||
|
cssClass: "is-limit--lwr is-limit--red",
|
||||||
|
sin: -RED.sin,
|
||||||
|
cos: -RED.cos
|
||||||
|
},
|
||||||
|
high: {
|
||||||
|
cssClass: "is-limit--upr is-limit--red",
|
||||||
|
...RED
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -581,7 +581,9 @@ define([
|
|||||||
const provider = this.findLimitEvaluator(domainObject);
|
const provider = this.findLimitEvaluator(domainObject);
|
||||||
if (!provider) {
|
if (!provider) {
|
||||||
return {
|
return {
|
||||||
limits: function () {}
|
limits: function () {
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export default class MCTChartAlarmLineSet {
|
|||||||
|
|
||||||
eventHelpers.extend(this);
|
eventHelpers.extend(this);
|
||||||
this.listenTo(series, 'limitBounds', this.updateBounds, this);
|
this.listenTo(series, 'limitBounds', this.updateBounds, this);
|
||||||
|
this.listenTo(series, 'limits', this.getLimitPoints, this);
|
||||||
this.listenTo(series, 'change:xKey', this.getLimitPoints, this);
|
this.listenTo(series, 'change:xKey', this.getLimitPoints, this);
|
||||||
|
|
||||||
if (series.limits) {
|
if (series.limits) {
|
||||||
|
|||||||
@@ -117,7 +117,17 @@ export default class PlotSeries extends Model {
|
|||||||
this.keyString = this.openmct.objects.makeKeyString(this.domainObject.identifier);
|
this.keyString = this.openmct.objects.makeKeyString(this.domainObject.identifier);
|
||||||
this.limitEvaluator = this.openmct.telemetry.limitEvaluator(options.domainObject);
|
this.limitEvaluator = this.openmct.telemetry.limitEvaluator(options.domainObject);
|
||||||
this.limitDefinition = this.openmct.telemetry.limitDefinition(options.domainObject);
|
this.limitDefinition = this.openmct.telemetry.limitDefinition(options.domainObject);
|
||||||
this.limits = this.limitDefinition.limits();
|
this.limits = [];
|
||||||
|
this.limitDefinition.limits().then(response => {
|
||||||
|
this.limits = [];
|
||||||
|
|
||||||
|
if (response) {
|
||||||
|
this.limits = response;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.emit('limits', this);
|
||||||
|
|
||||||
|
});
|
||||||
this.openmct.time.on('bounds', this.updateLimits);
|
this.openmct.time.on('bounds', this.updateLimits);
|
||||||
this.on('destroy', this.onDestroy, this);
|
this.on('destroy', this.onDestroy, this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ describe("the plugin", function () {
|
|||||||
telemetrylimitProvider.supportsLimits.and.returnValue(true);
|
telemetrylimitProvider.supportsLimits.and.returnValue(true);
|
||||||
telemetrylimitProvider.getLimits.and.returnValue({
|
telemetrylimitProvider.getLimits.and.returnValue({
|
||||||
limits: function () {
|
limits: function () {
|
||||||
return {
|
return Promise.resolve({
|
||||||
WARNING: {
|
WARNING: {
|
||||||
low: {
|
low: {
|
||||||
cssClass: "is-limit--lwr is-limit--yellow",
|
cssClass: "is-limit--lwr is-limit--yellow",
|
||||||
@@ -118,7 +118,7 @@ describe("the plugin", function () {
|
|||||||
'some-key': 0.9
|
'some-key': 0.9
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
telemetrylimitProvider.getLimitEvaluator.and.returnValue({
|
telemetrylimitProvider.getLimitEvaluator.and.returnValue({
|
||||||
|
|||||||
Reference in New Issue
Block a user