2 ******************************************************************************
4 * @file ipconnectionconfiguration.cpp
5 * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2017.
6 * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
7 * @addtogroup GCSPlugins GCS Plugins
9 * @addtogroup IPConnPlugin IP Telemetry Plugin
11 * @brief IP Connection Plugin implements telemetry over TCP/IP and UDP/IP
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
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
29 #include "ipconnectionconfiguration.h"
31 #include <coreplugin/icore.h>
33 IPConnectionConfiguration::IPConnectionConfiguration(QString classId
, QSettings
&settings
, QObject
*parent
) :
34 IUAVGadgetConfiguration(classId
, parent
)
36 m_hostName
= settings
.value("HostName", "").toString();
37 m_port
= settings
.value("Port", 9000).toInt();
38 m_useTCP
= settings
.value("UseTCP", true).toInt();
41 IPConnectionConfiguration::IPConnectionConfiguration(const IPConnectionConfiguration
&obj
) :
42 IUAVGadgetConfiguration(obj
.classId(), obj
.parent())
44 m_hostName
= obj
.m_hostName
;
46 m_useTCP
= obj
.m_useTCP
;
49 IPConnectionConfiguration::~IPConnectionConfiguration()
52 IUAVGadgetConfiguration
*IPConnectionConfiguration::clone() const
54 return new IPConnectionConfiguration(*this);
58 * Saves a configuration.
61 void IPConnectionConfiguration::saveConfig(QSettings
&settings
) const
63 settings
.setValue("HostName", m_hostName
);
64 settings
.setValue("Port", m_port
);
65 settings
.setValue("UseTCP", m_useTCP
);