wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
TFlipFlop.h
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
7
8#pragma once
9
12
20{
21 Q_OBJECT
22
23public:
24 // --- Lifecycle ---
25
27 explicit TFlipFlop(QGraphicsItem *parent = nullptr);
28
29 // --- Visual ---
30
31 static QString pixmapPath()
32 {
33 return ":/Components/Memory/" + ThemeManager::themePath() + "/T-flipflop.svg";
34 }
35
37 void updatePortsProperties() override;
38
40 void updateTheme() override;
41
43 void updateLogic() override;
45 void resetSimState() override;
46private:
47 Status m_simLastClk = Status::Inactive;
48 Status m_simLastValue = Status::Active;
49};
Enums::Status Status
Definition Enums.h:106
Abstract base class for all graphical circuit elements.
Theme management types and singleton ThemeManager.
GraphicElement(ElementType type, QGraphicsItem *parent=nullptr)
Constructs a graphic element of the given type, fetching all properties from the metadata registry.
void resetSimState() override
Resets Q/~Q outputs and edge-detection state to power-on defaults.
void updateLogic() override
Updates output state on each rising clock edge.
Definition TFlipFlop.cpp:80
static QString pixmapPath()
Definition TFlipFlop.h:31
TFlipFlop(QGraphicsItem *parent=nullptr)
Constructs the element with optional parent.
Definition TFlipFlop.cpp:40
void updatePortsProperties() override
Updates port names for this flip-flop.
Definition TFlipFlop.cpp:47
void updateTheme() override
Refreshes the pixmap when the application theme changes.
Definition TFlipFlop.cpp:73
static QString themePath()
Returns the resource path prefix for the current theme (e.g. "dark" or "light").