Développements
ajout status de comm dans get statud
This commit is contained in:
@@ -6,7 +6,7 @@ CIspindelDevice::CIspindelDevice()
|
||||
{
|
||||
mISpindelServer = new QTcpServer;
|
||||
connect(mISpindelServer,SIGNAL(newConnection()),this,SLOT(IspindelClientConnected()));
|
||||
mISpindelServer->listen(QHostAddress::Any,80);
|
||||
mISpindelServer->listen(QHostAddress::Any,90);
|
||||
|
||||
mIspindelLog.clear();
|
||||
mDataLogger.LoadLogData(&mIspindelLog);
|
||||
@@ -126,3 +126,17 @@ QByteArray CIspindelDevice::GetLastestIspindelDataBuffer()
|
||||
}
|
||||
return Buf;
|
||||
}
|
||||
|
||||
bool CIspindelDevice::DeleteSampleRequest(int SampleIndex)
|
||||
{
|
||||
if(SampleIndex >= mIspindelLog.size())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
mIspindelLog.removeAt(SampleIndex);
|
||||
mDataLogger.WriteLogToFile(&mIspindelLog);
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ public:
|
||||
QList<CIspindelData*> *GetAllData(){return &mIspindelLog;}
|
||||
QByteArray GetAllDataBuffer();
|
||||
QByteArray GetLastestIspindelDataBuffer();
|
||||
bool DeleteSampleRequest(int SampleIndex);
|
||||
|
||||
|
||||
public slots:
|
||||
|
||||
@@ -30,6 +30,20 @@ int CIspindelInterface::NewDeviceFrameReceived(int DeviceID, int DeviceAddress,
|
||||
mNetworkInterfacePtr->SendNetworkMessage(ID_ISPINDEL_INTERFACE,mDeviceAddress,ISPINDEL_GET_FULL_DATA_BUFFER_RESPONSE,Buf.size(),&Buf);
|
||||
break;
|
||||
}
|
||||
case ISPINDEL_DELETE_SAMPLE_REQUEST:
|
||||
{
|
||||
int Index;
|
||||
QDataStream Strm(&Data,QIODevice::ReadOnly | QIODevice::Unbuffered);
|
||||
Strm >> Index;
|
||||
bool Res = mISpindelDevice->DeleteSampleRequest(Index);
|
||||
|
||||
QByteArray ResBuffer;
|
||||
QDataStream ResultStrm(&ResBuffer,QIODevice::WriteOnly | QIODevice::Unbuffered);
|
||||
ResultStrm << Res;
|
||||
|
||||
mNetworkInterfacePtr->SendNetworkMessage(ID_ISPINDEL_INTERFACE,mDeviceAddress,ISPINDEL_DELETE_SAMPLE_RESPONSE,ResBuffer.size(),&ResBuffer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
|
||||
Reference in New Issue
Block a user