viewer: salmon group boxes; dataset-info x-axis spans the whole dataset
- Fusion fills QGroupBox interiors with a flat light colour, so the settings window
lost its salmon look. A tiny app stylesheet (QGroupBox { background: transparent })
makes them show the salmon window background again; entry widgets stay white via
the palette.
- The dataset-info chart now fixes the x-axis to the whole dataset [0, n) (the
largest run = the original file), so a subset run is drawn at its real image
positions instead of being stretched to fill the plot. Subsets with binning bin
by ordinal and place each point at its mapped image number (correct for the
common contiguous sub-range).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -251,8 +251,15 @@ void JFJochViewerDatasetInfo::UpdatePlot() {
|
||||
RunColor(static_cast<int>(runs_.size())), XForRun(*live_run_)});
|
||||
}
|
||||
|
||||
// The whole dataset spans this many images (the largest run, i.e. the original file), so the
|
||||
// x-axis is fixed to it and subset runs appear at their real position.
|
||||
int64_t full_range = dataset->experiment.GetImageNum();
|
||||
for (const auto &run: runs_)
|
||||
if (run.dataset)
|
||||
full_range = std::max<int64_t>(full_range, run.dataset->experiment.GetImageNum());
|
||||
|
||||
chart_view->loadValues(data, image_number, one_over_d2, dataset.get(), primary_name,
|
||||
std::move(overlays), primary_color, XForRun(*dataset));
|
||||
std::move(overlays), primary_color, XForRun(*dataset), full_range);
|
||||
|
||||
if (dataset->experiment.GetGridScan()) {
|
||||
stack->setCurrentWidget(grid_scan_image);
|
||||
|
||||
@@ -132,11 +132,12 @@ void JFJochDatasetInfoChartView::resetZoom() {
|
||||
void JFJochDatasetInfoChartView::loadValues(const std::vector<float> &input, int64_t image, bool one_over_d2,
|
||||
const JFJochReaderDataset *dataset, const QString &primaryName,
|
||||
std::vector<NamedSeries> overlays, const QColor &primaryColor,
|
||||
std::vector<float> primaryX) {
|
||||
std::vector<float> primaryX, int64_t fullRange) {
|
||||
m_yOneOverD = one_over_d2;
|
||||
primaryName_ = primaryName;
|
||||
primary_color_ = primaryColor;
|
||||
primary_x_ = std::move(primaryX);
|
||||
full_range_ = fullRange;
|
||||
|
||||
// d -> 1/d^2 for resolution plots; identity otherwise. Applied to every series alike.
|
||||
auto transform = [one_over_d2](const std::vector<float> &in, std::vector<float> &out) {
|
||||
@@ -301,6 +302,9 @@ void JFJochDatasetInfoChartView::buildTimeDomainChart() {
|
||||
// ----- X axis handling -----
|
||||
QValueAxis *axisX = qobject_cast<QValueAxis *>(chart()->axisX(series));
|
||||
if (axisX) {
|
||||
// Always span the whole dataset so a subset run shows at its real position, not stretched.
|
||||
if (full_range_ > 1)
|
||||
axisX->setRange(0, static_cast<double>(full_range_ - 1));
|
||||
if (goniometer_axis.has_value() && m_xUseGoniometerAxis) {
|
||||
// Hide labels on numeric axis and move it to the top
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ private:
|
||||
std::vector<NamedSeries> overlays_;
|
||||
QColor primary_color_; // colour of the active (primary) run, if assigned
|
||||
std::vector<float> primary_x_; // x (image numbers) for the primary series; empty => index
|
||||
int64_t full_range_ = 0; // total images in the dataset; fixes the x-axis to [0, n)
|
||||
// Append (binned) finite points of vals to s at x positions (xs empty => index), extending [mn,mx].
|
||||
void appendSeries(QLineSeries *s, const std::vector<float> &vals, const std::vector<float> &xs,
|
||||
double &mn, double &mx) const;
|
||||
@@ -99,7 +100,8 @@ public:
|
||||
const QString &primaryName = QString(),
|
||||
std::vector<NamedSeries> overlays = {},
|
||||
const QColor &primaryColor = QColor(),
|
||||
std::vector<float> primaryX = {});
|
||||
std::vector<float> primaryX = {},
|
||||
int64_t fullRange = 0);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,9 @@ int main(int argc, char *argv[]) {
|
||||
pal.setColor(QPalette::Highlight, QColor(0x2a, 0x9d, 0x8f));
|
||||
pal.setColor(QPalette::HighlightedText, Qt::white);
|
||||
app.setPalette(pal);
|
||||
// Fusion fills QGroupBox interiors with a flat light colour; make them transparent so they show
|
||||
// the salmon window background like the rest of the UI (entry widgets stay white via the palette).
|
||||
app.setStyleSheet("QGroupBox { background-color: transparent; }");
|
||||
|
||||
QIcon appIcon(":/jfjoch.png");
|
||||
app.setWindowIcon(appIcon);
|
||||
|
||||
Reference in New Issue
Block a user