mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Filter: extend range of allowed temperatures
The temperature range 0-100 was inadequate in both supported scales (Celsius and Fahrenheit). Extend the range to encompass all physically meaningful values in both scales. Use the default-values to set the minimum and maximum of the UI-fields. Thus, these values are configurable in a single place. In the future we should use a scale-independent representation (e.g. mkelvin as in the rest of the code base). But this would mean implementing a custom widget with a conversion function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
b28e0bf0b9
commit
1470048773
2 changed files with 14 additions and 4 deletions
|
@ -10,6 +10,13 @@ FilterWidget2::FilterWidget2(QWidget* parent) : QWidget(parent)
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
FilterData data;
|
FilterData data;
|
||||||
|
|
||||||
|
// Use default values to set minimum and maximum air and water temperature.
|
||||||
|
ui.minAirTemp->setRange(data.minAirTemp, data.maxAirTemp);
|
||||||
|
ui.maxAirTemp->setRange(data.minAirTemp, data.maxAirTemp);
|
||||||
|
ui.minWaterTemp->setRange(data.minWaterTemp, data.maxWaterTemp);
|
||||||
|
ui.maxWaterTemp->setRange(data.minWaterTemp, data.maxWaterTemp);
|
||||||
|
|
||||||
ui.minRating->setCurrentStars(data.minRating);
|
ui.minRating->setCurrentStars(data.minRating);
|
||||||
ui.maxRating->setCurrentStars(data.maxRating);
|
ui.maxRating->setCurrentStars(data.maxRating);
|
||||||
ui.minVisibility->setCurrentStars(data.minVisibility);
|
ui.minVisibility->setCurrentStars(data.minVisibility);
|
||||||
|
|
|
@ -20,10 +20,13 @@ struct FilterData {
|
||||||
int maxVisibility = 5;
|
int maxVisibility = 5;
|
||||||
int minRating = 0;
|
int minRating = 0;
|
||||||
int maxRating = 5;
|
int maxRating = 5;
|
||||||
double minWaterTemp = 0;
|
// The default minimum and maximum temperatures are set such that all
|
||||||
double maxWaterTemp = 100;
|
// physically reasonable dives are shown. Note that these values should
|
||||||
double minAirTemp = 0;
|
// work for both Celcius and Fahrenheit scales.
|
||||||
double maxAirTemp = 100;
|
double minWaterTemp = -10;
|
||||||
|
double maxWaterTemp = 200;
|
||||||
|
double minAirTemp = -50;
|
||||||
|
double maxAirTemp = 200;
|
||||||
QDateTime fromDate;
|
QDateTime fromDate;
|
||||||
QTime fromTime;
|
QTime fromTime;
|
||||||
QDateTime toDate = QDateTime::currentDateTime();
|
QDateTime toDate = QDateTime::currentDateTime();
|
||||||
|
|
Loading…
Add table
Reference in a new issue