SILICON
Toggle main menu visibility
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
17
#include <
core/projectDocument.hpp
>
18
19
#include <
ui/actionGroups.hpp
>
20
#include <
ui/lifetime.hpp
>
21
22
class
QAction;
23
class
QDialog;
24
class
QWidget;
25
26
namespace
SILICON::ui
{
27
28
class
DiagramScene
;
29
class
ProjectDocumentController
;
30
struct
ProjectSession
;
31
namespace
waveform
{
32
class
Viewer
;
33
}
34
36
class
WaveformController
:
public
QObject {
37
public
:
38
WaveformController
(
ProjectSession
& session,
DiagramScene
&
scene
,
39
ProjectDocumentController
& documents, QWidget*
window
);
40
~WaveformController
()
override
;
41
43
void
bindActions
(
const
WaveformActions
& actions);
44
45
void
toggle
(
bool
enabled);
46
47
private
:
49
void
handleActiveDocumentChanged
(
const
QString& path,
50
SILICON::project::DocumentCategory
category);
52
void
closeViewer
();
53
void
setTraceActionChecked
(
bool
checked);
54
55
DiagramScene
&
scene
;
56
QAction*
toggleAction
=
nullptr
;
57
waveform::Viewer
*
viewer
=
nullptr
;
58
QString
activeDocumentPath
;
59
bool
activeIsDiagram
=
false
;
60
std::unique_ptr<QDialog>
window
;
61
CallbackScope
callbacks
;
62
};
63
64
}
// namespace SILICON::ui
actionGroups.hpp
SILICON::ui::CallbackScope
Definition
lifetime.hpp:34
SILICON::ui::DiagramScene
Graphics scene for the circuit diagram editor.
Definition
diagramScene.hpp:118
SILICON::ui::ProjectDocumentController
Definition
projectDocumentController.hpp:35
SILICON::ui::WaveformController::setTraceActionChecked
void setTraceActionChecked(bool checked)
Definition
waveformController.cpp:118
SILICON::ui::WaveformController::viewer
waveform::Viewer * viewer
Definition
waveformController.hpp:57
SILICON::ui::WaveformController::bindActions
void bindActions(const WaveformActions &actions)
Connects the main-window waveform actions to their viewer commands.
Definition
waveformController.cpp:74
SILICON::ui::WaveformController::handleActiveDocumentChanged
void handleActiveDocumentChanged(const QString &path, SILICON::project::DocumentCategory category)
Keeps the viewer bound to the diagram that is now active.
Definition
waveformController.cpp:99
SILICON::ui::WaveformController::closeViewer
void closeViewer()
Hides the viewer and leaves the scene in a non-simulating state.
Definition
waveformController.cpp:126
SILICON::ui::WaveformController::scene
DiagramScene & scene
Definition
waveformController.hpp:55
SILICON::ui::WaveformController::activeDocumentPath
QString activeDocumentPath
Definition
waveformController.hpp:58
SILICON::ui::WaveformController::callbacks
CallbackScope callbacks
Definition
waveformController.hpp:61
SILICON::ui::WaveformController::window
std::unique_ptr< QDialog > window
Definition
waveformController.hpp:60
SILICON::ui::WaveformController::toggleAction
QAction * toggleAction
Definition
waveformController.hpp:56
SILICON::ui::WaveformController::~WaveformController
~WaveformController() override
SILICON::ui::WaveformController::toggle
void toggle(bool enabled)
Definition
waveformController.cpp:83
SILICON::ui::WaveformController::WaveformController
WaveformController(ProjectSession &session, DiagramScene &scene, ProjectDocumentController &documents, QWidget *window)
Definition
waveformController.cpp:36
SILICON::ui::WaveformController::activeIsDiagram
bool activeIsDiagram
Definition
waveformController.hpp:59
SILICON::ui::waveform::Viewer
Definition
waveformViewer.hpp:225
lifetime.hpp
SILICON::project::DocumentCategory
DocumentCategory
Definition
projectDocument.hpp:39
SILICON::ui::waveform
Definition
waveformController.hpp:31
SILICON::ui
Definition
actionGroups.hpp:14
projectDocument.hpp
SILICON::ui::ProjectSession
Definition
projectSession.hpp:26
SILICON::ui::WaveformActions
Definition
actionGroups.hpp:69
src
ui
waveform
waveformController.hpp
Generated by
1.17.0