LibrePCB Developers Documentation
Loading...
Searching...
No Matches
boardeditor.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_BOARDEDITOR_H
21#define LIBREPCB_EDITOR_BOARDEDITOR_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "appwindow.h"
27
30
31#include <QtCore>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class Board;
39class BoardPlaneFragmentsBuilder;
40class OrderPcbApiRequest;
41class Project;
42
43namespace editor {
44
45class Board2dTab;
46class Board3dTab;
47class Notification;
48class ProjectEditor;
49class RuleCheckMessagesModel;
50
51/*******************************************************************************
52 * Class BoardEditor
53 ******************************************************************************/
54
58class BoardEditor final : public QObject {
59 Q_OBJECT
60
61public:
62 // Signals
64
65 // Constructors / Destructor
66 BoardEditor() = delete;
67 BoardEditor(const BoardEditor& other) = delete;
68 explicit BoardEditor(ProjectEditor& prjEditor, Board& board, int uiIndex,
69 QObject* parent = nullptr) noexcept;
70 ~BoardEditor() noexcept;
71
72 // General Methods
74 Board& getBoard() noexcept { return mBoard; }
75 int getUiIndex() const noexcept { return mUiIndex; }
76 void setUiIndex(int index) noexcept;
77 ui::BoardData getUiData() const noexcept;
78 void setUiData(const ui::BoardData& data) noexcept;
79 bool isRebuildingPlanes() const noexcept;
81 void startPlanesRebuild(bool force = false) noexcept;
82 void startDrc(bool quick) noexcept;
83 void registerActiveTab(Board2dTab* tab) noexcept;
84 void unregisterActiveTab(Board2dTab* tab) noexcept;
85 void registerActiveTab(Board3dTab* tab) noexcept;
86 void unregisterActiveTab(Board3dTab* tab) noexcept;
87 void execBoardSetupDialog(bool switchToDrcSettings = false) noexcept;
88 void execStepExportDialog() noexcept;
89
93 void prepareOrderPcb() noexcept;
94
101 void startOrderPcbUpload(bool openBrowser) noexcept;
102
103 // Operator Overloadings
104 BoardEditor& operator=(const BoardEditor& rhs) = delete;
105
106signals:
111 bool zoomTo);
113
114private:
115 void setDrcResult(const BoardDesignRuleCheck::Result& result) noexcept;
116 void registeredTabsModified() noexcept;
117 void planesRebuildTimerTimeout() noexcept;
118
119private:
124
125 // Plane fragments builder
127 std::unique_ptr<QTimer> mPlanesRebuildTimer;
129
130 // DRC
135
136 // Order PCB
138 QString mOrderStatus;
142
143 // Registered active tabs
144 QVector<QPointer<Board2dTab>> mActive2dTabs;
145 QVector<QPointer<Board3dTab>> mActive3dTabs;
146};
147
148/*******************************************************************************
149 * End of File
150 ******************************************************************************/
151
152} // namespace editor
153} // namespace librepcb
154
155#endif
The BoardDesignRuleCheck class checks a librepcb::Board for design rule violations.
Definition boarddesignrulecheck.h:47
The Board class represents a PCB of a project and is always part of a circuit.
Definition board.h:73
Plane fragments builder working on a librepcb::Board.
Definition boardplanefragmentsbuilder.h:55
Order a PCB via a LibrePCB API server.
Definition orderpcbapirequest.h:42
The Project class represents a whole (opened) project with all its content.
Definition project.h:71
The RuleCheckMessage class.
Definition rulecheckmessage.h:45
The Signal class is used to emit signals on non-QObject derived classes.
Definition signalslot.h:65
The Board2dTab class.
Definition board2dtab.h:68
The Board3dTab class.
Definition board3dtab.h:55
The BoardEditor class.
Definition boardeditor.h:58
void startDrc(bool quick) noexcept
Definition boardeditor.cpp:214
void registeredTabsModified() noexcept
Definition boardeditor.cpp:472
std::unique_ptr< OrderPcbApiRequest > mOrderRequest
May be nullptr
Definition boardeditor.h:137
void startOrderPcbUpload(bool openBrowser) noexcept
Start the "Order PCB" upload.
Definition boardeditor.cpp:364
std::unique_ptr< BoardDesignRuleCheck > mDrc
Definition boardeditor.h:131
void schedulePlanesRebuild()
Definition boardeditor.cpp:161
void drcMessageHighlightRequested(std::shared_ptr< const RuleCheckMessage > msg, bool zoomTo)
QString mOrderStatus
Either error or status.
Definition boardeditor.h:138
void execStepExportDialog() noexcept
Definition boardeditor.cpp:264
void execBoardSetupDialog(bool switchToDrcSettings=false) noexcept
Definition boardeditor.cpp:254
std::shared_ptr< Notification > mDrcNotification
Definition boardeditor.h:132
ProjectEditor & getProjectEditor() noexcept
Definition boardeditor.h:73
bool isRebuildingPlanes() const noexcept
Definition boardeditor.cpp:157
std::unique_ptr< BoardPlaneFragmentsBuilder > mPlanesBuilder
Definition boardeditor.h:126
void setDrcResult(const BoardDesignRuleCheck::Result &result) noexcept
Definition boardeditor.cpp:444
void registerActiveTab(Board2dTab *tab) noexcept
Definition boardeditor.cpp:230
Board & getBoard() noexcept
Definition boardeditor.h:74
void prepareOrderPcb() noexcept
Prepare the "Order PCB" feature (request server status)
Definition boardeditor.cpp:305
QString mDrcExecutionError
Definition boardeditor.h:141
ProjectEditor & mProjectEditor
Definition boardeditor.h:120
void unregisterActiveTab(Board2dTab *tab) noexcept
Definition boardeditor.cpp:237
int mOrderUploadProgressPercent
-1 means "not in progress"
Definition boardeditor.h:139
int mUiIndex
Definition boardeditor.h:123
bool mOrderOpenBrowser
Definition boardeditor.h:140
BoardEditor(const BoardEditor &other)=delete
Board & mBoard
Definition boardeditor.h:122
void setUiIndex(int index) noexcept
Definition boardeditor.cpp:113
void planesRebuildTimerTimeout() noexcept
Definition boardeditor.cpp:487
uint mDrcUndoStackState
Definition boardeditor.h:133
Project & mProject
Definition boardeditor.h:121
qint64 mTimestampOfLastPlaneRebuild
Definition boardeditor.h:128
int getUiIndex() const noexcept
Definition boardeditor.h:75
QVector< QPointer< Board3dTab > > mActive3dTabs
Definition boardeditor.h:145
Signal< BoardEditor > onUiDataChanged
Definition boardeditor.h:63
void setUiData(const ui::BoardData &data) noexcept
Definition boardeditor.cpp:153
ui::BoardData getUiData() const noexcept
Definition boardeditor.cpp:120
std::unique_ptr< QTimer > mPlanesRebuildTimer
Definition boardeditor.h:127
QVector< QPointer< Board2dTab > > mActive2dTabs
Definition boardeditor.h:144
void startPlanesRebuild(bool force=false) noexcept
Definition boardeditor.cpp:165
std::shared_ptr< RuleCheckMessagesModel > mDrcMessages
Definition boardeditor.h:134
The Notification class.
Definition notification.h:43
The ProjectEditor class.
Definition projecteditor.h:63
The RuleCheckMessagesModel class.
Definition rulecheckmessagesmodel.h:46
Definition occmodel.cpp:77
Definition uuid.h:186