Selaa lähdekoodia

add RemoteCtrl_Three.pro.

yuchuli 2 vuotta sitten
vanhempi
commit
e26ea36cea

+ 194 - 0
src/tool/RemoteCtrl_Wide/RemoteCtrl_Three.pro

@@ -0,0 +1,194 @@
+
+
+!include(../../../include/common.pri ) {
+    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
+#}
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+DEFINES += TESTH264
+
+
+system(protoc -I=./../../include/proto3 --cpp_out=./../../include/msgtype   ./../../include/proto3/uploadthreadmsg.proto)
+# The following define makes your compiler emit warnings if you use
+# any Qt feature that has been marked deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+    ../../common/common/getinterface/get_interface.cpp \
+    ../../common/common/md5/md5_encode.cpp \
+    ../../include/msgtype/gps.pb.cc \
+    ../../include/msgtype/gpsimu.pb.cc \
+    ../../include/msgtype/imu.pb.cc \
+    ../../include/msgtype/plugmsg.pb.cc \
+    ../../include/msgtype/rawpic.pb.cc \
+    ../../include/msgtype/remotectrl.pb.cc \
+    ../../plugin/common/pluginapp.cpp \
+    dialogsetpassword.cpp \
+    dialogsetting.cpp \
+    joyreadthread.cpp \
+    mainthree.cpp \
+    mainwindowcenter.cpp \
+    myview.cpp \
+    remotectrlini.cpp \
+    speed.cpp \
+    ../../driver/driver_cloud_grpc_thread/uploadthreadmsg.grpc.pb.cc \
+    ../../include/msgtype/cloud.pb.cc \
+    ../../include/msgtype/uploadthreadmsg.pb.cc \
+    grpcpc.cpp \
+    remotecomm.cpp \
+    ../../driver/driver_h264_dec/ivh264framedecode.cpp \
+    rtspclientdown.cpp \
+    mainwindowleft.cpp
+
+HEADERS += \
+    ../../common/common/getinterface/get_interface.h \
+    ../../common/common/md5/md5_encode.h \
+    ../../include/msgtype/gps.pb.h \
+    ../../include/msgtype/gpsimu.pb.h \
+    ../../include/msgtype/imu.pb.h \
+    ../../include/msgtype/plugmsg.pb.h \
+    ../../include/msgtype/rawpic.pb.h \
+    ../../include/msgtype/remotectrl.pb.h \
+    ../../plugin/common/pluginapp.h \
+    dialogsetpassword.h \
+    dialogsetting.h \
+    joyreadthread.h \
+    mainwindowcenter.h \
+    myview.h \
+    pos_def.h \
+    remotectrlini.h \
+    speed.h \
+    ../../driver/driver_cloud_grpc_thread/uploadthreadmsg.grpc.pb.h \
+    ../../include/msgtype/cloud.pb.h \
+    ../../include/msgtype/uploadthreadmsg.pb.h \
+    grpcpc.h \
+    remotecomm.h \
+    ../../driver/driver_h264_dec/ivh264framedecode.h \
+    rtspclientdown.h \
+    mainwindowleft.h
+
+FORMS += \
+    dialogsetpassword.ui \
+    dialogsetting.ui \
+    mainwindowcenter.ui \
+    mainwindowleft.ui
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target
+
+INCLUDEPATH += /usr/include/opencv4
+
+
+
+INCLUDEPATH += $$PWD/../../driver/driver_cloud_grpc_thread
+
+INCLUDEPATH += $$PWD/../../plugin/common
+
+
+INCLUDEPATH += $$PWD/../../driver/driver_h264_dec
+
+LIBS += -lprotobuf -lyaml-cpp
+
+
+unix: LIBS += -lopencv_highgui -lopencv_core -lopencv_imgproc -lopencv_imgcodecs -lopencv_video  -lopencv_videoio -lpthread #-lopencv_shape
+
+
+#INCLUDEPATH += $$PWD/../../../include/
+#LIBS += -L$$PWD/../../../bin/ -lxmlparam -lmodulecomm -livbacktrace #-livlog -livfault
+
+INCLUDEPATH += $$PWD/../../../thirdpartylib/AGX/qtwebenginewidgets/include/include     # If AGX, Need this line,if x86 please comment this line
+
+contains(QMAKE_HOST.arch, aarch64){
+    LIBS += -lQt5WebEngineWidgets  # If AGX, sudo apt-get install libqt5webenginewidgets5, If x86 comment this line
+}
+
+unix: LIBS += -lQt5WebEngineWidgets
+
+RESOURCES += \
+    remotectrl.qrc
+
+TRANSLATIONS = zh_CN.ts\
+            en_CN.ts
+
+unix: LIBS += -lboost_system
+
+win32: DEFINES +=  _WIN32_WINNT=0x0602
+!include(../../../include/common.pri ) {
+    error( "Couldn't find the common.pri file!" )
+}
+
+!include(../../../include/ivprotobuf.pri ) {
+    error( "Couldn't find the ivprotobuf.pri file!" )
+}
+
+!include(../../../include/ivboost.pri ) {
+    error( "Couldn't find the ivboost.pri file!" )
+}
+
+!include(../../../include/ivgrpc.pri ) {
+    error( "Couldn't find the ivgrpc.pri file!" )
+}
+
+!include(../../../include/ivyaml-cpp.pri ) {
+    error( "Couldn't find the ivyaml-cpp.pri file!" )
+}
+
+!include(../../../include/ivopencv.pri ) {
+    error( "Couldn't find the ivopencv.pri file!" )
+}
+
+INCLUDEPATH += $$PWD/../../../thirdpartylib/grpc/include
+
+LIBS += -L$$PWD/../../../thirdpartylib/grpc/lib
+
+
+unix:LIBS += -lgrpc++_unsecure -lgrpc++_reflection -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_exponential_biased -labsl_hash -labsl_bad_variant_access -labsl_city -labsl_status -labsl_cord -labsl_str_format_internal -labsl_synchronization -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_stacktrace -labsl_debugging_internal -labsl_malloc_internal -labsl_time -labsl_time_zone -labsl_civil_time -labsl_strings -labsl_strings_internal -labsl_throw_delegate -labsl_int128 -labsl_base -labsl_spinlock_wait -labsl_bad_optional_access -labsl_raw_logging_internal -labsl_log_severity
+
+INCLUDEPATH += $$PWD/../../common/common/md5
+INCLUDEPATH += $$PWD/../../common/common/getinterface
+
+#DEFINES += USE_QSV
+
+
+if(contains(DEFINES,USE_QSV)){
+INCLUDEPATH += /usr/local/include
+INCLUDEPATH += /opt/intel/mediasdk/include
+LIBS += /opt/intel/mediasdk/lib/libmfx.so.1
+LIBS += -L/opt/intel/mediasdk/lib -lmfx
+LIBS += /home/yuchuli/File1/git/ffmpeg/lib/libavcodec.so.59
+LIBS += /home/yuchuli/File1/git/ffmpeg/lib/libavutil.so.57
+LIBS += /home/yuchuli/File1/git/ffmpeg/lib/libavdevice.so.59
+LIBS += /home/yuchuli/File1/git/ffmpeg/lib/libavformat.so.59
+
+
+} else {
+
+INCLUDEPATH += /usr/include/x86_64-linux-gnu
+unix: LIBS +=  -lavcodec -lavformat -lavutil
+}
+
+INCLUDEPATH +=  D:\ffmpegwin\include
+
+win32:LIBS += -LD:\ffmpegwin\bin
+win32:LIBS += -lavcodec-58 -lavformat-58 -lavutil-56  -lwsock32 -lws2_32
+

+ 86 - 0
src/tool/RemoteCtrl_Wide/mainthree.cpp

@@ -0,0 +1,86 @@
+#include "mainwindow.h"
+#include "mainwindowleft.h"
+
+#include <QApplication>
+#include <QList>
+
+#include <vector>
+
+#include "pos_def.h"
+
+#include "xmlparam.h"
+#include "ivversion.h"
+
+std::string gstrmem_gpsimu;
+std::string gstrmem_pic[CAMERA_NUM];
+std::string gstryaml_path;
+std::string gstrjoy_path;
+
+std::vector<iv::pos_def> gvectorpos;
+
+
+MainWindowLeft * gwleft,*gwright;
+void LoadPos(std::string strfilepath)
+{
+    QFile xFile;
+    xFile.setFileName(strfilepath.data());
+    if(xFile.open(QIODevice::ReadOnly))
+    {
+        QByteArray ba = xFile.readAll();
+        QList<QByteArray> baline =  ba.split('\n');
+        int nline = baline.size();
+        int i;
+        for(i=0;i<nline;i++)
+        {
+            QList<QByteArray> badata = baline[i].split('\t');
+            if(badata.size()>=3)
+            {
+                iv::pos_def xposdef;
+                xposdef.mstrstationname = badata[0].toStdString();
+                xposdef.mflon = badata[1].toDouble();
+                xposdef.mflat = badata[2].toDouble();
+                gvectorpos.push_back(xposdef);
+
+            }
+
+        }
+    }
+    xFile.close();
+}
+
+
+#include "ivbacktrace.h"
+
+int main(int argc, char *argv[])
+{
+
+    showversion("RemoteCtl");
+    QApplication a(argc, argv);
+
+    RegisterIVBackTrace();
+
+
+
+    iv::xmlparam::Xmlparam xp("RemoteCtrl.xml");
+    gstrmem_gpsimu = xp.GetParam("gpsimu","hcp2_gpsimu");
+    gstrmem_pic[0] = xp.GetParam("PicFront","h264front");
+    gstrmem_pic[1] = xp.GetParam("PicRear","h264rear");
+    gstrmem_pic[2] = xp.GetParam("PicLeft","h264left");
+    gstrmem_pic[3] = xp.GetParam("PicRight","h264right");
+    gstrjoy_path = xp.GetParam("joypath","/dev/input/js0");
+    gstryaml_path = xp.GetParam("yamlpath","./driver_cloud_grpc_pc.yaml");
+
+    LoadPos("pos.txt");
+
+    MainWindow w;
+    w.show();
+    MainWindowLeft wl;
+    wl.SetWT("Left View");
+    wl.show();
+    MainWindowLeft wr;
+    wr.SetWT("Right View");
+    wr.show();
+    gwleft = &wl;
+    gwright = &wr;
+    return a.exec();
+}

+ 1188 - 0
src/tool/RemoteCtrl_Wide/mainwindowcenter.cpp

@@ -0,0 +1,1188 @@
+#include "mainwindowcenter.h"
+#include "ui_mainwindowcenter.h"
+#include "pos_def.h"
+
+#include "remotectrlini.h"
+
+#include "mainwindowleft.h"
+
+MainWindow * gw;
+
+extern MainWindowLeft * gwleft,*gwright;
+//#include "QStringLiteral"
+
+#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
+
+#include <opencv2/opencv.hpp>
+#include <opencv2/core.hpp>
+
+iv::gps::gpsimu ggpsimu;
+qint64 gTimeGPSIMUUpdate = 0;
+
+iv::vision::rawpic grawpic[CAMERA_NUM];
+qint64 gTimeRawPic[CAMERA_NUM] = {0,0,0,0};
+QMutex gMutexPic[CAMERA_NUM];
+
+extern std::string gstrmem_gpsimu;
+extern std::string gstrmem_pic[CAMERA_NUM];
+extern std::vector<iv::pos_def> gvectorpos;
+extern std::string gstryaml_path;
+
+class xodrobj
+{
+public:
+    double flatsrc;
+    double flonsrc;
+    double fhgdsrc;
+    double flat;
+    double flon;
+    int lane;
+};
+
+namespace iv {
+struct simpletrace
+{
+    double gps_lat = 0;//纬度
+    double gps_lng = 0;//经度
+
+    double gps_x = 0;
+    double gps_y = 0;
+    double gps_z = 0;
+
+
+    double ins_heading_angle = 0;	//航向角
+};
+}
+
+std::vector<iv::simpletrace> gvectorsimplerace;
+QMutex gMutexTrace;
+qint64 gTimeTrace = 0;
+
+
+void * gpaframe;
+
+MainWindow::MainWindow(QWidget *parent)
+    : QMainWindow(parent)
+    , ui(new Ui::MainWindowCenter)
+{
+
+    m_translator = new QTranslator(this);
+    QString strLanguageFile = ":/zh_CN.qm";
+    if(ServiceRCIni.GetLanguage() == "Chinese")
+    {
+        strLanguageFile = ":/zh_CN.qm";
+    }
+    else
+    {
+        strLanguageFile = ":/en_CN.qm";
+    }
+    if (QFile(strLanguageFile).exists())
+    {
+        m_translator->load(strLanguageFile);
+        qApp->installTranslator(m_translator);
+    }
+
+
+    gpaframe = iv::modulecomm::RegisterSend("h264frame",1000000,1);
+    gw = this;
+
+    ui->setupUi(this);
+
+
+
+    mstrserverip = ServiceRCIni.GetServerIP();
+    mstrserverport = ServiceRCIni.GetServerPort();
+    mstruploadinterval = ServiceRCIni.GetInterval();
+    mstrVehVIN = ServiceRCIni.GetVIN();
+    mstrqueryMD5 = ServiceRCIni.GetQueryMD5();
+    mstrctrlMD5 = ServiceRCIni.GetCtrlMD5();
+
+
+    mpJRT = new JoyReadThread();
+    mpJRT->start();
+
+    unsigned int i;
+
+    CreateView();
+
+    unsigned int nstation = static_cast<unsigned int>(gvectorpos.size()) ;
+    for(i=0;i<nstation;i++)
+    {
+        ui->comboBox_Station->addItem(gvectorpos[i].mstrstationname.data());
+    }
+
+    ui->radioButton_auto->setChecked(true);
+
+    mpa = iv::modulecomm::RegisterSend("remotectrl",10000,1);
+
+    mpTimerManual = new QTimer(this);
+    connect(mpTimerManual,SIGNAL(timeout()),this,SLOT(onTimerManual()));
+
+    mpTimerRemote = new QTimer(this);
+    connect(mpTimerRemote,SIGNAL(timeout()),this,SLOT(onTimerRemote()));
+    mpTimerRemote->start(50);
+
+    mpTimerUpdateView = new QTimer(this);
+    connect(mpTimerUpdateView,SIGNAL(timeout()),this,SLOT(onTimerUpdateView()));
+    mpTimerUpdateView->start(1000);
+
+    QTimer * timer = new QTimer(this);
+    connect(timer,SIGNAL(timeout()),this,SLOT(onTimerUpdatePic()));
+    timer->start(1000);
+
+    mpadst = iv::modulecomm::RegisterSend("xodrreq",1000,1);
+
+
+    mgrpcpc = new grpcpc(gstryaml_path);
+    mgrpcpc->setserverip(mstrserverip);
+    mgrpcpc->setserverport(mstrserverport);
+    mgrpcpc->setqueryinterval(mstruploadinterval);
+    mgrpcpc->setVIN(mstrVehVIN);
+    mgrpcpc->setqueryMD5(mstrqueryMD5);
+    mgrpcpc->setctrlMD5(mstrctrlMD5);
+    mgrpcpc->StartRTSP();
+    mgrpcpc->start();
+
+    for(i=0;i<NUM_CAM;i++)
+    {
+        mpImageCam[i] = new QImage(640, 360, QImage::Format_RGB32);
+        mbCamUpdate[i] = false;
+        mph264decode[i] = new ivh264framedecode(mnframewidth,mnframeheight);
+        mpthreadframe[i] = new std::thread(&MainWindow::threadframe,this,i);
+        mpthreadpic[i] = new std::thread(&MainWindow::threadpic,this,i);
+
+    }
+    mpthreadinfo = new std::thread(&MainWindow::threadinfo,this);
+
+    mstrVIN = mgrpcpc->GetVIN().data();
+    mstrVIN = " VIN:"+ mstrVIN+" ";
+
+
+    QLabel * pLabel = new QLabel();
+    pLabel->setFixedWidth(600);
+    pLabel->setText("Latency");
+    mpLabelLatency = pLabel;
+    ui->statusbar->addPermanentWidget(pLabel);
+
+    ui->horizontalSlider_wheelspeed->setRange(1,30);
+
+    connect(this,SIGNAL(CamUpdate(int)),this,SLOT(onCamUpdate(int)));
+
+
+    setWindowTitle(mstrProgName +mstrVIN+  mstrGPSTime + mstrPicTime);
+
+}
+
+MainWindow::~MainWindow()
+{
+
+
+    mpJRT->requestInterruption();
+    mbThreadrun = false;
+    int i;
+    mpthreadinfo->join();
+    for(i=0;i<NUM_CAM;i++)
+    {
+//        mph264decode[i] = new ivh264framedecode(mnframewidth,mnframeheight);
+        mpthreadframe[i]->join();
+        mpthreadpic[i]->join();
+    }
+
+     std::cout<<" ~MainWindow. "<<std::endl;
+    delete ui;
+}
+
+void MainWindow::CreateView()
+{
+//    mMapview = new QWebEngineView(ui->centralwidget);
+//    qDebug((QDir::currentPath()).toLatin1().data());
+//    mMapview->load(QUrl(QString("file:///%1/%2").arg(QApplication::applicationDirPath()).arg("BaiDuMap.html")));
+
+ //   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(450);
+    mpWheel->setmaxvalue(-450);
+
+    mpAcc = new Speed(ui->groupBox_rem);
+
+    mpAcc->settitle(QStringLiteral("油门"));
+    mpAcc->updatevalue(0);
+    mpAcc->setminvalue(-100);
+    mpAcc->setmaxvalue(100);
+
+    mpBrake = new Speed(ui->groupBox_rem);
+    mpBrake->settitle(QStringLiteral("刹车"));
+    mpBrake->updatevalue(0);
+    mpBrake->setminvalue(0);
+    mpBrake->setmaxvalue(100);
+
+    mpVehSpeed = new Speed(ui->centralwidget);
+    mpVehSpeed->settitle(QStringLiteral("车速(km/h)"));
+    mpVehSpeed->updatevalue(0);
+    mpVehSpeed->setminvalue(0);
+    mpVehSpeed->setmaxvalue( mnSpeedMax);
+
+    mmyview = new MyView(ui->centralwidget);
+    mmyview->setObjectName(QStringLiteral("graphicsView"));
+    mmyview->setGeometry(QRect(30, 30, 600, 600));
+    mmyview->setCacheMode(mmyview->CacheBackground);
+
+
+    mmyviewRear = new MyView(ui->centralwidget);
+    mmyviewRear->setObjectName(QStringLiteral("graphicsView"));
+    mmyviewRear->setGeometry(QRect(30, 30, 600, 600));
+    mmyviewRear->setCacheMode(mmyviewRear->CacheBackground);
+
+
+    mscene = new QGraphicsScene;
+    mpsceneImg[0] = mscene;
+    mpsceneImg[1] = new QGraphicsScene;
+//    mpsceneImg[2] = new QGraphicsScene;
+//    mpsceneImg[3] = new QGraphicsScene;
+
+    mpviewImg[0] = mmyview;
+    mpviewImg[1] = mmyviewRear;
+//    mpviewImg[2] = mmyviewLeft;
+//    mpviewImg[3] = mmyviewRight;
+
+    ui->radioButton_Null->setChecked(true);
+
+
+
+}
+
+
+void MainWindow::keyPressEvent(QKeyEvent *event)
+{
+
+    //按键按下,key值放入容器,如果是长按触发的repeat就不判断
+    if(!event->isAutoRepeat())
+        mPressKeys.insert(event->key());
+
+
+}
+
+void MainWindow::keyReleaseEvent(QKeyEvent *event)
+{
+    if((event->key() == Qt::Key_Escape)||(event->key() == Qt::Key_F11))
+    {
+        showNormal();
+        ui->menubar->setVisible(true);
+        ui->statusbar->setVisible(true);
+    }
+    if(!event->isAutoRepeat())mPressKeys.remove(event->key());
+    qDebug("key count is %d",mPressKeys.count());
+}
+
+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->setGeometry(10,10,sizemain.width()/2,sizemain.height()*3/5);
+
+//    mpbaiduapp->SetGeometry(10,30,sizemain.width()/2,sizemain.height()*3/5);
+
+    int nMode = 0;
+
+
+    ui->lineEdit_lat->setVisible(false);
+    ui->lineEdit_lon->setVisible(false);
+    ui->pushButton_test->setVisible(false);
+
+    if(nMode == 0)
+    {
+
+
+        double fMainRatio = 0.8;
+        mpVehSpeed->setVisible(false);
+
+        double fVideoRatio = 9.0/16.0;
+
+
+        int nfrontsize_y = static_cast<int>(sizemain.height()* fMainRatio );
+        int nfrontsize_x = static_cast<int>(nfrontsize_y/fVideoRatio ) ;
+
+        int nfrontpos_x = sizemain.width()/2 - nfrontsize_x/2;
+        int nfrontpos_y = sizemain.height() - nfrontsize_y;
+
+        mmyview->setGeometry(nfrontpos_x,nfrontpos_y,nfrontsize_x,nfrontsize_y);
+
+
+        int nrearsize_y = sizemain.height() - nfrontsize_y;
+        int nrearsize_x =  static_cast<int>(nrearsize_y/fVideoRatio ) ;
+
+        int nrearpos_x = sizemain.width()/2 - nrearsize_x/2;
+        int nrearpos_y = 0;
+
+        mmyviewRear->setGeometry(nrearpos_x,nrearpos_y,nrearsize_x,nrearsize_y);
+
+
+        int grouppos_x =  nfrontpos_x + nfrontsize_x;
+        int grouppos_y =  nfrontpos_y;
+        int grouppos_width = sizemain.width() - grouppos_x;
+        int grouppos_height = nfrontsize_y;
+
+
+        //    int speed_width = grouppos_height-40;
+        //    if((speed_width*3 + 150)>grouppos_width)speed_width = (grouppos_width - 150)/3;
+
+        int speed_width = grouppos_width;
+        int ngroupkeep = 260;
+        if(grouppos_width >(grouppos_height -260)*3/2)
+        {
+            speed_width = grouppos_width/3;
+            if(speed_width> (grouppos_height -260))speed_width = grouppos_height -260;
+            mpWheel->setGeometry(0,ngroupkeep ,speed_width,speed_width);
+            mpBrake->setGeometry(0+speed_width,ngroupkeep ,speed_width,speed_width);
+            mpAcc->setGeometry(0 +speed_width*2,ngroupkeep,speed_width,speed_width);
+
+        }
+        else
+        {
+            if((speed_width*3 > (grouppos_height-ngroupkeep))&&(ngroupkeep<grouppos_height)) speed_width = (grouppos_height-ngroupkeep)/3;
+            mpWheel->setGeometry(0,ngroupkeep ,speed_width,speed_width);
+            mpBrake->setGeometry(0,ngroupkeep + speed_width,speed_width,speed_width);
+            mpAcc->setGeometry(0 ,ngroupkeep + speed_width*2,speed_width,speed_width);
+        }
+        ui->groupBox_rem->setGeometry(grouppos_x,grouppos_y,grouppos_width,grouppos_height);
+
+
+
+        int groupmap_x = 0;
+        int groupmap_y = 0;
+        int groupmap_width = nfrontpos_x;
+        int groupmap_height = 100;
+
+        ui->comboBox_Station->setGeometry(10,30,groupmap_width*3/5,30);
+        ui->pushButton_Go->setGeometry(20 + groupmap_width*3/5,30,groupmap_width*2/5 - 30,30);
+
+        ui->groupBox_map->setGeometry(groupmap_x,groupmap_y,groupmap_width,groupmap_height);
+
+        int groupgps_x = 0;
+        int groupgps_y = nfrontpos_y;
+        int groupgps_width = nfrontpos_x;
+        int groupgps_height = nfrontsize_y;
+
+        ui->groupBox_gps->setGeometry(groupgps_x,groupgps_y,groupgps_width,groupgps_height);
+
+        int lablewidth =groupgps_width*3/10;// (groupgps_width-50)*2/10;
+        int lewidth = groupgps_width*6/10;
+        int leheight = 26;
+
+        int nypos = 40;
+        ui->label_gpsins->setGeometry(10,nypos,lablewidth,leheight);
+        ui->lineEdit_gpsins->setGeometry(20+lablewidth,nypos,lewidth,leheight);
+
+        nypos = nypos + leheight*11/10;
+        ui->label_gpsrtk->setGeometry(10,nypos,lablewidth,leheight);
+        ui->lineEdit_gpsrtk->setGeometry(20+lablewidth,nypos,lewidth,leheight);
+
+        nypos = nypos + leheight*11/10;
+        ui->label_gpslon->setGeometry(10,nypos,lablewidth,leheight);
+        ui->lineEdit_gpslon->setGeometry(20+lablewidth,nypos,lewidth,leheight);
+
+        nypos = nypos + leheight*11/10;
+        ui->label_gpslat->setGeometry(10,nypos,lablewidth,leheight);
+        ui->lineEdit_gpslat->setGeometry(20+lablewidth,nypos,lewidth,leheight);
+
+        nypos = nypos + leheight*11/10;
+        ui->label_gpsheading->setGeometry(10,nypos,lablewidth,leheight);
+        ui->lineEdit_gpsheading->setGeometry(20+lablewidth,nypos,lewidth,leheight);
+
+        nypos = nypos + leheight*11/10;
+        ui->label_gpsheight->setGeometry(10,nypos,lablewidth,leheight);
+        ui->lineEdit_gpsheight->setGeometry(20+lablewidth,nypos,lewidth,leheight);
+
+        nypos = nypos + leheight*11/10;
+        ui->label_gpsspeed->setGeometry(10,nypos,lablewidth,leheight);
+        ui->lineEdit_gpsspeed->setGeometry(20+lablewidth,nypos,lewidth,leheight);
+
+        nypos = nypos + leheight*11/10;
+        ui->label_gpssat->setGeometry(10,nypos,lablewidth,leheight);
+        ui->lineEdit_gpssat->setGeometry(20+lablewidth,nypos,lewidth,leheight);
+
+
+        double fscale = nfrontsize_x*0.99/mnframewidth;
+        double fscale2 = nrearsize_x*0.99/mnframewidth;
+ //       fscale = fscale * 0.99;
+        mmyview->viewscaleto(fscale);
+        mmyviewRear->viewscaleto(fscale2);
+
+
+
+    }
+
+
+    mbNeedSetBack = true;
+
+}
+
+
+void MainWindow::on_pushButton_test_clicked()
+{
+    double flat = ui->lineEdit_lat->text().toDouble();
+    double flon = ui->lineEdit_lon->text().toDouble();
+
+    char strscript[256];
+    snprintf(strscript,255,"theLocation(%11.7f,%11.7f);",flon,flat);
+//    mMapview->page()->runJavaScript(strscript);
+}
+
+void MainWindow::on_radioButton_manual_clicked()
+{
+    ui->radioButton_manual->setChecked(true);
+    mPressKeys.clear();
+    mfAcc = 0;
+    mfWheel = 0;
+    mfBrake = 0;
+    mpWheel->updatevalue(mfWheel);
+    mpAcc->updatevalue(mfAcc);
+    mpBrake->updatevalue(mfBrake);
+    mManualTime.restart();
+    mnLastTime = mManualTime.elapsed();
+    mpTimerManual->start(10);
+    mbNeedSetBack = true;
+}
+
+void MainWindow::onTimerManual()
+{
+
+    static qint64 nLastKeepKeyTime = 0;
+    const qint64 nKeepTime = 3000; //if press c key, 5 seconds. in keep mode.
+    double fOldWheel = mfWheel;
+    double fOldAcc = mfAcc;
+    double fOldBrake = mfBrake;
+    int timediff = mManualTime.elapsed() - mnLastTime;
+    mnLastTime = mManualTime.elapsed();
+
+    bool bInKeepMode = false;
+
+    int nOldShift = mnShift;
+
+
+    if(mpJRT->isOK())
+    {
+        mfWheel = mpJRT->GetWheel() * (-100.0)/32768.0;
+        mfAcc = ((mpJRT->GetAcc()-32767.0)/65535)*(-100.0);
+        mfBrake = ((mpJRT->GetBrake()-32767.0)/65535)*(-100.0);
+        if(mfWheel != fOldWheel)mpWheel->updatevalue(mfWheel*5.5);
+        if(mfAcc != fOldAcc)mpAcc->updatevalue(mfAcc);
+        if(mfBrake != fOldBrake)mpBrake->updatevalue(mfBrake);
+
+        int x = mpJRT->GetShift();
+        if(x > 0)mnShift = 1;
+        if(x == 0)mnShift = 0;
+        if(x < 0)mnShift = -1;
+        if(mnShift != nOldShift)
+        {
+            switch (mnShift) {
+            case 1:
+                ui->radioButton_Drive->setChecked(true);
+                break;
+            case 0:
+                ui->radioButton_Null->setChecked(true);
+                break;
+            case -1:
+                ui->radioButton_Rear->setChecked(true);
+                break;
+            default:
+                break;
+            }
+        }
+        return;
+    }
+
+
+    if(mPressKeys.contains(Qt::Key_C)||(mPressKeys.contains(Qt::Key_A))||(mPressKeys.contains(Qt::Key_D))||(mPressKeys.contains(Qt::Key_W))||(mPressKeys.contains(Qt::Key_S)))
+    {
+        nLastKeepKeyTime = QDateTime::currentMSecsSinceEpoch();
+    }
+
+    if(abs(QDateTime::currentMSecsSinceEpoch() - nLastKeepKeyTime)  < nKeepTime)
+    {
+        bInKeepMode = true;
+    }
+
+
+    if(mPressKeys.contains(Qt::Key_A)&&(mPressKeys.contains((Qt::Key_D))))
+    {
+        mfWheel = mfWheel;
+    }
+    else
+    {
+        if(mPressKeys.contains(Qt::Key_A))
+        {
+//            if(mfWheel<0)mfWheel = 0;
+//            else
+//            {
+                mfWheel = mfWheel + timediff*mfWheelSpeed/1000;
+                if(mfWheel < -100)mfWheel = -100;
+                if(mfWheel > 100 )mfWheel = 100;
+//            }
+        }
+
+        if(mPressKeys.contains(Qt::Key_D))
+        {
+//            if(mfWheel>0)mfWheel = 0;
+//            else
+//            {
+                mfWheel = mfWheel - timediff*mfWheelSpeed/1000;
+                if(mfWheel < -100)mfWheel = -100;
+                if(mfWheel > 100 )mfWheel = 100;
+//            }
+        }
+
+
+    }
+
+    if(mPressKeys.contains(Qt::Key_Z))
+    {
+        mfWheel = 0;
+    }
+
+    if(!mPressKeys.contains(Qt::Key_A)&&(!mPressKeys.contains((Qt::Key_D)))&&(bInKeepMode == false))
+    {
+        if(mfWheel != 0)
+        {
+            if(mfWheel > 0)mfWheel = mfWheel - timediff*mfWheelAutoDownSpeed/1000;
+            else mfWheel = mfWheel + timediff*mfWheelAutoDownSpeed/1000;
+            if(fabs(mfWheel)< 10)mfWheel =0;
+        }
+    }
+
+    if(mnVehMode == 2)   //ACC BRAKE
+    {
+        if(mPressKeys.contains(Qt::Key_W)&&(mPressKeys.contains((Qt::Key_S))))
+        {
+            mfAcc = 0;
+            mfBrake = mfBrake + timediff*mfBrakeSpeed/1000;
+            if(mfBrake<0)mfBrake = 0;
+            if(mfBrake > 100)mfBrake = 100;
+        }
+        else
+        {
+            if(mPressKeys.contains(Qt::Key_W))
+            {
+                mfBrake = 0;
+                mfAcc = mfAcc + timediff*mfAccSpeed/1000;
+                if(mfAcc<0)mfAcc = 0;
+                if(mfAcc > 100)mfAcc = 100;
+
+            }
+
+            if(mPressKeys.contains(Qt::Key_S))
+            {
+                mfAcc = 0;
+                mfBrake = mfBrake + timediff*mfBrakeSpeed/1000;
+                if(mfBrake<0)mfBrake = 0;
+                if(mfBrake > 100)mfBrake = 100;
+            }
+
+
+        }
+    }
+    else   //Speed Mode
+    {
+        if(mPressKeys.contains(Qt::Key_W)&&(mPressKeys.contains((Qt::Key_S))))
+        {
+            if(mfAcc > 0)
+            {
+                mfAcc = mfAcc - 10*timediff*mfAccSpeed/1000;
+                if(mfAcc<0)mfAcc = 0;
+            }
+            else
+            {
+                mfBrake = mfBrake + timediff*mfBrakeSpeed/1000;
+                if(mfBrake<0)mfBrake = 0;
+                if(mfBrake > 100)mfBrake = 100;
+            }
+        }
+        else
+        {
+            if(mPressKeys.contains(Qt::Key_W))
+            {
+                mfBrake = 0;
+                mfAcc = mfAcc + timediff*mfAccSpeed/1000;
+                if(mfAcc<0)mfAcc = 0;
+                if(mfAcc > 100)mfAcc = 100;
+
+            }
+
+            if(mPressKeys.contains(Qt::Key_S))
+            {
+                if(mfAcc > 0)
+                {
+                    mfAcc = mfAcc - 10*timediff*mfAccSpeed/1000;
+                    if(mfAcc<0)mfAcc = 0;
+                }
+                else
+                {
+                    mfBrake = mfBrake + timediff*mfBrakeSpeed/1000;
+                    if(mfBrake<0)mfBrake = 0;
+                    if(mfBrake > 100)mfBrake = 100;
+                }
+            }
+
+
+        }
+    }
+
+
+    if(!mPressKeys.contains(Qt::Key_W)&&(!mPressKeys.contains((Qt::Key_S)))&&(bInKeepMode == false))
+    {
+        if(mfBrake != 0)
+        {
+//            mfBrake = mfBrake - timediff*mfBrakeAutoDownSpeed/1000;
+//            if(mfBrake<0)mfBrake = 0;
+//            if(mfBrake > 100)mfBrake = 100;
+        }
+
+        if(mfAcc != 0)
+        {
+            mfAcc = mfAcc - timediff*mfAccAutoDownSpeed/1000;
+            if(mfAcc<0)mfAcc = 0;
+            if(mfAcc > 100)mfAcc = 100;
+        }
+    }
+
+    if(mfWheel != fOldWheel)mpWheel->updatevalue(mfWheel*4.5);
+    if(mfAcc != fOldAcc)mpAcc->updatevalue(mfAcc);
+    if(mfBrake != fOldBrake)mpBrake->updatevalue(mfBrake);
+}
+
+void MainWindow::on_radioButton_auto_clicked()
+{
+    ui->radioButton_auto->setChecked(true);
+    mPressKeys.clear();
+    mpTimerManual->stop();
+
+    mbNeedSetBack = true;
+
+}
+
+void MainWindow::onTimerRemote()
+{
+    if(ui->radioButton_auto->isChecked())
+    {
+        mremotectrl.set_ntype(iv::remotectrl_CtrlType_AUTO);
+//        mfAcc = 0;
+//        mfBrake = 0;
+//        mfWheel =0;
+//        mpWheel->updatevalue(mfWheel);
+//        mpAcc->updatevalue(mfAcc);
+//        mpBrake->updatevalue(mfBrake);
+
+
+    }
+    else
+    {
+        mremotectrl.set_ntype(iv::remotectrl_CtrlType_REMOTE);
+
+    }
+    mremotectrl.set_acc(mfAcc);
+    mremotectrl.set_brake(mfBrake);
+    mremotectrl.set_wheel(mfWheel);
+    mremotectrl.set_shift(mnShift);
+
+
+    int nsersize = mremotectrl.ByteSize();
+    char * strbuf = new char[nsersize];
+    if(mremotectrl.SerializeToArray(strbuf,nsersize))
+    {
+        mgrpcpc->SetCtrlMsg("remotectrl",strbuf,nsersize);
+//        iv::modulecomm::ModuleSendMsg(mpa,strbuf,nsersize);
+    }
+    delete strbuf;
+}
+
+void MainWindow::onTimerUpdatePic()
+{
+    static qint64 time_pic = 0;
+
+    static qint64 time_trace = 0;
+    static int pos = 0;
+    static std::vector<iv::simpletrace> xvectorsimpletrace;
+
+
+
+    if(gTimeTrace != time_trace)
+    {
+        time_trace = gTimeTrace;
+
+        gMutexTrace.lock();
+        xvectorsimpletrace = gvectorsimplerace;
+        gMutexTrace.unlock();
+        pos = 0;
+        if(xvectorsimpletrace.size()> 0)
+        {
+            QJsonArray num_json,num2_json;                       //声明QJsonArray
+            QJsonDocument num_document,num2_document;    //将QJsonArray改为QJsonDocument类
+            QByteArray num_byteArray,num2_byteArray;      //
+
+            int i=0;
+            for(i=0;i<xvectorsimpletrace.size();i++)                            //将数组传入压入num_json
+            {
+                num_json.append(xvectorsimpletrace[i].gps_lng);
+                num2_json.append(xvectorsimpletrace[i].gps_lat);
+            }
+
+            num_document.setArray(num_json);
+            num2_document.setArray(num2_json);
+            num_byteArray = num_document.toJson(QJsonDocument::Compact);
+            num2_byteArray = num2_document.toJson(QJsonDocument::Compact);
+            QString numJson(num_byteArray);             //再转为QString
+            QString num2Json(num2_byteArray);             //再转为QString
+
+
+            QString cmd = QString("settrace(\"%1\",\"%2\")").arg(numJson).arg(num2Json);
+//            mMapview->page()->runJavaScript(cmd);
+        }
+
+    }
+
+//    if(pos<xvectorsimpletrace.size())
+//    {
+//        if(pos == 0)
+//        {
+//            mMapview->page()->runJavaScript("clear()");
+//        }
+
+//        char strscript[256];
+//        snprintf(strscript,255,"mapLocation(%11.7f,%11.7f);",xvectorsimpletrace[pos].gps_lng,xvectorsimpletrace[pos].gps_lat);
+//        mMapview->page()->runJavaScript(strscript);
+//        pos++;
+
+//    }
+}
+
+void MainWindow::onTimerUpdateView()
+{
+    static qint64 time_gps = 0;
+
+    unsigned int i;
+
+   char strlatency[1000];
+   char strtem[100];
+   snprintf(strlatency,1000,"Latency(Up|FrameRate|Down): ");
+   snprintf(strtem,100,"FT(%d|%d|%d) ",mgrpcpc->GetPicLatency(0),mgrpcpc->GetFrameRate(0),mgrpcpc->GetPicDownLatency(0));strncat(strlatency,strtem,1000);
+   snprintf(strtem,100,"RR(%d|%d|%d) ",mgrpcpc->GetPicLatency(1),mgrpcpc->GetFrameRate(1),mgrpcpc->GetPicDownLatency(1));strncat(strlatency,strtem,1000);
+   snprintf(strtem,100,"LT(%d|%d|%d) ",mgrpcpc->GetPicLatency(2),mgrpcpc->GetFrameRate(2),mgrpcpc->GetPicDownLatency(2));strncat(strlatency,strtem,1000);
+   snprintf(strtem,100,"RT(%d|%d|%d) ",mgrpcpc->GetPicLatency(3),mgrpcpc->GetFrameRate(3),mgrpcpc->GetPicDownLatency(3));strncat(strlatency,strtem,1000);
+
+   mpLabelLatency->setText(strlatency);
+
+
+    if(gTimeGPSIMUUpdate != time_gps)
+    {
+        time_gps = gTimeGPSIMUUpdate;
+        char strscript[256];
+        snprintf(strscript,255,"theLocation(%11.7f,%11.7f,%11.3f);",ggpsimu.lon(),ggpsimu.lat(),ggpsimu.heading());
+//        mMapview->page()->runJavaScript(strscript);
+
+        iv::gps::gpsimu xgpsimu;
+        xgpsimu.CopyFrom(ggpsimu);
+
+        ui->lineEdit_gpsins->setText(QString::number(xgpsimu.ins_state()));
+        ui->lineEdit_gpsrtk->setText(QString::number(xgpsimu.rtk_state()));
+        ui->lineEdit_gpslon->setText(QString::number(xgpsimu.lon(),'f',7));
+        ui->lineEdit_gpslat->setText(QString::number(xgpsimu.lat(),'f',7));
+        ui->lineEdit_gpsheading->setText(QString::number(xgpsimu.heading(),'f',2));
+        ui->lineEdit_gpsheight->setText(QString::number(xgpsimu.height(),'f',2));
+        ui->lineEdit_gpsspeed->setText(QString::number(xgpsimu.speed(),'f',2));
+        ui->lineEdit_gpssat->setText(QString::number(xgpsimu.satnum1()));
+
+        mstrGPSTime =  QDateTime::fromMSecsSinceEpoch(xgpsimu.msgtime()).toString("GPS: yyyy-MM-dd hh:mm:ss  ");
+        setWindowTitle(mstrProgName + mstrVIN + mstrGPSTime + mstrPicTime);
+
+        double fVehSpeed = xgpsimu.speed()*3.6;
+
+
+        if(fVehSpeed>30)
+        {
+            if(mnSpeedMax != 130)
+            {
+                mnSpeedMax = 130;
+                mpVehSpeed->setmaxvalue(130);
+            }
+        }
+
+        if(fVehSpeed<20)
+        {
+            if(mnSpeedMax != 30)
+            {
+                mnSpeedMax = 30;
+                mpVehSpeed->setmaxvalue(130);
+            }
+        }
+
+        mpVehSpeed->updatevalue(fVehSpeed);
+    }
+
+
+
+
+
+}
+
+void MainWindow::onCamUpdate(int ncampos, QImage image)
+{
+    int i = ncampos;
+    if(i<2)
+    {
+ //   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 *)
+{
+
+    QTime xTime;
+
+    static int mnDraw = 10;
+    if(mbNeedSetBack == true)
+    {
+        mnDraw = 10;
+        mbNeedSetBack = false;
+    }
+    if(mnDraw>0)
+    {
+        mpainter_background  = new QPainter(this);
+        mpainter_background->drawPixmap(0, 0, this->width(), this->height(), QPixmap(":/pic/background2.jpg"));
+        delete mpainter_background;
+        mnDraw--;
+    }
+
+
+
+
+    int i;
+
+    xTime.start();
+    int nupdate = 0;
+
+    for(i=0;i<NUM_CAM;i++)
+    {
+        if(i<2)
+        {
+            //       continue;
+            if(mbCamUpdate[i])
+            {
+                nupdate++;
+                //           xTime.start();
+                //           std::cout<<" copy image. "<<std::endl;
+                mMutexCam[i].lock();
+                //            QImage image = mpImageCam[i]->copy();
+                mbCamUpdate[i] = false;
+
+
+                //       QImage image = mpPicView->GetImage();
+                mpsceneImg[i]->clear();
+                //           mpsceneImg[i]->addPixmap(QPixmap::fromImage(image));
+                mpsceneImg[i]->addPixmap(QPixmap::fromImage(*mpImageCam[i]));
+                mpviewImg[i]->setScene(mpsceneImg[i]);
+                mpviewImg[i]->show();
+                mMutexCam[i].unlock();
+                //            std::cout<<" update a image use. "<<xTime.elapsed()<<std::endl;
+            }
+        }
+    }
+
+//    std::cout<<" time upadate time: "<<xTime.elapsed()<<" update cout:"<<nupdate<<std::endl;
+
+}
+
+void MainWindow::on_pushButton_Go_clicked()
+{
+
+
+
+    if(ui->comboBox_Station->currentIndex() < 0)return;
+    int index = ui->comboBox_Station->currentIndex();
+
+    if(index<0 ||  index>= gvectorpos.size())
+    {
+        std::cout<<"out range."<<std::endl;
+        return;
+    }
+    iv::pos_def xpos = gvectorpos[index];
+
+    double lon,lat;
+    lon = xpos.mflon;
+    lat = xpos.mflat;
+
+    xodrobj xo;
+    xo.flon = lon;
+    xo.flat = lat;
+    xo.lane = 3;
+
+
+    mgrpcpc->SetCtrlMsg("xodrreq",(char *)&xo,sizeof(xodrobj));
+//    iv::modulecomm::ModuleSendMsg(mpadst,(char *)&xo,sizeof(xodrobj));
+}
+
+void MainWindow::on_comboBox_Station_currentIndexChanged(int index)
+{
+    if(index<0 ||  index>= gvectorpos.size())
+    {
+        std::cout<<"out range."<<std::endl;
+        return;
+    }
+    iv::pos_def xpos = gvectorpos[index];
+
+    char strscript[256];
+    snprintf(strscript,255,"objLocation(%11.7f,%11.7f);",xpos.mflon,xpos.mflat);
+ //   mMapview->page()->runJavaScript(strscript);
+    mbNeedSetBack = true;
+
+}
+
+void MainWindow::on_checkBox_Drive_stateChanged(int arg1)
+{
+
+}
+
+void MainWindow::on_checkBox_Drive_clicked()
+{
+}
+
+void MainWindow::on_checkBox_Null_clicked()
+{
+
+}
+
+void MainWindow::on_checkBox_Rear_clicked()
+{
+    mbNeedSetBack = true;
+}
+
+void MainWindow::on_radioButton_Drive_clicked()
+{
+    mnShift = 1;
+    mbNeedSetBack = true;
+
+//    on_radioButton_picfront_clicked();
+}
+
+void MainWindow::on_radioButton_Null_clicked()
+{
+    mnShift = 0;
+    mbNeedSetBack = true;
+}
+
+
+
+
+
+void MainWindow::onCloseDlg()
+{
+    qDebug("cloase");
+}
+
+void MainWindow::on_checkBox_clicked()
+{
+
+}
+
+void MainWindow::saveavi(int index)
+{
+    (void)index;
+}
+
+
+
+void MainWindow::onCloseBigDlg()
+{
+}
+
+void MainWindow::on_actionSet_Query_Pass_triggered()
+{
+    DialogSetPassWord xdlg(DialogSetPassWord_Type::QUERY,mstrqueryMD5,this);
+    if(xdlg.exec() == xdlg.Accepted)
+    {
+        mgrpcpc->setqueryMD5(ServiceRCIni.GetQueryMD5());
+        mstrqueryMD5 = ServiceRCIni.GetQueryMD5();
+    }
+}
+
+void MainWindow::on_actionSetting_triggered()
+{
+    DialogSetting xdlg(this);
+    if(xdlg.exec() == QDialog::Accepted)
+    {
+        mgrpcpc->setVIN(ServiceRCIni.GetVIN());
+        mstrVehVIN = ServiceRCIni.GetVIN();
+    }
+}
+
+void MainWindow::on_actionSet_Ctrl_Pass_triggered()
+{
+    DialogSetPassWord xdlg(DialogSetPassWord_Type::CTRL,mstrctrlMD5,this);
+    if(xdlg.exec() == xdlg.Accepted)
+    {
+        mgrpcpc->setctrlMD5(ServiceRCIni.GetCtrlMD5());
+        mstrctrlMD5 = ServiceRCIni.GetCtrlMD5();
+    }
+
+}
+
+void MainWindow::threadinfo()
+{
+    int nrtn;
+    iv::cloud::cloudmsg xcloudmsg;
+    while(mbThreadrun)
+    {
+        nrtn = mgrpcpc->GetQueryMsg(xcloudmsg,1000);
+        if(nrtn == 1)
+        {
+            int i;
+            for(i=0;i<xcloudmsg.xclouddata_size();i++)
+            {
+                iv::cloud::cloudunit * punit = xcloudmsg.mutable_xclouddata(i);
+                if(punit->msgname() == "hcp2_gpsimu")
+                {
+                    iv::gps::gpsimu xgpsimu;
+                    if(!xgpsimu.ParseFromArray(punit->data().data(),punit->data().size()))
+                    {
+                        std::cout<<"ListenRaw Parse error."<<std::endl;
+                        continue;
+                    }
+                    ggpsimu.CopyFrom(xgpsimu);
+                    gTimeGPSIMUUpdate = QDateTime::currentMSecsSinceEpoch();
+                }
+            }
+ //           std::cout<<" receive info msg. "<<std::endl;
+        }
+    }
+}
+
+void MainWindow::threadframe(int ncamppos)
+{
+    iv::h264rawframedata xframe;
+    while(mbThreadrun)
+    {
+//        std::this_thread::sleep_for(std::chrono::milliseconds(100));
+//        continue;
+        int nrtn;
+        nrtn = mgrpcpc->Consumeh264frame(ncamppos,xframe,10);
+        if(nrtn == 1)
+        {
+//            std::cout<<"recv a frame."<<std::endl;
+            iv::rawframedata xrawframe;
+            xrawframe.mpstr_ptr = xframe.mpstr_ptr;
+            xrawframe.ndatasize = xframe.mdatasize;
+            mph264decode[ncamppos]->addframedata(xrawframe);
+        }
+    }
+}
+
+void MainWindow::threadpic(int ncampos)
+{
+
+    while(mbThreadrun)
+    {
+        int nindex = mph264decode[ncampos]->GetUpdatedIndex(10);
+        if(nindex<0)continue;
+//        std::cout<<" recv a yuv."<<std::endl;
+        iv::framedecodebuf * pbuf =  mph264decode[ncampos]->LockReadBuff(nindex);
+        int cy = pbuf->frameheight;
+        int cx = pbuf->framewidth;
+        cv::Mat rgbImg(cy, cx,CV_8UC3);
+
+        if((cy!=mnframeheight) || (cx != mnframewidth))
+        {
+            mnframeheight = cy;
+            mnframewidth = cx;
+            resizeEvent(NULL);
+
+        }
+
+
+#ifndef USE_QSV
+        cv::cvtColor(pbuf->myuvImg, rgbImg,  CV_YUV2RGB_I420);
+#endif
+#ifdef USE_QSV
+        cv::cvtColor(pbuf->myuvImg, rgbImg,  CV_YUV2RGB_NV12);
+#endif
+        mph264decode[ncampos]->UnlockReadBuff(nindex);
+
+        QImage image2 = QImage((uchar*)(rgbImg.data), rgbImg.cols, rgbImg.rows,  QImage::Format_RGB888);
+
+#ifndef TESTH264
+        mMutexCam[ncampos].lock();
+//        emit CamUpdate(ncampos,image2);
+        *mpImageCam[ncampos] = image2.copy();
+        mbCamUpdate[ncampos] = true;
+        mMutexCam[ncampos].unlock();
+        emit CamUpdate(ncampos);
+#else
+        unsigned int j;
+        for(j=0;j<NUM_CAM;j++)
+        {
+            mMutexCam[j].lock();
+            //        emit CamUpdate(ncampos,image2);
+            *mpImageCam[j] = image2.copy();
+            mbCamUpdate[j] = true;
+            mMutexCam[j].unlock();
+            emit CamUpdate( static_cast<int>(j));
+        }
+        gwleft->SetImage(image2);
+        gwright->SetImage(image2);
+#endif
+//        cv::cvtColor(rgbImg, rgbImg, CV_BGR2RGB);
+//        QImage image2 = QImage((uchar*)(rgbImg.data), rgbImg.cols, rgbImg.rows,  QImage::Format_RGB888);
+    }
+}
+
+void MainWindow::onCamUpdate(int ncampos)
+{
+    (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()
+{
+    showFullScreen();
+    ui->menubar->setVisible(false);
+    ui->statusbar->setVisible(false);
+    mbNeedSetBack = true;
+}
+
+void MainWindow::on_actionNormal_triggered()
+{
+    showNormal();
+}
+
+void MainWindow::on_horizontalSlider_wheelspeed_sliderMoved(int position)
+{
+    (void)position;
+    mfWheelSpeed = mfWheelBaseSpeed * ui->horizontalSlider_wheelspeed->value();
+    mbNeedSetBack = true;
+}
+
+void MainWindow::on_horizontalSlider_wheelspeed_valueChanged(int value)
+{
+    (void)value;
+    mfWheelSpeed = mfWheelBaseSpeed * ui->horizontalSlider_wheelspeed->value();
+    mbNeedSetBack = true;
+}

+ 246 - 0
src/tool/RemoteCtrl_Wide/mainwindowcenter.h

@@ -0,0 +1,246 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+
+#define CAMERA_NUM 4
+
+#include <QMainWindow>
+
+#include <QTranslator>
+
+#include <QtWidgets>
+//#include <QtWebEngineWidgets/QtWebEngineWidgets>
+#include <QSet>
+#include <QMutex>
+#include <QLabel>
+
+#include <iostream>
+
+#include <speed.h>
+
+#include "remotectrl.pb.h"
+#include "gpsimu.pb.h"
+#include "rawpic.pb.h"
+
+#include "myview.h"
+#include "grpcpc.h"
+#include "modulecomm.h"
+#include "joyreadthread.h"
+#include "dialogsetpassword.h"
+#include "dialogsetting.h"
+#include "ivh264framedecode.h"
+
+#include "pluginapp.h"
+
+QT_BEGIN_NAMESPACE
+namespace Ui { class MainWindowCenter; }
+QT_END_NAMESPACE
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    MainWindow(QWidget *parent = nullptr);
+    ~MainWindow();
+
+private slots:
+    void on_pushButton_test_clicked();
+
+    virtual void paintEvent(QPaintEvent *);
+
+    void on_radioButton_manual_clicked();
+
+    void onTimerManual();
+
+    void onTimerRemote();
+
+    void onTimerUpdateView();
+
+    void onTimerUpdatePic();
+
+    void on_radioButton_auto_clicked();
+
+//    virtual void paintEvent(QPaintEvent *);
+
+
+
+    void on_pushButton_Go_clicked();
+
+    void on_comboBox_Station_currentIndexChanged(int index);
+
+    void on_checkBox_Drive_stateChanged(int arg1);
+
+    void on_checkBox_Drive_clicked();
+
+    void on_checkBox_Null_clicked();
+
+    void on_checkBox_Rear_clicked();
+
+    void on_radioButton_Drive_clicked();
+
+    void on_radioButton_Null_clicked();
+
+
+
+    void onCloseDlg();
+    void onCloseBigDlg();
+
+    void on_checkBox_clicked();
+
+
+    void on_actionSet_Query_Pass_triggered();
+
+    void on_actionSetting_triggered();
+
+    void on_actionSet_Ctrl_Pass_triggered();
+
+    void onCamUpdate(int ncampos);
+
+    void on_actionFullScreem_triggered();
+
+    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) Q_DECL_OVERRIDE;
+
+     void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
+
+     void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
+
+
+
+private:
+    Ui::MainWindowCenter *ui;
+
+
+//    QWebEngineView * mMapview;
+
+    Speed * mpWheel, * mpAcc, * mpBrake;
+
+    Speed * mpVehSpeed;
+
+    int mnSpeedMax = 30.0;
+
+     QSet<int> mPressKeys;
+
+     QTimer * mpTimerManual;
+     QTimer * mpTimerRemote;
+
+     double mfWheel = 0;
+     double mfAcc = 0;
+     double mfBrake = 0;
+
+     int mnLastTime;
+     QTime mManualTime;
+
+     double mfWheelSpeed = 10; //100degree/s
+     double mfAccSpeed = 30; //30/s
+     double mfBrakeSpeed = 100; //100/s
+
+     double mfWheelBaseSpeed = 10;
+
+     double mfWheelAutoDownSpeed = 0;
+     double mfAccAutoDownSpeed = 10;
+     double mfBrakeAutoDownSpeed = 30;
+
+     iv::remotectrl mremotectrl;
+
+     void * mpa;
+
+     QTimer * mpTimerUpdateView;
+
+     MyView * mmyview;
+     QGraphicsScene *mscene;
+
+     MyView * mmyviewRear;
+
+//     MyView * mmyviewLeft,* mmyviewRear,*mmyviewRight;
+
+     MyView * mpviewImg[NUM_CAM];
+     QGraphicsScene * mpsceneImg[NUM_CAM];
+
+     void * mpadst;
+     void * mpasimpletrace;
+
+     grpcpc * mgrpcpc;
+
+     QString mstrProgName = "ADC IV Remote Control  ";
+     QString mstrGPSTime = " GPS:";
+     QString mstrPicTime = " Pic:";
+
+     QString mstrVIN;
+
+     JoyReadThread * mpJRT;
+
+     int mnShift = 0;
+
+     int mnSelPic = 0;
+
+
+
+     bool mbSavePic = false;
+
+public:
+     void saveavi(int index);
+
+
+private:
+    void CreateView();
+
+private:
+    QLabel * mpLabelLatency;
+
+private:
+    std::string mstrserverip = "192.168.14.98";//"111.33.136.149";//"127.0.0.1";// "140.143.237.38";
+    std::string mstrserverport = "50051";//"9000";
+    std::string mstruploadinterval = "100";
+    std::string mstrVehVIN = "AAAAAAAAAAAAAAAAA";
+    std::string mstrqueryMD5 = "5d41402abc4b2a76b9719d911017c592";
+    std::string mstrctrlMD5 = "5d41402abc4b2a76b9719d911017c592";
+
+private:
+    pluginapp * mpbaiduapp;
+    pluginapp * mppicshow;
+
+private:
+    bool mbThreadrun = true;
+private:
+    void threadframe(int ncamppos);
+    void threadpic(int ncampos);
+    void threadinfo();
+
+private:
+    ivh264framedecode * mph264decode[NUM_CAM];
+
+    int mnframewidth =  1920;
+    int mnframeheight = 1080;//720;
+
+    std::thread * mpthreadframe[NUM_CAM];
+    std::thread * mpthreadpic[NUM_CAM];
+    std::thread * mpthreadinfo;
+
+    QImage * mpImageCam[NUM_CAM];
+    bool mbCamUpdate[NUM_CAM];
+    QMutex mMutexCam[NUM_CAM];
+
+    int mnVehMode = 1; //1 Speed Mode  2 AccBrakeMode
+
+    QTranslator * m_translator;
+
+    QPainter  *mpainter_background = 0;
+    bool mbNeedSetBack = true;
+
+    double mfWide_View_CenterRatio = 0.2656;
+    double mfWide_View_LRRatio = 0.5;  //Left Right Reletive to Center.
+};
+#endif // MAINWINDOW_H

+ 463 - 0
src/tool/RemoteCtrl_Wide/mainwindowcenter.ui

@@ -0,0 +1,463 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindowCenter</class>
+ <widget class="QMainWindow" name="MainWindowCenter">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>1920</width>
+    <height>603</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="remotectrl.qrc">
+    <normaloff>:/remotectrl.png</normaloff>:/remotectrl.png</iconset>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <widget class="QLineEdit" name="lineEdit_lat">
+    <property name="geometry">
+     <rect>
+      <x>940</x>
+      <y>50</y>
+      <width>113</width>
+      <height>25</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_lon">
+    <property name="geometry">
+     <rect>
+      <x>940</x>
+      <y>110</y>
+      <width>113</width>
+      <height>25</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="pushButton_test">
+    <property name="geometry">
+     <rect>
+      <x>950</x>
+      <y>190</y>
+      <width>89</width>
+      <height>25</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Test</string>
+    </property>
+   </widget>
+   <widget class="QGroupBox" name="groupBox_rem">
+    <property name="geometry">
+     <rect>
+      <x>840</x>
+      <y>240</y>
+      <width>291</width>
+      <height>311</height>
+     </rect>
+    </property>
+    <property name="title">
+     <string>Control</string>
+    </property>
+    <widget class="QRadioButton" name="radioButton_manual">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>30</y>
+       <width>61</width>
+       <height>23</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>远程</string>
+     </property>
+    </widget>
+    <widget class="QRadioButton" name="radioButton_auto">
+     <property name="geometry">
+      <rect>
+       <x>80</x>
+       <y>30</y>
+       <width>61</width>
+       <height>23</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>自动</string>
+     </property>
+    </widget>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>129</y>
+       <width>151</width>
+       <height>121</height>
+      </rect>
+     </property>
+     <property name="title">
+      <string>档位</string>
+     </property>
+     <widget class="QRadioButton" name="radioButton_Drive">
+      <property name="geometry">
+       <rect>
+        <x>10</x>
+        <y>30</y>
+        <width>112</width>
+        <height>23</height>
+       </rect>
+      </property>
+      <property name="text">
+       <string>前进</string>
+      </property>
+     </widget>
+     <widget class="QRadioButton" name="radioButton_Null">
+      <property name="geometry">
+       <rect>
+        <x>10</x>
+        <y>60</y>
+        <width>112</width>
+        <height>23</height>
+       </rect>
+      </property>
+      <property name="text">
+       <string>空档</string>
+      </property>
+     </widget>
+     <widget class="QRadioButton" name="radioButton_Rear">
+      <property name="geometry">
+       <rect>
+        <x>10</x>
+        <y>90</y>
+        <width>112</width>
+        <height>23</height>
+       </rect>
+      </property>
+      <property name="text">
+       <string>后退</string>
+      </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">
+     <rect>
+      <x>420</x>
+      <y>190</y>
+      <width>351</width>
+      <height>121</height>
+     </rect>
+    </property>
+    <property name="title">
+     <string>Map</string>
+    </property>
+    <widget class="QPushButton" name="pushButton_Go">
+     <property name="geometry">
+      <rect>
+       <x>240</x>
+       <y>50</y>
+       <width>91</width>
+       <height>41</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>前往</string>
+     </property>
+    </widget>
+    <widget class="QComboBox" name="comboBox_Station">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>50</y>
+       <width>211</width>
+       <height>41</height>
+      </rect>
+     </property>
+    </widget>
+   </widget>
+   <widget class="QGroupBox" name="groupBox_gps">
+    <property name="geometry">
+     <rect>
+      <x>200</x>
+      <y>320</y>
+      <width>411</width>
+      <height>351</height>
+     </rect>
+    </property>
+    <property name="title">
+     <string>GPS</string>
+    </property>
+    <widget class="QLineEdit" name="lineEdit_gpsins">
+     <property name="geometry">
+      <rect>
+       <x>80</x>
+       <y>30</y>
+       <width>81</width>
+       <height>25</height>
+      </rect>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_gpsins">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>30</y>
+       <width>67</width>
+       <height>17</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>Ins</string>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_gpsrtk">
+     <property name="geometry">
+      <rect>
+       <x>190</x>
+       <y>30</y>
+       <width>67</width>
+       <height>17</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>RTK</string>
+     </property>
+    </widget>
+    <widget class="QLineEdit" name="lineEdit_gpsrtk">
+     <property name="geometry">
+      <rect>
+       <x>250</x>
+       <y>30</y>
+       <width>81</width>
+       <height>25</height>
+      </rect>
+     </property>
+    </widget>
+    <widget class="QLineEdit" name="lineEdit_gpslon">
+     <property name="geometry">
+      <rect>
+       <x>80</x>
+       <y>60</y>
+       <width>81</width>
+       <height>25</height>
+      </rect>
+     </property>
+    </widget>
+    <widget class="QLineEdit" name="lineEdit_gpslat">
+     <property name="geometry">
+      <rect>
+       <x>250</x>
+       <y>60</y>
+       <width>81</width>
+       <height>25</height>
+      </rect>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_gpslon">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>60</y>
+       <width>67</width>
+       <height>17</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>Lon</string>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_gpslat">
+     <property name="geometry">
+      <rect>
+       <x>190</x>
+       <y>60</y>
+       <width>67</width>
+       <height>17</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>Lat</string>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_gpsheading">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>90</y>
+       <width>67</width>
+       <height>17</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>Heading</string>
+     </property>
+    </widget>
+    <widget class="QLineEdit" name="lineEdit_gpsheading">
+     <property name="geometry">
+      <rect>
+       <x>80</x>
+       <y>90</y>
+       <width>81</width>
+       <height>25</height>
+      </rect>
+     </property>
+    </widget>
+    <widget class="QLineEdit" name="lineEdit_gpsheight">
+     <property name="geometry">
+      <rect>
+       <x>250</x>
+       <y>90</y>
+       <width>81</width>
+       <height>25</height>
+      </rect>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_gpsheight">
+     <property name="geometry">
+      <rect>
+       <x>190</x>
+       <y>90</y>
+       <width>67</width>
+       <height>17</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>Height</string>
+     </property>
+    </widget>
+    <widget class="QLineEdit" name="lineEdit_gpsspeed">
+     <property name="geometry">
+      <rect>
+       <x>80</x>
+       <y>120</y>
+       <width>81</width>
+       <height>25</height>
+      </rect>
+     </property>
+    </widget>
+    <widget class="QLineEdit" name="lineEdit_gpssat">
+     <property name="geometry">
+      <rect>
+       <x>250</x>
+       <y>120</y>
+       <width>81</width>
+       <height>25</height>
+      </rect>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_gpsspeed">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>120</y>
+       <width>67</width>
+       <height>17</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>Speed</string>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_gpssat">
+     <property name="geometry">
+      <rect>
+       <x>190</x>
+       <y>120</y>
+       <width>67</width>
+       <height>17</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>Sat</string>
+     </property>
+    </widget>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>1920</width>
+     <height>28</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuFile">
+    <property name="title">
+     <string>File</string>
+    </property>
+    <addaction name="actionSetting"/>
+    <addaction name="actionSet_Query_Pass"/>
+    <addaction name="actionSet_Ctrl_Pass"/>
+   </widget>
+   <widget class="QMenu" name="menuView">
+    <property name="title">
+     <string>View</string>
+    </property>
+    <addaction name="actionFullScreem"/>
+    <addaction name="actionNormal"/>
+   </widget>
+   <addaction name="menuFile"/>
+   <addaction name="menuView"/>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+  <action name="actionSetting">
+   <property name="text">
+    <string>Setting</string>
+   </property>
+  </action>
+  <action name="actionSet_Query_Pass">
+   <property name="text">
+    <string>Set Query Pass</string>
+   </property>
+  </action>
+  <action name="actionSet_Ctrl_Pass">
+   <property name="text">
+    <string>Set Ctrl Pass</string>
+   </property>
+  </action>
+  <action name="actionFullScreem">
+   <property name="text">
+    <string>FullScreen</string>
+   </property>
+  </action>
+  <action name="actionNormal">
+   <property name="text">
+    <string>Normal</string>
+   </property>
+  </action>
+ </widget>
+ <resources>
+  <include location="remotectrl.qrc"/>
+ </resources>
+ <connections/>
+</ui>

+ 120 - 0
src/tool/RemoteCtrl_Wide/mainwindowleft.cpp

@@ -0,0 +1,120 @@
+#include "mainwindowleft.h"
+#include "ui_mainwindowleft.h"
+
+MainWindowLeft::MainWindowLeft(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::MainWindowLeft)
+{
+    ui->setupUi(this);
+
+    mpImageCam = new QImage(640, 360, QImage::Format_RGB32);
+    mpsceneImg = new QGraphicsScene;;
+
+    mmyview = new MyView(ui->centralwidget);
+    mmyview->setObjectName(QStringLiteral("graphicsView"));
+    mmyview->setGeometry(QRect(30, 30, 600, 600));
+    mmyview->setCacheMode(mmyview->CacheBackground);
+
+    connect(mmyview,SIGNAL(EscFull()),this,SLOT(onEscFull()));
+
+    connect(this,SIGNAL(imageupdate()),this,SLOT(onImageUpdate()));
+}
+
+MainWindowLeft::~MainWindowLeft()
+{
+    delete ui;
+}
+
+void MainWindowLeft::SetWT(QString strTitle)
+{
+    setWindowTitle(strTitle);
+}
+
+void MainWindowLeft::keyPressEvent(QKeyEvent *event)
+{
+
+    //按键按下,key值放入容器,如果是长按触发的repeat就不判断
+    if(!event->isAutoRepeat())
+        mPressKeys.insert(event->key());
+
+
+}
+
+void MainWindowLeft::keyReleaseEvent(QKeyEvent *event)
+{
+    if((event->key() == Qt::Key_Escape)||(event->key() == Qt::Key_F11))
+    {
+        showNormal();
+        ui->menubar->setVisible(true);
+        ui->statusbar->setVisible(true);
+    }
+    if(!event->isAutoRepeat())mPressKeys.remove(event->key());
+}
+
+void MainWindowLeft::on_actionFullScreen_triggered()
+{
+    showFullScreen();
+    ui->menubar->setVisible(false);
+    ui->statusbar->setVisible(false);
+}
+
+void MainWindowLeft::resizeEvent(QResizeEvent *event)
+{
+    (void)event;
+    QSize sizemain = ui->centralwidget->size();
+    mmyview->setGeometry(0,0,sizemain.width()-0,sizemain.height()-0);
+
+    double fscale = sizemain.width()*0.99/mnFrameWidth;
+    double fscale2 = sizemain.height()*0.99/mnFrameHeight;
+//       fscale = fscale * 0.99;
+    if(fscale>fscale2)fscale = fscale2;
+    mmyview->viewscaleto(fscale);
+
+
+}
+
+void MainWindowLeft::onEscFull()
+{
+    showNormal();
+    ui->menubar->setVisible(true);
+    ui->statusbar->setVisible(true);
+}
+
+void MainWindowLeft::SetImage(QImage & xImage)
+{
+    mMutexCam.lock();
+    *mpImageCam = xImage.copy();
+    mbCamUpdate = true;
+    mMutexCam.unlock();
+    emit imageupdate();
+
+}
+
+void MainWindowLeft::onImageUpdate()
+{
+    update();
+}
+
+void MainWindowLeft::paintEvent(QPaintEvent * event)
+{
+    (void)event;
+    if(mbCamUpdate)
+    {
+
+        mMutexCam.lock();
+        //            QImage image = mpImageCam[i]->copy();
+        mbCamUpdate = false;
+
+
+        //       QImage image = mpPicView->GetImage();
+        mpsceneImg->clear();
+        //           mpsceneImg[i]->addPixmap(QPixmap::fromImage(image));
+        mpsceneImg->addPixmap(QPixmap::fromImage(*mpImageCam));
+        mmyview->setScene(mpsceneImg);
+        mmyview->show();
+        mMutexCam.unlock();
+        //            std::cout<<" update a image use. "<<xTime.elapsed()<<std::endl;
+    }
+}
+
+

+ 68 - 0
src/tool/RemoteCtrl_Wide/mainwindowleft.h

@@ -0,0 +1,68 @@
+#ifndef MAINWINDOWLEFT_H
+#define MAINWINDOWLEFT_H
+
+#include <QMainWindow>
+
+#include <QSet>
+#include <QKeyEvent>
+#include <QImage>
+
+#include <mutex>
+
+#include "myview.h"
+
+namespace Ui {
+class MainWindowLeft;
+}
+
+class MainWindowLeft : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit MainWindowLeft(QWidget *parent = 0);
+    ~MainWindowLeft();
+    void SetWT(QString strTitle);
+    void SetImage(QImage & xImage);
+
+private slots:
+    void on_actionFullScreen_triggered();
+    void onEscFull();
+    virtual void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+
+    void onImageUpdate();
+
+signals:
+    void imageupdate();
+
+private:
+    Ui::MainWindowLeft *ui;
+
+private:
+    void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
+
+    void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
+
+    void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
+
+private:
+    QSet<int> mPressKeys;
+
+    MyView * mmyview;
+    QGraphicsScene *mscene;
+
+    QImage * mpImageCam;
+     QGraphicsScene * mpsceneImg;
+
+    bool mbCamUpdate = false;
+
+    std::mutex mMutexCam;
+
+    int mnFrameWidth = 1920;
+    int mnFrameHeight = 1080;
+
+
+
+};
+
+#endif // MAINWINDOWLEFT_H

+ 43 - 0
src/tool/RemoteCtrl_Wide/mainwindowleft.ui

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindowLeft</class>
+ <widget class="QMainWindow" name="MainWindowLeft">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>640</width>
+    <height>360</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Left View</string>
+  </property>
+  <widget class="QWidget" name="centralwidget"/>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>640</width>
+     <height>28</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuView">
+    <property name="title">
+     <string>View</string>
+    </property>
+    <addaction name="actionFullScreen"/>
+   </widget>
+   <addaction name="menuView"/>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+  <action name="actionFullScreen">
+   <property name="text">
+    <string>FullScreen</string>
+   </property>
+  </action>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 9 - 0
src/tool/RemoteCtrl_Wide/myview.cpp

@@ -126,3 +126,12 @@ void MyView::viewscaleto(double fratio)
     beishu *= fscale;
     centerOn(450, 700 - (200 / beishu));
 }
+
+void MyView::keyReleaseEvent(QKeyEvent *event)
+{
+    (void)event;
+    if((event->key() == Qt::Key_Escape)||(event->key() == Qt::Key_F11))
+    {
+        emit EscFull();
+    }
+}

+ 4 - 0
src/tool/RemoteCtrl_Wide/myview.h

@@ -25,9 +25,13 @@ protected:
     void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
     void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
     void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+    void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
 public Q_SLOTS:
     void zoomIn();  // 放大
     void zoomOut();  // 缩小
+
+signals:
+    void EscFull();
 private:
     bool bottonstatus = false;
     QPoint myview_lastMousePos;