diff --git a/src/actors/sensoractor.cpp b/src/actors/sensoractor.cpp index 55dac9b..cc15418 100644 --- a/src/actors/sensoractor.cpp +++ b/src/actors/sensoractor.cpp @@ -108,6 +108,9 @@ QString SensorActor::getName() const else if (sloap_ == SLOPE_BOTH) string.append(" passes "); string.append(QString::number(threshold_) + " "); + + if(delayMs_ > 0) string.append("(+" + QString::number(delayMs_) + "ms) "); + return string; } } diff --git a/src/ui/actorwidgets/sensoractorwidget.cpp b/src/ui/actorwidgets/sensoractorwidget.cpp index 2718b1b..58d64bc 100644 --- a/src/ui/actorwidgets/sensoractorwidget.cpp +++ b/src/ui/actorwidgets/sensoractorwidget.cpp @@ -26,9 +26,12 @@ SensorActorWidget::SensorActorWidget(std::shared_ptr sensorActor, S ui->doubleSpinBox_threshold->setValue(sensorActor_->getThreshold()); + ui->spinBox_delay->setValue(sensorActor_->getDelayMs()); + connect(ui->listView, &SensorListWidget::clicked, this, &SensorActorWidget::setSensor); connect(ui->doubleSpinBox_threshold, SIGNAL(valueChanged(double)), this, SLOT(setThreshold(double))); connect(ui->comboBox_slope, SIGNAL(currentIndexChanged(int)), this, SLOT(setSlope(int))); + connect(ui->spinBox_delay, SIGNAL(valueChanged(int)), this, SLOT(setDelay(int))); } SensorActorWidget::~SensorActorWidget() @@ -52,3 +55,8 @@ void SensorActorWidget::setSensor(const QModelIndex &index) { sensorActor_->setSensor(ui->listView->getSensorForIndex(index)); } + +void SensorActorWidget::setDelay(int ms) +{ + sensorActor_->setDelayMs(ms); +} diff --git a/src/ui/actorwidgets/sensoractorwidget.h b/src/ui/actorwidgets/sensoractorwidget.h index 3501977..3552769 100644 --- a/src/ui/actorwidgets/sensoractorwidget.h +++ b/src/ui/actorwidgets/sensoractorwidget.h @@ -27,6 +27,7 @@ private slots: void setThreshold(double in); void setSlope(int index); void setSensor(const QModelIndex &index); + void setDelay(int ms); private: Ui::SensorActorWidget *ui; diff --git a/src/ui/actorwidgets/sensoractorwidget.ui b/src/ui/actorwidgets/sensoractorwidget.ui index 5f49c96..e489d52 100644 --- a/src/ui/actorwidgets/sensoractorwidget.ui +++ b/src/ui/actorwidgets/sensoractorwidget.ui @@ -13,8 +13,8 @@ Form - - + + @@ -27,7 +27,7 @@ - + @@ -37,51 +37,90 @@ - - + + + + Threshold + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + - - - Threshold - - + + > = + - - - - 0 - 0 - - - - - > = - - - - - < = - - - - - Passes - - - + + < = + - - - -9999.989999999999782 - - - 9999.989999999999782 - - + + Passes + - + + + + + + -9999.989999999999782 + + + 9999.989999999999782 + + + + + + + Delay + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + ms + + + 9999999 + + @@ -89,7 +128,7 @@ SensorListWidget QListView -
ui/sensorlistwidget.h
+
ui/sensorlistwidget.h