Browse Source

complete ivservice code.

yuchuli 3 years ago
parent
commit
d69cf3c3ca

+ 9 - 0
autogen_lib.sh

@@ -115,6 +115,15 @@ rm Makefile
 rm .qmake.stash
 cd ../../../
 
+cd src/common/ivservice/
+$qtmake ivservice.pro
+make $MAKEOPT
+make clean
+cp libivservice.so ./../../../bin/
+rm Makefile
+rm .qmake.stash
+cd ../../../
+
 
 cd src/common/makeprotointerface/
 $qtmake makeprotointerface.pro

+ 1 - 1
include/common.pri

@@ -11,7 +11,7 @@ unix:include(systemdef.pri)
 win32: DEFINES += SYSTEM_WIN
 
 INCLUDEPATH += $$PWD/../include/
-LIBS += -L$$PWD/../bin/ -lxmlparam -lmodulecomm  -livlog -livfault -livexit -livbacktrace -livchart
+LIBS += -L$$PWD/../bin/ -lxmlparam -lmodulecomm  -livlog -livfault -livexit -livbacktrace -livchart -livservice
 
 
 #LIBS += -L$$PWD/../bin/ -lmodulecomm_shm -lmodulecomm_fastrtps -lmodulecomm_fastrtps_tcp -lmodulecomm_inter

+ 80 - 0
include/ivservice.h

@@ -0,0 +1,80 @@
+#ifndef IVSERVICE_H
+#define IVSERVICE_H
+
+
+#include <memory>
+
+#include <QtCore/qglobal.h>
+
+#if defined(IVSERVICE_LIBRARY)
+#  define IVSERVICE_EXPORT Q_DECL_EXPORT
+#else
+#  define IVSERVICE_EXPORT Q_DECL_IMPORT
+#endif
+
+
+typedef void (*ServiceProc)(std::shared_ptr<char> pstr_request,const int nreqsize, std::shared_ptr<char> & pstr_response,int & nsize);
+
+
+//nRes 0 超时  1 正确返回
+typedef void (*ServiceAsycnProc)(std::shared_ptr<char> & pstr_response,int & nsize,int nRes);
+
+
+namespace iv {
+
+namespace service {
+class IVSERVICE_EXPORT Server
+{
+public:
+    Server(const char * strservicename,ServiceProc xProc);
+    ~Server();
+
+private:
+    void * mpimpl;
+};
+
+class IVSERVICE_EXPORT Client
+{
+public:
+    Client(const char * strservicename);
+    ~Client();
+
+    enum  ServiceResRes
+    {
+        NO_RES = 1,
+        HAVE_RES = 2
+    };
+
+public:
+    /**
+     * @brief SendRequest 获得服务结果
+     * @param pstr_request  请求的数据
+     * @param pstr_response  返回的结果
+     * @param timeout  超时时间
+     * @return  如果成功,返回  HAVE_RES,如果超时,返回NO_RES
+     */
+    ServiceResRes SendRequest(std::shared_ptr<char> pstr_request,const int nreqsize,std::shared_ptr<char> & pstr_response,
+                              int & nressize,const int timeout = 100);
+
+    /**
+     * @brief AsyncSendRequest 异步请求服务
+     * @param pstr_request  请求数据
+     * @param nreqsize    请求数据大小
+     * @param xProc    回调函数
+     * @param timeout   超时时间,默认30秒
+     * @return 0 Last Async Call Not Complete   1 Prepare Run Async
+     */
+    int AsyncSendRequest(std::shared_ptr<char> pstr_request,const int nreqsize,
+                                   ServiceAsycnProc xProc,const int timeout = 30000);
+
+
+private:
+    void * mpimpl;
+};
+
+}
+}
+
+
+
+#endif // IVSERVICE_H

+ 6 - 0
src/common/ivservice/ivservice.cpp

@@ -37,5 +37,11 @@ Client::ServiceResRes  Client::SendRequest(std::shared_ptr<char> pstr_request,co
     return pclient->SendRequest(pstr_request,nreqsize,pstr_response,nressize,timeout);
 }
 
+int Client::AsyncSendRequest(std::shared_ptr<char> pstr_request, const int nreqsize, ServiceAsycnProc xProc, const int timeout)
+{
+    Client_impl * pclient = (Client_impl *)mpimpl;
+    return pclient->AsyncSendRequest(pstr_request,nreqsize,xProc,timeout);
+}
+
 }
 }

+ 16 - 0
src/common/ivservice/ivservice.h

@@ -16,6 +16,10 @@
 typedef void (*ServiceProc)(std::shared_ptr<char> pstr_request,const int nreqsize, std::shared_ptr<char> & pstr_response,int & nsize);
 
 
+//nRes 0 超时  1 正确返回
+typedef void (*ServiceAsycnProc)(std::shared_ptr<char> & pstr_response,int & nsize,int nRes);
+
+
 namespace iv {
 
 namespace service {
@@ -52,6 +56,18 @@ public:
     ServiceResRes SendRequest(std::shared_ptr<char> pstr_request,const int nreqsize,std::shared_ptr<char> & pstr_response,
                               int & nressize,const int timeout = 100);
 
+    /**
+     * @brief AsyncSendRequest 异步请求服务
+     * @param pstr_request  请求数据
+     * @param nreqsize    请求数据大小
+     * @param xProc    回调函数
+     * @param timeout   超时时间,默认30秒
+     * @return 0 Last Async Call Not Complete   1 Prepare Run Async
+     */
+    int AsyncSendRequest(std::shared_ptr<char> pstr_request,const int nreqsize,
+                                   ServiceAsycnProc xProc,const int timeout = 30000);
+
+
 private:
     void * mpimpl;
 };

+ 2 - 0
src/common/ivservice/ivservice.pro

@@ -5,6 +5,8 @@ DEFINES += IVSERVICE_LIBRARY
 
 CONFIG += c++11
 
+CONFIG += plugin
+
 # 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

+ 72 - 1
src/common/ivservice/ivservice_impl.cpp

@@ -84,19 +84,90 @@ Client::ServiceResRes Client_impl::SendRequest(std::shared_ptr<char> pstr_reques
     return Client::NO_RES;
 }
 
+int Client_impl::AsyncSendRequest(std::shared_ptr<char> pstr_request, const int nreqsize, ServiceAsycnProc xProc, const int timeout)
+{
+    if(mbAsync == true)
+    {
+        std::cout<<" A Async Running. Not Run this Call"<<std::endl;
+        return 0;
+    }
+    mbAsync = true;
+    mpthread_ptr = std::shared_ptr<std::thread>(new std::thread(&Client_impl::ThreadAsync,this,pstr_request,nreqsize,
+                                                                xProc,timeout));
+    return 1;
+}
+
 Client_impl::~Client_impl()
 {
+    mbRunning = false;
+    if(mbAsync)
+    {
+        mpthread_ptr->join();
+    }
     iv::modulecomm::Unregister(mpareq);
     iv::modulecomm::Unregister(mpares);
 }
 
+void Client_impl::ThreadAsync(std::shared_ptr<char> pstr_request, const int nreqsize, ServiceAsycnProc xProc, const int timeout)
+{
+    mbNewRes = false;
+    mreqid = std::chrono::system_clock::now().time_since_epoch().count();
+    std::shared_ptr<char> pstr_send = std::shared_ptr<char>(new char[sizeof(qint64)+nreqsize]);
+    memcpy(pstr_send.get(),&mreqid,sizeof(qint64));
+    memcpy(pstr_send.get()+sizeof(qint64),pstr_request.get(),nreqsize);
+
+//    iv::modulecomm::ModuleSendMsg(mpareq,pstr_request.get(),nreqsize);
+
+    std::shared_ptr<char> pstr_response;
+    int nressize = 0;
+    const int nAwait = 100;
+    int nRemain = timeout;
+    int nWait = nAwait;
+    if(nRemain < nAwait)
+    {
+        nWait = nRemain;
+    }
+
+    while((nRemain> 0)&&(mbRunning))
+    {
+        iv::modulecomm::ModuleSendMsg(mpareq,pstr_send.get(),nreqsize+sizeof(qint64));
+        mWaitMutex.lock();
+        mwc.wait(&mWaitMutex,nWait);
+        mWaitMutex.unlock();
+        if(mbNewRes)
+        {
+            mMutexRes.lock();
+            pstr_response = mpstr_res;
+            nressize = mressize;
+            mbNewRes = false;
+            mMutexRes.unlock();
+            (*xProc)(pstr_response,nressize,1);
+            mbAsync = false;
+            return;
+        }
+        nRemain = nRemain - nWait;
+        if(nRemain < nAwait)
+        {
+            nWait = nRemain;
+        }
+        else
+        {
+            nWait = nAwait;
+        }
+    }
+
+    std::cout<<"Async Service NO Response."<<std::endl;
+    (*xProc)(pstr_response,nressize,0); //No Response.
+    mbAsync = false;
+}
+
 void Client_impl::UpdateRes(const char *strdata, const unsigned int nSize, const unsigned int index, const QDateTime *dt, const char *strmemname)
 {
     (void)index;
     (void )dt;
     (void)strmemname;
     int nqint64size = sizeof(qint64);
-    if(nSize<=nqint64size)return;
+    if(nSize<=(unsigned int)nqint64size)return;
     qint64 * preqid = (qint64 *)strdata;
     if(*preqid != mreqid)
     {

+ 23 - 0
src/common/ivservice/ivservice_impl.h

@@ -7,6 +7,8 @@
 #include <QWaitCondition>
 #include <QDateTime>
 
+#include <thread>
+
 namespace iv {
 
 namespace service {
@@ -44,6 +46,17 @@ public:
      Client::ServiceResRes SendRequest(std::shared_ptr<char> pstr_request,const int nreqsize,std::shared_ptr<char> & pstr_response,
                               int & nressize,const int timeout = 100);
 
+     /**
+      * @brief AsyncSendRequest 异步请求服务
+      * @param pstr_request  请求数据
+      * @param nreqsize    请求数据大小
+      * @param xProc    回调函数
+      * @param timeout   超时时间,默认30秒
+      * @return
+      */
+     int AsyncSendRequest(std::shared_ptr<char> pstr_request,const int nreqsize,
+                                    ServiceAsycnProc xProc,const int timeout = 30000);
+
 
 private:
 
@@ -64,6 +77,16 @@ private:
      void * mpares;
      qint64 mreqid;
 
+     bool mbAsync = false;
+
+     bool mbRunning = true;
+
+     std::shared_ptr<std::thread> mpthread_ptr;
+
+private:
+     void ThreadAsync(std::shared_ptr<char> pstr_request,const int nreqsize,
+                      ServiceAsycnProc xProc,const int timeout);
+
 
 
 };

+ 33 - 5
src/common/ivservice/main.cpp

@@ -14,10 +14,23 @@ void ProcReq(std::shared_ptr<char> pstr_req,const int nreqsize,std::shared_ptr<c
    nressize = 100;
 }
 
+void ProcAsync(std::shared_ptr<char> & pstr_res,int & ndatasize,int nres)
+{
+    if(nres == 0)
+    {
+        std::cout<<"extend time."<<std::endl;
+    }
+
+    if(nres == 1)
+    {
+        std::cout<<"Aysnc Service return."<<std::endl;
+    }
+}
+
 
 void threadclientai(int ai)
 {
-    iv::service::Client xclient("hellob");
+    iv::service::Client xclient("helloa");
 
 //    std::this_thread::sleep_for(std::chrono::milliseconds(3));
 //    std::cout<<"Send Time : "<<QDateTime::currentMSecsSinceEpoch()<<std::endl;
@@ -41,6 +54,7 @@ void threadclientai(int ai)
         {
             std::cout<<ai<<" Fail Get Result."<<std::endl;
         }
+        break;
     }
 }
 void threadclient()
@@ -83,6 +97,9 @@ void threadclient()
 }
 
 
+
+
+
 int main(int argc, char *argv[])
 {
     QCoreApplication a(argc, argv);
@@ -94,11 +111,22 @@ int main(int argc, char *argv[])
     qint64 xtime1 = std::chrono::system_clock::now().time_since_epoch().count();
     qint64 xtime2 = std::chrono::system_clock::now().time_since_epoch().count();
     qint64 xtd = xtime2 - xtime1;
-    iv::service::Server xserver("hellob",ProcReq);
-    std::this_thread::sleep_for(std::chrono::milliseconds(300));
-    std::thread * pthread_a = new std::thread(threadclientai,1);
+//    iv::service::Server xserver("helloa",ProcReq);
 //    std::this_thread::sleep_for(std::chrono::milliseconds(300));
-    std::thread * pthread_b = new std::thread(threadclientai,2);
+//    std::thread * pthread_a = new std::thread(threadclientai,1);
+//    std::thread * pthread_b = new std::thread(threadclientai,2);
+
+
+
+    iv::service::Client xaync("async");
+    std::shared_ptr<char> pstr_async = std::shared_ptr<char>(new char[1000]);
+    xaync.AsyncSendRequest(pstr_async,100,ProcAsync);
+
+    std::this_thread::sleep_for(std::chrono::milliseconds(10000));
+    iv::service::Server xserver("async",ProcReq);
+
+
+
 //    std::thread * pthread = new std::thread(threadclient);
 //    int i;
 //    for(i=0;i<100;i++)

+ 5 - 2
src/common/modulecomm/main.cpp

@@ -90,7 +90,10 @@ iv::modulecommext::modulecommmsg<iv::testmodulecommext> * gmsgtestsend,* gmsgtes
 void ListenProto(google::protobuf::Message & xmsg)
 {
     iv::testmodulecommext * pmsg = (iv::testmodulecommext *)&xmsg;
-    qDebug("time : %lld",pmsg->time());
+    qint64 recvtime = std::chrono::system_clock::now().time_since_epoch().count();
+    qint64 latency = recvtime - pmsg->time();
+    double flatency = ((double)latency)/1000000.0;
+    qDebug(" Latency: %fms  Recv Time: %lld time : %lld",flatency,recvtime, pmsg->time());
 }
 
 void threadsendproto()
@@ -100,7 +103,7 @@ void threadsendproto()
         iv::testmodulecommext xmsg;
         xmsg.set_a(1);
         xmsg.set_b(2);
-        xmsg.set_time(QDateTime::currentMSecsSinceEpoch());
+        xmsg.set_time(std::chrono::system_clock::now().time_since_epoch().count());
         gmsgtestsend->ModuleSendMsg(xmsg);
         std::this_thread::sleep_for(std::chrono::milliseconds(1000));
     }

+ 4 - 0
src/common/modulecomm/testmodulecomm.pro

@@ -23,6 +23,7 @@ DEFINES += QT_DEPRECATED_WARNINGS
 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
 
 SOURCES += \
+        ../../include/msgtype/testmodulecommext.pb.cc \
         main.cpp \
         modulecomm.cpp \
         modulecomm_base.cpp
@@ -59,8 +60,11 @@ LIBS += -L$$PWD -lfastcdr -lfastrtps
 }
 
 HEADERS += \
+    ../../include/msgtype/testmodulecommext.pb.h \
     modulecomm.h \
     modulecomm_base.h
 
+INCLUDEPATH += $$PWD/../../../src/include/msgtype
 
+LIBS += -lprotobuf
 

+ 73 - 0
src/driver/driver_service_vehicleinfo/.gitignore

@@ -0,0 +1,73 @@
+# This file is used to ignore files which are generated
+# ----------------------------------------------------------------------------
+
+*~
+*.autosave
+*.a
+*.core
+*.moc
+*.o
+*.obj
+*.orig
+*.rej
+*.so
+*.so.*
+*_pch.h.cpp
+*_resource.rc
+*.qm
+.#*
+*.*#
+core
+!core/
+tags
+.DS_Store
+.directory
+*.debug
+Makefile*
+*.prl
+*.app
+moc_*.cpp
+ui_*.h
+qrc_*.cpp
+Thumbs.db
+*.res
+*.rc
+/.qmake.cache
+/.qmake.stash
+
+# qtcreator generated files
+*.pro.user*
+
+# xemacs temporary files
+*.flc
+
+# Vim temporary files
+.*.swp
+
+# Visual Studio generated files
+*.ib_pdb_index
+*.idb
+*.ilk
+*.pdb
+*.sln
+*.suo
+*.vcproj
+*vcproj.*.*.user
+*.ncb
+*.sdf
+*.opensdf
+*.vcxproj
+*vcxproj.*
+
+# MinGW generated files
+*.Debug
+*.Release
+
+# Python byte code
+*.pyc
+
+# Binaries
+# --------
+*.dll
+*.exe
+

+ 28 - 0
src/driver/driver_service_vehicleinfo/driver_service_vehicleinfo.pro

@@ -0,0 +1,28 @@
+QT -= gui
+
+CONFIG += c++11 console
+CONFIG -= app_bundle
+
+# 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 += \
+        main.cpp
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target
+
+
+!include(../../../include/common.pri ) {
+    error( "Couldn't find the common.pri file!" )
+}

+ 96 - 0
src/driver/driver_service_vehicleinfo/main.cpp

@@ -0,0 +1,96 @@
+#include <QCoreApplication>
+
+#include "ivservice.h"
+#include "ivversion.h"
+#include "xmlparam.h"
+
+#include <QFile>
+
+static std::string gstrVIN;
+static std::string gstrVehicleType;
+static std::string gstrVersion;
+
+void ProcVINReq(std::shared_ptr<char> pstr_req,const int nreqsize,std::shared_ptr<char> & pstr_res,int & nressize)
+{
+    (void)pstr_req;
+    (void)nreqsize;
+    nressize = gstrVIN.size() +1;
+    pstr_res = std::shared_ptr<char>(new char[nressize]);
+    *(pstr_res.get() + nressize) = 0;
+    memcpy(pstr_res.get(),gstrVIN.data(),gstrVIN.size());
+}
+
+void ProcVehicleTypeReq(std::shared_ptr<char> pstr_req,const int nreqsize,std::shared_ptr<char> & pstr_res,int & nressize)
+{
+    (void)pstr_req;
+    (void)nreqsize;
+    nressize = gstrVehicleType.size() +1;
+    pstr_res = std::shared_ptr<char>(new char[nressize]);
+    *(pstr_res.get() + nressize) = 0;
+    memcpy(pstr_res.get(),gstrVehicleType.data(),gstrVehicleType.size());
+
+}
+
+void ProcVersionReq(std::shared_ptr<char> pstr_req,const int nreqsize,std::shared_ptr<char> & pstr_res,int & nressize)
+{
+   (void)pstr_req;
+   (void)nreqsize;
+   nressize = gstrVersion.size() +1;
+   pstr_res = std::shared_ptr<char>(new char[nressize]);
+   *(pstr_res.get() + nressize) = 0;
+   memcpy(pstr_res.get(),gstrVersion.data(),gstrVersion.size());
+}
+
+std::string GetVersion()
+{
+    std::string strversion;
+    QFile xFile;
+    xFile.setFileName("version");
+    if(xFile.open(QIODevice::ReadOnly))
+    {
+        QByteArray ba = xFile.readAll();
+        strversion = ba.toStdString();
+    }
+    else
+    {
+        strversion = IVVERSION;
+    }
+    return strversion;
+}
+
+std::string GetVIN()
+{
+    std::string strVIN;
+    iv::xmlparam::Xmlparam xp("vin.xml");
+    strVIN = xp.GetParam("VIN","Unknown");
+    return strVIN;
+}
+
+std::string GetVehicleType()
+{
+    std::string strVehicleType = "Unknown";
+    iv::xmlparam::Xmlparam xp("vin.xml");
+    strVehicleType = xp.GetParam("VehicleType","Unknown");
+    return strVehicleType;
+}
+
+int main(int argc, char *argv[])
+{
+    showversion("driver_service_vehicleinfo");
+    QCoreApplication a(argc, argv);
+
+    gstrVersion = GetVersion();
+    gstrVIN = GetVIN();
+    gstrVehicleType = GetVehicleType();
+
+    iv::service::Server serviceVersion("Version",ProcVersionReq);
+    (void)serviceVersion;
+
+    iv::service::Server serviceVIN("VIN",ProcVINReq);
+    (void)serviceVIN;
+
+    iv::service::Server serviceVehicleType("VehicleType",ProcVehicleTypeReq);
+    (void)serviceVehicleType;
+
+    return a.exec();
+}

+ 73 - 0
src/test/testivservice/.gitignore

@@ -0,0 +1,73 @@
+# This file is used to ignore files which are generated
+# ----------------------------------------------------------------------------
+
+*~
+*.autosave
+*.a
+*.core
+*.moc
+*.o
+*.obj
+*.orig
+*.rej
+*.so
+*.so.*
+*_pch.h.cpp
+*_resource.rc
+*.qm
+.#*
+*.*#
+core
+!core/
+tags
+.DS_Store
+.directory
+*.debug
+Makefile*
+*.prl
+*.app
+moc_*.cpp
+ui_*.h
+qrc_*.cpp
+Thumbs.db
+*.res
+*.rc
+/.qmake.cache
+/.qmake.stash
+
+# qtcreator generated files
+*.pro.user*
+
+# xemacs temporary files
+*.flc
+
+# Vim temporary files
+.*.swp
+
+# Visual Studio generated files
+*.ib_pdb_index
+*.idb
+*.ilk
+*.pdb
+*.sln
+*.suo
+*.vcproj
+*vcproj.*.*.user
+*.ncb
+*.sdf
+*.opensdf
+*.vcxproj
+*vcxproj.*
+
+# MinGW generated files
+*.Debug
+*.Release
+
+# Python byte code
+*.pyc
+
+# Binaries
+# --------
+*.dll
+*.exe
+

+ 55 - 0
src/test/testivservice/main.cpp

@@ -0,0 +1,55 @@
+#include <QCoreApplication>
+
+#include "ivservice.h"
+#include <iostream>
+
+void ProcAsyncVin(std::shared_ptr<char> & pstr_res,int & ndatasize,int nres)
+{
+    if(nres == 0)
+    {
+        std::cout<<"not get Service VIN"<<std::endl;
+        return;
+    }
+    if(nres == 1)
+    {
+        (void)ndatasize;
+        std::string strVIN;
+        strVIN.append(pstr_res.get());
+        std::cout<<"VIN:"<<pstr_res.get()<<std::endl;
+    }
+}
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication a(argc, argv);
+
+    iv::service::Client xclientVIN("VIN");
+    std::shared_ptr<char> pstr_ptr = std::shared_ptr<char>(new char[100]);
+    xclientVIN.AsyncSendRequest(pstr_ptr,100,ProcAsyncVin);
+
+    iv::service::Client xclientVecleType("VehicleType");
+    std::shared_ptr<char> pstrvt_ptr;
+    int ndatasize;
+    if(xclientVecleType.SendRequest(pstr_ptr,100,pstrvt_ptr,ndatasize) == iv::service::Client::HAVE_RES)
+    {
+        std::cout<<" VehicleType: "<< pstrvt_ptr.get()<<std::endl;
+    }
+    else
+    {
+        std::cout<<" Can't Get VehicleType"<<std::endl;
+    }
+
+    iv::service::Client xclientVersion("Version");
+//    std::shared_ptr<char> pstrvt_ptr;
+//    int ndatasize;
+    if(xclientVersion.SendRequest(pstr_ptr,100,pstrvt_ptr,ndatasize) == iv::service::Client::HAVE_RES)
+    {
+        std::cout<<" Version: "<< pstrvt_ptr.get()<<std::endl;
+    }
+    else
+    {
+        std::cout<<" Can't Get Version"<<std::endl;
+    }
+
+    return a.exec();
+}

+ 28 - 0
src/test/testivservice/testivservice.pro

@@ -0,0 +1,28 @@
+QT -= gui
+
+CONFIG += c++11 console
+CONFIG -= app_bundle
+
+# 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 += \
+        main.cpp
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target
+
+
+!include(../../../include/common.pri ) {
+    error( "Couldn't find the common.pri file!" )
+}