SILICON
Toggle main menu visibility
Loading...
Searching...
No Matches
graphicalMultiplexer.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
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License
15
along with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#pragma once
19
20
#include <
extraComponents/multiplexer.hpp
>
21
#include <
ui/circuit/components/graphicalLogicComponent.hpp
>
22
23
24
namespace
SILICON::ui
{
25
using namespace
SILICON::core;
26
using namespace
SILICON::extra;
27
28
class
GraphicalMultiplexer
:
public
GraphicalLogicComponent
{
29
Q_OBJECT
30
private
:
31
void
setupCallbacks
();
32
void
updateLayout
(
int
selectionSize,
int
busSize);
33
int
applySelectionSize
(
int
selectionSize);
34
int
applyBusSize
(
int
busSize);
35
36
[[nodiscard]]
Multiplexer
*
getComponentAsMultiplexer
()
const
;
37
38
public
:
39
explicit
GraphicalMultiplexer
(QGraphicsItem* parent =
nullptr
);
40
41
int
type
()
const override
{
return
SiliconTypes::MULTIPLEXER
; }
42
43
void
setComponent
(
const
Component_ptr
& component)
override
;
44
};
45
46
class
GraphicalDemultiplexer
:
public
GraphicalLogicComponent
{
47
Q_OBJECT
48
private
:
49
void
setupCallbacks
();
50
void
updateLayout
(
int
selectionSize,
int
busSize);
51
int
applySelectionSize
(
int
selectionSize);
52
int
applyBusSize
(
int
busSize);
53
54
[[nodiscard]]
Demultiplexer
*
getComponentAsDemultiplexer
()
const
;
55
56
public
:
57
explicit
GraphicalDemultiplexer
(QGraphicsItem* parent =
nullptr
);
58
59
int
type
()
const override
{
return
SiliconTypes::DEMULTIPLEXER
; }
60
61
void
setComponent
(
const
Component_ptr
& component)
override
;
62
};
63
64
class
GraphicalDecoder
:
public
GraphicalLogicComponent
{
65
Q_OBJECT
66
private
:
67
void
setupCallbacks
();
68
int
applySelectionSize
(
int
selectionSize);
69
70
[[nodiscard]]
Decoder
*
getComponentAsDecoder
()
const
;
71
72
public
:
73
explicit
GraphicalDecoder
(QGraphicsItem* parent =
nullptr
);
74
75
int
type
()
const override
{
return
SiliconTypes::DECODER
; }
76
77
void
setComponent
(
const
Component_ptr
& component)
override
;
78
};
79
80
}
// namespace SILICON::ui
SILICON::extra::Decoder
Definition
multiplexer.hpp:102
SILICON::extra::Demultiplexer
Definition
multiplexer.hpp:71
SILICON::extra::Multiplexer
Definition
multiplexer.hpp:30
SILICON::ui::GraphicalDecoder::type
int type() const override
Definition
graphicalMultiplexer.hpp:75
SILICON::ui::GraphicalDecoder::GraphicalDecoder
GraphicalDecoder(QGraphicsItem *parent=nullptr)
Definition
graphicalMultiplexer.cpp:311
SILICON::ui::GraphicalDecoder::setComponent
void setComponent(const Component_ptr &component) override
Sets the associated logical component.
Definition
graphicalMultiplexer.cpp:348
SILICON::ui::GraphicalDecoder::getComponentAsDecoder
Decoder * getComponentAsDecoder() const
Definition
graphicalMultiplexer.cpp:320
SILICON::ui::GraphicalDecoder::setupCallbacks
void setupCallbacks()
Definition
graphicalMultiplexer.cpp:328
SILICON::ui::GraphicalDecoder::applySelectionSize
int applySelectionSize(int selectionSize)
Definition
graphicalMultiplexer.cpp:338
SILICON::ui::GraphicalDemultiplexer::type
int type() const override
Definition
graphicalMultiplexer.hpp:59
SILICON::ui::GraphicalDemultiplexer::GraphicalDemultiplexer
GraphicalDemultiplexer(QGraphicsItem *parent=nullptr)
Definition
graphicalMultiplexer.cpp:231
SILICON::ui::GraphicalDemultiplexer::setComponent
void setComponent(const Component_ptr &component) override
Sets the associated logical component.
Definition
graphicalMultiplexer.cpp:297
SILICON::ui::GraphicalDemultiplexer::getComponentAsDemultiplexer
Demultiplexer * getComponentAsDemultiplexer() const
Definition
graphicalMultiplexer.cpp:241
SILICON::ui::GraphicalDemultiplexer::updateLayout
void updateLayout(int selectionSize, int busSize)
Definition
graphicalMultiplexer.cpp:263
SILICON::ui::GraphicalDemultiplexer::applyBusSize
int applyBusSize(int busSize)
Definition
graphicalMultiplexer.cpp:289
SILICON::ui::GraphicalDemultiplexer::setupCallbacks
void setupCallbacks()
Definition
graphicalMultiplexer.cpp:249
SILICON::ui::GraphicalDemultiplexer::applySelectionSize
int applySelectionSize(int selectionSize)
Definition
graphicalMultiplexer.cpp:281
SILICON::ui::GraphicalLogicComponent::GraphicalLogicComponent
GraphicalLogicComponent(ItemCategory category, const Component_ptr &component, QGraphicsItem *shape, QGraphicsItem *parent, bool scanShape=false)
Definition
graphicalLogicComponent.cpp:26
SILICON::ui::GraphicalMultiplexer::GraphicalMultiplexer
GraphicalMultiplexer(QGraphicsItem *parent=nullptr)
Definition
graphicalMultiplexer.cpp:117
SILICON::ui::GraphicalMultiplexer::type
int type() const override
Definition
graphicalMultiplexer.hpp:41
SILICON::ui::GraphicalMultiplexer::getComponentAsMultiplexer
Multiplexer * getComponentAsMultiplexer() const
Definition
graphicalMultiplexer.cpp:126
SILICON::ui::GraphicalMultiplexer::setComponent
void setComponent(const Component_ptr &component) override
Sets the associated logical component.
Definition
graphicalMultiplexer.cpp:216
SILICON::ui::GraphicalMultiplexer::updateLayout
void updateLayout(int selectionSize, int busSize)
Definition
graphicalMultiplexer.cpp:157
SILICON::ui::GraphicalMultiplexer::applyBusSize
int applyBusSize(int busSize)
Definition
graphicalMultiplexer.cpp:208
SILICON::ui::GraphicalMultiplexer::setupCallbacks
void setupCallbacks()
Definition
graphicalMultiplexer.cpp:134
SILICON::ui::GraphicalMultiplexer::applySelectionSize
int applySelectionSize(int selectionSize)
Definition
graphicalMultiplexer.cpp:200
graphicalLogicComponent.hpp
multiplexer.hpp
SILICON::core::Component_ptr
std::shared_ptr< Component > Component_ptr
Definition
component_registry.hpp:33
SILICON::ui
Definition
actionGroups.hpp:14
SILICON::ui::DECODER
@ DECODER
Definition
enums.hpp:107
SILICON::ui::DEMULTIPLEXER
@ DEMULTIPLEXER
Definition
enums.hpp:106
SILICON::ui::MULTIPLEXER
@ MULTIPLEXER
Definition
enums.hpp:105
src
ui
circuit
components
graphicalMultiplexer.hpp
Generated by
1.17.0