46using namespace SILICON::core;
47using namespace SILICON::simulation;
48using namespace SILICON::waveform;
49using namespace SILICON::waveform::fst;
121 std::vector<Sample> inputSnapshots);
131 std::vector<CircuitWriter::NamedBus>
buses;
187 const std::optional<std::string>& traceFile);
193 std::unique_ptr<SILICON::simulation::Session>
simulator;
198#ifndef __EMSCRIPTEN__
RunResult
Outcome of a cancellable simulator operation.
void resetTrace(const TraceConfiguration &trace)
Rebuilds the waveform viewer's signal-name configuration.
void setupJobUI()
Configures progress dialog, timers, and locks the views before a job.
std::optional< std::string > fstTraceFile
Optional output file used for live FST tracing.
void cancelAndWait()
Requests cancellation and waits for the active job before teardown.
void setFstTraceFile(std::optional< std::string > fileName)
Enables or disables FST tracing for the active simulation session.
std::atomic_bool jobFinished
void clearWaveformTrace()
Clears waveform state after the scene has been fully emptied.
DiagramSceneSimulationController(DiagramScene &scene)
Constructs a simulation controller bound to a scene.
void refreshGraphicalOutputs()
Refreshes the visual state of all graphical outputs from bus values.
DiagramScene & scene
Host scene that owns the graphical items and Qt signals.
void exitSimulationMode()
Leaves interactive simulation mode and clears runtime state.
Simulator::RunResult jobResult
Result produced by the latest simulation operation.
QTimer * completionTimer
GUI timer that detects job completion without blocking the event loop.
void handleInputToggled(Bus targetBus, const BusValue &value, Component_weakPtr source)
Applies a user input toggle to the running simulator.
void setJobFinished(bool finished)
Publishes whether the active job has completed.
std::unique_ptr< SILICON::simulation::Session > simulator
Runtime simulation session active only during simulation mode.
void finishJob()
Finalizes a completed job on the GUI thread.
std::exception_ptr jobException
Exception captured during a job and reported on the GUI thread.
void refreshTraceConfiguration()
Refreshes waveform, simulator, and FST tracing from one scene snapshot.
bool isFstTracingEnabled() const
Returns whether FST tracing is currently enabled.
bool isJobCancellationRequested() const
Returns whether cancellation has been requested for the active job.
bool enterSimulationMode()
Enters interactive simulation mode for the scene.
void configureSimulatorTrace(const TraceConfiguration &trace, const std::optional< std::string > &traceFile)
Applies trace buses, snapshot collection, and optional FST output.
std::jthread worker
Native worker synchronization.
void startJob(std::function< Simulator::RunResult()> job)
Starts one cancellable simulation operation and its progress UI.
QTimer * dialogTimer
GUI timer that prevents the progress dialog flashing for short jobs.
std::atomic_bool jobCancellationRequested
Platform-agnostic thread-safe job state.
void resetJobCancellation()
Clears cancellation state before starting a job.
TraceConfiguration collectTraceConfiguration() const
Collects ordered trace buses and their input count.
QList< QPair< qulonglong, std::vector< BusValue > > > pendingWaveformSnapshots
Worker-produced snapshots delivered to the viewer as one GUI batch.
void simulateEditedWaveform(qulonglong duration, std::vector< Sample > inputSnapshots)
Runs the circuit from an edited input waveform and publishes output trace.
bool isJobFinished() const
Returns whether the active job has completed.
void requestJobCancellation()
Publishes a cancellation request for the active job.
QProgressDialog * progressDialog
Delayed cancellation dialog for long-running jobs.
~DiagramSceneSimulationController()
Destroys the controller and releases any simulator resources.
Graphics scene for the circuit diagram editor.
std::weak_ptr< Component > Component_weakPtr
std::vector< State > BusValue
Ordered buses and group metadata used by waveform tracing.
std::vector< CircuitWriter::NamedBus > buses