32 lines
713 B
C++
32 lines
713 B
C++
#include "dmxwidget.h"
|
|
|
|
dmxWidget::dmxWidget(QWidget *parent) :
|
|
QGroupBox(parent)
|
|
, m_receiveDMX(new QCheckBox)
|
|
, m_watchDMX(new QTimer)
|
|
{
|
|
this->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
|
QVBoxLayout *vbox = new QVBoxLayout;
|
|
m_receiveDMX->setText("DMX signal");
|
|
vbox->addWidget(m_receiveDMX);
|
|
this->setLayout(vbox);
|
|
connect(m_watchDMX, SIGNAL(timeout()),
|
|
this, SLOT(watchDMXExpired()));
|
|
m_watchDMX->start(2000);
|
|
}
|
|
|
|
dmxWidget::~dmxWidget()
|
|
{
|
|
|
|
}
|
|
|
|
void dmxWidget::watchDMXExpired() {
|
|
m_receiveDMX->setChecked(false);
|
|
}
|
|
|
|
void dmxWidget::updateWatchDMX(int uni)
|
|
{
|
|
(void)uni;
|
|
if (m_receiveDMX->isChecked() == false)
|
|
m_receiveDMX->setChecked(true);
|
|
}
|