SILICON
Loading...
Searching...
No Matches
waveformController.hpp
Go to the documentation of this file.
1/*
2 Copyright (c) 2026. Giulio Cocconi
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8 */
9
10#pragma once
11
12#include <memory>
13
14#include <QObject>
15#include <QString>
16
18
19#include <ui/actionGroups.hpp>
20#include <ui/lifetime.hpp>
21
22class QAction;
23class QDialog;
24class QWidget;
25
26namespace SILICON::ui {
27
28class DiagramScene;
30struct ProjectSession;
31namespace waveform {
32 class Viewer;
33}
34
36class WaveformController : public QObject {
37public:
39 ProjectDocumentController& documents, QWidget* window);
41
43 void bindActions(const WaveformActions& actions);
44
45 void toggle(bool enabled);
46
47private:
49 void handleActiveDocumentChanged(const QString& path,
52 void closeViewer();
53 void setTraceActionChecked(bool checked);
54
56 QAction* toggleAction = nullptr;
59 bool activeIsDiagram = false;
60 std::unique_ptr<QDialog> window;
62};
63
64} // namespace SILICON::ui
Graphics scene for the circuit diagram editor.
void bindActions(const WaveformActions &actions)
Connects the main-window waveform actions to their viewer commands.
void handleActiveDocumentChanged(const QString &path, SILICON::project::DocumentCategory category)
Keeps the viewer bound to the diagram that is now active.
void closeViewer()
Hides the viewer and leaves the scene in a non-simulating state.
std::unique_ptr< QDialog > window
WaveformController(ProjectSession &session, DiagramScene &scene, ProjectDocumentController &documents, QWidget *window)