Q2NSViz 0.1.0
Q2NS trace visualizer
Loading...
Searching...
No Matches
q2nsviz.ui.window.PlaybackController Class Reference

Owns the simulation clock, playback timer, and all time-navigation logic. More...

Public Member Functions

 connect_signals (self)
 Wire all ControlPanel signals to the appropriate playback methods.
 
 setup_for_file (self)
 Reset to time zero and configure the slider for a newly loaded file.
 
 reset (self)
 Stop playback, return to t = 0, and restore the slider to its default range.
 
 start (self)
 Begin timer-driven playback.
 
 pause (self)
 Suspend timer-driven playback.
 
 step_forward (self)
 Advance to the next keyframe and invoke the update callback.
 
 step_backward (self)
 Retreat to the previous keyframe and invoke the update callback.
 
 jump_to_start (self)
 Jump to t = 0 and invoke the update callback.
 
 jump_to_end (self)
 Jump to the last event timestamp and invoke the update callback.
 

Public Attributes

 state_manager
 
 control_panel
 
 start
 
 pause
 
 step_forward
 
 step_backward
 
 current_sim_time_ns
 
 is_playing
 

Detailed Description

Owns the simulation clock, playback timer, and all time-navigation logic.

Decoupled from QuantumVisualizerWindow so that playback concerns are separated from widget construction. The controller reads state_manager.time_array and state_manager.t_max and drives the on_update callback after every time advance.

Call connect_signals() once after construction to wire ControlPanel signals, and setup_for_file() each time a new trace is loaded.

Parameters
state_managerShared SimulationStateManager instance.
control_panelControlPanel providing slider, speed, and loop widgets.
on_updateCallback invoked (with no arguments) after every time step.

Definition at line 77 of file window.py.

Member Function Documentation

◆ connect_signals()

q2nsviz.ui.window.PlaybackController.connect_signals (   self)

Wire all ControlPanel signals to the appropriate playback methods.

Definition at line 104 of file window.py.

References q2nsviz.ui.window.PlaybackController.control_panel, and q2nsviz.ui.window.QuantumVisualizerWindow.control_panel.

◆ jump_to_end()

◆ jump_to_start()

q2nsviz.ui.window.PlaybackController.jump_to_start (   self)

Jump to t = 0 and invoke the update callback.

Definition at line 175 of file window.py.

References q2nsviz.ui.window.PlaybackController._on_update, q2nsviz.ui.window.PlaybackController._sync_slider(), q2nsviz.ui.window.PlaybackController.current_sim_time_ns, q2nsviz.ui.canvas.NetworkCanvas.state_manager, q2nsviz.ui.window.PlaybackController.state_manager, and q2nsviz.ui.window.QuantumVisualizerWindow.state_manager.

Here is the call graph for this function:

◆ pause()

q2nsviz.ui.window.PlaybackController.pause (   self)

Suspend timer-driven playback.

Definition at line 149 of file window.py.

References q2nsviz.ui.window.PlaybackController._timer, q2nsviz.ui.panels.ControlPanel.is_playing, and q2nsviz.ui.window.PlaybackController.is_playing.

Referenced by q2nsviz.ui.window.PlaybackController.jump_to_end().

Here is the caller graph for this function:

◆ reset()

q2nsviz.ui.window.PlaybackController.reset (   self)

Stop playback, return to t = 0, and restore the slider to its default range.

Definition at line 131 of file window.py.

References q2nsviz.ui.window.PlaybackController._timer, q2nsviz.ui.window.PlaybackController.control_panel, q2nsviz.ui.window.QuantumVisualizerWindow.control_panel, q2nsviz.ui.window.PlaybackController.current_sim_time_ns, q2nsviz.ui.panels.ControlPanel.is_playing, and q2nsviz.ui.window.PlaybackController.is_playing.

Referenced by q2nsviz.logic.SimulationStateManager.load_events().

Here is the caller graph for this function:

◆ setup_for_file()

q2nsviz.ui.window.PlaybackController.setup_for_file (   self)

Reset to time zero and configure the slider for a newly loaded file.

Called immediately after SimulationStateManager.load_events(). Does not invoke the update callback; the caller is responsible for triggering a visualization refresh.

Definition at line 114 of file window.py.

◆ start()

q2nsviz.ui.window.PlaybackController.start (   self)

◆ step_backward()

q2nsviz.ui.window.PlaybackController.step_backward (   self)

Retreat to the previous keyframe and invoke the update callback.

Definition at line 165 of file window.py.

References q2nsviz.ui.window.PlaybackController._on_update, q2nsviz.ui.window.PlaybackController._sync_slider(), q2nsviz.ui.window.PlaybackController.current_sim_time_ns, q2nsviz.ui.canvas.NetworkCanvas.state_manager, q2nsviz.ui.window.PlaybackController.state_manager, and q2nsviz.ui.window.QuantumVisualizerWindow.state_manager.

Here is the call graph for this function:

◆ step_forward()

q2nsviz.ui.window.PlaybackController.step_forward (   self)

Advance to the next keyframe and invoke the update callback.

Definition at line 154 of file window.py.

References q2nsviz.ui.window.PlaybackController._on_update, q2nsviz.ui.window.PlaybackController._sync_slider(), q2nsviz.ui.window.PlaybackController.current_sim_time_ns, q2nsviz.ui.canvas.NetworkCanvas.state_manager, q2nsviz.ui.window.PlaybackController.state_manager, and q2nsviz.ui.window.QuantumVisualizerWindow.state_manager.

Here is the call graph for this function:

Member Data Documentation

◆ control_panel

◆ current_sim_time_ns

◆ is_playing

◆ pause

q2nsviz.ui.window.PlaybackController.pause

Definition at line 108 of file window.py.

Referenced by q2nsviz.ui.window.PlaybackController.jump_to_end().

◆ start

q2nsviz.ui.window.PlaybackController.start

Definition at line 107 of file window.py.

Referenced by q2nsviz.ui.window.PlaybackController.start().

◆ state_manager

◆ step_backward

q2nsviz.ui.window.PlaybackController.step_backward

Definition at line 110 of file window.py.

◆ step_forward

q2nsviz.ui.window.PlaybackController.step_forward

Definition at line 109 of file window.py.


The documentation for this class was generated from the following file: