Skip to content

Commit

Permalink
Fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vranki committed May 28, 2018
1 parent 2cd6948 commit f0982fd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ SimulatedDataRef::SimulatedDataRef(QObject *parent,
QObject(parent)
, minValue(minV)
, maxValue(maxV)
, change((maxValue - minValue)/changeDivisor)
, currentValue(minV)
, actualCurrentValue(minV)
, change((maxValue - minValue)/changeDivisor)
, round(round)
, arrayCount(arrayCount)
, myClientRef(nullptr, refName, 0)
Expand All @@ -25,9 +25,7 @@ SimulatedDataRef::SimulatedDataRef(QObject *parent,
changeTimer.start();
}

SimulatedDataRef::~SimulatedDataRef() {

}
SimulatedDataRef::~SimulatedDataRef() { }

void SimulatedDataRef::tickTime(double dt, int total) {
Q_UNUSED(total);
Expand Down
18 changes: 11 additions & 7 deletions extplane-transformer/datasources/flightgeardatasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include "../extplane-server/datarefs/floatdataref.h"

FlightGearDataSource::FlightGearDataSource() : DataSource() {
connect(&tcpClient, &BasicTcpClient::tcpClientConnected,
this, &FlightGearDataSource::sessionOpened);
connect(&tcpClient, &BasicTcpClient::connectedChanged,
this, &FlightGearDataSource::connectedChanged);
connect(&tcpClient, &BasicTcpClient::receivedLine,
this, &FlightGearDataSource::readLine);
connect(&tcpClient, &BasicTcpClient::networkError,
Expand Down Expand Up @@ -34,7 +34,9 @@ FlightGearDataSource::FlightGearDataSource() : DataSource() {

void FlightGearDataSource::connectToSource() {
setNetworkError(QString());
tcpClient.startConnection("localhost" , 5401);
tcpClient.setHostName("localhost");
tcpClient.setPort(5401);
tcpClient.startConnection();
}

DataRef *FlightGearDataSource::subscribeRef(QString &name)
Expand Down Expand Up @@ -79,11 +81,13 @@ void FlightGearDataSource::command(QString &name, extplaneCommandType type)
bool FlightGearDataSource::loadSituation(QString sitFileLocation)
{}

void FlightGearDataSource::sessionOpened()
void FlightGearDataSource::connectedChanged(bool connected)
{
setNetworkError(QString());
setHelpText(QString("Connected to FlightGear at %1:%2").arg(tcpClient.hostName()).arg(tcpClient.port()));
tcpClient.writeLine("data");
if(connected) {
setNetworkError(QString());
setHelpText(QString("Connected to FlightGear at %1:%2").arg(tcpClient.hostName()).arg(tcpClient.port()));
tcpClient.writeLine("data");
}
}

void FlightGearDataSource::readLine(QString line)
Expand Down
2 changes: 1 addition & 1 deletion extplane-transformer/datasources/flightgeardatasource.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class FlightGearDataSource : public DataSource
//

private slots:
void sessionOpened();
void connectedChanged(bool connected);
void readLine(QString line);
void gotNetworkError(QString errstring);

Expand Down

0 comments on commit f0982fd

Please sign in to comment.