mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2025-10-19 11:49:42 +08:00
1.修改了部分ATP系列光谱仪的控制函数以匹配数据类型的改变。
2.添加了网络上传模块,矫正算法部分可能需要调整。
This commit is contained in:
@ -34,7 +34,8 @@ int ZZ_HttpTransfer::SendData()
|
||||
|
||||
QNetworkRequest qnRequest;
|
||||
qnRequest.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/json"));
|
||||
qnRequest.setUrl(QUrl("http://172.16.0.234/fileup/Data_uper.php"));
|
||||
QString qstrURL = m_qstrUploadURL + "/Data_uper.php";
|
||||
qnRequest.setUrl(QUrl(qstrURL));
|
||||
|
||||
QByteArray qbSend;
|
||||
QString qstrSend;
|
||||
@ -57,15 +58,15 @@ int ZZ_HttpTransfer::SendData()
|
||||
qbSend.append((char*)m_vecCalcedData[i][j].fData, sizeof(float)*m_vecCalcedData[i][j].iPixels);
|
||||
|
||||
m_pNetworkManagerThread->post(qnRequest, qbSend);
|
||||
iFlagIsReplied = 0;
|
||||
m_iFlagIsReplied = 0;
|
||||
int iCount = 0;
|
||||
while (!iFlagIsReplied)
|
||||
while (!m_iFlagIsReplied)
|
||||
{
|
||||
iCount++;
|
||||
Delay_MSec(500);
|
||||
if (iCount > 20)
|
||||
{
|
||||
iFlagIsReplied = 1;
|
||||
m_iFlagIsReplied = 1;
|
||||
qDebug() << "Reply Timeout:Upload Data ";
|
||||
}
|
||||
}
|
||||
@ -89,12 +90,14 @@ int ZZ_HttpTransfer::SendInfo()
|
||||
|
||||
QNetworkRequest qnRequest;
|
||||
qnRequest.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/json"));
|
||||
qnRequest.setUrl(QUrl("http://172.16.0.234/fileup/Dev_info_uper.php"));
|
||||
QString qstrURL = m_qstrUploadURL + "/Dev_info_uper.php";
|
||||
qnRequest.setUrl(QUrl(qstrURL));
|
||||
//qnRequest.setUrl(QUrl("http://172.16.0.234/fileup/Dev_info_uper.php"));
|
||||
|
||||
QByteArray qbSend;
|
||||
QString qstrSend;
|
||||
QString qstrWaveLength;
|
||||
iFlagIsReplied = false;
|
||||
m_iFlagIsReplied = false;
|
||||
for (int i = 0; i < m_struGrabberRTParams.fscParams.ucDeviceNumber; i++)
|
||||
{
|
||||
qstrSend = "Location:" + QString("%1").arg(m_struEC.qstrLocation) + "####";
|
||||
@ -126,15 +129,15 @@ int ZZ_HttpTransfer::SendInfo()
|
||||
|
||||
qbSend = qstrSend.toLatin1();
|
||||
m_pNetworkManager->post(qnRequest, qbSend);
|
||||
iFlagIsReplied = 0;
|
||||
m_iFlagIsReplied = 0;
|
||||
int iCount = 0;
|
||||
while (!iFlagIsReplied)
|
||||
while (!m_iFlagIsReplied)
|
||||
{
|
||||
iCount++;
|
||||
Delay_MSec(500);
|
||||
if (iCount>2)
|
||||
{
|
||||
iFlagIsReplied = 1;
|
||||
m_iFlagIsReplied = 1;
|
||||
qDebug() << "Reply Timeout:Upload Info ";
|
||||
}
|
||||
}
|
||||
@ -155,7 +158,9 @@ int ZZ_HttpTransfer::SendErr()
|
||||
|
||||
QNetworkRequest qnRequest;
|
||||
qnRequest.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/json"));
|
||||
qnRequest.setUrl(QUrl("http://172.16.0.234/fileup/Warning.php"));
|
||||
QString qstrURL = m_qstrUploadURL + "/Warning.php";
|
||||
qnRequest.setUrl(QUrl(qstrURL));
|
||||
//qnRequest.setUrl(QUrl("http://172.16.0.234/fileup/Warning.php"));
|
||||
|
||||
QByteArray qbSend;
|
||||
QString qstrSend;
|
||||
@ -194,15 +199,15 @@ int ZZ_HttpTransfer::SendErr()
|
||||
|
||||
qbSend = qstrSend.toLatin1();
|
||||
m_pNetworkManager->post(qnRequest, qbSend);
|
||||
iFlagIsReplied = 0;
|
||||
m_iFlagIsReplied = 0;
|
||||
int iCount = 0;
|
||||
while (!iFlagIsReplied)
|
||||
while (!m_iFlagIsReplied)
|
||||
{
|
||||
iCount++;
|
||||
Delay_MSec(500);
|
||||
if (iCount > 2)
|
||||
{
|
||||
iFlagIsReplied = 1;
|
||||
m_iFlagIsReplied = 1;
|
||||
qDebug() << "Reply Timeout:Upload Info ";
|
||||
}
|
||||
}
|
||||
@ -218,6 +223,8 @@ void ZZ_HttpTransfer::SetContext(EContext struEC, MEContext struMEC)
|
||||
{
|
||||
m_struEC = struEC;
|
||||
m_struMEC = struMEC;
|
||||
|
||||
m_qstrUploadURL = m_struMEC.qstrHTTPServer;
|
||||
}
|
||||
|
||||
void ZZ_HttpTransfer::SetDeviceInfo(RunTimeGrabberParams struGrabberRTParams)
|
||||
@ -245,7 +252,7 @@ int ZZ_HttpTransfer::SlotReplyFinished(QNetworkReply* qnReply)
|
||||
QByteArray qbData = qnReply->readAll();
|
||||
if (qnReply->error()== QNetworkReply::NoError)
|
||||
{
|
||||
iFlagIsReplied = 1;
|
||||
m_iFlagIsReplied = 1;
|
||||
}
|
||||
qnReply->abort();
|
||||
qnReply->close();
|
||||
@ -262,7 +269,7 @@ int ZZ_HttpTransfer::SlotReplyFinishedThread(QNetworkReply* qnReply)
|
||||
QByteArray qbData = qnReply->readAll();
|
||||
if (qnReply->error() == QNetworkReply::NoError)
|
||||
{
|
||||
iFlagIsReplied = 1;
|
||||
m_iFlagIsReplied = 1;
|
||||
}
|
||||
qnReply->abort();
|
||||
qnReply->close();
|
||||
|
Reference in New Issue
Block a user