k可以键盘输入,监视器可以扩开
This commit is contained in:
@@ -15,6 +15,15 @@ Inputter::Inputter(QWidget *parent) :
|
||||
this->setStyleSheet(stylesheet);
|
||||
file.close();
|
||||
|
||||
this->setFocusPolicy(Qt::WheelFocus);
|
||||
this->setFocus();
|
||||
|
||||
|
||||
activateWindow();
|
||||
|
||||
ui->lineEdit->setFocusPolicy(Qt::WheelFocus);
|
||||
ui->lineEdit->setFocus();
|
||||
|
||||
curentStr = "";
|
||||
currentValue = 0;
|
||||
inputType = type::Normal;
|
||||
@@ -57,6 +66,68 @@ bool Inputter::event(QEvent *event)
|
||||
return QWidget::event(event);
|
||||
}
|
||||
|
||||
|
||||
void Inputter::keyPressEvent(QKeyEvent *event) //键盘按下事件
|
||||
{
|
||||
qInfo() << "inputter key" << event;
|
||||
//qDebug() << event;
|
||||
switch(event->key())
|
||||
{
|
||||
case Qt::Key_0:
|
||||
on_pushButton_0_clicked();
|
||||
break;
|
||||
case Qt::Key_1:
|
||||
on_pushButton_1_clicked();
|
||||
break;
|
||||
case Qt::Key_2:
|
||||
on_pushButton_2_clicked();
|
||||
break;
|
||||
case Qt::Key_3:
|
||||
on_pushButton_3_clicked();
|
||||
break;
|
||||
case Qt::Key_4:
|
||||
on_pushButton_4_clicked();
|
||||
break;
|
||||
case Qt::Key_5:
|
||||
on_pushButton_5_clicked();
|
||||
break;
|
||||
case Qt::Key_6:
|
||||
on_pushButton_6_clicked();
|
||||
break;
|
||||
case Qt::Key_7:
|
||||
on_pushButton_7_clicked();
|
||||
break;
|
||||
case Qt::Key_8:
|
||||
on_pushButton_8_clicked();
|
||||
break;
|
||||
case Qt::Key_9:
|
||||
on_pushButton_9_clicked();
|
||||
break;
|
||||
case Qt::Key_Period:
|
||||
on_pushButton_point_clicked();
|
||||
break;
|
||||
|
||||
case Qt::Key_Minus:
|
||||
on_pushButton_minus_clicked();
|
||||
break;
|
||||
case Qt::Key_Delete:
|
||||
on_pushButton_del_clicked();
|
||||
break;
|
||||
case Qt::Key_Backspace:
|
||||
on_pushButton_del_clicked();
|
||||
break;
|
||||
case Qt::Key_Escape:
|
||||
on_pushButton_cancel_clicked();
|
||||
break;
|
||||
case Qt::Key_Return:
|
||||
on_pushButton_ok_clicked();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Inputter::setInputType(int Type)
|
||||
{
|
||||
switch (Type) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#ifndef INPUTTER_H
|
||||
#ifndef INPUTTER_H
|
||||
#define INPUTTER_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "QDebug" `
|
||||
#include "QFile"
|
||||
#include "QTimer"
|
||||
#include <QKeyEvent>
|
||||
|
||||
namespace Ui {
|
||||
class Inputter;
|
||||
@@ -38,6 +39,7 @@ signals:
|
||||
protected:
|
||||
|
||||
bool event(QEvent *event);
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
|
||||
private slots:
|
||||
void DoubleClickTimeout();
|
||||
|
||||
@@ -22,7 +22,7 @@ ParameterInspector::ParameterInspector(QWidget *parent) :
|
||||
|
||||
ui->treeWidget->header()->resizeSection(0,400);
|
||||
ui->treeWidget->header()->resizeSection(1,150);
|
||||
ui->treeWidget->header()->resizeSection(2,50);
|
||||
ui->treeWidget->header()->resizeSection(2,150);
|
||||
|
||||
ui->CancelpushButton->setEnabled(false);
|
||||
ui->pushButton_id->setEnabled(false);
|
||||
@@ -590,32 +590,6 @@ QString ParameterInspector::param_id(char *id)//设置id,如果id小于16,那
|
||||
Name = Name.left(16);
|
||||
}
|
||||
|
||||
qDebug() << "Name" << Name;
|
||||
|
||||
|
||||
/*
|
||||
qDebug() << "Name" << Name;
|
||||
|
||||
|
||||
uint8_t len = 0;
|
||||
while(len < 16)
|
||||
{
|
||||
if(id[len] != '\0')
|
||||
{
|
||||
//continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
return id;
|
||||
}
|
||||
len++;
|
||||
}
|
||||
|
||||
id[16] = '\0';
|
||||
return id;
|
||||
*/
|
||||
|
||||
|
||||
return Name;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
}
|
||||
|
||||
.QLabel {
|
||||
font: 15px "Arial";
|
||||
font: 20px "Arial";
|
||||
}
|
||||
|
||||
.QLabel[state="0"] {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>989</width>
|
||||
<height>474</height>
|
||||
<height>564</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -67,6 +67,9 @@
|
||||
<string>基本状态</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_9">
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
@@ -385,6 +388,9 @@
|
||||
<string>舵面状态</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_37">
|
||||
<property name="text">
|
||||
@@ -584,6 +590,9 @@
|
||||
<string>曲线数据源</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_12">
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_INS">
|
||||
<property name="text">
|
||||
@@ -611,6 +620,9 @@
|
||||
<string>数据链状态</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_41">
|
||||
<property name="text">
|
||||
@@ -748,6 +760,9 @@
|
||||
<string>电池状态</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label_52">
|
||||
<property name="text">
|
||||
@@ -901,6 +916,9 @@
|
||||
<string>导航状态</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_47">
|
||||
<property name="text">
|
||||
@@ -1109,6 +1127,9 @@
|
||||
<string>发动机状态</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_58">
|
||||
<property name="text">
|
||||
@@ -1262,6 +1283,9 @@
|
||||
<string>控制状态</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_8">
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_68">
|
||||
<property name="text">
|
||||
|
||||
@@ -36,6 +36,8 @@ MAVLinkInspector::MAVLinkInspector(const QString& title, QAction* action,QWidget
|
||||
|
||||
ui->treeWidget->header()->setStretchLastSection(true);
|
||||
|
||||
ui->treeWidget->setHeaderHidden(false);
|
||||
|
||||
connect(ui->clearButton, &QPushButton::clicked, this, &MAVLinkInspector::clearView);
|
||||
|
||||
// Attach the UI's refresh rate to a timer.
|
||||
|
||||
@@ -601,6 +601,8 @@ void MainWindow::keyPressEvent(QKeyEvent *event) //键盘按下事件
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
QWidget::keyPressEvent(event);
|
||||
}
|
||||
|
||||
bool MainWindow::event(QEvent *event)
|
||||
|
||||
@@ -186,7 +186,7 @@ void MissionProcess::transmitPoint(float param1,float param2,float param3,float
|
||||
|
||||
items.insert(item.seq,item);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
foreach (mapcontrol::WayPointItem::_property item, items) {
|
||||
qDebug() << "Mission Thread: transmit seq"
|
||||
@@ -209,6 +209,7 @@ void MissionProcess::transmitPoint(float param1,float param2,float param3,float
|
||||
<< item.mission_type;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ void ParameterProcess::WriteCmd(uint8_t m_sysid, uint8_t m_compid ,const char *i
|
||||
//这个函数类似中断,专门处理接收到的状态
|
||||
void ParameterProcess::Parse(mavlink_message_t msg)
|
||||
{
|
||||
qDebug() << "Parameter" << msg.msgid;
|
||||
//qDebug() << "Parameter" << msg.msgid;
|
||||
|
||||
switch (msg.msgid) {
|
||||
case MAVLINK_MSG_ID_PARAM_SET:{
|
||||
@@ -157,7 +157,8 @@ void ParameterProcess::Parse(mavlink_message_t msg)
|
||||
|
||||
status.recieve.isWaitingforValue = false;
|
||||
status.transmit.isWaitingforValue = false;
|
||||
qDebug() << "param_value" << param_value.param_id << param_value.param_index << param_value.param_type << param_value.param_value;
|
||||
|
||||
qDebug() << "param_value" << param_value.param_index << param_value.param_value;
|
||||
}break;
|
||||
case MAVLINK_MSG_ID_PARAM_EXT_ACK:{
|
||||
mavlink_msg_param_ext_ack_decode(&msg,¶m_ext_ack);
|
||||
|
||||
Reference in New Issue
Block a user