Add delay ability to sensor actor
This commit is contained in:
parent
8db0ac7290
commit
8e33897d29
4 changed files with 94 additions and 43 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,9 +26,12 @@ SensorActorWidget::SensorActorWidget(std::shared_ptr<SensorActor> 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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="1" column="0" colspan="4">
|
||||
<widget class="SensorListWidget" name="listView">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
|
|
@ -37,16 +37,27 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Threshold</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="horizontalSpacer_threshold">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QComboBox" name="comboBox_slope">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
|
|
@ -71,7 +82,7 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_threshold">
|
||||
<property name="minimum">
|
||||
<double>-9999.989999999999782</double>
|
||||
|
|
@ -81,7 +92,35 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_delay">
|
||||
<property name="text">
|
||||
<string>Delay</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<spacer name="horizontalSpacer_delay">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QSpinBox" name="spinBox_delay">
|
||||
<property name="suffix">
|
||||
<string> ms</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>9999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
@ -89,7 +128,7 @@
|
|||
<customwidget>
|
||||
<class>SensorListWidget</class>
|
||||
<extends>QListView</extends>
|
||||
<header location="local">ui/sensorlistwidget.h</header>
|
||||
<header>ui/sensorlistwidget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue