mirror of
https://github.com/nasa/openmct.git
synced 2025-06-04 08:30:48 +00:00
Merge branch 'master' into testing-guidelines
This commit is contained in:
commit
8962b0c88b
@ -169,12 +169,10 @@ export default {
|
|||||||
|
|
||||||
const bounds = this.openmct.time.bounds();
|
const bounds = this.openmct.time.bounds();
|
||||||
const isTimeBoundChanged = this.embed.bounds.start !== bounds.start
|
const isTimeBoundChanged = this.embed.bounds.start !== bounds.start
|
||||||
&& this.embed.bounds.end !== bounds.end;
|
|| this.embed.bounds.end !== bounds.end;
|
||||||
const isFixedTimespanMode = !this.openmct.time.clock();
|
const isFixedTimespanMode = !this.openmct.time.clock();
|
||||||
|
|
||||||
this.openmct.time.stopClock();
|
this.openmct.time.stopClock();
|
||||||
window.location.href = link;
|
|
||||||
|
|
||||||
let message = '';
|
let message = '';
|
||||||
if (isTimeBoundChanged) {
|
if (isTimeBoundChanged) {
|
||||||
this.openmct.time.bounds({
|
this.openmct.time.bounds({
|
||||||
@ -188,7 +186,11 @@ export default {
|
|||||||
message = 'Time bound values changed to fixed timespan mode';
|
message = 'Time bound values changed to fixed timespan mode';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.openmct.notifications.alert(message);
|
if (message.length) {
|
||||||
|
this.openmct.notifications.alert(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.location.href = link;
|
||||||
},
|
},
|
||||||
formatTime(unixTime, timeFormat) {
|
formatTime(unixTime, timeFormat) {
|
||||||
return Moment.utc(unixTime).format(timeFormat);
|
return Moment.utc(unixTime).format(timeFormat);
|
||||||
|
@ -324,7 +324,15 @@ define([
|
|||||||
* a point to the end without dupe checking.
|
* a point to the end without dupe checking.
|
||||||
*/
|
*/
|
||||||
add: function (point, appendOnly) {
|
add: function (point, appendOnly) {
|
||||||
var insertIndex = this.data.length;
|
var insertIndex = this.data.length,
|
||||||
|
currentYVal = this.getYVal(point),
|
||||||
|
lastYVal = this.getYVal(this.data[insertIndex - 1]);
|
||||||
|
|
||||||
|
if (this.isValueInvalid(currentYVal) && this.isValueInvalid(lastYVal)) {
|
||||||
|
console.warn('[Plot] Invalid Y Values detected');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!appendOnly) {
|
if (!appendOnly) {
|
||||||
insertIndex = this.sortedIndex(point);
|
insertIndex = this.sortedIndex(point);
|
||||||
if (this.getXVal(this.data[insertIndex]) === this.getXVal(point)) {
|
if (this.getXVal(this.data[insertIndex]) === this.getXVal(point)) {
|
||||||
@ -334,11 +342,21 @@ define([
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateStats(point);
|
this.updateStats(point);
|
||||||
point.mctLimitState = this.evaluate(point);
|
point.mctLimitState = this.evaluate(point);
|
||||||
this.data.splice(insertIndex, 0, point);
|
this.data.splice(insertIndex, 0, point);
|
||||||
this.emit('add', point, insertIndex, this);
|
this.emit('add', point, insertIndex, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
isValueInvalid: function (val) {
|
||||||
|
return Number.isNaN(val) || val === undefined;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a point from the data array and notify listeners.
|
* Remove a point from the data array and notify listeners.
|
||||||
* @private
|
* @private
|
||||||
|
@ -182,21 +182,6 @@ define([
|
|||||||
this.set('format', yFormat.format.bind(yFormat));
|
this.set('format', yFormat.format.bind(yFormat));
|
||||||
this.set('values', yMetadata.values);
|
this.set('values', yMetadata.values);
|
||||||
if (!label) {
|
if (!label) {
|
||||||
var labelUnits = series.map(function (s) {
|
|
||||||
return s.metadata.value(s.get('yKey')).units;
|
|
||||||
}).reduce(function (a, b) {
|
|
||||||
if (a === undefined) {
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
if (a === b) {
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
}, undefined);
|
|
||||||
if (labelUnits) {
|
|
||||||
this.set('label', labelUnits);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var labelName = series.map(function (s) {
|
var labelName = series.map(function (s) {
|
||||||
return s.metadata.value(s.get('yKey')).name;
|
return s.metadata.value(s.get('yKey')).name;
|
||||||
}).reduce(function (a, b) {
|
}).reduce(function (a, b) {
|
||||||
@ -208,7 +193,28 @@ define([
|
|||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}, undefined);
|
}, undefined);
|
||||||
this.set('label', labelName);
|
|
||||||
|
if (labelName) {
|
||||||
|
this.set('label', labelName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var labelUnits = series.map(function (s) {
|
||||||
|
return s.metadata.value(s.get('yKey')).units;
|
||||||
|
}).reduce(function (a, b) {
|
||||||
|
if (a === undefined) {
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
if (a === b) {
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}, undefined);
|
||||||
|
|
||||||
|
if (labelUnits) {
|
||||||
|
this.set('label', labelUnits);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
defaults: function (options) {
|
defaults: function (options) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user