Files
Jungfraujoch/viewer/JFJochViewerStatusBar.h
T

35 lines
1.2 KiB
C++

// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <QStatusBar>
#include <QLabel>
#include <QProgressBar>
#include "../common/BrokerStatus.h"
#include "JFJochImageReadingWorker.h"
class JFJochViewerStatusBar : public QStatusBar {
Q_OBJECT
// Permanent (right-side) widgets. These are created once and never shown/hidden or resized,
// so the status bar never reflows; when not applicable they are just blanked in place.
QProgressBar *state_box; // Jungfraujoch state text, progress drawn as the bar fill
QLabel *rate_label; // effective live update rate
JFJochImageReadingWorker::AutoloadMode autoload_mode = JFJochImageReadingWorker::AutoloadMode::None;
int64_t total_images = 0;
int64_t current_image = 0;
public:
explicit JFJochViewerStatusBar(QWidget *parent = nullptr);
public slots:
void display(QString input);
void setBrokerStatus(BrokerStatus status);
void setHttpConnection(bool connected, QString addr);
void setAutoloadMode(JFJochImageReadingWorker::AutoloadMode mode);
void setImageNumber(int64_t total_images, int64_t current_image);
void setLiveRate(double hz);
};