Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/jakarta' into build/jakarta/2020.330
Browse files Browse the repository at this point in the history
  • Loading branch information
gempa-jabe committed May 3, 2021
2 parents 59d741c + 41fc2e7 commit cdd0917
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 24 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Jakarta

## Release 2020.330 patch7

* GUI

* Fix picker settings with Qt5 which set preOffset
and postOffset always to zero after accepting or
saving the settings

## Release 2020.330 patch6

* slmon
Expand Down
48 changes: 26 additions & 22 deletions src/gui-qt4/libs/seiscomp3/gui/datamodel/pickersettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,11 @@ PickerSettings::PickerSettings(const OriginLocatorView::Config &c1,
_ui.cbRemoveAllAutomaticPicks->setChecked(_pickerConfig.removeAutomaticPicks);

_ui.cbUsePerStreamTimeWindow->setChecked(_pickerConfig.usePerStreamTimeWindows);
_ui.preTimeEdit->setTime(QTime().addSecs(_pickerConfig.preOffset.seconds()));
_ui.postTimeEdit->setTime(QTime().addSecs(_pickerConfig.postOffset.seconds()));
_ui.minimumLengthTimeEdit->setTime(QTime().addSecs(_pickerConfig.minimumTimeWindow.seconds()));
_ui.preTimeEdit->setTime(QTime(0, 0, 0, 0).addSecs(_pickerConfig.preOffset.seconds()));
adjustPreSlider(_ui.preTimeEdit->time());
_ui.postTimeEdit->setTime(QTime(0, 0, 0, 0).addSecs(_pickerConfig.postOffset.seconds()));
adjustPostSlider(_ui.postTimeEdit->time());
_ui.minimumLengthTimeEdit->setTime(QTime(0, 0, 0, 0).addSecs(_pickerConfig.minimumTimeWindow.seconds()));

_ui.slWaveformAlignment->setValue(_pickerConfig.alignmentPosition*100);
_ui.waveformAlignmentEdit->setValue(_pickerConfig.alignmentPosition*100);
Expand All @@ -264,8 +266,10 @@ PickerSettings::PickerSettings(const OriginLocatorView::Config &c1,

_ui.editRecordSource->setText(_pickerConfig.recordURL);

_ui.preAmplitudeTimeEdit->setTime(QTime().addSecs(_amplitudeConfig.preOffset.seconds()));
_ui.postAmplitudeTimeEdit->setTime(QTime().addSecs(_amplitudeConfig.postOffset.seconds()));
_ui.preAmplitudeTimeEdit->setTime(QTime(0, 0, 0, 0).addSecs(_amplitudeConfig.preOffset.seconds()));
adjustAmplitudePreSlider(_ui.preAmplitudeTimeEdit->time());
_ui.postAmplitudeTimeEdit->setTime(QTime(0, 0, 0, 0).addSecs(_amplitudeConfig.postOffset.seconds()));
adjustAmplitudePostSlider(_ui.postAmplitudeTimeEdit->time());

QFont font;

Expand Down Expand Up @@ -294,12 +298,12 @@ PickerSettings::PickerSettings(const OriginLocatorView::Config &c1,
_ui.labelPickUncertainties->setEnabled(_ui.listPickUncertainties->count() > 0);

if ( _pickerConfig.repickerSignalStart ) {
_ui.cbRepickerStart->setChecked(Qt::Checked);
_ui.cbRepickerStart->setChecked(true);
_ui.editRepickerStart->setValue(*_pickerConfig.repickerSignalStart);
}

if ( _pickerConfig.repickerSignalEnd ) {
_ui.cbRepickerEnd->setChecked(Qt::Checked);
_ui.cbRepickerEnd->setChecked(true);
_ui.editRepickerEnd->setValue(*_pickerConfig.repickerSignalEnd);
}

Expand Down Expand Up @@ -333,56 +337,56 @@ bool PickerSettings::saveSettings() const {


void PickerSettings::adjustPreTime(int value) {
_ui.preTimeEdit->setTime(QTime().addSecs(_ui.slPreOffset->value()*60));
_ui.preTimeEdit->setTime(QTime(0, 0, 0, 0).addSecs(value*60));
}


void PickerSettings::adjustPostTime(int value) {
_ui.postTimeEdit->setTime(QTime().addSecs(_ui.slPostOffset->value()*60));
_ui.postTimeEdit->setTime(QTime(0, 0, 0, 0).addSecs(value*60));
}


void PickerSettings::adjustLength(int value) {
_ui.minimumLengthTimeEdit->setTime(QTime().addSecs(_ui.slMinimumLength->value()*60));
_ui.minimumLengthTimeEdit->setTime(QTime(0, 0, 0, 0).addSecs(value*60));
}


void PickerSettings::adjustPreSlider(const QTime &t) {
int value = QTime().secsTo(t) / 60;
int value = QTime(0, 0, 0, 0).secsTo(t) / 60;
_ui.slPreOffset->setValue(value);
}


void PickerSettings::adjustPostSlider(const QTime &t) {
int value = QTime().secsTo(t) / 60;
int value = QTime(0, 0, 0, 0).secsTo(t) / 60;
_ui.slPostOffset->setValue(value);
}


void PickerSettings::adjustLengthSlider(const QTime &t) {
int value = QTime().secsTo(t) / 60;
int value = QTime(0, 0, 0, 0).secsTo(t) / 60;
_ui.slMinimumLength->setValue(value);
}


void PickerSettings::adjustAmplitudePreTime(int value) {
_ui.preAmplitudeTimeEdit->setTime(QTime().addSecs(_ui.slAmplitudePreOffset->value()*60));
_ui.preAmplitudeTimeEdit->setTime(QTime(0, 0, 0, 0).addSecs(value*60));
}


void PickerSettings::adjustAmplitudePostTime(int value) {
_ui.postAmplitudeTimeEdit->setTime(QTime().addSecs(_ui.slAmplitudePostOffset->value()*60));
_ui.postAmplitudeTimeEdit->setTime(QTime(0, 0, 0, 0).addSecs(value*60));
}


void PickerSettings::adjustAmplitudePreSlider(const QTime &t) {
int value = QTime().secsTo(t) / 60;
int value = QTime(0, 0, 0, 0).secsTo(t) / 60;
_ui.slAmplitudePreOffset->setValue(value);
}


void PickerSettings::adjustAmplitudePostSlider(const QTime &t) {
int value = QTime().secsTo(t) / 60;
int value = QTime(0, 0, 0, 0).secsTo(t) / 60;
_ui.slAmplitudePostOffset->setValue(value);
}

Expand Down Expand Up @@ -509,9 +513,9 @@ PickerView::Config PickerSettings::pickerConfig() const {
_pickerConfig.removeAutomaticPicks = _ui.cbRemoveAllAutomaticPicks->isChecked();

_pickerConfig.usePerStreamTimeWindows = _ui.cbUsePerStreamTimeWindow->isChecked();
_pickerConfig.preOffset = Core::TimeSpan(QTime().secsTo(_ui.preTimeEdit->time()));
_pickerConfig.postOffset = Core::TimeSpan(QTime().secsTo(_ui.postTimeEdit->time()));
_pickerConfig.minimumTimeWindow = Core::TimeSpan(QTime().secsTo(_ui.minimumLengthTimeEdit->time()));
_pickerConfig.preOffset = Core::TimeSpan(QTime(0, 0, 0, 0).secsTo(_ui.preTimeEdit->time()));
_pickerConfig.postOffset = Core::TimeSpan(QTime(0, 0, 0, 0).secsTo(_ui.postTimeEdit->time()));
_pickerConfig.minimumTimeWindow = Core::TimeSpan(QTime(0, 0, 0, 0).secsTo(_ui.minimumLengthTimeEdit->time()));

_pickerConfig.alignmentPosition = _ui.slWaveformAlignment->value()*0.01;
if ( _pickerConfig.alignmentPosition < 0 )
Expand Down Expand Up @@ -546,8 +550,8 @@ PickerView::Config PickerSettings::pickerConfig() const {

AmplitudeView::Config PickerSettings::amplitudeConfig() const {
_amplitudeConfig.recordURL = _ui.editRecordSource->text();
_amplitudeConfig.preOffset = Core::TimeSpan(QTime().secsTo(_ui.preAmplitudeTimeEdit->time()));
_amplitudeConfig.postOffset = Core::TimeSpan(QTime().secsTo(_ui.postAmplitudeTimeEdit->time()));
_amplitudeConfig.preOffset = Core::TimeSpan(QTime(0, 0, 0, 0).secsTo(_ui.preAmplitudeTimeEdit->time()));
_amplitudeConfig.postOffset = Core::TimeSpan(QTime(0, 0, 0, 0).secsTo(_ui.postAmplitudeTimeEdit->time()));
_amplitudeConfig.defaultAddStationsDistance = _ui.spinAddStationsDistance->value();
_amplitudeConfig.hideStationsWithoutData = _ui.cbHideStationsWithoutData->isChecked();
_amplitudeConfig.loadStrongMotionData = _ui.cbStrongMotion->isChecked();
Expand Down
4 changes: 2 additions & 2 deletions src/gui-qt4/libs/seiscomp3/gui/datamodel/pickersettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@
<item>
<widget class="QSlider" name="slAmplitudePreOffset" >
<property name="maximum" >
<number>60</number>
<number>300</number>
</property>
<property name="sliderPosition" >
<number>1</number>
Expand Down Expand Up @@ -1327,7 +1327,7 @@
<item>
<widget class="QSlider" name="slAmplitudePostOffset" >
<property name="maximum" >
<number>60</number>
<number>300</number>
</property>
<property name="sliderPosition" >
<number>2</number>
Expand Down
5 changes: 5 additions & 0 deletions src/gui-qt4/libs/seiscomp3/gui/datamodel/pickerview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4376,6 +4376,11 @@ bool PickerView::setOrigin(Seiscomp::DataModel::Origin* origin,
minTime -= _config.preOffset;
maxTime += _config.postOffset;

if ( (maxTime - minTime) < Core::TimeSpan(0,100000) ) {
minTime -= Core::TimeSpan(10 * _config.alignmentPosition,0);
maxTime += Core::TimeSpan(10 * (1-_config.alignmentPosition),0);
}

relTimeWindowStart = minTime - originTime;
relTimeWindowEnd = maxTime - originTime;

Expand Down

0 comments on commit cdd0917

Please sign in to comment.