dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
uavtalkplugin.cpp
Go to the documentation of this file.
1 
12 /*
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.
17  *
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.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, see <http://www.gnu.org/licenses/>
25  */
26 #include "uavtalkplugin.h"
27 
28 #include <coreplugin/icore.h>
30 
31 UAVTalkPlugin::UAVTalkPlugin()
32 {
33 }
34 
35 UAVTalkPlugin::~UAVTalkPlugin()
36 {
37 }
41 void UAVTalkPlugin::extensionsInitialized()
42 {
43 }
44 
48 bool UAVTalkPlugin::initialize(const QStringList &arguments, QString *errorString)
49 {
50  // Done
51  Q_UNUSED(arguments);
52  Q_UNUSED(errorString);
53  // Get UAVObjectManager instance
54  ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
55  objMngr = pm->getObject<UAVObjectManager>();
56 
57  // Create TelemetryManager
58  telMngr = new TelemetryManager();
59  addAutoReleasedObject(telMngr);
60 
61  // Connect to connection manager so we get notified when the user connect to his device
63  QObject::connect(cm, &Core::ConnectionManager::deviceConnected, this,
65  QObject::connect(cm, &Core::ConnectionManager::deviceAboutToDisconnect, this,
67  return true;
68 }
69 
70 void UAVTalkPlugin::shutdown()
71 {
72 }
73 
74 void UAVTalkPlugin::onDeviceConnect(QIODevice *dev)
75 {
76  telMngr->start(dev);
77 }
78 
80 {
81  telMngr->stop();
82 }
void onDeviceConnect(QIODevice *dev)
Core plugin system that manages the plugins, their life cycle and their registered objects...
Definition: pluginmanager.h:53
virtual ConnectionManager * connectionManager() const =0
static ICore * instance()
Definition: coreimpl.cpp:46
void addAutoReleasedObject(QObject *obj)
Definition: iplugin.cpp:306
void onDeviceDisconnect()
void deviceConnected(QIODevice *device)