91 lines
2.3 KiB
C++
91 lines
2.3 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#ifndef JFJOCH_JFJOCHVIEWERTOOLBAR_H
|
|
#define JFJOCH_JFJOCHVIEWERTOOLBAR_H
|
|
|
|
#include <QToolBar>
|
|
#include <QLabel>
|
|
#include <QLineEdit>
|
|
#include <QIntValidator>
|
|
#include <QPushButton>
|
|
#include <QSlider>
|
|
#include <QComboBox>
|
|
#include "widgets/SliderPlusBox.h"
|
|
#include "widgets/NumericComboBox.h"
|
|
|
|
class JFJochViewerToolbar : public QToolBar {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum class ToolbarMode {Autoload, Movie, None};
|
|
Q_ENUM(ToolbarMode)
|
|
private:
|
|
ToolbarMode mode = ToolbarMode::None;
|
|
size_t image_count_in_dataset;
|
|
int64_t curr_image;
|
|
|
|
int jump_value = 1;
|
|
int sum = 1;
|
|
|
|
QLabel *total_number_label;
|
|
QLineEdit *current_image_edit;
|
|
QIntValidator *current_image_edit_validator;
|
|
|
|
QPushButton *leftmost_button;
|
|
QPushButton *left_button;
|
|
QPushButton *right_button;
|
|
QPushButton *rightmost_button;
|
|
|
|
QSlider *image_number_slider;
|
|
QTimer *image_number_slider_timer;
|
|
bool image_number_slider_manual = false;
|
|
|
|
SliderPlusBox *foreground_slider;
|
|
|
|
QComboBox *color_map_select;
|
|
|
|
QPushButton *movie_button;
|
|
QPushButton *autoload_button;
|
|
|
|
NumericComboBox *jump;
|
|
|
|
QTimer *movie_timer;
|
|
int movie_interval = 500; // milliseconds
|
|
|
|
void updateButtons();
|
|
void updateAutoload();
|
|
signals:
|
|
void loadImage(int64_t number, int summation);
|
|
void setForeground(float val);
|
|
void colorMapChanged(int val);
|
|
public:
|
|
explicit JFJochViewerToolbar(QWidget *parent = nullptr);
|
|
|
|
public slots:
|
|
void setImageNumber(int64_t total_images, int64_t current_image);
|
|
void updateForeground(float val);
|
|
void setAutoloadMode(ToolbarMode input);
|
|
private slots:
|
|
void leftButtonPressed();
|
|
void rightButtonPressed();
|
|
void leftmostButtonPressed();
|
|
void rightmostButtonPressed();
|
|
|
|
void editFinalized();
|
|
void imageNumberSliderPressed();
|
|
void imageNumberSliderMoved(int val);
|
|
void imageNumberSliderReleased();
|
|
|
|
void foregroundSet(double val);
|
|
void colorComboBoxSet(int val);
|
|
void setImageJump(int val);
|
|
void setSummation(int val);
|
|
|
|
void movieButtonPressed();
|
|
void autoloadButtonPressed();
|
|
void movieTimerTimeout();
|
|
};
|
|
|
|
#endif //JFJOCH_JFJOCHVIEWERTOOLBAR_H
|