Browse Source

fix virtual function

master
Arash Aletayeb 4 years ago
parent
commit
b26d5eac62
  1. 0
      api.cpp
  2. 0
      api.h
  3. 3
      developHw.pro.user
  4. 31
      include/model/hardware/core/TrxBoard.h
  5. 12
      include/model/hardware/core/register/Register.h
  6. 49
      include/model/hardware/core/register/RegisterChain.h
  7. 6
      include/model/hardware/core/register/beamFormer/registerDefinition/AfeLut.h
  8. 7
      include/model/hardware/core/register/beamFormer/registerDefinition/ApodizationLut.h
  9. 7
      include/model/hardware/core/register/beamFormer/registerDefinition/ElementPositionLut.h
  10. 8
      include/model/hardware/core/register/beamFormer/registerDefinition/PulseLut.h
  11. 7
      include/model/hardware/core/register/beamFormer/registerDefinition/RxBeamformerLut.h
  12. 22
      include/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h
  13. 17
      include/model/hardware/core/register/bpiFlash/registerDefinition/McsRdWr.h
  14. 7
      include/model/hardware/core/register/builtInTest/registerDefinition/BiteDacMemory.h
  15. 7
      include/model/hardware/core/register/dsp/registerDefinition/AtgcLut.h
  16. 7
      include/model/hardware/core/register/dsp/registerDefinition/BlendWeight.h
  17. 7
      include/model/hardware/core/register/dsp/registerDefinition/DtgcLut.h
  18. 7
      include/model/hardware/core/register/dsp/registerDefinition/FrequencyLut.h
  19. 7
      include/model/hardware/core/register/dsp/registerDefinition/LineFilterCoefficient.h
  20. 7
      include/model/hardware/core/register/dsp/registerDefinition/LpfLut.h
  21. 7
      include/model/hardware/core/register/dsp/registerDefinition/ReceiverConfigurationLut.h
  22. 7
      include/model/hardware/core/register/dsp/registerDefinition/StbCoefficient.h
  23. 2
      include/model/hardware/core/register/fpgaProgram/FpgaProgram.h
  24. 296
      mainwindow.cpp
  25. 13
      mainwindow.h
  26. 370
      mainwindow.ui
  27. 79
      src/model/hardware/core/TrxBoard.cpp
  28. 11
      src/model/hardware/core/register/Register.cpp
  29. 104
      src/model/hardware/core/register/RegisterChain.cpp
  30. 31
      src/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.cpp
  31. 12
      src/model/hardware/core/register/fpgaProgram/FpgaProgram.cpp

0
api.cpp

0
api.h

3
developHw.pro.user

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.10.0, 2021-05-02T18:31:07. -->
<!-- Written by QtCreator 4.10.0, 2021-05-03T19:45:33. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@ -314,7 +314,6 @@
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseTerminal">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/hasis/Desktop/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Debug</value>
</valuemap>

31
include/model/hardware/core/TrxBoard.h

@ -3,6 +3,7 @@
#include <QVector>
#include <QString>
#include <QByteArray>
#include <QDebug>
#include "model/hardware/core/register/clockDistributer/ClockDistributer.h"
@ -50,6 +51,22 @@ enum eSelectProbe : quint8
prbD,
};
struct ConnectedPrbId
{
quint32 prbA;
quint32 prbB;
quint32 prbC;
quint32 prbD;
};
struct ConnectedPrbInfo
{
QByteArray prbA;
QByteArray prbB;
QByteArray prbC;
QByteArray prbD;
};
class TrxBoard
{
private:
@ -124,10 +141,10 @@ public:
void setBeamFormerMode (eClkMode mode) const;
/////////////////////////////// Scenario Player API ////////////////////////////
void setScenPlayerIndex (quint32& startIdx, quint32& endIdx) const;
void scenPlayerStart (bool start) const;
void scenPlayerPause (bool pause) const;
void scenPlayerStop (bool stop) const;
void setScenPlayerIndex (quint32 startIdx, quint32 endIdx) const;
void scenPlayerStart (void) const;
//void scenPlayerPause (bool pause) const;
void scenPlayerStop (void) const;
///////////////////////////////// Sram Fill API ////////////////////////////////
void sramWrite(QList<quint64>& data, quint32 offsetAddr);
@ -145,13 +162,13 @@ public:
quint32 mpsId (void) const;
quint32 prbCtrlId (void) const;
quint32 prbId (quint8 prbSel) const;
QList<quint32> getConnectedPrbId (void) const;
void getConnectedPrbId (ConnectedPrbId* prbId) const;
QString trxInfo (void) const;
QString mpsInfo (void) const;
QString prbCtrlInfo (void) const;
QString prbInfo (quint8 prbSel) const;
QList<QString> getConnectedPrbInfo (void) const;
QByteArray prbInfo (quint8 prbSel) const;
void getConnectedPrbInfo (ConnectedPrbInfo* prbInfo) const;
void supervisorRbValue(SupervisorRbValue* sValue) const;
void mpsFaultStatus (MpsFaultStatus* faultStatus) const;

12
include/model/hardware/core/register/Register.h

@ -6,9 +6,9 @@
class Register
{
//private:
// virtual void prepareData(quint32 index);
// virtual void receiveData(void);
private:
virtual void prepareData(quint32){}
virtual void receiveData(void){}
protected:
quint32 _bar;
@ -16,7 +16,6 @@ protected:
quint32 _baseOffset;
quint32 _arrayLength;
quint8 _arrayDepth;
quint32 _value;
@ -27,9 +26,8 @@ protected:
SonoDevice* _device;
public:
//Register(quint8 bar, quint32 offset, SonoDevice* device, quint32 arrayLength=0); // Constructor for general Registers: single and array
Register(quint8 bar, quint32 offset, SonoDevice* device);
~Register();
Register(quint8 bar, quint32 offset, SonoDevice* device, quint32 arrayLength=0); // Constructor for general Registers: single and array
virtual ~Register();
quint32 getValue();
void setValue(quint32 value);

49
include/model/hardware/core/register/RegisterChain.h

@ -1,49 +0,0 @@
#ifndef REGISTERCHAIN_H
#define REGISTERCHAIN_H
#include "model/hardware/core/register/Field.h"
#include "model/hardware/device/SonoDevice.h"
class RegisterChain
{
private:
virtual void prepareData(quint32 index)=0;
//virtual void receiveData(void);
protected:
quint32 _bar;
quint32 _offset;
quint32 _baseOffset;
quint32 _arrayLength;
quint8 _arrayDepth;
quint32 _value;
bool _isUpdated;
QList<Field*> _fields;
SonoDevice* _device;
public:
RegisterChain(quint8 bar, quint32 offset, SonoDevice* device, quint32 arrayLength); // Constructor for general Registers: single and array
virtual ~RegisterChain();
quint32 getValue();
void setValue(quint32 value);
void changeOffset(quint32 offset);
quint32 getCurrentOffset (void) const;
bool isUpdated();
void update();
void upadteArray();
void sync();
void syncArray();
};
#endif // REGISTERCHAIN_H

6
include/model/hardware/core/register/beamFormer/registerDefinition/AfeLut.h

@ -1,7 +1,7 @@
#ifndef AFELUT_H
#define AFELUT_H
#include "model/hardware/core/register/RegisterChain.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -41,7 +41,7 @@ struct AfeProperties
QList<quint32> lnaHpfProg;
};
class AfeLut : public RegisterChain
class AfeLut : public Register
{
private:
AfeProperties* _AfeLut;
@ -104,7 +104,7 @@ public:
_AfeLut = AfeLut;
}
AfeLut(SonoDevice* device, quint32 offset) : RegisterChain(BAR, OFFSET+offset, device, LENGTH)
AfeLut(SonoDevice* device, quint32 offset) : Register(BAR, OFFSET+offset, device, LENGTH)
{
ADD_UNSIGNED_FIELD(lpfProgPrp, LPF_PROG_PRP_MASK);
ADD_UNSIGNED_FIELD(pgaHpfDisPrp, PGA_HPF_DIS_PRP_MASK);

7
include/model/hardware/core/register/beamFormer/registerDefinition/ApodizationLut.h

@ -1,8 +1,7 @@
#ifndef APODIZATIONLUT_H
#define APODIZATIONLUT_H
//#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegisterChain.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -13,7 +12,7 @@
#define OFFSET 0x4C0000
#define LENGTH 3057U
class ApodizationLut : public RegisterChain
class ApodizationLut : public Register
{
private:
QList<quint32> _apodization;
@ -32,7 +31,7 @@ public:
_apodization = apodization;
}
ApodizationLut(SonoDevice* device, quint32 offset) : RegisterChain(BAR, OFFSET+offset, device, LENGTH)
ApodizationLut(SonoDevice* device, quint32 offset) : Register(BAR, OFFSET+offset, device, LENGTH)
{
ADD_UNSIGNED_FIELD(apodizationPrp, APODIZATION_PRP_MASK);
}

7
include/model/hardware/core/register/beamFormer/registerDefinition/ElementPositionLut.h

@ -1,8 +1,7 @@
#ifndef ELEMENTPOSITIONLUT_H
#define ELEMENTPOSITIONLUT_H
//#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegisterChain.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -13,7 +12,7 @@
#define OFFSET 0X484000
#define LENGTH 64U
class ElementPositionLut : public RegisterChain
class ElementPositionLut : public Register
{
private:
QList<quint32> _elementPosition;
@ -31,7 +30,7 @@ public:
_elementPosition = elementPosition;
}
ElementPositionLut(SonoDevice* device, quint32 offset) : RegisterChain(BAR, OFFSET+offset, device, LENGTH)
ElementPositionLut(SonoDevice* device, quint32 offset) : Register(BAR, OFFSET+offset, device, LENGTH)
{
ADD_UNSIGNED_FIELD(elementPositionPrp, ELEMENT_POSITION_PRP_MASK);
}

8
include/model/hardware/core/register/beamFormer/registerDefinition/PulseLut.h

@ -1,8 +1,8 @@
#ifndef PULSELUT_H
#define PULSELUT_H
#include "model/hardware/core/register/RegisterChain.h"
//#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -26,7 +26,7 @@ struct PulseProperties
QList<quint32> dampingPulseWidth;
};
class PulseLut : public RegisterChain
class PulseLut : public Register
{
private:
PulseProperties* _pulseLut;
@ -60,7 +60,7 @@ public:
_pulseLut = pulseLut;
}
PulseLut(SonoDevice* device, quint32 offset) : RegisterChain(BAR, OFFSET+offset, device, LENGTH)
PulseLut(SonoDevice* device, quint32 offset) : Register(BAR, OFFSET+offset, device, LENGTH)
{
ADD_UNSIGNED_FIELD(halfPeriodPrp, HALF_PERIOD_PRP_MASK);
ADD_UNSIGNED_FIELD(halfCycleNoPrp, HALF_CYCLE_NO_PRP_MASK);

7
include/model/hardware/core/register/beamFormer/registerDefinition/RxBeamformerLut.h

@ -1,8 +1,7 @@
#ifndef RXBEAMFORMERLUT_H
#define RXBEAMFORMERLUT_H
#include "model/hardware/core/register/RegisterChain.h"
//#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -22,7 +21,7 @@ struct RxBeamformerProperties
QList<quint32> mla;
};
class RxBeamformerLut : public RegisterChain
class RxBeamformerLut : public Register
{
private:
RxBeamformerProperties* _rxBfLut;
@ -46,7 +45,7 @@ public:
_rxBfLut = rxBfLut;
}
RxBeamformerLut(SonoDevice* device, quint32 offset) : RegisterChain(BAR, OFFSET+offset, device, LENGTH)
RxBeamformerLut(SonoDevice* device, quint32 offset) : Register(BAR, OFFSET+offset, device, LENGTH)
{
ADD_UNSIGNED_FIELD(lagPrp, LAG_PRP_MASK);
ADD_UNSIGNED_FIELD(apodizationSelPrp, APODIZATION_SEL_PRP_MASK);

22
include/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h

@ -4,7 +4,7 @@
#include <QObject>
#include <QDebug>
#include <QTimer>
#include <QString>
#include <QByteArray>
#include "registerDefinition/BoardsSpecs.h"
#define TRX_ROM_MAX_LEN 131072U
@ -114,7 +114,7 @@ private:
struct EepromReq
{
quint32 dataIn;
qint32 dataIn;
quint32 address;
quint32 probeSelect;
}*_rom;
@ -159,7 +159,7 @@ private:
QTimer* _timer;
template<class T1, class T2>
void eepromWrite (QString& str, quint32 addr, quint8 prbSel, T1* request, T2* status);
void eepromWrite (QByteArray& arr, quint32 addr, quint8 prbSel, T1* request, T2* status);
template<class T3>
void setEepromWrite (EepromReq* _rom, T3* request);
@ -229,10 +229,10 @@ private:
void setSetupCmdDacsOnOff(bool cwd, bool hvb, bool hva) const;
void setMpsDacsValue (MpsDacs* _mpsDacs) const;
friend void trxEepromWrite(QString str, quint32 address, BoardsCtrlMngt* boards);
friend void mpsEepromWrite(QString str, quint32 address, BoardsCtrlMngt* boards);
friend void prbCtrlEepromWrite (QString str, quint32 address, BoardsCtrlMngt* boards);
friend void prbEepromWrite (QString str, quint32 address, quint8 prbSel, BoardsCtrlMngt* boards);
friend void trxEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards);
friend void mpsEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards);
friend void prbCtrlEepromWrite (QByteArray arr, quint32 address, BoardsCtrlMngt* boards);
friend void prbEepromWrite (QByteArray arr, quint32 address, quint8 prbSel, BoardsCtrlMngt* boards);
void timerShot (quint16 ms) const;
void timerStop (void) const;
@ -281,9 +281,9 @@ public:
};
void trxEepromWrite (QString str, quint32 address, BoardsCtrlMngt* boards);
void mpsEepromWrite (QString str, quint32 address, BoardsCtrlMngt* boards);
void prbCtrlEepromWrite (QString str, quint32 address, BoardsCtrlMngt* boards);
void prbEepromWrite (QString str, quint32 address, quint8 prbSel, BoardsCtrlMngt* boards);
void trxEepromWrite (QByteArray arr, quint32 address, BoardsCtrlMngt* boards);
void mpsEepromWrite (QByteArray arr, quint32 address, BoardsCtrlMngt* boards);
void prbCtrlEepromWrite (QByteArray arr, quint32 address, BoardsCtrlMngt* boards);
void prbEepromWrite (QByteArray arr, quint32 address, quint8 prbSel, BoardsCtrlMngt* boards);
#endif // BOARDSCTRLMNGT_H

17
include/model/hardware/core/register/bpiFlash/registerDefinition/McsRdWr.h

@ -1,8 +1,7 @@
#ifndef MCSRDWR_H
#define MCSRDWR_H
#include "model/hardware/core/register/RegisterChain.h"
//#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -13,14 +12,14 @@
#define OFFSET 0X8000000
#define MCS_FILE_SIZE 27*1024*1024 // now and must be modified
class McsRdWr : public RegisterChain
class McsRdWr : public Register
{
private:
QList<quint32> _mcsListWr;
void prepareData(quint32 index) override
{
masterMcsData->setValue(_mcsListWr.at(static_cast<qint32>(index)));
masterMcsData->setValue(_mcsListWr[static_cast<qint32>(index)]);
}
public:
@ -31,12 +30,12 @@ public:
_mcsListWr = mcsList;
}
//void receiveData (void) override
// {
// mcsListRd.append(masterMcsData->getValue());
// }
void receiveData (void) override
{
mcsListRd.append(masterMcsData->getValue());
}
McsRdWr(SonoDevice* device) : RegisterChain(BAR, OFFSET, device, MCS_FILE_SIZE)
McsRdWr(SonoDevice* device) : Register(BAR, OFFSET, device, MCS_FILE_SIZE)
{
ADD_UNSIGNED_FIELD(masterMcsData, MASTER_MCS_DATA_MASK);
}

7
include/model/hardware/core/register/builtInTest/registerDefinition/BiteDacMemory.h

@ -1,8 +1,7 @@
#ifndef BITEDACMEMORY_H
#define BITEDACMEMORY_H
#include "model/hardware/core/register/RegisterChain.h"
//#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -21,7 +20,7 @@ struct TxDacMemory
};
class BiteDacMemory : public RegisterChain
class BiteDacMemory : public Register
{
private:
TxDacMemory* _txDacMem;
@ -40,7 +39,7 @@ public:
_txDacMem = txDacMem;
}
BiteDacMemory(SonoDevice* device) : RegisterChain(BAR, OFFSET, device, LENGTH)
BiteDacMemory(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH)
{
ADD_UNSIGNED_FIELD(txDacIData, TxDAC_I_DATA_MASK);
ADD_UNSIGNED_FIELD(txDacQData, TxDAC_Q_DATA_MASK);

7
include/model/hardware/core/register/dsp/registerDefinition/AtgcLut.h

@ -1,8 +1,7 @@
#ifndef ATGCLUT_H
#define ATGCLUT_H
#include "model/hardware/core/register/RegisterChain.h"
//#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -13,7 +12,7 @@
#define OFFSET 0x85000
#define LENGTH 256U
class AtgcLut : public RegisterChain
class AtgcLut : public Register
{
private:
QList<quint32> _atgcLut;
@ -30,7 +29,7 @@ public:
_atgcLut = atgcLut;
}
AtgcLut(SonoDevice* device) : RegisterChain(BAR, OFFSET, device, LENGTH)
AtgcLut(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH)
{
ADD_UNSIGNED_FIELD(atgcLut, ATGC_LUT_MASK);
}

7
include/model/hardware/core/register/dsp/registerDefinition/BlendWeight.h

@ -1,8 +1,7 @@
#ifndef BLENDWEIGHT_H
#define BLENDWEIGHT_H
#include "model/hardware/core/register/RegisterChain.h"
//#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -13,7 +12,7 @@
#define OFFSET 0x82000
#define LENGTH 512U
class BlendWeight : public RegisterChain
class BlendWeight : public Register
{
private:
QList<quint32> _blendWeight;
@ -30,7 +29,7 @@ public:
_blendWeight = blendWeight;
}
BlendWeight(SonoDevice* device) : RegisterChain(BAR, OFFSET, device, LENGTH)
BlendWeight(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH)
{
ADD_UNSIGNED_FIELD(blendWeight, BLEND_WEIGHT_MASK);
}

7
include/model/hardware/core/register/dsp/registerDefinition/DtgcLut.h

@ -1,8 +1,7 @@
#ifndef DTGCLUT_H
#define DTGCLUT_H
#include "model/hardware/core/register/RegisterChain.h"
//#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -13,7 +12,7 @@
#define OFFSET 0X84000
#define LENGTH 1024U
class DtgcLut : public RegisterChain
class DtgcLut : public Register
{
private:
QList<quint32> _dtLut;
@ -30,7 +29,7 @@ public:
_dtLut = dtLut;
}
DtgcLut(SonoDevice* device) : RegisterChain(BAR, OFFSET, device, LENGTH)
DtgcLut(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH)
{
ADD_UNSIGNED_FIELD(dtgcLut, DTGC_LUT_MASK);
}

7
include/model/hardware/core/register/dsp/registerDefinition/FrequencyLut.h

@ -1,8 +1,7 @@
#ifndef FREQUENCYLUT_H
#define FREQUENCYLUT_H
#include "model/hardware/core/register/RegisterChain.h"
//#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -13,7 +12,7 @@
#define OFFSET 0X80800
#define LENGTH 8U
class FrequencyLut : public RegisterChain
class FrequencyLut : public Register
{
private:
QList<quint32> _fLut;
@ -30,7 +29,7 @@ public:
_fLut = fLut;
}
FrequencyLut(SonoDevice* device) : RegisterChain(BAR, OFFSET, device, LENGTH)
FrequencyLut(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH)
{
ADD_UNSIGNED_FIELD(freqLut, FREQ_LUT_MASK);
}

7
include/model/hardware/core/register/dsp/registerDefinition/LineFilterCoefficient.h

@ -1,8 +1,7 @@
#ifndef LINEFILTERCOEFFICIENT_H
#define LINEFILTERCOEFFICIENT_H
#include "model/hardware/core/register/RegisterChain.h"
//#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -14,7 +13,7 @@
#define OFFSET 0x86010
#define LENGTH 2U // 4/2
class LineFilterCoefficient : public RegisterChain
class LineFilterCoefficient : public Register
{
private:
QList<quint32> _lineFilterLut;
@ -33,7 +32,7 @@ public:
_lineFilterLut = lineFilterLut;
}
LineFilterCoefficient(SonoDevice* device) : RegisterChain(BAR, OFFSET, device, LENGTH)
LineFilterCoefficient(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH)
{
ADD_UNSIGNED_FIELD(lineFilterLutEven, LINE_FILTER_LUT_EVEN_MASK);
ADD_UNSIGNED_FIELD(lineFilterLutOdd , LINE_FILTER_LUT_ODD_MASK );

7
include/model/hardware/core/register/dsp/registerDefinition/LpfLut.h

@ -1,8 +1,7 @@
#ifndef LPFLUT_H
#define LPFLUT_H
#include "model/hardware/core/register/RegisterChain.h"
//#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -13,7 +12,7 @@
#define OFFSET 0x81000
#define LENGTH 48U
class LpfLut : public RegisterChain
class LpfLut : public Register
{
private:
QList<quint32> _lpfLut;
@ -30,7 +29,7 @@ public:
_lpfLut = lpfLut;
}
LpfLut(SonoDevice* device) : RegisterChain(BAR, OFFSET, device, LENGTH)
LpfLut(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH)
{
ADD_UNSIGNED_FIELD(lpfLut, LPF_LUT_MASK);
}

7
include/model/hardware/core/register/dsp/registerDefinition/ReceiverConfigurationLut.h

@ -1,8 +1,7 @@
#ifndef RECEIVERCONFIGURATIONLUT_H
#define RECEIVERCONFIGURATIONLUT_H
#include "model/hardware/core/register/RegisterChain.h"
//#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -46,7 +45,7 @@ struct ReceiverConfiguration
QList<bool> dpeEn;
};
class ReceiverConfigurationLut : public RegisterChain
class ReceiverConfigurationLut : public Register
{
private:
ReceiverConfiguration* _configLut;
@ -116,7 +115,7 @@ public:
_configLut = configLut;
}
ReceiverConfigurationLut(SonoDevice* device) : RegisterChain(BAR, OFFSET, device, LENGTH)
ReceiverConfigurationLut(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH)
{
ADD_UNSIGNED_FIELD(mlaPrp, MLA_PRP_MASK);
ADD_UNSIGNED_FIELD(lineModePrp, LINE_MODE_PRP_MASK);

7
include/model/hardware/core/register/dsp/registerDefinition/StbCoefficient.h

@ -1,8 +1,7 @@
#ifndef STBCOEFFICIENT_H
#define STBCOEFFICIENT_H
#include "model/hardware/core/register/RegisterChain.h"
//#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
@ -14,7 +13,7 @@
#define OFFSET 0x86000
#define LENGTH 4U // 8/2
class StbCoefficient : public RegisterChain
class StbCoefficient : public Register
{
private:
QList<quint32> _stbLut;
@ -33,7 +32,7 @@ public:
_stbLut = stbLut;
}
StbCoefficient(SonoDevice* device) : RegisterChain(BAR, OFFSET, device, LENGTH)
StbCoefficient(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH)
{
ADD_UNSIGNED_FIELD(stbLutEven, STB_LUT_EVEN_MASK);
ADD_UNSIGNED_FIELD(stbLutOdd , STB_LUT_ODD_MASK );

2
include/model/hardware/core/register/fpgaProgram/FpgaProgram.h

@ -4,6 +4,8 @@
#include <QDataStream>
#include <QDebug>
#include <QByteArray>
#include <QProgressDialog>
#include "registerDefinition/SlaveFpgaNumber.h"
#include "registerDefinition/SerialProgramData.h"
#include "registerDefinition/SerialProgramStatus.h"

296
mainwindow.cpp

@ -17,6 +17,9 @@ MainWindow::MainWindow(QWidget *parent)
_healStatus = new HealthStatus;
_rxBfPrp = new RxBeamformerProperties;
_bCtrl = new BoardsCtrlMngt (_usd->device);
_supRbValue = new SupervisorRbValue;
_faultStatus = new MpsFaultStatus;
// _dial = new WaitDialog();
// _dial->setModal(true);
@ -76,19 +79,19 @@ MainWindow::MainWindow(QWidget *parent)
// ui->btn_txDacStartStop->setText(START);
// ui->btn_txDacOnOff->setText(ON);
// ui->btn_HVOnOff->setText(HV_ON);
ui->btn_motorOnOff->setText(MOTOR_ON);
ui->btn_pwr1OnOff->setText(PWR1_ON);
ui->btn_pwr2OnOff->setText(PWR2_ON);
ui->btn_pwr3OnOff->setText(PWR3_ON);
ui->btn_pwr4OnOff->setText(PWR4_ON);
// ui->btn_motorOnOff->setText(MOTOR_ON);
// ui->btn_pwr1OnOff->setText(PWR1_ON);
// ui->btn_pwr2OnOff->setText(PWR2_ON);
// ui->btn_pwr3OnOff->setText(PWR3_ON);
// ui->btn_pwr4OnOff->setText(PWR4_ON);
ui->btn_pllClkSt->setText(ON);
ui->btn_pllClkTps->setText(ON);
//ui->btn_mulDacTrig->setText(TRIG_ON);
ui->btn_thsdStateUpdate->setText(THSD_State_Update);
ui->btn_pwrDacsEnable->setText(VALID);
// ui->btn_pwrDacsEnable->setText(VALID);
ui->btn_hvRegulatorConfig->setText(ENABLE);
ui->btn_pm5RegulatorConfig->setText(ENABLE);
ui->btn_DacsOnOff->setText(DACS_ENABLE);
// ui->btn_DacsOnOff->setText(DACS_ENABLE);
ui->btn_updateRdbackValue->setText(UPDATE);
// ui->btn_dmaStart_2->setText(START);
// ui->btn_dmaStop_2->setVisible(false);
@ -1143,6 +1146,43 @@ void MainWindow::newMessage(QString message)
// }
//}
void MainWindow::on_btn_scenStart_clicked()
{
try
{
auto startIndex = ui->tb_startIdx->text().toUInt(Q_NULLPTR, 16);
if(startIndex == 0 && ui->tb_startIdx->text() != "0")
{
MESSAGE_BOX("Invalid input format for start index");
return;
}
auto endIndex = ui->tb_endIdx->text().toUInt(Q_NULLPTR, 16);
if(endIndex == 0 && ui->tb_endIdx->text() != "0")
{
MESSAGE_BOX("Invalid input format for stop index");
return;
}
auto str = ui->btn_scenStart->text();
if(str == "Scenario Start")
{
_trx.setScenPlayerIndex(startIndex, endIndex);
_trx.scenPlayerStart();
ui->btn_scenStart->setText("Scenario Stop");
}
else
{
_trx.scenPlayerStop();
ui->btn_scenStart->setText("Scenario Start");
}
}
catch(SonoException& e)
{
qDebug(e.what());
}
}
///*************************************************************************************************/
//void MainWindow::on_btn_scenarioPauseResume_clicked()
//{
@ -1169,6 +1209,7 @@ void MainWindow::newMessage(QString message)
// }
//}
///*************************************************************************************************/
//void MainWindow::on_btn_txDacBrowse_clicked()
//{
@ -1865,8 +1906,6 @@ const QString MainWindow::enum2String(ePg state) const
//// pwr.setDAcs(true, cwdValue, hvbValue, hvaValue);
//// pwr.setDAcs(false, cwdValue, hvbValue, hvaValue);
// _trx.mpsSetAo(hvaValue, hvbValue);
//// i2cDone=pwr.getI2cCmdDone();
//// while (i2cDone==false){
//// i2cDone=pwr.getI2cCmdDone();
@ -1879,6 +1918,14 @@ const QString MainWindow::enum2String(ePg state) const
//// ui->tb_cwdDacValue->setText(QString::number(real_CWdValue, 'f', 2));
//}
void MainWindow::on_btn_setAo_clicked()
{
auto hvaValue=ui->tb_hvaDacValue->text().toFloat(Q_NULLPTR);
auto hvbValue=ui->tb_hvbDacValue->text().toFloat(Q_NULLPTR);
//auto cwdValue=ui->tb_cwdDacValue->text().toFloat(Q_NULLPTR);
_trx.mpsSetAo(hvaValue, hvbValue);
}
///*************************************************************************************************/
//void MainWindow::on_btn_DacsOnOff_clicked()
//{
@ -1923,295 +1970,293 @@ const QString MainWindow::enum2String(ePg state) const
//}
///*************************************************************************************************/
//void MainWindow::on_chk_sup24v_stateChanged(int arg1)
//{
// bool i2cBusy, i2cDone;
//// i2cBusy=pwr.getI2cBusy();
//// while (i2cBusy==true) {
//// i2cBusy=pwr.getI2cBusy();
//// }
// if (ui->chk_sup24v->isChecked())
// {
//// i2cBusy=pwr.getI2cBusy();
//// while (i2cBusy==true) {
//// i2cBusy=pwr.getI2cBusy();
//// }
//// // delay (100);
// _trx.init(); // p24_On
//// i2cDone=pwr.getI2cCmdDone();
//// while (i2cDone==false){
//// i2cDone=pwr.getI2cCmdDone();
//// }
// }
// else
// {
//// i2cBusy=pwr.getI2cBusy();
//// while (i2cBusy==true) {
//// i2cBusy=pwr.getI2cBusy();
//// }
//// // delay (100);
//// pwr.setSetupCmdP24vOnOff(false); // p24_Off
//// i2cDone=pwr.getI2cCmdDone();
//// while (i2cDone==false){
//// i2cDone=pwr.getI2cCmdDone();
//// }
// }
void MainWindow::on_chk_initBoards_clicked()
{
// bool i2cBusy, i2cDone;
// i2cBusy=pwr.getI2cBusy();
// while (i2cBusy==true) {
// i2cBusy=pwr.getI2cBusy();
// }
//}
if (ui->chk_initBoards->isChecked())
{
// i2cBusy=pwr.getI2cBusy();
// while (i2cBusy==true) {
// i2cBusy=pwr.getI2cBusy();
// }
// // delay (100);
_trx.init(); // p24_On
// i2cDone=pwr.getI2cCmdDone();
// while (i2cDone==false){
// i2cDone=pwr.getI2cCmdDone();
// }
}
else
{
// i2cBusy=pwr.getI2cBusy();
// while (i2cBusy==true) {
// i2cBusy=pwr.getI2cBusy();
// }
// // delay (100);
// pwr.setSetupCmdP24vOnOff(false); // p24_Off
// i2cDone=pwr.getI2cCmdDone();
// while (i2cDone==false){
// i2cDone=pwr.getI2cCmdDone();
// }
}
}
///*************************************************************************************************/
//void MainWindow::on_btn_supJump_clicked()
//{
//// bool i2cBusy, i2cDone;
void MainWindow::on_btn_supJump_clicked()
{
// bool i2cBusy, i2cDone;
//// i2cBusy=pwr.getI2cBusy();
//// while (i2cBusy==true) {
//// i2cBusy=pwr.getI2cBusy();
//// }
// i2cBusy=pwr.getI2cBusy();
// while (i2cBusy==true) {
// i2cBusy=pwr.getI2cBusy();
// }
//// pwr.setSetupCmdJmp(true); // jump
//// pwr.setSetupCmdJmp(false);
// pwr.setSetupCmdJmp(true); // jump
// pwr.setSetupCmdJmp(false);
//// i2cDone=pwr.getI2cCmdDone();
//// while (i2cDone==false){
//// i2cDone=pwr.getI2cCmdDone();
//// }
// _trx.mpsReset();
//}
// i2cDone=pwr.getI2cCmdDone();
// while (i2cDone==false){
// i2cDone=pwr.getI2cCmdDone();
// }
_trx.mpsReset();
}
/*************************************************************************************************/
void MainWindow::on_btn_updateRdbackValue_clicked()
{
_trx.supervisorRbValue(supRbValue);
_trx.supervisorRbValue(_supRbValue);
auto hvapValue=supRbValue->hvap;
auto hvapValue=_supRbValue->hvap;
ui->l_hvap->setText(QString::number(hvapValue, 'f', 3));
delay(10);
auto hvbpValue=supRbValue->hvbp;
auto hvbpValue=_supRbValue->hvbp;
ui->l_hvbp->setText(QString::number(hvbpValue, 'f', 3));
delay(10);
auto cwdpValue=supRbValue->cwdp;
auto cwdpValue=_supRbValue->cwdp;
ui->l_cwdp->setText(QString::number(cwdpValue, 'f', 3));
delay(10);
auto curr24vValue=supRbValue->curr24V;
auto curr24vValue=_supRbValue->curr24V;
ui->l_curr24v->setText(QString::number(curr24vValue, 'f', 3));
delay(10);
auto p24vValue=supRbValue->p24V;
auto p24vValue=_supRbValue->p24V;
ui->l_p24v->setText(QString::number(p24vValue, 'f', 3));
delay(10);
auto p12vValue=supRbValue->p12V;
auto p12vValue=_supRbValue->p12V;
ui->l_p12v->setText(QString::number(p12vValue, 'f', 3));
delay(10);
auto p5vValue=supRbValue->p5V;
auto p5vValue=_supRbValue->p5V;
ui->l_p5v->setText(QString::number(p5vValue, 'f', 3));
delay(10);
auto m5vValue=supRbValue->m5V;
auto m5vValue=_supRbValue->m5V;
ui->l_m5v->setText(QString::number(m5vValue, 'f', 3));
delay(10);
auto hvStopValue=supRbValue->hvStop;
auto hvStopValue=_supRbValue->hvStop;
ui->l_hvStop->setText(QString::number(hvStopValue, 'f', 3));
delay(10);
auto p4dValue=supRbValue->p4D;
auto p4dValue=_supRbValue->p4D;
ui->l_p4d->setText(QString::number(p4dValue, 'f', 3));
delay(10);
/********************Faults***********************/
_trx.mpsFaultStatus(faultStatus);
_trx.mpsFaultStatus(_faultStatus);
bool hvapFlt=faultStatus->hvap;
bool hvapFlt=_faultStatus->hvap;
ui->l_hvapFlt->setText(QVariant(hvapFlt).toString());
auto colorHvapFlt = hvapFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_hvapFlt, colorHvapFlt);
delay(10);
bool hvbpFlt=faultStatus->hvbp;
bool hvbpFlt=_faultStatus->hvbp;
ui->l_hvbpFlt->setText(QVariant(hvbpFlt).toString());
auto colorHvbpFlt = hvbpFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_hvbpFlt, colorHvbpFlt);
delay(10);
bool cwdpFlt=faultStatus->cwdp;
bool cwdpFlt=_faultStatus->cwdp;
ui->l_cwdFlt->setText(QVariant(cwdpFlt).toString());
auto colorCwdpFlt = cwdpFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_cwdFlt, colorCwdpFlt);
delay(10);
bool cur24vFlt=faultStatus->curr24V;
bool cur24vFlt=_faultStatus->curr24V;
ui->l_curr24vFlt->setText(QVariant(cur24vFlt).toString());
auto colorCur24vFlt = cur24vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_curr24vFlt, colorCur24vFlt);
delay(10);
bool p24vFlt=faultStatus->p24v;
bool p24vFlt=_faultStatus->p24v;
ui->l_p24vFlt->setText(QVariant(p24vFlt).toString());
auto colorP24vFlt = p24vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_p24vFlt, colorP24vFlt);
delay(10);
bool p12vFlt=faultStatus->p12v;
bool p12vFlt=_faultStatus->p12v;
ui->l_p12vFlt->setText(QVariant(p12vFlt).toString());
auto colorP12vFlt = p12vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_p12vFlt, colorP12vFlt);
delay(10);
bool p5vFlt=faultStatus->p5v;
bool p5vFlt=_faultStatus->p5v;
ui->l_p5vFlt->setText(QVariant(p5vFlt).toString());
auto colorP5vFlt = p5vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_p5vFlt, colorP5vFlt);
delay(10);
bool m5vFlt=faultStatus->m5v;
bool m5vFlt=_faultStatus->m5v;
ui->l_m5vFlt->setText(QVariant(m5vFlt).toString());
auto colorM5vFlt = m5vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_m5vFlt, colorM5vFlt);
delay(10);
bool hvFlt=faultStatus->hvError;
bool hvFlt=_faultStatus->hvError;
ui->l_hvFlt->setText(QVariant(hvFlt).toString());
auto colorHvFlt = hvFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_hvFlt, colorHvFlt);
delay(10);
bool sup4dFlt=faultStatus->sup4d;
bool sup4dFlt=_faultStatus->sup4d;
ui->l_p4dFlt->setText(QVariant(sup4dFlt).toString());
auto colorP4dFlt = sup4dFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_p4dFlt, colorP4dFlt);
delay(10);
/******************Faults_Over*********************/
bool ovrHvapFlt=faultStatus->overHvap;
bool ovrHvapFlt=_faultStatus->overHvap;
ui->l_ovrHVapFlt->setText(QVariant(ovrHvapFlt).toString());
auto colorOvrHvapFlt = ovrHvapFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_ovrHVapFlt, colorOvrHvapFlt);
delay(10);
bool ovrHvbpFlt=faultStatus->overHvbp;
bool ovrHvbpFlt=_faultStatus->overHvbp;
ui->l_ovrHVbpFlt->setText(QVariant(ovrHvbpFlt).toString());
auto colorOvrHvbpFlt = ovrHvbpFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_ovrHVbpFlt, colorOvrHvbpFlt);
delay(10);
bool ovrCwdpFlt=faultStatus->overCwdp;
bool ovrCwdpFlt=_faultStatus->overCwdp;
ui->l_ovrCWdpFlt->setText(QVariant(ovrCwdpFlt).toString());
auto colorOvrCwdpFlt = ovrCwdpFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_ovrCWdpFlt, colorOvrCwdpFlt);
delay(10);
bool ovrCur24vFlt=faultStatus->overCurr24V;
bool ovrCur24vFlt=_faultStatus->overCurr24V;
ui->l_ovrCur24vFlt->setText(QVariant(ovrCur24vFlt).toString());
auto colorOvrCur24vFlt = ovrCur24vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_ovrCur24vFlt, colorOvrCur24vFlt);
delay(10);
bool ovrP24vFlt=faultStatus->overP24v;
bool ovrP24vFlt=_faultStatus->overP24v;
ui->l_ovrP24vFlt->setText(QVariant(ovrP24vFlt).toString());
auto colorOvrP24vFlt = ovrP24vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_ovrP24vFlt, colorOvrP24vFlt);
delay(10);
bool ovrP12vFlt=faultStatus->overP12v;
bool ovrP12vFlt=_faultStatus->overP12v;
ui->l_ovrP12vFlt->setText(QVariant(ovrP12vFlt).toString());
auto colorOvrP12vFlt = ovrP12vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_ovrP12vFlt, colorOvrP12vFlt);
delay(10);
bool ovrP5vFlt=faultStatus->overP5v;
bool ovrP5vFlt=_faultStatus->overP5v;
ui->l_ovrP5vFlt->setText(QVariant(ovrP5vFlt).toString());
auto colorOvrP5vFlt = ovrP5vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_ovrP5vFlt, colorOvrP5vFlt);
delay(10);
bool ovrM5vFlt=faultStatus->overM5v;
bool ovrM5vFlt=_faultStatus->overM5v;
ui->l_ovrM5vFlt->setText(QVariant(ovrM5vFlt).toString());
auto colorOvrM5vFlt = ovrM5vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_ovrM5vFlt, colorOvrM5vFlt);
delay(10);
bool ovrHvFlt=faultStatus->overHvError;
bool ovrHvFlt=_faultStatus->overHvError;
ui->l_ovrHvFlt->setText(QVariant(ovrHvFlt).toString());
auto colorOvrHvFlt = ovrHvFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_ovrHvFlt, colorOvrHvFlt);
delay(10);
bool ovrSup4dFlt=faultStatus->overSup4d;
bool ovrSup4dFlt=_faultStatus->overSup4d;
ui->l_ovr4dFlt->setText(QVariant(ovrSup4dFlt).toString());
auto colorOvrP4dFlt = ovrSup4dFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_ovr4dFlt, colorOvrP4dFlt);
delay(10);
/******************Faults_Under*********************/
bool udrHvapFlt=faultStatus->underHvap;
bool udrHvapFlt=_faultStatus->underHvap;
ui->l_udrHVapFlt->setText(QVariant(udrHvapFlt).toString());
auto colorUdrHvapFlt = udrHvapFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_udrHVapFlt, colorUdrHvapFlt);
delay(10);
bool udrHvbpFlt=faultStatus->underHvbp;
bool udrHvbpFlt=_faultStatus->underHvbp;
ui->l_udrHVbpFlt->setText(QVariant(udrHvbpFlt).toString());
auto colorUdrHvbpFlt = udrHvbpFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_udrHVbpFlt, colorUdrHvbpFlt);
delay(10);
bool udrCwdpFlt=faultStatus->underCwdp;
bool udrCwdpFlt=_faultStatus->underCwdp;
ui->l_udrCWdpFlt->setText(QVariant(udrCwdpFlt).toString());
auto colorUdrCwdpFlt = udrCwdpFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_udrCWdpFlt, colorUdrCwdpFlt);
delay(10);
bool udrCur24vFlt=faultStatus->underCurr24V;
bool udrCur24vFlt=_faultStatus->underCurr24V;
ui->l_udrCurr24vFlt->setText(QVariant(udrCur24vFlt).toString());
auto colorUdrCur24vFlt = udrCur24vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_udrCurr24vFlt, colorUdrCur24vFlt);
delay(10);
bool udrP24vFlt=faultStatus->underP24v;
bool udrP24vFlt=_faultStatus->underP24v;
ui->l_udrP24vFlt->setText(QVariant(udrP24vFlt).toString());
auto colorUdrP24vFlt = udrP24vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_udrP24vFlt, colorUdrP24vFlt);
delay(10);
bool udrP12vFlt=faultStatus->underP12v;
bool udrP12vFlt=_faultStatus->underP12v;
ui->l_udrP12vFlt->setText(QVariant(udrP12vFlt).toString());
auto colorUdrP12vFlt = udrP12vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_udrP12vFlt, colorUdrP12vFlt);
delay(10);
bool udrP5vFlt=faultStatus->underP5v;
bool udrP5vFlt=_faultStatus->underP5v;
ui->l_udrP5vFlt->setText(QVariant(udrP5vFlt).toString());
auto colorUdrP5vFlt = udrP5vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_udrP5vFlt, colorUdrP5vFlt);
delay(10);
bool udrM5vFlt=faultStatus->underM5v;
bool udrM5vFlt=_faultStatus->underM5v;
ui->l_udrM5vFlt->setText(QVariant(udrM5vFlt).toString());
auto colorUdrM5vFlt = udrM5vFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_udrM5vFlt, colorUdrM5vFlt);
delay(10);
bool udrHvFlt=faultStatus->underHvError;
bool udrHvFlt=_faultStatus->underHvError;
ui->l_udrHvFlt->setText(QVariant(udrHvFlt).toString());
auto colorUdrHvFlt = udrHvFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_udrHvFlt, colorUdrHvFlt);
delay(10);
bool udrSup4dFlt=faultStatus->underSup4d;
bool udrSup4dFlt=_faultStatus->underSup4d;
ui->l_udr4dFlt->setText(QVariant(udrSup4dFlt).toString());
auto colorUdrP4dFlt = udrSup4dFlt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_udr4dFlt, colorUdrP4dFlt);
@ -2888,10 +2933,15 @@ void MainWindow::on_btn_setAtgcMode_clicked()
void MainWindow::on_btn_trxRomWrite_clicked()
{
QByteArray arr;
arr.clear();
QString txtStr = ui->tb_trxRomWrite->toPlainText();
try
{
QString txtStr = ui->tb_trxRomWrite->toPlainText();
trxEepromWrite(txtStr, 0, _bCtrl);
foreach (auto i, txtStr){
arr.append(i.toLatin1());
}
trxEepromWrite(arr, 0, _bCtrl);
}
catch (SonoException& e)
{
@ -2934,10 +2984,15 @@ void MainWindow::on_btn_trxRomInfoRead_clicked()
void MainWindow::on_btn_mpsRomWrite_clicked()
{
QByteArray arr;
arr.clear();
QString txtStr = ui->tb_mpsRomWrite->toPlainText();
try
{
QString txtStr = ui->tb_mpsRomWrite->toPlainText();
mpsEepromWrite(txtStr, 0, _bCtrl);
foreach (auto i, txtStr){
arr.append(i.toLatin1());
}
mpsEepromWrite(arr, 0, _bCtrl);
}
catch (SonoException& e)
{
@ -2980,10 +3035,15 @@ void MainWindow::on_btn_mpsRomInfoRead_clicked()
void MainWindow::on_btn_prbCtrlRomWrite_clicked()
{
QByteArray arr;
arr.clear();
QString txtStr = ui->tb_prbCtrlRomWrite->toPlainText();
try
{
QString txtStr = ui->tb_prbCtrlRomWrite->toPlainText();
prbCtrlEepromWrite(txtStr, 0, _bCtrl);
foreach (auto i, txtStr){
arr.append(i.toLatin1());
}
prbCtrlEepromWrite(arr, 0, _bCtrl);
}
catch (SonoException& e)
{
@ -3026,11 +3086,16 @@ void MainWindow::on_btn_prbCtrlRomInfoRead_clicked()
void MainWindow::on_btn_prbRomWrite_clicked()
{
QByteArray arr;
arr.clear();
auto sel = ui->cb_prbSelRom->currentIndex();
QString txtStr = ui->tb_prbRomWrite->toPlainText();
try
{
auto sel = ui->cb_prbSelRom->currentIndex();
QString txtStr = ui->tb_prbRomWrite->toPlainText();
prbEepromWrite(txtStr, 0, static_cast<quint8>(sel), _bCtrl);
foreach (auto i, txtStr){
arr.append(i.toLatin1());
}
prbEepromWrite(arr, 0, static_cast<quint8>(sel), _bCtrl);
}
catch (SonoException& e)
{
@ -3061,8 +3126,8 @@ void MainWindow::on_btn_prbRomInfoRead_clicked()
try
{
auto sel = ui->cb_prbSelRom->currentIndex();
QString infoStr = _trx.prbInfo(static_cast<quint8>(sel));
ui->tb_prbRomInfoRead->setText(infoStr);
QByteArray arr = _trx.prbInfo(static_cast<quint8>(sel));
ui->tb_prbRomInfoRead->setText(QString(arr));
}
catch (SonoException& e)
{
@ -3239,3 +3304,4 @@ void MainWindow::on_btn_afeLut_clicked()
changeLabelTextColor(ui->l_afeLut, Qt::green);
}

13
mainwindow.h

@ -104,9 +104,9 @@ private:
BoardsCtrlMngt* _bCtrl;
SupervisorRbValue* supRbValue;
SupervisorRbValue* _supRbValue;
MpsFaultStatus* faultStatus;
MpsFaultStatus* _faultStatus;
HealthStatus* _healStatus;
@ -243,10 +243,11 @@ private slots:
void on_btn_updateRdbackValue_clicked();
// void on_btn_supJump_clicked();
void on_btn_supJump_clicked();
// void on_chk_sup24v_stateChanged(int arg1);
void on_btn_setAo_clicked();
void on_chk_initBoards_clicked();
// void on_btn_dmaStart_2_clicked();
@ -379,6 +380,10 @@ private slots:
void on_btn_afeLut_clicked();
void on_btn_scenStart_clicked();
signals:
// void updateBlockProgressValue(int percentage, QProgressBar* prg);
// void updateFpgaProgressValue(int percentage);

370
mainwindow.ui

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>854</width>
<height>947</height>
<height>907</height>
</rect>
</property>
<property name="windowTitle">
@ -27,7 +27,7 @@
<string/>
</property>
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -361,7 +361,7 @@
<rect>
<x>60</x>
<y>70</y>
<width>76</width>
<width>128</width>
<height>17</height>
</rect>
</property>
@ -369,7 +369,7 @@
<item>
<widget class="QLabel" name="label_36">
<property name="text">
<string>done:</string>
<string>Programming:</string>
</property>
</widget>
</item>
@ -397,6 +397,64 @@
</widget>
</widget>
</widget>
<widget class="QWidget" name="tab_5">
<attribute name="title">
<string>Scen Player</string>
</attribute>
<widget class="QWidget" name="verticalLayoutWidget_16">
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<width>190</width>
<height>58</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_16">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_39">
<item>
<widget class="QLabel" name="label_28">
<property name="text">
<string>Start Idx:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="tb_startIdx"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_40">
<item>
<widget class="QLabel" name="label_80">
<property name="text">
<string>End Idx:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="tb_endIdx"/>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QPushButton" name="btn_scenStart">
<property name="geometry">
<rect>
<x>230</x>
<y>20</y>
<width>94</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Scenario Start</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>DSP Setting</string>
@ -782,7 +840,7 @@
</widget>
<widget class="QWidget" name="tab_4">
<attribute name="title">
<string>BeamFormer</string>
<string>BeamFormer Setting</string>
</attribute>
<widget class="QWidget" name="verticalLayoutWidget_9">
<property name="geometry">
@ -1621,7 +1679,7 @@
<widget class="Line" name="line_2">
<property name="geometry">
<rect>
<x>230</x>
<x>240</x>
<y>50</y>
<width>16</width>
<height>111</height>
@ -1766,7 +1824,7 @@
<rect>
<x>140</x>
<y>90</y>
<width>80</width>
<width>101</width>
<height>23</height>
</rect>
</property>
@ -2017,8 +2075,8 @@
<widget class="QPushButton" name="btn_getFpgaVersion">
<property name="geometry">
<rect>
<x>720</x>
<y>50</y>
<x>700</x>
<y>60</y>
<width>91</width>
<height>23</height>
</rect>
@ -2030,8 +2088,8 @@
<widget class="QLabel" name="l_masterVersion">
<property name="geometry">
<rect>
<x>720</x>
<y>70</y>
<x>700</x>
<y>90</y>
<width>81</width>
<height>17</height>
</rect>
@ -2043,8 +2101,8 @@
<widget class="QLabel" name="l_slave0Version">
<property name="geometry">
<rect>
<x>720</x>
<y>90</y>
<x>700</x>
<y>110</y>
<width>81</width>
<height>17</height>
</rect>
@ -2056,8 +2114,8 @@
<widget class="QLabel" name="l_slave1Version">
<property name="geometry">
<rect>
<x>720</x>
<y>110</y>
<x>700</x>
<y>130</y>
<width>81</width>
<height>17</height>
</rect>
@ -2069,8 +2127,8 @@
<widget class="QLabel" name="l_slave2Version">
<property name="geometry">
<rect>
<x>720</x>
<y>130</y>
<x>700</x>
<y>150</y>
<width>81</width>
<height>17</height>
</rect>
@ -2219,7 +2277,7 @@
<x>0</x>
<y>510</y>
<width>821</width>
<height>101</height>
<height>61</height>
</rect>
</property>
<property name="font">
@ -2234,106 +2292,11 @@
<property name="flat">
<bool>false</bool>
</property>
<widget class="QLabel" name="label_10">
<property name="geometry">
<rect>
<x>0</x>
<y>60</y>
<width>111</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Selected probe:</string>
</property>
</widget>
<widget class="QPushButton" name="btn_pwr2OnOff">
<property name="geometry">
<rect>
<x>510</x>
<y>60</y>
<width>83</width>
<height>25</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
<widget class="QPushButton" name="btn_pwr4OnOff">
<property name="geometry">
<rect>
<x>670</x>
<y>60</y>
<width>83</width>
<height>25</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
<widget class="QPushButton" name="btn_HVOnOff">
<property name="geometry">
<rect>
<x>220</x>
<y>60</y>
<width>83</width>
<height>25</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
<widget class="QPushButton" name="btn_pwr3OnOff">
<property name="geometry">
<rect>
<x>590</x>
<y>60</y>
<width>83</width>
<height>25</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
<widget class="QComboBox" name="cb_selectedProbe">
<property name="geometry">
<rect>
<x>110</x>
<y>60</y>
<width>101</width>
<height>25</height>
</rect>
</property>
<item>
<property name="text">
<string>A</string>
</property>
</item>
<item>
<property name="text">
<string>B</string>
</property>
</item>
<item>
<property name="text">
<string>C</string>
</property>
</item>
<item>
<property name="text">
<string>D</string>
</property>
</item>
</widget>
<widget class="QPushButton" name="btn_pwr1OnOff">
<property name="geometry">
<rect>
<x>430</x>
<y>60</y>
<x>390</x>
<y>30</y>
<width>83</width>
<height>25</height>
</rect>
@ -2345,8 +2308,8 @@
<widget class="QPushButton" name="btn_motorOnOff">
<property name="geometry">
<rect>
<x>310</x>
<y>60</y>
<x>470</x>
<y>30</y>
<width>83</width>
<height>25</height>
</rect>
@ -2381,12 +2344,55 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget_3">
<property name="geometry">
<rect>
<x>230</x>
<y>30</y>
<width>142</width>
<height>25</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_104">
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string>Selected probe:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cb_selectedProbe">
<item>
<property name="text">
<string>A</string>
</property>
</item>
<item>
<property name="text">
<string>B</string>
</property>
</item>
<item>
<property name="text">
<string>C</string>
</property>
</item>
<item>
<property name="text">
<string>D</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox_8">
<property name="geometry">
<rect>
<x>0</x>
<y>610</y>
<y>570</y>
<width>821</width>
<height>321</height>
</rect>
@ -2518,25 +2524,6 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget_8">
<property name="geometry">
<rect>
<x>430</x>
<y>70</y>
<width>91</width>
<height>31</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_39">
<item>
<widget class="QPushButton" name="btn_pwrDacsEnable">
<property name="text">
<string>Valid</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget_13">
<property name="geometry">
<rect>
@ -3593,58 +3580,6 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget_55">
<property name="geometry">
<rect>
<x>710</x>
<y>210</y>
<width>143</width>
<height>21</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_87">
<item>
<widget class="QLabel" name="label_80">
<property name="text">
<string>cmd_error:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="l_cmdError">
<property name="text">
<string>Unknown</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget_56">
<property name="geometry">
<rect>
<x>710</x>
<y>240</y>
<width>144</width>
<height>21</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_88">
<item>
<widget class="QLabel" name="label_81">
<property name="text">
<string>cmd_done:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="l_cmdDone">
<property name="text">
<string>Unknown</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget_57">
<property name="geometry">
<rect>
@ -3700,59 +3635,46 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget_9">
<widget class="QPushButton" name="btn_supJump">
<property name="geometry">
<rect>
<x>550</x>
<y>70</y>
<width>261</width>
<height>31</height>
<x>730</x>
<y>110</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_40">
<item>
<widget class="QLabel" name="label_28">
<property name="text">
<string>DACs_OnOff:</string>
</property>
</widget>
</item>
<item alignment="Qt::AlignRight">
<widget class="QLineEdit" name="tb_DacsOnOff"/>
</item>
<item>
<widget class="QPushButton" name="btn_DacsOnOff">
<property name="text">
<string>Dacs_Enable</string>
</property>
</widget>
</item>
</layout>
<property name="text">
<string>Reset MPS</string>
</property>
</widget>
<widget class="QPushButton" name="btn_supJump">
<widget class="QCheckBox" name="chk_initBoards">
<property name="geometry">
<rect>
<x>710</x>
<y>120</y>
<width>41</width>
<height>25</height>
<x>730</x>
<y>70</y>
<width>75</width>
<height>17</height>
</rect>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:7pt; font-weight:600; font-style:italic;&quot;&gt;PrbCtrl and MPS&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>JMP</string>
<string>Init Boards</string>
</property>
</widget>
<widget class="QCheckBox" name="chk_sup24v">
<widget class="QPushButton" name="btn_setAo">
<property name="geometry">
<rect>
<x>760</x>
<y>120</y>
<width>51</width>
<x>440</x>
<y>70</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>24V</string>
<string>Set Ao</string>
</property>
</widget>
</widget>

79
src/model/hardware/core/TrxBoard.cpp

@ -246,8 +246,6 @@ void TrxBoard::setSwapVector()
TrxBoard::TrxBoard() : _offsetSlave0(0), _offsetSlave1(0x400000), _offsetSlave2(0x800000)
{
_run = true;
_device.init();
_beamFormerSlave0 = new BeamFormer (&_device, _offsetSlave0);
_beamFormerSlave1 = new BeamFormer (&_device, _offsetSlave1);
@ -263,8 +261,12 @@ TrxBoard::TrxBoard() : _offsetSlave0(0), _offsetSlave1(0x400000), _offsetSlave2(
_adc = new AdcVoltages();
_pg = new VoltagesPg();
setSwapVector();
_allow = false;
_run = true;
_device.init();
/*************************************************************************************************/
/*************************************************************************************************/
@ -429,13 +431,18 @@ void TrxBoard::setBeamFormerMode(eClkMode mode) const
this->_clkDistributer->clockMode(CLOCK_DIVISION, mode);
}
void TrxBoard::setScenPlayerIndex(quint32 &startIdx, quint32 &endIdx) const
void TrxBoard::setScenPlayerIndex(quint32 startIdx, quint32 endIdx) const
{
if (endIdx >= startIdx)
{
this->_scenPlayer->setStartIndex(startIdx);
this->_scenPlayer->setEndIndex(endIdx);
}
else
throw SonoException("The end index must be greater than or equal to the start index");
}
void TrxBoard::scenPlayerStart(bool start) const
void TrxBoard::scenPlayerStart(void) const
{
if (_allow)
{
@ -449,17 +456,17 @@ void TrxBoard::scenPlayerStart(bool start) const
}
this->_scenPlayer->control.command(start);
this->_scenPlayer->control.command(true);
}
void TrxBoard::scenPlayerPause(bool pause) const
{
this->_scenPlayer->control.pause(pause);
}
//void TrxBoard::scenPlayerPause(bool pause) const
//{
// this->_scenPlayer->control.pause(pause);
//}
void TrxBoard::scenPlayerStop(bool stop) const
void TrxBoard::scenPlayerStop(void) const
{
this->_scenPlayer->control.command(!stop);
this->_scenPlayer->control.command(false);
}
@ -499,28 +506,32 @@ quint32 TrxBoard::prbId(quint8 prbSel) const
return byteArray2Uint32BigEndian(id);
}
QList<quint32> TrxBoard::getConnectedPrbId() const
void TrxBoard::getConnectedPrbId(ConnectedPrbId* prbId) const
{
QList<quint32> list;
QVector<bool> vec;
QByteArray id;
list.clear();
vec.clear();
id.clear();
vec = this->_bCtrlMngt->getConnectedPrb();
for (quint8 i=0; i < vec.size(); i++)
{
if (vec.at(i))
{
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BYTE_BEGIN, EEPROM_ID_BYTE_NUMBER, i);
list.append(byteArray2Uint32BigEndian(id));
}
else
list.append(0);
id.append(nullptr);
switch (i)
{
case 0: prbId->prbA = byteArray2Uint32BigEndian(id);break;
case 1: prbId->prbB = byteArray2Uint32BigEndian(id);break;
case 2: prbId->prbC = byteArray2Uint32BigEndian(id);break;
case 3: prbId->prbD = byteArray2Uint32BigEndian(id);break;
}
}
return list;
}
QString TrxBoard::trxInfo() const
@ -541,35 +552,37 @@ QString TrxBoard::prbCtrlInfo() const
return str;
}
QString TrxBoard::prbInfo(quint8 prbSel) const
QByteArray TrxBoard::prbInfo(quint8 prbSel) const
{
QString str = QString(this->_bCtrlMngt->prbEepromRead(EEPROM_INFO_BYTE_BEGIN, EEPROM_INFO_BYTE_NUMBER, prbSel));
return str;
return this->_bCtrlMngt->prbEepromRead(EEPROM_INFO_BYTE_BEGIN, EEPROM_INFO_BYTE_NUMBER, prbSel);
}
QList<QString> TrxBoard::getConnectedPrbInfo() const
void TrxBoard::getConnectedPrbInfo(ConnectedPrbInfo* prbInfo) const
{
QList<QString> list;
QByteArray info;
QVector<bool> vec;
QString str;
list.clear();
info.clear();
vec.clear();
str.clear();
vec = this->_bCtrlMngt->getConnectedPrb();
for (quint8 i=0; i < vec.size(); i++)
{
if (vec.at(i))
info = this->_bCtrlMngt->prbEepromRead(EEPROM_INFO_BYTE_BEGIN, EEPROM_INFO_BYTE_NUMBER, i);
else
info.append(nullptr);
switch (i)
{
str = QString(this->_bCtrlMngt->prbEepromRead(EEPROM_INFO_BYTE_BEGIN, EEPROM_INFO_BYTE_NUMBER, i));
list.append(str);
case 0: prbInfo->prbA = info;break;
case 1: prbInfo->prbB = info;break;
case 2: prbInfo->prbC = info;break;
case 3: prbInfo->prbD = info;break;
}
else
list.append("NULL");
}
return list;
}

11
src/model/hardware/core/register/Register.cpp

@ -1,13 +1,10 @@
#include "model/hardware/core/register/Register.h"
#include <QDebug>
//Register::Register(quint8 bar, quint32 offset, SonoDevice *device, quint32 arrayLength)
Register::Register(quint8 bar, quint32 offset, SonoDevice *device)
Register::Register(quint8 bar, quint32 offset, SonoDevice *device, quint32 arrayLength)
{
_bar = bar;
_offset = offset;
// _arrayLength = arrayLength;
_arrayLength = arrayLength;
_device = device;
}
@ -69,7 +66,7 @@ void Register::upadteArray() //update array register
{
for(quint32 i = 0; i < _arrayLength; i++)
{
// prepareData(i);
prepareData(i);
auto value = 0;
for(auto j = 0; j < _fields.length(); j++)
@ -101,7 +98,7 @@ void Register::syncArray()
_fields[i]->updateValue(value);
}
// receiveData();
receiveData();
}
}

104
src/model/hardware/core/register/RegisterChain.cpp

@ -1,104 +0,0 @@
#include "model/hardware/core/register/RegisterChain.h"
RegisterChain::RegisterChain(quint8 bar, quint32 offset, SonoDevice *device, quint32 arrayLength)
{
_bar = bar;
_offset = offset;
_arrayLength = arrayLength;
_device = device;
}
RegisterChain::~RegisterChain()
{
for(auto i = 0; i < _fields.length(); i++)
{
delete _fields[i];
}
_fields.clear();
}
quint32 RegisterChain::getValue()
{
return _value;
}
void RegisterChain::setValue(quint32 value)
{
if(_value == value)
{
return;
}
_value = value;
_isUpdated = true;
}
void RegisterChain::changeOffset(quint32 offset)
{
_offset = offset;
}
quint32 RegisterChain::getCurrentOffset() const
{
return _offset;
}
bool RegisterChain::isUpdated()
{
auto temp = _isUpdated;
_isUpdated = false;
return temp;
}
void RegisterChain::update() //update single RegisterChain
{
auto value = 0;
for(auto i = 0; i < _fields.length(); i++)
{
value |= _fields[i]->getRegisterWriteValue();
}
_device->device.writeWord(_bar, _offset, value);
}
void RegisterChain::upadteArray() //update array RegisterChain
{
for(quint32 i = 0; i < _arrayLength; i++)
{
prepareData(i);
auto value = 0;
for(auto j = 0; j < _fields.length(); j++)
{
value |= _fields[j]->getRegisterWriteValue();
}
_device->device.writeWord(_bar, _offset + i*4, value);
}
}
void RegisterChain::sync()
{
auto value = _device->device.readWord(_bar, _offset);
for(auto i = 0; i < _fields.length(); i++)
{
_fields[i]->updateValue(value);
}
}
void RegisterChain::syncArray()
{
for(quint32 i = 0; i < _arrayLength; i++)
{
auto value = _device->device.readWord(_bar, _offset + i*4);
for(auto i = 0; i < _fields.length(); i++)
{
_fields[i]->updateValue(value);
}
//receiveData();
}
}

31
src/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.cpp

@ -31,12 +31,12 @@ BoardsCtrlMngt::Gain::Gain()
/************************************* Write Functions Template ************************************/
/***************************************************************************************************/
template<class T1, class T2>
void BoardsCtrlMngt::eepromWrite(QString& str, quint32 addr, quint8 prbSel, T1* request, T2* status)
void BoardsCtrlMngt::eepromWrite(QByteArray& arr, quint32 addr, quint8 prbSel, T1* request, T2* status)
{
quint32 j(0);
bool busy=true, error=false, done=false;
foreach (auto i, str)
foreach (auto i, arr)
{
status->sync();
@ -56,7 +56,8 @@ void BoardsCtrlMngt::eepromWrite(QString& str, quint32 addr, quint8 prbSel, T1*
timerShot(5); // must be >= 4
while (!checkTimeout());
_rom->dataIn = static_cast<quint32>(i.toLatin1());
//_rom->dataIn = static_cast<quint32>(i.toLatin1());
_rom->dataIn = i;
_rom->address = addr+j;
_rom->probeSelect = prbSel;
setEepromWrite<T1>(_rom, request);
@ -872,39 +873,39 @@ QByteArray BoardsCtrlMngt::prbEepromRead(quint32 address, quint32 length, quint8
}
void trxEepromWrite(QString str, quint32 address, BoardsCtrlMngt* boards)
void trxEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards)
{
if (str.size() >= static_cast<qint32>(TRX_ROM_MAX_LEN))
if (arr.size() >= static_cast<qint32>(TRX_ROM_MAX_LEN))
throw SonoException("Out of range writing into TRX eeprom ");
quint8 prbSel = 0;
boards->eepromWrite<TrxEepromRwReq, TrxEepromRwStatus>(str, address, prbSel, boards->_tRomReq, boards->_tRomStatus);
boards->eepromWrite<TrxEepromRwReq, TrxEepromRwStatus>(arr, address, prbSel, boards->_tRomReq, boards->_tRomStatus);
}
void mpsEepromWrite(QString str, quint32 address, BoardsCtrlMngt *boards)
void mpsEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt *boards)
{
if (str.size() >= static_cast<qint32>(MPS_ROM_MAX_LEN))
if (arr.size() >= static_cast<qint32>(MPS_ROM_MAX_LEN))
throw SonoException("Out of range writing into MPS eeprom ");
quint8 prbSel = 0;
boards->eepromWrite<MpsEepromRwReq, MpsEepromRwStatus>(str, address, prbSel, boards->_mRomReq, boards->_mRomStatus);
boards->eepromWrite<MpsEepromRwReq, MpsEepromRwStatus>(arr, address, prbSel, boards->_mRomReq, boards->_mRomStatus);
}
void prbCtrlEepromWrite(QString str, quint32 address, BoardsCtrlMngt *boards)
void prbCtrlEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt *boards)
{
if (str.size() >= static_cast<qint32>(PRB_CTRL_ROM_MAX_LEN))
if (arr.size() >= static_cast<qint32>(PRB_CTRL_ROM_MAX_LEN))
throw SonoException("Out of range writing into Probe Control eeprom ");
quint8 prbSel = 0;
boards->eepromWrite<PrbCtrlEepromRwReq, PrbCtrlEepromRwStatus>(str, address, prbSel, boards->_pCtrlRomReq, boards->_pCtrlRomStatus);
boards->eepromWrite<PrbCtrlEepromRwReq, PrbCtrlEepromRwStatus>(arr, address, prbSel, boards->_pCtrlRomReq, boards->_pCtrlRomStatus);
}
void prbEepromWrite(QString str, quint32 address, quint8 prbSel, BoardsCtrlMngt *boards)
void prbEepromWrite(QByteArray arr, quint32 address, quint8 prbSel, BoardsCtrlMngt *boards)
{
if (str.size() >= static_cast<qint32>(PRB_ROM_MAX_LEN))
if (arr.size() >= static_cast<qint32>(PRB_ROM_MAX_LEN))
throw SonoException("Out of range writing into Probe eeprom ");
boards->eepromWrite<PrbEepromRwReq, PrbEepromRwStatus>(str, address, prbSel, boards->_pRomReq, boards->_pRomStatus);
boards->eepromWrite<PrbEepromRwReq, PrbEepromRwStatus>(arr, address, prbSel, boards->_pRomReq, boards->_pRomStatus);
}

12
src/model/hardware/core/register/fpgaProgram/FpgaProgram.cpp

@ -38,6 +38,13 @@ void FpgaProgram::program(QByteArray& bitFileData, quint8 number)
quint32 progData(0);
QByteArray temp;
QProgressDialog progress;
progress.setMinimumSize(300,100);
progress.setLabelText("Please wait...");
progress.setWindowTitle("Slaves FPGA Programming");
progress.setRange(0,bitFileData.size());
progress.setModal(true);
setSlaveFpgaNumber(number);
while (progByte<bitFileData.size())
@ -70,6 +77,11 @@ void FpgaProgram::program(QByteArray& bitFileData, quint8 number)
throw SonoException("Timeout is happened and the programming of the slave FPGAs is failed");
}
progress.setValue(progByte);
if (progress.wasCanceled())
throw SonoException("Slaves fpga programming is canceled");
temp.clear();
progByte += sizeof (quint32);

Loading…
Cancel
Save