LibrePCB Developers Documentation
cmdcomponentsignaledit.h
Go to the documentation of this file.
1/*
2 * LibrePCB - Professional EDA for everyone!
3 * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4 * https://librepcb.org/
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LIBREPCB_EDITOR_CMDCOMPONENTSIGNALEDIT_H
21#define LIBREPCB_EDITOR_CMDCOMPONENTSIGNALEDIT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../cmd/cmdlistelementinsert.h"
27#include "../../cmd/cmdlistelementremove.h"
28#include "../../cmd/cmdlistelementsswap.h"
29#include "../../undocommand.h"
30
32
33#include <QtCore>
34
35/*******************************************************************************
36 * Namespace / Forward Declarations
37 ******************************************************************************/
38namespace librepcb {
39namespace editor {
40
41/*******************************************************************************
42 * Class CmdComponentSignalEdit
43 ******************************************************************************/
44
48class CmdComponentSignalEdit final : public UndoCommand {
49public:
50 // Constructors / Destructor
53 explicit CmdComponentSignalEdit(ComponentSignal& signal) noexcept;
54 ~CmdComponentSignalEdit() noexcept;
55
56 // Setters
57 void setName(const CircuitIdentifier& name) noexcept;
58 void setRole(const SignalRole& role) noexcept;
59 void setForcedNetName(const QString& name) noexcept;
60 void setIsRequired(bool required) noexcept;
61 void setIsNegated(bool negated) noexcept;
62 void setIsClock(bool clock) noexcept;
63
64 // Operator Overloadings
65 CmdComponentSignalEdit& operator=(const CmdComponentSignalEdit& rhs) = delete;
66
67private: // Methods
69 bool performExecute() override;
70
72 void performUndo() override;
73
75 void performRedo() override;
76
77private: // Data
79
92};
93
94/*******************************************************************************
95 * Undo Commands
96 ******************************************************************************/
97
100 ComponentSignal::Event>;
103 ComponentSignal::Event>;
106 ComponentSignal::Event>;
107
108/*******************************************************************************
109 * End of File
110 ******************************************************************************/
111
112} // namespace editor
113} // namespace librepcb
114
115#endif
The ComponentSignal class represents one signal of a component.
Definition: componentsignal.h:45
The SignalRole class provides all supported electrical signal roles.
Definition: signalrole.h:42
The CmdComponentSignalEdit class.
Definition: cmdcomponentsignaledit.h:48
void performRedo() override
Redo the command.
Definition: cmdcomponentsignaledit.cpp:116
void setIsClock(bool clock) noexcept
Definition: cmdcomponentsignaledit.cpp:86
QString mNewForcedNetName
Definition: cmdcomponentsignaledit.h:85
~CmdComponentSignalEdit() noexcept
Definition: cmdcomponentsignaledit.cpp:54
CircuitIdentifier mOldName
Definition: cmdcomponentsignaledit.h:80
void setIsRequired(bool required) noexcept
Definition: cmdcomponentsignaledit.cpp:76
bool mOldIsRequired
Definition: cmdcomponentsignaledit.h:86
bool mOldIsNegated
Definition: cmdcomponentsignaledit.h:88
void setRole(const SignalRole &role) noexcept
Definition: cmdcomponentsignaledit.cpp:66
void performUndo() override
Undo the command.
Definition: cmdcomponentsignaledit.cpp:107
QString mOldForcedNetName
Definition: cmdcomponentsignaledit.h:84
SignalRole mNewRole
Definition: cmdcomponentsignaledit.h:83
bool mNewIsClock
Definition: cmdcomponentsignaledit.h:91
void setForcedNetName(const QString &name) noexcept
Definition: cmdcomponentsignaledit.cpp:71
void setName(const CircuitIdentifier &name) noexcept
Definition: cmdcomponentsignaledit.cpp:61
bool mNewIsRequired
Definition: cmdcomponentsignaledit.h:87
ComponentSignal & mSignal
Definition: cmdcomponentsignaledit.h:78
bool mNewIsNegated
Definition: cmdcomponentsignaledit.h:89
CmdComponentSignalEdit(const CmdComponentSignalEdit &other)=delete
bool mOldIsClock
Definition: cmdcomponentsignaledit.h:90
void setIsNegated(bool negated) noexcept
Definition: cmdcomponentsignaledit.cpp:81
bool performExecute() override
Execute the command the first time.
Definition: cmdcomponentsignaledit.cpp:95
SignalRole mOldRole
Definition: cmdcomponentsignaledit.h:82
CircuitIdentifier mNewName
Definition: cmdcomponentsignaledit.h:81
The CmdListElementInsert class.
Definition: cmdlistelementinsert.h:46
The CmdListElementRemove class.
Definition: cmdlistelementremove.h:46
The CmdListElementsSwap class.
Definition: cmdlistelementsswap.h:46
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:46
Definition: occmodel.cpp:77
type_safe::constrained_type< QString, CircuitIdentifierConstraint, CircuitIdentifierVerifier > CircuitIdentifier
Definition: circuitidentifier.h:96
Definition: componentsignal.h:119