Browse Source

New E2PROMs and fans are updated.

Arash Aletayeb 2 years ago
parent
commit
30dc085747
  1. 2
      developHw.pro.user
  2. 2
      include/model/hardware/core/lowLevelApi/TrxBoard.h
  3. 1
      include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h
  4. 4
      include/model/hardware/core/lowLevelApi/register/afe/Afe.h
  5. 17
      include/model/hardware/core/lowLevelApi/register/boardsCtrlMngt/BoardsCtrlMngt.h
  6. 4
      include/model/hardware/core/lowLevelApi/register/boardsCtrlMngt/registerDefinition/BoardsSpecs.h
  7. 58
      include/model/hardware/core/lowLevelApi/register/boardsCtrlMngt/registerDefinition/mps/FansPdw.h
  8. 4
      include/model/hardware/core/lowLevelApi/register/boardsCtrlMngt/registerDefinition/trx/OnBoardTempSensor.h
  9. 1035
      mainwindow.cpp
  10. 30
      mainwindow.h
  11. 602
      mainwindow.ui
  12. 11
      src/model/hardware/core/lowLevelApi/TrxBoard.cpp
  13. 54
      src/model/hardware/core/lowLevelApi/register/boardsCtrlMngt/BoardsCtrlMngt.cpp

2
developHw.pro.user

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.10.0, 2023-02-20T16:12:00. --> <!-- Written by QtCreator 4.10.0, 2023-05-24T17:07:03. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>

2
include/model/hardware/core/lowLevelApi/TrxBoard.h

@ -280,6 +280,8 @@ public:
void selectProbe(eSelectProbe prbSel); void selectProbe(eSelectProbe prbSel);
void getHealthStatus(HealthStatus* healStat) const; void getHealthStatus(HealthStatus* healStat) const;
void setTrxFanRpm(const eFanPwm& fan, const quint8& dutyCyclePercent) const;
//////////////////////////////// BPI Flash API //////////////////////////////// //////////////////////////////// BPI Flash API ////////////////////////////////
void mcsProgram(QString path); void mcsProgram(QString path);
void mcsVerify(QString path) const; void mcsVerify(QString path) const;

1
include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h

@ -23,6 +23,7 @@ struct ProbeElementPosition
struct HealthStatus struct HealthStatus
{ {
float systemTemperature; float systemTemperature;
float mpsTemperature;
AdcVoltages* adcMon; AdcVoltages* adcMon;
VoltagesPg* voltsPg; VoltagesPg* voltsPg;
FanRpm* fanRpm; FanRpm* fanRpm;

4
include/model/hardware/core/lowLevelApi/register/afe/Afe.h

@ -90,7 +90,9 @@ enum eLnaHpf : quint8
enum eLnaGainGbl : quint8 enum eLnaGainGbl : quint8
{ {
lnaGainGbl24db = 1 lnaGainGbl18db,
lnaGainGbl24db,
lnaGainGbl12db
}; };
enum eLowNf : quint8 enum eLowNf : quint8

17
include/model/hardware/core/lowLevelApi/register/boardsCtrlMngt/BoardsCtrlMngt.h

@ -6,10 +6,10 @@
#include <QByteArray> #include <QByteArray>
#include "registerDefinition/BoardsSpecs.h" #include "registerDefinition/BoardsSpecs.h"
#define TRX_ROM_MAX_LEN 131072U #define TRX_ROM_MAX_LEN 256U
#define MPS_ROM_MAX_LEN 512U #define MPS_ROM_MAX_LEN 256U
#define PRB_ROM_MAX_LEN 4096U #define PRB_ROM_MAX_LEN 4096U
#define PRB_CTRL_ROM_MAX_LEN 131072U #define PRB_CTRL_ROM_MAX_LEN 256U
#define TEMP_SENSOR_RESOLUTION 0.125f #define TEMP_SENSOR_RESOLUTION 0.125f
@ -26,6 +26,9 @@
#define HVA_MAX_VALUE 66.0f #define HVA_MAX_VALUE 66.0f
#define HVB_MAX_VALUE 66.0f //must be check #define HVB_MAX_VALUE 66.0f //must be check
#define FAN1_PRI 127U //Equal to 10.4ms according to the pulse gen submodule in HDL code
#define FAN2_PRI 127U //Equal to 10.4ms according to the pulse gen submodule in HDL code
enum ePg : bool enum ePg : bool
{ {
bad = false, bad = false,
@ -136,6 +139,12 @@ struct FanRpm
float fan2; float fan2;
}; };
enum eFanPwm : quint8
{
fan1,
fan2
};
struct criticalComponentVoltages struct criticalComponentVoltages
{ {
FpgaVccInt vccInt; FpgaVccInt vccInt;
@ -292,6 +301,7 @@ public:
void getTrxBoardVoltages(AdcVoltages* adc, VoltagesPg* pg); void getTrxBoardVoltages(AdcVoltages* adc, VoltagesPg* pg);
void getTrxVoltagesPg(VoltagesPg* pg); void getTrxVoltagesPg(VoltagesPg* pg);
float getMpsTempSensor(void) const;
void getSupervisorValue(SupervisorRbValue* sValue) const; void getSupervisorValue(SupervisorRbValue* sValue) const;
void getMpsFault(MpsFaultStatus* faultStatus) const; void getMpsFault(MpsFaultStatus* faultStatus) const;
void mpsInit(void) const; void mpsInit(void) const;
@ -305,6 +315,7 @@ public:
void getFpgaVccAux(FpgaVccAux& coreAux); void getFpgaVccAux(FpgaVccAux& coreAux);
void getFpgaVccBram(FpgaVccBram& coreBram); void getFpgaVccBram(FpgaVccBram& coreBram);
void getFanRpm(FanRpm* _rpm); void getFanRpm(FanRpm* _rpm);
void setFanPwm(const eFanPwm& fan, const quint8& dcPercent) const;
QByteArray trxEepromRead(quint32 address, quint32 length); QByteArray trxEepromRead(quint32 address, quint32 length);
QByteArray mpsEepromRead(quint32 address, quint32 length); QByteArray mpsEepromRead(quint32 address, quint32 length);

4
include/model/hardware/core/lowLevelApi/register/boardsCtrlMngt/registerDefinition/BoardsSpecs.h

@ -27,6 +27,7 @@
#include "mps/FanStatus.h" #include "mps/FanStatus.h"
#include "mps/FanTacho1.h" #include "mps/FanTacho1.h"
#include "mps/FanTacho2.h" #include "mps/FanTacho2.h"
#include "mps/FansPdw.h"
//////////////// Prb Headers //////////////// //////////////// Prb Headers ////////////////
#include "probe/PrbCtrlEepromRwStatus.h" #include "probe/PrbCtrlEepromRwStatus.h"
@ -87,6 +88,7 @@ protected:
MpsHvStopState* _mHvStop; MpsHvStopState* _mHvStop;
FanTacho1* _fanTacho1; FanTacho1* _fanTacho1;
FanTacho2* _fanTacho2; FanTacho2* _fanTacho2;
FansPdw* _fansPdw;
FanStatus* _fan; FanStatus* _fan;
//////////////// Prb classes //////////////// //////////////// Prb classes ////////////////
@ -150,6 +152,7 @@ protected:
_mHvStop = new MpsHvStopState(device); _mHvStop = new MpsHvStopState(device);
_fanTacho1 = new FanTacho1(device); _fanTacho1 = new FanTacho1(device);
_fanTacho2 = new FanTacho2(device); _fanTacho2 = new FanTacho2(device);
_fansPdw = new FansPdw(device);
_fan = new FanStatus(device); _fan = new FanStatus(device);
///////////////////// Prb Mem Alloc ///////////////////// ///////////////////// Prb Mem Alloc /////////////////////
@ -211,6 +214,7 @@ protected:
delete _mHvStop; delete _mHvStop;
delete _fanTacho1; delete _fanTacho1;
delete _fanTacho2; delete _fanTacho2;
delete _fansPdw;
delete _fan; delete _fan;
//// Prb Mem delete //// //// Prb Mem delete ////

58
include/model/hardware/core/lowLevelApi/register/boardsCtrlMngt/registerDefinition/mps/FansPdw.h

@ -0,0 +1,58 @@
#ifndef FANSPDW_H
#define FANSPDW_H
#include "model/hardware/core/lowLevelApi/register/Register.h"
#include "model/hardware/core/lowLevelApi/register/RegUtils.h"
#undef BAR
#define FAN1_EN_MASK 0x00000001
#define FAN1_LOAD_CFG_MASK 0x00000002
#define FAN1_PW_MASK 0x000001FC
#define FAN1_PRI_MASK 0x0000FE00
#define FAN2_EN_MASK 0x00010000
#define FAN2_LOAD_CFG_MASK 0x00020000
#define FAN2_PW_MASK 0x01FC0000
#define FAN2_PRI_MASK 0xFE000000
#define BAR 0
#define OFFSET 0X2601C
class FansPdw : public Register
{
public:
Field* fan1En;
Field* fan1LoadCfg;
Field* fan1Pw;
Field* fan1Pri;
Field* fan2En;
Field* fan2LoadCfg;
Field* fan2Pw;
Field* fan2Pri;
FansPdw(SonoDevice* device) : Register(BAR, OFFSET, device)
{
ADD_UNSIGNED_FIELD(fan1En, FAN1_EN_MASK );
ADD_UNSIGNED_FIELD(fan1LoadCfg, FAN1_LOAD_CFG_MASK);
ADD_UNSIGNED_FIELD(fan1Pw, FAN1_PW_MASK );
ADD_UNSIGNED_FIELD(fan1Pri, FAN1_PRI_MASK );
ADD_UNSIGNED_FIELD(fan2En, FAN2_EN_MASK );
ADD_UNSIGNED_FIELD(fan2LoadCfg, FAN2_LOAD_CFG_MASK);
ADD_UNSIGNED_FIELD(fan2Pw, FAN2_PW_MASK );
ADD_UNSIGNED_FIELD(fan2Pri, FAN2_PRI_MASK );
}
};
#undef FAN1_EN_MASK
#undef FAN1_LOAD_CFG_MASK
#undef FAN1_PW_MASK
#undef FAN1_PRI_MASK
#undef FAN2_EN_MASK
#undef FAN2_LOAD_CFG_MASK
#undef FAN2_PW_MASK
#undef FAN2_PRI_MASK
#undef BAR
#undef OFFSET
#endif // FANSPDW_H

4
include/model/hardware/core/lowLevelApi/register/boardsCtrlMngt/registerDefinition/trx/OnBoardTempSensor.h

@ -7,6 +7,7 @@
#undef BAR #undef BAR
#define TEMPERATURE_MASK 0x000007FF #define TEMPERATURE_MASK 0x000007FF
#define MPS_TEMP_MASK 0xFFFF0000
#define BAR 0 #define BAR 0
#define OFFSET 0X26064 #define OFFSET 0X26064
@ -15,14 +16,17 @@ class OnBoardTempSensor : public Register
{ {
public: public:
Field* temperature; Field* temperature;
Field* mpsTemp;
OnBoardTempSensor(SonoDevice* device) : Register(BAR, OFFSET, device) OnBoardTempSensor(SonoDevice* device) : Register(BAR, OFFSET, device)
{ {
ADD_SIGNED_FIELD(temperature, TEMPERATURE_MASK); ADD_SIGNED_FIELD(temperature, TEMPERATURE_MASK);
ADD_SIGNED_FIELD(mpsTemp, MPS_TEMP_MASK);
} }
}; };
#undef TEMPERATURE_MASK #undef TEMPERATURE_MASK
#undef MPS_TEMP_MASK
#undef BAR #undef BAR
#undef OFFSET #undef OFFSET

1035
mainwindow.cpp

File diff suppressed because it is too large

30
mainwindow.h

@ -31,18 +31,24 @@
#define MESSAGE_BOX(M) \ #define MESSAGE_BOX(M) \
emit showMessage(M) emit showMessage(M)
#define TRX_RLY_MPS_E2PROM_SIZE_BYTE 256 #define TRX_RLY_MPS_E2PROM_SIZE_BYTE 256U
#define PROBE_E2PROM_BYTE_ORIGIN 0U
#define PROBE_E2PROM_BYTE_SIZE 4096U
#define TOTAL_PROBE_ELEMENTS 32U
#define SCENARIO_FILE_PATH "scenarioFilePath" #define SCENARIO_FILE_PATH "scenarioFilePath"
#define SCENARIOS_FOLDER_PATH "scenariosFolderPath" #define SCENARIOS_FOLDER_PATH "scenariosFolderPath"
#define BITE_SCEN_FILE_PATH "biteScenarioFilePath" #define BITE_SCEN_FILE_PATH "biteScenarioFilePath"
#define FRAME_LOG_PATH "frameLogPath" #define FRAME_LOG_PATH "frameLogPath"
#define ADC_LOG_PATH "adcLogPath" #define ADC_LOG_PATH "adcLogPath"
#define PROBE_LOG_PATH "prbRelayLogPath"
#define BITE_FILE_PATH "biteFilePath" #define BITE_FILE_PATH "biteFilePath"
#define FPGA_FILE_PATH "fpgaFilePath" #define FPGA_FILE_PATH "fpgaFilePath"
#define MCS_FILE_PATH "mcsFilePath" #define MCS_FILE_PATH "mcsFilePath"
#define PRB_FILE_PATH "prbFilePath"
#define REG_ACCESS_SEL "regAccessType" #define REG_ACCESS_SEL "regAccessType"
#define START "Start" #define START "Start"
#define STOP "Stop" #define STOP "Stop"
@ -214,9 +220,11 @@ private:
QString _frameLogFolder = "/home/hasis/Desktop/hardware/Log/DMA"; QString _frameLogFolder = "/home/hasis/Desktop/hardware/Log/DMA";
QString _biteLogFolder = "/home/hasis/Desktop/hardware/Log/BITe"; QString _biteLogFolder = "/home/hasis/Desktop/hardware/Log/BITe";
QString _adcLoggerFolder = "/home/hasis/Desktop/hardware/Log/ADC"; QString _adcLoggerFolder = "/home/hasis/Desktop/hardware/Log/ADC";
QString _probeLoggerFolder = "/home/hasis/Desktop/hardware/Log/ProbeElements";
QString _statusVectorPSPath = "/home/hasis/Desktop/hardware/Log/statusVectorPS"; QString _statusVectorPSPath = "/home/hasis/Desktop/hardware/Log/statusVectorPS";
QString _headerLogPath = "/home/hasis/Desktop/hardware/Log/frameHeader/headerLog.csv"; QString _headerLogPath = "/home/hasis/Desktop/hardware/Log/frameHeader/headerLog.csv";
QString _headerEndurancePath = "/home/hasis/Desktop/hardware/Log/header_endurance/headerLog.csv"; QString _headerEndurancePath = "/home/hasis/Desktop/hardware/Log/header_endurance/headerLog.csv";
QString _probeRomPath = "/home/hasis/Desktop/hardware/ProbeRom";
QVector<QByteArray> _dmaBuffer; QVector<QByteArray> _dmaBuffer;
QByteArray _lastBuffer; QByteArray _lastBuffer;
@ -438,6 +446,26 @@ private slots:
void on_chk_writeCrcPrbCtrlRom_clicked(bool checked); void on_chk_writeCrcPrbCtrlRom_clicked(bool checked);
void prbRead (const QString& prbSelData, qint32 prbSel);
void prbWrite (qint32 prbSel);
void on_btn_prbRomBrowse_clicked();
void on_btn_prbRomWriteAll_clicked();
void on_chk_prbRomWrEn_clicked(bool checked);
void on_btn_prbRomReadAll_clicked();
void on_sb_Fan1Pwm_valueChanged(int arg1);
void on_sb_Fan2Pwm_valueChanged(int arg1);
void on_btn_prbRelayLogBrowse_clicked();
void on_btn_prbRelayTestStart_clicked();
signals: signals:
void showMessage(QString message); void showMessage(QString message);
void threeDReady(); void threeDReady();

602
mainwindow.ui

@ -42,7 +42,7 @@
<string/> <string/>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>4</number> <number>6</number>
</property> </property>
<widget class="QWidget" name="tab_0"> <widget class="QWidget" name="tab_0">
<attribute name="title"> <attribute name="title">
@ -2023,7 +2023,7 @@
<x>10</x> <x>10</x>
<y>10</y> <y>10</y>
<width>381</width> <width>381</width>
<height>81</height> <height>121</height>
</rect> </rect>
</property> </property>
<property name="title"> <property name="title">
@ -2121,14 +2121,40 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QCheckBox" name="chk_clearTrxRom">
<property name="geometry">
<rect>
<x>0</x>
<y>90</y>
<width>91</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Clear All</string>
</property>
</widget>
<widget class="QCheckBox" name="chk_writeCrcTrxRom">
<property name="geometry">
<rect>
<x>160</x>
<y>90</y>
<width>101</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Write CRC</string>
</property>
</widget>
</widget> </widget>
<widget class="QGroupBox" name="groupBox_11"> <widget class="QGroupBox" name="groupBox_11">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>410</x> <x>410</x>
<y>170</y> <y>150</y>
<width>381</width> <width>381</width>
<height>151</height> <height>201</height>
</rect> </rect>
</property> </property>
<property name="title"> <property name="title">
@ -2231,6 +2257,168 @@
</property> </property>
</item> </item>
</widget> </widget>
<widget class="QLineEdit" name="tb_prbRomFilePath">
<property name="geometry">
<rect>
<x>0</x>
<y>170</y>
<width>311</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
</widget>
<widget class="QPushButton" name="btn_prbRomBrowse">
<property name="geometry">
<rect>
<x>310</x>
<y>170</y>
<width>71</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="text">
<string>Browse...</string>
</property>
</widget>
<widget class="QWidget" name="verticalLayoutWidget_20">
<property name="geometry">
<rect>
<x>0</x>
<y>120</y>
<width>159</width>
<height>54</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_27">
<property name="spacing">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_42">
<property name="spacing">
<number>0</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum>
</property>
<item>
<widget class="QCheckBox" name="chk_prbRomWrEn">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:8pt; font-weight:600; font-style:italic;&quot;&gt;Wr En&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>En</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_prbRomWriteAll">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
</size>
</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;Write All Data to Probe&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Write All</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="btn_prbRomReadAll">
<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;Read All Data From Probe&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Read All</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="label_90">
<property name="geometry">
<rect>
<x>0</x>
<y>100</y>
<width>71</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Operation:</string>
</property>
</widget>
<widget class="QLabel" name="l_prbRomDone">
<property name="geometry">
<rect>
<x>80</x>
<y>100</y>
<width>41</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>doing</string>
</property>
</widget>
</widget> </widget>
<widget class="QGroupBox" name="groupBox_14"> <widget class="QGroupBox" name="groupBox_14">
<property name="geometry"> <property name="geometry">
@ -2238,7 +2426,7 @@
<x>410</x> <x>410</x>
<y>10</y> <y>10</y>
<width>381</width> <width>381</width>
<height>81</height> <height>121</height>
</rect> </rect>
</property> </property>
<property name="title"> <property name="title">
@ -2336,14 +2524,40 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QCheckBox" name="chk_clearMpsRom">
<property name="geometry">
<rect>
<x>0</x>
<y>90</y>
<width>91</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Clear All</string>
</property>
</widget>
<widget class="QCheckBox" name="chk_writeCrcMpsRom">
<property name="geometry">
<rect>
<x>160</x>
<y>90</y>
<width>101</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Write CRC</string>
</property>
</widget>
</widget> </widget>
<widget class="QGroupBox" name="groupBox_15"> <widget class="QGroupBox" name="groupBox_15">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>170</y> <y>150</y>
<width>381</width> <width>381</width>
<height>81</height> <height>121</height>
</rect> </rect>
</property> </property>
<property name="title"> <property name="title">
@ -2441,64 +2655,11 @@
</item> </item>
</layout> </layout>
</widget> </widget>
</widget>
<widget class="QCheckBox" name="chk_clearTrxRom">
<property name="geometry">
<rect>
<x>10</x>
<y>100</y>
<width>91</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Clear All</string>
</property>
</widget>
<widget class="QCheckBox" name="chk_writeCrcTrxRom">
<property name="geometry">
<rect>
<x>170</x>
<y>100</y>
<width>101</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Write CRC</string>
</property>
</widget>
<widget class="QCheckBox" name="chk_clearMpsRom">
<property name="geometry">
<rect>
<x>410</x>
<y>100</y>
<width>91</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Clear All</string>
</property>
</widget>
<widget class="QCheckBox" name="chk_writeCrcMpsRom">
<property name="geometry">
<rect>
<x>570</x>
<y>100</y>
<width>101</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Write CRC</string>
</property>
</widget>
<widget class="QCheckBox" name="chk_writeCrcPrbCtrlRom"> <widget class="QCheckBox" name="chk_writeCrcPrbCtrlRom">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>170</x> <x>160</x>
<y>260</y> <y>90</y>
<width>101</width> <width>101</width>
<height>23</height> <height>23</height>
</rect> </rect>
@ -2510,8 +2671,8 @@
<widget class="QCheckBox" name="chk_clearPrbCtrlRom"> <widget class="QCheckBox" name="chk_clearPrbCtrlRom">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>0</x>
<y>260</y> <y>90</y>
<width>90</width> <width>90</width>
<height>23</height> <height>23</height>
</rect> </rect>
@ -2521,6 +2682,7 @@
</property> </property>
</widget> </widget>
</widget> </widget>
</widget>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
<string>Debug</string> <string>Debug</string>
@ -3106,11 +3268,14 @@
<rect> <rect>
<x>190</x> <x>190</x>
<y>30</y> <y>30</y>
<width>218</width> <width>196</width>
<height>60</height> <height>60</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_18"> <layout class="QVBoxLayout" name="verticalLayout_18">
<property name="spacing">
<number>6</number>
</property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_55"> <layout class="QHBoxLayout" name="horizontalLayout_55">
<item> <item>
@ -3122,12 +3287,24 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Log Count En</string> <string>Log Cnt En</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="chk_afeConfig"> <widget class="QCheckBox" name="chk_afeConfig">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="font"> <property name="font">
<font> <font>
<weight>50</weight> <weight>50</weight>
@ -3143,8 +3320,17 @@
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_86"> <layout class="QHBoxLayout" name="horizontalLayout_86">
<property name="spacing">
<number>6</number>
</property>
<item> <item>
<widget class="QLabel" name="label_24"> <widget class="QLabel" name="label_24">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font"> <property name="font">
<font> <font>
<weight>50</weight> <weight>50</weight>
@ -3152,12 +3338,24 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>ADC Log Count:</string> <string>ADC Log Cnt:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="tb_adcLogCount"> <widget class="QLineEdit" name="tb_adcLogCount">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>98</width>
<height>16777215</height>
</size>
</property>
<property name="font"> <property name="font">
<font> <font>
<weight>50</weight> <weight>50</weight>
@ -3404,9 +3602,169 @@
</widget> </widget>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="tab_6">
<attribute name="title">
<string>Boards Test</string>
</attribute>
<widget class="QGroupBox" name="groupBox_18">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>801</width>
<height>101</height>
</rect>
</property>
<property name="title">
<string>Probe - Relay</string>
</property>
<widget class="QWidget" name="layoutWidget_24">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>501</width>
<height>41</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_109">
<item>
<widget class="QLabel" name="label_91">
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="text">
<string>Log Path:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="tb_prbRelayLogPath">
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_prbRelayLogBrowse">
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QPushButton" name="btn_prbRelayTestStart">
<property name="geometry">
<rect>
<x>700</x>
<y>40</y>
<width>91</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>Start</string>
</property>
</widget>
<widget class="QWidget" name="verticalLayoutWidget_21">
<property name="geometry">
<rect>
<x>520</x>
<y>29</y>
<width>172</width>
<height>61</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_28">
<property name="spacing">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_111">
<item>
<widget class="QLabel" name="label_92">
<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;Total Elements on Card : 32&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:7pt;font-weight:600; font-style:italic;&quot;&gt;Total Elements on Probe : 192&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Active Elements: </string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="tb_prbElements">
<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;Total Elements on Card : 32&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:7pt;font-weight:600; font-style:italic;&quot;&gt;Total Elements on Probe : 192&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_110">
<item>
<widget class="QLabel" name="label_93">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>calculate of count: </string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="l_prbRelayDone">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>doing</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</widget>
<widget class="QWidget" name="tab_5"> <widget class="QWidget" name="tab_5">
<attribute name="title"> <attribute name="title">
<string>Temp Test</string> <string>Temporary</string>
</attribute> </attribute>
<widget class="QPushButton" name="btn_tempTest"> <widget class="QPushButton" name="btn_tempTest">
<property name="geometry"> <property name="geometry">
@ -3782,6 +4140,86 @@
<string>Scen Change</string> <string>Scen Change</string>
</property> </property>
</widget> </widget>
<widget class="QSpinBox" name="sb_Fan1Pwm">
<property name="geometry">
<rect>
<x>560</x>
<y>10</y>
<width>71</width>
<height>51</height>
</rect>
</property>
<property name="font">
<font>
<underline>true</underline>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:9pt; font-weight:600; font-style:italic;&quot;&gt;Fan1 (D.C.)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
</string>
</property>
<property name="suffix">
<string extracomment=" "/>
</property>
<property name="prefix">
<string/>
</property>
<property name="maximum">
<number>200</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="stepType">
<enum>QAbstractSpinBox::DefaultStepType</enum>
</property>
<property name="value">
<number>10</number>
</property>
<property name="displayIntegerBase">
<number>10</number>
</property>
</widget>
<widget class="QSpinBox" name="sb_Fan2Pwm">
<property name="geometry">
<rect>
<x>560</x>
<y>70</y>
<width>71</width>
<height>51</height>
</rect>
</property>
<property name="font">
<font>
<underline>true</underline>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:9pt; font-weight:600; font-style:italic;&quot;&gt;Fan2 (D.C.)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
</string>
</property>
<property name="suffix">
<string extracomment=" "/>
</property>
<property name="prefix">
<string/>
</property>
<property name="maximum">
<number>200</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="stepType">
<enum>QAbstractSpinBox::DefaultStepType</enum>
</property>
<property name="value">
<number>10</number>
</property>
<property name="displayIntegerBase">
<number>10</number>
</property>
</widget>
</widget> </widget>
</widget> </widget>
<widget class="QGroupBox" name="groupBox_6"> <widget class="QGroupBox" name="groupBox_6">
@ -4399,7 +4837,7 @@
<widget class="QWidget" name="layoutWidget_5"> <widget class="QWidget" name="layoutWidget_5">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>0</x>
<y>140</y> <y>140</y>
<width>176</width> <width>176</width>
<height>21</height> <height>21</height>
@ -4846,6 +5284,32 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="layoutWidget_23">
<property name="geometry">
<rect>
<x>190</x>
<y>140</y>
<width>142</width>
<height>21</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_108">
<item>
<widget class="QLabel" name="label12_2">
<property name="text">
<string>MPS Temp:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="l_mpsTemp">
<property name="text">
<string>Unknown</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
<widget class="QGroupBox" name="groupBox_7"> <widget class="QGroupBox" name="groupBox_7">
<property name="geometry"> <property name="geometry">

11
src/model/hardware/core/lowLevelApi/TrxBoard.cpp

@ -1918,6 +1918,17 @@ void TrxBoard::getHealthStatus(HealthStatus* healStat) const
healStat->fpgaCoreVoltages = _coreVolt; healStat->fpgaCoreVoltages = _coreVolt;
healStat->fpgaCoreTemperature = _coreTemp; healStat->fpgaCoreTemperature = _coreTemp;
healStat->systemTemperature = this->_bCtrlMngt->getTrxTempSensor(); healStat->systemTemperature = this->_bCtrlMngt->getTrxTempSensor();
// healStat->mpsTemperature = this->_bCtrlMngt->getMpsTempSensor();
}
void TrxBoard::setTrxFanRpm(const eFanPwm &fan, const quint8 &dutyCyclePercent) const
{
if(dutyCyclePercent > 100)
{
throw SonoException("Out of range for fan duty cycle.");
}
this->_bCtrlMngt->setFanPwm(fan, dutyCyclePercent);
} }
void TrxBoard::mcsProgram(QString path) void TrxBoard::mcsProgram(QString path)

54
src/model/hardware/core/lowLevelApi/register/boardsCtrlMngt/BoardsCtrlMngt.cpp

@ -659,6 +659,20 @@ void BoardsCtrlMngt::getTrxVoltagesPg(VoltagesPg* pg)
pg->regulatorB = ((this->_tRgltorPg->regB->getValue()) != 0) ? good : bad; pg->regulatorB = ((this->_tRgltorPg->regB->getValue()) != 0) ? good : bad;
} }
float BoardsCtrlMngt::getMpsTempSensor() const
{
this->_tempSensor->sync();
quint16 temp = static_cast<quint16>(this->_tempSensor->mpsTemp->getValue());
if(temp < 0x4000 || temp > 0xC000)
{
throw SonoException("The mps temp adc value is out of range.");
}
quint32 average = 16;
return (((temp / average) * TEMP_SENSOR_RESOLUTION) - 256);
}
void BoardsCtrlMngt::getSupervisorValue(SupervisorRbValue* sValue) const void BoardsCtrlMngt::getSupervisorValue(SupervisorRbValue* sValue) const
{ {
getSupervisorI2cTimeout(); getSupervisorI2cTimeout();
@ -863,9 +877,33 @@ void BoardsCtrlMngt::getFanRpm(FanRpm* _rpm)
_rpm->fan2 = this->fanTacho<FanTacho2>(_fanTacho2); _rpm->fan2 = this->fanTacho<FanTacho2>(_fanTacho2);
} }
void BoardsCtrlMngt::setFanPwm(const eFanPwm &fan, const quint8 &dcPercent) const
{
float dcValue = static_cast<float>(100 - dcPercent) / 100; // PWM connect to ground so it's inverted.
switch(fan)
{
case fan1:
this->_fansPdw->fan1Pri->setValue(FAN1_PRI);
this->_fansPdw->fan1Pw->setValue(static_cast<quint32>(FAN1_PRI * dcValue));
this->_fansPdw->fan1LoadCfg->setValue(1);
this->_fansPdw->fan1En->setValue(1);
break;
case fan2:
this->_fansPdw->fan2Pri->setValue(FAN2_PRI);
this->_fansPdw->fan2Pw->setValue(static_cast<quint32>(FAN2_PRI * dcValue));
this->_fansPdw->fan2LoadCfg->setValue(1);
this->_fansPdw->fan2En->setValue(1);
break;
}
this->_fansPdw->update();
}
QByteArray BoardsCtrlMngt::trxEepromRead(quint32 address, quint32 length) QByteArray BoardsCtrlMngt::trxEepromRead(quint32 address, quint32 length)
{ {
if(address + length >= TRX_ROM_MAX_LEN) if(address + length > TRX_ROM_MAX_LEN)
{ {
throw SonoException("Out of range reading from TRX eeprom "); throw SonoException("Out of range reading from TRX eeprom ");
} }
@ -881,7 +919,7 @@ QByteArray BoardsCtrlMngt::trxEepromRead(quint32 address, quint32 length)
QByteArray BoardsCtrlMngt::mpsEepromRead(quint32 address, quint32 length) QByteArray BoardsCtrlMngt::mpsEepromRead(quint32 address, quint32 length)
{ {
if(address + length >= MPS_ROM_MAX_LEN) if(address + length > MPS_ROM_MAX_LEN)
{ {
throw SonoException("Out of range reading from MPS eeprom "); throw SonoException("Out of range reading from MPS eeprom ");
} }
@ -897,7 +935,7 @@ QByteArray BoardsCtrlMngt::mpsEepromRead(quint32 address, quint32 length)
QByteArray BoardsCtrlMngt::prbCtrlEepromRead(quint32 address, quint32 length) QByteArray BoardsCtrlMngt::prbCtrlEepromRead(quint32 address, quint32 length)
{ {
if(address + length >= PRB_CTRL_ROM_MAX_LEN) if(address + length > PRB_CTRL_ROM_MAX_LEN)
{ {
throw SonoException("Out of range reading from Probe Control eeprom "); throw SonoException("Out of range reading from Probe Control eeprom ");
} }
@ -913,7 +951,7 @@ QByteArray BoardsCtrlMngt::prbCtrlEepromRead(quint32 address, quint32 length)
QByteArray BoardsCtrlMngt::prbEepromRead(quint32 address, quint32 length, quint8 prbSel) QByteArray BoardsCtrlMngt::prbEepromRead(quint32 address, quint32 length, quint8 prbSel)
{ {
if(address + length >= PRB_ROM_MAX_LEN) if(address + length > PRB_ROM_MAX_LEN)
{ {
throw SonoException("Out of range reading from Probe eeprom "); throw SonoException("Out of range reading from Probe eeprom ");
} }
@ -927,7 +965,7 @@ QByteArray BoardsCtrlMngt::prbEepromRead(quint32 address, quint32 length, quint8
void trxEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards) void trxEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards)
{ {
if(arr.size() >= static_cast<qint32>(TRX_ROM_MAX_LEN)) if(address + static_cast<quint32>(arr.size()) > TRX_ROM_MAX_LEN)
{ {
throw SonoException("Out of range writing into TRX eeprom "); throw SonoException("Out of range writing into TRX eeprom ");
} }
@ -942,7 +980,7 @@ void trxEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards)
void mpsEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards) void mpsEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards)
{ {
if(arr.size() >= static_cast<qint32>(MPS_ROM_MAX_LEN)) if(address + static_cast<quint32>(arr.size()) > MPS_ROM_MAX_LEN)
{ {
throw SonoException("Out of range writing into MPS eeprom "); throw SonoException("Out of range writing into MPS eeprom ");
} }
@ -957,7 +995,7 @@ void mpsEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards)
void prbCtrlEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards) void prbCtrlEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards)
{ {
if(arr.size() >= static_cast<qint32>(PRB_CTRL_ROM_MAX_LEN)) if(address + static_cast<quint32>(arr.size()) > PRB_CTRL_ROM_MAX_LEN)
{ {
throw SonoException("Out of range writing into Probe Control eeprom "); throw SonoException("Out of range writing into Probe Control eeprom ");
} }
@ -972,7 +1010,7 @@ void prbCtrlEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards)
void prbEepromWrite(QByteArray arr, quint32 address, quint8 prbSel, BoardsCtrlMngt* boards) void prbEepromWrite(QByteArray arr, quint32 address, quint8 prbSel, BoardsCtrlMngt* boards)
{ {
if(arr.size() >= static_cast<qint32>(PRB_ROM_MAX_LEN)) if(address + static_cast<quint32>(arr.size()) > PRB_ROM_MAX_LEN)
{ {
throw SonoException("Out of range writing into Probe eeprom "); throw SonoException("Out of range writing into Probe eeprom ");
} }

Loading…
Cancel
Save