Skip to content
Snippets Groups Projects
Commit 4598452f authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

DataPropertyWidget: change units in real data

parent e8b608ec
No related branches found
No related tags found
1 merge request!978GUI: plotting widgets migration finished
......@@ -13,6 +13,8 @@
// ************************************************************************************************
#include "GUI/View/PlotUtil/DataPropertyWidget.h"
#include "GUI/Model/Data/SessionData.h"
#include "GUI/Model/Project/ProjectDocument.h"
#include "GUI/Model/Data/DataItem.h"
#include <QFormLayout>
......@@ -39,21 +41,24 @@ void DataPropertyWidget::updateItemCoords(DataItem* item)
// TODO : https://jugit.fz-juelich.de/mlz/bornagain/-/issues/320
// Also change units for real item with linked instrument
if (!item || !jobItem())
if (!item)
return;
// InstrumentItem* instrument;
// if(jobItem())
// instrument = jobItem()->instrumentItem();
// else if(realItem())
// instrument = gSessionData->instrumentLibrary.collectedItems()
// ->findInstrumentById(realItem()->instrumentId());
// if(instrument) {
InstrumentItem* instrument = nullptr;
if(jobItem())
instrument = jobItem()->instrumentItem();
else if(realItem()) {
instrument = gSessionData->projectDocument.value()->collectedItems()
->findInstrumentById(realItem()->instrumentId());
} else
ASSERT(0)
if(instrument) {
item->blockSignals(true);
item->updateCoords(jobItem()->instrumentItem());
item->updateCoords(instrument);
item->blockSignals(false);
emit item->axesUnitsReplotRequested();
// }
}
}
void DataPropertyWidget::updateUIValues()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment