|
@@ -20,6 +20,7 @@ grpcclient::grpcclient(std::string stryamlpath)
|
|
|
ggrpcclient = this;
|
|
|
dec_yaml(stryamlpath.data());
|
|
|
|
|
|
+
|
|
|
mstrpicmsgname[0] = "picfront";
|
|
|
mstrpicmsgname[1] = "picrear";
|
|
|
mstrpicmsgname[2] = "picleft";
|
|
@@ -52,6 +53,11 @@ grpcclient::grpcclient(std::string stryamlpath)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ for(i=0;i<NUM_CAM;i++)
|
|
|
+ {
|
|
|
+ mpicbuf[i].mnSkipBase = mnskip;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
grpcclient::~grpcclient()
|
|
@@ -263,6 +269,12 @@ void grpcclient::dec_yaml(const char * stryamlpath)
|
|
|
{
|
|
|
gstruploadinterval = config["uploadinterval"].as<std::string>();
|
|
|
}
|
|
|
+ if(config["skip"])
|
|
|
+ {
|
|
|
+ std::string strskip = config["skip"].as<std::string>();
|
|
|
+ mnskip = atoi(strskip.data());
|
|
|
+ if(mnskip<1)mnskip = 1;
|
|
|
+ }
|
|
|
|
|
|
if(config["VIN"])
|
|
|
{
|
|
@@ -473,8 +485,6 @@ void grpcclient::threadpicupload(int nCamPos)
|
|
|
|
|
|
// ClientContext context;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
while(mbPicUpload)
|
|
|
{
|
|
|
std::shared_ptr<char> pstr_ptr;
|
|
@@ -489,6 +499,8 @@ void grpcclient::threadpicupload(int nCamPos)
|
|
|
qint64 nMsgTime = 0;
|
|
|
int nSize = 0;
|
|
|
qint64 npiclatency;
|
|
|
+ int nSkipBase = 1;
|
|
|
+ int nCount;
|
|
|
|
|
|
mpicbuf[nCamPos].mWaitMutex.lock();
|
|
|
mpicbuf[nCamPos].mwc.wait(&mpicbuf[nCamPos].mWaitMutex,100);
|
|
@@ -504,7 +516,19 @@ void grpcclient::threadpicupload(int nCamPos)
|
|
|
pstr_ptr = mpicbuf[nCamPos].mpstrmsgdata;
|
|
|
nSize = mpicbuf[nCamPos].mDataSize;
|
|
|
npiclatency = CalcLateny(mpicbuf[nCamPos].mvectorlatency);
|
|
|
- std::cout<<"upload "<<nMsgTime<<" latency: "<<npiclatency<<std::endl;
|
|
|
+ nSkipBase = mpicbuf[nCamPos].mnSkipBase;
|
|
|
+ nCount = mpicbuf[nCamPos].mnCount;
|
|
|
+ mpicbuf[nCamPos].mnCount++;
|
|
|
+// if(npiclatency > 500)
|
|
|
+// {
|
|
|
+// if(mpicbuf[nCamPos].mnSkipBase<30)mpicbuf[nCamPos].mnSkipBase++;
|
|
|
+// }
|
|
|
+// else
|
|
|
+// {
|
|
|
+// if(npiclatency<300)
|
|
|
+// if(mpicbuf[nCamPos].mnSkipBase > mpicbuf[nCamPos].mnDefSkipBase)mpicbuf[nCamPos].mnSkipBase--;
|
|
|
+// }
|
|
|
+ std::cout<<"upload "<<nMsgTime<<" latency: "<<npiclatency<<" skip param: "<<nSkipBase<<std::endl;
|
|
|
}
|
|
|
mpicbuf[nCamPos].mMutex.unlock();
|
|
|
if(bUpdate == false)
|
|
@@ -513,6 +537,13 @@ void grpcclient::threadpicupload(int nCamPos)
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
+ if(nCount%nSkipBase != 0)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
ClientContext context ;
|
|
|
context.set_deadline(timespec);
|
|
|
qint64 time1 = QDateTime::currentMSecsSinceEpoch();
|