@@ -5,6 +5,7 @@ import { CXXRTLConnection, CXXRTLDebugItem, CXXRTLDebugItemType, CXXRTLNodeDesig
5
5
import { TimePoint } from './model/time' ;
6
6
import { Scope } from './model/scope' ;
7
7
import { Variable } from './model/variable' ;
8
+ import { StatusItemController } from './ui/status' ;
8
9
9
10
export enum CXXRTLSessionStatus {
10
11
Absent = "absent" ,
@@ -13,7 +14,7 @@ export enum CXXRTLSessionStatus {
13
14
}
14
15
15
16
export class CXXRTLDebugger {
16
- private statusItem : vscode . StatusBarItem ;
17
+ private statusItemController : StatusItemController ;
17
18
private terminal : vscode . Terminal | null = null ;
18
19
private connection : CXXRTLConnection | null = null ;
19
20
@@ -44,37 +45,7 @@ export class CXXRTLDebugger {
44
45
readonly onDidChangeLatestTime : vscode . Event < TimePoint > = this . _onDidChangeLatestTime . event ;
45
46
46
47
constructor ( ) {
47
- this . statusItem = vscode . window . createStatusBarItem ( 'rtlDebugger' , vscode . StatusBarAlignment . Left , 10 ) ;
48
- this . statusItem . tooltip = 'RTL Debugger Status' ;
49
- this . statusItem . command = 'rtlDebugger.runPauseSimulation' ;
50
- this . onDidChangeSessionStatus ( ( _state ) => this . updateStatusItem ( ) ) ;
51
- this . onDidChangeCurrentTime ( ( _time ) => this . updateStatusItem ( ) ) ;
52
- this . onDidChangeSimulationStatus ( ( _state ) => this . updateStatusItem ( ) ) ;
53
- this . onDidChangeLatestTime ( ( _time ) => this . updateStatusItem ( ) ) ;
54
- }
55
-
56
- private updateStatusItem ( ) {
57
- if ( this . sessionStatus === CXXRTLSessionStatus . Absent ) {
58
- this . statusItem . hide ( ) ;
59
- } else {
60
- this . statusItem . show ( ) ;
61
- if ( this . sessionStatus === CXXRTLSessionStatus . Starting ) {
62
- this . statusItem . text = `$(gear~spin) Starting...` ;
63
- this . statusItem . tooltip = `RTL Debugger: Starting` ;
64
- } else { // this.sessionState === CXXRTLSessionState.Running
65
- if ( this . simulationStatus === CXXRTLSimulationStatus . Running ) {
66
- this . statusItem . text = '$(debug-pause) ' ;
67
- this . statusItem . tooltip = `RTL Debugger: Running` ;
68
- } else if ( this . simulationStatus === CXXRTLSimulationStatus . Paused ) {
69
- this . statusItem . text = '$(debug-continue) ' ;
70
- this . statusItem . tooltip = `RTL Debugger: Paused` ;
71
- } else if ( this . simulationStatus === CXXRTLSimulationStatus . Finished ) {
72
- this . statusItem . text = '' ;
73
- this . statusItem . tooltip = `RTL Debugger: Finished` ;
74
- }
75
- this . statusItem . text += `${ this . currentTime } / ${ this . latestTime } ` ;
76
- }
77
- }
48
+ this . statusItemController = new StatusItemController ( this ) ;
78
49
}
79
50
80
51
public dispose ( ) {
0 commit comments