Kaynağa Gözat

Changing ADCIntelligentShow_grpc.

yuchuli 1 yıl önce
ebeveyn
işleme
67dec08f50

+ 74 - 43
src/tool/RemoteCtrl_Wide/joyreadthread.cpp

@@ -177,60 +177,72 @@ int JoyReadThread::GetShift()
 #include "dinput.h"
 #include "joyreadthread.h"
 
-void JoyReadThread::LoadAPI()
-{
-    mbJoyOK = false;
-    std::cout<<"Load Logi g29 API"<<std::endl;
-    QLibrary xlib("./LogitechSteeringWheelEnginesWrapper.dll");
-    if(!xlib.load())
-    {
-        std::cout<<" load LogitechSteeringWheelEnginesWrapper fail."<<xlib.errorString().toStdString()<< std::endl;
-        return ;
-    }
-
-    LogiUpdate =(LogiUpdateFunction)xlib.resolve("LogiUpdate");
-
-    if(LogiUpdate == NULL)
-    {
-        std::cout<<" no this api."<<std::endl;
-        return;
-    }
-    else
-    {
-        std::cout<<" Load API Successfully. "<<std::endl;
-    }
-
-    LogiSteeringInitialize =(LogiSteeringInitializeFunction)xlib.resolve("LogiSteeringInitialize");
-    LogiIsConnected =(LogiIsConnectedFunction)xlib.resolve("LogiIsConnected");
-    LogiGetState =(LogiGetStateFunction)xlib.resolve("LogiGetState");
-    LogiSteeringShutdown =(LogiSteeringShutdownFunction)xlib.resolve("LogiSteeringShutdown");
-    LogiPlayConstantForce =(LogiPlayConstantForceFunction)xlib.resolve("LogiPlayConstantForce");
-    LogiStopConstantForce =(LogiStopConstantForceFunction)xlib.resolve("LogiStopConstantForce");
-
-    if((LogiSteeringInitialize == NULL)||(LogiIsConnected == NULL)||(LogiGetState == NULL)||(LogiSteeringShutdown == NULL))
-    {
-        std::cout<<" no this apiS."<<std::endl;
-        return;
-    }
-    else
-    {
-        std::cout<<" Load All API Successfully. "<<std::endl;
-    }
+#ifdef Q_OS_WIN
+extern HWND gwnd;
+#endif
 
-    mbJoyOK = true;
-}
+//void JoyReadThread::LoadAPI()
+//{
+//    mbJoyOK = false;
+//    std::cout<<"Load Logi g29 API"<<std::endl;
+//    QLibrary xlib("./LogitechSteeringWheelEnginesWrapper.dll");
+//    if(!xlib.load())
+//    {
+//        std::cout<<" load LogitechSteeringWheelEnginesWrapper fail."<<xlib.errorString().toStdString()<< std::endl;
+//        return ;
+//    }
+
+//    LogiUpdate =(LogiUpdateFunction)xlib.resolve("LogiUpdate");
+
+//    if(LogiUpdate == NULL)
+//    {
+//        std::cout<<" no this api."<<std::endl;
+//        return;
+//    }
+//    else
+//    {
+//        std::cout<<" Load API Successfully. "<<std::endl;
+//    }
+
+//    LogiSteeringInitialize =(LogiSteeringInitializeFunction)xlib.resolve("LogiSteeringInitialize");
+//    LogiSteeringInitializeWithWindow =(LogiSteeringInitializeWithWindowFunction)xlib.resolve("LogiSteeringInitializeWithWindow");
+//    LogiIsConnected =(LogiIsConnectedFunction)xlib.resolve("LogiIsConnected");
+//    LogiGetState =(LogiGetStateFunction)xlib.resolve("LogiGetState");
+//    LogiSteeringShutdown =(LogiSteeringShutdownFunction)xlib.resolve("LogiSteeringShutdown");
+//    LogiPlayConstantForce =(LogiPlayConstantForceFunction)xlib.resolve("LogiPlayConstantForce");
+//    LogiStopConstantForce =(LogiStopConstantForceFunction)xlib.resolve("LogiStopConstantForce");
+
+//    if((LogiSteeringInitialize == NULL)||(LogiIsConnected == NULL)||(LogiGetState == NULL)||(LogiSteeringShutdown == NULL)||(LogiSteeringInitializeWithWindow == NULL))
+//    {
+//        std::cout<<" no this apiS."<<std::endl;
+//        return;
+//    }
+//    else
+//    {
+//        std::cout<<" Load All API Successfully. "<<std::endl;
+//    }
+
+//    mbJoyOK = true;
+//}
 
 JoyReadThread::JoyReadThread()
 {
 
-    LoadAPI();
+//    LoadAPI();
 }
 
 void JoyReadThread::run()
 {
     if(mbJoyOK == false)return;
 
-    bool bStart = LogiSteeringInitialize(false);
+    return;
+
+     msleep(3000);
+//    bool bStart = LogiSteeringInitialize(false);
+
+
+
+    bool bStart = LogiSteeringInitializeWithWindow(false,gwnd);
     std::cout<<" init. "<<bStart<<std::endl;
 
     int nFail = 0;
@@ -240,6 +252,7 @@ void JoyReadThread::run()
         double angle,acc,brake;
         if((LogiUpdate())&&(LogiIsConnected(0)))
         {
+            std::cout<<"get state."<<std::endl;
             DIJOYSTATE2* wheel = LogiGetState(0);
             angle = wheel->lX;
             acc = wheel->lY;
@@ -319,4 +332,22 @@ int JoyReadThread::GetShift()
     return mnShift;
 }
 
+void JoyReadThread::SetWheel(double fWheel)
+{
+    mfWheel = fWheel;
+}
+void JoyReadThread::SetAcc(double fAcc)
+{
+    mfAcc = fAcc;
+}
+
+void JoyReadThread::SetBrake(double fBrake)
+{
+    mfBrake = fBrake;
+}
+void JoyReadThread::SetJoyOK(bool bOk)
+{
+    mbJoyOK = bOk;
+}
+
 #endif

+ 11 - 1
src/tool/RemoteCtrl_Wide/joyreadthread.h

@@ -11,6 +11,10 @@
  #include "dinput.h"
 
 typedef bool (*LogiSteeringInitializeFunction)(bool ignoreXInputControllers);
+
+typedef bool (*LogiSteeringInitializeWithWindowFunction)(bool ignoreXInputControllers,HWND hwnd);
+
+
 typedef bool  (*LogiUpdateFunction)();
 //Check if a generic device at index is connected
 typedef  bool (*LogiIsConnectedFunction)(const int index);
@@ -71,7 +75,13 @@ private:
     LogiSteeringShutdownFunction LogiSteeringShutdown;
     LogiPlayConstantForceFunction LogiPlayConstantForce;
     LogiStopConstantForceFunction LogiStopConstantForce;
-    void LoadAPI();
+    LogiSteeringInitializeWithWindowFunction LogiSteeringInitializeWithWindow;
+//    void LoadAPI();
+public:
+    void SetWheel(double fWheel);
+    void SetAcc(double fAcc);
+    void SetBrake(double fBrake);
+    void SetJoyOK(bool bOk);
 #endif
 };
 

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

@@ -53,6 +53,10 @@ void LoadPos(std::string strfilepath)
 
 #include "ivbacktrace.h"
 
+#ifdef Q_OS_WIN
+HWND gwnd;
+#endif
+
 int main(int argc, char *argv[])
 {
 
@@ -84,5 +88,9 @@ int main(int argc, char *argv[])
     wr.show();
     gwleft = &wl;
     gwright = &wr;
+
+#ifdef Q_OS_WIN
+    gwnd = (HWND)w.winId();
+#endif
     return a.exec();
 }

+ 121 - 1
src/tool/RemoteCtrl_Wide/mainwindowcenter.cpp

@@ -178,6 +178,18 @@ MainWindow::MainWindow(QWidget *parent)
 
     connect(this,SIGNAL(CamUpdate(int)),this,SLOT(onCamUpdate(int)));
 
+#ifdef Q_OS_WIN
+   LoadAPI();
+
+   HWND hwnd = (HWND)this->winId();
+   bool bStart = LogiSteeringInitializeWithWindow(false,hwnd);
+   std::cout<<" init. "<<bStart<<std::endl;
+
+   QTimer * timerjoy = new QTimer(this);
+   connect(timerjoy,SIGNAL(timeout()),this,SLOT(onTimerJoy()));
+   timerjoy->start(50);
+#endif
+
     setWindowTitle(mstrProgName +mstrVIN+  mstrGPSTime );
 
 
@@ -186,7 +198,9 @@ MainWindow::MainWindow(QWidget *parent)
 
 MainWindow::~MainWindow()
 {
-
+#ifdef Q_OS_WIN
+    LogiSteeringShutdown();
+#endif
 
     mpJRT->requestInterruption();
     mbThreadrun = false;
@@ -263,6 +277,112 @@ void MainWindow::CreateView()
 
 }
 
+#ifdef Q_OS_WIN
+void MainWindow::LoadAPI()
+{
+
+    std::cout<<"Load Logi g29 API"<<std::endl;
+    QLibrary xlib("./LogitechSteeringWheelEnginesWrapper.dll");
+    if(!xlib.load())
+    {
+        std::cout<<" load LogitechSteeringWheelEnginesWrapper fail."<<xlib.errorString().toStdString()<< std::endl;
+        return ;
+    }
+
+    LogiUpdate =(LogiUpdateFunction)xlib.resolve("LogiUpdate");
+
+    if(LogiUpdate == NULL)
+    {
+        std::cout<<" no this api."<<std::endl;
+        return;
+    }
+    else
+    {
+        std::cout<<" Load API Successfully. "<<std::endl;
+    }
+
+    LogiSteeringInitialize =(LogiSteeringInitializeFunction)xlib.resolve("LogiSteeringInitialize");
+    LogiSteeringInitializeWithWindow =(LogiSteeringInitializeWithWindowFunction)xlib.resolve("LogiSteeringInitializeWithWindow");
+    LogiIsConnected =(LogiIsConnectedFunction)xlib.resolve("LogiIsConnected");
+    LogiGetState =(LogiGetStateFunction)xlib.resolve("LogiGetState");
+    LogiSteeringShutdown =(LogiSteeringShutdownFunction)xlib.resolve("LogiSteeringShutdown");
+    LogiPlayConstantForce =(LogiPlayConstantForceFunction)xlib.resolve("LogiPlayConstantForce");
+    LogiStopConstantForce =(LogiStopConstantForceFunction)xlib.resolve("LogiStopConstantForce");
+
+    if((LogiSteeringInitialize == NULL)||(LogiIsConnected == NULL)||(LogiGetState == NULL)||(LogiSteeringShutdown == NULL)||(LogiSteeringInitializeWithWindow == NULL))
+    {
+        std::cout<<" no this apiS."<<std::endl;
+        return;
+    }
+    else
+    {
+        std::cout<<" Load All API Successfully. "<<std::endl;
+    }
+
+}
+
+void MainWindow::onTimerJoy()
+{
+    double angle,acc,brake;
+    static int nFail;
+    if((LogiUpdate())&&(LogiIsConnected(0)))
+    {
+        std::cout<<"get state."<<std::endl;
+        DIJOYSTATE2* wheel = LogiGetState(0);
+        angle = wheel->lX;
+        acc = wheel->lY;
+        brake = wheel->lRz;
+        if(angle>100)
+        {
+            int force;
+            if(angle>3000)force = 30;
+            else
+            {
+                force = angle*30/3000;
+            }
+            LogiPlayConstantForce(0,force);
+        }
+        else
+        {
+            if(angle<-100)
+            {
+                int force;
+                if(angle<-3000)force = -30;
+                else
+                {
+                    force = angle*30/3000;
+                }
+               LogiPlayConstantForce(0,force);
+            }
+            else
+            {
+                LogiStopConstantForce(0);
+            }
+        }
+
+//        mfWheel = angle;
+//        mfAcc = acc;
+//        mfBrake = brake;
+        nFail = 0;
+        mpJRT->SetJoyOK(true);
+        mpJRT->SetWheel(angle);
+        mpJRT->SetAcc(acc);
+        mpJRT->SetBrake(brake);
+    }
+    else
+    {
+        nFail++;
+    }
+    if(nFail>10)
+    {
+       mpJRT->SetJoyOK(false);
+    }
+}
+
+#endif
+
+
+
 
 void MainWindow::keyPressEvent(QKeyEvent *event)
 {

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

@@ -113,6 +113,11 @@ private slots:
 
     void onEscFull();
 
+#ifdef Q_OS_WIN
+    void onTimerJoy();
+
+#endif
+
 signals:
     void CamUpdate(int ncampos);
     void CamUpdate(int ncampos,QImage image);
@@ -251,5 +256,22 @@ private:
 
 
     bool mbSave[NUM_CAM] = {false,false,false,false};
+
+
+#ifdef Q_OS_WIN
+
+
+
+
+    LogiUpdateFunction LogiUpdate;
+    LogiSteeringInitializeFunction LogiSteeringInitialize;
+    LogiIsConnectedFunction LogiIsConnected;
+    LogiGetStateFunction LogiGetState;
+    LogiSteeringShutdownFunction LogiSteeringShutdown;
+    LogiPlayConstantForceFunction LogiPlayConstantForce;
+    LogiStopConstantForceFunction LogiStopConstantForce;
+    LogiSteeringInitializeWithWindowFunction LogiSteeringInitializeWithWindow;
+    void LoadAPI();
+#endif
 };
 #endif // MAINWINDOW_H

+ 16 - 1
src/ui/ADCIntelligentShow_grpc/ADCIntelligentShow_grpc.pro

@@ -39,12 +39,15 @@ SOURCES += \
     ../../include/msgtype/radarobject.pb.cc \
     ../../include/msgtype/radarobjectarray.pb.cc \
     ../../include/msgtype/vehinfo.pb.cc \
+    const.cpp \
     dialogsetting.cpp \
+    fresnl.cpp \
     ivmapview.cpp \
     ivview.cpp \
         main.cpp \
     adcintelligentshow.cpp \
-    myview.cpp
+    myview.cpp \
+    polevl.c
 
 HEADERS += \
         ../../decition/common/common/gps_type.h \
@@ -66,6 +69,7 @@ HEADERS += \
         dialogsetting.h \
         ivmapview.h \
         ivview.h \
+        mconf.h \
         myview.h \
         pos_def.h
 
@@ -99,6 +103,17 @@ win32: DEFINES +=  _WIN32_WINNT=0x0602
     error( "Couldn't find the ivyaml-cpp.pri file!" )
 }
 
+!include(../../common/common/xodr/OpenDrive/OpenDrive.pri ) {
+    error( "Couldn't find the OpenDrive.pri file!" )
+}
+
+!include(../../common/common/xodr/TinyXML/TinyXML.pri ) {
+    error( "Couldn't find the TinyXML.pri file!" )
+}
+
+
+INCLUDEPATH += $$PWD/../../common/common/xodr
+
 INCLUDEPATH += $$PWD/../../decition/common
 INCLUDEPATH += $$PWD/../../decition/common/common
 

+ 17 - 0
src/ui/ADCIntelligentShow_grpc/adcintelligentshow.cpp

@@ -358,6 +358,9 @@ ADCIntelligentShow::ADCIntelligentShow(QWidget *parent) :
 //    ui->park->hide();
     ///////////////////////////////////////////////////////////////////////
 
+    mpivmapview->setMapMode(1);
+    ui->checkBox_HDMap->setChecked(true);
+
 #ifdef ANDROID
 
 
@@ -427,6 +430,7 @@ void ADCIntelligentShow::resizeEvent(QResizeEvent *event)
     ui->pushButton_go->setGeometry(490,30,100,50);
     ui->pushButton_AddStation->setGeometry(600,30,100,50);
     ui->pushButton_DelStation->setGeometry(730,30,100,50);
+    ui->checkBox_HDMap->setGeometry(860,30,100,100);
 #else
 
 //    ui->pushButton_prestation->setGeometry(30,30,150,100);
@@ -441,6 +445,7 @@ void ADCIntelligentShow::resizeEvent(QResizeEvent *event)
     ui->pushButton_go->setGeometry(830,30,150,100);
     ui->pushButton_AddStation->setGeometry(1050,30,150,100);
     ui->pushButton_DelStation->setGeometry(1230,30,150,100);
+    ui->checkBox_HDMap->setGeometry(1380,30,100,100);
 #endif
 
 }
@@ -1490,3 +1495,15 @@ void ADCIntelligentShow::UpdateFusion(iv::fusion::fusionobjectarray &xfusion)
     mpivmapview->setfusion(xfusion);
     mnTimeLidar = QDateTime::currentMSecsSinceEpoch();
 }
+
+void ADCIntelligentShow::on_checkBox_HDMap_clicked()
+{
+    if(ui->checkBox_HDMap->isChecked())
+    {
+        mpivmapview->setMapMode(1);
+    }
+    else
+    {
+        mpivmapview->setMapMode(0);
+    }
+}

+ 2 - 0
src/ui/ADCIntelligentShow_grpc/adcintelligentshow.h

@@ -222,6 +222,8 @@ private slots:
 
     void onOTAVehInfoUpdate();
 
+    void on_checkBox_HDMap_clicked();
+
 public slots:
     void slotAlarm();
 

+ 15 - 2
src/ui/ADCIntelligentShow_grpc/adcintelligentshow.ui

@@ -593,8 +593,8 @@ font: 30px &quot;Ubuntu&quot;;</string>
     <widget class="QPushButton" name="pushButton_AddStation">
      <property name="geometry">
       <rect>
-       <x>708</x>
-       <y>120</y>
+       <x>670</x>
+       <y>170</y>
        <width>101</width>
        <height>41</height>
       </rect>
@@ -626,6 +626,19 @@ font: 30px &quot;Ubuntu&quot;;</string>
       <string>减站</string>
      </property>
     </widget>
+    <widget class="QCheckBox" name="checkBox_HDMap">
+     <property name="geometry">
+      <rect>
+       <x>710</x>
+       <y>110</y>
+       <width>71</width>
+       <height>51</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>HD</string>
+     </property>
+    </widget>
    </widget>
    <widget class="QPushButton" name="park">
     <property name="geometry">

+ 255 - 0
src/ui/ADCIntelligentShow_grpc/const.cpp

@@ -0,0 +1,255 @@
+/*							const.c
+ *
+ *	Globally declared constants
+ *
+ *
+ *
+ * SYNOPSIS:
+ *
+ * extern double nameofconstant;
+ *
+ *
+ *
+ *
+ * DESCRIPTION:
+ *
+ * This file contains a number of mathematical constants and
+ * also some needed size parameters of the computer arithmetic.
+ * The values are supplied as arrays of hexadecimal integers
+ * for IEEE arithmetic; arrays of octal constants for DEC
+ * arithmetic; and in a normal decimal scientific notation for
+ * other machines.  The particular notation used is determined
+ * by a symbol (DEC, IBMPC, or UNK) defined in the include file
+ * mconf.h.
+ *
+ * The default size parameters are as follows.
+ *
+ * For DEC and UNK modes:
+ * MACHEP =  1.38777878078144567553E-17       2**-56
+ * MAXLOG =  8.8029691931113054295988E1       log(2**127)
+ * MINLOG = -8.872283911167299960540E1        log(2**-128)
+ * MAXNUM =  1.701411834604692317316873e38    2**127
+ *
+ * For IEEE arithmetic (IBMPC):
+ * MACHEP =  1.11022302462515654042E-16       2**-53
+ * MAXLOG =  7.09782712893383996843E2         log(2**1024)
+ * MINLOG = -7.08396418532264106224E2         log(2**-1022)
+ * MAXNUM =  1.7976931348623158E308           2**1024
+ *
+ * The global symbols for mathematical constants are
+ * PI     =  3.14159265358979323846           pi
+ * PIO2   =  1.57079632679489661923           pi/2
+ * PIO4   =  7.85398163397448309616E-1        pi/4
+ * SQRT2  =  1.41421356237309504880           sqrt(2)
+ * SQRTH  =  7.07106781186547524401E-1        sqrt(2)/2
+ * LOG2E  =  1.4426950408889634073599         1/log(2)
+ * SQ2OPI =  7.9788456080286535587989E-1      sqrt( 2/pi )
+ * LOGE2  =  6.93147180559945309417E-1        log(2)
+ * LOGSQ2 =  3.46573590279972654709E-1        log(2)/2
+ * THPIO4 =  2.35619449019234492885           3*pi/4
+ * TWOOPI =  6.36619772367581343075535E-1     2/pi
+ *
+ * These lists are subject to change.
+ */
+
+/*							const.c */
+
+/*
+Cephes Math Library Release 2.3:  March, 1995
+Copyright 1984, 1995 by Stephen L. Moshier
+*/
+
+#include "mconf.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+#ifdef UNK
+#if 1
+double MACHEP =  1.11022302462515654042E-16;   /* 2**-53 */
+#else
+double MACHEP =  1.38777878078144567553E-17;   /* 2**-56 */
+#endif
+double UFLOWTHRESH =  2.22507385850720138309E-308; /* 2**-1022 */
+#ifdef DENORMAL
+double MAXLOG =  7.09782712893383996732E2;     /* log(MAXNUM) */
+/* double MINLOG = -7.44440071921381262314E2; */     /* log(2**-1074) */
+double MINLOG = -7.451332191019412076235E2;     /* log(2**-1075) */
+#else
+double MAXLOG =  7.08396418532264106224E2;     /* log 2**1022 */
+double MINLOG = -7.08396418532264106224E2;     /* log 2**-1022 */
+#endif
+double MAXNUM =  1.79769313486231570815E308;    /* 2**1024*(1-MACHEP) */
+double PI     =  3.14159265358979323846;       /* pi */
+double PIO2   =  1.57079632679489661923;       /* pi/2 */
+double PIO4   =  7.85398163397448309616E-1;    /* pi/4 */
+double SQRT2  =  1.41421356237309504880;       /* sqrt(2) */
+double SQRTH  =  7.07106781186547524401E-1;    /* sqrt(2)/2 */
+double LOG2E  =  1.4426950408889634073599;     /* 1/log(2) */
+double SQ2OPI =  7.9788456080286535587989E-1;  /* sqrt( 2/pi ) */
+double LOGE2  =  6.93147180559945309417E-1;    /* log(2) */
+double LOGSQ2 =  3.46573590279972654709E-1;    /* log(2)/2 */
+double THPIO4 =  2.35619449019234492885;       /* 3*pi/4 */
+double TWOOPI =  6.36619772367581343075535E-1; /* 2/pi */
+#ifdef INFINITIES
+//double INFINITY = 1.0/0.0;  /* 99e999; */
+double INFINITY = atof("infinity");  /* 99e999; */
+#else
+double INFINITY =  1.79769313486231570815E308;    /* 2**1024*(1-MACHEP) */
+#endif
+#ifdef NANS
+double NAN =atof("infinity") - atof("infinity");
+#else
+double NAN = 0.0;
+#endif
+#ifdef MINUSZERO
+double NEGZERO = -0.0;
+#else
+double NEGZERO = 0.0;
+#endif
+#endif
+
+#ifdef IBMPC
+			/* 2**-53 =  1.11022302462515654042E-16 */
+unsigned short MACHEP[4] = {0x0000,0x0000,0x0000,0x3ca0};
+unsigned short UFLOWTHRESH[4] = {0x0000,0x0000,0x0000,0x0010};
+#ifdef DENORMAL
+			/* log(MAXNUM) =  7.09782712893383996732224E2 */
+unsigned short MAXLOG[4] = {0x39ef,0xfefa,0x2e42,0x4086};
+			/* log(2**-1074) = - -7.44440071921381262314E2 */
+/*unsigned short MINLOG[4] = {0x71c3,0x446d,0x4385,0xc087};*/
+unsigned short MINLOG[4] = {0x3052,0xd52d,0x4910,0xc087};
+#else
+			/* log(2**1022) =   7.08396418532264106224E2 */
+unsigned short MAXLOG[4] = {0xbcd2,0xdd7a,0x232b,0x4086};
+			/* log(2**-1022) = - 7.08396418532264106224E2 */
+unsigned short MINLOG[4] = {0xbcd2,0xdd7a,0x232b,0xc086};
+#endif
+			/* 2**1024*(1-MACHEP) =  1.7976931348623158E308 */
+unsigned short MAXNUM[4] = {0xffff,0xffff,0xffff,0x7fef};
+unsigned short PI[4]     = {0x2d18,0x5444,0x21fb,0x4009};
+unsigned short PIO2[4]   = {0x2d18,0x5444,0x21fb,0x3ff9};
+unsigned short PIO4[4]   = {0x2d18,0x5444,0x21fb,0x3fe9};
+unsigned short SQRT2[4]  = {0x3bcd,0x667f,0xa09e,0x3ff6};
+unsigned short SQRTH[4]  = {0x3bcd,0x667f,0xa09e,0x3fe6};
+unsigned short LOG2E[4]  = {0x82fe,0x652b,0x1547,0x3ff7};
+unsigned short SQ2OPI[4] = {0x3651,0x33d4,0x8845,0x3fe9};
+unsigned short LOGE2[4]  = {0x39ef,0xfefa,0x2e42,0x3fe6};
+unsigned short LOGSQ2[4] = {0x39ef,0xfefa,0x2e42,0x3fd6};
+unsigned short THPIO4[4] = {0x21d2,0x7f33,0xd97c,0x4002};
+unsigned short TWOOPI[4] = {0xc883,0x6dc9,0x5f30,0x3fe4};
+#ifdef INFINITIES
+unsigned short INFINITY[4] = {0x0000,0x0000,0x0000,0x7ff0};
+#else
+unsigned short INFINITY[4] = {0xffff,0xffff,0xffff,0x7fef};
+#endif
+#ifdef NANS
+unsigned short NAN[4] = {0x0000,0x0000,0x0000,0x7ffc};
+#else
+unsigned short NAN[4] = {0x0000,0x0000,0x0000,0x0000};
+#endif
+#ifdef MINUSZERO
+unsigned short NEGZERO[4] = {0x0000,0x0000,0x0000,0x8000};
+#else
+unsigned short NEGZERO[4] = {0x0000,0x0000,0x0000,0x0000};
+#endif
+#endif
+
+#ifdef MIEEE
+			/* 2**-53 =  1.11022302462515654042E-16 */
+unsigned short MACHEP[4] = {0x3ca0,0x0000,0x0000,0x0000};
+unsigned short UFLOWTHRESH[4] = {0x0010,0x0000,0x0000,0x0000};
+#ifdef DENORMAL
+			/* log(2**1024) =   7.09782712893383996843E2 */
+unsigned short MAXLOG[4] = {0x4086,0x2e42,0xfefa,0x39ef};
+			/* log(2**-1074) = - -7.44440071921381262314E2 */
+/* unsigned short MINLOG[4] = {0xc087,0x4385,0x446d,0x71c3}; */
+unsigned short MINLOG[4] = {0xc087,0x4910,0xd52d,0x3052};
+#else
+			/* log(2**1022) =  7.08396418532264106224E2 */
+unsigned short MAXLOG[4] = {0x4086,0x232b,0xdd7a,0xbcd2};
+			/* log(2**-1022) = - 7.08396418532264106224E2 */
+unsigned short MINLOG[4] = {0xc086,0x232b,0xdd7a,0xbcd2};
+#endif
+			/* 2**1024*(1-MACHEP) =  1.7976931348623158E308 */
+unsigned short MAXNUM[4] = {0x7fef,0xffff,0xffff,0xffff};
+unsigned short PI[4]     = {0x4009,0x21fb,0x5444,0x2d18};
+unsigned short PIO2[4]   = {0x3ff9,0x21fb,0x5444,0x2d18};
+unsigned short PIO4[4]   = {0x3fe9,0x21fb,0x5444,0x2d18};
+unsigned short SQRT2[4]  = {0x3ff6,0xa09e,0x667f,0x3bcd};
+unsigned short SQRTH[4]  = {0x3fe6,0xa09e,0x667f,0x3bcd};
+unsigned short LOG2E[4]  = {0x3ff7,0x1547,0x652b,0x82fe};
+unsigned short SQ2OPI[4] = {0x3fe9,0x8845,0x33d4,0x3651};
+unsigned short LOGE2[4]  = {0x3fe6,0x2e42,0xfefa,0x39ef};
+unsigned short LOGSQ2[4] = {0x3fd6,0x2e42,0xfefa,0x39ef};
+unsigned short THPIO4[4] = {0x4002,0xd97c,0x7f33,0x21d2};
+unsigned short TWOOPI[4] = {0x3fe4,0x5f30,0x6dc9,0xc883};
+#ifdef INFINITIES
+unsigned short INFINITY[4] = {0x7ff0,0x0000,0x0000,0x0000};
+#else
+unsigned short INFINITY[4] = {0x7fef,0xffff,0xffff,0xffff};
+#endif
+#ifdef NANS
+unsigned short NAN[4] = {0x7ff8,0x0000,0x0000,0x0000};
+#else
+unsigned short NAN[4] = {0x0000,0x0000,0x0000,0x0000};
+#endif
+#ifdef MINUSZERO
+unsigned short NEGZERO[4] = {0x8000,0x0000,0x0000,0x0000};
+#else
+unsigned short NEGZERO[4] = {0x0000,0x0000,0x0000,0x0000};
+#endif
+#endif
+
+#ifdef DEC
+			/* 2**-56 =  1.38777878078144567553E-17 */
+unsigned short MACHEP[4] = {0022200,0000000,0000000,0000000};
+unsigned short UFLOWTHRESH[4] = {0x0080,0x0000,0x0000,0x0000};
+			/* log 2**127 = 88.029691931113054295988 */
+unsigned short MAXLOG[4] = {041660,007463,0143742,025733,};
+			/* log 2**-128 = -88.72283911167299960540 */
+unsigned short MINLOG[4] = {0141661,071027,0173721,0147572,};
+			/* 2**127 = 1.701411834604692317316873e38 */
+unsigned short MAXNUM[4] = {077777,0177777,0177777,0177777,};
+unsigned short PI[4]     = {040511,007732,0121041,064302,};
+unsigned short PIO2[4]   = {040311,007732,0121041,064302,};
+unsigned short PIO4[4]   = {040111,007732,0121041,064302,};
+unsigned short SQRT2[4]  = {040265,002363,031771,0157145,};
+unsigned short SQRTH[4]  = {040065,002363,031771,0157144,};
+unsigned short LOG2E[4]  = {040270,0125073,024534,013761,};
+unsigned short SQ2OPI[4] = {040114,041051,0117241,0131204,};
+unsigned short LOGE2[4]  = {040061,071027,0173721,0147572,};
+unsigned short LOGSQ2[4] = {037661,071027,0173721,0147572,};
+unsigned short THPIO4[4] = {040426,0145743,0174631,007222,};
+unsigned short TWOOPI[4] = {040042,0174603,067116,042025,};
+/* Approximate infinity by MAXNUM.  */
+unsigned short INFINITY[4] = {077777,0177777,0177777,0177777,};
+unsigned short NAN[4] = {0000000,0000000,0000000,0000000};
+#ifdef MINUSZERO
+unsigned short NEGZERO[4] = {0000000,0000000,0000000,0100000};
+#else
+unsigned short NEGZERO[4] = {0000000,0000000,0000000,0000000};
+#endif
+#endif
+
+#ifndef UNK
+extern unsigned short MACHEP[];
+extern unsigned short UFLOWTHRESH[];
+extern unsigned short MAXLOG[];
+extern unsigned short UNDLOG[];
+extern unsigned short MINLOG[];
+extern unsigned short MAXNUM[];
+extern unsigned short PI[];
+extern unsigned short PIO2[];
+extern unsigned short PIO4[];
+extern unsigned short SQRT2[];
+extern unsigned short SQRTH[];
+extern unsigned short LOG2E[];
+extern unsigned short SQ2OPI[];
+extern unsigned short LOGE2[];
+extern unsigned short LOGSQ2[];
+extern unsigned short THPIO4[];
+extern unsigned short TWOOPI[];
+extern unsigned short INFINITY[];
+extern unsigned short NAN[];
+extern unsigned short NEGZERO[];
+#endif

+ 518 - 0
src/ui/ADCIntelligentShow_grpc/fresnl.cpp

@@ -0,0 +1,518 @@
+/*							fresnl.c
+ *
+ *	Fresnel integral
+ *
+ *
+ *
+ * SYNOPSIS:
+ *
+ * double x, S, C;
+ * void fresnl();
+ *
+ * fresnl( x, _&S, _&C );
+ *
+ *
+ * DESCRIPTION:
+ *
+ * Evaluates the Fresnel integrals
+ *
+ *           x
+ *           -
+ *          | |
+ * C(x) =   |   cos(pi/2 t**2) dt,
+ *        | |
+ *         -
+ *          0
+ *
+ *           x
+ *           -
+ *          | |
+ * S(x) =   |   sin(pi/2 t**2) dt.
+ *        | |
+ *         -
+ *          0
+ *
+ *
+ * The integrals are evaluated by a power series for x < 1.
+ * For x >= 1 auxiliary functions f(x) and g(x) are employed
+ * such that
+ *
+ * C(x) = 0.5 + f(x) sin( pi/2 x**2 ) - g(x) cos( pi/2 x**2 )
+ * S(x) = 0.5 - f(x) cos( pi/2 x**2 ) - g(x) sin( pi/2 x**2 )
+ *
+ *
+ *
+ * ACCURACY:
+ *
+ *  Relative error.
+ *
+ * Arithmetic  function   domain     # trials      peak         rms
+ *   IEEE       S(x)      0, 10       10000       2.0e-15     3.2e-16
+ *   IEEE       C(x)      0, 10       10000       1.8e-15     3.3e-16
+ *   DEC        S(x)      0, 10        6000       2.2e-16     3.9e-17
+ *   DEC        C(x)      0, 10        5000       2.3e-16     3.9e-17
+ */
+
+/*
+Cephes Math Library Release 2.8:  June, 2000
+Copyright 1984, 1987, 1989, 2000 by Stephen L. Moshier
+*/
+
+#include "mconf.h"
+
+
+/* S(x) for small x */
+#ifdef UNK
+static double sn[6] = {
+-2.99181919401019853726E3,
+ 7.08840045257738576863E5,
+-6.29741486205862506537E7,
+ 2.54890880573376359104E9,
+-4.42979518059697779103E10,
+ 3.18016297876567817986E11,
+};
+static double sd[6] = {
+/* 1.00000000000000000000E0,*/
+ 2.81376268889994315696E2,
+ 4.55847810806532581675E4,
+ 5.17343888770096400730E6,
+ 4.19320245898111231129E8,
+ 2.24411795645340920940E10,
+ 6.07366389490084639049E11,
+};
+#endif
+#ifdef DEC
+static unsigned short sn[24] = {
+0143072,0176433,0065455,0127034,
+0045055,0007200,0134540,0026661,
+0146560,0035061,0023667,0127545,
+0050027,0166503,0002673,0153756,
+0151045,0002721,0121737,0102066,
+0051624,0013177,0033451,0021271,
+};
+static unsigned short sd[24] = {
+/*0040200,0000000,0000000,0000000,*/
+0042214,0130051,0112070,0101617,
+0044062,0010307,0172346,0152510,
+0045635,0160575,0143200,0136642,
+0047307,0171215,0127457,0052361,
+0050647,0031447,0032621,0013510,
+0052015,0064733,0117362,0012653,
+};
+#endif
+#ifdef IBMPC
+static unsigned short sn[24] = {
+0xb5c3,0x6d65,0x5fa3,0xc0a7,
+0x05b6,0x172c,0xa1d0,0x4125,
+0xf5ed,0x24f6,0x0746,0xc18e,
+0x7afe,0x60b7,0xfda8,0x41e2,
+0xf087,0x347b,0xa0ba,0xc224,
+0x2457,0xe6e5,0x82cf,0x4252,
+};
+static unsigned short sd[24] = {
+/*0x0000,0x0000,0x0000,0x3ff0,*/
+0x1072,0x3287,0x9605,0x4071,
+0xdaa9,0xfe9c,0x4218,0x40e6,
+0x17b4,0xb8d0,0xbc2f,0x4153,
+0xea9e,0xb5e5,0xfe51,0x41b8,
+0x22e9,0xe6b2,0xe664,0x4214,
+0x42b5,0x73de,0xad3b,0x4261,
+};
+#endif
+#ifdef MIEEE
+static unsigned short sn[24] = {
+0xc0a7,0x5fa3,0x6d65,0xb5c3,
+0x4125,0xa1d0,0x172c,0x05b6,
+0xc18e,0x0746,0x24f6,0xf5ed,
+0x41e2,0xfda8,0x60b7,0x7afe,
+0xc224,0xa0ba,0x347b,0xf087,
+0x4252,0x82cf,0xe6e5,0x2457,
+};
+static unsigned short sd[24] = {
+/*0x3ff0,0x0000,0x0000,0x0000,*/
+0x4071,0x9605,0x3287,0x1072,
+0x40e6,0x4218,0xfe9c,0xdaa9,
+0x4153,0xbc2f,0xb8d0,0x17b4,
+0x41b8,0xfe51,0xb5e5,0xea9e,
+0x4214,0xe664,0xe6b2,0x22e9,
+0x4261,0xad3b,0x73de,0x42b5,
+};
+#endif
+
+/* C(x) for small x */
+#ifdef UNK
+static double cn[6] = {
+-4.98843114573573548651E-8,
+ 9.50428062829859605134E-6,
+-6.45191435683965050962E-4,
+ 1.88843319396703850064E-2,
+-2.05525900955013891793E-1,
+ 9.99999999999999998822E-1,
+};
+static double cd[7] = {
+ 3.99982968972495980367E-12,
+ 9.15439215774657478799E-10,
+ 1.25001862479598821474E-7,
+ 1.22262789024179030997E-5,
+ 8.68029542941784300606E-4,
+ 4.12142090722199792936E-2,
+ 1.00000000000000000118E0,
+};
+#endif
+#ifdef DEC
+static unsigned short cn[24] = {
+0132126,0040141,0063733,0013231,
+0034037,0072223,0010200,0075637,
+0135451,0021020,0073264,0036057,
+0036632,0131520,0101316,0060233,
+0137522,0072541,0136124,0132202,
+0040200,0000000,0000000,0000000,
+};
+static unsigned short cd[28] = {
+0026614,0135503,0051776,0032631,
+0030573,0121116,0154033,0126712,
+0032406,0034100,0012442,0106212,
+0034115,0017567,0150520,0164623,
+0035543,0106171,0177336,0146351,
+0037050,0150073,0000607,0171635,
+0040200,0000000,0000000,0000000,
+};
+#endif
+#ifdef IBMPC
+static unsigned short cn[24] = {
+0x62d3,0x2cfb,0xc80c,0xbe6a,
+0x0f74,0x6210,0xee92,0x3ee3,
+0x8786,0x0ed6,0x2442,0xbf45,
+0xcc13,0x1059,0x566a,0x3f93,
+0x9690,0x378a,0x4eac,0xbfca,
+0x0000,0x0000,0x0000,0x3ff0,
+};
+static unsigned short cd[28] = {
+0xc6b3,0x6a7f,0x9768,0x3d91,
+0x75b9,0xdb03,0x7449,0x3e0f,
+0x5191,0x02a4,0xc708,0x3e80,
+0x1d32,0xfa2a,0xa3ee,0x3ee9,
+0xd99d,0x3fdb,0x718f,0x3f4c,
+0xfe74,0x6030,0x1a07,0x3fa5,
+0x0000,0x0000,0x0000,0x3ff0,
+};
+#endif
+#ifdef MIEEE
+static unsigned short cn[24] = {
+0xbe6a,0xc80c,0x2cfb,0x62d3,
+0x3ee3,0xee92,0x6210,0x0f74,
+0xbf45,0x2442,0x0ed6,0x8786,
+0x3f93,0x566a,0x1059,0xcc13,
+0xbfca,0x4eac,0x378a,0x9690,
+0x3ff0,0x0000,0x0000,0x0000,
+};
+static unsigned short cd[28] = {
+0x3d91,0x9768,0x6a7f,0xc6b3,
+0x3e0f,0x7449,0xdb03,0x75b9,
+0x3e80,0xc708,0x02a4,0x5191,
+0x3ee9,0xa3ee,0xfa2a,0x1d32,
+0x3f4c,0x718f,0x3fdb,0xd99d,
+0x3fa5,0x1a07,0x6030,0xfe74,
+0x3ff0,0x0000,0x0000,0x0000,
+};
+#endif
+
+/* Auxiliary function f(x) */
+#ifdef UNK
+static double fn[10] = {
+  4.21543555043677546506E-1,
+  1.43407919780758885261E-1,
+  1.15220955073585758835E-2,
+  3.45017939782574027900E-4,
+  4.63613749287867322088E-6,
+  3.05568983790257605827E-8,
+  1.02304514164907233465E-10,
+  1.72010743268161828879E-13,
+  1.34283276233062758925E-16,
+  3.76329711269987889006E-20,
+};
+static double fd[10] = {
+/*  1.00000000000000000000E0,*/
+  7.51586398353378947175E-1,
+  1.16888925859191382142E-1,
+  6.44051526508858611005E-3,
+  1.55934409164153020873E-4,
+  1.84627567348930545870E-6,
+  1.12699224763999035261E-8,
+  3.60140029589371370404E-11,
+  5.88754533621578410010E-14,
+  4.52001434074129701496E-17,
+  1.25443237090011264384E-20,
+};
+#endif
+#ifdef DEC
+static unsigned short fn[40] = {
+0037727,0152216,0106601,0016214,
+0037422,0154606,0112710,0071355,
+0036474,0143453,0154253,0166545,
+0035264,0161606,0022250,0073743,
+0033633,0110036,0024653,0136246,
+0032003,0036652,0041164,0036413,
+0027740,0174122,0046305,0036726,
+0025501,0125270,0121317,0167667,
+0023032,0150555,0076175,0047443,
+0020061,0133570,0070130,0027657,
+};
+static unsigned short fd[40] = {
+/*0040200,0000000,0000000,0000000,*/
+0040100,0063767,0054413,0151452,
+0037357,0061566,0007243,0065754,
+0036323,0005365,0033552,0133625,
+0035043,0101123,0000275,0165402,
+0033367,0146614,0110623,0023647,
+0031501,0116644,0125222,0144263,
+0027436,0062051,0117235,0001411,
+0025204,0111543,0056370,0036201,
+0022520,0071351,0015227,0122144,
+0017554,0172240,0112713,0005006,
+};
+#endif
+#ifdef IBMPC
+static unsigned short fn[40] = {
+0x2391,0xd1b0,0xfa91,0x3fda,
+0x0e5e,0xd2b9,0x5b30,0x3fc2,
+0x7dad,0x7b15,0x98e5,0x3f87,
+0x0efc,0xc495,0x9c70,0x3f36,
+0x7795,0xc535,0x7203,0x3ed3,
+0x87a1,0x484e,0x67b5,0x3e60,
+0xa7bb,0x4998,0x1f0a,0x3ddc,
+0xfdf7,0x1459,0x3557,0x3d48,
+0xa9e4,0xaf8f,0x5a2d,0x3ca3,
+0x05f6,0x0e0b,0x36ef,0x3be6,
+};
+static unsigned short fd[40] = {
+/*0x0000,0x0000,0x0000,0x3ff0,*/
+0x7a65,0xeb21,0x0cfe,0x3fe8,
+0x6d7d,0xc1d4,0xec6e,0x3fbd,
+0x56f3,0xa6ed,0x615e,0x3f7a,
+0xbd60,0x6017,0x704a,0x3f24,
+0x64f5,0x9232,0xf9b1,0x3ebe,
+0x5916,0x9552,0x33b4,0x3e48,
+0xa061,0x33d3,0xcc85,0x3dc3,
+0x0790,0x6b9f,0x926c,0x3d30,
+0xf48d,0x2352,0x0e5d,0x3c8a,
+0x6141,0x12b9,0x9e94,0x3bcd,
+};
+#endif
+#ifdef MIEEE
+static unsigned short fn[40] = {
+0x3fda,0xfa91,0xd1b0,0x2391,
+0x3fc2,0x5b30,0xd2b9,0x0e5e,
+0x3f87,0x98e5,0x7b15,0x7dad,
+0x3f36,0x9c70,0xc495,0x0efc,
+0x3ed3,0x7203,0xc535,0x7795,
+0x3e60,0x67b5,0x484e,0x87a1,
+0x3ddc,0x1f0a,0x4998,0xa7bb,
+0x3d48,0x3557,0x1459,0xfdf7,
+0x3ca3,0x5a2d,0xaf8f,0xa9e4,
+0x3be6,0x36ef,0x0e0b,0x05f6,
+};
+static unsigned short fd[40] = {
+/*0x3ff0,0x0000,0x0000,0x0000,*/
+0x3fe8,0x0cfe,0xeb21,0x7a65,
+0x3fbd,0xec6e,0xc1d4,0x6d7d,
+0x3f7a,0x615e,0xa6ed,0x56f3,
+0x3f24,0x704a,0x6017,0xbd60,
+0x3ebe,0xf9b1,0x9232,0x64f5,
+0x3e48,0x33b4,0x9552,0x5916,
+0x3dc3,0xcc85,0x33d3,0xa061,
+0x3d30,0x926c,0x6b9f,0x0790,
+0x3c8a,0x0e5d,0x2352,0xf48d,
+0x3bcd,0x9e94,0x12b9,0x6141,
+};
+#endif
+
+
+/* Auxiliary function g(x) */
+#ifdef UNK
+static double gn[11] = {
+  5.04442073643383265887E-1,
+  1.97102833525523411709E-1,
+  1.87648584092575249293E-2,
+  6.84079380915393090172E-4,
+  1.15138826111884280931E-5,
+  9.82852443688422223854E-8,
+  4.45344415861750144738E-10,
+  1.08268041139020870318E-12,
+  1.37555460633261799868E-15,
+  8.36354435630677421531E-19,
+  1.86958710162783235106E-22,
+};
+static double gd[11] = {
+/*  1.00000000000000000000E0,*/
+  1.47495759925128324529E0,
+  3.37748989120019970451E-1,
+  2.53603741420338795122E-2,
+  8.14679107184306179049E-4,
+  1.27545075667729118702E-5,
+  1.04314589657571990585E-7,
+  4.60680728146520428211E-10,
+  1.10273215066240270757E-12,
+  1.38796531259578871258E-15,
+  8.39158816283118707363E-19,
+  1.86958710162783236342E-22,
+};
+#endif
+#ifdef DEC
+static unsigned short gn[44] = {
+0040001,0021435,0120406,0053123,
+0037511,0152523,0037703,0122011,
+0036631,0134302,0122721,0110235,
+0035463,0051712,0043215,0114732,
+0034101,0025677,0147725,0057630,
+0032323,0010342,0067523,0002206,
+0030364,0152247,0110007,0054107,
+0026230,0057654,0035464,0047124,
+0023706,0036401,0167705,0045440,
+0021166,0154447,0105632,0142461,
+0016142,0002353,0011175,0170530,
+};
+static unsigned short gd[44] = {
+/*0040200,0000000,0000000,0000000,*/
+0040274,0145551,0016742,0127005,
+0037654,0166557,0076416,0015165,
+0036717,0140217,0030675,0050111,
+0035525,0110060,0076405,0070502,
+0034125,0176061,0060120,0031730,
+0032340,0001615,0054343,0120501,
+0030375,0041414,0070747,0107060,
+0026233,0031034,0160757,0074526,
+0023710,0003341,0137100,0144664,
+0021167,0126414,0023774,0015435,
+0016142,0002353,0011175,0170530,
+};
+#endif
+#ifdef IBMPC
+static unsigned short gn[44] = {
+0xcaca,0xb420,0x2463,0x3fe0,
+0x7481,0x67f8,0x3aaa,0x3fc9,
+0x3214,0x54ba,0x3718,0x3f93,
+0xb33b,0x48d1,0x6a79,0x3f46,
+0xabf3,0xf9fa,0x2577,0x3ee8,
+0x6091,0x4dea,0x621c,0x3e7a,
+0xeb09,0xf200,0x9a94,0x3dfe,
+0x89cb,0x8766,0x0bf5,0x3d73,
+0xa964,0x3df8,0xc7a0,0x3cd8,
+0x58a6,0xf173,0xdb24,0x3c2e,
+0xbe2b,0x624f,0x409d,0x3b6c,
+};
+static unsigned short gd[44] = {
+/*0x0000,0x0000,0x0000,0x3ff0,*/
+0x55c1,0x23bc,0x996d,0x3ff7,
+0xc34f,0xefa1,0x9dad,0x3fd5,
+0xaa09,0xe637,0xf811,0x3f99,
+0xae28,0x0fa0,0xb206,0x3f4a,
+0x067b,0x2c0a,0xbf86,0x3eea,
+0x7428,0xab1c,0x0071,0x3e7c,
+0xf1c6,0x8e3c,0xa861,0x3dff,
+0xef2b,0x9c3d,0x6643,0x3d73,
+0x1936,0x37c8,0x00dc,0x3cd9,
+0x8364,0x84ff,0xf5a1,0x3c2e,
+0xbe2b,0x624f,0x409d,0x3b6c,
+};
+#endif
+#ifdef MIEEE
+static unsigned short gn[44] = {
+0x3fe0,0x2463,0xb420,0xcaca,
+0x3fc9,0x3aaa,0x67f8,0x7481,
+0x3f93,0x3718,0x54ba,0x3214,
+0x3f46,0x6a79,0x48d1,0xb33b,
+0x3ee8,0x2577,0xf9fa,0xabf3,
+0x3e7a,0x621c,0x4dea,0x6091,
+0x3dfe,0x9a94,0xf200,0xeb09,
+0x3d73,0x0bf5,0x8766,0x89cb,
+0x3cd8,0xc7a0,0x3df8,0xa964,
+0x3c2e,0xdb24,0xf173,0x58a6,
+0x3b6c,0x409d,0x624f,0xbe2b,
+};
+static unsigned short gd[44] = {
+/*0x3ff0,0x0000,0x0000,0x0000,*/
+0x3ff7,0x996d,0x23bc,0x55c1,
+0x3fd5,0x9dad,0xefa1,0xc34f,
+0x3f99,0xf811,0xe637,0xaa09,
+0x3f4a,0xb206,0x0fa0,0xae28,
+0x3eea,0xbf86,0x2c0a,0x067b,
+0x3e7c,0x0071,0xab1c,0x7428,
+0x3dff,0xa861,0x8e3c,0xf1c6,
+0x3d73,0x6643,0x9c3d,0xef2b,
+0x3cd9,0x00dc,0x37c8,0x1936,
+0x3c2e,0xf5a1,0x84ff,0x8364,
+0x3b6c,0x409d,0x624f,0xbe2b,
+};
+#endif
+
+#ifdef ANSIPROT
+extern "C" {double fabs ( double );}
+extern "C" {double cos ( double );}
+extern "C" {double sin ( double );}
+extern "C" {double polevl ( double, double *, int );}
+extern "C" {double p1evl ( double, double *, int );}
+#else
+double fabs(), cos(), sin(), polevl(), p1evl();
+#endif
+extern "C" {extern double PI, PIO2, MACHEP;}
+
+//int fresnl( xxa, ssa, cca )
+//double xxa, *ssa, *cca;
+
+int fresnl( double xxa, double *ssa, double *cca )
+{
+double f, g, cc, ss, c, s, t, u;
+double x, x2;
+
+x = fabs(xxa);
+x2 = x * x;
+if( x2 < 2.5625 )
+	{
+	t = x2 * x2;
+	ss = x * x2 * polevl( t, sn, 5)/p1evl( t, sd, 6 );
+	cc = x * polevl( t, cn, 5)/polevl(t, cd, 6 );
+	goto done;
+	}
+
+
+
+
+
+
+if( x > 36974.0 )
+	{
+	cc = 0.5;
+	ss = 0.5;
+	goto done;
+	}
+
+
+/*		Asymptotic power series auxiliary functions
+ *		for large argument
+ */
+	x2 = x * x;
+	t = PI * x2;
+	u = 1.0/(t * t);
+	t = 1.0/t;
+	f = 1.0 - u * polevl( u, fn, 9)/p1evl(u, fd, 10);
+	g = t * polevl( u, gn, 10)/p1evl(u, gd, 11);
+
+	t = PIO2 * x2;
+	c = cos(t);
+	s = sin(t);
+	t = PI * x;
+	cc = 0.5  +  (f * s  -  g * c)/t;
+	ss = 0.5  -  (f * c  +  g * s)/t;
+
+done:
+if( xxa < 0.0 )
+	{
+	cc = -cc;
+	ss = -ss;
+	}
+
+*cca = cc;
+*ssa = ss;
+return(0);
+}

+ 10 - 0
src/ui/ADCIntelligentShow_grpc/ivmapview.cpp

@@ -40,6 +40,11 @@ void GaussProjCal(double longitude, double latitude, double *X, double *Y)
 }
 
 
+static bool LoadXODR(std::string strpath,OpenDrive & xxodr)
+{
+    OpenDriveXmlParser xp(&xxodr);
+    xp.ReadFile(strpath);
+}
 
 ivmapview::ivmapview()
 {
@@ -436,4 +441,9 @@ void ivmapview::setfusion(iv::fusion::fusionobjectarray &xfusion)
     mnTimeFusion = QDateTime::currentMSecsSinceEpoch();
 }
 
+void ivmapview::setMapMode(int nMode)
+{
+    mnMapMode = 1;
+}
+
 

+ 8 - 0
src/ui/ADCIntelligentShow_grpc/ivmapview.h

@@ -12,6 +12,11 @@
 
 #include "radarobjectarray.pb.h"
 
+#include "OpenDrive/OpenDrive.h"
+#include "OpenDrive/OpenDriveXmlWriter.h"
+
+#include "OpenDrive/OpenDriveXmlParser.h"
+
 
 class ivmapview : public IVView
 {
@@ -57,6 +62,8 @@ private:
     QMutex mMutexFusion;
     qint64 mnTimeFusion = 0;
 
+    int mnMapMode = 1; // 0 nomal  1 opendrive view
+
 
 public:
     void setgps(iv::gps::gpsimu * pxgpsimu);
@@ -64,6 +71,7 @@ public:
     void setobs(std::shared_ptr<std::vector<iv::ObstacleBasic>> xobs);
     void setradar(iv::radar::radarobjectarray * pradarobj);
     void setfusion(iv::fusion::fusionobjectarray & xfusion);
+    void setMapMode(int nMode);
 };
 
 #endif // IVMAPVIEW_H

+ 199 - 0
src/ui/ADCIntelligentShow_grpc/mconf.h

@@ -0,0 +1,199 @@
+/*							mconf.h
+ *
+ *	Common include file for math routines
+ *
+ *
+ *
+ * SYNOPSIS:
+ *
+ * #include "mconf.h"
+ *
+ *
+ *
+ * DESCRIPTION:
+ *
+ * This file contains definitions for error codes that are
+ * passed to the common error handling routine mtherr()
+ * (which see).
+ *
+ * The file also includes a conditional assembly definition
+ * for the type of computer arithmetic (IEEE, DEC, Motorola
+ * IEEE, or UNKnown).
+ * 
+ * For Digital Equipment PDP-11 and VAX computers, certain
+ * IBM systems, and others that use numbers with a 56-bit
+ * significand, the symbol DEC should be defined.  In this
+ * mode, most floating point constants are given as arrays
+ * of octal integers to eliminate decimal to binary conversion
+ * errors that might be introduced by the compiler.
+ *
+ * For little-endian computers, such as IBM PC, that follow the
+ * IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE
+ * Std 754-1985), the symbol IBMPC should be defined.  These
+ * numbers have 53-bit significands.  In this mode, constants
+ * are provided as arrays of hexadecimal 16 bit integers.
+ *
+ * Big-endian IEEE format is denoted MIEEE.  On some RISC
+ * systems such as Sun SPARC, double precision constants
+ * must be stored on 8-byte address boundaries.  Since integer
+ * arrays may be aligned differently, the MIEEE configuration
+ * may fail on such machines.
+ *
+ * To accommodate other types of computer arithmetic, all
+ * constants are also provided in a normal decimal radix
+ * which one can hope are correctly converted to a suitable
+ * format by the available C language compiler.  To invoke
+ * this mode, define the symbol UNK.
+ *
+ * An important difference among these modes is a predefined
+ * set of machine arithmetic constants for each.  The numbers
+ * MACHEP (the machine roundoff error), MAXNUM (largest number
+ * represented), and several other parameters are preset by
+ * the configuration symbol.  Check the file const.c to
+ * ensure that these values are correct for your computer.
+ *
+ * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL
+ * may fail on many systems.  Verify that they are supposed
+ * to work on your computer.
+ */
+/*
+Cephes Math Library Release 2.3:  June, 1995
+Copyright 1984, 1987, 1989, 1995 by Stephen L. Moshier
+*/
+
+
+/* Define if the `long double' type works.  */
+#define HAVE_LONG_DOUBLE 1
+
+/* Define as the return type of signal handlers (int or void).  */
+#define RETSIGTYPE void
+
+/* Define if you have the ANSI C header files.  */
+#define STDC_HEADERS 1
+
+/* Define if your processor stores words with the most significant
+   byte first (like Motorola and SPARC, unlike Intel and VAX).  */
+/* #undef WORDS_BIGENDIAN */
+
+/* Define if floating point words are bigendian.  */
+/* #undef FLOAT_WORDS_BIGENDIAN */
+
+/* The number of bytes in a int.  */
+#define SIZEOF_INT 4
+
+/* Define if you have the <string.h> header file.  */
+#define HAVE_STRING_H 1
+
+/* Name of package */
+#define PACKAGE "cephes"
+
+/* Version number of package */
+#define VERSION "2.7"
+
+/* Constant definitions for math error conditions
+ */
+
+//#define DOMAIN		1	/* argument domain error */
+//#define SING		2	/* argument singularity */
+//#define OVERFLOW	3	/* overflow range error */
+//#define UNDERFLOW	4	/* underflow range error */
+//#define TLOSS		5	/* total loss of precision */
+//#define PLOSS		6	/* partial loss of precision */
+
+#define EDOM		33
+#define ERANGE		34
+/* Complex numeral.  */
+typedef struct
+	{
+	double r;
+	double i;
+	} cmplx;
+
+#ifdef HAVE_LONG_DOUBLE
+/* Long double complex numeral.  */
+typedef struct
+	{
+	long double r;
+	long double i;
+	} cmplxl;
+#endif
+
+
+/* Type of computer arithmetic */
+
+/* PDP-11, Pro350, VAX:
+ */
+/* #define DEC 1 */
+
+/* Intel IEEE, low order words come first:
+ */
+/* #define IBMPC 1 */
+
+/* Motorola IEEE, high order words come first
+ * (Sun 680x0 workstation):
+ */
+/* #define MIEEE 1 */
+
+/* UNKnown arithmetic, invokes coefficients given in
+ * normal decimal format.  Beware of range boundary
+ * problems (MACHEP, MAXLOG, etc. in const.c) and
+ * roundoff problems in pow.c:
+ * (Sun SPARCstation)
+ */
+#define UNK 1
+
+/* If you define UNK, then be sure to set BIGENDIAN properly. */
+#ifdef FLOAT_WORDS_BIGENDIAN
+#define BIGENDIAN 1
+#else
+#define BIGENDIAN 0
+#endif
+/* Define this `volatile' if your compiler thinks
+ * that floating point arithmetic obeys the associative
+ * and distributive laws.  It will defeat some optimizations
+ * (but probably not enough of them).
+ *
+ * #define VOLATILE volatile
+ */
+#define VOLATILE
+
+/* For 12-byte long doubles on an i386, pad a 16-bit short 0
+ * to the end of real constants initialized by integer arrays.
+ *
+ * #define XPD 0,
+ *
+ * Otherwise, the type is 10 bytes long and XPD should be
+ * defined blank (e.g., Microsoft C).
+ *
+ * #define XPD
+ */
+#define XPD 0,
+
+/* Define to support tiny denormal numbers, else undefine. */
+#define DENORMAL 1
+
+/* Define to ask for infinity support, else undefine. */
+#define INFINITIES 1
+
+/* Define to ask for support of numbers that are Not-a-Number,
+   else undefine.  This may automatically define INFINITIES in some files. */
+#define NANS 1
+
+/* Define to distinguish between -0.0 and +0.0.  */
+#define MINUSZERO 1
+
+/* Define 1 for ANSI C atan2() function
+   See atan.c and clog.c. */
+#define ANSIC 1
+
+/* Get ANSI function prototypes, if you want them. */
+#if 1
+/* #ifdef __STDC__ */
+#define ANSIPROT 1
+int mtherr ( char *, int );
+#else
+int mtherr();
+#endif
+
+/* Variable for error reporting.  See mtherr.c.  */
+extern int merror;

+ 97 - 0
src/ui/ADCIntelligentShow_grpc/polevl.c

@@ -0,0 +1,97 @@
+/*							polevl.c
+ *							p1evl.c
+ *
+ *	Evaluate polynomial
+ *
+ *
+ *
+ * SYNOPSIS:
+ *
+ * int N;
+ * double x, y, coef[N+1], polevl[];
+ *
+ * y = polevl( x, coef, N );
+ *
+ *
+ *
+ * DESCRIPTION:
+ *
+ * Evaluates polynomial of degree N:
+ *
+ *                     2          N
+ * y  =  C  + C x + C x  +...+ C x
+ *        0    1     2          N
+ *
+ * Coefficients are stored in reverse order:
+ *
+ * coef[0] = C  , ..., coef[N] = C  .
+ *            N                   0
+ *
+ *  The function p1evl() assumes that coef[N] = 1.0 and is
+ * omitted from the array.  Its calling arguments are
+ * otherwise the same as polevl().
+ *
+ *
+ * SPEED:
+ *
+ * In the interest of speed, there are no checks for out
+ * of bounds arithmetic.  This routine is used by most of
+ * the functions in the library.  Depending on available
+ * equipment features, the user may wish to rewrite the
+ * program in microcode or assembly language.
+ *
+ */
+
+
+/*
+Cephes Math Library Release 2.1:  December, 1988
+Copyright 1984, 1987, 1988 by Stephen L. Moshier
+Direct inquiries to 30 Frost Street, Cambridge, MA 02140
+*/
+
+
+double polevl( double x,  double *coef, int N )
+//double x;
+//double coef[];
+//int N;
+{
+double ans;
+int i;
+double *p;
+
+p = coef;
+ans = *p++;
+i = N;
+
+do
+	ans = ans * x  +  *p++;
+while( --i );
+
+return( ans );
+}
+
+/*							p1evl()	*/
+/*                                          N
+ * Evaluate polynomial when coefficient of x  is 1.0.
+ * Otherwise same as polevl.
+ */
+
+double p1evl( double x, double *coef, int N )
+//double x;
+//double coef[];
+//int N;
+{
+double ans;
+double *p;
+int i;
+
+p = coef;
+ans = x + *p++;
+i = N-1;
+
+do
+	ans = ans * x  + *p++;
+while( --i );
+
+return( ans );
+}