refs #369, revised FSUIPC

* removed own aircraft member
* split into read / write, removed process
This commit is contained in:
Klaus Basan
2015-02-01 20:47:00 +01:00
parent fe4613a868
commit 24e6dcef54
2 changed files with 41 additions and 51 deletions

View File

@@ -1,13 +1,18 @@
/* Copyright (C) 2013 VATSIM Community / contributors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Copyright (C) 2014
* swift project community / contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKSIMPLUGIN_FSUIPC_H
#define BLACKSIMPLUGIN_FSUIPC_H
#include "blackmisc/simulation/aircraftmodel.h"
#include "blackmisc/avaircraft.h"
#include "blackmisc/simulation/simulatedaircraft.h"
#include <QStringList>
namespace BlackSimPlugin
@@ -34,17 +39,14 @@ namespace BlackSimPlugin
//! Is connected?
bool isConnected() const { return m_connected; }
//! Valid read values
bool validReadValues() const { return m_validReadValues; }
//! Get own aircraft from FSUIPC
const BlackMisc::Aviation::CAircraft &getOwnAircraft() const { return m_aircraft; }
//! Process reading and writing variables
void process();
void process(BlackMisc::Simulation::CSimulatedAircraft &aircraft);
//! Write variables
void write();
bool write(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
//! Read data from FSUIPC
bool read(BlackMisc::Simulation::CSimulatedAircraft &aircraft);
//! Error messages
static const QStringList &errorMessages()
@@ -87,15 +89,9 @@ namespace BlackSimPlugin
static QString getMessageCategory() { return "swift.fscommon.fsuipc"; }
private:
bool m_connected;
bool m_validReadValues;
bool m_connected = false;
QString m_lastErrorMessage;
QString m_fsuipcVersion;
BlackMisc::Aviation::CAircraft m_aircraft; //!< FSUIPC read aircraft
BlackMisc::Simulation::CAircraftModel m_model; //!< FSUIPC read model
//! Read data from FSUIPC
void read();
//! Integer representing fractional
static double intToFractional(double fractional);