| 1325 | } |
| 1326 | |
| 1327 | void Worksheet::curveDataChanged(const XYCurve* curve) { |
| 1328 | auto* plot = dynamic_cast<CartesianPlot*>(QObject::sender()); |
| 1329 | if (!plot || !curve) |
| 1330 | return; |
| 1331 | |
| 1332 | TreeModel* treeModel = cursorModel(); |
| 1333 | int rowCount = treeModel->rowCount(); |
| 1334 | |
| 1335 | for (int i = 0; i < rowCount; i++) { |
| 1336 | QModelIndex plotIndex = treeModel->index(i, static_cast<int>(WorksheetPrivate::TreeModelColumn::PLOTNAME)); |
| 1337 | if (plotIndex.data().toString().compare(plot->name()) != 0) |
| 1338 | continue; |
| 1339 | |
| 1340 | for (int j = 0; j < plot->curveCount(); j++) { |
| 1341 | if (plot->getCurve(j)->name().compare(curve->name()) != 0) |
| 1342 | continue; |
| 1343 | |
| 1344 | treeModel->setTreeData(QVariant(curve->name()), j, static_cast<int>(WorksheetPrivate::TreeModelColumn::SIGNALNAME), plotIndex); |
| 1345 | |
| 1346 | bool valueFound; |
| 1347 | double valueCursor0 = curve->y(plot->cursorPos(0), valueFound); |
| 1348 | treeModel->setTreeData(QVariant(valueCursor0), j, static_cast<int>(WorksheetPrivate::TreeModelColumn::CURSOR0), plotIndex); |
| 1349 | |
| 1350 | double valueCursor1 = curve->y(plot->cursorPos(1), valueFound); |
| 1351 | treeModel->setTreeData(QVariant(valueCursor1), j, static_cast<int>(WorksheetPrivate::TreeModelColumn::CURSOR1), plotIndex); |
| 1352 | |
| 1353 | treeModel->setTreeData(QVariant(valueCursor1 - valueCursor0), j, static_cast<int>(WorksheetPrivate::TreeModelColumn::CURSORDIFF), plotIndex); |
| 1354 | break; |
| 1355 | } |
| 1356 | break; |
| 1357 | } |
| 1358 | } |
| 1359 | |
| 1360 | void Worksheet::curveAdded(const XYCurve* curve) { |
| 1361 | Q_D(const Worksheet); |
nothing calls this directly
no test coverage detected