Player Tool Bar
Layout
Player Tool BarStatus Text FieldStart ButtonPause ButtonRun-One-Line ButtonRun-One-Step ButtonStop ButtonReset Button
Behavior of Player Tool Bar
See the example code to:
- complete the behavior of the buttons and
Status Text Field. - The rapidly used buttons should has hotkey. At least the following buttons:
- Run One Line Button
- Run One Step Button
- Start/Continue
- Pause
- Both webservice and win-desktop applications use LocalProjectService events for monitoring PacePlayer status changes.
- In webservice applications, the
PlayerStatusServicesubscribes to these LocalProjectService events and broadcasts status changes viaPlayerStatusHubusing SignalR for real-time communication. - Win-desktop applications can directly subscribe to LocalProjectService events for status updates.
- Alter the background color of the
Status Text Fieldif the status changed.- Warning style color
- Running
- Secondary style color
- Paused
- No Project
- Success style color
- Finished
- Ready
- Warning style color
The action of Reset Button should be async for user experience.
Tip
Use icon instead of text to the tool bar button. Run One Line Button and Run One Step Button use the same icon, use the different color to resolve them.
- Run One Line Button > default color with green seasoned
- Run One Step Button > default color with blue seasoned
The other button use the default color is enough.
Source Code Path
See this page for git repository.
WPF Application Source Code Path
- Play/PlayerToolBar
Web Page Application Source Code Path
- wwwroot/player/player-tool-bar.js
- Players/PlayerController.cs
- Players/PlayerStatusHub.cs
- Players/PlayerStatusService.cs
SignalR Implementation (Webapi Only)
PlayerStatusHub provides real-time player status updates, with methods GetPlayerStatus() and event PlayerStatusUpdated. PlayerStatusService monitors PacePlayer events (IsRunningChangedEvent, IsLockedChangedEvent, IsFinishedChangedEvent, ResetedEvent) and broadcasts changes via SignalR. The JavaScript component connects to /playerStatusHub and listens for status updates. API endpoints include /api/player/start, /api/player/pause, /api/player/resume, /api/player/run-line, /api/player/run-step, /api/player/stop, and /api/player/reset.