Skip to content

Commit

Permalink
fix: move the types DeviceStatus, StatusCode to timeline-state-resolv…
Browse files Browse the repository at this point in the history
…er-types

This is both because I think they serve a better purpose there, but also so that they are exported by timeline-state-resolver (they where not before)
  • Loading branch information
nytamin committed Apr 12, 2022
1 parent 6df36ef commit 4d84179
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 14 deletions.
14 changes: 14 additions & 0 deletions packages/timeline-state-resolver-types/src/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ import {
} from '.'
import { ShotokuOptions } from './shotoku'

export enum StatusCode {
UNKNOWN = 0, // Status unknown
GOOD = 1, // All good and green
WARNING_MINOR = 2, // Everything is not OK, operation is not affected
WARNING_MAJOR = 3, // Everything is not OK, operation might be affected
BAD = 4, // Operation affected, possible to recover
FATAL = 5, // Operation affected, not possible to recover without manual interference
}
export interface DeviceStatus {
statusCode: StatusCode
messages?: Array<string>
active: boolean
}

export interface DeviceOptionsBase<T> extends SlowReportOptions {
type: DeviceType
isMultiThreaded?: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Array [
"ShotokuTransitionType",
"SlotId",
"SlotStatus",
"StatusCode",
"Timeline",
"TimelineContentTypeAtem",
"TimelineContentTypeCasparCg",
Expand Down
24 changes: 10 additions & 14 deletions packages/timeline-state-resolver/src/devices/device.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import * as _ from 'underscore'
import { TimelineState } from 'superfly-timeline'
import { Mappings, DeviceType, MediaObject, DeviceOptionsBase } from 'timeline-state-resolver-types'
import {
Mappings,
DeviceType,
MediaObject,
DeviceOptionsBase,
DeviceStatus,
StatusCode,
} from 'timeline-state-resolver-types'
import { EventEmitter } from 'eventemitter3'
import { CommandReport, DoOnTime, SlowFulfilledCommandInfo, SlowSentCommandInfo } from '../doOnTime'
import { ExpectedPlayoutItem } from '../expectedPlayoutItems'
Expand All @@ -26,24 +33,13 @@ export interface CommandWithContext {
timelineObjId: string
command: any
}
export enum StatusCode {
UNKNOWN = 0, // Status unknown
GOOD = 1, // All good and green
WARNING_MINOR = 2, // Everything is not OK, operation is not affected
WARNING_MAJOR = 3, // Everything is not OK, operation might be affected
BAD = 4, // Operation affected, possible to recover
FATAL = 5, // Operation affected, not possible to recover without manual interference
}
export interface DeviceStatus {
statusCode: StatusCode
messages?: Array<string>
active: boolean
}

export function literal<T>(o: T) {
return o
}

export { DeviceStatus, StatusCode }

export type DeviceEvents = {
info: [info: string]
warning: [warning: string]
Expand Down

0 comments on commit 4d84179

Please sign in to comment.