1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Got rid of some compiler warnings, and fixed a few whitespaces.

This commit is contained in:
Kenz Dale 2012-08-23 17:14:21 +02:00
parent 05f131fa46
commit 05db4c64b1
4 changed files with 54 additions and 47 deletions

View File

@ -63,6 +63,8 @@ FGSimulator::~FGSimulator()
void FGSimulator::setupUdpPorts(const QString& host, int inPort, int outPort) void FGSimulator::setupUdpPorts(const QString& host, int inPort, int outPort)
{ {
Q_UNUSED(outPort);
if(inSocket->bind(QHostAddress(host), inPort)) if(inSocket->bind(QHostAddress(host), inPort))
emit processOutput("Successfully bound to address " + host + " on port " + QString::number(inPort) + "\n"); emit processOutput("Successfully bound to address " + host + " on port " + QString::number(inPort) + "\n");
else else

View File

@ -96,10 +96,11 @@ IL2Simulator::~IL2Simulator()
void IL2Simulator::setupUdpPorts(const QString& host, int inPort, int outPort) void IL2Simulator::setupUdpPorts(const QString& host, int inPort, int outPort)
{ {
inSocket->connectToHost(host,inPort); // IL2 Q_UNUSED(outPort);
if(!inSocket->waitForConnected())
qxtLog->error(Name() + " cann't connect to UDP Port: " + QString::number(inPort));
inSocket->connectToHost(host,inPort); // IL2
if(!inSocket->waitForConnected())
qxtLog->error(Name() + " cann't connect to UDP Port: " + QString::number(inPort));
} }
void IL2Simulator::transmitUpdate() void IL2Simulator::transmitUpdate()

View File

@ -173,53 +173,55 @@ struct Output2OP{
class Simulator : public QObject class Simulator : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
Simulator(const SimulatorSettings& params); Simulator(const SimulatorSettings& params);
virtual ~Simulator(); virtual ~Simulator();
bool isAutopilotConnected() const { return autopilotConnectionStatus; } bool isAutopilotConnected() const { return autopilotConnectionStatus; }
bool isSimulatorConnected() const { return simConnectionStatus; } bool isSimulatorConnected() const { return simConnectionStatus; }
QString Name() const { return name; } QString Name() const { return name; }
void setName(QString str) { name = str; } void setName(QString str) { name = str; }
QString SimulatorId() const { return simulatorId; } QString SimulatorId() const { return simulatorId; }
void setSimulatorId(QString str) { simulatorId = str; } void setSimulatorId(QString str) { simulatorId = str; }
static bool IsStarted() { return isStarted; } static bool IsStarted() { return isStarted; }
static void setStarted(bool val) { isStarted = val; } static void setStarted(bool val) { isStarted = val; }
static QStringList& Instances() { return Simulator::instances; } static QStringList& Instances() { return Simulator::instances; }
static void setInstance(const QString& str) { Simulator::instances.append(str); } static void setInstance(const QString& str) { Simulator::instances.append(str); }
virtual void stopProcess() {}
virtual void setupUdpPorts(const QString& host, int inPort, int outPort) { Q_UNUSED(host) Q_UNUSED(inPort) Q_UNUSED(outPort)} virtual void setupUdpPorts(const QString& host, int inPort, int outPort) { Q_UNUSED(host) Q_UNUSED(inPort) Q_UNUSED(outPort)}
void resetInitialHomePosition(); void resetInitialHomePosition();
void updateUAVOs(Output2OP out); void updateUAVOs(Output2OP out);
signals: signals:
void autopilotConnected(); void autopilotConnected();
void autopilotDisconnected(); void autopilotDisconnected();
void simulatorConnected(); void simulatorConnected();
void simulatorDisconnected(); void simulatorDisconnected();
void processOutput(QString str); void processOutput(QString str);
void deleteSimProcess(); void deleteSimProcess();
void myStart(); void myStart();
public slots: public slots:
Q_INVOKABLE virtual bool setupProcess() { return true;} Q_INVOKABLE virtual bool setupProcess() { return true;}
private slots: private slots:
void onStart(); void onStart();
//void transmitUpdate(); //void transmitUpdate();
void receiveUpdate(); void receiveUpdate();
void onAutopilotConnect(); void onAutopilotConnect();
void onAutopilotDisconnect(); void onAutopilotDisconnect();
void onSimulatorConnectionTimeout(); void onSimulatorConnectionTimeout();
void telStatsUpdated(UAVObject* obj); void telStatsUpdated(UAVObject* obj);
Q_INVOKABLE void onDeleteSimulator(void); Q_INVOKABLE void onDeleteSimulator(void);
virtual void transmitUpdate() = 0; virtual void transmitUpdate() = 0;
virtual void processUpdate(const QByteArray& data) = 0; virtual void processUpdate(const QByteArray& data) = 0;
protected: protected:
static const float GEE; static const float GEE;
@ -291,20 +293,20 @@ private:
class SimulatorCreator class SimulatorCreator
{ {
public: public:
SimulatorCreator(QString id, QString descr) : SimulatorCreator(QString id, QString descr) :
classId(id), classId(id),
description(descr) description(descr)
{} {}
virtual ~SimulatorCreator() {} virtual ~SimulatorCreator() {}
QString ClassId() const {return classId;} QString ClassId() const {return classId;}
QString Description() const {return description;} QString Description() const {return description;}
virtual Simulator* createSimulator(const SimulatorSettings& params) = 0; virtual Simulator* createSimulator(const SimulatorSettings& params) = 0;
private: private:
QString classId; QString classId;
QString description; QString description;
}; };
#endif // ISIMULATOR_H #endif // ISIMULATOR_H

View File

@ -78,9 +78,11 @@ XplaneSimulator::~XplaneSimulator()
void XplaneSimulator::setupUdpPorts(const QString& host, int inPort, int outPort) void XplaneSimulator::setupUdpPorts(const QString& host, int inPort, int outPort)
{ {
inSocket->bind(QHostAddress(host), inPort); Q_UNUSED(outPort);
//outSocket->bind(QHostAddress(host), outPort);
once = false; inSocket->bind(QHostAddress(host), inPort);
//outSocket->bind(QHostAddress(host), outPort);
once = false;
} }