|
|
@ -56,17 +56,27 @@ bool HonaLowLevelAPI::isHiruStarted() |
|
|
|
void HonaLowLevelAPI::deviceReset() |
|
|
|
{ |
|
|
|
if(!plxWrapper.deviceReset()) |
|
|
|
throw HonaAlreadyStartedException("reset Doesnt Occur"); |
|
|
|
throw HonaAlreadyStartedException("Reset Doesnt Occur"); |
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
void HonaLowLevelAPI::setConfig(HonaSettings& settings) |
|
|
|
{ |
|
|
|
plxWrapper.deviceReadRegister(0x10000000, honaRegisterBuffer, 8); |
|
|
|
if(!plxWrapper.deviceReadRegister(0x10000000, honaRegisterBuffer, 8)) |
|
|
|
{ |
|
|
|
throw HonaAlreadyStartedException("DeviceReadRegister Doesnt Occur"); |
|
|
|
} |
|
|
|
_honaSetting = settings; |
|
|
|
writeSettingToRegisters(settings); |
|
|
|
plxWrapper.deviceWriteRegister(0x10000000, honaRegisterBuffer); |
|
|
|
plxWrapper.deviceReadRegister(0x10000000, honaRegisterBuffer, 8); |
|
|
|
if(!plxWrapper.deviceWriteRegister(0x10000000, honaRegisterBuffer)) |
|
|
|
{ |
|
|
|
throw HonaAlreadyStartedException("DeviceWriteRegister Doesnt Occur"); |
|
|
|
} |
|
|
|
|
|
|
|
if(!plxWrapper.deviceReadRegister(0x10000000, honaRegisterBuffer, 8)) |
|
|
|
{ |
|
|
|
throw HonaAlreadyStartedException("DeviceReadRegister Doesnt Occur"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
@ -92,7 +102,7 @@ QString HonaLowLevelAPI::getDeviceId() |
|
|
|
void HonaLowLevelAPI::hsruStart() |
|
|
|
{ |
|
|
|
if(!isHsruStarted()) |
|
|
|
throw HonaAlreadyStartedException("HsruStarted doesn't started "); |
|
|
|
throw HonaException("HsruStarted doesn't started "); |
|
|
|
QtConcurrent::run(this, &HonaLowLevelAPI::hsruMainThread); |
|
|
|
setHsruIsStarted(true); |
|
|
|
} |
|
|
@ -101,14 +111,26 @@ void HonaLowLevelAPI::hsruStart() |
|
|
|
void HonaLowLevelAPI::hiruStart() |
|
|
|
{ |
|
|
|
if(!isHiruStarted()) |
|
|
|
throw HonaAlreadyStartedException("HiruStarted doesn't started "); |
|
|
|
throw HonaException("HiruStarted doesn't started "); |
|
|
|
QtConcurrent::run(this, &HonaLowLevelAPI::hiruMainThread); |
|
|
|
setHiruIsStarted(true); |
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
void HonaLowLevelAPI::hsruStop() |
|
|
|
{ |
|
|
|
if(isHiruStarted()) |
|
|
|
setHsruIsStarted(false); |
|
|
|
_hsruStopEvent.wakeAll(); |
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
void HonaLowLevelAPI::init() |
|
|
|
{ |
|
|
|
if(!plxWrapper.deviceInit(0X9054)) |
|
|
|
{ |
|
|
|
throw HonaAlreadyStartedException("Init Doesnt Occur"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
@ -134,8 +156,8 @@ void HonaLowLevelAPI::writeSettingToRegisters(HonaSettings& settings) |
|
|
|
/************************************************************************/ |
|
|
|
|
|
|
|
honaRegisterBuffer.insert(0, |
|
|
|
(honaRegisterBuffer.at(0) + |
|
|
|
(settings.hiruSettings.threshold & 0x00000FFF))); |
|
|
|
(honaRegisterBuffer.at(0) + |
|
|
|
(settings.hiruSettings.threshold & 0x00000FFF))); |
|
|
|
|
|
|
|
honaRegisterBuffer.insert(1, settings.hsruSettings.honaInt123CTHR); |
|
|
|
honaRegisterBuffer.insert(2, settings.hsruSettings.honaRes123CTHR); |
|
|
@ -160,7 +182,10 @@ void HonaLowLevelAPI::hsruMainThread() |
|
|
|
deviceReset(); |
|
|
|
setConfig(); |
|
|
|
deviceReset(); |
|
|
|
plxWrapper.deviceEnableInterrupt(); |
|
|
|
if(!plxWrapper.deviceEnableInterrupt()) |
|
|
|
{ |
|
|
|
throw HonaAlreadyStartedException("DeviceEnableInterrupt Doesnt Occur"); |
|
|
|
} |
|
|
|
|
|
|
|
QtConcurrent::run(this, &HonaLowLevelAPI::hsruReadThread); |
|
|
|
QtConcurrent::run(this, &HonaLowLevelAPI::hsruUpdateThread); |
|
|
@ -169,7 +194,7 @@ void HonaLowLevelAPI::hsruMainThread() |
|
|
|
{ |
|
|
|
_isHsruReaderThreadFree = true; |
|
|
|
_isHsruUpdateThreadFree = true; |
|
|
|
setHiruIsStarted(false); |
|
|
|
hsruStop(); |
|
|
|
} |
|
|
|
|
|
|
|
_mutex.lock(); |
|
|
@ -178,7 +203,10 @@ void HonaLowLevelAPI::hsruMainThread() |
|
|
|
_isHsruReaderThreadFree = true; |
|
|
|
_isHsruUpdateThreadFree = true; |
|
|
|
|
|
|
|
plxWrapper.deviceDisableInterrupt(); |
|
|
|
if(!plxWrapper.deviceDisableInterrupt()) |
|
|
|
{ |
|
|
|
throw HonaAlreadyStartedException("DeviceEnableInterrupt Doesnt Occur"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
@ -190,23 +218,35 @@ void HonaLowLevelAPI::hsruReadThread() |
|
|
|
if(_isHsruReaderThreadFree) |
|
|
|
break; |
|
|
|
|
|
|
|
plxWrapper.deviceWaitForInterrupt(1000); |
|
|
|
if(!plxWrapper.deviceWaitForInterrupt(1000)) |
|
|
|
{ |
|
|
|
throw HonaAlreadyStartedException("DeviceWaitForInterrupt Doesnt Occur"); |
|
|
|
} |
|
|
|
honaPacketList.clear(); |
|
|
|
_hsruLoss = 0; |
|
|
|
plxWrapper.deviceOpenPCIChannel(); |
|
|
|
if(!plxWrapper.deviceOpenPCIChannel()) |
|
|
|
{ |
|
|
|
throw HonaAlreadyStartedException("DeviceOpenPCIChannel Doesnt Occur"); |
|
|
|
} |
|
|
|
|
|
|
|
_hsruLoss += hsruParserInt123C(hsruReadHonaBuffer(honaReceivers::int123C), |
|
|
|
honaPacketList); |
|
|
|
honaPacketList); |
|
|
|
_hsruLoss += hsruParserRes123C(hsruReadHonaBuffer(honaReceivers::res123C), |
|
|
|
honaPacketList); |
|
|
|
honaPacketList); |
|
|
|
_hsruLoss += hsruParserIntS(hsruReadHonaBuffer(honaReceivers::intS), honaPacketList); |
|
|
|
_hsruLoss += hsruParserResS(hsruReadHonaBuffer(honaReceivers::resS), honaPacketList); |
|
|
|
_hsruLoss += hsruParserInt4(hsruReadHonaBuffer(honaReceivers::int4), honaPacketList); |
|
|
|
_hsruLoss += hsruParserRes4(hsruReadHonaBuffer(honaReceivers::res4), honaPacketList); |
|
|
|
_hsruLoss += hsruParserSinglePulse(hsruReadHonaBuffer(honaReceivers::singlePulse), |
|
|
|
honaPacketList); |
|
|
|
plxWrapper.deviceClosePCIChannel(); |
|
|
|
plxWrapper.deviceEnableInterrupt(); |
|
|
|
honaPacketList); |
|
|
|
if(!plxWrapper.deviceClosePCIChannel()) |
|
|
|
{ |
|
|
|
throw HonaAlreadyStartedException("DeviceClosePCIChannel Doesnt Occur"); |
|
|
|
} |
|
|
|
if(!plxWrapper.deviceEnableInterrupt()) |
|
|
|
{ |
|
|
|
throw HonaAlreadyStartedException("DeviceEnableInterrupt Doesnt Occur"); |
|
|
|
} |
|
|
|
|
|
|
|
_mutex.lock(); |
|
|
|
_hsruReadDone.wakeAll(); |
|
|
@ -242,9 +282,6 @@ void HonaLowLevelAPI::hiruMainThread() |
|
|
|
_mutex.lock(); |
|
|
|
_hsruStopEvent.wait(&_mutex); |
|
|
|
_mutex.unlock(); |
|
|
|
|
|
|
|
//_isReaderThreadFree = true;
|
|
|
|
//_isUpdateThreadFree = true;
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -262,7 +299,10 @@ void HonaLowLevelAPI::hiruUpdateThread() |
|
|
|
quint32 HonaLowLevelAPI::hiruGetDOA() |
|
|
|
{ |
|
|
|
quint32 Doa = 0; |
|
|
|
plxWrapper.deviceReadRegister(0x30000004, Doa); |
|
|
|
if(!plxWrapper.deviceReadRegister(0x30000004, Doa)) |
|
|
|
{ |
|
|
|
throw HonaAlreadyStartedException("DeviceReadRegister Doesnt Occur"); |
|
|
|
} |
|
|
|
Doa = Doa & 0x0000FFFF; |
|
|
|
|
|
|
|
return Doa; |
|
|
@ -270,7 +310,7 @@ quint32 HonaLowLevelAPI::hiruGetDOA() |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
quint32 HonaLowLevelAPI::hsruParserInt123C(const QVector<quint32>& honaData, |
|
|
|
QList<HonaPacket> honaPacketList) |
|
|
|
QList<HonaPacket> honaPacketList) |
|
|
|
{ |
|
|
|
quint32 lossFound; |
|
|
|
for(quint32 Ind = 0; Ind < honaData.length(); Ind++) |
|
|
@ -282,7 +322,7 @@ quint32 HonaLowLevelAPI::hsruParserInt123C(const QVector<quint32>& honaData, |
|
|
|
packetLenInt123C = 6; |
|
|
|
tempHonaPacketInt123C.setPacketNumber(honaData.at(Ind) & 0x0000FFFF); |
|
|
|
if((tempHonaPacketInt123C.getPacketNumber() != |
|
|
|
(lastPNInt123C + 1)) & (lastPNInt123C > 0)) |
|
|
|
(lastPNInt123C + 1)) & (lastPNInt123C > 0)) |
|
|
|
//& (LastPNInt123C != 65535))
|
|
|
|
{ |
|
|
|
lossFound += |
|
|
@ -301,7 +341,7 @@ quint32 HonaLowLevelAPI::hsruParserInt123C(const QVector<quint32>& honaData, |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x20000000) && (nextInt123C == 2)) |
|
|
|
{ |
|
|
|
tempHonaPacketInt123C.setToa(((tempHonaPacketInt123C.getToa()) + |
|
|
|
(qulonglong)((honaData.at(Ind) & 0x0000FFFF) << 28))); |
|
|
|
(qulonglong)((honaData.at(Ind) & 0x0000FFFF) << 28))); |
|
|
|
|
|
|
|
tempHonaPacketInt123C.setPa2((honaData.at(Ind) & 0x0FFF0000) >> 16); |
|
|
|
nextInt123C = 3; |
|
|
@ -350,7 +390,7 @@ quint32 HonaLowLevelAPI::hsruParserInt123C(const QVector<quint32>& honaData, |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
quint32 HonaLowLevelAPI::hsruParserRes123C(const QVector<quint32>& honaData, |
|
|
|
QList<HonaPacket> honaPacketList) |
|
|
|
QList<HonaPacket> honaPacketList) |
|
|
|
{ |
|
|
|
quint32 lossFound = 0; |
|
|
|
for(quint32 Ind = 0; Ind < honaData.length(); Ind++) |
|
|
@ -361,7 +401,7 @@ quint32 HonaLowLevelAPI::hsruParserRes123C(const QVector<quint32>& honaData, |
|
|
|
packetLenRes123C = 6; |
|
|
|
tempHonaPacketRes123C.setPacketNumber(honaData.at(Ind) & 0x0000FFFF); |
|
|
|
if((tempHonaPacketRes123C.getPacketNumber() != |
|
|
|
(lastPNRes123C + 1)) & (lastPNRes123C > 0)) |
|
|
|
(lastPNRes123C + 1)) & (lastPNRes123C > 0)) |
|
|
|
//& (LastPNRes123C != 65535))
|
|
|
|
{ |
|
|
|
lossFound += |
|
|
@ -380,7 +420,7 @@ quint32 HonaLowLevelAPI::hsruParserRes123C(const QVector<quint32>& honaData, |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x20000000) && (nextRes123C == 2)) |
|
|
|
{ |
|
|
|
tempHonaPacketRes123C.setToa(tempHonaPacketRes123C.getToa() + |
|
|
|
(((ulong)(honaData.at(Ind) & 0x0000FFFF)) << 28)); |
|
|
|
(((ulong)(honaData.at(Ind) & 0x0000FFFF)) << 28)); |
|
|
|
tempHonaPacketRes123C.setPa2((honaData.at(Ind) & 0x0FFF0000) >> 16); |
|
|
|
nextRes123C = 3; |
|
|
|
} |
|
|
@ -394,9 +434,9 @@ quint32 HonaLowLevelAPI::hsruParserRes123C(const QVector<quint32>& honaData, |
|
|
|
{ |
|
|
|
tempHonaPacketRes123C.setPa1(honaData.at(Ind) & 0x0000FFFF); |
|
|
|
tempHonaPacketRes123C.setPa2(tempHonaPacketRes123C.getPa2() + |
|
|
|
((honaData.at(Ind) & 0x000F0000) >> 4)); |
|
|
|
((honaData.at(Ind) & 0x000F0000) >> 4)); |
|
|
|
tempHonaPacketRes123C.setPa3(tempHonaPacketRes123C.getPa3() + |
|
|
|
((honaData.at(Ind) & 0x00F00000) >> 8)); |
|
|
|
((honaData.at(Ind) & 0x00F00000) >> 8)); |
|
|
|
nextRes123C = 5; |
|
|
|
} |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x50000000) && (nextRes123C == 5)) |
|
|
@ -430,7 +470,7 @@ quint32 HonaLowLevelAPI::hsruParserRes123C(const QVector<quint32>& honaData, |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
quint32 HonaLowLevelAPI::hsruParserIntS(const QVector<quint32>& honaData, |
|
|
|
QList<HonaPacket> honaPacketList) |
|
|
|
QList<HonaPacket> honaPacketList) |
|
|
|
{ |
|
|
|
uint lossFound = 0; |
|
|
|
for(quint32 Ind = 0; Ind < honaData.length(); Ind++) |
|
|
@ -468,7 +508,7 @@ quint32 HonaLowLevelAPI::hsruParserIntS(const QVector<quint32>& honaData, |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x20000000) && (nextIntS == 2)) |
|
|
|
{ |
|
|
|
tempHonaPacketIntS.setToa(tempHonaPacketIntS.getToa() + |
|
|
|
(((ulong)(honaData.at(Ind) & 0x0000FFFF)) << 28)); |
|
|
|
(((ulong)(honaData.at(Ind) & 0x0000FFFF)) << 28)); |
|
|
|
tempHonaPacketIntS.setToa((honaData.at(Ind) & 0x0FFF0000) >> 16); |
|
|
|
nextIntS = 3; |
|
|
|
} |
|
|
@ -479,13 +519,13 @@ quint32 HonaLowLevelAPI::hsruParserIntS(const QVector<quint32>& honaData, |
|
|
|
nextIntS = 4; |
|
|
|
} |
|
|
|
else if(((honaData.at(static_cast<int>(Ind)) & 0xF0000000) == 0x40000000) && |
|
|
|
(nextIntS == 4)) |
|
|
|
(nextIntS == 4)) |
|
|
|
{ |
|
|
|
tempHonaPacketIntS.setPa1(honaData.at(Ind) & 0x0000FFFF); |
|
|
|
tempHonaPacketIntS.setPa2(tempHonaPacketIntS.getPa2() + ((honaData.at( |
|
|
|
Ind) & 0x000F0000))); |
|
|
|
tempHonaPacketIntS.setPa3(tempHonaPacketIntS.getPa3() + |
|
|
|
((honaData.at(Ind) & 0x00F00000) >> 4)); |
|
|
|
((honaData.at(Ind) & 0x00F00000) >> 4)); |
|
|
|
nextIntS = 5; |
|
|
|
} |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x50000000) && (nextIntS == 5)) |
|
|
@ -497,7 +537,7 @@ quint32 HonaLowLevelAPI::hsruParserIntS(const QVector<quint32>& honaData, |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x60000000) && (nextIntS == 6)) |
|
|
|
{ |
|
|
|
tempHonaPacketIntS.setCodeM(tempHonaPacketIntS.getCodeM() + |
|
|
|
((ulong)(honaData.at(Ind) & 0x0FFFFFFF)) << 36); |
|
|
|
((ulong)(honaData.at(Ind) & 0x0FFFFFFF)) << 36); |
|
|
|
tempHonaPacketIntS.setCodeL(0); |
|
|
|
nextIntS = 7; |
|
|
|
} |
|
|
@ -510,7 +550,7 @@ quint32 HonaLowLevelAPI::hsruParserIntS(const QVector<quint32>& honaData, |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x80000000) && (nextIntS == 8)) |
|
|
|
{ |
|
|
|
tempHonaPacketIntS.setCodeM(tempHonaPacketIntS.getCodeM() + |
|
|
|
((ulong)(honaData.at(Ind) & 0x0FFFFFFF)) << 36); |
|
|
|
((ulong)(honaData.at(Ind) & 0x0FFFFFFF)) << 36); |
|
|
|
nextIntS = 9; |
|
|
|
} |
|
|
|
else if(honaData.at(Ind) == 0xEEEEEEEE) |
|
|
@ -538,7 +578,7 @@ quint32 HonaLowLevelAPI::hsruParserIntS(const QVector<quint32>& honaData, |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
quint32 HonaLowLevelAPI::hsruParserResS(const QVector<quint32>& honaData, |
|
|
|
QList<HonaPacket> honaPacketList) |
|
|
|
QList<HonaPacket> honaPacketList) |
|
|
|
{ |
|
|
|
uint lossFound = 0; |
|
|
|
for(quint32 Ind = 0; Ind < honaData.length(); Ind++) |
|
|
@ -576,8 +616,8 @@ quint32 HonaLowLevelAPI::hsruParserResS(const QVector<quint32>& honaData, |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x20000000) && (nextResS == 2)) |
|
|
|
{ |
|
|
|
tempHonaPacketResS.setDoa(tempHonaPacketResS.getDoa() + |
|
|
|
((static_cast<qulonglong>(honaData.at(Ind) & 0x0000FFFF)) << |
|
|
|
28)); |
|
|
|
((static_cast<qulonglong>(honaData.at(Ind) & 0x0000FFFF)) << |
|
|
|
28)); |
|
|
|
tempHonaPacketResS.setPa2((honaData.at(Ind) & 0x0FFF0000) >> 16); |
|
|
|
nextResS = 3; |
|
|
|
} |
|
|
@ -593,7 +633,7 @@ quint32 HonaLowLevelAPI::hsruParserResS(const QVector<quint32>& honaData, |
|
|
|
tempHonaPacketResS.setPa2(tempHonaPacketResS.getPa2() + ((honaData.at( |
|
|
|
Ind) & 0x000F0000))); |
|
|
|
tempHonaPacketResS.setPa3(tempHonaPacketResS.getPa3() + |
|
|
|
((honaData.at(Ind) & 0x00F00000) >> 4)); |
|
|
|
((honaData.at(Ind) & 0x00F00000) >> 4)); |
|
|
|
nextResS = 5; |
|
|
|
} |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x50000000) && (nextResS == 5)) |
|
|
@ -606,7 +646,7 @@ quint32 HonaLowLevelAPI::hsruParserResS(const QVector<quint32>& honaData, |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x60000000) && (nextResS == 6)) |
|
|
|
{ |
|
|
|
tempHonaPacketResS.setCodeM(tempHonaPacketResS.getCodeM() + |
|
|
|
(static_cast<qulonglong>(honaData.at( |
|
|
|
(static_cast<qulonglong>(honaData.at( |
|
|
|
Ind) & 0x0FFFFFFF)) << 36); |
|
|
|
tempHonaPacketResS.setCodeL(0); |
|
|
|
nextResS = 7; |
|
|
@ -621,7 +661,7 @@ quint32 HonaLowLevelAPI::hsruParserResS(const QVector<quint32>& honaData, |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x80000000) && (nextResS == 8)) |
|
|
|
{ |
|
|
|
tempHonaPacketResS.setCodeM(tempHonaPacketResS.getCodeM() + |
|
|
|
(static_cast<qulonglong>(honaData.at( |
|
|
|
(static_cast<qulonglong>(honaData.at( |
|
|
|
Ind) & 0x0FFFFFFF)) << 36); |
|
|
|
nextResS = 9; |
|
|
|
} |
|
|
@ -650,7 +690,7 @@ quint32 HonaLowLevelAPI::hsruParserResS(const QVector<quint32>& honaData, |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
quint32 HonaLowLevelAPI::hsruParserInt4(const QVector<quint32>& honaData, |
|
|
|
QList<HonaPacket> honaPacketList) |
|
|
|
QList<HonaPacket> honaPacketList) |
|
|
|
{ |
|
|
|
uint lossFound = 0; |
|
|
|
|
|
|
@ -679,8 +719,8 @@ quint32 HonaLowLevelAPI::hsruParserInt4(const QVector<quint32>& honaData, |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x20000000) && (nextInt4 == 2)) |
|
|
|
{ |
|
|
|
tempHonaPacketInt4.setToa(tempHonaPacketInt4.getToa() + |
|
|
|
((static_cast<qulonglong>(honaData.at(Ind) & 0x0000FFFF)) << |
|
|
|
28)); |
|
|
|
((static_cast<qulonglong>(honaData.at(Ind) & 0x0000FFFF)) << |
|
|
|
28)); |
|
|
|
tempHonaPacketInt4.setPa2((honaData.at(Ind) & 0x0FFF0000) >> 16); |
|
|
|
nextInt4 = 3; |
|
|
|
} |
|
|
@ -694,9 +734,9 @@ quint32 HonaLowLevelAPI::hsruParserInt4(const QVector<quint32>& honaData, |
|
|
|
{ |
|
|
|
tempHonaPacketInt4.setPa1(honaData.at(Ind) & 0x0000FFFF); |
|
|
|
tempHonaPacketInt4.setPa2(tempHonaPacketInt4.getPa2() + |
|
|
|
((honaData.at(Ind) & 0x000F0000) >> 4)); |
|
|
|
((honaData.at(Ind) & 0x000F0000) >> 4)); |
|
|
|
tempHonaPacketInt4.setPa3(tempHonaPacketInt4.getPa3() + |
|
|
|
((honaData.at(Ind) & 0x00F00000) >> 8)); |
|
|
|
((honaData.at(Ind) & 0x00F00000) >> 8)); |
|
|
|
nextInt4 = 5; |
|
|
|
} |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x50000000) && (nextInt4 == 5)) |
|
|
@ -709,9 +749,9 @@ quint32 HonaLowLevelAPI::hsruParserInt4(const QVector<quint32>& honaData, |
|
|
|
{ |
|
|
|
tempHonaPacketInt4.setPa4(honaData.at(Ind) & 0x0000FFFF); |
|
|
|
tempHonaPacketInt4.setCodeL(tempHonaPacketInt4.getCodeL() + |
|
|
|
((static_cast<qulonglong>(honaData.at(Ind) & 0x000F0000)) << |
|
|
|
12)); |
|
|
|
tempHonaPacketInt4.M4Status = ((byte)((honaData.at(Ind) & 0x0F000000) >> 20)); |
|
|
|
((static_cast<qulonglong>(honaData.at(Ind) & 0x000F0000)) << |
|
|
|
12)); |
|
|
|
tempHonaPacketInt4.setm4Status((quint8)((honaData.at(Ind) & 0x0F000000) >> 20)); |
|
|
|
nextInt4 = 7; |
|
|
|
} |
|
|
|
else if(honaData.at(Ind) == 0xEEEEEEEE) |
|
|
@ -738,7 +778,7 @@ quint32 HonaLowLevelAPI::hsruParserInt4(const QVector<quint32>& honaData, |
|
|
|
} |
|
|
|
|
|
|
|
quint32 HonaLowLevelAPI::hsruParserRes4(const QVector<quint32>& honaData, |
|
|
|
QList<HonaPacket> honaPacketList) |
|
|
|
QList<HonaPacket> honaPacketList) |
|
|
|
{ |
|
|
|
uint lossFound = 0; |
|
|
|
for(quint32 Ind = 0; Ind < honaData.length(); Ind++) |
|
|
@ -766,8 +806,8 @@ quint32 HonaLowLevelAPI::hsruParserRes4(const QVector<quint32>& honaData, |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x20000000) && (nextRes4 == 2)) |
|
|
|
{ |
|
|
|
tempHonaPacketRes4.setToa(tempHonaPacketRes4.getToa() + |
|
|
|
(static_cast<qulonglong>(honaData.at(Ind) & 0x0000FFFF) << |
|
|
|
28)); |
|
|
|
(static_cast<qulonglong>(honaData.at(Ind) & 0x0000FFFF) << |
|
|
|
28)); |
|
|
|
tempHonaPacketRes4.setPa2((honaData.at(Ind) & 0x0FFF0000) >> 16); |
|
|
|
nextRes4 = 3; |
|
|
|
} |
|
|
@ -811,7 +851,7 @@ quint32 HonaLowLevelAPI::hsruParserRes4(const QVector<quint32>& honaData, |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
quint32 HonaLowLevelAPI::hsruParserSinglePulse(const QVector<quint32>& honaData, |
|
|
|
QList<HonaPacket> honaPacketList) |
|
|
|
QList<HonaPacket> honaPacketList) |
|
|
|
{ |
|
|
|
uint lossFound = 0; |
|
|
|
for(quint32 Ind = 0; Ind < honaData.length(); Ind++) |
|
|
@ -822,7 +862,7 @@ quint32 HonaLowLevelAPI::hsruParserSinglePulse(const QVector<quint32>& honaData, |
|
|
|
packetLenSinglePulse = 5; |
|
|
|
tempHonaPacketSinglePulse.setPacketNumber(honaData.at(Ind) & 0x0000FFFF); |
|
|
|
if((tempHonaPacketSinglePulse.getPacketNumber() != |
|
|
|
(lastPNSinglePulse + 1)) & (lastPNSinglePulse > 0)) |
|
|
|
(lastPNSinglePulse + 1)) & (lastPNSinglePulse > 0)) |
|
|
|
; |
|
|
|
{ |
|
|
|
lossFound += |
|
|
@ -838,14 +878,14 @@ quint32 HonaLowLevelAPI::hsruParserSinglePulse(const QVector<quint32>& honaData, |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x10000000) && (nextSinglePulse == 1)) |
|
|
|
{ |
|
|
|
tempHonaPacketSinglePulse.setToa(static_cast<qulonglong>(honaData.at(Ind) & |
|
|
|
0x0FFFFFFF)); |
|
|
|
0x0FFFFFFF)); |
|
|
|
nextSinglePulse = 2; |
|
|
|
} |
|
|
|
else if(((honaData.at(Ind) & 0xF0000000) == 0x20000000) && (nextSinglePulse == 2)) |
|
|
|
{ |
|
|
|
tempHonaPacketSinglePulse.setToa(tempHonaPacketSinglePulse.getToa() + |
|
|
|
((static_cast<qulonglong>(honaData.at(Ind) & |
|
|
|
0x0000FFFF)) << 28)); |
|
|
|
((static_cast<qulonglong>(honaData.at(Ind) & |
|
|
|
0x0000FFFF)) << 28)); |
|
|
|
tempHonaPacketSinglePulse.setPa2((honaData.at(Ind) & 0x0FFF0000) >> 16); |
|
|
|
nextSinglePulse = 3; |
|
|
|
} |
|
|
@ -859,9 +899,9 @@ quint32 HonaLowLevelAPI::hsruParserSinglePulse(const QVector<quint32>& honaData, |
|
|
|
{ |
|
|
|
tempHonaPacketSinglePulse.setPa1(honaData.at(Ind) & 0x0000FFFF); |
|
|
|
tempHonaPacketSinglePulse.setPa2(tempHonaPacketSinglePulse.getPa2() + |
|
|
|
((honaData.at(Ind) & 0x000F0000) >> 4)); //NOTE: shifted by 4
|
|
|
|
((honaData.at(Ind) & 0x000F0000) >> 4)); //NOTE: shifted by 4
|
|
|
|
tempHonaPacketSinglePulse.setPa3(tempHonaPacketSinglePulse.getPa3() + |
|
|
|
((honaData.at(Ind) & 0x00F00000) >> 8)); //NOTE: shifted by 8
|
|
|
|
((honaData.at(Ind) & 0x00F00000) >> 8)); //NOTE: shifted by 8
|
|
|
|
nextSinglePulse = 5; |
|
|
|
} |
|
|
|
else if(honaData.at(Ind) == 0xEEEEEEEE) |
|
|
@ -912,7 +952,10 @@ QVector<quint32> HonaLowLevelAPI::hsruReadHonaBuffer(honaReceivers receiver) |
|
|
|
else |
|
|
|
throw HonaException("honaReceivers is Not Valid"); |
|
|
|
|
|
|
|
plxWrapper.deviceReadMemory(address, honaData, honaData.size()); |
|
|
|
if(!plxWrapper.deviceReadMemory(address, honaData, honaData.size())) |
|
|
|
{ |
|
|
|
throw HonaAlreadyStartedException("DeviceReadMemory Doesnt Occur"); |
|
|
|
} |
|
|
|
|
|
|
|
return honaData; |
|
|
|
} |
|
|
|