Commit cbb2f7ae authored by pixhawk's avatar pixhawk

[landauf] added button to clear the pattern and letter lists

parent 5cd0d543
...@@ -56,6 +56,7 @@ ObjectDetectionView::ObjectDetectionView(QString folder, QWidget *parent) : ...@@ -56,6 +56,7 @@ ObjectDetectionView::ObjectDetectionView(QString folder, QWidget *parent) :
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setUAS(UASInterface*))); connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setUAS(UASInterface*)));
letterTimer.start(1000); letterTimer.start(1000);
connect(&letterTimer, SIGNAL(timeout()), this, SLOT(decreaseLetterTime())); connect(&letterTimer, SIGNAL(timeout()), this, SLOT(decreaseLetterTime()));
connect(m_ui->clearButton, SIGNAL(clicked()), this, SLOT(clearLists()));
} }
ObjectDetectionView::~ObjectDetectionView() ObjectDetectionView::~ObjectDetectionView()
...@@ -183,6 +184,14 @@ void ObjectDetectionView::updateLetterList() ...@@ -183,6 +184,14 @@ void ObjectDetectionView::updateLetterList()
m_ui->letterListWidget->addItem(pattern.name + separator + "(" + QString::number(pattern.count) + ")" + separator + QString::number(pattern.confidence)); m_ui->letterListWidget->addItem(pattern.name + separator + "(" + QString::number(pattern.count) + ")" + separator + QString::number(pattern.confidence));
} }
void ObjectDetectionView::clearLists()
{
patternList.clear();
letterList.clear();
m_ui->listWidget->clear();
m_ui->letterListWidget->clear();
}
void ObjectDetectionView::takeAction() void ObjectDetectionView::takeAction()
{ {
QAction* act = dynamic_cast<QAction*>(sender()); QAction* act = dynamic_cast<QAction*>(sender());
......
...@@ -76,6 +76,7 @@ public slots: ...@@ -76,6 +76,7 @@ public slots:
void newLetter(int uasId, QString letter, float confidence, bool detected); void newLetter(int uasId, QString letter, float confidence, bool detected);
void decreaseLetterTime(); void decreaseLetterTime();
void updateLetterList(); void updateLetterList();
void clearLists();
/** @brief Accept an internal action, update name and preview image label */ /** @brief Accept an internal action, update name and preview image label */
void takeAction(); void takeAction();
......
...@@ -13,25 +13,37 @@ ...@@ -13,25 +13,37 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout" columnstretch="10,10" columnminimumwidth="0,0"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2"> <item row="0" column="0" colspan="3">
<widget class="QListWidget" name="listWidget"/> <widget class="QListWidget" name="listWidget"/>
</item> </item>
<item row="1" column="0" colspan="2"> <item row="1" column="0" colspan="3">
<widget class="QListWidget" name="letterListWidget"/> <widget class="QListWidget" name="letterListWidget"/>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="imageLabel"> <widget class="QLabel" name="imageLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch> <horstretch>10</horstretch>
<verstretch>1</verstretch> <verstretch>10</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>64</width> <width>110</width>
<height>64</height> <height>110</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>2</width>
<height>2</height>
</size>
</property>
<property name="baseSize">
<size>
<width>10</width>
<height>10</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
...@@ -39,7 +51,7 @@ ...@@ -39,7 +51,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1" colspan="2">
<widget class="QLabel" name="letterLabel"> <widget class="QLabel" name="letterLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
...@@ -47,6 +59,12 @@ ...@@ -47,6 +59,12 @@
<verstretch>10</verstretch> <verstretch>10</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize">
<size>
<width>110</width>
<height>110</height>
</size>
</property>
<property name="sizeIncrement"> <property name="sizeIncrement">
<size> <size>
<width>2</width> <width>2</width>
...@@ -78,6 +96,19 @@ color: white;</string> ...@@ -78,6 +96,19 @@ color: white;</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2">
<widget class="QPushButton" name="clearButton">
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment