参数显示测试完成,可以显示,但是存在一定的缺陷,后期慢慢修复
This commit is contained in:
@@ -247,6 +247,10 @@ void MainWindow::onTabIndexChanged(const int &index)
|
||||
inspector->show();
|
||||
|
||||
}
|
||||
else if (index == 4)
|
||||
{
|
||||
dlink->mavlinknode->Parameter->paramInspect->show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,11 +19,17 @@ ParameterInspector::ParameterInspector(QWidget *parent) :
|
||||
header << tr("Value");
|
||||
ui->treeWidget->setHeaderLabels(header);
|
||||
|
||||
|
||||
TimerRunningFlag = true;
|
||||
QTimer::singleShot(1000,this,SLOT(mReflush()));
|
||||
}
|
||||
|
||||
ParameterInspector::~ParameterInspector()
|
||||
{
|
||||
TimerRunningFlag = false;
|
||||
|
||||
//clear 那些消息
|
||||
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@@ -38,9 +44,11 @@ void ParameterInspector::mReflush()
|
||||
refreshView();
|
||||
}
|
||||
|
||||
|
||||
if(TimerRunningFlag == true)
|
||||
{
|
||||
QTimer::singleShot(10,this,SLOT(mReflush()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -304,8 +312,6 @@ char* ParameterInspector::param_id(char *id)//设置id,如果id小于16,那么
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ParameterInspector::on_ReadButton_clicked()
|
||||
{
|
||||
uint8_t m_sysid = 0;
|
||||
@@ -319,7 +325,13 @@ void ParameterInspector::on_ReadButton_clicked()
|
||||
|
||||
void ParameterInspector::on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||
{
|
||||
qDebug() << item->data(0,Qt::DisplayRole) << column;
|
||||
|
||||
ui->SearchlineEdit->setText(item->data(0,Qt::DisplayRole).toString());
|
||||
|
||||
//根据type 设置这个value
|
||||
|
||||
ui->ValuelineEdit->setText(item->data(1,Qt::DisplayRole).toString());
|
||||
|
||||
}
|
||||
|
||||
void ParameterInspector::on_clearButton_clicked()
|
||||
|
||||
@@ -150,6 +150,7 @@ private slots:
|
||||
private:
|
||||
|
||||
|
||||
bool TimerRunningFlag = false;
|
||||
bool isReflush = false;
|
||||
uint16_t currentpersent;
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
</item>
|
||||
<item row="0" column="1" rowspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="4" column="0" colspan="2">
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -134,36 +134,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLineEdit" name="lineEdit_2">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>95</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>id</string>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="SearchButton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>search</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QPushButton" name="WriteButton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -176,18 +147,18 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QLineEdit" name="ValuelineEdit">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>95</width>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
@@ -196,6 +167,35 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="SearchButton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>search</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QLineEdit" name="SearchlineEdit">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>id</string>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -31,12 +31,24 @@ MavLinkNode::MavLinkNode(QObject *parent) : QObject(parent)
|
||||
|
||||
MavLinkNode::~MavLinkNode()
|
||||
{
|
||||
//停止任务
|
||||
Mission->stop();
|
||||
delete Mission;
|
||||
Mission = nullptr;
|
||||
//停止参数
|
||||
Parameter->stop();
|
||||
delete Parameter;
|
||||
Parameter = nullptr;
|
||||
|
||||
if(Nodethread->isRunning())
|
||||
{
|
||||
Nodethread->quit();
|
||||
Nodethread->wait();
|
||||
}
|
||||
|
||||
delete Nodethread;
|
||||
Nodethread = nullptr;
|
||||
|
||||
}
|
||||
|
||||
void MavLinkNode::setRunFrq(uint32_t frq)
|
||||
|
||||
@@ -23,8 +23,8 @@ ParameterProcess::ParameterProcess(QObject *parent) : QObject(parent)
|
||||
|
||||
|
||||
|
||||
|
||||
paramInspect->show();
|
||||
//隐藏
|
||||
paramInspect->hide();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user