2
* Copyright (c) 2009 Mark Liversedge (liversedge@gmail.com)
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the Free
6
* Software Foundation; either version 2 of the License, or (at your option)
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14
* You should have received a copy of the GNU General Public License along
15
* with this program; if not, write to the Free Software Foundation, Inc., 51
16
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
#include <QProgressDialog>
20
#include "ANTplusController.h"
21
#include "QuarqdClient.h"
22
#include "RealtimeData.h"
24
ANTplusController::ANTplusController(TrainTool *parent, DeviceConfiguration *dc) : RealtimeController(parent, dc)
26
myANTplus = new QuarqdClient (parent, dc);
31
ANTplusController::start()
39
ANTplusController::restart()
41
return myANTplus->restart();
46
ANTplusController::pause()
48
return myANTplus->pause();
53
ANTplusController::stop()
55
return myANTplus->stop();
60
ANTplusController::discover(QString)
62
return myANTplus->discover(QString);
66
bool ANTplusController::doesPush() { return false; }
67
bool ANTplusController::doesPull() { return true; }
68
bool ANTplusController::doesLoad() { return false; }
71
* gets called from the GUI to get updated telemetry.
72
* so whilst we are at it we check button status too and
77
ANTplusController::getRealtimeData(RealtimeData &rtData)
79
if(!myANTplus->isRunning())
82
msgBox.setText("Cannot Connect to Quarqd");
83
msgBox.setIcon(QMessageBox::Critical);
88
// get latest telemetry
89
rtData = myANTplus->getRealtimeData();
90
processRealtimeData(rtData);
93
void ANTplusController::pushRealtimeData(RealtimeData &) { } // update realtime data with current values