Skip to content

Commit ef6beb5

Browse files
committed
init data
1 parent d71ceed commit ef6beb5

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

src/preload/data.d.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,47 @@ export type TraceItem = {
175175
filterId?: string[]
176176
}
177177

178+
/**
179+
* Supported replay file formats
180+
*/
181+
export type ReplayFileFormat = 'blf' | 'asc' | 'csv' | 'trc' | 'log' | 'mf4'
182+
183+
/**
184+
* Replay mode - online with hardware or offline simulation
185+
*/
186+
export type ReplayMode = 'online' | 'offline'
187+
188+
/**
189+
* Replay item configuration for replaying BLF, ASC, and other log files
190+
*/
191+
export type ReplayItem = {
192+
id: string
193+
name: string
194+
disabled?: boolean
195+
/** File path to the replay file */
196+
filePath: string
197+
/** File format (auto-detected if not specified) */
198+
format?: ReplayFileFormat
199+
/** Target channels to replay to */
200+
channel: string[]
201+
/**
202+
* Replay mode
203+
* - 'online': Replay to actual hardware devices (real-time transmission)
204+
* - 'offline': Simulation mode for analysis without hardware
205+
*/
206+
mode: ReplayMode
207+
/**
208+
* Speed factor for replay
209+
* 1.0 = original speed, 2.0 = 2x speed, 0.5 = half speed, 0 = as fast as possible
210+
*/
211+
speedFactor?: number
212+
/**
213+
* Number of times to repeat the replay
214+
* undefined/1 = play once, 0 = infinite loop
215+
*/
216+
repeatCount?: number
217+
}
218+
178219
export interface DataSet {
179220
devices: Record<string, UdsDevice>
180221
tester: Record<string, TesterInfo>
@@ -196,5 +237,6 @@ export interface DataSet {
196237
panels: Record<string, PanelItem>
197238
logs: Record<string, LogItem>
198239
traces: Record<string, TraceItem>
240+
replays: Record<string, ReplayItem>
199241
pluginData: Record<string, any>
200242
}

src/renderer/src/stores/data.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export const useDataStore = defineStore('useDataStore', {
2929
panels: {},
3030
logs: {},
3131
traces: {},
32-
pluginData: {}
32+
pluginData: {},
33+
replays: {}
3334
}),
3435
actions: {
3536
globalRun(type: 'start' | 'stop') {
@@ -176,7 +177,8 @@ export const useDataStore = defineStore('useDataStore', {
176177
panels: this.panels,
177178
logs: this.logs,
178179
traces: this.traces,
179-
pluginData: this.pluginData
180+
pluginData: this.pluginData,
181+
replays: this.replays
180182
}
181183
}
182184
}

0 commit comments

Comments
 (0)