mirror of
https://github.com/nasa/openmct.git
synced 2024-12-24 07:16:39 +00:00
Realtime should not show if there are no clocks
This commit is contained in:
parent
38457fd262
commit
47892b9641
@ -356,7 +356,7 @@ export class MCT extends EventEmitter {
|
||||
|
||||
this.element = domElement;
|
||||
|
||||
if (!this.time.getClock()) {
|
||||
if (this.time.clocks.size !== 0 && !this.time.getClock()) {
|
||||
this.time.setClock(this.defaultClock);
|
||||
}
|
||||
|
||||
|
@ -33,11 +33,11 @@
|
||||
<ConductorModeIcon class="c-conductor__mode-icon" />
|
||||
<div class="c-compact-tc__setting-value u-fade-truncate">
|
||||
<ConductorMode :read-only="true" />
|
||||
<ConductorClock :read-only="true" />
|
||||
<ConductorClock v-if="openmct.time.clocks.size > 0" :read-only="true" />
|
||||
<ConductorTimeSystem :read-only="true" />
|
||||
</div>
|
||||
<ConductorInputsFixed v-if="isFixedTimeMode" :input-bounds="viewBounds" :read-only="true" />
|
||||
<ConductorInputsRealtime v-else :input-bounds="viewBounds" :read-only="true" />
|
||||
<ConductorInputsRealtime v-else-if="openmct.time.clocks.size > 0" :input-bounds="viewBounds" :read-only="true" />
|
||||
<ConductorAxis
|
||||
v-if="isFixedTimeMode"
|
||||
class="c-conductor__ticks"
|
||||
|
@ -12,12 +12,12 @@
|
||||
title="Sets the Time Conductor's mode."
|
||||
/>
|
||||
<IndependentClock
|
||||
v-if="isIndependent"
|
||||
v-if="isIndependent && openmct.time.clocks.size > 0"
|
||||
class="c-conductor__mode-select"
|
||||
title="Sets the Time Conductor's clock."
|
||||
/>
|
||||
<ConductorClock
|
||||
v-else
|
||||
v-else-if="openmct.time.clocks.size > 0"
|
||||
class="c-conductor__mode-select"
|
||||
title="Sets the Time Conductor's clock."
|
||||
/>
|
||||
|
@ -3,7 +3,14 @@ import { FIXED_MODE_KEY, REALTIME_MODE_KEY } from '../../api/time/constants.js';
|
||||
export default {
|
||||
methods: {
|
||||
loadModes() {
|
||||
this.modes = [FIXED_MODE_KEY, REALTIME_MODE_KEY].map(this.getModeMetadata);
|
||||
const modes = [FIXED_MODE_KEY];
|
||||
const clockCount = this.openmct.time.clocks.size;
|
||||
|
||||
if (clockCount > 1) {
|
||||
modes.push(REALTIME_MODE_KEY);
|
||||
}
|
||||
|
||||
this.modes = modes.map(this.getModeMetadata);
|
||||
},
|
||||
getModeMetadata(mode, testIds = false) {
|
||||
let modeOptions;
|
||||
|
@ -65,7 +65,14 @@ export function useTimeMode(openmct, timeContext) {
|
||||
}
|
||||
|
||||
function getAllModeMetadata() {
|
||||
return [FIXED_MODE_KEY, REALTIME_MODE_KEY].map(getModeMetadata);
|
||||
const clockCount = openmct.time.clocks.size;
|
||||
const modes = [FIXED_MODE_KEY];
|
||||
|
||||
if (clockCount > 0) {
|
||||
modes.push(REALTIME_MODE_KEY);
|
||||
}
|
||||
|
||||
return modes.map(getModeMetadata);
|
||||
}
|
||||
|
||||
function getModeMetadata(key) {
|
||||
|
@ -33,7 +33,7 @@ export default function () {
|
||||
return function (openmct) {
|
||||
const timeSystem = new UTCTimeSystem();
|
||||
openmct.time.addTimeSystem(timeSystem);
|
||||
openmct.time.addClock(new LocalClock(100));
|
||||
|
||||
openmct.telemetry.addFormat(new UTCTimeFormat());
|
||||
openmct.telemetry.addFormat(new DurationFormat());
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user