mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 05:28:09 +08:00
refs #369, changed for own aircraft provider
* CLI client * test network * GUI/GUI components
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user