eismultiplexer-qt/channelwidget.h
2025-07-03 11:55:32 +02:00

49 lines
1.1 KiB
C++

#ifndef CHANNELWIDGET_H
#define CHANNELWIDGET_H
#include <QWidget>
#include <QCheckBox>
#include <QLabel>
#include <QHBoxLayout>
#include <QComboBox>
#include <eismultiplexer.h>
#include <memory>
class ChannelWidget : public QWidget
{
Q_OBJECT
public:
explicit ChannelWidget(uint16_t deviceSerial, uint16_t channelNumber, std::shared_ptr<struct eismultiplexer> multiplexer,
QWidget *parent = nullptr);
~ChannelWidget() override;
uint16_t getDeviceSerial() const;
uint16_t getChannelNumber() const;
bool isChecked() const;
signals:
void channelAboutToBeTurnedOn(uint16_t deviceSerial, uint16_t channelNumber);
private slots:
void onChannelToggled(bool checked);
private:
uint16_t deviceSerial;
uint16_t channelNumber;
std::shared_ptr<struct eismultiplexer> multiplexer;
QCheckBox checkbox;
QLabel devicelabel;
QLabel channellabel;
QLabel ganglabel;
QComboBox gangcombo;
QFrame line;
QVBoxLayout vlayout;
QHBoxLayout hlayout;
QVBoxLayout labellayout;
};
#endif // CHANNELWIDGET_H