Skip to content

Commit

Permalink
[TASK] cleanup obsolete wind-/temp-related code (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaseberle committed May 29, 2023
1 parent 5891aed commit 1c89de4
Show file tree
Hide file tree
Showing 15 changed files with 3 additions and 14,200 deletions.
5 changes: 0 additions & 5 deletions QuteScoop.pro
Expand Up @@ -79,7 +79,6 @@ CONFIG(release,release|debug) {
dataFiles.files += ./data/firdisplay.dat
dataFiles.files += ./data/firlist.dat
dataFiles.files += ./data/airlines.dat
dataFiles.files += ./data/station.dat
downloadedFiles.path = $$DESTDIR/downloaded
downloadedFiles.files += ./downloaded/_notes.txt
screenshotsFiles.path = $$DESTDIR/screenshots
Expand Down Expand Up @@ -193,11 +192,9 @@ HEADERS += \
src/ListClientsDialog.h \
src/Ping.h \
src/GuiMessage.h \
src/Station.h \
src/Launcher.h \
src/SectorView.h \
src/Net.h \
src/SondeData.h \
src/JobList.h \
src/MetarDelegate.h \
src/Platform.h
Expand Down Expand Up @@ -249,11 +246,9 @@ SOURCES += src/WhazzupData.cpp \
src/ListClientsDialog.cpp \
src/Ping.cpp \
src/GuiMessage.cpp \
src/Station.cpp \
src/Launcher.cpp \
src/SectorView.cpp \
src/Net.cpp \
src/SondeData.cpp \
src/JobList.cpp \
src/MetarDelegate.cpp \
src/Platform.cpp
Expand Down
1 change: 0 additions & 1 deletion data/dataversions.txt
Expand Up @@ -6,4 +6,3 @@ countries.dat%%120
countrycodes.dat%%119
firdisplay.dat%%331
firlist.dat%%337
station.dat%%246
13,372 changes: 0 additions & 13,372 deletions data/station.dat

This file was deleted.

24 changes: 0 additions & 24 deletions src/GLWidget.cpp
Expand Up @@ -17,7 +17,6 @@
#include "AirportDetails.h"
#include "PilotDetails.h"
#include "Airac.h"
#include "SondeData.h"

//#include <GL/glext.h> // Multitexturing - not platform-independant
#include <algorithm>
Expand All @@ -31,7 +30,6 @@ GLWidget::GLWidget(QGLFormat fmt, QWidget *parent) :
_pilotsList(0), _activeAirportsList(0), _inactiveAirportsList(0), _fixesList(0),
_usedWaypointsList(0), _sectorPolygonsList(0), _sectorPolygonBorderLinesList(0),
_congestionsList(0),
_sondeLabelZoomTreshold(3.),
_pilotLabelZoomTreshold(.9),
_activeAirportLabelZoomTreshold(1.2), _inactiveAirportLabelZoomTreshold(.15),
_controllerLabelZoomTreshold(2.), _allWaypointsLabelZoomTreshold(.1),
Expand Down Expand Up @@ -1085,18 +1083,6 @@ void GLWidget::paintGL() {
}
}

// render Wind
if(Settings::showSonde()) {
// show wind arrows of altitudes near the selected one
for(quint8 span = 1; span <= Settings::sondeAltSecondarySpan_1k(); span++) {
glCallList(SondeData::instance()->
windArrows(Settings::sondeAlt_1k() - span, true));
glCallList(SondeData::instance()->
windArrows(Settings::sondeAlt_1k() + span, true));
}
glCallList(SondeData::instance()->windArrows(Settings::sondeAlt_1k()));
}

// render labels
renderLabels();

Expand Down Expand Up @@ -1473,16 +1459,6 @@ void GLWidget::renderLabels() {
Settings::pilotFontColor());
}

// temperatures and spreads
if (Settings::showSonde()) {
objects.clear();
foreach(Station *s, SondeData::instance()->stationList)
if (!s->mapLabel().isEmpty())
objects.append(s);
renderLabels(objects, Settings::sondeFont(), _sondeLabelZoomTreshold,
Settings::windColor().lighter(), Settings::windColor().darker(300));
}

// waypoints used in shown routes
if (Settings::showUsedWaypoints()) {
QSet<MapObject*> waypointObjects;
Expand Down
7 changes: 3 additions & 4 deletions src/GLWidget.h
Expand Up @@ -121,10 +121,9 @@ class GLWidget : public QGLWidget {
_staticSectorPolygonsList, _staticSectorPolygonBorderLinesList,
_hoveredSectorPolygonsList, _hoveredSectorPolygonBorderLinesList;
QSet<Controller*> _hoveredControllers;
double _sondeLabelZoomTreshold, _pilotLabelZoomTreshold,
_activeAirportLabelZoomTreshold, _inactiveAirportLabelZoomTreshold,
_controllerLabelZoomTreshold, _allWaypointsLabelZoomTreshold, _usedWaypointsLabelZoomThreshold,
_xRot, _yRot, _zRot, _zoom, _aspectRatio;
double _pilotLabelZoomTreshold, _activeAirportLabelZoomTreshold, _inactiveAirportLabelZoomTreshold,
_controllerLabelZoomTreshold, _allWaypointsLabelZoomTreshold, _usedWaypointsLabelZoomThreshold,
_xRot, _yRot, _zRot, _zoom, _aspectRatio;
QTimer *_highlighter;
QList< QPair<double , double> > m_friendPositions;
};
Expand Down
9 changes: 0 additions & 9 deletions src/Launcher.cpp
Expand Up @@ -3,7 +3,6 @@
**************************************************************************/

#include "Launcher.h"
#include "SondeData.h"
#include "JobList.h"
#include "Net.h"
#include "Airac.h"
Expand Down Expand Up @@ -165,14 +164,6 @@ void Launcher::fireUp() {
));
}

if (Settings::showSonde()) {
jobs->append(JobList::Job(
SondeData::instance(),
SLOT(load()),
SIGNAL(loaded())
));
}

jobs->start();
qDebug() << "Launcher::fireUp() finished";
}
Expand Down
42 changes: 0 additions & 42 deletions src/PreferencesDialog.cpp
Expand Up @@ -4,7 +4,6 @@

#include "PreferencesDialog.h"
#include "Settings.h"
#include "SondeData.h"
#include "Window.h"

//singleton instance
Expand Down Expand Up @@ -172,12 +171,6 @@ void PreferencesDialog::loadSettings() {
pbFirHighlightedFillColor->setText(color.name());
pbFirHighlightedFillColor->setPalette(QPalette(color));

color = Settings::windColor();
pbUpperWindColor->setText(color.name());
pbUpperWindColor->setPalette(QPalette(color));
sbWindSize->setValue(Settings::windArrowSize());
sbWindSecondarySpan->setValue(Settings::sondeAltSecondarySpan_1k());

// airport traffic settings
cbFilterTraffic->setChecked(Settings::filterTraffic());
spFilterDistance->setValue(Settings::filterDistance());
Expand Down Expand Up @@ -1241,21 +1234,6 @@ void PreferencesDialog::on_useSelectionRectangle_toggled(bool checked) {
Settings::setUseSelctionRectangle(checked);
}

void PreferencesDialog::on_pbUpperWindColor_clicked() {
QColor color = QColorDialog::getColor(Settings::windColor(), this,
"Select color", QColorDialog::ShowAlphaChannel);
if(color.isValid()) {
pbUpperWindColor->setText(color.name());
pbUpperWindColor->setPalette(QPalette(color));
Settings::setWindColor(color);
if (SondeData::instance(false) != 0) {
SondeData::instance()->invalidateWindLists();
if (Window::instance(false) != 0)
Window::instance()->mapScreen->glWidget->update();
}
}
}

void PreferencesDialog::closeEvent(QCloseEvent *event) {
Settings::setPreferencesDialogSize(size());
Settings::setPreferencesDialogPos(pos());
Expand Down Expand Up @@ -1297,23 +1275,3 @@ void PreferencesDialog::on_cbRememberMapPositionOnClose_toggled(bool checked) {
return;
Settings::setRememberMapPositionOnClose(checked);
}

void PreferencesDialog::on_sbWindSize_valueChanged(int factor) {
if (!_settingsLoaded)
return;
Settings::setWindArrowSize(factor);
if (SondeData::instance(false) != 0) {
SondeData::instance()->invalidateWindLists();
if (Window::instance(false) != 0)
Window::instance()->mapScreen->glWidget->update();
}
}

void PreferencesDialog::on_sbWindSecondarySpan_valueChanged(int value) {
if (!_settingsLoaded)
return;
Settings::setSondeAltSecondarySpan_1k(value);
if (Window::instance(false) != 0)
Window::instance()->mapScreen->glWidget->update();
}

3 changes: 0 additions & 3 deletions src/PreferencesDialog.h
Expand Up @@ -69,7 +69,6 @@ class PreferencesDialog: public QDialog, public Ui::PreferencesDialog {
void on_cbLineSmoothing_stateChanged(int state);
void on_cbDotSmoothing_stateChanged(int state);
void on_sbMaxTextLabels_valueChanged(int value);
void on_pbUpperWindColor_clicked();
void on_editNavdir_editingFinished();
void on_browseNavdirButton_clicked();
void on_cbUseNavDatabase_stateChanged(int state);
Expand Down Expand Up @@ -138,8 +137,6 @@ class PreferencesDialog: public QDialog, public Ui::PreferencesDialog {
void on_useSelectionRectangle_toggled(bool checked);
void on_cbSimpleLabels_toggled(bool checked);
void on_cbRememberMapPositionOnClose_toggled(bool checked);
void on_sbWindSize_valueChanged(int factor);
void on_sbWindSecondarySpan_valueChanged(int value);

private:
PreferencesDialog(QWidget *parent);
Expand Down
113 changes: 0 additions & 113 deletions src/PreferencesDialog.ui
Expand Up @@ -753,119 +753,6 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<widget class="QWidget" name="tabWeather">
<attribute name="title">
<string>Weather</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_17">
<item>
<widget class="QGroupBox" name="groupBox_6">
<property name="title">
<string>Sonde Data: Temperature [not yet shown], Dewpoint/Spread [not yet shown] &amp;&amp; Wind by altitude</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_16">
<item>
<widget class="QLabel" name="label_42">
<property name="text">
<string>&lt;i&gt;will be downloaded when needed&lt;/i&gt;</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_17">
<item>
<widget class="QLabel" name="label_40">
<property name="text">
<string>wind arrows</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pbUpperWindColor">
<property name="toolTip">
<string>default color of the windflags</string>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_43">
<property name="text">
<string>size factor</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="sbWindSize">
<property name="prefix">
<string>× </string>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>99999</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_48">
<property name="text">
<string>show adjacent altitudes</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="sbWindSecondarySpan">
<property name="specialValueText">
<string>n/a</string>
</property>
<property name="suffix">
<string>000ft</string>
</property>
<property name="prefix">
<string>+/- </string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_21">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>454</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabDisp1">
<attribute name="title">
<string>Display (general)</string>
Expand Down

0 comments on commit 1c89de4

Please sign in to comment.