Browse Source

get HonaLowLevelAPI.cpp qlonglong change

mehrabi
mehrabi 3 years ago
parent
commit
341959af6a
  1. 2
      Plx/include/LowLevel/HonaLowLevelAPI.h
  2. 18
      Plx/include/LowLevel/HonaPacket.h
  3. 72
      Plx/src/LowLevel/HonaLowLevelAPI.cpp
  4. 12
      Plx/src/LowLevel/HonaPacket.cpp

2
Plx/include/LowLevel/HonaLowLevelAPI.h

@ -74,7 +74,7 @@ private:
HonaPacket tempHonaPacketResS;
public:
qulonglong toaStartBoard = 0;
quint64 toaStartBoard = 0;
HonaLowLevelAPI(QObject* parent = nullptr);
~HonaLowLevelAPI()

18
Plx/include/LowLevel/HonaPacket.h

@ -13,15 +13,15 @@ private:
qreal toaClock;
honaPacketType m_PacketType;
quint32 m_PacketNumber;
qulonglong m_Toa;
quint64 m_Toa;
quint32 m_Doa;
quint32 m_Pa1;
quint32 m_Pa2;
quint32 m_Pa3;
quint32 m_Pa4;
quint32 m_Code;
qulonglong m_CodeL;
qulonglong m_CodeM;
quint64 m_CodeL;
quint64 m_CodeM;
quint8 m4Status;
public:
@ -33,8 +33,8 @@ public:
quint32 getPacketNumber();
void setPacketNumber(quint32 temp);
/******************************************************************/
qulonglong getToa();
void setToa(qulonglong temp);
quint64 getToa();
void setToa(quint64 temp);
/******************************************************************/
quint32 getDoa();
void setDoa(quint32 temp);
@ -54,11 +54,11 @@ public:
quint32 getCode();
void setCode(quint32 temp);
/******************************************************************/
quint32 getCodeL();
void setCodeL(quint32 temp);
quint64 getCodeL();
void setCodeL(quint64 temp);
/******************************************************************/
quint32 getCodeM();
void setCodeM(quint32 temp);
quint64 getCodeM();
void setCodeM(quint64 temp);
/******************************************************************/
quint8 getm4Status();
void setm4Status(quint8 temp);

72
Plx/src/LowLevel/HonaLowLevelAPI.cpp

@ -326,13 +326,13 @@ quint32 HonaLowLevelAPI::hsruParserInt123C(const QVector<quint32>& honaData,
}
else if(((honaData[Ind] & 0xF0000000) == 0x10000000) && (nextInt123C == 1))
{
tempHonaPacketInt123C.setToa(static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF));
tempHonaPacketInt123C.setToa(static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF));
nextInt123C = 2;
}
else if(((honaData[Ind] & 0xF0000000) == 0x20000000) && (nextInt123C == 2))
{
tempHonaPacketInt123C.setToa((tempHonaPacketInt123C.getToa()) +
(static_cast<qulonglong>(honaData[Ind] & 0x0000FFFF) <<
(static_cast<quint64>(honaData[Ind] & 0x0000FFFF) <<
28));
tempHonaPacketInt123C.setPa2((honaData[Ind] & 0x0FFF0000) >> 16);
@ -356,7 +356,7 @@ quint32 HonaLowLevelAPI::hsruParserInt123C(const QVector<quint32>& honaData,
else if(((honaData[Ind] & 0xF0000000) == 0x50000000) && (nextInt123C == 5))
{
tempHonaPacketInt123C.setCodeM(
(static_cast<qulonglong>(honaData[Ind] & 0x0000001F)) << 59);
(static_cast<quint64>(honaData[Ind] & 0x0000001F)) << 59);
tempHonaPacketInt123C.setCodeL(0);
nextInt123C = 6;
}
@ -400,13 +400,13 @@ quint32 HonaLowLevelAPI::hsruParserRes123C(const QVector<quint32>& honaData,
}
else if(((honaData[Ind] & 0xF0000000) == 0x10000000) && (nextRes123C == 1))
{
tempHonaPacketRes123C.setToa(static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF));
tempHonaPacketRes123C.setToa(static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF));
nextRes123C = 2;
}
else if(((honaData[Ind] & 0xF0000000) == 0x20000000) && (nextRes123C == 2))
{
tempHonaPacketRes123C.setToa(tempHonaPacketRes123C.getToa() +
((static_cast<qulonglong>(honaData[Ind] & 0x0000FFFF)) <<
((static_cast<quint64>(honaData[Ind] & 0x0000FFFF)) <<
28));
tempHonaPacketRes123C.setPa2((honaData[Ind] & 0x0FFF0000) >> 16);
nextRes123C = 3;
@ -430,7 +430,7 @@ quint32 HonaLowLevelAPI::hsruParserRes123C(const QVector<quint32>& honaData,
else if(((honaData[Ind] & 0xF0000000) == 0x50000000) && (nextRes123C == 5))
{
tempHonaPacketRes123C.setCodeM(
(static_cast<qulonglong>(honaData[Ind] & 0x00001FFF)) << 51);
(static_cast<quint64>(honaData[Ind] & 0x00001FFF)) << 51);
tempHonaPacketRes123C.setCodeL(0);
nextRes123C = 6;
@ -482,13 +482,13 @@ quint32 HonaLowLevelAPI::hsruParserIntS(const QVector<quint32>& honaData,
}
else if(((honaData[Ind] & 0xF0000000) == 0x10000000) && (nextIntS == 1))
{
tempHonaPacketIntS.setToa(static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF));
tempHonaPacketIntS.setToa(static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF));
nextIntS = 2;
}
else if(((honaData[Ind] & 0xF0000000) == 0x20000000) && (nextIntS == 2))
{
tempHonaPacketIntS.setToa(tempHonaPacketIntS.getToa() +
((static_cast<qulonglong>(honaData[Ind] & 0x0000FFFF)) <<
((static_cast<quint64>(honaData[Ind] & 0x0000FFFF)) <<
28));
tempHonaPacketIntS.setPa2((honaData[Ind] & 0x0FFF0000) >> 16);
nextIntS = 3;
@ -509,27 +509,37 @@ quint32 HonaLowLevelAPI::hsruParserIntS(const QVector<quint32>& honaData,
}
else if(((honaData[Ind] & 0xF0000000) == 0x50000000) && (nextIntS == 5))
{
tempHonaPacketIntS.setCodeM((static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF)) << 8);
tempHonaPacketIntS.setCodeM((static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF)) << 8);
tempHonaPacketIntS.setCodeL(0);
nextIntS = 6;
}
else if(((honaData[Ind] & 0xF0000000) == 0x60000000) && (nextIntS == 6))
{
tempHonaPacketIntS.setCodeM(tempHonaPacketIntS.getCodeM() +
<<<<<<< HEAD
((static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF)) << 36));
=======
(static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF)) <<
36);
>>>>>>> b4c9ce73b677efe5e06e4c2aaa524c112a0e9313
tempHonaPacketIntS.setCodeL(0);
nextIntS = 7;
}
else if(((honaData[Ind] & 0xF0000000) == 0x70000000) && (nextIntS == 7))
{
tempHonaPacketIntS.setCodeL(tempHonaPacketIntS.getCodeM());
tempHonaPacketIntS.setCodeM((static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF)) << 8);
tempHonaPacketIntS.setCodeM((static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF)) << 8);
nextIntS = 8;
}
else if(((honaData[Ind] & 0xF0000000) == 0x80000000) && (nextIntS == 8))
{
tempHonaPacketIntS.setCodeM(tempHonaPacketIntS.getCodeM() +
<<<<<<< HEAD
((static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF)) << 36));
=======
(static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF)) <<
36);
>>>>>>> b4c9ce73b677efe5e06e4c2aaa524c112a0e9313
nextIntS = 9;
}
@ -580,13 +590,13 @@ quint32 HonaLowLevelAPI::hsruParserResS(const QVector<quint32>& honaData,
}
else if(((honaData[Ind] & 0xF0000000) == 0x10000000) && (nextResS == 1))
{
tempHonaPacketResS.setToa(static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF));
tempHonaPacketResS.setToa(static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF));
nextResS = 2;
}
else if(((honaData[Ind] & 0xF0000000) == 0x20000000) && (nextResS == 2))
{
tempHonaPacketResS.setToa(tempHonaPacketResS.getToa() +
((static_cast<qulonglong>(honaData[Ind] & 0x0000FFFF)) <<
((static_cast<quint64>(honaData[Ind] & 0x0000FFFF)) <<
28));
tempHonaPacketResS.setPa2((honaData[Ind] & 0x0FFF0000) >> 16);
nextResS = 3;
@ -607,27 +617,37 @@ quint32 HonaLowLevelAPI::hsruParserResS(const QVector<quint32>& honaData,
}
else if(((honaData[Ind] & 0xF0000000) == 0x50000000) && (nextResS == 5))
{
tempHonaPacketResS.setCodeM((static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF)) << 8);
tempHonaPacketResS.setCodeM((static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF)) << 8);
tempHonaPacketResS.setCodeL(0);
nextResS = 6;
}
else if(((honaData[Ind] & 0xF0000000) == 0x60000000) && (nextResS == 6))
{
tempHonaPacketResS.setCodeM(tempHonaPacketResS.getCodeM() +
<<<<<<< HEAD
((static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF)) << 36));
=======
(static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF)) <<
36);
>>>>>>> b4c9ce73b677efe5e06e4c2aaa524c112a0e9313
tempHonaPacketResS.setCodeL(0);
nextResS = 7;
}
else if(((honaData[Ind] & 0xF0000000) == 0x70000000) && (nextResS == 7))
{
tempHonaPacketResS.setCodeL(tempHonaPacketResS.getCodeM());
tempHonaPacketResS.setCodeM((static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF)) << 8);
tempHonaPacketResS.setCodeM((static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF)) << 8);
nextResS = 8;
}
else if(((honaData[Ind] & 0xF0000000) == 0x80000000) && (nextResS == 8))
{
tempHonaPacketResS.setCodeM(tempHonaPacketResS.getCodeM() +
<<<<<<< HEAD
((static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF)) << 36));
=======
(static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF)) <<
36);
>>>>>>> b4c9ce73b677efe5e06e4c2aaa524c112a0e9313
nextResS = 9;
}
if(nextResS == packetLenResS)
@ -669,13 +689,13 @@ quint32 HonaLowLevelAPI::hsruParserInt4(const QVector<quint32>& honaData,
}
else if(((honaData[Ind] & 0xF0000000) == 0x10000000) && (nextInt4 == 1))
{
tempHonaPacketInt4.setToa(static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF));
tempHonaPacketInt4.setToa(static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF));
nextInt4 = 2;
}
else if(((honaData[Ind] & 0xF0000000) == 0x20000000) && (nextInt4 == 2))
{
tempHonaPacketInt4.setToa(tempHonaPacketInt4.getToa() +
((static_cast<qulonglong>(honaData[Ind] & 0x0000FFFF)) <<
((static_cast<quint64>(honaData[Ind] & 0x0000FFFF)) <<
28));
tempHonaPacketInt4.setPa2((honaData[Ind] & 0x0FFF0000) >> 16);
nextInt4 = 3;
@ -698,14 +718,14 @@ quint32 HonaLowLevelAPI::hsruParserInt4(const QVector<quint32>& honaData,
else if(((honaData[Ind] & 0xF0000000) == 0x50000000) && (nextInt4 == 5))
{
tempHonaPacketInt4.setCodeM(0);
tempHonaPacketInt4.setCodeL(static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF));
tempHonaPacketInt4.setCodeL(static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF));
nextInt4 = 6;
}
else if(((honaData[Ind] & 0xF0000000) == 0x60000000) && (nextInt4 == 6))
{
tempHonaPacketInt4.setPa4(honaData[Ind] & 0x0000FFFF);
tempHonaPacketInt4.setCodeL(tempHonaPacketInt4.getCodeL() +
((static_cast<qulonglong>(honaData[Ind] & 0x000F0000)) << 12));
((static_cast<quint64>(honaData[Ind] & 0x000F0000)) << 12));
tempHonaPacketInt4.setm4Status(static_cast<quint8>((honaData[Ind] & 0x0F000000) >> 20));
nextInt4 = 7;
}
@ -748,13 +768,13 @@ quint32 HonaLowLevelAPI::hsruParserRes4(const QVector<quint32>& honaData,
}
else if(((honaData[Ind] & 0xF0000000) == 0x10000000) && (nextRes4 == 1))
{
tempHonaPacketRes4.setToa((static_cast<qulonglong>(honaData[Ind] & 0x0FFFFFFF)));
tempHonaPacketRes4.setToa((static_cast<quint64>(honaData[Ind] & 0x0FFFFFFF)));
nextRes4 = 2;
}
else if(((honaData[Ind] & 0xF0000000) == 0x20000000) && (nextRes4 == 2))
{
tempHonaPacketRes4.setToa(tempHonaPacketRes4.getToa() +
(static_cast<qulonglong>(honaData[Ind] & 0x0000FFFF) <<
(static_cast<quint64>(honaData[Ind] & 0x0000FFFF) <<
28));
tempHonaPacketRes4.setPa2((honaData[Ind] & 0x0FFF0000) >> 16);
nextRes4 = 3;
@ -816,14 +836,14 @@ quint32 HonaLowLevelAPI::hsruParserSinglePulse(const QVector<quint32>& honaData,
}
else if(((honaData[Ind] & 0xF0000000) == 0x10000000) && (nextSinglePulse == 1))
{
tempHonaPacketSinglePulse.setToa(static_cast<qulonglong>(honaData[Ind] &
tempHonaPacketSinglePulse.setToa(static_cast<quint64>(honaData[Ind] &
0x0FFFFFFF));
nextSinglePulse = 2;
}
else if(((honaData[Ind] & 0xF0000000) == 0x20000000) && (nextSinglePulse == 2))
{
tempHonaPacketSinglePulse.setToa(tempHonaPacketSinglePulse.getToa() +
((static_cast<qulonglong>(honaData[Ind] &
((static_cast<quint64>(honaData[Ind] &
0x0000FFFF)) << 28));
tempHonaPacketSinglePulse.setPa2((honaData[Ind] & 0x0FFF0000) >> 16);
nextSinglePulse = 3;
@ -888,10 +908,10 @@ QVector<quint32> HonaLowLevelAPI::hsruReadHonaBuffer(honaReceivers receiver)
throw HonaException();
}
// qDebug() << " hsruReadHonaBuffer receiver "<< receiver;
// for(auto i = 0 ; i < 10; i++)
// qDebug() << "[" << i << "] " << "0x" << QString::number(honaData[i], 16);
// qDebug() << "------------------------------------------------------------";
// qDebug() << " hsruReadHonaBuffer receiver "<< receiver;
// for(auto i = 0 ; i < 10; i++)
// qDebug() << "[" << i << "] " << "0x" << QString::number(honaData[i], 16);
// qDebug() << "------------------------------------------------------------";
return honaData;
}

12
Plx/src/LowLevel/HonaPacket.cpp

@ -27,12 +27,12 @@ void HonaPacket::setPacketNumber(quint32 temp)
}
/*************************************************************************************************/
qulonglong HonaPacket::getToa()
quint64 HonaPacket::getToa()
{
return m_Toa;
}
void HonaPacket::setToa(qulonglong temp)
void HonaPacket::setToa(quint64 temp)
{
m_Toa = temp;
}
@ -104,23 +104,23 @@ void HonaPacket::setCode(quint32 temp)
}
/*************************************************************************************************/
quint32 HonaPacket::getCodeL()
quint64 HonaPacket::getCodeL()
{
return m_CodeL;
}
void HonaPacket::setCodeL(quint32 temp)
void HonaPacket::setCodeL(quint64 temp)
{
m_CodeL = temp;
}
/*************************************************************************************************/
quint32 HonaPacket::getCodeM()
quint64 HonaPacket::getCodeM()
{
return m_CodeM;
}
void HonaPacket::setCodeM(quint32 temp)
void HonaPacket::setCodeM(quint64 temp)
{
m_CodeM = temp;
}

Loading…
Cancel
Save