SILICON
Toggle main menu visibility
Loading...
Searching...
No Matches
graphicalMemory.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/memory.hpp
>
21
#include <
ui/circuit/components/graphicalLogicComponent.hpp
>
22
23
namespace
SILICON::project
{
24
class
DocumentStore
;
25
}
26
27
namespace
SILICON::ui
{
28
29
class
GraphicalROM
final :
public
GraphicalLogicComponent
{
30
Q_OBJECT
31
public
:
32
explicit
GraphicalROM
(QGraphicsItem* parent =
nullptr
);
33
~GraphicalROM
()
override
;
34
35
int
type
()
const override
{
return
SiliconTypes::ROM_COMPONENT
; }
36
37
void
setComponent
(
const
SILICON::core::Component_ptr
& component)
override
;
38
void
applyProperty
(std::string_view key,
39
const
SILICON::core::PropertyValue
& value)
override
;
40
void
setDocumentStore
(
const
SILICON::project::DocumentStore
*
documents
);
41
42
protected
:
43
void
mouseDoubleClickEvent
(QGraphicsSceneMouseEvent* event)
override
;
44
45
private
:
46
const
SILICON::project::DocumentStore
*
documents
=
nullptr
;
47
std::uint64_t
documentListenerId
= 0;
48
49
void
subscribeToDocuments
();
50
void
unsubscribeFromDocuments
();
51
void
refreshBinaryContents
();
52
[[nodiscard]] std::shared_ptr<const std::string>
53
resolveBinaryContents
(std::string_view slug)
const
;
54
[[nodiscard]] std::string
currentSlug
()
const
;
55
};
56
57
}
// namespace SILICON::ui
SILICON::project::DocumentStore
Definition
projectDocument.hpp:137
SILICON::ui::GraphicalLogicComponent::GraphicalLogicComponent
GraphicalLogicComponent(ItemCategory category, const Component_ptr &component, QGraphicsItem *shape, QGraphicsItem *parent, bool scanShape=false)
Definition
graphicalLogicComponent.cpp:26
SILICON::ui::GraphicalROM::documents
const SILICON::project::DocumentStore * documents
Definition
graphicalMemory.hpp:46
SILICON::ui::GraphicalROM::GraphicalROM
GraphicalROM(QGraphicsItem *parent=nullptr)
Definition
graphicalMemory.cpp:70
SILICON::ui::GraphicalROM::applyProperty
void applyProperty(std::string_view key, const SILICON::core::PropertyValue &value) override
Applies a component property while notifying Qt about possible geometry changes.
Definition
graphicalMemory.cpp:108
SILICON::ui::GraphicalROM::type
int type() const override
Definition
graphicalMemory.hpp:35
SILICON::ui::GraphicalROM::unsubscribeFromDocuments
void unsubscribeFromDocuments()
Definition
graphicalMemory.cpp:161
SILICON::ui::GraphicalROM::setDocumentStore
void setDocumentStore(const SILICON::project::DocumentStore *documents)
Definition
graphicalMemory.cpp:125
SILICON::ui::GraphicalROM::refreshBinaryContents
void refreshBinaryContents()
Definition
graphicalMemory.cpp:168
SILICON::ui::GraphicalROM::resolveBinaryContents
std::shared_ptr< const std::string > resolveBinaryContents(std::string_view slug) const
Definition
graphicalMemory.cpp:175
SILICON::ui::GraphicalROM::mouseDoubleClickEvent
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
Definition
graphicalMemory.cpp:85
SILICON::ui::GraphicalROM::~GraphicalROM
~GraphicalROM() override
Definition
graphicalMemory.cpp:80
SILICON::ui::GraphicalROM::documentListenerId
std::uint64_t documentListenerId
Definition
graphicalMemory.hpp:47
SILICON::ui::GraphicalROM::setComponent
void setComponent(const SILICON::core::Component_ptr &component) override
Sets the associated logical component.
Definition
graphicalMemory.cpp:97
SILICON::ui::GraphicalROM::subscribeToDocuments
void subscribeToDocuments()
Definition
graphicalMemory.cpp:143
SILICON::ui::GraphicalROM::currentSlug
std::string currentSlug() const
Definition
graphicalMemory.cpp:135
graphicalLogicComponent.hpp
memory.hpp
SILICON::core::Component_ptr
std::shared_ptr< Component > Component_ptr
Definition
component_registry.hpp:33
SILICON::core::PropertyValue
std::variant< int, bool, std::string, BusValue > PropertyValue
Variant type for component properties.
Definition
component.hpp:142
SILICON::project
Definition
circuitDependencyGraph.cpp:30
SILICON::ui
Definition
actionGroups.hpp:14
SILICON::ui::ROM_COMPONENT
@ ROM_COMPONENT
Definition
enums.hpp:109
src
ui
circuit
components
graphicalMemory.hpp
Generated by
1.17.0