瀏覽代碼

Change RemoteCtrl_h264. add wheel speed slider for change wheel speed.

yuchuli 3 年之前
父節點
當前提交
92cb3d7135

+ 9 - 19
src/tool/RemoteCtrl_h264/RemoteCtrl_h264.pro

@@ -4,13 +4,15 @@
     error( "Couldn't find the common.pri file!" )
 }
 
+ QT       += core gui  xml network
 
-contains(QMAKE_HOST.arch, aarch64){
-    QT       += core gui  xml #webenginewidgets    #AGX
-    DEFINES += NVIDIA_AGX
-}else{
-    QT       += core gui  xml network  #webenginewidgets    #x86
-}
+
+#contains(QMAKE_HOST.arch, aarch64){
+#    QT       += core gui  xml #webenginewidgets    #AGX
+#    DEFINES += NVIDIA_AGX
+#}else{
+#    QT       += core gui  xml network  #webenginewidgets    #x86
+#}
 
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 
@@ -37,11 +39,8 @@ SOURCES += \
     ../../include/msgtype/rawpic.pb.cc \
     ../../include/msgtype/remotectrl.pb.cc \
     ../../plugin/common/pluginapp.cpp \
-    dialogbigpic.cpp \
     dialogsetpassword.cpp \
     dialogsetting.cpp \
-    ivpicview.cpp \
-    ivview.cpp \
     joyreadthread.cpp \
     main.cpp \
     mainwindow.cpp \
@@ -50,8 +49,6 @@ SOURCES += \
     speed.cpp \
     ../../driver/driver_cloud_grpc_thread/uploadthreadmsg.grpc.pb.cc \
     ../../include/msgtype/cloud.pb.cc \
-    dialogpic.cpp \
-    ivpicsave.cpp \
     ../../include/msgtype/uploadthreadmsg.pb.cc \
     grpcpc.cpp \
     remotecomm.cpp \
@@ -68,11 +65,8 @@ HEADERS += \
     ../../include/msgtype/rawpic.pb.h \
     ../../include/msgtype/remotectrl.pb.h \
     ../../plugin/common/pluginapp.h \
-    dialogbigpic.h \
     dialogsetpassword.h \
     dialogsetting.h \
-    ivpicview.h \
-    ivview.h \
     joyreadthread.h \
     mainwindow.h \
     myview.h \
@@ -81,8 +75,6 @@ HEADERS += \
     speed.h \
     ../../driver/driver_cloud_grpc_thread/uploadthreadmsg.grpc.pb.h \
     ../../include/msgtype/cloud.pb.h \
-    dialogpic.h \
-    ivpicsave.h \
     ../../include/msgtype/uploadthreadmsg.pb.h \
     grpcpc.h \
     remotecomm.h \
@@ -90,11 +82,9 @@ HEADERS += \
     rtspclientdown.h
 
 FORMS += \
-    dialogbigpic.ui \
     dialogsetpassword.ui \
     dialogsetting.ui \
-    mainwindow.ui \
-    dialogpic.ui
+    mainwindow.ui
 
 # Default rules for deployment.
 qnx: target.path = /tmp/$${TARGET}/bin

+ 0 - 256
src/tool/RemoteCtrl_h264/dialogbigpic.cpp

@@ -1,256 +0,0 @@
-#include "dialogbigpic.h"
-#include "ui_dialogbigpic.h"
-
-#include "mainwindow.h"
-extern iv::vision::rawpic grawpic[CAMERA_NUM];
-extern qint64 gTimeRawPic[CAMERA_NUM] ;
-extern QMutex gMutexPic[CAMERA_NUM];
-extern std::string gstrmem_pic[CAMERA_NUM];
-
-
-DialogBigPic::DialogBigPic(QWidget *parent) :
-    QDialog(parent),
-    ui(new Ui::DialogBigPic)
-{
-    ui->setupUi(this);
-
-    mpview = new MyView(this);
-    mpview->setObjectName(QStringLiteral("graphicsView"));
-    mpview->setGeometry(QRect(30, 30, 1000, 600));
-    mpview->setCacheMode(mpview->CacheBackground);
-
-    mscene = new QGraphicsScene;
-
-    mpPicView = new IVPicView();
-    mpPicView->start();
-
-    mpviewLeft = new MyView(this);
-    mpviewLeft->setObjectName(QStringLiteral("graphicsView"));
-    mpviewLeft->setGeometry(QRect(30, 30, 450, 300));
-    mpviewLeft->setCacheMode(mpview->CacheBackground);
-    msceneLeft = new QGraphicsScene;
-    mpPicViewLeft = new IVPicView();
-    mpPicViewLeft->start();
-
-    mpviewRight = new MyView(this);
-    mpviewRight->setObjectName(QStringLiteral("graphicsView"));
-    mpviewRight->setGeometry(QRect(30, 30, 450, 300));
-    mpviewRight->setCacheMode(mpview->CacheBackground);
-    msceneRight = new QGraphicsScene;
-    mpPicViewRight = new IVPicView();
-    mpPicViewRight->start();
-
-//    mnLastPicTime = 0;
-    int i;
-    for(i=0;i<3;i++)
-    {
-        mnLastPicTime[i] = 0;
-        mbDraw[i] = false;
-    }
-//    mbDraw = false;
-    connect(mpPicView,SIGNAL(painterupadate()),this,SLOT(onPainterUpdate()));
-    connect(mpPicViewLeft,SIGNAL(painterupadate()),this,SLOT(onPainterUpdate()));
-    connect(mpPicViewRight,SIGNAL(painterupadate()),this,SLOT(onPainterUpdate()));
-
-    mpview->scale(0.8,0.8);
-    mpviewLeft->scale(0.4,0.4);
-    mpviewRight->scale(0.4,0.4);
-
-    qDebug("wid : ",this->winId());
-
-
-    mppicshow[0] = new pluginapp(this->winId(),"big_center","plugin_picshow","/home/yuchuli/qt/modularization/src/plugin/build-plugin_picshow-Debug");
-    mppicshow[0]->SetAttr("rawpicmsgname",gstrmem_pic[0].data(),gstrmem_pic[0].size());
-
-    mppicshow[1] = new pluginapp(this->winId(),"big_left","plugin_picshow","/home/yuchuli/qt/modularization/src/plugin/build-plugin_picshow-Debug");
-    mppicshow[1]->SetAttr("rawpicmsgname",gstrmem_pic[1].data(),gstrmem_pic[1].size());
-
-    mppicshow[2] = new pluginapp(this->winId(),"big_right","plugin_picshow","/home/yuchuli/qt/modularization/src/plugin/build-plugin_picshow-Debug");
-    mppicshow[2]->SetAttr("rawpicmsgname",gstrmem_pic[2].data(),gstrmem_pic[2].size());
-
-    QTimer * timer = new QTimer();
-    connect(timer,SIGNAL(timeout()),this,SLOT(onTimerPic()));
-    timer->start(10);
-
-    setWindowTitle("View Picture");
-}
-
-DialogBigPic::~DialogBigPic()
-{
-    unsigned int i;
-    for(i=0;i<3;i++)delete mppicshow[i];
-    delete ui;
-}
-
-void DialogBigPic::onTimerPic()
-{
-
-    if(mbRefresh == false)return;
-
-    bool bUpdate = false;
-
-//    int ncam = mnCamera;
-//    if((mnLastPicTime != gTimeRawPic[ncam])&&(gTimeRawPic[ncam]!= 0))
-//    {
-//        gMutexPic[ncam].lock();
-//        mpPicView->SetPic(grawpic[ncam]);
-//        gMutexPic[ncam].unlock();
-//        bUpdate = true;
-//        mbDraw = true;
-//    }
-
-    int ncamcenter = 0;
-    int ncamleft = 2;
-    int ncamright = 3;
-    if(mbFront == false)
-    {
-        ncamcenter = 1;
-        ncamright = 2;
-        ncamleft = 3;
-    }
-
-
-    if((mnLastPicTime[0] != gTimeRawPic[ncamcenter])&&(gTimeRawPic[ncamcenter]!= 0))
-    {
-        gMutexPic[ncamcenter].lock();
-        mpPicView->SetPic(grawpic[ncamcenter]);
-        gMutexPic[ncamcenter].unlock();
-        bUpdate = true;
-        mnLastPicTime[0] = gTimeRawPic[ncamcenter];
- //       mbDraw[0] = true;
-    }
-
-    if((mnLastPicTime[1] != gTimeRawPic[ncamleft])&&(gTimeRawPic[ncamleft]!= 0))
-    {
-        gMutexPic[ncamleft].lock();
-        mpPicViewLeft->SetPic(grawpic[ncamleft]);
-        gMutexPic[ncamleft].unlock();
-        bUpdate = true;
-        mnLastPicTime[1] = gTimeRawPic[ncamleft];
-//        mbDraw[1] = true;
-    }
-
-    if((mnLastPicTime[2] != gTimeRawPic[ncamright])&&(gTimeRawPic[ncamright]!= 0))
-    {
-        gMutexPic[ncamright].lock();
-        mpPicViewRight->SetPic(grawpic[ncamright]);
-        gMutexPic[ncamright].unlock();
-        bUpdate = true;
-        mnLastPicTime[2] = gTimeRawPic[ncamright];
-//        mbDraw[2] = true;
-    }
-
-
-//    if(bUpdate)update();
-
-}
-
-void DialogBigPic::paintEvent(QPaintEvent *)
-{
-
-    if(mbDraw[0])
-    {
-        QImage image = mpPicView->GetImage();
-        mscene->clear();
-        mscene->addPixmap(QPixmap::fromImage(image));
-        mpview->setScene(mscene);
-        mpview->show();
-    }
-
-    if(mbDraw[1])
-    {
-        QImage image = mpPicViewLeft->GetImage();
-        msceneLeft->clear();
-        msceneLeft->addPixmap(QPixmap::fromImage(image));
-        mpviewLeft->setScene(msceneLeft);
-        mpviewLeft->show();
-    }
-
-    if(mbDraw[2])
-    {
-        QImage image = mpPicViewRight->GetImage();
-        msceneRight->clear();
-        msceneRight->addPixmap(QPixmap::fromImage(image));
-        mpviewRight->setScene(msceneRight);
-        mpviewRight->show();
-    }
-
-//    if(mbDraw)
-//    {
-//        QImage image = mpPicView->GetImage();
-//        mscene->clear();
-//        mscene->addPixmap(QPixmap::fromImage(image));
-//        mpview->setScene(mscene);
-//        mpview->show();
-
-//        msceneLeft->clear();
-//        msceneLeft->addPixmap(QPixmap::fromImage(image));
-//        mpviewLeft->setScene(msceneLeft);
-//        mpviewLeft->show();
-
-//        msceneRight->clear();
-//        msceneRight->addPixmap(QPixmap::fromImage(image));
-//        mpviewRight->setScene(msceneRight);
-//        mpviewRight->show();
-//    }
-
-}
-
-void DialogBigPic::resizeEvent(QResizeEvent *event)
-{
-    (void)event;
-     QRect rect = this->geometry();
-     double fwidth = rect.width()/1;
-     double fheight = rect.height()/1;
- //    mpview->setGeometry(0,0,fwidth,fheight);
-//     mpview->setGeometry(fwidth/4,0,fwidth/2,fheight);
-//     mpviewLeft->setGeometry(0,0,fwidth/4,fheight/2);
-//     mpviewRight->setGeometry(fwidth*3/4,0,fwidth/4,fheight/2);
-
-
-     qDebug("width : %f ",fwidth);
-     mppicshow[0]->SetGeometry(fwidth/4,0,fwidth/2,fheight);
-     mppicshow[1]->SetGeometry(0,0,fwidth/4,fheight/2);
-     mppicshow[2]->SetGeometry(fwidth*3/4,0,fwidth/4,fheight/2);
-//     rect.setX(rect.x());
-}
-
-void DialogBigPic::setRefresh(bool brefresh)
-{
-    mbRefresh = brefresh;
-}
-
-void DialogBigPic::onPainterUpdate()
-{
-    if(sender() == mpPicView)
-    {
-//        qDebug("front draw");
-        mbDraw[0] = true;
-    }
-    if(sender() == mpPicViewLeft)
-    {
-//        qDebug("left draw");
-        mbDraw[1] = true;
-    }
-    if(sender() == mpPicViewRight)
-    {
-//        qDebug("right draw");
-        mbDraw[2] = true;
-    }
-    update();
-}
-
-void DialogBigPic::setCamera(int n)
-{
-    mnCamera = n;
-}
-
-void DialogBigPic::SetFront()
-{
-    mbFront = true;
-}
-
-void DialogBigPic::SetRear()
-{
-    mbFront = false;
-}

+ 0 - 70
src/tool/RemoteCtrl_h264/dialogbigpic.h

@@ -1,70 +0,0 @@
-#ifndef DIALOGBIGPIC_H
-#define DIALOGBIGPIC_H
-
-#include <QDialog>
-
-
-#include "pluginapp.h"
-
-namespace Ui {
-class DialogBigPic;
-}
-
-#include "ivpicview.h"
-#include "myview.h"
-
-class DialogBigPic : public QDialog
-{
-    Q_OBJECT
-
-public:
-    explicit DialogBigPic(QWidget *parent = nullptr);
-    ~DialogBigPic();
-
-private slots:
-    virtual void paintEvent(QPaintEvent *);
-    void onTimerPic();
-   void onPainterUpdate();
-
-
-public:
-     void resizeEvent(QResizeEvent *event);
-
-     void setRefresh(bool brefresh);
-
-     void setCamera(int n);
-
-     void SetFront();
-     void SetRear();
-
-private:
-    Ui::DialogBigPic *ui;
-
-    MyView * mpview;
-    QGraphicsScene *mscene;
-    IVPicView * mpPicView;
-
-    MyView * mpviewLeft;
-    QGraphicsScene *msceneLeft;
-    IVPicView * mpPicViewLeft;
-
-    MyView * mpviewRight;
-    QGraphicsScene *msceneRight;
-    IVPicView * mpPicViewRight;
-
-//    qint64 mnLastPicTime;
-    qint64 mnLastPicTime[3];
-
-//    bool mbDraw;
-    bool mbDraw[3];
-
-    bool mbRefresh= false;
-
-    int mnCamera = 0;
-
-    bool mbFront = true;  //if false, rear drive
-
-    pluginapp * mppicshow[3];
-};
-
-#endif // DIALOGBIGPIC_H

+ 0 - 19
src/tool/RemoteCtrl_h264/dialogbigpic.ui

@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>DialogBigPic</class>
- <widget class="QDialog" name="DialogBigPic">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>1920</width>
-    <height>600</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Dialog</string>
-  </property>
- </widget>
- <resources/>
- <connections/>
-</ui>

+ 0 - 104
src/tool/RemoteCtrl_h264/dialogpic.cpp

@@ -1,104 +0,0 @@
-#include "dialogpic.h"
-#include "ui_dialogpic.h"
-#include "mainwindow.h"
-
-extern iv::vision::rawpic grawpic[CAMERA_NUM];
-extern qint64 gTimeRawPic[CAMERA_NUM] ;
-extern QMutex gMutexPic[CAMERA_NUM];
-
-
-
-DialogPic::DialogPic(QWidget *parent) :
-    QDialog(parent),
-    ui(new Ui::DialogPic)
-{
-    ui->setupUi(this);
-
-    int i;
-    for(i=0;i<4;i++)
-    {
-        mpview[i] = new MyView(this);
-        mpview[i]->setObjectName(QStringLiteral("graphicsView"));
-        mpview[i]->setGeometry(QRect(30, 30, 600, 600));
-        mpview[i]->setCacheMode(mpview[i]->CacheBackground);
-
-        mscene[i] = new QGraphicsScene;
-
-        mpPicView[i] = new IVPicView();
-        mpPicView[i]->start();
-        mnLastPicTime[i] = 0;
-        mbDraw[i] = false;
-    }
-
-    QTimer * timer = new QTimer();
-    connect(timer,SIGNAL(timeout()),this,SLOT(onTimerPic()));
-    timer->start(10);
-
-    setWindowTitle("View All Picture");
-}
-
-DialogPic::~DialogPic()
-{
-    qDebug("delete dialog");
-    delete ui;
-}
-
-void DialogPic::resizeEvent(QResizeEvent *event)
-{
-    (void)event;
-     QRect rect = this->geometry();
-     double fwidth = rect.width()/2;
-     double fheight = rect.height()/2;
-     mpview[0]->setGeometry(0,0,fwidth,fheight);
-     mpview[1]->setGeometry(fwidth,0,fwidth,fheight);
-     mpview[2]->setGeometry(0,fheight,fwidth,fheight);
-     mpview[3]->setGeometry(fwidth,fheight,fwidth,fheight);
-//     rect.setX(rect.x());
-}
-
-void DialogPic::onTimerPic()
-{
-    int i;
-
-    if(mbRefresh == false)return;
-
-    bool bUpdate = false;
-    for(i=0;i<4;i++)
-    {
-        if(mnLastPicTime[i] != gTimeRawPic[i])
-        {
-            gMutexPic[i].lock();
-            mpPicView[i]->SetPic(grawpic[i]);
-            gMutexPic[i].unlock();
-            bUpdate = true;
-            mbDraw[i] = true;
-            mnLastPicTime[i] = gTimeRawPic[i];
-//            qDebug("draw time is %ld",mnLastPicTime[i]);
-        }
-    }
-
-    if(bUpdate)update();
-
-}
-
-void DialogPic::paintEvent(QPaintEvent *)
-{
-    int i;
-    for(i=0;i<4;i++)
-    {
-        if(mbDraw[i])
-        {
-            QImage image = mpPicView[i]->GetImage();
-            mscene[i]->clear();
-            mscene[i]->addPixmap(QPixmap::fromImage(image));
-            mpview[i]->setScene(mscene[i]);
-            mpview[i]->show();
-        }
-        mbDraw[i] = false;
-    }
-}
-
-void DialogPic::setRefresh(bool brefresh)
-{
-    mbRefresh = brefresh;
-}

+ 0 - 49
src/tool/RemoteCtrl_h264/dialogpic.h

@@ -1,49 +0,0 @@
-#ifndef DIALOGPIC_H
-#define DIALOGPIC_H
-
-#include <QDialog>
-
-namespace Ui {
-class DialogPic;
-}
-
-#include "ivpicview.h"
-#include "myview.h"
-
-
-class DialogPic : public QDialog
-{
-    Q_OBJECT
-
-public:
-    explicit DialogPic(QWidget *parent = 0);
-    ~DialogPic();
-
-private slots:
-    void onTimerPic();
-
-    virtual void paintEvent(QPaintEvent *);
-
-
-
-public:
-     void resizeEvent(QResizeEvent *event);
-
-     void setRefresh(bool brefresh);
-private:
-    Ui::DialogPic *ui;
-
-    MyView * mpview[4];
-    QGraphicsScene *mscene[4];
-
-    IVPicView * mpPicView[4];
-
-    qint64 mnLastPicTime[4];
-
-    bool mbDraw[4];
-
-    bool mbRefresh= false;
-
-};
-
-#endif // DIALOGPIC_H

+ 0 - 19
src/tool/RemoteCtrl_h264/dialogpic.ui

@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>DialogPic</class>
- <widget class="QDialog" name="DialogPic">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>1366</width>
-    <height>680</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Dialog</string>
-  </property>
- </widget>
- <resources/>
- <connections/>
-</ui>

+ 0 - 155
src/tool/RemoteCtrl_h264/ivpicsave.cpp

@@ -1,155 +0,0 @@
-#include "ivpicsave.h"
-
-#include <QDateTime>
-
-#include <opencv2/opencv.hpp>
-#include <opencv2/core.hpp>
-
-#ifdef NVIDIA_AGX
-#include <opencv2/imgcodecs/legacy/constants_c.h>    //OpenCV4 use this line
-#include <opencv2/imgproc/types_c.h>   //OpenCV4 use this line
-#endif
-
-ivpicsave::ivpicsave(QString strdir,QString strsuffix,std::string strvin)
-{
-    mstrdir = strdir;
-    mstrsuffix = strsuffix;
-    mstrvin = strvin;
-    mnWriteIndex = 0;
-}
-
-void ivpicsave::SetPic(iv::vision::rawpic pic)
-{
-    if((mbGetPicSize == true ) && (mbSave == false))
-    {
-        return;
-    }
-    mMutex.lock();
-    mrawpic.CopyFrom(pic);
-    mnWriteIndex++;
-    mMutex.unlock();
-}
-
-void ivpicsave::run()
-{
-    int nReadIndex = 0;
-    std::vector<iv::vision::rawpic> xvectorpic;
-    bool bgetfps = false;
-    double ffps = 30;
-    while(!QThread::isInterruptionRequested())
-    {
-        if((mbSave == false)&&(bgetfps))
-        {
-            msleep(100);
-            continue;
-        }
-        bool bNew = false;
-        iv::vision::rawpic pic;
-        if(mnWriteIndex != nReadIndex)
-        {
-
-            mMutex.lock();
-            pic.CopyFrom(mrawpic);
-            mMutex.unlock();
-            if(bgetfps == false)
-            {
-                xvectorpic.push_back(pic);
-                if(xvectorpic.size()>=10)
-                {
-                    std::vector<qint64> xtimediff;
-                    int j;
-                    for(j=1;j<xvectorpic.size();j++)
-                    {
-                        qint64 diff = xvectorpic[j].time() - xvectorpic[j-1].time();
-                        xtimediff.push_back(diff);
-                    }
-                    qint64 totaldiff = 0;
-                    for(j=0;j<xtimediff.size();j++)
-                    {
-                        totaldiff = totaldiff + xtimediff[j];
-                    }
-                    qint64 avgdiff = totaldiff/xtimediff.size();
-                    ffps = avgdiff;
-                    if(ffps<1.0)ffps =1.0;
-                    if(ffps>1000.0)ffps = 1000.0;
-                    ffps = 1000.0/ffps;
-                    mMutexSave.lock();
-                    mfps = ffps;
-                    mnpicheight = xvectorpic[0].height();
-                    mnpicwidth = xvectorpic[0].width();
-                    mMutexSave.unlock();
-                    mbGetPicSize = true;
-                    bgetfps = true;
-                    xvectorpic.clear();
-                    xtimediff.clear();
-                }
-            }
-            nReadIndex++;
-            bNew = true;
-        }
-
-        if(mbSave == false)
-        {
-            msleep(1);
-            continue;
-        }
-        if(bNew)
-        {
-            cv::Mat mat(pic.height(),pic.width(),pic.mattype());
-
-            if(mbSave)
-            {
-                if(pic.type() == 1)
-                    memcpy(mat.data,pic.picdata().data(),mat.rows*mat.cols*mat.elemSize());
-                else
-                {
-                    std::vector<unsigned char> buff(pic.picdata().data(),pic.picdata().data()+pic.picdata().size());
-                    mat = cv::imdecode(buff,CV_LOAD_IMAGE_COLOR);
-                }
-                int font = cv::FONT_HERSHEY_DUPLEX;
-                QDateTime xrecvtime = QDateTime::fromMSecsSinceEpoch(pic.time());
-         //       char strtext[256];
-          //      snprintf(strtext,"%s",xrecvtime.toString("yyyy-MM-dd hh:mm:ss:zzz").toLatin1().data());
-                std::string strtext = xrecvtime.toString("yyyy-MM-dd hh:mm:ss:zzz").toStdString();
-                double fratio = pic.width()/640;
-                int fontsize = 0.5*fratio;
-                if(fontsize<1)fontsize = 1;
-                cv::putText(mat,strtext,cv::Point(pic.width() - 230*fratio,30*fratio),font,0.5*fratio,cv::Scalar(0,255,0),fontsize);
-                cv::putText(mat,mstrvin,cv::Point(10,30*fratio),font,0.5*fratio,cv::Scalar(0,255,0),fontsize);
-            }
-
-
-            mMutexSave.lock();
-            if(mbSave)
-            {
-                mWriter<<mat;
-            }
-            mMutexSave.unlock();
-        }
-        msleep(10);
-    }
-}
-
-void ivpicsave::startsave()
-{
-    std::string strfilename;
-    strfilename = mstrdir.toStdString() + QDateTime::currentDateTime().toString("yyyy-MM-dd-hh-mm-ss-zzz").toStdString() +"-" + mstrsuffix.toStdString() +".avi";
-    mMutexSave.lock();
-    mWriter.open(strfilename,cv::VideoWriter::fourcc('M','P','4','2'),10.0,cv::Size(mnpicwidth,mnpicheight),1);
-    if(mWriter.isOpened())
-    {
-        mbSave = true;
-    }
-    mMutexSave.unlock();
-}
-
-void ivpicsave::stopsave()
-{
-    if(mbSave)
-    {
-        mMutexSave.lock();
-        mbSave = false;
-        mWriter.release();
-        mMutexSave.unlock();
-    }
-}

+ 0 - 44
src/tool/RemoteCtrl_h264/ivpicsave.h

@@ -1,44 +0,0 @@
-#ifndef IVPICSAVE_H
-#define IVPICSAVE_H
-
-#include "rawpic.pb.h"
-
-#include <QMutex>
-
-#include <QThread>
-
-#include "opencv2/video.hpp"
-#include "opencv2/videoio.hpp"
-
-class ivpicsave : public QThread
-{
-public:
-    ivpicsave(QString strdir,QString strsuffix,std::string strvin);
-
-private:
-    iv::vision::rawpic mrawpic;
-    QMutex mMutex;
-    QMutex mMutexSave;
-    int mnWriteIndex = 0;
-    cv::VideoWriter mWriter;
-    bool mbSave = false;
-    QString mstrdir;
-    QString mstrsuffix;
-    std::string mstrvin;
-    double mfps;
-    int mnpicwidth = 1920;
-    bool mbGetPicSize = false;
-    int mnpicheight = 1080;
-
-    void run();
-
-public:
-    void SetPic(iv::vision::rawpic pic);
-
-    void startsave();
-    void stopsave();
-
-
-};
-
-#endif // IVPICSAVE_H

+ 0 - 111
src/tool/RemoteCtrl_h264/ivpicview.cpp

@@ -1,111 +0,0 @@
-#include "ivpicview.h"
-
-#include <QDateTime>
-
-#include <opencv2/opencv.hpp>
-#include <opencv2/core.hpp>
-
-#ifdef NVIDIA_AGX
-#include <opencv2/imgcodecs/legacy/constants_c.h>    //OpenCV4 use this line
-#include <opencv2/imgproc/types_c.h>   //OpenCV4 use this line
-#endif
-
-#define VIEW_WIDTH 640
-#define VIEW_HEIGHT 360
-
-IVPicView::IVPicView()
-{
-    mimagepaint = new QImage(VIEW_WIDTH, VIEW_HEIGHT, QImage::Format_RGB32);//画布的初始化大小设为300*300,使用32位颜色
-}
-
-void IVPicView::run()
-{
-    while(!QThread::isInterruptionRequested())
-    {
-        if(mnReadIndex != mnWriteIndex)
-        {
-            paint();
-            mnReadIndex = mnWriteIndex;
-            mbImageUpdate = true;
-        }
-        else
-        {
-            msleep(10);
-        }
-    }
-}
-
-
-
-void IVPicView::paint()
-{
-    iv::vision::rawpic pic;
-    mMutex.lock();
-    pic.CopyFrom(mrawpic);
-    mMutex.unlock();
-
-    cv::Mat mat(pic.height(),pic.width(),pic.mattype());
-
-    if(pic.type() == 1)
-        memcpy(mat.data,pic.picdata().data(),mat.rows*mat.cols*mat.elemSize());
-    else
-    {
-//        qDebug("jpg");
-        std::vector<unsigned char> buff(pic.picdata().data(),pic.picdata().data()+pic.picdata().size());
-        mat = cv::imdecode(buff,CV_LOAD_IMAGE_COLOR);
-        int font = cv::FONT_HERSHEY_DUPLEX;
-        QDateTime xrecvtime = QDateTime::fromMSecsSinceEpoch(pic.time());
- //       char strtext[256];
-  //      snprintf(strtext,"%s",xrecvtime.toString("yyyy-MM-dd hh:mm:ss:zzz").toLatin1().data());
-        std::string strtext = xrecvtime.toString("yyyy-MM-dd hh:mm:ss:zzz").toStdString();
-        double fratio = pic.width()/640;
-        cv::putText(mat,strtext,cv::Point(pic.width() - 230*fratio,30*fratio),font,0.5*fratio,cv::Scalar(0,255,0),0.5*fratio);
-    }
-
-    cv::cvtColor(mat, mat, CV_BGR2RGB);
-    QImage image2 = QImage((uchar*)(mat.data), mat.cols, mat.rows,  QImage::Format_RGB888);
-
-    mMutexPaint.lock();
-
-//    delete mimagepaint;
-//    mimagepaint = new  QImage(mat.cols, mat.rows,  QImage::Format_RGB888);
-    *mimagepaint = image2.copy();
-    //  *mimagepaint = image2;
- //   mimagepaint = new QImage(image2);
-    mMutexPaint.unlock();
-
-    mat.release();
-
-    emit painterupadate();
-}
-
-QImage IVPicView::GetImage()
-{
-
-    mMutexPaint.lock();
-//    QImage imagertn(*mimagepaint);
-//    QImage imagertn(mimagepaint->width(), mimagepaint->height(), QImage::Format_RGB32);
-    QImage imagertn = mimagepaint->copy();
-    mMutexPaint.unlock();
-    mbImageUpdate = false;
-    return imagertn;
-}
-
-bool IVPicView::IsHaveNew()
-{
-    return mbImageUpdate;
-}
-
-int IVPicView::GetType()
-{
-    return 2;
-}
-
-void IVPicView::SetPic(iv::vision::rawpic pic)
-{
-    mMutex.lock();
-    mrawpic.CopyFrom(pic);
-    mnWriteIndex++;
-    mMutex.unlock();
-}
-

+ 0 - 40
src/tool/RemoteCtrl_h264/ivpicview.h

@@ -1,40 +0,0 @@
-#ifndef IVPICVIEW_H
-#define IVPICVIEW_H
-
-#include "ivview.h"
-
-#include "rawpic.pb.h"
-
-class IVPicView : public IVView
-{
-    Q_OBJECT
-public:
-    IVPicView();
-
-public:
-    QImage GetImage();
-    bool IsHaveNew();
-    int GetType();
-private:
-    void run();
-    int mnWriteIndex = 0;
-    int mnReadIndex = 0;
-
-private:
-    bool mbImageUpdate = false;
-    QMutex mMutex;
-    QMutex mMutexPaint;
-
-private:
-    void paint();
-    QImage * mimagepaint;
-signals:
-    void painterupadate();
-
-private:
-    iv::vision::rawpic mrawpic;
-public:
-    void SetPic(iv::vision::rawpic pic);
-};
-
-#endif // IVPICVIEW_H

+ 0 - 25
src/tool/RemoteCtrl_h264/ivview.cpp

@@ -1,25 +0,0 @@
-#include "ivview.h"
-
-IVView::IVView()
-{
-
-
-}
-
-QImage IVView::GetImage()
-{
-    QImage * pimage = new QImage(100,100,QImage::Format_RGB32);
-    return *pimage;
-
-
-}
-
-bool IVView::IsHaveNew()
-{
-    return false;
-}
-
-int IVView::GetType()
-{
-    return 0;
-}

+ 0 - 34
src/tool/RemoteCtrl_h264/ivview.h

@@ -1,34 +0,0 @@
-#ifndef IVVIEW_H
-#define IVVIEW_H
-
-#include <QImage>
-#include <QGraphicsScene>
-#include <QTimer>
-#include <QPainter>
-
-#include <QThread>
-
-#include <QMutex>
-
-//#include <pcl/conversions.h>
-//#include <pcl/point_cloud.h>
-//#include <pcl/point_types.h>
-
-
-class IVView : public QThread
-{
-public:
-    IVView();  
-
-public:
-    virtual QImage GetImage();
-    virtual bool IsHaveNew();
-    virtual int GetType();
-
-private:
-
-
-
-};
-
-#endif // IVVIEW_H

+ 64 - 246
src/tool/RemoteCtrl_h264/mainwindow.cpp

@@ -60,88 +60,6 @@ qint64 gTimeTrace = 0;
 
 void * gpaframe;
 
-void Listenpic(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
-{
-    if(nSize<50)return;
-
-    int * pnhead = (int * )strdata;
-    std::cout<<" pac count: "<<*pnhead<<" first pac size: "<<*(pnhead + 1)<<std::endl;
-
-    std::cout<<" pic name : "<<strmemname<<std::endl;
-    int npaccount = *pnhead;
-    int j;
-    int ndatapos = 0;
-
-    char * strfdata = (char *)(strdata + 11*sizeof(int));
-    for(j=0;j<npaccount;j++)
-    {
-        int ndatasize = *(pnhead +j +1);
-        char * strframedata = new char[ndatasize];
-        memcpy(strframedata,strfdata + ndatapos,ndatasize);
-        ndatapos = ndatapos + ndatasize;
-        iv::modulecomm::ModuleSendMsg(gpaframe, strframedata,ndatasize);
-        std::this_thread::sleep_for(std::chrono::milliseconds(15));
-
-    }
-    return;
-    iv::vision::rawpic pic;
-    if(false == pic.ParseFromArray(strdata,nSize))
-    {
-        std::cout<<"picview Listenpic fail."<<std::endl;
-        return;
-    }
-    int indexpic = -1;
-    for(int i =0;i<CAMERA_NUM;i++)
-    {
-        if(strncmp(strmemname,gstrmem_pic[i].data(),256) == 0)
-        {
-            indexpic = i;
-            break;
-        }
-    }
-    if(indexpic >= 0)
-    {
-    gMutexPic[indexpic].lock();
-    grawpic[indexpic].CopyFrom(pic);
-    gTimeRawPic[indexpic] = QDateTime::currentMSecsSinceEpoch();
-    gMutexPic[indexpic].unlock();
-    gw->saveavi(indexpic);
-    }
-}
-
-void Listensimpletrace(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
-{
-    int npoint = nSize/sizeof(iv::simpletrace);
-    if(npoint < 1)
-    {
-        std::cout<<"simple trace is very smalll"<<std::endl;
-        return;
-    }
-
-    gMutexTrace.lock();
-    gvectorsimplerace.clear();
-    gvectorsimplerace.resize(npoint);
-    memcpy(gvectorsimplerace.data(),strdata,npoint*sizeof(iv::simpletrace));
-    gTimeTrace = QDateTime::currentMSecsSinceEpoch();
-    gMutexTrace.unlock();
-
-
-}
-
-void Listengpsimu(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
-{
-//        ggpsimu->UpdateGPSIMU(strdata,nSize);
-
-    iv::gps::gpsimu xgpsimu;
-    if(!xgpsimu.ParseFromArray(strdata,nSize))
-    {
-        std::cout<<"ListenRaw Parse error."<<std::endl;
-    }
-    ggpsimu.CopyFrom(xgpsimu);
-    gTimeGPSIMUUpdate = QDateTime::currentMSecsSinceEpoch();
-
-}
-
 MainWindow::MainWindow(QWidget *parent)
     : QMainWindow(parent)
     , ui(new Ui::MainWindow)
@@ -183,15 +101,8 @@ MainWindow::MainWindow(QWidget *parent)
 
     int i;
 
-
-
     CreateView();
 
-    mpPicView = new IVPicView();
-    mpPicView->start();
-
-
-
     int nstation = gvectorpos.size();
     for(i=0;i<nstation;i++)
     {
@@ -243,23 +154,15 @@ MainWindow::MainWindow(QWidget *parent)
     mstrVIN = mgrpcpc->GetVIN().data();
     mstrVIN = " VIN:"+ mstrVIN+" ";
 
-    mpPicSave[0] = new ivpicsave("./","front",mstrVIN.toStdString());
-    mpPicSave[1] = new ivpicsave("./","rear",mstrVIN.toStdString());
-    mpPicSave[2] = new ivpicsave("./","left",mstrVIN.toStdString());
-    mpPicSave[3] = new ivpicsave("./","right",mstrVIN.toStdString());
 
-    for(i=0;i<4;i++)
-    {
-//        mpPicSave[i]->start();
-    }
 
-    mppicdlg = new DialogPic(this);
-    mppicdlg->setModal(false);
-    connect(mppicdlg,SIGNAL(finished(int)),this,SLOT(onCloseDlg()));
+//    mppicdlg = new DialogPic(this);
+//    mppicdlg->setModal(false);
+//    connect(mppicdlg,SIGNAL(finished(int)),this,SLOT(onCloseDlg()));
 
-    mpbigpicdlg = new DialogBigPic(this);
-    mpbigpicdlg->setModal(false);
-    connect(mpbigpicdlg,SIGNAL(finished(int)),this,SLOT(onCloseBigDlg()));
+//    mpbigpicdlg = new DialogBigPic(this);
+//    mpbigpicdlg->setModal(false);
+//    connect(mpbigpicdlg,SIGNAL(finished(int)),this,SLOT(onCloseBigDlg()));
 
     QLabel * pLabel = new QLabel();
     pLabel->setFixedWidth(600);
@@ -267,12 +170,7 @@ MainWindow::MainWindow(QWidget *parent)
     mpLabelLatency = pLabel;
     ui->statusbar->addPermanentWidget(pLabel);
 
-    mpasimpletrace = iv::modulecomm::RegisterRecv("simpletrace",Listensimpletrace);
-
-    void * pa = iv::modulecomm::RegisterRecv(gstrmem_gpsimu.data(),Listengpsimu);
-
-    for(i=0;i<CAMERA_NUM;i++)
-        pa = iv::modulecomm::RegisterRecv(gstrmem_pic[i].data(),Listenpic);
+    ui->horizontalSlider_wheelspeed->setRange(1,30);
 
     connect(this,SIGNAL(CamUpdate(int)),this,SLOT(onCamUpdate(int)));
 
@@ -288,8 +186,6 @@ MainWindow::MainWindow(QWidget *parent)
 MainWindow::~MainWindow()
 {
 
-//    delete mppicshow;
-//    delete mpbaiduapp;
     mbThreadrun = false;
     int i;
     mpthreadinfo->join();
@@ -304,22 +200,24 @@ MainWindow::~MainWindow()
 
 void MainWindow::CreateView()
 {
-    mMapview = new QWebEngineView(ui->centralwidget);
+//    mMapview = new QWebEngineView(ui->centralwidget);
 //    qDebug((QDir::currentPath()).toLatin1().data());
-    mMapview->load(QUrl(QString("file:///%1/%2").arg(QApplication::applicationDirPath()).arg("BaiDuMap.html")));
+//    mMapview->load(QUrl(QString("file:///%1/%2").arg(QApplication::applicationDirPath()).arg("BaiDuMap.html")));
 
-    mMapview->setGeometry(10,10,800,800);
+ //   mMapview->setGeometry(10,10,800,800);
 
 //    mMapview->page()->runJavaScript("theLocation(117.355,39.066);");  //117.355,39.066
 
     mpWheel = new Speed(ui->groupBox_rem);
     mpWheel->settitle(QStringLiteral("方向盘"));
+    mpWheel->setminvalue(550);
+    mpWheel->setmaxvalue(-550);
 
     mpAcc = new Speed(ui->groupBox_rem);
 
     mpAcc->settitle(QStringLiteral("油门"));
     mpAcc->updatevalue(0);
-    mpAcc->setminvalue(0);
+    mpAcc->setminvalue(-100);
     mpAcc->setmaxvalue(100);
 
     mpBrake = new Speed(ui->groupBox_rem);
@@ -361,7 +259,6 @@ void MainWindow::CreateView()
 
     ui->radioButton_Null->setChecked(true);
 
-    ui->radioButton_picfront->setChecked(true);
 
 
 }
@@ -389,10 +286,11 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event)
 
 void MainWindow::resizeEvent(QResizeEvent *event)
 {
+    (void)event;
     QSize sizemain = ui->centralwidget->size();
     qDebug("size x = %d y=%d",sizemain.width(),sizemain.height());
 
-    mMapview->setVisible(false);
+//    mMapview->setVisible(false);
 //    mMapview->setGeometry(10,10,sizemain.width()/2,sizemain.height()*3/5);
 
 //    mpbaiduapp->SetGeometry(10,30,sizemain.width()/2,sizemain.height()*3/5);
@@ -451,13 +349,7 @@ void MainWindow::resizeEvent(QResizeEvent *event)
     mpAcc->setGeometry(0 ,sizemain.height()/6 + sizemain.height()/3,speed_width,speed_width);
     ui->groupBox_rem->setGeometry(grouppos_x,grouppos_y,grouppos_width,grouppos_height);
 
-//    int grouppic_x = 10 + sizemain.width()*6/10 + 10;
-//    int grouppic_y = 20 + sizemain.height() *3/5;
-//    int grouppic_width = sizemain.width()*4/10 - 30;
-//    int grouppic_height = sizemain.height()*1/10;
 
-//    ui->groupBox_picsel->setGeometry(grouppic_x,grouppic_y,grouppic_width,grouppic_height);
-    ui->groupBox_picsel->setVisible(false);
 
     int groupmap_x = 0;
     int groupmap_y = sizemain.height()*1/3;
@@ -538,7 +430,7 @@ void MainWindow::on_pushButton_test_clicked()
 
     char strscript[256];
     snprintf(strscript,255,"theLocation(%11.7f,%11.7f);",flon,flat);
-    mMapview->page()->runJavaScript(strscript);
+//    mMapview->page()->runJavaScript(strscript);
 }
 
 void MainWindow::on_radioButton_manual_clicked()
@@ -589,16 +481,12 @@ void MainWindow::onTimerManual()
             switch (mnShift) {
             case 1:
                 ui->radioButton_Drive->setChecked(true);
-                ui->radioButton_picfront->setChecked(true);
-                on_radioButton_picfront_clicked();
                 break;
             case 0:
                 ui->radioButton_Null->setChecked(true);
                 break;
             case -1:
                 ui->radioButton_Rear->setChecked(true);
-                ui->radioButton_picrear->setChecked(true);
-                on_radioButton_picrear_clicked();
                 break;
             default:
                 break;
@@ -759,7 +647,7 @@ void MainWindow::onTimerManual()
         }
     }
 
-    if(mfWheel != fOldWheel)mpWheel->updatevalue(mfWheel);
+    if(mfWheel != fOldWheel)mpWheel->updatevalue(mfWheel*5.5);
     if(mfAcc != fOldAcc)mpAcc->updatevalue(mfAcc);
     if(mfBrake != fOldBrake)mpBrake->updatevalue(mfBrake);
 }
@@ -815,22 +703,7 @@ void MainWindow::onTimerUpdatePic()
     static int pos = 0;
     static std::vector<iv::simpletrace> xvectorsimpletrace;
 
-    if((mnSelPic>=0)&&(mnSelPic<4))
-    {
-        if((gTimeRawPic[mnSelPic] != time_pic) && (gTimeRawPic[mnSelPic] != 0))
-  //      if((gTimeRawPic[mnSelPic] != time_pic))
-        {
-            time_pic = gTimeRawPic[mnSelPic];
-            iv::vision::rawpic xpic;
-            gMutexPic[mnSelPic].lock();
-            xpic.CopyFrom(grawpic[mnSelPic]);
-            gMutexPic[mnSelPic].unlock();
-            mpPicView->SetPic(xpic);
 
-        }
-    }
-
-    if(mpPicView->IsHaveNew())update();
 
     if(gTimeTrace != time_trace)
     {
@@ -862,7 +735,7 @@ void MainWindow::onTimerUpdatePic()
 
 
             QString cmd = QString("settrace(\"%1\",\"%2\")").arg(numJson).arg(num2Json);
-            mMapview->page()->runJavaScript(cmd);
+//            mMapview->page()->runJavaScript(cmd);
         }
 
     }
@@ -926,16 +799,32 @@ void MainWindow::onTimerUpdateView()
 
 
 
+}
+
+void MainWindow::onCamUpdate(int ncampos, QImage image)
+{
+    int i = ncampos;
+ //   ui->label_pic->setPixmap(QPixmap::fromImage(image));
+    mpsceneImg[i]->clear();
+//           mpsceneImg[i]->addPixmap(QPixmap::fromImage(image));
+    mpsceneImg[i]->addPixmap(QPixmap::fromImage(image));
+    mpviewImg[i]->setScene(mpsceneImg[i]);
+    mpviewImg[i]->show();
 }
 
 void MainWindow::paintEvent(QPaintEvent *)
 {
     int i;
-//    QTime xTime;
+    QTime xTime;
+    xTime;
+    xTime.start();
+    int nupdate = 0;
     for(i=0;i<NUM_CAM;i++)
     {
+ //       continue;
         if(mbCamUpdate[i])
         {
+            nupdate++;
  //           xTime.start();
  //           std::cout<<" copy image. "<<std::endl;
             mMutexCam[i].lock();
@@ -953,28 +842,8 @@ void MainWindow::paintEvent(QPaintEvent *)
 //            std::cout<<" update a image use. "<<xTime.elapsed()<<std::endl;
         }
     }
-//    if(mbCamUpdate[0])
-//    {
-//        std::cout<<" copy image. "<<std::endl;
-//        mMutexCam[0].lock();
-//        QImage image = mpImageCam[0]->copy();
-//        mbCamUpdate[0] = false;
-//        mMutexCam[0].unlock();
-//        //       QImage image = mpPicView->GetImage();
-//        mscene->clear();
-//        mscene->addPixmap(QPixmap::fromImage(image));
-//        mmyview->setScene(mscene);
-//        mmyview->show();
-//    }
-    if(!mpPicView->IsHaveNew())
-    {
-        return;
-    }
-    else
-    {
-
+//    std::cout<<" time upadate time: "<<xTime.elapsed()<<" update cout:"<<nupdate<<std::endl;
 
-    }
 }
 
 void MainWindow::on_pushButton_Go_clicked()
@@ -1017,7 +886,7 @@ void MainWindow::on_comboBox_Station_currentIndexChanged(int index)
 
     char strscript[256];
     snprintf(strscript,255,"objLocation(%11.7f,%11.7f);",xpos.mflon,xpos.mflat);
-    mMapview->page()->runJavaScript(strscript);
+ //   mMapview->page()->runJavaScript(strscript);
 
 }
 
@@ -1043,110 +912,38 @@ void MainWindow::on_checkBox_Rear_clicked()
 void MainWindow::on_radioButton_Drive_clicked()
 {
     mnShift = 1;
-    ui->radioButton_picfront->setChecked(true);
+
 //    on_radioButton_picfront_clicked();
-    mpbigpicdlg->SetFront();
 }
 
 void MainWindow::on_radioButton_Null_clicked()
 {
     mnShift = 0;
-    mpbigpicdlg->SetFront();
-}
-
-void MainWindow::on_radioButton_Rear_clicked()
-{
-    mnShift = -1;
-    ui->radioButton_picrear->setChecked(true);
-//    on_radioButton_picrear_clicked();
-    mpbigpicdlg->SetRear();
-}
-
-void MainWindow::on_radioButton_picfront_clicked()
-{
-
-    mnSelPic = 0;
-    mppicshow->SetAttr("rawpicmsgname",gstrmem_pic[mnSelPic].data(),gstrmem_pic[mnSelPic].size());
-    mpbigpicdlg->setCamera(mnSelPic);
 }
 
-void MainWindow::on_radioButton_picrear_clicked()
-{
-    mnSelPic = 1;
-    mppicshow->SetAttr("rawpicmsgname",gstrmem_pic[mnSelPic].data(),gstrmem_pic[mnSelPic].size());
-    mpbigpicdlg->setCamera(mnSelPic);
-}
-
-void MainWindow::on_radioButton_picleft_clicked()
-{
-    mnSelPic = 2;
-    mppicshow->SetAttr("rawpicmsgname",gstrmem_pic[mnSelPic].data(),gstrmem_pic[mnSelPic].size());
-    mpbigpicdlg->setCamera(mnSelPic);
-}
-
-void MainWindow::on_radioButton_picright_clicked()
-{
-    mnSelPic = 3;
-    mppicshow->SetAttr("rawpicmsgname",gstrmem_pic[mnSelPic].data(),gstrmem_pic[mnSelPic].size());
-    mpbigpicdlg->setCamera(mnSelPic);
-}
 
 
 
-void MainWindow::on_pushButton_AllPic_clicked()
-{
-
-    mppicdlg->show();
-    mppicdlg->setRefresh(true);
-}
 
 void MainWindow::onCloseDlg()
 {
-    mppicdlg->setRefresh(false);
     qDebug("cloase");
 }
 
 void MainWindow::on_checkBox_clicked()
 {
-    int i;
-    if(ui->checkBox->isChecked())
-    {
-        for(i=0;i<4;i++)
-        {
-            mpPicSave[i]->startsave();
-        }
-        mbSavePic = true;
-    }
-    else
-    {
-        for(i=0;i<4;i++)
-        {
-            mpPicSave[i]->stopsave();
-        }
-        mbSavePic = false;
-    }
+
 }
 
 void MainWindow::saveavi(int index)
 {
-//    if(mbSavePic == false)return;
-    gMutexPic[index].lock();
-    mpPicSave[index]->SetPic(grawpic[index]);
-    gMutexPic[index].unlock();
+    (void)index;
 }
 
-void MainWindow::on_pushButton_big_clicked()
-{
-//    pluginapp * pa  = new pluginapp(this->winId(),"main","plugin_threepicshow","/home/yuchuli/qt/modularization/src/plugin/build-plugin_threepicshow-Debug");
 
-//    return;
-    mpbigpicdlg->show();
-    mpbigpicdlg->setRefresh(true);
-}
 
 void MainWindow::onCloseBigDlg()
 {
-    mpbigpicdlg->setRefresh(false);
 }
 
 void MainWindow::on_actionSet_Query_Pass_triggered()
@@ -1251,10 +1048,12 @@ void MainWindow::threadpic(int ncampos)
 #endif
         mph264decode[ncampos]->UnlockReadBuff(nindex);
 
-        mMutexCam[ncampos].lock();
-        mbCamUpdate[ncampos] = true;
         QImage image2 = QImage((uchar*)(rgbImg.data), rgbImg.cols, rgbImg.rows,  QImage::Format_RGB888);
+
+        mMutexCam[ncampos].lock();
+//        emit CamUpdate(ncampos,image2);
         *mpImageCam[ncampos] = image2.copy();
+        mbCamUpdate[ncampos] = true;
         mMutexCam[ncampos].unlock();
         emit CamUpdate(ncampos);
 //        cv::cvtColor(rgbImg, rgbImg, CV_BGR2RGB);
@@ -1264,7 +1063,14 @@ void MainWindow::threadpic(int ncampos)
 
 void MainWindow::onCamUpdate(int ncampos)
 {
-    update();
+    (void)ncampos;
+    static int64_t nlastupdate =0;
+    int64_t nnow = std::chrono::system_clock::now().time_since_epoch().count()/1000000;
+    if(abs(nnow - nlastupdate)>30)
+    {
+        nlastupdate = std::chrono::system_clock::now().time_since_epoch().count()/1000000;
+        update();
+    }
 }
 
 void MainWindow::on_actionFullScreem_triggered()
@@ -1276,3 +1082,15 @@ void MainWindow::on_actionNormal_triggered()
 {
     showNormal();
 }
+
+void MainWindow::on_horizontalSlider_wheelspeed_sliderMoved(int position)
+{
+    (void)position;
+    mfWheelSpeed = mfWheelBaseSpeed * ui->horizontalSlider_wheelspeed->value();
+}
+
+void MainWindow::on_horizontalSlider_wheelspeed_valueChanged(int value)
+{
+    (void)value;
+    mfWheelSpeed = mfWheelBaseSpeed * ui->horizontalSlider_wheelspeed->value();
+}

+ 13 - 30
src/tool/RemoteCtrl_h264/mainwindow.h

@@ -9,7 +9,7 @@
 #include <QTranslator>
 
 #include <QtWidgets>
-#include <QtWebEngineWidgets/QtWebEngineWidgets>
+//#include <QtWebEngineWidgets/QtWebEngineWidgets>
 #include <QSet>
 #include <QMutex>
 #include <QLabel>
@@ -22,21 +22,12 @@
 #include "gpsimu.pb.h"
 #include "rawpic.pb.h"
 
-#include "ivpicview.h"
-#include "ivpicsave.h"
 #include "myview.h"
 #include "grpcpc.h"
-
-#include "dialogpic.h"
-#include "dialogbigpic.h"
-
 #include "modulecomm.h"
-
 #include "joyreadthread.h"
-
 #include "dialogsetpassword.h"
 #include "dialogsetting.h"
-
 #include "ivh264framedecode.h"
 
 #include "pluginapp.h"
@@ -90,25 +81,13 @@ private slots:
 
     void on_radioButton_Null_clicked();
 
-    void on_radioButton_Rear_clicked();
-
-
-    void on_radioButton_picfront_clicked();
-
-    void on_radioButton_picrear_clicked();
 
-    void on_radioButton_picleft_clicked();
-
-    void on_radioButton_picright_clicked();
-
-    void on_pushButton_AllPic_clicked();
 
     void onCloseDlg();
     void onCloseBigDlg();
 
     void on_checkBox_clicked();
 
-    void on_pushButton_big_clicked();
 
     void on_actionSet_Query_Pass_triggered();
 
@@ -122,8 +101,15 @@ private slots:
 
     void on_actionNormal_triggered();
 
+    void on_horizontalSlider_wheelspeed_sliderMoved(int position);
+
+    void on_horizontalSlider_wheelspeed_valueChanged(int value);
+
+    void onCamUpdate(int ncampos,QImage image);
+
 signals:
     void CamUpdate(int ncampos);
+    void CamUpdate(int ncampos,QImage image);
 public:
      void resizeEvent(QResizeEvent *event);
 
@@ -137,7 +123,7 @@ private:
     Ui::MainWindow *ui;
 
 
-    QWebEngineView * mMapview;
+//    QWebEngineView * mMapview;
 
     Speed * mpWheel, * mpAcc, * mpBrake;
 
@@ -153,11 +139,13 @@ private:
      int mnLastTime;
      QTime mManualTime;
 
-     double mfWheelSpeed = 100; //100degree/s
+     double mfWheelSpeed = 10; //100degree/s
      double mfAccSpeed = 30; //30/s
      double mfBrakeSpeed = 100; //100/s
 
-     double mfWheelAutoDownSpeed = 30;
+     double mfWheelBaseSpeed = 10;
+
+     double mfWheelAutoDownSpeed = 0;
      double mfAccAutoDownSpeed = 10;
      double mfBrakeAutoDownSpeed = 30;
 
@@ -169,15 +157,12 @@ private:
 
      MyView * mmyview;
      QGraphicsScene *mscene;
-     IVPicView * mpPicView;
 
      MyView * mmyviewLeft,* mmyviewRear,*mmyviewRight;
 
      MyView * mpviewImg[NUM_CAM];
      QGraphicsScene * mpsceneImg[NUM_CAM];
 
-     ivpicsave * mpPicSave[4];
-
      void * mpadst;
      void * mpasimpletrace;
 
@@ -195,8 +180,6 @@ private:
 
      int mnSelPic = 0;
 
-     DialogPic * mppicdlg;
-     DialogBigPic * mpbigpicdlg;
 
 
      bool mbSavePic = false;

+ 31 - 109
src/tool/RemoteCtrl_h264/mainwindow.ui

@@ -54,8 +54,8 @@
    <widget class="QGroupBox" name="groupBox_rem">
     <property name="geometry">
      <rect>
-      <x>870</x>
-      <y>270</y>
+      <x>840</x>
+      <y>240</y>
       <width>291</width>
       <height>311</height>
      </rect>
@@ -67,7 +67,7 @@
      <property name="geometry">
       <rect>
        <x>10</x>
-       <y>40</y>
+       <y>30</y>
        <width>61</width>
        <height>23</height>
       </rect>
@@ -79,8 +79,8 @@
     <widget class="QRadioButton" name="radioButton_auto">
      <property name="geometry">
       <rect>
-       <x>10</x>
-       <y>70</y>
+       <x>80</x>
+       <y>30</y>
        <width>61</width>
        <height>23</height>
       </rect>
@@ -141,6 +141,32 @@
       </property>
      </widget>
     </widget>
+    <widget class="QSlider" name="horizontalSlider_wheelspeed">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>100</y>
+       <width>181</width>
+       <height>21</height>
+      </rect>
+     </property>
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>60</y>
+       <width>131</width>
+       <height>31</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>Wheel Speed:</string>
+     </property>
+    </widget>
    </widget>
    <widget class="QGroupBox" name="groupBox_map">
     <property name="geometry">
@@ -375,110 +401,6 @@
      </property>
     </widget>
    </widget>
-   <widget class="QGroupBox" name="groupBox_picsel">
-    <property name="geometry">
-     <rect>
-      <x>360</x>
-      <y>40</y>
-      <width>551</width>
-      <height>91</height>
-     </rect>
-    </property>
-    <property name="title">
-     <string>图像</string>
-    </property>
-    <widget class="QRadioButton" name="radioButton_picfront">
-     <property name="geometry">
-      <rect>
-       <x>10</x>
-       <y>40</y>
-       <width>51</width>
-       <height>23</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>前</string>
-     </property>
-    </widget>
-    <widget class="QRadioButton" name="radioButton_picrear">
-     <property name="geometry">
-      <rect>
-       <x>70</x>
-       <y>40</y>
-       <width>51</width>
-       <height>21</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>后</string>
-     </property>
-    </widget>
-    <widget class="QRadioButton" name="radioButton_picleft">
-     <property name="geometry">
-      <rect>
-       <x>140</x>
-       <y>40</y>
-       <width>41</width>
-       <height>21</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>左</string>
-     </property>
-    </widget>
-    <widget class="QRadioButton" name="radioButton_picright">
-     <property name="geometry">
-      <rect>
-       <x>220</x>
-       <y>40</y>
-       <width>41</width>
-       <height>23</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>右</string>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="pushButton_AllPic">
-     <property name="geometry">
-      <rect>
-       <x>300</x>
-       <y>40</y>
-       <width>71</width>
-       <height>25</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>All</string>
-     </property>
-    </widget>
-    <widget class="QCheckBox" name="checkBox">
-     <property name="geometry">
-      <rect>
-       <x>390</x>
-       <y>40</y>
-       <width>71</width>
-       <height>23</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>Save</string>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="pushButton_big">
-     <property name="geometry">
-      <rect>
-       <x>460</x>
-       <y>40</y>
-       <width>51</width>
-       <height>25</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>Big</string>
-     </property>
-    </widget>
-   </widget>
   </widget>
   <widget class="QMenuBar" name="menubar">
    <property name="geometry">

+ 2 - 2
src/tool/RemoteCtrl_h264/speed.cpp

@@ -19,7 +19,7 @@ Speed::Speed(QWidget *parent) : QWidget(parent)
     m_scaleMinor = 10;
     m_units = "";
     m_title = "Wheel";
-    m_precision = 0;
+    m_precision = 2;
     m_value = 0;
 }
 
@@ -182,7 +182,7 @@ void Speed::setmaxvalue(int value)
     m_maxValue = value;
 }
 
-void Speed::updatevalue(int value)
+void Speed::updatevalue(double value)
 {
     m_value = value;
     update();

+ 1 - 1
src/tool/RemoteCtrl_h264/speed.h

@@ -43,7 +43,7 @@ private:
 public:
     void setminvalue(int value);
     void setmaxvalue(int value);
-    void updatevalue(int value);
+    void updatevalue(double value);
     void setunits(QString strunits);
     void settitle(QString strtitle);
 };

+ 4 - 3
src/tool/map_collectfromveh/mainwindow.cpp

@@ -105,10 +105,11 @@ MainWindow::MainWindow(QWidget *parent)
     connect(mpEditWin,SIGNAL(editwinclose()),this,SLOT(onEditWinClose()));
 
     double x,y;
-    GaussProjCal(120,0,&x,&y);
+
+    GaussProjCal(117,0,&x,&y);
 //    x = 0;
-    x = x + 500000 + 2356.8309 + 1.5;
-    y = y + 4332295.5834 - 2.5;
+    x = x + + 2356.8309;
+    y =  4332295.5834;
     double lon,lat;
     GaussProjInvCal(x,y,&lon,&lat);
 

+ 1 - 0
src/tool/map_collectfromveh/map_collectfromveh.pro

@@ -93,3 +93,4 @@ RESOURCES += \
 DISTFILES += \
     ../map_lanetoxodr/TinyXML/TinyXML.pri
 
+DEFINES += NOTINPILOT