mirror of
https://github.com/nasa/openmct.git
synced 2025-07-03 21:38:13 +00:00
Compare commits
12 Commits
remove-dep
...
fix-remote
Author | SHA1 | Date | |
---|---|---|---|
9f7a88090c | |||
9fcebf8b11 | |||
d68d7bdd8e | |||
88cbd8e40c | |||
d4bce52fb0 | |||
93214c235a | |||
907da30516 | |||
eb9e0d8d4d | |||
eb3129bdb0 | |||
d9877759d3 | |||
ac21c1b70c | |||
0ea776f688 |
@ -46,6 +46,7 @@ export default class RemoteClock extends DefaultClock {
|
|||||||
|
|
||||||
this.timeTelemetryObject = undefined;
|
this.timeTelemetryObject = undefined;
|
||||||
this.parseTime = undefined;
|
this.parseTime = undefined;
|
||||||
|
this.formatTime = undefined;
|
||||||
this.metadata = undefined;
|
this.metadata = undefined;
|
||||||
|
|
||||||
this.lastTick = 0;
|
this.lastTick = 0;
|
||||||
@ -137,6 +138,10 @@ export default class RemoteClock extends DefaultClock {
|
|||||||
this.parseTime = (datum) => {
|
this.parseTime = (datum) => {
|
||||||
return timeFormatter.parse(datum);
|
return timeFormatter.parse(datum);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.formatTime = (datum) => {
|
||||||
|
return timeFormatter.format(datum);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,9 +38,8 @@
|
|||||||
import {getValidatedData} from "../plan/util";
|
import {getValidatedData} from "../plan/util";
|
||||||
import ListView from '../../ui/components/List/ListView.vue';
|
import ListView from '../../ui/components/List/ListView.vue';
|
||||||
import {getPreciseDuration} from "../../utils/duration";
|
import {getPreciseDuration} from "../../utils/duration";
|
||||||
import ticker from 'utils/clock/Ticker';
|
|
||||||
import {SORT_ORDER_OPTIONS} from "./constants";
|
import {SORT_ORDER_OPTIONS} from "./constants";
|
||||||
|
import _ from 'lodash';
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { v4 as uuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
@ -53,16 +52,26 @@ const headerItems = [
|
|||||||
isSortable: true,
|
isSortable: true,
|
||||||
property: 'start',
|
property: 'start',
|
||||||
name: 'Start Time',
|
name: 'Start Time',
|
||||||
format: function (value, object) {
|
format: function (value, object, key, openmct) {
|
||||||
return `${moment(value).format(TIME_FORMAT)}Z`;
|
const clock = openmct.time.clock();
|
||||||
|
if (clock && clock.formatTime) {
|
||||||
|
return clock.formatTime(value);
|
||||||
|
} else {
|
||||||
|
return `${moment(value).format(TIME_FORMAT)}Z`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
defaultDirection: true,
|
defaultDirection: true,
|
||||||
isSortable: true,
|
isSortable: true,
|
||||||
property: 'end',
|
property: 'end',
|
||||||
name: 'End Time',
|
name: 'End Time',
|
||||||
format: function (value, object) {
|
format: function (value, object, key, openmct) {
|
||||||
return `${moment(value).format(TIME_FORMAT)}Z`;
|
const clock = openmct.time.clock();
|
||||||
|
if (clock && clock.formatTime) {
|
||||||
|
return clock.formatTime(value);
|
||||||
|
} else {
|
||||||
|
return `${moment(value).format(TIME_FORMAT)}Z`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
defaultDirection: false,
|
defaultDirection: false,
|
||||||
@ -119,7 +128,7 @@ export default {
|
|||||||
this.unlistenConfig = this.openmct.objects.observe(this.domainObject, 'configuration', this.setViewFromConfig);
|
this.unlistenConfig = this.openmct.objects.observe(this.domainObject, 'configuration', this.setViewFromConfig);
|
||||||
this.removeStatusListener = this.openmct.status.observe(this.domainObject.identifier, this.setStatus);
|
this.removeStatusListener = this.openmct.status.observe(this.domainObject.identifier, this.setStatus);
|
||||||
this.status = this.openmct.status.get(this.domainObject.identifier);
|
this.status = this.openmct.status.get(this.domainObject.identifier);
|
||||||
this.unlistenTicker = ticker.listen(this.clearPreviousActivities);
|
|
||||||
this.openmct.time.on('bounds', this.updateTimestamp);
|
this.openmct.time.on('bounds', this.updateTimestamp);
|
||||||
this.openmct.editor.on('isEditing', this.setEditState);
|
this.openmct.editor.on('isEditing', this.setEditState);
|
||||||
|
|
||||||
@ -144,10 +153,6 @@ export default {
|
|||||||
this.unlistenConfig();
|
this.unlistenConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.unlistenTicker) {
|
|
||||||
this.unlistenTicker();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.removeStatusListener) {
|
if (this.removeStatusListener) {
|
||||||
this.removeStatusListener();
|
this.removeStatusListener();
|
||||||
}
|
}
|
||||||
@ -192,8 +197,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateTimestamp(_bounds, isTick) {
|
updateTimestamp(_bounds, isTick) {
|
||||||
if (isTick === true) {
|
if (isTick === true && this.openmct.time.clock() !== undefined) {
|
||||||
this.timestamp = this.openmct.time.clock().currentValue();
|
this.updateTimeStampAndListActivities(this.openmct.time.clock().currentValue());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setViewFromClock(newClock) {
|
setViewFromClock(newClock) {
|
||||||
@ -202,12 +207,11 @@ export default {
|
|||||||
if (isFixedTime) {
|
if (isFixedTime) {
|
||||||
this.hideAll = false;
|
this.hideAll = false;
|
||||||
this.showAll = true;
|
this.showAll = true;
|
||||||
// clear invokes listActivities
|
this.updateTimeStampAndListActivities(this.openmct.time.bounds()?.start);
|
||||||
this.clearPreviousActivities(this.openmct.time.bounds()?.start);
|
|
||||||
} else {
|
} else {
|
||||||
this.setSort();
|
this.setSort();
|
||||||
this.setViewBounds();
|
this.setViewBounds();
|
||||||
this.listActivities();
|
this.updateTimeStampAndListActivities(this.openmct.time.clock().currentValue());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addItem(domainObject) {
|
addItem(domainObject) {
|
||||||
@ -346,12 +350,8 @@ export default {
|
|||||||
// sort by start time
|
// sort by start time
|
||||||
this.planActivities = activities.sort(this.sortByStartTime);
|
this.planActivities = activities.sort(this.sortByStartTime);
|
||||||
},
|
},
|
||||||
clearPreviousActivities(time) {
|
updateTimeStampAndListActivities(time) {
|
||||||
if (time instanceof Date) {
|
this.timestamp = time;
|
||||||
this.timestamp = time.getTime();
|
|
||||||
} else {
|
|
||||||
this.timestamp = time;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.listActivities();
|
this.listActivities();
|
||||||
},
|
},
|
||||||
|
@ -37,7 +37,7 @@ export default {
|
|||||||
// eslint-disable-next-line you-dont-need-lodash-underscore/get
|
// eslint-disable-next-line you-dont-need-lodash-underscore/get
|
||||||
let value = _.get(this.item, property.key);
|
let value = _.get(this.item, property.key);
|
||||||
if (property.format) {
|
if (property.format) {
|
||||||
value = property.format(value, this.item, property.key);
|
value = property.format(value, this.item, property.key, this.openmct);
|
||||||
}
|
}
|
||||||
|
|
||||||
values.push({
|
values.push({
|
||||||
|
Reference in New Issue
Block a user