dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
simulation.cpp
Go to the documentation of this file.
1 
11 /*
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful, but
18  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20  * for more details.
21  *
22  * You should have received a copy of the GNU General Public License along
23  * with this program; if not, see <http://www.gnu.org/licenses/>
24  *
25  * Additional note on redistribution: The copyright and license notices above
26  * must be maintained in each individual source file that is a derivative work
27  * of this source file; otherwise redistribution is prohibited.
28  */
29 
30 #include "simulation.h"
31 
32 #include "hwsimulation.h"
34 
40 {
41  boardType = 0x7F;
42 
43  /* For now assuming flyingpio bank configuration. This may not hold
44  * true in the long term...
45  */
46  channelBanks.resize(2);
47  channelBanks[0] = QVector<int>() << 1 << 2; // TIM3
48  channelBanks[1] = QVector<int>() << 3 << 4 << 5 << 6; // TIM1
49 }
50 
52 {
53 }
54 
56 {
57  return QString("Simulation");
58 }
59 
61 {
62  return QString("POSIX Simulator");
63 }
64 
66 {
67  switch (capability) {
72  return true;
73  default:
74  return false;
75  }
76  return false;
77 }
78 
80 {
81  return QPixmap(":/images/gcs_logo_256.png");
82 }
83 
85 {
86  return "HwSimulation";
87 }
88 
89 QWidget *Simulation::getBoardConfiguration(QWidget *parent, bool connected)
90 {
91  Q_UNUSED(connected);
92  return new SimulationConfiguration(parent);
93 }
94 
96 {
97  /* Correct for flyingpi and reasonable for simulation. */
98  return 2000;
99 }
100 
102 {
103  switch (annunc) {
105  case ANNUNCIATOR_ALARM:
106  return true;
107  case ANNUNCIATOR_BUZZER:
108  case ANNUNCIATOR_RGB:
109  case ANNUNCIATOR_DAC:
110  break;
111  }
112  return false;
113 }
114 
qint32 boardType
The numerical board type ID.
Definition: iboardtype.h:284
virtual QString shortName()
Definition: simulation.cpp:55
QVector< QVector< qint32 > > channelBanks
The channel groups that are driven by timers.
Definition: iboardtype.h:287
BoardCapabilities
Types of capabilities boards can support.
Definition: iboardtype.h:92
virtual bool queryCapabilities(BoardCapabilities capability)
Query capabilities of the board.
Definition: simulation.cpp:65
QWidget * getBoardConfiguration(QWidget *parent, bool connected)
Return a custom configuration widget, if one is provided.
Definition: simulation.cpp:89
Simulation()
Simulation:Simulation This is the Simulation board definition.
Definition: simulation.cpp:39
virtual bool hasAnnunciator(AnnunciatorType annunc)
Check if the board has the given type of annunciator.
Definition: simulation.cpp:101
virtual ~Simulation()
Definition: simulation.cpp:51
virtual QString boardDescription()
Definition: simulation.cpp:60
virtual int queryMaxGyroRate()
Query the board for the currently set max rate of the gyro.
Definition: simulation.cpp:95
virtual QString getHwUAVO()
Definition: simulation.cpp:84
virtual QPixmap getBoardPicture()
getBoardPicture
Definition: simulation.cpp:79