refs #369, changed for own aircraft provider

* CLI client
* test network
* GUI/GUI components
This commit is contained in:
Klaus Basan
2015-02-01 20:52:50 +01:00
parent 1b04205584
commit 880bb53e3d
7 changed files with 74 additions and 71 deletions

View File

@@ -255,7 +255,7 @@ namespace BlackGui
{
if (unit != CComSystem::Com1 && unit != CComSystem::Com2) { return; }
if (!CComSystem::isValidComFrequency(frequency)) { return; }
this->getIContextOwnAircraft()->updateComFrequency(frequency, static_cast<int>(unit), originator());
this->getIContextOwnAircraft()->updateActiveComFrequency(frequency, static_cast<int>(unit), originator());
}
void CAtcStationComponent::updateTreeView()

View File

@@ -183,8 +183,8 @@ namespace BlackGui
ownAircraft.setCallsign(aircraftValues.ownCallsign);
// set latest ICAO, callsign
this->getIContextOwnAircraft()->updateIcaoData(ownAircraft.getIcaoInfo(), loginOriginator());
this->getIContextOwnAircraft()->updateCallsign(ownAircraft.getCallsign(), loginOriginator());
this->getIContextOwnAircraft()->updateIcaoData(ownAircraft.getIcaoInfo());
this->getIContextOwnAircraft()->updateCallsign(ownAircraft.getCallsign());
// Login mode
INetwork::LoginMode mode = ui->gbp_LoginMode->getLoginMode();
@@ -214,7 +214,7 @@ namespace BlackGui
currentServer = this->getCurrentOtherServer();
}
this->ui->frp_CurrentServer->setServer(currentServer);
this->getIContextOwnAircraft()->updatePilot(currentServer.getUser(), loginOriginator());
this->getIContextOwnAircraft()->updatePilot(currentServer.getUser());
// Login
msg = this->getIContextNetwork()->connectToNetwork(currentServer, static_cast<uint>(mode));
@@ -338,7 +338,7 @@ namespace BlackGui
bool simConnected = this->getIContextSimulator() && this->getIContextSimulator()->isSimulating();
if (simConnected)
{
CAircraftModel model = this->getIContextSimulator()->getOwnAircraftModel();
CAircraftModel model = this->getIContextOwnAircraft()->getOwnAircraft().getModel();
this->ui->le_SimulatorModel->setText(model.getModelString());
this->setIcaoValuesIfEmpty(model.getIcao());
@@ -437,13 +437,5 @@ namespace BlackGui
}
}
const QString &CLoginComponent::loginOriginator()
{
// string is generated once, the timestamp allows to use multiple
// components (as long as they are not generated at the same ms)
static const QString o = QString("LOGINCOMCOMPONENT:").append(QString::number(QDateTime::currentMSecsSinceEpoch()));
return o;
}
} // namespace
} // namespace

View File

@@ -139,9 +139,6 @@ namespace BlackGui
//! Set ICAO values if fields are empty
void setIcaoValuesIfEmpty(const BlackMisc::Aviation::CAircraftIcao &icao);
//! Identifies sender of cockpit updates
static const QString &loginOriginator();
bool m_visible = false; //!< is this component selected?
QScopedPointer<Ui::CLoginComponent> ui;
const int LogoffIntervalSeconds = 10;

View File

@@ -52,5 +52,5 @@ void SwiftGuiStd::setTestPosition(const QString &wgsLatitude, const QString &wgs
this->m_ownAircraft.setPosition(coordinate);
this->m_ownAircraft.setAltitude(altitude);
this->getIContextOwnAircraft()->updatePosition(coordinate, altitude, SwiftGuiStd::swiftGuiStandardOriginator());
this->getIContextOwnAircraft()->updatePosition(coordinate, altitude);
}