mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 20:03:52 +00:00
Relative run mode (#1512)
* inti relative mode * send imediat update on mode change * add relative to test * don't persist offset mode * add test relative and update calc function * pass data from ssocket * add dev guard * spelling and comments * show relative in offset overview * remove comments * refactor: move totalDelay to _rundown * update clear naming and comments * remove old testing values
This commit is contained in:
committed by
GitHub
parent
a94b10cb0f
commit
dce87c3a81
@@ -1,11 +1,18 @@
|
||||
import type { MaybeNumber } from '../../utils/utils.type.js';
|
||||
|
||||
export enum OffsetMode {
|
||||
Absolute = 'absolute',
|
||||
Relative = 'relative',
|
||||
}
|
||||
|
||||
export type Runtime = {
|
||||
numEvents: number;
|
||||
selectedEventIndex: MaybeNumber;
|
||||
offset: number;
|
||||
relativeOffset: number;
|
||||
plannedStart: MaybeNumber;
|
||||
actualStart: MaybeNumber;
|
||||
plannedEnd: MaybeNumber;
|
||||
expectedEnd: MaybeNumber;
|
||||
offsetMode: OffsetMode;
|
||||
};
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { SimpleDirection, SimplePlayback } from './AuxTimer.type.js';
|
||||
import { Playback } from './Playback.type.js';
|
||||
import { OffsetMode } from './Runtime.type.js';
|
||||
import type { RuntimeStore } from './RuntimeStore.type.js';
|
||||
import { TimerPhase } from './TimerState.type.js';
|
||||
|
||||
export const runtimeStorePlaceholder: RuntimeStore = {
|
||||
export const runtimeStorePlaceholder: Readonly<RuntimeStore> = {
|
||||
clock: 0,
|
||||
timer: {
|
||||
addedTime: 0,
|
||||
@@ -32,10 +33,12 @@ export const runtimeStorePlaceholder: RuntimeStore = {
|
||||
selectedEventIndex: null, // changes if rundown changes or we load a new event
|
||||
numEvents: 0, // change initiated by user
|
||||
offset: 0, // changes at runtime
|
||||
relativeOffset: 0, // changes at runtime
|
||||
plannedStart: 0, // only changes if event changes
|
||||
plannedEnd: 0, // only changes if event changes, overflows over dayInMs
|
||||
actualStart: null, // set once we start the timer
|
||||
expectedEnd: null, // changes with runtime, based on offset, overflows over dayInMs
|
||||
offsetMode: OffsetMode.Absolute,
|
||||
},
|
||||
currentBlock: {
|
||||
block: null,
|
||||
|
||||
@@ -87,6 +87,7 @@ export { TimerLifeCycle, timerLifecycleValues } from './definitions/core/TimerLi
|
||||
export type { TimerMessage, MessageState, SecondarySource } from './definitions/runtime/MessageControl.type.js';
|
||||
|
||||
export type { Runtime } from './definitions/runtime/Runtime.type.js';
|
||||
export { OffsetMode } from './definitions/runtime/Runtime.type.js';
|
||||
export type { RuntimeStore } from './definitions/runtime/RuntimeStore.type.js';
|
||||
export { runtimeStorePlaceholder } from './definitions/runtime/RuntimeStore.js';
|
||||
export { type TimerState, TimerPhase } from './definitions/runtime/TimerState.type.js';
|
||||
|
||||
Reference in New Issue
Block a user