SILICON
Toggle main menu visibility
Loading...
Searching...
No Matches
graphicalRegister.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 <
core/register.hpp
>
21
#include <
ui/circuit/components/graphicalLogicComponent.hpp
>
22
23
24
namespace
SILICON::ui
{
25
using namespace
SILICON::core;
26
27
class
GraphicalRegister
:
public
GraphicalLogicComponent
{
28
Q_OBJECT
29
private
:
30
void
setupCallbacks
();
31
void
updateLayout
();
32
void
updateLayout
(
const
std::string& inputType,
const
std::string& outputType);
33
int
applySize
(
int
size);
34
std::string
applyInputType
(
const
std::string& inputType);
35
std::string
applyOutputType
(
const
std::string& outputType);
36
37
[[nodiscard]]
Register
*
getComponentAsRegister
()
const
;
38
39
public
:
40
explicit
GraphicalRegister
(QGraphicsItem* parent =
nullptr
);
41
42
int
type
()
const override
{
return
SiliconTypes::REGISTER
; }
43
44
void
setComponent
(
const
Component_ptr
& component)
override
;
45
};
46
47
}
// namespace SILICON::ui
SILICON::core::Register
Definition
register.hpp:29
SILICON::ui::GraphicalLogicComponent::GraphicalLogicComponent
GraphicalLogicComponent(ItemCategory category, const Component_ptr &component, QGraphicsItem *shape, QGraphicsItem *parent, bool scanShape=false)
Definition
graphicalLogicComponent.cpp:26
SILICON::ui::GraphicalRegister::GraphicalRegister
GraphicalRegister(QGraphicsItem *parent=nullptr)
Definition
graphicalRegister.cpp:82
SILICON::ui::GraphicalRegister::applyOutputType
std::string applyOutputType(const std::string &outputType)
Definition
graphicalRegister.cpp:165
SILICON::ui::GraphicalRegister::updateLayout
void updateLayout()
Definition
graphicalRegister.cpp:117
SILICON::ui::GraphicalRegister::applyInputType
std::string applyInputType(const std::string &inputType)
Definition
graphicalRegister.cpp:156
SILICON::ui::GraphicalRegister::applySize
int applySize(int size)
Definition
graphicalRegister.cpp:149
SILICON::ui::GraphicalRegister::type
int type() const override
Definition
graphicalRegister.hpp:42
SILICON::ui::GraphicalRegister::setComponent
void setComponent(const Component_ptr &component) override
Sets the associated logical component.
Definition
graphicalRegister.cpp:175
SILICON::ui::GraphicalRegister::getComponentAsRegister
Register * getComponentAsRegister() const
Definition
graphicalRegister.cpp:93
SILICON::ui::GraphicalRegister::setupCallbacks
void setupCallbacks()
Definition
graphicalRegister.cpp:101
graphicalLogicComponent.hpp
SILICON::core::Component_ptr
std::shared_ptr< Component > Component_ptr
Definition
component_registry.hpp:33
SILICON::ui
Definition
actionGroups.hpp:14
SILICON::ui::REGISTER
@ REGISTER
Definition
enums.hpp:108
register.hpp
src
ui
circuit
components
graphicalRegister.hpp
Generated by
1.17.0