v1.0.0-rc.103 (#8)
All checks were successful
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 7m51s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 7m19s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 7m46s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 8m32s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 8m6s
Build Packages / build:rpm (rocky8) (push) Successful in 8m7s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 7m37s
Build Packages / Generate python client (push) Successful in 17s
Build Packages / Create release (push) Has been skipped
Build Packages / Build documentation (push) Successful in 32s
Build Packages / build:rpm (rocky9) (push) Successful in 9m6s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 6m53s
Build Packages / Unit tests (push) Successful in 1h9m39s
All checks were successful
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 7m51s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 7m19s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 7m46s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 8m32s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 8m6s
Build Packages / build:rpm (rocky8) (push) Successful in 8m7s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 7m37s
Build Packages / Generate python client (push) Successful in 17s
Build Packages / Create release (push) Has been skipped
Build Packages / Build documentation (push) Successful in 32s
Build Packages / build:rpm (rocky9) (push) Successful in 9m6s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 6m53s
Build Packages / Unit tests (push) Successful in 1h9m39s
This is an UNSTABLE release. * jfjoch_viewer: Minor improvements to the viewer * jfjoch_broker: Change behavior for modular detectors: coordinates of 0-th pixel can be now arbitrary and detector will be cropped to the smallest rectangle limited by module coordinates Reviewed-on: #8 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch> Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
This commit was merged in pull request #8.
This commit is contained in:
@@ -43,14 +43,15 @@ JFJochViewerSidePanel::JFJochViewerSidePanel(QWidget *parent) : QWidget(parent)
|
||||
|
||||
connect(predictionsToggleCheckBox, &QCheckBox::toggled, this,
|
||||
&JFJochViewerSidePanel::predictionsToggled);
|
||||
res_rings = new ResolutionRingWidget(this);
|
||||
|
||||
resRingsCheckBox = new QCheckBox("Show resolution rings", this);
|
||||
resRingsCheckBox->setCheckState(Qt::Unchecked);
|
||||
connect(res_rings, &ResolutionRingWidget::resRingsSet, [this] (QVector<float> v) {
|
||||
emit resRingsSet(v);
|
||||
});
|
||||
|
||||
autoResRingsCheckBox = new QCheckBox("Resolution rings auto.", this);
|
||||
res_rings_edit = new QLineEdit(this);
|
||||
res_rings_edit->setPlaceholderText("Ring positions, e.g., 1.0,2.5,3.7");
|
||||
res_rings_edit->setEnabled(false); // Initially disabled as "Auto Res Rings" is checked by default
|
||||
connect(res_rings, &ResolutionRingWidget::ringModeSet, [this] (JFJochDiffractionImage::RingMode mode) {
|
||||
emit ringModeSet(mode);
|
||||
});
|
||||
|
||||
auto highestPixelsComboBox = new QComboBox(this);
|
||||
highestPixelsComboBox->addItem("Show 0 highest pixels", 0);
|
||||
@@ -92,24 +93,15 @@ JFJochViewerSidePanel::JFJochViewerSidePanel(QWidget *parent) : QWidget(parent)
|
||||
image_feature_grid->addWidget(spotToggleCheckBox, 0, 0);
|
||||
image_feature_grid->addWidget(highlightIceRingToggleCheckBox, 0, 1);
|
||||
image_feature_grid->addWidget(predictionsToggleCheckBox, 1, 0);
|
||||
image_feature_grid->addWidget(resRingsCheckBox, 2, 0);
|
||||
image_feature_grid->addWidget(autoResRingsCheckBox, 2, 1);
|
||||
image_feature_grid->addWidget(res_rings_edit, 3, 0, 1, 2);
|
||||
image_feature_grid->addWidget(saturatedPixelsCheckBox, 4, 0);
|
||||
image_feature_grid->addWidget(highestPixelsComboBox, 4, 1);
|
||||
image_feature_grid->addWidget(colorSelectButton, 5, 0);
|
||||
image_feature_grid->addWidget(spotColorSelectButton, 5, 1);
|
||||
|
||||
image_feature_grid->addWidget(saturatedPixelsCheckBox, 2, 0);
|
||||
image_feature_grid->addWidget(highestPixelsComboBox, 2, 1);
|
||||
image_feature_grid->addWidget(colorSelectButton, 3, 0);
|
||||
image_feature_grid->addWidget(spotColorSelectButton, 3, 1);
|
||||
image_feature_grid->addWidget(res_rings, 4, 0, 1, 2);
|
||||
|
||||
layout->addLayout(image_feature_grid);
|
||||
|
||||
connect(autoResRingsCheckBox, &QCheckBox::toggled, this, &JFJochViewerSidePanel::enableAutoResRings);
|
||||
|
||||
connect(res_rings_edit, &QLineEdit::editingFinished,
|
||||
this, &JFJochViewerSidePanel::editingFinished);
|
||||
|
||||
connect(resRingsCheckBox, &QCheckBox::toggled,
|
||||
this, &JFJochViewerSidePanel::enableResRings);
|
||||
|
||||
layout->addWidget(new TitleLabel("Image statistics plot", this));
|
||||
chart = new JFJochViewerSidePanelChart(this);
|
||||
layout->addWidget(chart);
|
||||
@@ -162,7 +154,7 @@ JFJochViewerSidePanel::JFJochViewerSidePanel(QWidget *parent) : QWidget(parent)
|
||||
for (float ring : rings) {
|
||||
q_rings.append(2 * M_PI / ring);
|
||||
}
|
||||
setRings(q_rings);
|
||||
res_rings->setRings(q_rings);
|
||||
});
|
||||
|
||||
// Add preset ice rings button below LaB6 calibration
|
||||
@@ -170,7 +162,7 @@ JFJochViewerSidePanel::JFJochViewerSidePanel(QWidget *parent) : QWidget(parent)
|
||||
connect(iceRingsButton, &QPushButton::clicked, this, [this]() {
|
||||
// Set manual rings and enable display
|
||||
const QVector<float> ice_rings(ICE_RING_RES_A.begin(), ICE_RING_RES_A.end());
|
||||
setRings(ice_rings);
|
||||
res_rings->setRings(ice_rings);
|
||||
});
|
||||
|
||||
auto refine_row = new QGridLayout();
|
||||
@@ -231,28 +223,6 @@ void JFJochViewerSidePanel::findBeamCenterClicked() {
|
||||
emit findBeamCenter(GetCalibrant(), true);
|
||||
}
|
||||
|
||||
void JFJochViewerSidePanel::setRings(const QVector <float> &v) {
|
||||
QString txt;
|
||||
for (float i : v) {
|
||||
txt += QString::number(i, 'f', 4) + ",";
|
||||
}
|
||||
|
||||
resRingsCheckBox->setChecked(true);
|
||||
autoResRingsCheckBox->setChecked(false);
|
||||
res_rings_edit->setEnabled(true);
|
||||
res_rings_edit->setText(txt);
|
||||
emit setResRings(v);
|
||||
}
|
||||
|
||||
void JFJochViewerSidePanel::enableAutoResRings(bool input) {
|
||||
res_rings_edit->setEnabled(!input); // Enable line edit only if "Auto Res Rings" is unchecked
|
||||
if (input) {
|
||||
emit autoResRings();
|
||||
} else {
|
||||
editingFinished();
|
||||
}
|
||||
}
|
||||
|
||||
void JFJochViewerSidePanel::spotsToggled(bool input) {
|
||||
emit showSpots(input);
|
||||
}
|
||||
@@ -261,31 +231,6 @@ void JFJochViewerSidePanel::predictionsToggled(bool input) {
|
||||
emit showPredictions(input);
|
||||
}
|
||||
|
||||
void JFJochViewerSidePanel::editingFinished() {
|
||||
QString text = res_rings_edit->text();
|
||||
QStringList stringList = text.split(',', Qt::SkipEmptyParts);
|
||||
QVector<float> manualResRings;
|
||||
|
||||
bool validInput = true;
|
||||
for (const QString &str: stringList) {
|
||||
bool ok;
|
||||
float value = str.toFloat(&ok);
|
||||
if (ok && value >= 0) {
|
||||
manualResRings.append(value);
|
||||
} else {
|
||||
validInput = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!validInput) {
|
||||
res_rings_edit->setStyleSheet("border: 1px solid red;"); // Highlight error
|
||||
} else {
|
||||
res_rings_edit->setStyleSheet(""); // Reset to default style
|
||||
emit setResRings(manualResRings); // Update resolution ring vector
|
||||
}
|
||||
}
|
||||
|
||||
void JFJochViewerSidePanel::loadImage(std::shared_ptr<const JFJochReaderImage> image) {
|
||||
if (image)
|
||||
sample_cell = image->Dataset().experiment.GetUnitCell();
|
||||
@@ -294,17 +239,6 @@ void JFJochViewerSidePanel::loadImage(std::shared_ptr<const JFJochReaderImage> i
|
||||
emit imageLoaded(image);
|
||||
}
|
||||
|
||||
void JFJochViewerSidePanel::enableResRings(bool input) {
|
||||
if (!input) {
|
||||
autoResRingsCheckBox->setEnabled(false);
|
||||
res_rings_edit->setEnabled(false);
|
||||
emit setResRings({});
|
||||
} else {
|
||||
autoResRingsCheckBox->setEnabled(true);
|
||||
enableAutoResRings(autoResRingsCheckBox->isChecked());
|
||||
}
|
||||
}
|
||||
|
||||
void JFJochViewerSidePanel::saturatedPixelsToggled(bool input) {
|
||||
emit showSaturatedPixels(input);
|
||||
}
|
||||
@@ -324,3 +258,8 @@ void JFJochViewerSidePanel::SetROICircle(double x, double y, double radius) {
|
||||
void JFJochViewerSidePanel::SetROIResult(ROIMessage msg) {
|
||||
roi->SetROIResult(msg);
|
||||
}
|
||||
|
||||
void JFJochViewerSidePanel::SetRings(QVector<float> v) {
|
||||
res_rings->setRings(v);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user