pull/36/head
pvqf6mep3 3 years ago
commit 6c204cbc6f

@ -360,4 +360,27 @@ void MainWindow::setBtnStyles(){
"QPushButton:pressed{border-image: url(://images/down_right_2.png)}");
ui->pushButton_Right_Back->setFlat(true);
}
void MainWindow::importFrame()
{
capture >> frame;
cvtColor(frame, frame, CV_BGR2RGB);
QImage srcQImage = QImage((uchar*)(frame.data), frame.cols, frame.rows, QImage::Format_RGB888);
ui->tello_receiver->setPixmap(QPixmap::fromImage(srcQImage));
ui->tello_receiver->resize(srcQImage.size());
ui->tello_receiver->show();
}
void MainWindow::on_Open_receive_clicked()
{
capture.open(1);
//capture.open("udp://@0.0.0.0:11111");
timer->start(30);
}
void MainWindow::on_Stop_receive_clicked()
{
timer->stop();
capture.release();
}

@ -43,3 +43,9 @@ void MainWindow::on_CLOSE_clicked()
timer->stop();
capture.release();
}

@ -4,13 +4,14 @@
#include <QMainWindow>
#include <QImage>
#include <QMutex>
#include <QTimer>
#include "ui_mainwindow.h"
#include "../include/joystick.h"
#include "../include/qnode.hpp"
#include "../include/dashboard.h"
#include <sensor_msgs/BatteryState.h>
using namespace cv;
namespace Ui {
class MainWindow;
}
@ -45,10 +46,16 @@ public slots:
void slot_batteryState(sensor_msgs::BatteryState);
void Slider_raw_valueChanged(int v);
void Slider_linear_valueChanged(int v);
void importFrame();//read video
void slot_show_image(QImage image);//added
private slots:
void on_Stop_receive_clicked();
private slots:
void on_Open_receive_clicked();
private:
Ui::MainWindow *ui;
QNode qnode;
@ -56,6 +63,11 @@ private:
DashBoard *m_DashBoard_x;
DashBoard *m_DashBoard_th;
VideoCapture capture;
QTimer *timer;
Mat frame;
bool isCamerea = 0;
void initUis();
void setBtnStyles();
void connections();

@ -98,7 +98,7 @@
</property>
<property name="icon">
<iconset theme="://images/toolbar_dash.png">
<normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</iconset>
<normaloff>../../../Ros_Qt5_Gui_App/ui</normaloff>../../../Ros_Qt5_Gui_App/ui</iconset>
</property>
<property name="iconSize">
<size>
@ -143,7 +143,7 @@ margin:0px 0px 0px 0px;
</property>
<property name="icon">
<iconset theme="://images/toolbar_map.png">
<normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</iconset>
<normaloff>../../../Ros_Qt5_Gui_App/ui</normaloff>../../../Ros_Qt5_Gui_App/ui</iconset>
</property>
<property name="iconSize">
<size>
@ -188,7 +188,7 @@ margin:0px 0px 0px 0px;
</property>
<property name="icon">
<iconset theme="://images/toolbar_other.png">
<normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</iconset>
<normaloff>../../../Ros_Qt5_Gui_App/ui</normaloff>../../../Ros_Qt5_Gui_App/ui</iconset>
</property>
<property name="iconSize">
<size>
@ -203,7 +203,7 @@ margin:0px 0px 0px 0px;
<item row="0" column="0">
<widget class="QStackedWidget" name="stackedWidget_main">
<property name="currentIndex">
<number>2</number>
<number>1</number>
</property>
<widget class="QWidget" name="mainWidget">
<widget class="QLabel" name="label_2">
@ -224,8 +224,8 @@ margin:0px 0px 0px 0px;
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>680</x>
<y>290</y>
<x>870</x>
<y>300</y>
<width>271</width>
<height>121</height>
</rect>
@ -234,9 +234,126 @@ margin:0px 0px 0px 0px;
<string>UAV Widget</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox_13">
<property name="geometry">
<rect>
<x>90</x>
<y>20</y>
<width>661</width>
<height>401</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Logging</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<widget class="QLabel" name="tello_receiver">
<property name="minimumSize">
<size>
<width>600</width>
<height>270</height>
</size>
</property>
<property name="text">
<string>CameraLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QListView" name="view_logging_3">
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
<width>600</width>
<height>81</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>81</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>90</x>
<y>420</y>
<width>661</width>
<height>81</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<spacer name="horizontalSpacer_16">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="Open_receive">
<property name="minimumSize">
<size>
<width>211</width>
<height>71</height>
</size>
</property>
<property name="text">
<string>Open</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="Stop_receive">
<property name="minimumSize">
<size>
<width>211</width>
<height>71</height>
</size>
</property>
<property name="text">
<string>Stop</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_15">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="UGVWidget">
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>680</x>
@ -1135,7 +1252,7 @@ background-color: rgb(255,255,255);
</item>
</layout>
</widget>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>21</x>

Loading…
Cancel
Save