LibrePCB Developers Documentation
|
The board editor finite state machine. More...
#include <boardeditorfsm.h>
Inherits QObject.
Classes | |
struct | Context |
FSM Context. More... | |
Public Types | |
enum | State |
FSM States. More... | |
Signals | |
void | stateChanged (State newState) |
void | statusBarMessageChanged (const QString &message, int timeoutMs=-1) |
Public Member Functions | |
BoardEditorFsm ()=delete | |
BoardEditorFsm (const BoardEditorFsm &other)=delete | |
BoardEditorFsm (const Context &context, QObject *parent=nullptr) noexcept | |
virtual | ~BoardEditorFsm () noexcept |
State | getCurrentState () const noexcept |
bool | processSelect () noexcept |
bool | processAddHole () noexcept |
bool | processAddStrokeText () noexcept |
bool | processAddVia () noexcept |
bool | processAddDevice (ComponentInstance &component, const Uuid &device, const Uuid &footprint) noexcept |
bool | processDrawPolygon () noexcept |
bool | processDrawPlane () noexcept |
bool | processDrawZone () noexcept |
bool | processDrawTrace () noexcept |
bool | processImportDxf () noexcept |
bool | processMeasure () noexcept |
bool | processAbortCommand () noexcept |
bool | processSelectAll () noexcept |
bool | processCut () noexcept |
bool | processCopy () noexcept |
bool | processPaste () noexcept |
bool | processMove (const Point &delta) noexcept |
bool | processRotate (const Angle &rotation) noexcept |
bool | processFlip (Qt::Orientation orientation) noexcept |
bool | processSnapToGrid () noexcept |
bool | processSetLocked (bool locked) noexcept |
bool | processChangeLineWidth (int step) noexcept |
bool | processResetAllTexts () noexcept |
bool | processRemove () noexcept |
bool | processEditProperties () noexcept |
bool | processKeyPressed (const QKeyEvent &e) noexcept |
bool | processKeyReleased (const QKeyEvent &e) noexcept |
bool | processGraphicsSceneMouseMoved (QGraphicsSceneMouseEvent &e) noexcept |
bool | processGraphicsSceneLeftMouseButtonPressed (QGraphicsSceneMouseEvent &e) noexcept |
bool | processGraphicsSceneLeftMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept |
bool | processGraphicsSceneLeftMouseButtonDoubleClicked (QGraphicsSceneMouseEvent &e) noexcept |
bool | processGraphicsSceneRightMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept |
bool | processSwitchToBoard (int index) noexcept |
BoardEditorFsm & | operator= (const BoardEditorFsm &rhs)=delete |
Private Member Functions | |
BoardEditorState * | getCurrentStateObj () const noexcept |
bool | setNextState (State state) noexcept |
bool | leaveCurrentState () noexcept |
bool | enterNextState (State state) noexcept |
bool | switchToPreviousState () noexcept |
Private Attributes | |
QMap< State, BoardEditorState * > | mStates |
State | mCurrentState |
State | mPreviousState |
The board editor finite state machine.
enum State |
|
delete |
|
delete |
|
explicitnoexcept |
|
virtualnoexcept |
|
inlinenoexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
Switch to another board
If someone (the user or the application) wants to switch to another board in the board editor, this is not allowed at any time (for example, while drawing a trace in the active board, you cannot switch to another board). So this kind of event must be processed by the FSM. The FSM then will only decide whether changing the board is allowed (event accepted) or not (event rejected). If the event was accepted, the board editor then is allowed to switch to the requested board.
index | The new board index |
true | If switching is allowed |
false | If switching is rejected |
|
delete |
|
signal |
|
signal |
|
privatenoexcept |
|
privatenoexcept |
|
privatenoexcept |
|
privatenoexcept |
|
privatenoexcept |
|
private |
|
private |
|
private |