OP-1900 have path_progress updated correctly for leg_remaining and error_below end...
[librepilot.git] / ground / openpilotgcs / src / plugins / uploader / uploadergadgetconfiguration.h
blob2d1ee84e8a40f3e84642a00ce6013ba2d6cea0c0
1 /**
2 ******************************************************************************
4 * @file uploadergadgetconfiguration.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
7 * @{
8 * @addtogroup YModemUploader YModem Serial Uploader Plugin
9 * @{
10 * @brief The YModem protocol serial uploader plugin
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef UPLOADERGADGETCONFIGURATION_H
29 #define UPLOADERGADGETCONFIGURATION_H
31 #include <coreplugin/iuavgadgetconfiguration.h>
32 #include <QtSerialPort/QSerialPort>
33 #include <QtSerialPort/QSerialPortInfo>
34 #include "uploader_global.h"
36 using namespace Core;
38 /**
39 * structure to contain port settings
41 struct PortSettings {
42 QSerialPort::BaudRate BaudRate;
43 QSerialPort::DataBits DataBits;
44 QSerialPort::Parity Parity;
45 QSerialPort::StopBits StopBits;
46 QSerialPort::FlowControl FlowControl;
47 long Timeout_Millisec;
50 class UPLOADER_EXPORT UploaderGadgetConfiguration : public IUAVGadgetConfiguration {
51 Q_OBJECT
52 public:
53 explicit UploaderGadgetConfiguration(QString classId, QSettings *qSettings = 0, QObject *parent = 0);
55 // set port configuration functions
56 void setSpeed(QSerialPort::BaudRate speed)
58 m_defaultSpeed = speed;
60 void setDataBits(QSerialPort::DataBits databits)
62 m_defaultDataBits = databits;
64 void setFlow(QSerialPort::FlowControl flow)
66 m_defaultFlow = flow;
68 void setParity(QSerialPort::Parity parity)
70 m_defaultParity = parity;
72 void setStopBits(QSerialPort::StopBits stopbits)
74 m_defaultStopBits = stopbits;
76 void setPort(QString port)
78 m_defaultPort = port;
80 void setTimeOut(long timeout)
82 m_defaultTimeOut = timeout;
85 // get port configuration functions
86 QString port()
88 return m_defaultPort;
90 QSerialPort::BaudRate speed()
92 return m_defaultSpeed;
94 QSerialPort::FlowControl flow()
96 return m_defaultFlow;
98 QSerialPort::DataBits dataBits()
100 return m_defaultDataBits;
102 QSerialPort::StopBits stopBits()
104 return m_defaultStopBits;
106 QSerialPort::Parity parity()
108 return m_defaultParity;
110 long timeOut()
112 return m_defaultTimeOut;
114 void saveConfig(QSettings *settings) const;
115 IUAVGadgetConfiguration *clone();
117 private:
118 QString m_defaultPort;
119 QSerialPort::BaudRate m_defaultSpeed;
120 QSerialPort::DataBits m_defaultDataBits;
121 QSerialPort::FlowControl m_defaultFlow;
122 QSerialPort::Parity m_defaultParity;
123 QSerialPort::StopBits m_defaultStopBits;
124 long m_defaultTimeOut;
127 #endif // UPLOADERGADGETCONFIGURATION_H