| 89 | } |
| 90 | |
| 91 | void XYDataReductionCurveDock::initGeneralTab() { |
| 92 | // show the properties of the first curve |
| 93 | // data source |
| 94 | uiGeneralTab.cbDataSourceType->setCurrentIndex(static_cast<int>(m_dataReductionCurve->dataSourceType())); |
| 95 | this->dataSourceTypeChanged(uiGeneralTab.cbDataSourceType->currentIndex()); |
| 96 | cbDataSourceCurve->setAspect(m_dataReductionCurve->dataSourceCurve()); |
| 97 | cbXDataColumn->setAspect(m_dataReductionCurve->xDataColumn(), m_dataReductionCurve->xDataColumnPath()); |
| 98 | cbYDataColumn->setAspect(m_dataReductionCurve->yDataColumn(), m_dataReductionCurve->yDataColumnPath()); |
| 99 | |
| 100 | // range widgets |
| 101 | const auto* plot = static_cast<const CartesianPlot*>(m_dataReductionCurve->parentAspect()); |
| 102 | const int xIndex = plot->coordinateSystem(m_curve->coordinateSystemIndex())->index(CartesianCoordinateSystem::Dimension::X); |
| 103 | m_dateTimeRange = (plot->xRangeFormat(xIndex) != RangeT::Format::Numeric); |
| 104 | if (!m_dateTimeRange) { |
| 105 | const auto numberLocale = QLocale(); |
| 106 | uiGeneralTab.leMin->setText(numberLocale.toString(m_dataReductionData.xRange.first())); |
| 107 | uiGeneralTab.leMax->setText(numberLocale.toString(m_dataReductionData.xRange.last())); |
| 108 | } else { |
| 109 | uiGeneralTab.dateTimeEditMin->setMSecsSinceEpochUTC(m_dataReductionData.xRange.first()); |
| 110 | uiGeneralTab.dateTimeEditMax->setMSecsSinceEpochUTC(m_dataReductionData.xRange.last()); |
| 111 | } |
| 112 | |
| 113 | uiGeneralTab.lMin->setVisible(!m_dateTimeRange); |
| 114 | uiGeneralTab.leMin->setVisible(!m_dateTimeRange); |
| 115 | uiGeneralTab.lMax->setVisible(!m_dateTimeRange); |
| 116 | uiGeneralTab.leMax->setVisible(!m_dateTimeRange); |
| 117 | uiGeneralTab.lMinDateTime->setVisible(m_dateTimeRange); |
| 118 | uiGeneralTab.dateTimeEditMin->setVisible(m_dateTimeRange); |
| 119 | uiGeneralTab.lMaxDateTime->setVisible(m_dateTimeRange); |
| 120 | uiGeneralTab.dateTimeEditMax->setVisible(m_dateTimeRange); |
| 121 | |
| 122 | // auto range |
| 123 | uiGeneralTab.cbAutoRange->setChecked(m_dataReductionData.autoRange); |
| 124 | this->autoRangeChanged(); |
| 125 | |
| 126 | // update list of selectable types |
| 127 | xDataColumnChanged(cbXDataColumn->currentModelIndex()); |
| 128 | |
| 129 | uiGeneralTab.cbMethod->setCurrentIndex(m_dataReductionData.type); |
| 130 | this->methodChanged(m_dataReductionData.type); |
| 131 | uiGeneralTab.chkAuto->setChecked(m_dataReductionData.autoTolerance); |
| 132 | this->autoToleranceChanged(); |
| 133 | uiGeneralTab.sbTolerance->setValue(m_dataReductionData.tolerance); |
| 134 | this->toleranceChanged(m_dataReductionData.tolerance); |
| 135 | uiGeneralTab.chkAuto2->setChecked(m_dataReductionData.autoTolerance2); |
| 136 | this->autoTolerance2Changed(); |
| 137 | uiGeneralTab.sbTolerance2->setValue(m_dataReductionData.tolerance2); |
| 138 | this->tolerance2Changed(m_dataReductionData.tolerance2); |
| 139 | |
| 140 | this->showDataReductionResult(); |
| 141 | |
| 142 | // enable the "recalculate"-button if the source data was changed since the last dataReduction |
| 143 | uiGeneralTab.pbRecalculate->setEnabled(m_dataReductionCurve->isSourceDataChangedSinceLastRecalc()); |
| 144 | |
| 145 | uiGeneralTab.chkLegendVisible->setChecked(m_curve->legendVisible()); |
| 146 | uiGeneralTab.chkVisible->setChecked(m_curve->isVisible()); |
| 147 | |
| 148 | // Slots |
nothing calls this directly
no test coverage detected