Del (a lot!)

This commit is contained in:
jfmartel 2022-12-11 13:50:51 -05:00
parent a69e88c091
commit 17e753c365
27 changed files with 1060 additions and 292 deletions

View File

@ -27,40 +27,40 @@ int CAvReceiver::Start()
} }
int CAvReceiver::SpeakerBToggleSwitchPressed(bool state) int CAvReceiver::Zone2ToggleSwitchPressed(bool state)
{ {
QByteArray SpkrState; QByteArray ZoneState;
SpkrState.clear(); ZoneState.clear();
if(state) if(state)
{ {
SpkrState.append((char)0x01); ZoneState.append((char)0x01);
} }
else else
{ {
SpkrState.append((char)0x00); ZoneState.append((char)0x00);
} }
return mNetworkInterface->SendMasterCtrlCommand(AV_RECEIVER_INTERFACE_SET_SPEAKERB_REQUEST,SpkrState); return mNetworkInterface->SendMasterCtrlCommand(AV_RECEIVER_INTERFACE_SET_ZONE2_REQUEST,ZoneState);
} }
int CAvReceiver::SpeakerAToggleSwitchPressed(bool state) int CAvReceiver::MainUnitToggleSwitchPressed(bool state)
{ {
QByteArray SpkrState; QByteArray ZoneState;
SpkrState.clear(); ZoneState.clear();
if(state) if(state)
{ {
SpkrState.append((char)0x01); ZoneState.append((char)0x01);
} }
else else
{ {
SpkrState.append((char)0x00); ZoneState.append((char)0x00);
} }
return mNetworkInterface->SendMasterCtrlCommand(AV_RECEIVER_INTERFACE_SET_SPEAKERA_REQUEST,SpkrState); return mNetworkInterface->SendMasterCtrlCommand(AV_RECEIVER_INTERFACE_SET_MAIN_ZONE_REQUEST,ZoneState);
} }
@ -71,6 +71,11 @@ void CAvReceiver::PollTimerExpired()
int CAvReceiver::ReceiverGeneralStatusReceived(QByteArray StatusData) int CAvReceiver::ReceiverGeneralStatusReceived(QByteArray StatusData)
{ {
mReceiverStatus.FromByteArray(StatusData); QDataStream Strm(&StatusData,QIODevice::ReadOnly | QIODevice::Unbuffered);
mReceiverGui->UpdateReceiverStatus(mReceiverStatus); Strm.device()->seek(0);
Strm >> mReceiverStatus;
Strm >> mZone2Status;
mReceiverGui->UpdateReceiverStatus(mReceiverStatus, mZone2Status);
return RET_OK;
} }

View File

@ -17,8 +17,8 @@ public:
int Start(); int Start();
int SpeakerBToggleSwitchPressed(bool state); int Zone2ToggleSwitchPressed(bool state);
int SpeakerAToggleSwitchPressed(bool state); int MainUnitToggleSwitchPressed(bool state);
int ReceiverGeneralStatusReceived(QByteArray StatusData); int ReceiverGeneralStatusReceived(QByteArray StatusData);
CAvReceiverNetworkCtrlInterface *mNetworkInterface; CAvReceiverNetworkCtrlInterface *mNetworkInterface;
@ -27,6 +27,7 @@ public:
private: private:
CAvReceiverMainStatus mReceiverStatus; CAvReceiverMainStatus mReceiverStatus;
CAvReceiverMainStatus mZone2Status;
public slots: public slots:
void PollTimerExpired(); void PollTimerExpired();

View File

@ -20,8 +20,6 @@ QByteArray CAvReceiverMainStatus::ToByteArray()
Strm << mIsMute; Strm << mIsMute;
Strm << mInput; Strm << mInput;
Strm << mProgram; Strm << mProgram;
Strm << mSpeakerAState;
Strm << mSpeakerBState;
Strm << mDataValid; Strm << mDataValid;
Strm << mReceiverOnline; Strm << mReceiverOnline;
@ -41,8 +39,6 @@ int CAvReceiverMainStatus::FromByteArray(QByteArray Data)
Strm >> mIsMute; Strm >> mIsMute;
Strm >> mInput; Strm >> mInput;
Strm >> mProgram; Strm >> mProgram;
Strm >> mSpeakerAState;
Strm >> mSpeakerBState;
Strm >> mDataValid; Strm >> mDataValid;
Strm >> mReceiverOnline; Strm >> mReceiverOnline;
@ -50,3 +46,29 @@ int CAvReceiverMainStatus::FromByteArray(QByteArray Data)
return RET_OK; return RET_OK;
} }
QDataStream &operator<<(QDataStream &out, const CAvReceiverMainStatus &source)
{
out << source.mMainPwrStatus
<< source.mMainSleepStatus
<< source.mMainVolume
<< source.mIsMute
<< source.mInput
<< source.mProgram
<< source.mDataValid
<< source.mReceiverOnline;
return out;
}
QDataStream &operator>>(QDataStream &in, CAvReceiverMainStatus &dest)
{
in >> dest.mMainPwrStatus
>> dest.mMainSleepStatus
>> dest.mMainVolume
>> dest.mIsMute
>> dest.mInput
>> dest.mProgram
>> dest.mDataValid
>> dest.mReceiverOnline;
return in;
}

View File

@ -19,12 +19,12 @@ public:
bool mIsMute; bool mIsMute;
QString mInput; QString mInput;
QString mProgram; QString mProgram;
bool mSpeakerAState;
bool mSpeakerBState;
bool mDataValid; bool mDataValid;
bool mReceiverOnline; bool mReceiverOnline;
}; };
QDataStream &operator<<(QDataStream &out, const CAvReceiverMainStatus &source);
QDataStream &operator>>(QDataStream &in, CAvReceiverMainStatus &dest);
#endif // AVRECEIVERDATA_H #endif // AVRECEIVERDATA_H

View File

@ -9,8 +9,8 @@ CAvReceiverGui::CAvReceiverGui(QWidget *parent) :
{ {
ui->setupUi(this); ui->setupUi(this);
connect(ui->mSpkBCheckBox,SIGNAL(toggled(bool)),this,SLOT(SpeakerBRadioClicked(bool))); connect(ui->mSpkBCheckBox,SIGNAL(clicked(bool)),this,SLOT(SpeakerBRadioClicked(bool)));
connect(ui->mSpkACheckBox,SIGNAL(toggled(bool)),this,SLOT(SpeakerARadioClicked(bool))); connect(ui->mSpkACheckBox,SIGNAL(clicked(bool)),this,SLOT(SpeakerARadioClicked(bool)));
} }
CAvReceiverGui::~CAvReceiverGui() CAvReceiverGui::~CAvReceiverGui()
@ -20,29 +20,31 @@ CAvReceiverGui::~CAvReceiverGui()
void CAvReceiverGui::SpeakerBRadioClicked(bool checked) void CAvReceiverGui::SpeakerBRadioClicked(bool checked)
{ {
mProgramHandle->SpeakerBToggleSwitchPressed(checked); mProgramHandle->Zone2ToggleSwitchPressed(checked);
} }
void CAvReceiverGui::SpeakerARadioClicked(bool checked) void CAvReceiverGui::SpeakerARadioClicked(bool checked)
{ {
mProgramHandle->SpeakerAToggleSwitchPressed(checked); mProgramHandle->MainUnitToggleSwitchPressed(checked);
} }
int CAvReceiverGui::UpdateReceiverStatus(CAvReceiverMainStatus Status) int CAvReceiverGui::UpdateReceiverStatus(CAvReceiverMainStatus Status, CAvReceiverMainStatus Zone2Status)
{ {
QString StatusText; QString StatusText;
StatusText.clear(); StatusText.clear();
StatusText += "Receiver Status:\n\n"; StatusText += "Main Receiver Status:\n\n";
StatusText += "Power: "; StatusText += "Power: ";
if(Status.mMainPwrStatus == true) if(Status.mMainPwrStatus == true)
{ {
StatusText += "ON\n"; StatusText += "ON\n";
ui->mSpkACheckBox->setChecked(true);
} }
else else
{ {
StatusText += "OFF\n"; StatusText += "OFF\n";
ui->mSpkACheckBox->setChecked(false);
} }
StatusText += "Mute: "; StatusText += "Mute: ";
@ -75,20 +77,17 @@ int CAvReceiverGui::UpdateReceiverStatus(CAvReceiverMainStatus Status)
StatusText +=Status.mProgram; StatusText +=Status.mProgram;
StatusText += "\n"; StatusText += "\n";
StatusText += "Zone A: "; ui->mRcvrStatusLabel->setText(StatusText);
if(Status.mSpeakerAState == true)
{
StatusText += "ON\n";
ui->mSpkACheckBox->setChecked(true);
}
else
{
StatusText += "OFF\n";
ui->mSpkACheckBox->setChecked(false);
}
StatusText += "Zone B: ";
if(Status.mSpeakerBState == true)
StatusText = "Zone2 Status\n\n";
StatusText += "Power: ";
if(Zone2Status.mMainPwrStatus == true)
{ {
StatusText += "ON\n"; StatusText += "ON\n";
ui->mSpkBCheckBox->setChecked(true); ui->mSpkBCheckBox->setChecked(true);
@ -99,6 +98,38 @@ int CAvReceiverGui::UpdateReceiverStatus(CAvReceiverMainStatus Status)
ui->mSpkBCheckBox->setChecked(false); ui->mSpkBCheckBox->setChecked(false);
} }
StatusText += "Mute: ";
if(Zone2Status.mIsMute == true)
{
StatusText += "ON\n";
}
else
{
StatusText += "OFF\n";
}
ui->mRcvrStatusLabel->setText(StatusText); StatusText += "Main sleep: ";
if(Zone2Status.mMainSleepStatus == true)
{
StatusText += "ON\n";
}
else
{
StatusText += "OFF\n";
}
StatusText += "Volume: ";
StatusText += QString("%1").arg(Zone2Status.mMainVolume);
StatusText +="\n";
StatusText += "Input: ";
StatusText +=Zone2Status.mInput;
StatusText += "\n";
StatusText += "Program: ";
StatusText +=Zone2Status.mProgram;
StatusText += "\n";
ui->mZone2StatusLabel->setText(StatusText);
return RET_OK;
} }

View File

@ -19,7 +19,7 @@ public:
CAvReceiver *mProgramHandle; CAvReceiver *mProgramHandle;
int UpdateReceiverStatus(CAvReceiverMainStatus Status); int UpdateReceiverStatus(CAvReceiverMainStatus Status, CAvReceiverMainStatus Zone2Status);
private: private:
Ui::CAvReceiverGui *ui; Ui::CAvReceiverGui *ui;

View File

@ -29,8 +29,8 @@
<widget class="QLabel" name="mRcvrStatusLabel"> <widget class="QLabel" name="mRcvrStatusLabel">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>100</x> <x>50</x>
<y>110</y> <y>130</y>
<width>181</width> <width>181</width>
<height>231</height> <height>231</height>
</rect> </rect>
@ -42,27 +42,40 @@
<widget class="QCheckBox" name="mSpkBCheckBox"> <widget class="QCheckBox" name="mSpkBCheckBox">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>570</x> <x>280</x>
<y>130</y> <y>110</y>
<width>70</width> <width>70</width>
<height>17</height> <height>17</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>Speaker B</string> <string>Zone 2</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="mSpkACheckBox"> <widget class="QCheckBox" name="mSpkACheckBox">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>570</x> <x>50</x>
<y>160</y> <y>110</y>
<width>70</width> <width>70</width>
<height>17</height> <height>17</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>Speaker A</string> <string>Main Zone</string>
</property>
</widget>
<widget class="QLabel" name="mZone2StatusLabel">
<property name="geometry">
<rect>
<x>300</x>
<y>140</y>
<width>171</width>
<height>191</height>
</rect>
</property>
<property name="text">
<string>TextLabel</string>
</property> </property>
</widget> </widget>
</widget> </widget>

View File

@ -39,7 +39,7 @@ int CAvReceiverNetworkCtrlInterface::DeviceFrameReceived(int TargetDeviceID, int
break; break;
} }
case AV_RECEIVER_INTERFACE_SET_SPEAKERB_RESPONSE: case AV_RECEIVER_INTERFACE_SET_ZONE2_RESPONSE:
{ {
break; break;
} }
@ -50,7 +50,7 @@ int CAvReceiverNetworkCtrlInterface::DeviceFrameReceived(int TargetDeviceID, int
} }
case AV_RECEIVER_INTERFACE_GENERAL_STATUS_REQUEST: case AV_RECEIVER_INTERFACE_GENERAL_STATUS_REQUEST:
case AV_RECEIVER_INTERFACE_SET_MAIN_POWER_REQUEST: case AV_RECEIVER_INTERFACE_SET_MAIN_POWER_REQUEST:
case AV_RECEIVER_INTERFACE_SET_SPEAKERB_REQUEST: case AV_RECEIVER_INTERFACE_SET_ZONE2_REQUEST:
case AV_RECEIVER_INTERFACE_SEND_DIRECT_CMD_REQUEST: case AV_RECEIVER_INTERFACE_SEND_DIRECT_CMD_REQUEST:
default: default:
{ {

View File

@ -137,6 +137,40 @@ int CChalet::RequestDeviceWifiParams()
int CChalet::RequestFirmwareVersion() int CChalet::RequestFirmwareVersion()
{ {
mNetworkInterface->SendMasterCtrlCommand(CHALET_INTERFACE_GET_FIRMWARE_VERSION_REQUEST,QByteArray()); mNetworkInterface->SendMasterCtrlCommand(CHALET_INTERFACE_GET_FIRMWARE_VERSION_REQUEST,QByteArray());
return RET_OK;
}
int CChalet::RequestClearCommStats()
{
mNetworkInterface->SendMasterCtrlCommand(CHALET_INTERFACE_CLEAR_COMMS_STATS_REQUEST,QByteArray());
return RET_OK;
}
int CChalet::RequestWifiStatus()
{
mNetworkInterface->SendMasterCtrlCommand(CHALET_INTERFACE_GET_WIFI_STATUS_REQUEST,QByteArray());
return RET_OK;
}
int CChalet::WifiStatusReceived(QByteArray Data)
{
quint32 Add = 0;
char byte;
byte = Data.at(1);
Add += (quint32)(byte & 0x000000FF);
Add <<= 8;
byte = Data.at(2);
Add += (quint32)(byte & 0x000000FF);
Add <<= 8;
byte = Data.at(3);
Add += (quint32)(byte & 0x000000FF);
Add <<= 8;
byte = Data.at(4);
Add += (quint32)(byte & 0x000000FF);
QHostAddress IP = QHostAddress(Add);
mChaletGui->UpdateDeviceWifiStatus(Data[0],IP);
return RET_OK;
} }
int CChalet::DeviceWiFiParamsReceived(QByteArray *Data) int CChalet::DeviceWiFiParamsReceived(QByteArray *Data)
@ -170,7 +204,22 @@ int CChalet::DeviceWiFiParamsReceived(QByteArray *Data)
Add += (quint32)(byte & 0x000000FF); Add += (quint32)(byte & 0x000000FF);
QHostAddress Gateway = QHostAddress(Add); QHostAddress Gateway = QHostAddress(Add);
mChaletGui->UpdateDeviceWiFiParameters(IP, Gateway); QString APName, APPassword;
quint8 APNameLenght, APPasswordLenght;
bool UseDHCP = false;
if(Data->size() > 9)
{
if(Data->at(8) == 1)
UseDHCP = true;
APNameLenght = Data->at(9);
APPasswordLenght = Data->at(10);
APName = QString(Data->mid(11,APNameLenght));
APPassword = QString(Data->mid(11+APNameLenght,APPasswordLenght));
}
mChaletGui->UpdateDeviceWiFiParameters(IP, Gateway,APName,APPassword,UseDHCP);
return RET_OK; return RET_OK;
} }
@ -179,10 +228,17 @@ int CChalet::DeviceFirmwareVersionReceived(QByteArray Data)
mChaletGui->UpdateFirmwareVersion(Data); mChaletGui->UpdateFirmwareVersion(Data);
} }
int CChalet::SetDeviceWifiParams(QString IP, QString Gateway) int CChalet::SetDeviceWifiParams(QString IP, QString Gateway, bool UseDHCP, QString APName, QString APPwd)
{ {
QHostAddress DeviceIP; QHostAddress DeviceIP;
QHostAddress DeviceGateway; QHostAddress DeviceGateway;
quint8 APNameLength, APPwdLength;
if(APName.length() > 64)
return RET_ERROR;
if(APPwd.length() > 64)
return RET_ERROR;
if(DeviceIP.setAddress(IP) == false) if(DeviceIP.setAddress(IP) == false)
{ {
@ -226,6 +282,22 @@ int CChalet::SetDeviceWifiParams(QString IP, QString Gateway)
Buffer[4] = byte; Buffer[4] = byte;
Address >>= 8; Address >>= 8;
if(UseDHCP)
{
Buffer[8] = 1;
}
else
{
Buffer[8] = 0;
}
Buffer.append(APName.length());
Buffer.append(APPwd.length());
Buffer.append(APName);
Buffer.append(APPwd);
mNetworkInterface->SendMasterCtrlCommand(CHALET_INTERFACE_WIFI_SET_DEVICE_PARAMS_REQUEST,Buffer); mNetworkInterface->SendMasterCtrlCommand(CHALET_INTERFACE_WIFI_SET_DEVICE_PARAMS_REQUEST,Buffer);
return RET_OK; return RET_OK;

View File

@ -34,9 +34,12 @@ public:
int RequestChaletLogs(QDate StartDate); int RequestChaletLogs(QDate StartDate);
int RequestDeviceWifiParams(); int RequestDeviceWifiParams();
int DeviceWiFiParamsReceived(QByteArray *Data); int DeviceWiFiParamsReceived(QByteArray *Data);
int SetDeviceWifiParams(QString IP, QString Gateway); int SetDeviceWifiParams(QString IP, QString Gateway, bool UseDHCP, QString APName, QString APPwd);
int RequestFirmwareVersion(); int RequestFirmwareVersion();
int DeviceFirmwareVersionReceived(QByteArray Data); int DeviceFirmwareVersionReceived(QByteArray Data);
int RequestClearCommStats();
int RequestWifiStatus();
int WifiStatusReceived(QByteArray Data);
signals: signals:

View File

@ -48,7 +48,10 @@ QDataStream &operator>>(QDataStream &in, CChaletMainStatus &dest)
>> dest.mThisStatusDateTime >> dest.mThisStatusDateTime
>> dest.mLastLoraStatus >> dest.mLastLoraStatus
>> dest.mStatusToggleBit >> dest.mStatusToggleBit
>> dest.mChaletTemperature; >> dest.mChaletTemperature
>> dest.mTotalNbChaletRxCmds
>> dest.mTotalMasterTxCmds
>> dest.mMasterLostRequestCount;
return in; return in;
} }

View File

@ -58,6 +58,10 @@ public:
float mLostRequestPercentage; float mLostRequestPercentage;
int mTotalNbChaletRxCmds;
int mTotalMasterTxCmds;
int mMasterLostRequestCount;
}; };
QDataStream &operator>>(QDataStream &in, CChaletMainStatus &dest); QDataStream &operator>>(QDataStream &in, CChaletMainStatus &dest);

View File

@ -39,6 +39,8 @@ CChaletGui::CChaletGui(QWidget *parent) :
connect(ui->mStartTerminalShellBtn,SIGNAL(clicked(bool)),this,SLOT(StartTerminalShellBtnClicked())); connect(ui->mStartTerminalShellBtn,SIGNAL(clicked(bool)),this,SLOT(StartTerminalShellBtnClicked()));
connect(mGetFimwVersionButtonColorTimer,SIGNAL(timeout()),this,SLOT(GetFirmwVersionBtnColorTimerExpired())); connect(mGetFimwVersionButtonColorTimer,SIGNAL(timeout()),this,SLOT(GetFirmwVersionBtnColorTimerExpired()));
connect(mGetWifiParamsButtonColorTimer,SIGNAL(timeout()),this,SLOT(GetWifiParamsBtnColorTimerExpired())); connect(mGetWifiParamsButtonColorTimer,SIGNAL(timeout()),this,SLOT(GetWifiParamsBtnColorTimerExpired()));
connect(ui->mResetCommStatsBtn,SIGNAL(clicked(bool)),this,SLOT(ResetCommStatsBtnClicked()));
connect(ui->mGetWifiStatusBtn,SIGNAL(clicked(bool)),this,SLOT(GetModuleWifiStatusBtnClicked()));
mBatteryPlotWidget = new QCustomPlot(ui->mPlotWidget); mBatteryPlotWidget = new QCustomPlot(ui->mPlotWidget);
mBatteryPlotWidget->resize(ui->mPlotWidget->size()); mBatteryPlotWidget->resize(ui->mPlotWidget->size());
@ -77,6 +79,21 @@ CChaletGui::CChaletGui(QWidget *parent) :
mFirmVersionDefaultBtnPal = ui->mGetFirmwareVersionBtn->palette(); mFirmVersionDefaultBtnPal = ui->mGetFirmwareVersionBtn->palette();
mWifiDefaultBtnPal = ui->mGetFirmwareVersionBtn->palette(); mWifiDefaultBtnPal = ui->mGetFirmwareVersionBtn->palette();
mChaletLastLostReqCount = 0;
ui->mWiFiModuleStatusLabel->setText("Unknown");
ui->mInverterRlyStatusLabel->setText("Unknown");
ui->mCurrentSensorStateLbl->setText("Current Sensor: Unknown state");
ui->mBatteryVoltageLabel->setText("Battery Voltage: Unknown");
ui->mBatterySOCLabel->setText("Battery SOC: Unknown");
ui->mSolarPanelCurrentLabel->setText("Raw Solar Panel Current: Unknown");
ui->mSolarPanelCurrentCnvLbl->setText("Solar Panel Current (A): Unknown");
ui->mLostReqPercentLbl->setText("N/A");
ui->mTotalRxTxRequestsLbl->setText("Chalet Rx req: ??");
ui->mChaletTemperatureLbl->setText("Temperature: -100)");
} }
CChaletGui::~CChaletGui() CChaletGui::~CChaletGui()
@ -102,15 +119,16 @@ int CChaletGui::UpdateChaletStatus(CChaletMainStatus Status)
pal.setColor(QPalette::WindowText,QColor(Qt::red)); pal.setColor(QPalette::WindowText,QColor(Qt::red));
ui->mChaletOnlineStatusLbl->setPalette(pal); ui->mChaletOnlineStatusLbl->setPalette(pal);
ui->mWiFiModuleStatusLabel->setText("Unknown"); // ui->mWiFiModuleStatusLabel->setText("Unknown");
ui->mInverterRlyStatusLabel->setText("Unknown"); // ui->mInverterRlyStatusLabel->setText("Unknown");
ui->mCurrentSensorStateLbl->setText("Current Sensor: Unknown state"); // ui->mCurrentSensorStateLbl->setText("Current Sensor: Unknown state");
ui->mBatteryVoltageLabel->setText("Battery Voltage: Unknown"); // ui->mBatteryVoltageLabel->setText("Battery Voltage: Unknown");
ui->mBatterySOCLabel->setText("Battery SOC: Unknown"); // ui->mBatterySOCLabel->setText("Battery SOC: Unknown");
ui->mSolarPanelCurrentLabel->setText("Raw Solar Panel Current: Unknown"); // ui->mSolarPanelCurrentLabel->setText("Raw Solar Panel Current: Unknown");
ui->mSolarPanelCurrentCnvLbl->setText("Solar Panel Current (A): Unknown"); // ui->mSolarPanelCurrentCnvLbl->setText("Solar Panel Current (A): Unknown");
ui->mLostReqPercentLbl->setText("N/A"); // ui->mLostReqPercentLbl->setText("N/A");
ui->mChaletTemperatureLbl->setText("Temperature: -100)"); // ui->mTotalRxTxRequestsLbl->setText("Chalet Rx req: ??");
// ui->mChaletTemperatureLbl->setText("Temperature: -100)");
return RET_OK; return RET_OK;
@ -207,12 +225,11 @@ int CChaletGui::UpdateChaletStatus(CChaletMainStatus Status)
QString Voltage = QString("Battery Voltage: %1").arg(Status.mBatteryVoltage); QString Voltage = QString("Battery Voltage: %1").arg(Status.mBatteryVoltage);
ui->mBatteryVoltageLabel->setText(Voltage); ui->mBatteryVoltageLabel->setText(Voltage);
QString Current = QString("Raw Solar Panel Current: %1").arg(Status.mBatteryCurrent); QString Current = QString("Raw Solar Panel Current: %1").arg(Status.mBatteryCurrent - 2);
ui->mSolarPanelCurrentLabel->setText(Current); ui->mSolarPanelCurrentLabel->setText(Current);
float ConvertedCurrent = (float)Status.mBatteryCurrent * (3.3/1023); //*0.080645; // 3.3/(1023*0.04) = 0.080645; float ConvertedCurrent = (float)(Status.mBatteryCurrent - 2) * (3.3/1023); //*0.080645; // 3.3/(1023*0.04) = 0.080645;
ConvertedCurrent -= (3.3/2); ConvertedCurrent /= 0.08;
ConvertedCurrent *= 25;
QString CnvCurrent = QString("Solar Panel Current (A): %1").arg(ConvertedCurrent); QString CnvCurrent = QString("Solar Panel Current (A): %1").arg(ConvertedCurrent);
ui->mSolarPanelCurrentCnvLbl->setText(CnvCurrent); ui->mSolarPanelCurrentCnvLbl->setText(CnvCurrent);
@ -225,6 +242,16 @@ int CChaletGui::UpdateChaletStatus(CChaletMainStatus Status)
ui->mLostReqPercentLbl->setText(Percent); ui->mLostReqPercentLbl->setText(Percent);
QString ChaletRxCnt = QString("Chalet Rx req: %1, Master Tx cmds: %2, Master lost reqs: %3").arg(Status.mTotalNbChaletRxCmds).arg(Status.mTotalMasterTxCmds).arg(Status.mMasterLostRequestCount);
ui->mTotalRxTxRequestsLbl->setText(ChaletRxCnt);
if(mChaletLastLostReqCount != Status.mMasterLostRequestCount)
{
QString ChaletLostReqStats = QString("Master --> Chalet: %1\nChalet --> Master: %2").arg((Status.mTotalMasterTxCmds-Status.mTotalNbChaletRxCmds)).arg(Status.mMasterLostRequestCount-(Status.mTotalMasterTxCmds-Status.mTotalNbChaletRxCmds));
ui->mLostReqsStatsLbl->setText(ChaletLostReqStats);
}
mChaletLastLostReqCount = Status.mMasterLostRequestCount;
if(Status.mStatusToggleBit != LastToggle) if(Status.mStatusToggleBit != LastToggle)
{ {
LastToggle = Status.mStatusToggleBit; LastToggle = Status.mStatusToggleBit;
@ -346,20 +373,24 @@ void CChaletGui::RebootCPUButtonClicked()
void CChaletGui::GetDeviceWiFiParamsButtonClicked(bool state) void CChaletGui::GetDeviceWiFiParamsButtonClicked(bool state)
{ {
mProgramHandle->RequestDeviceWifiParams(); mProgramHandle->RequestDeviceWifiParams();
} }
void CChaletGui::SetDeviceWiFiParamsButtonClicked(bool state) void CChaletGui::SetDeviceWiFiParamsButtonClicked(bool state)
{ {
if(mProgramHandle->SetDeviceWifiParams(ui->mWiFiIPAddressEditBx->text(),ui->mWiFiGatewayAddressEditBx->text()) == RET_ERROR) bool UseDHCP = ui->mDHCPEnableChkBx->isChecked();
if(mProgramHandle->SetDeviceWifiParams(ui->mWiFiIPAddressEditBx->text(),ui->mWiFiGatewayAddressEditBx->text(),UseDHCP,ui->mWifiAccessPtNameEditBx->text(),ui->mWifiPasswordEditBx->text()) == RET_ERROR)
{ {
QMessageBox::critical(this,"IP error","Invalid IP address"); QMessageBox::critical(this,"IP error","Invalid IP address");
} }
}
} void CChaletGui::UpdateDeviceWiFiParameters(QHostAddress IP, QHostAddress Gateway, QString APName, QString APPassword, bool UseDHCP)
void CChaletGui::UpdateDeviceWiFiParameters(QHostAddress IP, QHostAddress Gateway)
{ {
ui->mWiFiIPAddressEditBx->setText(IP.toString()); ui->mWiFiIPAddressEditBx->setText(IP.toString());
ui->mWiFiGatewayAddressEditBx->setText(Gateway.toString()); ui->mWiFiGatewayAddressEditBx->setText(Gateway.toString());
ui->mWifiAccessPtNameEditBx->setText(APName);
ui->mWifiPasswordEditBx->setText(APPassword);
ui->mDHCPEnableChkBx->setChecked(UseDHCP);
QPalette pal = ui->mWiFiGetRemoteSettingsBtn->palette(); QPalette pal = ui->mWiFiGetRemoteSettingsBtn->palette();
pal.setColor(QPalette::Button, QColor(Qt::green)); pal.setColor(QPalette::Button, QColor(Qt::green));
@ -375,6 +406,14 @@ void CChaletGui::RebootCPUButtonClicked()
mProgramHandle->RequestFirmwareVersion(); mProgramHandle->RequestFirmwareVersion();
} }
void CChaletGui::ResetCommStatsBtnClicked()
{
mChaletLastLostReqCount = 0;
QString ChaletLostReqStats = QString("Master --> Chalet: 0\nChalet --> Master: 0");
ui->mLostReqsStatsLbl->setText(ChaletLostReqStats);
mProgramHandle->RequestClearCommStats();
}
void CChaletGui::UpdateFirmwareVersion(QByteArray Version) void CChaletGui::UpdateFirmwareVersion(QByteArray Version)
{ {
QString VersionString(Version); QString VersionString(Version);
@ -391,18 +430,44 @@ void CChaletGui::RebootCPUButtonClicked()
} }
void CChaletGui::UpdateDeviceWifiStatus(char WifiState, QHostAddress IP)
{
QString Txt = QString("Module IP Address: %1").arg(IP.toString());
ui->mModuleIPAddressLbl->setText(Txt);
mModuleIPAddress = IP;
}
void CChaletGui::StartSyslogShellBtnClicked() void CChaletGui::StartSyslogShellBtnClicked()
{ {
//system("c:\\progra~1\\putty\\putty.exe -load \"0-ChaletDuino_Syslog\""); //system("c:\\progra~1\\putty\\putty.exe -load \"0-ChaletDuino_Syslog\"");
// QProcess Putty; // QProcess Putty;
//QProcess::startDetached("c:\\progra~1\\putty\\putty.exe -load \"0-ChaletDuino_Syslog\"");
if(mModuleIPAddress.isNull() || mModuleIPAddress.isBroadcast())
{
QProcess::startDetached("c:\\progra~1\\putty\\putty.exe -load \"0-ChaletDuino_Syslog\""); QProcess::startDetached("c:\\progra~1\\putty\\putty.exe -load \"0-ChaletDuino_Syslog\"");
} }
else
{
QString Proc = QString("c:\\progra~1\\putty\\putty.exe -raw -P 87 %1").arg(mModuleIPAddress.toString());
QProcess::startDetached(Proc);
}
}
void CChaletGui::StartTerminalShellBtnClicked() void CChaletGui::StartTerminalShellBtnClicked()
{ {
// system("c:\\program files\\putty\\putty.exe -load \"0-ChaletDuino_Terminal\""); // system("c:\\program files\\putty\\putty.exe -load \"0-ChaletDuino_Terminal\"");
// QProcess::startDetached("c:\\progra~1\\putty\\putty.exe -load \"0-ChaletDuino_Terminal\"");
if(mModuleIPAddress.isNull() || mModuleIPAddress.isBroadcast())
{
QProcess::startDetached("c:\\progra~1\\putty\\putty.exe -load \"0-ChaletDuino_Terminal\""); QProcess::startDetached("c:\\progra~1\\putty\\putty.exe -load \"0-ChaletDuino_Terminal\"");
} }
else
{
QString Proc = QString("c:\\progra~1\\putty\\putty.exe -raw -P 85 %1").arg(mModuleIPAddress.toString());
QProcess::startDetached(Proc);
}
}
void CChaletGui::GetFirmwVersionBtnColorTimerExpired() void CChaletGui::GetFirmwVersionBtnColorTimerExpired()
{ {
@ -417,3 +482,9 @@ void CChaletGui::RebootCPUButtonClicked()
ui->mWiFiGetRemoteSettingsBtn->setPalette(mFirmVersionDefaultBtnPal); ui->mWiFiGetRemoteSettingsBtn->setPalette(mFirmVersionDefaultBtnPal);
ui->mWiFiGetRemoteSettingsBtn->update(); ui->mWiFiGetRemoteSettingsBtn->update();
} }
void CChaletGui::GetModuleWifiStatusBtnClicked()
{
ui->mModuleIPAddressLbl->setText("Module IP Address: ");
mProgramHandle->RequestWifiStatus();
}

View File

@ -28,6 +28,8 @@ public:
int ChaletCommActivity(); int ChaletCommActivity();
QTimer *mGetWifiParamsButtonColorTimer, *mGetFimwVersionButtonColorTimer; QTimer *mGetWifiParamsButtonColorTimer, *mGetFimwVersionButtonColorTimer;
QPalette mFirmVersionDefaultBtnPal, mWifiDefaultBtnPal; QPalette mFirmVersionDefaultBtnPal, mWifiDefaultBtnPal;
int mChaletLastLostReqCount;
QHostAddress mModuleIPAddress;
private: private:
Ui::CChaletGui *ui; Ui::CChaletGui *ui;
@ -43,13 +45,16 @@ public slots:
void GetChaletLogsBtnClicked(); void GetChaletLogsBtnClicked();
void GetDeviceWiFiParamsButtonClicked(bool); void GetDeviceWiFiParamsButtonClicked(bool);
void SetDeviceWiFiParamsButtonClicked(bool); void SetDeviceWiFiParamsButtonClicked(bool);
void UpdateDeviceWiFiParameters(QHostAddress IP,QHostAddress Gateway); void UpdateDeviceWiFiParameters(QHostAddress IP,QHostAddress Gateway,QString APName, QString APPassword, bool UseDHCP);
void GetFirmwareVersionBtnClicked(); void GetFirmwareVersionBtnClicked();
void UpdateFirmwareVersion(QByteArray Version); void UpdateFirmwareVersion(QByteArray Version);
void StartSyslogShellBtnClicked(); void StartSyslogShellBtnClicked();
void StartTerminalShellBtnClicked(); void StartTerminalShellBtnClicked();
void GetWifiParamsBtnColorTimerExpired(); void GetWifiParamsBtnColorTimerExpired();
void GetFirmwVersionBtnColorTimerExpired(); void GetFirmwVersionBtnColorTimerExpired();
void ResetCommStatsBtnClicked();
void UpdateDeviceWifiStatus(char WifiState, QHostAddress IP);
void GetModuleWifiStatusBtnClicked();
}; };

View File

@ -268,8 +268,8 @@
<widget class="QLabel" name="mLostReqPercentLbl"> <widget class="QLabel" name="mLostReqPercentLbl">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>600</x> <x>430</x>
<y>190</y> <y>160</y>
<width>241</width> <width>241</width>
<height>16</height> <height>16</height>
</rect> </rect>
@ -291,8 +291,8 @@
<widget class="QLabel" name="mChaletCommActivityLbl"> <widget class="QLabel" name="mChaletCommActivityLbl">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>600</x> <x>430</x>
<y>170</y> <y>140</y>
<width>47</width> <width>47</width>
<height>16</height> <height>16</height>
</rect> </rect>
@ -304,8 +304,8 @@
<widget class="QLabel" name="mLasCommRequestReceivedLbl"> <widget class="QLabel" name="mLasCommRequestReceivedLbl">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>600</x> <x>430</x>
<y>150</y> <y>120</y>
<width>301</width> <width>301</width>
<height>16</height> <height>16</height>
</rect> </rect>
@ -317,7 +317,7 @@
<widget class="QDateEdit" name="mLogStartDateEdit"> <widget class="QDateEdit" name="mLogStartDateEdit">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>780</x> <x>520</x>
<y>210</y> <y>210</y>
<width>110</width> <width>110</width>
<height>22</height> <height>22</height>
@ -327,7 +327,7 @@
<widget class="QPushButton" name="mGetChaletLogButton"> <widget class="QPushButton" name="mGetChaletLogButton">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>900</x> <x>640</x>
<y>210</y> <y>210</y>
<width>75</width> <width>75</width>
<height>23</height> <height>23</height>
@ -350,11 +350,23 @@
<string>Temperature:</string> <string>Temperature:</string>
</property> </property>
</widget> </widget>
<widget class="QLineEdit" name="mWiFiIPAddressEditBx"> <widget class="QGroupBox" name="groupBox_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>160</x> <x>70</x>
<y>430</y> <y>380</y>
<width>321</width>
<height>231</height>
</rect>
</property>
<property name="title">
<string>WiFi parameters (stored in flash)</string>
</property>
<widget class="QLineEdit" name="mWifiAccessPtNameEditBx">
<property name="geometry">
<rect>
<x>80</x>
<y>110</y>
<width>221</width> <width>221</width>
<height>20</height> <height>20</height>
</rect> </rect>
@ -366,37 +378,63 @@
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
<widget class="QPushButton" name="mWiFiGetRemoteSettingsBtn"> <widget class="QLabel" name="mAccessPtNameLabel">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>160</x> <x>10</x>
<y>400</y> <y>110</y>
<width>75</width> <width>71</width>
<height>23</height> <height>20</height>
</rect> </rect>
</property> </property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text"> <property name="text">
<string>GET</string> <string>Access Pt:</string>
</property> </property>
</widget> </widget>
<widget class="QPushButton" name="mWiFiSetRemoteSettingsBtn"> <widget class="QLabel" name="mAccessPtPassLbl">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>250</x> <x>10</x>
<y>400</y> <y>140</y>
<width>75</width> <width>71</width>
<height>23</height> <height>20</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Password:</string>
</property>
</widget>
<widget class="QLineEdit" name="mWifiPasswordEditBx">
<property name="geometry">
<rect>
<x>80</x>
<y>140</y>
<width>221</width>
<height>20</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>SET</string> <string>?</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>90</x> <x>10</x>
<y>430</y> <y>50</y>
<width>71</width> <width>71</width>
<height>20</height> <height>20</height>
</rect> </rect>
@ -410,11 +448,11 @@
<string>IP Address:</string> <string>IP Address:</string>
</property> </property>
</widget> </widget>
<widget class="QLineEdit" name="mWiFiGatewayAddressEditBx"> <widget class="QLineEdit" name="mWiFiIPAddressEditBx">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>160</x> <x>80</x>
<y>460</y> <y>50</y>
<width>221</width> <width>221</width>
<height>20</height> <height>20</height>
</rect> </rect>
@ -429,8 +467,8 @@
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>90</x> <x>10</x>
<y>460</y> <y>80</y>
<width>71</width> <width>71</width>
<height>20</height> <height>20</height>
</rect> </rect>
@ -444,18 +482,61 @@
<string>Gatweway:</string> <string>Gatweway:</string>
</property> </property>
</widget> </widget>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QLineEdit" name="mWiFiGatewayAddressEditBx">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>80</x> <x>80</x>
<y>370</y> <y>80</y>
<width>321</width> <width>221</width>
<height>131</height> <height>20</height>
</rect> </rect>
</property> </property>
<property name="title"> <property name="text">
<string>WiFi parameters (stored in flash)</string> <string>?</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QCheckBox" name="mDHCPEnableChkBx">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>70</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>DHCP</string>
</property>
</widget>
<widget class="QPushButton" name="mWiFiGetRemoteSettingsBtn">
<property name="geometry">
<rect>
<x>70</x>
<y>180</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>GET</string>
</property>
</widget>
<widget class="QPushButton" name="mWiFiSetRemoteSettingsBtn">
<property name="geometry">
<rect>
<x>170</x>
<y>180</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>SET</string>
</property>
</widget>
</widget> </widget>
<widget class="QLabel" name="mSolarPanelCurrentCnvLbl"> <widget class="QLabel" name="mSolarPanelCurrentCnvLbl">
<property name="geometry"> <property name="geometry">
@ -473,8 +554,8 @@
<widget class="QLabel" name="mFirmwareVersionLabel"> <widget class="QLabel" name="mFirmwareVersionLabel">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>180</x> <x>510</x>
<y>520</y> <y>590</y>
<width>231</width> <width>231</width>
<height>20</height> <height>20</height>
</rect> </rect>
@ -491,8 +572,8 @@
<widget class="QPushButton" name="mGetFirmwareVersionBtn"> <widget class="QPushButton" name="mGetFirmwareVersionBtn">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>90</x> <x>420</x>
<y>520</y> <y>590</y>
<width>75</width> <width>75</width>
<height>23</height> <height>23</height>
</rect> </rect>
@ -504,8 +585,8 @@
<widget class="QPushButton" name="mStartTerminalShellBtn"> <widget class="QPushButton" name="mStartTerminalShellBtn">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>60</x> <x>420</x>
<y>590</y> <y>620</y>
<width>75</width> <width>75</width>
<height>23</height> <height>23</height>
</rect> </rect>
@ -517,8 +598,8 @@
<widget class="QPushButton" name="mStartSyslogShellBtn"> <widget class="QPushButton" name="mStartSyslogShellBtn">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>150</x> <x>510</x>
<y>590</y> <y>620</y>
<width>75</width> <width>75</width>
<height>23</height> <height>23</height>
</rect> </rect>
@ -527,6 +608,156 @@
<string>Syslog</string> <string>Syslog</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="mTotalRxTxRequestsLbl">
<property name="geometry">
<rect>
<x>430</x>
<y>180</y>
<width>521</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Chalet Rx Req :</string>
</property>
</widget>
<widget class="QPushButton" name="mResetCommStatsBtn">
<property name="geometry">
<rect>
<x>420</x>
<y>100</y>
<width>101</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Reset Comm Stats</string>
</property>
</widget>
<widget class="QLabel" name="mLostReqsStatsLbl">
<property name="geometry">
<rect>
<x>700</x>
<y>140</y>
<width>241</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>Master --&gt; Chalet: ??
Chalet --&gt; Master: ??</string>
</property>
</widget>
<widget class="QPushButton" name="mGetWifiStatusBtn">
<property name="geometry">
<rect>
<x>820</x>
<y>590</y>
<width>61</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>GET</string>
</property>
</widget>
<widget class="QLabel" name="mModuleIPAddressLbl">
<property name="geometry">
<rect>
<x>890</x>
<y>590</y>
<width>341</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Module IP Address:</string>
</property>
</widget>
<widget class="QGroupBox" name="mLoraIFGroupBox">
<property name="geometry">
<rect>
<x>890</x>
<y>20</y>
<width>541</width>
<height>201</height>
</rect>
</property>
<property name="title">
<string>Lora module Interface</string>
</property>
<widget class="QLabel" name="mLoraIFModuleType">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>131</width>
<height>61</height>
</rect>
</property>
<property name="text">
<string>Module Type: ???
Module state: ??</string>
</property>
</widget>
<widget class="QSpinBox" name="mLoraChannelSpinBox">
<property name="geometry">
<rect>
<x>470</x>
<y>30</y>
<width>51</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QSpinBox" name="mLoraAddressSpinBox">
<property name="geometry">
<rect>
<x>470</x>
<y>50</y>
<width>51</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>378</x>
<y>30</y>
<width>81</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Module Channel</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>380</x>
<y>51</y>
<width>81</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Module Address</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</widget>
<zorder>groupBox_2</zorder> <zorder>groupBox_2</zorder>
<zorder>groupBox</zorder> <zorder>groupBox</zorder>
<zorder>MainPageLabel</zorder> <zorder>MainPageLabel</zorder>
@ -552,17 +783,17 @@
<zorder>mLogStartDateEdit</zorder> <zorder>mLogStartDateEdit</zorder>
<zorder>mGetChaletLogButton</zorder> <zorder>mGetChaletLogButton</zorder>
<zorder>mChaletTemperatureLbl</zorder> <zorder>mChaletTemperatureLbl</zorder>
<zorder>mWiFiIPAddressEditBx</zorder>
<zorder>mWiFiGetRemoteSettingsBtn</zorder>
<zorder>mWiFiSetRemoteSettingsBtn</zorder>
<zorder>label</zorder>
<zorder>mWiFiGatewayAddressEditBx</zorder>
<zorder>label_2</zorder>
<zorder>mSolarPanelCurrentCnvLbl</zorder> <zorder>mSolarPanelCurrentCnvLbl</zorder>
<zorder>mFirmwareVersionLabel</zorder> <zorder>mFirmwareVersionLabel</zorder>
<zorder>mGetFirmwareVersionBtn</zorder> <zorder>mGetFirmwareVersionBtn</zorder>
<zorder>mStartTerminalShellBtn</zorder> <zorder>mStartTerminalShellBtn</zorder>
<zorder>mStartSyslogShellBtn</zorder> <zorder>mStartSyslogShellBtn</zorder>
<zorder>mTotalRxTxRequestsLbl</zorder>
<zorder>mResetCommStatsBtn</zorder>
<zorder>mLostReqsStatsLbl</zorder>
<zorder>mGetWifiStatusBtn</zorder>
<zorder>mModuleIPAddressLbl</zorder>
<zorder>mLoraIFGroupBox</zorder>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>

View File

@ -99,6 +99,11 @@ int CChaletMasterCtrlInterface::DeviceFrameReceived(int TargetDeviceID, int Targ
mProgramHandle->DeviceFirmwareVersionReceived(Data); mProgramHandle->DeviceFirmwareVersionReceived(Data);
break; break;
} }
case CHALET_INTERFACE_GET_WIFI_STATUS_RESPONSE:
{
mProgramHandle->WifiStatusReceived(Data);
break;
}
case CHALET_INTERFACE_GENERAL_STATUS_REQUEST: case CHALET_INTERFACE_GENERAL_STATUS_REQUEST:
case CHALET_INTERFACE_AC_POWER_STATE_STATUS_REQUEST: case CHALET_INTERFACE_AC_POWER_STATE_STATUS_REQUEST:
case CHALET_INTERFACE_AC_POWER_SET_STATE_REQUEST: case CHALET_INTERFACE_AC_POWER_SET_STATE_REQUEST:

View File

@ -7,6 +7,7 @@ CIspindel::CIspindel(CIspindelGUI *IspindelGui)
mIspindelGui = IspindelGui; mIspindelGui = IspindelGui;
IspindelGui->mProgramHandle = this; IspindelGui->mProgramHandle = this;
mNetworkInterface = new CIspindelInterface(this); mNetworkInterface = new CIspindelInterface(this);
mOG = 0.0;
} }
@ -42,10 +43,12 @@ void CIspindel::IspindelFullBufferReceived(QByteArray *Data)
mIspindelDataList.append(NewFrame); mIspindelDataList.append(NewFrame);
} }
mOG = mIspindelDataList.first()->mGravity;
SetLasFrameTextInGUI(*mIspindelDataList.last()); SetLasFrameTextInGUI(*mIspindelDataList.last());
mIspindelGui->UpdateIspindelPlot(&mIspindelDataList); mIspindelGui->UpdateIspindelPlot(&mIspindelDataList);
} }
void CIspindel::IspindelLastFrameReceived(QByteArray Data) void CIspindel::IspindelLastFrameReceived(QByteArray Data)
@ -66,6 +69,19 @@ void CIspindel::IspindelLastFrameReceived(QByteArray Data)
// qDebug("Latest Ispindel data received"); // qDebug("Latest Ispindel data received");
} }
int CIspindel::DeleteSampleResponseReceived(QByteArray Data)
{
bool Success;
QDataStream Strm(&Data,QIODevice::ReadOnly | QIODevice::Unbuffered);
Strm >> Success;
if(Success)
{
mNetworkInterface->SendMasterCtrlCommand(ISPINDEL_GET_FULL_DATA_BUFFER_REQUEST,QByteArray());
return RET_OK;
}
return RET_ERROR;
}
void CIspindel::ClearIspindleDataList() void CIspindel::ClearIspindleDataList()
{ {
@ -88,8 +104,9 @@ void CIspindel::ConnectedToMaster(bool connected)
void CIspindel::SetLasFrameTextInGUI(CIspindelData Frame) void CIspindel::SetLasFrameTextInGUI(CIspindelData Frame)
{ {
QString FrameText; QString FrameText;
QString ABVText;
FrameText = QString("\nLast Frame:\n------------------------------\nAngle: %1\nBattery Voltage: %2\nGravity: %3\nSample Interval: %4\nIspindel ID: %5\nIspindel Name: %6\nRSSI: %7\nTemperature: %8%9\nSample date time: %10\n------------------------------")\ FrameText = QString("\nLast Frame:\n------------------------------\nAngle: %1\nBattery Voltage: %2\nGravity: %3\nSample Interval: %4\nIspindel ID: %5\nIspindel Name: %6\nRSSI: %7\nTemperature: %8%9 (%11F)\nSample date time: %10\n------------------------------")\
.arg(Frame.mAngle)\ .arg(Frame.mAngle)\
.arg(Frame.mBattery)\ .arg(Frame.mBattery)\
.arg(Frame.mGravity)\ .arg(Frame.mGravity)\
@ -98,26 +115,40 @@ void CIspindel::SetLasFrameTextInGUI(CIspindelData Frame)
.arg(Frame.mIspindelName)\ .arg(Frame.mIspindelName)\
.arg(Frame.mRSSI)\ .arg(Frame.mRSSI)\
.arg(Frame.mTemperature).arg(Frame.mTemperatureUnits)\ .arg(Frame.mTemperature).arg(Frame.mTemperatureUnits)\
.arg(Frame.mSampleDateTime.toString("yyyy-MM-dd - hh:mm:ss")); .arg(Frame.mSampleDateTime.toString("yyyy-MM-dd - hh:mm:ss"))\
// FrameText = QString("\nLast Frame\n\ .arg(((Frame.mTemperature*9/5)+32));
// Angle: %1\n\
// Battery Voltage: %2\n\
// Gravity: %3\n\
// Sample Interval: %4\n\
// Ispindel ID: %5\n\
// Ispindel Name: %6\n\
// RSSI: %7\n\
// Temperature: %8%9\n\
// Sample date time: %10")\
// .arg(Frame.mAngle)\
// .arg(Frame.mBattery)\
// .arg(Frame.mGravity)\
// .arg(Frame.mInterval)\
// .arg(Frame.mIspindelID)\
// .arg(Frame.mIspindelName)\
// .arg(Frame.mRSSI)\
// .arg(Frame.mTemperature).arg(Frame.mTemperatureUnits)\
// .arg(Frame.mSampleDateTime.toString("yyyy-MM-dd - hh:mm:ss"));
mIspindelGui->SetLastIspindelFrameData(FrameText); if(mIspindelDataList.size() > 1)
{
float ABV = ((mOG - Frame.mGravity) * 131.25);
ABVText = QString("ABV : %1\%").arg(ABV);
}
else
{
ABVText = QString("ABV : ?\%");
}
mIspindelGui->SetLastIspindelFrameData(FrameText,ABVText);
}
int CIspindel::SetOGFromItem(int ItemIndex)
{
if(ItemIndex >= mIspindelDataList.size())
return RET_ERROR;
mOG = mIspindelDataList.at(ItemIndex)->mGravity;
SetLasFrameTextInGUI(*mIspindelDataList.last());
return RET_OK;
}
int CIspindel::DeleteSample(int ItemIndex)
{
if(ItemIndex >= mIspindelDataList.size())
return RET_ERROR;
QByteArray Data;
QDataStream Strm(&Data,QIODevice::WriteOnly | QIODevice::Unbuffered);
Strm << ItemIndex;
mNetworkInterface->SendMasterCtrlCommand(ISPINDEL_DELETE_SAMPLE_REQUEST,Data);
} }

View File

@ -25,9 +25,13 @@ public:
void ClearIspindleDataList(); void ClearIspindleDataList();
void ConnectedToMaster(bool connected); void ConnectedToMaster(bool connected);
void SetLasFrameTextInGUI(CIspindelData Frame); void SetLasFrameTextInGUI(CIspindelData Frame);
int SetOGFromItem(int ItemIndex);
int DeleteSample(int ItemIndex);
int DeleteSampleResponseReceived(QByteArray Data);
QList<CIspindelData*> mIspindelDataList; QList<CIspindelData*> mIspindelDataList;
CIspindelInterface *mNetworkInterface; CIspindelInterface *mNetworkInterface;
double mOG;

View File

@ -57,6 +57,13 @@ CIspindelGUI::CIspindelGUI(QWidget *parent) :
// mIspindelPlot->graph(1)->addData(now,20); // mIspindelPlot->graph(1)->addData(now,20);
mIspindelPlot->replot(); mIspindelPlot->replot();
ui->mSamplesTable->setColumnCount(4);
ui->mSamplesTable->setHorizontalHeaderLabels(QStringList() << "Sample" << "Date" << "Gravity" << "Temperature");
connect(ui->mSetOGBtn,SIGNAL(clicked(bool)),this,SLOT(SetOGButtonClicked(bool)));
connect(ui->mDelSelectedSampleBtn,SIGNAL(clicked(bool)),this,SLOT(DeleteSampleBtnClicked(bool)));
} }
CIspindelGUI::~CIspindelGUI() CIspindelGUI::~CIspindelGUI()
@ -64,9 +71,10 @@ CIspindelGUI::~CIspindelGUI()
delete ui; delete ui;
} }
void CIspindelGUI::SetLastIspindelFrameData(QString Data) void CIspindelGUI::SetLastIspindelFrameData(QString Data, QString ABVText)
{ {
ui->mLastFrameDataLbl->setText(Data); ui->mLastFrameDataLbl->setText(Data);
ui->mABVLabel->setText(ABVText);
} }
int CIspindelGUI::UpdateIspindelPlot(QList<CIspindelData *> *Data) int CIspindelGUI::UpdateIspindelPlot(QList<CIspindelData *> *Data)
@ -98,6 +106,21 @@ int CIspindelGUI::UpdateIspindelPlot(QList<CIspindelData *> *Data)
mIspindelPlot->replot(); mIspindelPlot->replot();
ui->mSamplesTable->setRowCount(Data->size());
QTableWidgetItem *TableItem;
for(int i= 0; i < Data->size(); i++)
{
TableItem = new QTableWidgetItem(QString("%1").arg(i));
ui->mSamplesTable->setItem(i,0,TableItem);
TableItem = new QTableWidgetItem(Data->at(i)->mSampleDateTime.toString("yyyy-MM-dd - hh:mm:ss"));
ui->mSamplesTable->setItem(i,1,TableItem);
TableItem = new QTableWidgetItem(QString("%1").arg(Data->at(i)->mGravity));
ui->mSamplesTable->setItem(i,2,TableItem);
TableItem = new QTableWidgetItem(QString("%1").arg(Data->at(i)->mTemperature));
ui->mSamplesTable->setItem(i,3,TableItem);
}
ui->mSamplesTable->resizeColumnsToContents();
return RET_OK; return RET_OK;
} }
@ -106,5 +129,48 @@ int CIspindelGUI::NewIspindelFrameReceived(CIspindelData *Data)
mIspindelPlot->graph(0)->addData(Data->mSampleDateTime.toSecsSinceEpoch(),Data->mGravity); mIspindelPlot->graph(0)->addData(Data->mSampleDateTime.toSecsSinceEpoch(),Data->mGravity);
mIspindelPlot->graph(1)->addData(Data->mSampleDateTime.toSecsSinceEpoch(),Data->mTemperature); mIspindelPlot->graph(1)->addData(Data->mSampleDateTime.toSecsSinceEpoch(),Data->mTemperature);
QTableWidgetItem *TableItem;
int RowIndex = ui->mSamplesTable->rowCount();
ui->mSamplesTable->insertRow(RowIndex);
TableItem = new QTableWidgetItem(QString("%1").arg(RowIndex));
ui->mSamplesTable->setItem(RowIndex,0,TableItem);
TableItem = new QTableWidgetItem(Data->mSampleDateTime.toString("yyyy-MM-dd - hh:mm:ss"));
ui->mSamplesTable->setItem(RowIndex,1,TableItem);
TableItem = new QTableWidgetItem(QString("%1").arg(Data->mGravity));
ui->mSamplesTable->setItem(RowIndex,2,TableItem);
TableItem = new QTableWidgetItem(QString("%1").arg(Data->mTemperature));
ui->mSamplesTable->setItem(RowIndex,3,TableItem);
mIspindelPlot->replot(); mIspindelPlot->replot();
return RET_OK;
} }
void CIspindelGUI::SetOGButtonClicked(bool)
{
QList<QTableWidgetItem*> SelectedItemsList;
SelectedItemsList = ui->mSamplesTable->selectedItems();
if(SelectedItemsList.size() == 0)
return;
int SampleIndex = SelectedItemsList.at(0)->row();
mProgramHandle->SetOGFromItem(SampleIndex);
}
void CIspindelGUI::DeleteSampleBtnClicked(bool)
{
QList<QTableWidgetItem*> SelectedItemsList;
SelectedItemsList = ui->mSamplesTable->selectedItems();
if(SelectedItemsList.size() == 0)
return;
int SampleIndex = SelectedItemsList.at(0)->row();
mProgramHandle->DeleteSample(SampleIndex);
}

View File

@ -21,12 +21,18 @@ public:
~CIspindelGUI(); ~CIspindelGUI();
CIspindel *mProgramHandle; CIspindel *mProgramHandle;
void SetLastIspindelFrameData(QString Data); void SetLastIspindelFrameData(QString Data, QString ABVText);
int UpdateIspindelPlot(QList<CIspindelData*> *Data); int UpdateIspindelPlot(QList<CIspindelData*> *Data);
int NewIspindelFrameReceived(CIspindelData *Data); int NewIspindelFrameReceived(CIspindelData *Data);
QCustomPlot *mIspindelPlot; QCustomPlot *mIspindelPlot;
public slots:
void SetOGButtonClicked(bool );
void DeleteSampleBtnClicked(bool);
private: private:
Ui::CIspindelGUI *ui; Ui::CIspindelGUI *ui;
}; };

View File

@ -16,8 +16,8 @@
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>510</x> <x>520</x>
<y>20</y> <y>0</y>
<width>91</width> <width>91</width>
<height>41</height> <height>41</height>
</rect> </rect>
@ -45,9 +45,9 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>60</x> <x>60</x>
<y>50</y> <y>10</y>
<width>381</width> <width>381</width>
<height>211</height> <height>241</height>
</rect> </rect>
</property> </property>
<property name="font"> <property name="font">
@ -65,7 +65,7 @@
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
<widget class="QTableWidget" name="tableWidget"> <widget class="QTableWidget" name="mSamplesTable">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
@ -75,6 +75,52 @@
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="mABVLabel">
<property name="geometry">
<rect>
<x>660</x>
<y>50</y>
<width>231</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>ABV : ?</string>
</property>
</widget>
<widget class="QPushButton" name="mSetOGBtn">
<property name="geometry">
<rect>
<x>650</x>
<y>10</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Set OG</string>
</property>
</widget>
<widget class="QPushButton" name="mDelSelectedSampleBtn">
<property name="geometry">
<rect>
<x>520</x>
<y>590</y>
<width>81</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Delete Sample</string>
</property>
</widget>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>

View File

@ -48,8 +48,14 @@ int CIspindelInterface::DeviceFrameReceived(int TargetDeviceID, int TargetDevice
mProgramHandle->IspindelLastFrameReceived(Data); mProgramHandle->IspindelLastFrameReceived(Data);
break; break;
} }
case ISPINDEL_DELETE_SAMPLE_RESPONSE:
{
mProgramHandle->DeleteSampleResponseReceived(Data);
break;
}
case ISPINDEL_GET_FULL_DATA_BUFFER_REQUEST: case ISPINDEL_GET_FULL_DATA_BUFFER_REQUEST:
case ISPINDLE_LATEST_DATA_REQUEST: case ISPINDLE_LATEST_DATA_REQUEST:
case ISPINDEL_DELETE_SAMPLE_REQUEST:
default: default:
{ {
qDebug("Ispindel: Invalid Ethernet Msg received from MasterCtrl: %d",MessageID); qDebug("Ispindel: Invalid Ethernet Msg received from MasterCtrl: %d",MessageID);

View File

@ -235,10 +235,10 @@ enum AV_RECEIVER_INTERFACE_CMDS
AV_RECEIVER_INTERFACE_GENERAL_STATUS_RESPONSE, AV_RECEIVER_INTERFACE_GENERAL_STATUS_RESPONSE,
AV_RECEIVER_INTERFACE_SET_MAIN_POWER_REQUEST, AV_RECEIVER_INTERFACE_SET_MAIN_POWER_REQUEST,
AV_RECEIVER_INTERFACE_SET_MAIN_POWER_RESPONSE, AV_RECEIVER_INTERFACE_SET_MAIN_POWER_RESPONSE,
AV_RECEIVER_INTERFACE_SET_SPEAKERB_REQUEST, AV_RECEIVER_INTERFACE_SET_ZONE2_REQUEST,
AV_RECEIVER_INTERFACE_SET_SPEAKERB_RESPONSE, AV_RECEIVER_INTERFACE_SET_ZONE2_RESPONSE,
AV_RECEIVER_INTERFACE_SET_SPEAKERA_REQUEST, AV_RECEIVER_INTERFACE_SET_MAIN_ZONE_REQUEST,
AV_RECEIVER_INTERFACE_SET_SPEAKERA_RESPONSE, AV_RECEIVER_INTERFACE_SET_MAIN_ZONE_RESPONSE,
AV_RECEIVER_INTERFACE_SET_SPEAKERS_REQUEST, AV_RECEIVER_INTERFACE_SET_SPEAKERS_REQUEST,
AV_RECEIVER_INTERFACE_SET_SPEAKERS_RESPONSE, AV_RECEIVER_INTERFACE_SET_SPEAKERS_RESPONSE,
AV_RECEIVER_INTERFACE_SEND_DIRECT_CMD_REQUEST, AV_RECEIVER_INTERFACE_SEND_DIRECT_CMD_REQUEST,
@ -276,6 +276,10 @@ enum CHALET_INTERFACE_CMDS
CHALET_INTERFACE_WIFI_SET_DEVICE_PARAMS_RESPONSE, CHALET_INTERFACE_WIFI_SET_DEVICE_PARAMS_RESPONSE,
CHALET_INTERFACE_GET_FIRMWARE_VERSION_REQUEST, CHALET_INTERFACE_GET_FIRMWARE_VERSION_REQUEST,
CHALET_INTERFACE_GET_FIRMWARE_VERSION_RESPONSE, CHALET_INTERFACE_GET_FIRMWARE_VERSION_RESPONSE,
CHALET_INTERFACE_CLEAR_COMMS_STATS_REQUEST,
CHALET_INTERFACE_CLEAR_COMMS_STATS_RESPONSE,
CHALET_INTERFACE_GET_WIFI_STATUS_REQUEST,
CHALET_INTERFACE_GET_WIFI_STATUS_RESPONSE,
MAX_CHALET_INTERFACE_CMD MAX_CHALET_INTERFACE_CMD
@ -306,6 +310,8 @@ enum CHALET_CMDS
CHALET_GET_STORED_WIFI_SETTINGS_RESPONSE, CHALET_GET_STORED_WIFI_SETTINGS_RESPONSE,
CHALET_SET_STORED_WIFI_SETTINGS_REQUEST, CHALET_SET_STORED_WIFI_SETTINGS_REQUEST,
CHALET_SET_STORED_WIFI_SETTINGS_RESPONSE, CHALET_SET_STORED_WIFI_SETTINGS_RESPONSE,
CHALET_CLEAR_COMMS_STATISTICS_REQUEST,
CHALET_CLEAR_COMMS_STATISTICS_RESPONSE,
MAX_CHALET_CMD MAX_CHALET_CMD
@ -352,8 +358,28 @@ enum ISPINDLE_CMDS
ISPINDLE_LATEST_DATA_RESPONSE, ISPINDLE_LATEST_DATA_RESPONSE,
ISPINDEL_GET_FULL_DATA_BUFFER_REQUEST, ISPINDEL_GET_FULL_DATA_BUFFER_REQUEST,
ISPINDEL_GET_FULL_DATA_BUFFER_RESPONSE, ISPINDEL_GET_FULL_DATA_BUFFER_RESPONSE,
ISPINDEL_DELETE_SAMPLE_REQUEST,
ISPINDEL_DELETE_SAMPLE_RESPONSE,
MAX_ISPINDLE_CMDS MAX_ISPINDLE_CMDS
}; };
enum LORA_INTERFACE_CMDS
{
LORA_IF_ACK = 1,
LORA_IF_GET_STATUS_REQUEST,
LORA_IF_GET_STATUS_RESPONSE,
LORA_IF_SEND_FRAME_REQUEST,
LORA_IF_SEND_FRAME_RESPONSE,
LORA_IF_NEW_FRAME_RESPONSE,
LORA_IF_GET_MODULE_CONFIG_REQUEST,
LORA_IF_GET_MODULE_CONFIG_RESPONSE,
LORA_IF_GET_RSSI_REQUEST,
LORA_IF_GET_RSSI_RESPONSE,
LORA_IF_SET_MODULE_CONFIG_REQUEST,
LORA_IF_SET_MODULE_CONFIG_RESPONSE,
MAX_LORA_IF_CMD
};
#endif #endif

View File

@ -50,6 +50,9 @@ CLightShowWidget::CLightShowWidget(QWidget *parent)
setSceneRect(-100,-100,parentWidget()->geometry().width(),parentWidget()->geometry().height()); setSceneRect(-100,-100,parentWidget()->geometry().width(),parentWidget()->geometry().height());
setMinimumSize(parentWidget()->geometry().width(),parentWidget()->geometry().height()); setMinimumSize(parentWidget()->geometry().width(),parentWidget()->geometry().height());
mScene->views().at(0)->setBackgroundBrush(QBrush(QColor(Qt::black)));
} }

View File

@ -24,6 +24,7 @@ public:
QLabel *mRcvrStatusLabel; QLabel *mRcvrStatusLabel;
QCheckBox *mSpkBCheckBox; QCheckBox *mSpkBCheckBox;
QCheckBox *mSpkACheckBox; QCheckBox *mSpkACheckBox;
QLabel *mZone2StatusLabel;
void setupUi(QWidget *CAvReceiverGui) void setupUi(QWidget *CAvReceiverGui)
{ {
@ -35,13 +36,16 @@ public:
label->setGeometry(QRect(230, 30, 201, 16)); label->setGeometry(QRect(230, 30, 201, 16));
mRcvrStatusLabel = new QLabel(CAvReceiverGui); mRcvrStatusLabel = new QLabel(CAvReceiverGui);
mRcvrStatusLabel->setObjectName(QString::fromUtf8("mRcvrStatusLabel")); mRcvrStatusLabel->setObjectName(QString::fromUtf8("mRcvrStatusLabel"));
mRcvrStatusLabel->setGeometry(QRect(100, 110, 181, 231)); mRcvrStatusLabel->setGeometry(QRect(50, 130, 181, 231));
mSpkBCheckBox = new QCheckBox(CAvReceiverGui); mSpkBCheckBox = new QCheckBox(CAvReceiverGui);
mSpkBCheckBox->setObjectName(QString::fromUtf8("mSpkBCheckBox")); mSpkBCheckBox->setObjectName(QString::fromUtf8("mSpkBCheckBox"));
mSpkBCheckBox->setGeometry(QRect(570, 130, 70, 17)); mSpkBCheckBox->setGeometry(QRect(280, 110, 70, 17));
mSpkACheckBox = new QCheckBox(CAvReceiverGui); mSpkACheckBox = new QCheckBox(CAvReceiverGui);
mSpkACheckBox->setObjectName(QString::fromUtf8("mSpkACheckBox")); mSpkACheckBox->setObjectName(QString::fromUtf8("mSpkACheckBox"));
mSpkACheckBox->setGeometry(QRect(570, 160, 70, 17)); mSpkACheckBox->setGeometry(QRect(50, 110, 70, 17));
mZone2StatusLabel = new QLabel(CAvReceiverGui);
mZone2StatusLabel->setObjectName(QString::fromUtf8("mZone2StatusLabel"));
mZone2StatusLabel->setGeometry(QRect(300, 140, 171, 191));
retranslateUi(CAvReceiverGui); retranslateUi(CAvReceiverGui);
@ -53,8 +57,9 @@ public:
CAvReceiverGui->setWindowTitle(QCoreApplication::translate("CAvReceiverGui", "Form", nullptr)); CAvReceiverGui->setWindowTitle(QCoreApplication::translate("CAvReceiverGui", "Form", nullptr));
label->setText(QCoreApplication::translate("CAvReceiverGui", "AvReceiver", nullptr)); label->setText(QCoreApplication::translate("CAvReceiverGui", "AvReceiver", nullptr));
mRcvrStatusLabel->setText(QCoreApplication::translate("CAvReceiverGui", "TextLabel", nullptr)); mRcvrStatusLabel->setText(QCoreApplication::translate("CAvReceiverGui", "TextLabel", nullptr));
mSpkBCheckBox->setText(QCoreApplication::translate("CAvReceiverGui", "Speaker B", nullptr)); mSpkBCheckBox->setText(QCoreApplication::translate("CAvReceiverGui", "Zone 2", nullptr));
mSpkACheckBox->setText(QCoreApplication::translate("CAvReceiverGui", "Speaker A", nullptr)); mSpkACheckBox->setText(QCoreApplication::translate("CAvReceiverGui", "Main Zone", nullptr));
mZone2StatusLabel->setText(QCoreApplication::translate("CAvReceiverGui", "TextLabel", nullptr));
} // retranslateUi } // retranslateUi
}; };

View File

@ -17,6 +17,7 @@
#include <QtWidgets/QLabel> #include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit> #include <QtWidgets/QLineEdit>
#include <QtWidgets/QPushButton> #include <QtWidgets/QPushButton>
#include <QtWidgets/QSpinBox>
#include <QtWidgets/QWidget> #include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -49,18 +50,34 @@ public:
QDateEdit *mLogStartDateEdit; QDateEdit *mLogStartDateEdit;
QPushButton *mGetChaletLogButton; QPushButton *mGetChaletLogButton;
QLabel *mChaletTemperatureLbl; QLabel *mChaletTemperatureLbl;
QGroupBox *groupBox_2;
QLineEdit *mWifiAccessPtNameEditBx;
QLabel *mAccessPtNameLabel;
QLabel *mAccessPtPassLbl;
QLineEdit *mWifiPasswordEditBx;
QLabel *label;
QLineEdit *mWiFiIPAddressEditBx; QLineEdit *mWiFiIPAddressEditBx;
QLabel *label_2;
QLineEdit *mWiFiGatewayAddressEditBx;
QCheckBox *mDHCPEnableChkBx;
QPushButton *mWiFiGetRemoteSettingsBtn; QPushButton *mWiFiGetRemoteSettingsBtn;
QPushButton *mWiFiSetRemoteSettingsBtn; QPushButton *mWiFiSetRemoteSettingsBtn;
QLabel *label;
QLineEdit *mWiFiGatewayAddressEditBx;
QLabel *label_2;
QGroupBox *groupBox_2;
QLabel *mSolarPanelCurrentCnvLbl; QLabel *mSolarPanelCurrentCnvLbl;
QLabel *mFirmwareVersionLabel; QLabel *mFirmwareVersionLabel;
QPushButton *mGetFirmwareVersionBtn; QPushButton *mGetFirmwareVersionBtn;
QPushButton *mStartTerminalShellBtn; QPushButton *mStartTerminalShellBtn;
QPushButton *mStartSyslogShellBtn; QPushButton *mStartSyslogShellBtn;
QLabel *mTotalRxTxRequestsLbl;
QPushButton *mResetCommStatsBtn;
QLabel *mLostReqsStatsLbl;
QPushButton *mGetWifiStatusBtn;
QLabel *mModuleIPAddressLbl;
QGroupBox *mLoraIFGroupBox;
QLabel *mLoraIFModuleType;
QSpinBox *mLoraChannelSpinBox;
QSpinBox *mLoraAddressSpinBox;
QLabel *label_3;
QLabel *label_4;
void setupUi(QWidget *CChaletGui) void setupUi(QWidget *CChaletGui)
{ {
@ -135,68 +152,123 @@ public:
mCurrentSensorStateLbl->setGeometry(QRect(190, 320, 241, 16)); mCurrentSensorStateLbl->setGeometry(QRect(190, 320, 241, 16));
mLostReqPercentLbl = new QLabel(CChaletGui); mLostReqPercentLbl = new QLabel(CChaletGui);
mLostReqPercentLbl->setObjectName(QString::fromUtf8("mLostReqPercentLbl")); mLostReqPercentLbl->setObjectName(QString::fromUtf8("mLostReqPercentLbl"));
mLostReqPercentLbl->setGeometry(QRect(600, 190, 241, 16)); mLostReqPercentLbl->setGeometry(QRect(430, 160, 241, 16));
mPlotWidget = new QWidget(CChaletGui); mPlotWidget = new QWidget(CChaletGui);
mPlotWidget->setObjectName(QString::fromUtf8("mPlotWidget")); mPlotWidget->setObjectName(QString::fromUtf8("mPlotWidget"));
mPlotWidget->setGeometry(QRect(420, 240, 1021, 321)); mPlotWidget->setGeometry(QRect(420, 240, 1021, 321));
mChaletCommActivityLbl = new QLabel(CChaletGui); mChaletCommActivityLbl = new QLabel(CChaletGui);
mChaletCommActivityLbl->setObjectName(QString::fromUtf8("mChaletCommActivityLbl")); mChaletCommActivityLbl->setObjectName(QString::fromUtf8("mChaletCommActivityLbl"));
mChaletCommActivityLbl->setGeometry(QRect(600, 170, 47, 16)); mChaletCommActivityLbl->setGeometry(QRect(430, 140, 47, 16));
mLasCommRequestReceivedLbl = new QLabel(CChaletGui); mLasCommRequestReceivedLbl = new QLabel(CChaletGui);
mLasCommRequestReceivedLbl->setObjectName(QString::fromUtf8("mLasCommRequestReceivedLbl")); mLasCommRequestReceivedLbl->setObjectName(QString::fromUtf8("mLasCommRequestReceivedLbl"));
mLasCommRequestReceivedLbl->setGeometry(QRect(600, 150, 301, 16)); mLasCommRequestReceivedLbl->setGeometry(QRect(430, 120, 301, 16));
mLogStartDateEdit = new QDateEdit(CChaletGui); mLogStartDateEdit = new QDateEdit(CChaletGui);
mLogStartDateEdit->setObjectName(QString::fromUtf8("mLogStartDateEdit")); mLogStartDateEdit->setObjectName(QString::fromUtf8("mLogStartDateEdit"));
mLogStartDateEdit->setGeometry(QRect(780, 210, 110, 22)); mLogStartDateEdit->setGeometry(QRect(520, 210, 110, 22));
mGetChaletLogButton = new QPushButton(CChaletGui); mGetChaletLogButton = new QPushButton(CChaletGui);
mGetChaletLogButton->setObjectName(QString::fromUtf8("mGetChaletLogButton")); mGetChaletLogButton->setObjectName(QString::fromUtf8("mGetChaletLogButton"));
mGetChaletLogButton->setGeometry(QRect(900, 210, 75, 23)); mGetChaletLogButton->setGeometry(QRect(640, 210, 75, 23));
mChaletTemperatureLbl = new QLabel(CChaletGui); mChaletTemperatureLbl = new QLabel(CChaletGui);
mChaletTemperatureLbl->setObjectName(QString::fromUtf8("mChaletTemperatureLbl")); mChaletTemperatureLbl->setObjectName(QString::fromUtf8("mChaletTemperatureLbl"));
mChaletTemperatureLbl->setGeometry(QRect(190, 340, 241, 16)); mChaletTemperatureLbl->setGeometry(QRect(190, 340, 241, 16));
mWiFiIPAddressEditBx = new QLineEdit(CChaletGui);
mWiFiIPAddressEditBx->setObjectName(QString::fromUtf8("mWiFiIPAddressEditBx"));
mWiFiIPAddressEditBx->setGeometry(QRect(160, 430, 221, 20));
mWiFiIPAddressEditBx->setAlignment(Qt::AlignCenter);
mWiFiGetRemoteSettingsBtn = new QPushButton(CChaletGui);
mWiFiGetRemoteSettingsBtn->setObjectName(QString::fromUtf8("mWiFiGetRemoteSettingsBtn"));
mWiFiGetRemoteSettingsBtn->setGeometry(QRect(160, 400, 75, 23));
mWiFiSetRemoteSettingsBtn = new QPushButton(CChaletGui);
mWiFiSetRemoteSettingsBtn->setObjectName(QString::fromUtf8("mWiFiSetRemoteSettingsBtn"));
mWiFiSetRemoteSettingsBtn->setGeometry(QRect(250, 400, 75, 23));
label = new QLabel(CChaletGui);
label->setObjectName(QString::fromUtf8("label"));
label->setGeometry(QRect(90, 430, 71, 20));
QFont font2;
font2.setPointSize(10);
label->setFont(font2);
mWiFiGatewayAddressEditBx = new QLineEdit(CChaletGui);
mWiFiGatewayAddressEditBx->setObjectName(QString::fromUtf8("mWiFiGatewayAddressEditBx"));
mWiFiGatewayAddressEditBx->setGeometry(QRect(160, 460, 221, 20));
mWiFiGatewayAddressEditBx->setAlignment(Qt::AlignCenter);
label_2 = new QLabel(CChaletGui);
label_2->setObjectName(QString::fromUtf8("label_2"));
label_2->setGeometry(QRect(90, 460, 71, 20));
label_2->setFont(font2);
groupBox_2 = new QGroupBox(CChaletGui); groupBox_2 = new QGroupBox(CChaletGui);
groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); groupBox_2->setObjectName(QString::fromUtf8("groupBox_2"));
groupBox_2->setGeometry(QRect(80, 370, 321, 131)); groupBox_2->setGeometry(QRect(70, 380, 321, 231));
mWifiAccessPtNameEditBx = new QLineEdit(groupBox_2);
mWifiAccessPtNameEditBx->setObjectName(QString::fromUtf8("mWifiAccessPtNameEditBx"));
mWifiAccessPtNameEditBx->setGeometry(QRect(80, 110, 221, 20));
mWifiAccessPtNameEditBx->setAlignment(Qt::AlignCenter);
mAccessPtNameLabel = new QLabel(groupBox_2);
mAccessPtNameLabel->setObjectName(QString::fromUtf8("mAccessPtNameLabel"));
mAccessPtNameLabel->setGeometry(QRect(10, 110, 71, 20));
QFont font2;
font2.setPointSize(10);
mAccessPtNameLabel->setFont(font2);
mAccessPtPassLbl = new QLabel(groupBox_2);
mAccessPtPassLbl->setObjectName(QString::fromUtf8("mAccessPtPassLbl"));
mAccessPtPassLbl->setGeometry(QRect(10, 140, 71, 20));
mAccessPtPassLbl->setFont(font2);
mWifiPasswordEditBx = new QLineEdit(groupBox_2);
mWifiPasswordEditBx->setObjectName(QString::fromUtf8("mWifiPasswordEditBx"));
mWifiPasswordEditBx->setGeometry(QRect(80, 140, 221, 20));
mWifiPasswordEditBx->setAlignment(Qt::AlignCenter);
label = new QLabel(groupBox_2);
label->setObjectName(QString::fromUtf8("label"));
label->setGeometry(QRect(10, 50, 71, 20));
label->setFont(font2);
mWiFiIPAddressEditBx = new QLineEdit(groupBox_2);
mWiFiIPAddressEditBx->setObjectName(QString::fromUtf8("mWiFiIPAddressEditBx"));
mWiFiIPAddressEditBx->setGeometry(QRect(80, 50, 221, 20));
mWiFiIPAddressEditBx->setAlignment(Qt::AlignCenter);
label_2 = new QLabel(groupBox_2);
label_2->setObjectName(QString::fromUtf8("label_2"));
label_2->setGeometry(QRect(10, 80, 71, 20));
label_2->setFont(font2);
mWiFiGatewayAddressEditBx = new QLineEdit(groupBox_2);
mWiFiGatewayAddressEditBx->setObjectName(QString::fromUtf8("mWiFiGatewayAddressEditBx"));
mWiFiGatewayAddressEditBx->setGeometry(QRect(80, 80, 221, 20));
mWiFiGatewayAddressEditBx->setAlignment(Qt::AlignCenter);
mDHCPEnableChkBx = new QCheckBox(groupBox_2);
mDHCPEnableChkBx->setObjectName(QString::fromUtf8("mDHCPEnableChkBx"));
mDHCPEnableChkBx->setGeometry(QRect(20, 20, 70, 17));
mWiFiGetRemoteSettingsBtn = new QPushButton(groupBox_2);
mWiFiGetRemoteSettingsBtn->setObjectName(QString::fromUtf8("mWiFiGetRemoteSettingsBtn"));
mWiFiGetRemoteSettingsBtn->setGeometry(QRect(70, 180, 75, 23));
mWiFiSetRemoteSettingsBtn = new QPushButton(groupBox_2);
mWiFiSetRemoteSettingsBtn->setObjectName(QString::fromUtf8("mWiFiSetRemoteSettingsBtn"));
mWiFiSetRemoteSettingsBtn->setGeometry(QRect(170, 180, 75, 23));
mSolarPanelCurrentCnvLbl = new QLabel(CChaletGui); mSolarPanelCurrentCnvLbl = new QLabel(CChaletGui);
mSolarPanelCurrentCnvLbl->setObjectName(QString::fromUtf8("mSolarPanelCurrentCnvLbl")); mSolarPanelCurrentCnvLbl->setObjectName(QString::fromUtf8("mSolarPanelCurrentCnvLbl"));
mSolarPanelCurrentCnvLbl->setGeometry(QRect(190, 280, 201, 16)); mSolarPanelCurrentCnvLbl->setGeometry(QRect(190, 280, 201, 16));
mFirmwareVersionLabel = new QLabel(CChaletGui); mFirmwareVersionLabel = new QLabel(CChaletGui);
mFirmwareVersionLabel->setObjectName(QString::fromUtf8("mFirmwareVersionLabel")); mFirmwareVersionLabel->setObjectName(QString::fromUtf8("mFirmwareVersionLabel"));
mFirmwareVersionLabel->setGeometry(QRect(180, 520, 231, 20)); mFirmwareVersionLabel->setGeometry(QRect(510, 590, 231, 20));
mFirmwareVersionLabel->setFont(font2); mFirmwareVersionLabel->setFont(font2);
mGetFirmwareVersionBtn = new QPushButton(CChaletGui); mGetFirmwareVersionBtn = new QPushButton(CChaletGui);
mGetFirmwareVersionBtn->setObjectName(QString::fromUtf8("mGetFirmwareVersionBtn")); mGetFirmwareVersionBtn->setObjectName(QString::fromUtf8("mGetFirmwareVersionBtn"));
mGetFirmwareVersionBtn->setGeometry(QRect(90, 520, 75, 23)); mGetFirmwareVersionBtn->setGeometry(QRect(420, 590, 75, 23));
mStartTerminalShellBtn = new QPushButton(CChaletGui); mStartTerminalShellBtn = new QPushButton(CChaletGui);
mStartTerminalShellBtn->setObjectName(QString::fromUtf8("mStartTerminalShellBtn")); mStartTerminalShellBtn->setObjectName(QString::fromUtf8("mStartTerminalShellBtn"));
mStartTerminalShellBtn->setGeometry(QRect(60, 590, 75, 23)); mStartTerminalShellBtn->setGeometry(QRect(420, 620, 75, 23));
mStartSyslogShellBtn = new QPushButton(CChaletGui); mStartSyslogShellBtn = new QPushButton(CChaletGui);
mStartSyslogShellBtn->setObjectName(QString::fromUtf8("mStartSyslogShellBtn")); mStartSyslogShellBtn->setObjectName(QString::fromUtf8("mStartSyslogShellBtn"));
mStartSyslogShellBtn->setGeometry(QRect(150, 590, 75, 23)); mStartSyslogShellBtn->setGeometry(QRect(510, 620, 75, 23));
mTotalRxTxRequestsLbl = new QLabel(CChaletGui);
mTotalRxTxRequestsLbl->setObjectName(QString::fromUtf8("mTotalRxTxRequestsLbl"));
mTotalRxTxRequestsLbl->setGeometry(QRect(430, 180, 521, 16));
mResetCommStatsBtn = new QPushButton(CChaletGui);
mResetCommStatsBtn->setObjectName(QString::fromUtf8("mResetCommStatsBtn"));
mResetCommStatsBtn->setGeometry(QRect(420, 100, 101, 23));
mLostReqsStatsLbl = new QLabel(CChaletGui);
mLostReqsStatsLbl->setObjectName(QString::fromUtf8("mLostReqsStatsLbl"));
mLostReqsStatsLbl->setGeometry(QRect(700, 140, 241, 41));
mGetWifiStatusBtn = new QPushButton(CChaletGui);
mGetWifiStatusBtn->setObjectName(QString::fromUtf8("mGetWifiStatusBtn"));
mGetWifiStatusBtn->setGeometry(QRect(820, 590, 61, 23));
mModuleIPAddressLbl = new QLabel(CChaletGui);
mModuleIPAddressLbl->setObjectName(QString::fromUtf8("mModuleIPAddressLbl"));
mModuleIPAddressLbl->setGeometry(QRect(890, 590, 341, 16));
mModuleIPAddressLbl->setFont(font2);
mLoraIFGroupBox = new QGroupBox(CChaletGui);
mLoraIFGroupBox->setObjectName(QString::fromUtf8("mLoraIFGroupBox"));
mLoraIFGroupBox->setGeometry(QRect(890, 20, 541, 201));
mLoraIFModuleType = new QLabel(mLoraIFGroupBox);
mLoraIFModuleType->setObjectName(QString::fromUtf8("mLoraIFModuleType"));
mLoraIFModuleType->setGeometry(QRect(10, 20, 131, 61));
mLoraChannelSpinBox = new QSpinBox(mLoraIFGroupBox);
mLoraChannelSpinBox->setObjectName(QString::fromUtf8("mLoraChannelSpinBox"));
mLoraChannelSpinBox->setGeometry(QRect(470, 30, 51, 22));
mLoraAddressSpinBox = new QSpinBox(mLoraIFGroupBox);
mLoraAddressSpinBox->setObjectName(QString::fromUtf8("mLoraAddressSpinBox"));
mLoraAddressSpinBox->setGeometry(QRect(470, 50, 51, 22));
label_3 = new QLabel(mLoraIFGroupBox);
label_3->setObjectName(QString::fromUtf8("label_3"));
label_3->setGeometry(QRect(378, 30, 81, 20));
label_3->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
label_4 = new QLabel(mLoraIFGroupBox);
label_4->setObjectName(QString::fromUtf8("label_4"));
label_4->setGeometry(QRect(380, 51, 81, 20));
label_4->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
groupBox_2->raise(); groupBox_2->raise();
groupBox->raise(); groupBox->raise();
MainPageLabel->raise(); MainPageLabel->raise();
@ -222,17 +294,17 @@ public:
mLogStartDateEdit->raise(); mLogStartDateEdit->raise();
mGetChaletLogButton->raise(); mGetChaletLogButton->raise();
mChaletTemperatureLbl->raise(); mChaletTemperatureLbl->raise();
mWiFiIPAddressEditBx->raise();
mWiFiGetRemoteSettingsBtn->raise();
mWiFiSetRemoteSettingsBtn->raise();
label->raise();
mWiFiGatewayAddressEditBx->raise();
label_2->raise();
mSolarPanelCurrentCnvLbl->raise(); mSolarPanelCurrentCnvLbl->raise();
mFirmwareVersionLabel->raise(); mFirmwareVersionLabel->raise();
mGetFirmwareVersionBtn->raise(); mGetFirmwareVersionBtn->raise();
mStartTerminalShellBtn->raise(); mStartTerminalShellBtn->raise();
mStartSyslogShellBtn->raise(); mStartSyslogShellBtn->raise();
mTotalRxTxRequestsLbl->raise();
mResetCommStatsBtn->raise();
mLostReqsStatsLbl->raise();
mGetWifiStatusBtn->raise();
mModuleIPAddressLbl->raise();
mLoraIFGroupBox->raise();
retranslateUi(CChaletGui); retranslateUi(CChaletGui);
@ -265,18 +337,34 @@ public:
mLasCommRequestReceivedLbl->setText(QCoreApplication::translate("CChaletGui", "Last Request: ", nullptr)); mLasCommRequestReceivedLbl->setText(QCoreApplication::translate("CChaletGui", "Last Request: ", nullptr));
mGetChaletLogButton->setText(QCoreApplication::translate("CChaletGui", "PushButton", nullptr)); mGetChaletLogButton->setText(QCoreApplication::translate("CChaletGui", "PushButton", nullptr));
mChaletTemperatureLbl->setText(QCoreApplication::translate("CChaletGui", "Temperature:", nullptr)); mChaletTemperatureLbl->setText(QCoreApplication::translate("CChaletGui", "Temperature:", nullptr));
groupBox_2->setTitle(QCoreApplication::translate("CChaletGui", "WiFi parameters (stored in flash)", nullptr));
mWifiAccessPtNameEditBx->setText(QCoreApplication::translate("CChaletGui", "?", nullptr));
mAccessPtNameLabel->setText(QCoreApplication::translate("CChaletGui", "Access Pt:", nullptr));
mAccessPtPassLbl->setText(QCoreApplication::translate("CChaletGui", "Password:", nullptr));
mWifiPasswordEditBx->setText(QCoreApplication::translate("CChaletGui", "?", nullptr));
label->setText(QCoreApplication::translate("CChaletGui", "IP Address:", nullptr));
mWiFiIPAddressEditBx->setText(QCoreApplication::translate("CChaletGui", "?", nullptr)); mWiFiIPAddressEditBx->setText(QCoreApplication::translate("CChaletGui", "?", nullptr));
label_2->setText(QCoreApplication::translate("CChaletGui", "Gatweway:", nullptr));
mWiFiGatewayAddressEditBx->setText(QCoreApplication::translate("CChaletGui", "?", nullptr));
mDHCPEnableChkBx->setText(QCoreApplication::translate("CChaletGui", "DHCP", nullptr));
mWiFiGetRemoteSettingsBtn->setText(QCoreApplication::translate("CChaletGui", "GET", nullptr)); mWiFiGetRemoteSettingsBtn->setText(QCoreApplication::translate("CChaletGui", "GET", nullptr));
mWiFiSetRemoteSettingsBtn->setText(QCoreApplication::translate("CChaletGui", "SET", nullptr)); mWiFiSetRemoteSettingsBtn->setText(QCoreApplication::translate("CChaletGui", "SET", nullptr));
label->setText(QCoreApplication::translate("CChaletGui", "IP Address:", nullptr));
mWiFiGatewayAddressEditBx->setText(QCoreApplication::translate("CChaletGui", "?", nullptr));
label_2->setText(QCoreApplication::translate("CChaletGui", "Gatweway:", nullptr));
groupBox_2->setTitle(QCoreApplication::translate("CChaletGui", "WiFi parameters (stored in flash)", nullptr));
mSolarPanelCurrentCnvLbl->setText(QCoreApplication::translate("CChaletGui", "Solar Panel Current (A):", nullptr)); mSolarPanelCurrentCnvLbl->setText(QCoreApplication::translate("CChaletGui", "Solar Panel Current (A):", nullptr));
mFirmwareVersionLabel->setText(QCoreApplication::translate("CChaletGui", "Firmware Version: ?", nullptr)); mFirmwareVersionLabel->setText(QCoreApplication::translate("CChaletGui", "Firmware Version: ?", nullptr));
mGetFirmwareVersionBtn->setText(QCoreApplication::translate("CChaletGui", "GET", nullptr)); mGetFirmwareVersionBtn->setText(QCoreApplication::translate("CChaletGui", "GET", nullptr));
mStartTerminalShellBtn->setText(QCoreApplication::translate("CChaletGui", "Terminal", nullptr)); mStartTerminalShellBtn->setText(QCoreApplication::translate("CChaletGui", "Terminal", nullptr));
mStartSyslogShellBtn->setText(QCoreApplication::translate("CChaletGui", "Syslog", nullptr)); mStartSyslogShellBtn->setText(QCoreApplication::translate("CChaletGui", "Syslog", nullptr));
mTotalRxTxRequestsLbl->setText(QCoreApplication::translate("CChaletGui", "Chalet Rx Req :", nullptr));
mResetCommStatsBtn->setText(QCoreApplication::translate("CChaletGui", "Reset Comm Stats", nullptr));
mLostReqsStatsLbl->setText(QCoreApplication::translate("CChaletGui", "Master --> Chalet: ??\n"
"Chalet --> Master: ??", nullptr));
mGetWifiStatusBtn->setText(QCoreApplication::translate("CChaletGui", "GET", nullptr));
mModuleIPAddressLbl->setText(QCoreApplication::translate("CChaletGui", "Module IP Address:", nullptr));
mLoraIFGroupBox->setTitle(QCoreApplication::translate("CChaletGui", "Lora module Interface", nullptr));
mLoraIFModuleType->setText(QCoreApplication::translate("CChaletGui", "Module Type: ???\n"
"Module state: ??", nullptr));
label_3->setText(QCoreApplication::translate("CChaletGui", "Module Channel", nullptr));
label_4->setText(QCoreApplication::translate("CChaletGui", "Module Address", nullptr));
} // retranslateUi } // retranslateUi
}; };

View File

@ -14,6 +14,7 @@
#include <QtWidgets/QDialog> #include <QtWidgets/QDialog>
#include <QtWidgets/QHeaderView> #include <QtWidgets/QHeaderView>
#include <QtWidgets/QLabel> #include <QtWidgets/QLabel>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QTableWidget> #include <QtWidgets/QTableWidget>
#include <QtWidgets/QWidget> #include <QtWidgets/QWidget>
@ -25,7 +26,10 @@ public:
QLabel *label; QLabel *label;
QWidget *mIspindelPlot; QWidget *mIspindelPlot;
QLabel *mLastFrameDataLbl; QLabel *mLastFrameDataLbl;
QTableWidget *tableWidget; QTableWidget *mSamplesTable;
QLabel *mABVLabel;
QPushButton *mSetOGBtn;
QPushButton *mDelSelectedSampleBtn;
void setupUi(QDialog *CIspindelGUI) void setupUi(QDialog *CIspindelGUI)
{ {
@ -34,7 +38,7 @@ public:
CIspindelGUI->resize(1123, 629); CIspindelGUI->resize(1123, 629);
label = new QLabel(CIspindelGUI); label = new QLabel(CIspindelGUI);
label->setObjectName(QString::fromUtf8("label")); label->setObjectName(QString::fromUtf8("label"));
label->setGeometry(QRect(510, 20, 91, 41)); label->setGeometry(QRect(520, 0, 91, 41));
QFont font; QFont font;
font.setPointSize(12); font.setPointSize(12);
label->setFont(font); label->setFont(font);
@ -43,7 +47,7 @@ public:
mIspindelPlot->setGeometry(QRect(520, 100, 661, 461)); mIspindelPlot->setGeometry(QRect(520, 100, 661, 461));
mLastFrameDataLbl = new QLabel(CIspindelGUI); mLastFrameDataLbl = new QLabel(CIspindelGUI);
mLastFrameDataLbl->setObjectName(QString::fromUtf8("mLastFrameDataLbl")); mLastFrameDataLbl->setObjectName(QString::fromUtf8("mLastFrameDataLbl"));
mLastFrameDataLbl->setGeometry(QRect(60, 50, 381, 211)); mLastFrameDataLbl->setGeometry(QRect(60, 10, 381, 241));
QFont font1; QFont font1;
font1.setFamily(QString::fromUtf8("Tahoma")); font1.setFamily(QString::fromUtf8("Tahoma"));
font1.setPointSize(11); font1.setPointSize(11);
@ -51,9 +55,23 @@ public:
font1.setWeight(75); font1.setWeight(75);
mLastFrameDataLbl->setFont(font1); mLastFrameDataLbl->setFont(font1);
mLastFrameDataLbl->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter); mLastFrameDataLbl->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);
tableWidget = new QTableWidget(CIspindelGUI); mSamplesTable = new QTableWidget(CIspindelGUI);
tableWidget->setObjectName(QString::fromUtf8("tableWidget")); mSamplesTable->setObjectName(QString::fromUtf8("mSamplesTable"));
tableWidget->setGeometry(QRect(10, 290, 461, 331)); mSamplesTable->setGeometry(QRect(10, 290, 461, 331));
mABVLabel = new QLabel(CIspindelGUI);
mABVLabel->setObjectName(QString::fromUtf8("mABVLabel"));
mABVLabel->setGeometry(QRect(660, 50, 231, 16));
QFont font2;
font2.setPointSize(12);
font2.setBold(true);
font2.setWeight(75);
mABVLabel->setFont(font2);
mSetOGBtn = new QPushButton(CIspindelGUI);
mSetOGBtn->setObjectName(QString::fromUtf8("mSetOGBtn"));
mSetOGBtn->setGeometry(QRect(650, 10, 75, 23));
mDelSelectedSampleBtn = new QPushButton(CIspindelGUI);
mDelSelectedSampleBtn->setObjectName(QString::fromUtf8("mDelSelectedSampleBtn"));
mDelSelectedSampleBtn->setGeometry(QRect(520, 590, 81, 23));
retranslateUi(CIspindelGUI); retranslateUi(CIspindelGUI);
@ -65,6 +83,9 @@ public:
CIspindelGUI->setWindowTitle(QCoreApplication::translate("CIspindelGUI", "Dialog", nullptr)); CIspindelGUI->setWindowTitle(QCoreApplication::translate("CIspindelGUI", "Dialog", nullptr));
label->setText(QCoreApplication::translate("CIspindelGUI", "ISpindel", nullptr)); label->setText(QCoreApplication::translate("CIspindelGUI", "ISpindel", nullptr));
mLastFrameDataLbl->setText(QCoreApplication::translate("CIspindelGUI", "No data...", nullptr)); mLastFrameDataLbl->setText(QCoreApplication::translate("CIspindelGUI", "No data...", nullptr));
mABVLabel->setText(QCoreApplication::translate("CIspindelGUI", "ABV : ?", nullptr));
mSetOGBtn->setText(QCoreApplication::translate("CIspindelGUI", "Set OG", nullptr));
mDelSelectedSampleBtn->setText(QCoreApplication::translate("CIspindelGUI", "Delete Sample", nullptr));
} // retranslateUi } // retranslateUi
}; };