wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
ICController.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
10#include <QObject>
11#include <QString>
12
13class IC;
14class MainWindowHost;
15class Scene;
16
27class ICController : public QObject
28{
29 Q_OBJECT
30
31public:
32 explicit ICController(MainWindowHost &host, QObject *parent = nullptr);
33
34public slots:
36 void addICFromFile();
37
39 void showRemoveICHint();
40
42 void removeICFile(const QString &icFileName);
43
45 void embedSelectedIC();
46
48 void extractSelectedIC();
49
51 void embedICByFile(const QString &fileName);
52
54 void extractICByBlobName(const QString &blobName);
55
57 void makeSelfContained();
58
61
63 void removeEmbeddedIC(const QString &blobName);
64
65private:
67 IC *selectedIC() const;
68
70 QString resolveUniqueBlobName(const QString &initialName, Scene *scene);
71
76 bool ensureProjectSaved(Scene *scene);
77
78 MainWindowHost &m_host;
79};
void makeSelfContained()
Embeds every file-based IC in the circuit so it becomes self-contained.
void embedICByFile(const QString &fileName)
Embeds the file-based IC named fileName (drag-and-drop target).
void extractICByBlobName(const QString &blobName)
Extracts the embedded IC blob blobName to a user-chosen .panda file.
void addEmbeddedICFromFile()
Prompts for a .panda file and registers it as an embedded IC blob.
void removeICFile(const QString &icFileName)
Deletes icFileName from the project directory and any instances of it in the scene.
void addICFromFile()
Copies a chosen .panda file (and its dependencies) into the project's IC directory.
void embedSelectedIC()
Embeds the currently selected file-backed IC as a blob in the circuit.
void removeEmbeddedIC(const QString &blobName)
Removes the embedded IC blob blobName from the current circuit.
void showRemoveICHint()
Shows the "drag here to remove" hint for the file-based IC trash button.
void extractSelectedIC()
Extracts the currently selected embedded IC back out to a .panda file.
ICController(MainWindowHost &host, QObject *parent=nullptr)
Graphic element representing an Integrated Circuit (sub-circuit) box.
Definition IC.h:31
Interface MainWindow provides to its extracted controllers (export, IC, …).
Main circuit editing scene.
Definition Scene.h:56