LP-106 Setup Wizard refresh : Add dual servo setup (dual aileron or
[librepilot.git] / ground / gcs / src / plugins / uavtalk / uavtalkplugin.cpp
blob472b00ed34aac623c3ac8e4e9f534543487a97b7
1 /**
2 ******************************************************************************
4 * @file uavtalkplugin.cpp
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
7 * @{
8 * @addtogroup UAVTalkPlugin UAVTalk Plugin
9 * @{
10 * @brief The UAVTalk protocol 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
27 #include "uavtalkplugin.h"
29 #include <coreplugin/icore.h>
30 #include <coreplugin/connectionmanager.h>
32 UAVTalkPlugin::UAVTalkPlugin()
35 UAVTalkPlugin::~UAVTalkPlugin()
37 /**
38 * Called once all the plugins which depend on us have been loaded
40 void UAVTalkPlugin::extensionsInitialized()
43 /**
44 * Called at startup, before any plugin which depends on us is initialized
46 bool UAVTalkPlugin::initialize(const QStringList & arguments, QString *errorString)
48 // Done
49 Q_UNUSED(arguments);
50 Q_UNUSED(errorString);
52 // Create TelemetryManager
53 telMngr = new TelemetryManager();
54 addAutoReleasedObject(telMngr);
56 // Connect to connection manager so we get notified when the user connect to his device
57 Core::ConnectionManager *cm = Core::ICore::instance()->connectionManager();
58 QObject::connect(cm, SIGNAL(deviceConnected(QIODevice *)),
59 this, SLOT(onDeviceConnect(QIODevice *)));
60 QObject::connect(cm, SIGNAL(deviceAboutToDisconnect()),
61 this, SLOT(onDeviceDisconnect()));
62 return true;
65 void UAVTalkPlugin::shutdown()
68 void UAVTalkPlugin::onDeviceConnect(QIODevice *dev)
70 telMngr->start(dev);
73 void UAVTalkPlugin::onDeviceDisconnect()
75 telMngr->stop();