Skip to content

Commit

Permalink
refactor: Remove remaining ATC booking parts
Browse files Browse the repository at this point in the history
Related to #252
  • Loading branch information
ltoenning committed Jan 30, 2024
1 parent d954a94 commit 332c2ed
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 58 deletions.
1 change: 0 additions & 1 deletion src/blackcore/airspacemonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ namespace BlackCore
connect(m_fsdClient, &CFSDClient::connectionStatusChanged, this, &CAirspaceMonitor::onConnectionStatusChanged);
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");

if (this->supportsVatsimDataFile())
Expand Down
2 changes: 1 addition & 1 deletion src/blackcore/vatsim/vatsimmetarreader.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace BlackCore::Vatsim
//! Constructor
explicit CVatsimMetarReader(QObject *owner);

//! Read / re-read bookings
//! Read / re-read metars
void readInBackgroundThread();

//! Get METARs
Expand Down
21 changes: 0 additions & 21 deletions src/blackcore/vatsim/vatsimsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
struct TVatsimDataFile : public BlackMisc::TSettingTrait<CReaderSettings>
{
Expand Down
1 change: 0 additions & 1 deletion src/blackcore/webdataservices.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ namespace BlackCore

namespace Vatsim
{
class CVatsimBookingReader;
class CVatsimDataFileReader;
class CVatsimMetarReader;
class CVatsimStatusFileReader;
Expand Down
8 changes: 0 additions & 8 deletions src/blackgui/components/settingsvatsimreaderscomponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,13 @@ namespace BlackGui::Components
void CSettingsVatsimReadersComponent::save()
{
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 newMetarSec = ui->sb_Metar->value();
if (newMetarSec != metarSec)
{
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();
if (newDataFileSec != dataFileSec)
{
Expand All @@ -59,11 +53,9 @@ namespace BlackGui::Components
void CSettingsVatsimReadersComponent::initValues()
{
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;

ui->sb_Metar->setValue(metarSec);
ui->sb_Bookings->setValue(bookingsSec);
ui->sb_DataFile->setValue(dataFileSec);
}
} // ns
1 change: 0 additions & 1 deletion src/blackgui/components/settingsvatsimreaderscomponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ namespace BlackGui::Components
void initValues();

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::TVatsimMetars> m_settingsMetars { this, &CSettingsVatsimReadersComponent::onSettingsChanged };
};
Expand Down
25 changes: 1 addition & 24 deletions src/blackgui/components/settingsvatsimreaderscomponent.ui
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,7 @@
</property>
</widget>
</item>
<item row="2" column="0">
<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">
<item row="2" column="0" colspan="2">
<widget class="QWidget" name="wi_Buttons" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
Expand Down
2 changes: 1 addition & 1 deletion tests/blackcore/testreaders/testreaders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ using namespace BlackCore::Db;

namespace BlackCoreTest
{
//! Test data readers (for bookings, JSON, etc.)
//! Test data readers (for ICAOs, JSON, etc.)
class CTestReaders : public QObject
{
Q_OBJECT
Expand Down

0 comments on commit 332c2ed

Please sign in to comment.