mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
@@ -90,7 +90,6 @@ namespace BlackCore
|
|||||||
connect(m_fsdClient, &CFSDClient::connectionStatusChanged, this, &CAirspaceMonitor::onConnectionStatusChanged);
|
connect(m_fsdClient, &CFSDClient::connectionStatusChanged, this, &CAirspaceMonitor::onConnectionStatusChanged);
|
||||||
connect(m_fsdClient, &CFSDClient::revbAircraftConfigReceived, this, &CAirspaceMonitor::onRevBAircraftConfigReceived);
|
connect(m_fsdClient, &CFSDClient::revbAircraftConfigReceived, this, &CAirspaceMonitor::onRevBAircraftConfigReceived);
|
||||||
|
|
||||||
// AutoConnection: this should also avoid race conditions by updating the bookings
|
|
||||||
Q_ASSERT_X(sApp && sApp->hasWebDataServices(), Q_FUNC_INFO, "Missing data reader");
|
Q_ASSERT_X(sApp && sApp->hasWebDataServices(), Q_FUNC_INFO, "Missing data reader");
|
||||||
|
|
||||||
if (this->supportsVatsimDataFile())
|
if (this->supportsVatsimDataFile())
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace BlackCore::Vatsim
|
|||||||
//! Constructor
|
//! Constructor
|
||||||
explicit CVatsimMetarReader(QObject *owner);
|
explicit CVatsimMetarReader(QObject *owner);
|
||||||
|
|
||||||
//! Read / re-read bookings
|
//! Read / re-read metars
|
||||||
void readInBackgroundThread();
|
void readInBackgroundThread();
|
||||||
|
|
||||||
//! Get METARs
|
//! Get METARs
|
||||||
|
|||||||
@@ -80,27 +80,6 @@ namespace BlackCore::Vatsim
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Reader settings
|
|
||||||
struct TVatsimBookings : public BlackMisc::TSettingTrait<CReaderSettings>
|
|
||||||
{
|
|
||||||
//! \copydoc BlackMisc::TSettingTrait::key
|
|
||||||
static const char *key() { return "vatsimreaders/bookings"; }
|
|
||||||
|
|
||||||
//! \copydoc BlackMisc::TSettingTrait::humanReadable
|
|
||||||
static const QString &humanReadable()
|
|
||||||
{
|
|
||||||
static const QString name("VATSIM bookings");
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! \copydoc BlackMisc::TSettingTrait::defaultValue
|
|
||||||
static const BlackCore::Vatsim::CReaderSettings &defaultValue()
|
|
||||||
{
|
|
||||||
static const BlackCore::Vatsim::CReaderSettings reader { { 30.0, BlackMisc::PhysicalQuantities::CTimeUnit::s() }, { 600.0, BlackMisc::PhysicalQuantities::CTimeUnit::s() } };
|
|
||||||
return reader;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//! Reader settings
|
//! Reader settings
|
||||||
struct TVatsimDataFile : public BlackMisc::TSettingTrait<CReaderSettings>
|
struct TVatsimDataFile : public BlackMisc::TSettingTrait<CReaderSettings>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ namespace BlackCore
|
|||||||
|
|
||||||
namespace Vatsim
|
namespace Vatsim
|
||||||
{
|
{
|
||||||
class CVatsimBookingReader;
|
|
||||||
class CVatsimDataFileReader;
|
class CVatsimDataFileReader;
|
||||||
class CVatsimMetarReader;
|
class CVatsimMetarReader;
|
||||||
class CVatsimStatusFileReader;
|
class CVatsimStatusFileReader;
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ namespace BlackGui::Components
|
|||||||
void CSettingsVatsimReadersComponent::save()
|
void CSettingsVatsimReadersComponent::save()
|
||||||
{
|
{
|
||||||
const int metarSec = m_settingsMetars.get().getPeriodicTime().toMs() / 1000;
|
const int metarSec = m_settingsMetars.get().getPeriodicTime().toMs() / 1000;
|
||||||
const int bookingsSec = m_settingsBookings.get().getPeriodicTime().toMs() / 1000;
|
|
||||||
const int dataFileSec = m_settingsDataFile.get().getPeriodicTime().toMs() / 1000;
|
const int dataFileSec = m_settingsDataFile.get().getPeriodicTime().toMs() / 1000;
|
||||||
|
|
||||||
const int newMetarSec = ui->sb_Metar->value();
|
const int newMetarSec = ui->sb_Metar->value();
|
||||||
@@ -39,11 +38,6 @@ namespace BlackGui::Components
|
|||||||
{
|
{
|
||||||
m_settingsMetars.setAndSaveProperty(CReaderSettings::IndexPeriodicTime, CVariant::fromValue(CTime { static_cast<double>(newMetarSec), CTimeUnit::s() }));
|
m_settingsMetars.setAndSaveProperty(CReaderSettings::IndexPeriodicTime, CVariant::fromValue(CTime { static_cast<double>(newMetarSec), CTimeUnit::s() }));
|
||||||
}
|
}
|
||||||
const int newBookingsSec = ui->sb_Bookings->value();
|
|
||||||
if (newBookingsSec != bookingsSec)
|
|
||||||
{
|
|
||||||
m_settingsBookings.setAndSaveProperty(CReaderSettings::IndexPeriodicTime, CVariant::fromValue(CTime { static_cast<double>(newBookingsSec), CTimeUnit::s() }));
|
|
||||||
}
|
|
||||||
const int newDataFileSec = ui->sb_DataFile->value();
|
const int newDataFileSec = ui->sb_DataFile->value();
|
||||||
if (newDataFileSec != dataFileSec)
|
if (newDataFileSec != dataFileSec)
|
||||||
{
|
{
|
||||||
@@ -59,11 +53,9 @@ namespace BlackGui::Components
|
|||||||
void CSettingsVatsimReadersComponent::initValues()
|
void CSettingsVatsimReadersComponent::initValues()
|
||||||
{
|
{
|
||||||
const int metarSec = m_settingsMetars.get().getPeriodicTime().toMs() / 1000;
|
const int metarSec = m_settingsMetars.get().getPeriodicTime().toMs() / 1000;
|
||||||
const int bookingsSec = m_settingsBookings.get().getPeriodicTime().toMs() / 1000;
|
|
||||||
const int dataFileSec = m_settingsDataFile.get().getPeriodicTime().toMs() / 1000;
|
const int dataFileSec = m_settingsDataFile.get().getPeriodicTime().toMs() / 1000;
|
||||||
|
|
||||||
ui->sb_Metar->setValue(metarSec);
|
ui->sb_Metar->setValue(metarSec);
|
||||||
ui->sb_Bookings->setValue(bookingsSec);
|
|
||||||
ui->sb_DataFile->setValue(dataFileSec);
|
ui->sb_DataFile->setValue(dataFileSec);
|
||||||
}
|
}
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ namespace BlackGui::Components
|
|||||||
void initValues();
|
void initValues();
|
||||||
|
|
||||||
QScopedPointer<Ui::CSettingsVatsimReadersComponent> ui;
|
QScopedPointer<Ui::CSettingsVatsimReadersComponent> ui;
|
||||||
BlackMisc::CSetting<BlackCore::Vatsim::TVatsimBookings> m_settingsBookings { this, &CSettingsVatsimReadersComponent::onSettingsChanged };
|
|
||||||
BlackMisc::CSetting<BlackCore::Vatsim::TVatsimDataFile> m_settingsDataFile { this, &CSettingsVatsimReadersComponent::onSettingsChanged };
|
BlackMisc::CSetting<BlackCore::Vatsim::TVatsimDataFile> m_settingsDataFile { this, &CSettingsVatsimReadersComponent::onSettingsChanged };
|
||||||
BlackMisc::CSetting<BlackCore::Vatsim::TVatsimMetars> m_settingsMetars { this, &CSettingsVatsimReadersComponent::onSettingsChanged };
|
BlackMisc::CSetting<BlackCore::Vatsim::TVatsimMetars> m_settingsMetars { this, &CSettingsVatsimReadersComponent::onSettingsChanged };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -66,30 +66,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="lbl_Bookings">
|
|
||||||
<property name="text">
|
|
||||||
<string>Bookings (secs.)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QSpinBox" name="sb_Bookings">
|
|
||||||
<property name="minimum">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>500</number>
|
|
||||||
</property>
|
|
||||||
<property name="singleStep">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>30</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="2">
|
|
||||||
<widget class="QWidget" name="wi_Buttons" native="true">
|
<widget class="QWidget" name="wi_Buttons" native="true">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ using namespace BlackCore::Db;
|
|||||||
|
|
||||||
namespace BlackCoreTest
|
namespace BlackCoreTest
|
||||||
{
|
{
|
||||||
//! Test data readers (for bookings, JSON, etc.)
|
//! Test data readers (for ICAOs, JSON, etc.)
|
||||||
class CTestReaders : public QObject
|
class CTestReaders : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|||||||
Reference in New Issue
Block a user