LP-311 Remove basic/advanced stabilization tab auto-switch (autotune/txpid lock issues)
[librepilot.git] / ground / gcs / src / plugins / config / calibration / wizardstate.h
blob6d4d9352acbdbd61405877bb52b4ed9d3afc390a
1 /**
2 ******************************************************************************
4 * @file wizardstate.c
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2013.
7 * @brief A fsm state used in wizard like UI
8 * @see The GNU Public License (GPL) Version 3
9 * @defgroup
10 * @{
12 *****************************************************************************/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef WIZARDSTATE_H
29 #define WIZARDSTATE_H
31 #include <QState>
33 class WizardState : public QState {
34 Q_OBJECT Q_PROPERTY(bool isActive READ isActive NOTIFY isActiveChanged)
35 Q_PROPERTY(bool isDone READ isDone NOTIFY isDoneChanged)
36 Q_PROPERTY(qint8 completion READ completion NOTIFY completionChanged)
37 Q_PROPERTY(QString stepName READ stepName)
39 public:
40 explicit WizardState(QString name, QState *parent = 0);
42 bool isActive()
44 return m_active;
47 bool isDone()
49 return m_done;
52 qint8 completion()
54 return m_completion;
57 QString stepName()
59 return m_stepName;
62 void setCompletion(qint8 completion);
63 virtual void onEntry(QEvent *event) Q_DECL_OVERRIDE;
64 virtual void onExit(QEvent *event) Q_DECL_OVERRIDE;
66 signals:
67 void isActiveChanged();
68 void isDoneChanged();
69 void completionChanged();
71 public slots:
72 void clean();
74 private:
75 void setIsDone(bool done);
76 bool m_done;
77 bool m_active;
78 qint8 m_completion;
79 QString m_stepName;
82 #endif // WIZARDSTATE_H