| 97 | } |
| 98 | |
| 99 | void RunChartDock::setPlots(QList<RunChart*> list) { |
| 100 | Lock lock(m_initializing); |
| 101 | m_plots = list; |
| 102 | m_plot = list.first(); |
| 103 | setAspects(list); |
| 104 | Q_ASSERT(m_plot); |
| 105 | setModel(); |
| 106 | |
| 107 | // initialize widgets for common properties |
| 108 | QList<Line*> dataLines; |
| 109 | QList<Symbol*> dataSymbols; |
| 110 | QList<Line*> centerLines; |
| 111 | for (auto* plot : m_plots) { |
| 112 | dataLines << plot->dataLine(); |
| 113 | dataSymbols << plot->dataSymbol(); |
| 114 | centerLines << plot->centerLine(); |
| 115 | } |
| 116 | dataLineWidget->setLines(dataLines); |
| 117 | dataSymbolWidget->setSymbols(dataSymbols); |
| 118 | centerLineWidget->setLines(centerLines); |
| 119 | |
| 120 | // if there are more then one curve in the list, disable the content in the tab "general" |
| 121 | if (m_plots.size() == 1) { |
| 122 | cbDataColumn->setEnabled(true); |
| 123 | cbDataColumn->setAspect(m_plot->dataColumn(), m_plot->dataColumnPath()); |
| 124 | } else { |
| 125 | cbDataColumn->setEnabled(false); |
| 126 | cbDataColumn->setCurrentModelIndex(QModelIndex()); |
| 127 | } |
| 128 | |
| 129 | ui.chkLegendVisible->setChecked(m_plot->legendVisible()); |
| 130 | ui.chkVisible->setChecked(m_plot->isVisible()); |
| 131 | |
| 132 | // center metric |
| 133 | const int index = ui.cbCenterMetric->findData(static_cast<int>(m_plot->centerMetric())); |
| 134 | ui.cbCenterMetric->setCurrentIndex(index); |
| 135 | |
| 136 | updatePlotRangeList(); |
| 137 | |
| 138 | // Slots |
| 139 | // General-tab |
| 140 | connect(m_plot, &RunChart::dataColumnChanged, this, &RunChartDock::plotDataColumnChanged); |
| 141 | connect(m_plot, &RunChart::centerMetricChanged, this, &RunChartDock::plotCenterMetricChanged); |
| 142 | } |
| 143 | |
| 144 | void RunChartDock::retranslateUi() { |
| 145 | ui.cbCenterMetric->clear(); |
nothing calls this directly
no test coverage detected