Ajout interface ISpindel

This commit is contained in:
jfmartel 2021-12-12 12:19:50 -05:00
parent 75b487a862
commit a69e88c091
25 changed files with 903 additions and 24 deletions

View File

@ -134,6 +134,11 @@ int CChalet::RequestDeviceWifiParams()
} }
int CChalet::RequestFirmwareVersion()
{
mNetworkInterface->SendMasterCtrlCommand(CHALET_INTERFACE_GET_FIRMWARE_VERSION_REQUEST,QByteArray());
}
int CChalet::DeviceWiFiParamsReceived(QByteArray *Data) int CChalet::DeviceWiFiParamsReceived(QByteArray *Data)
{ {
quint32 Add = 0; quint32 Add = 0;
@ -169,6 +174,11 @@ int CChalet::DeviceWiFiParamsReceived(QByteArray *Data)
return RET_OK; return RET_OK;
} }
int CChalet::DeviceFirmwareVersionReceived(QByteArray Data)
{
mChaletGui->UpdateFirmwareVersion(Data);
}
int CChalet::SetDeviceWifiParams(QString IP, QString Gateway) int CChalet::SetDeviceWifiParams(QString IP, QString Gateway)
{ {
QHostAddress DeviceIP; QHostAddress DeviceIP;

View File

@ -35,6 +35,8 @@ public:
int RequestDeviceWifiParams(); int RequestDeviceWifiParams();
int DeviceWiFiParamsReceived(QByteArray *Data); int DeviceWiFiParamsReceived(QByteArray *Data);
int SetDeviceWifiParams(QString IP, QString Gateway); int SetDeviceWifiParams(QString IP, QString Gateway);
int RequestFirmwareVersion();
int DeviceFirmwareVersionReceived(QByteArray Data);
signals: signals:

View File

@ -15,6 +15,15 @@ CChaletGui::CChaletGui(QWidget *parent) :
ui->mDoHarakiriButton->setEnabled(false); ui->mDoHarakiriButton->setEnabled(false);
ui->mLogStartDateEdit->setDate(QDate::currentDate()); ui->mLogStartDateEdit->setDate(QDate::currentDate());
mGetFimwVersionButtonColorTimer = new QTimer;
mGetFimwVersionButtonColorTimer->setSingleShot(true);
mGetFimwVersionButtonColorTimer->setInterval(500);
mGetWifiParamsButtonColorTimer = new QTimer;
mGetWifiParamsButtonColorTimer->setSingleShot(true);
mGetWifiParamsButtonColorTimer->setInterval(500);
connect(ui->mWiFiModuleONBtn,SIGNAL(clicked()),this,SLOT(WiFiONButtonClicked())); connect(ui->mWiFiModuleONBtn,SIGNAL(clicked()),this,SLOT(WiFiONButtonClicked()));
connect(ui->mWiFiModuleOFFBtn,SIGNAL(clicked(bool)),this,SLOT(WiFiOFFButtonClicked())); connect(ui->mWiFiModuleOFFBtn,SIGNAL(clicked(bool)),this,SLOT(WiFiOFFButtonClicked()));
connect(ui->mInverterRelayOFFBtn,SIGNAL(clicked()),this,SLOT(InverterPowerOFFButtonClicked())); connect(ui->mInverterRelayOFFBtn,SIGNAL(clicked()),this,SLOT(InverterPowerOFFButtonClicked()));
@ -25,6 +34,11 @@ CChaletGui::CChaletGui(QWidget *parent) :
connect(ui->mGetChaletLogButton,SIGNAL(clicked(bool)),this,SLOT(GetChaletLogsBtnClicked())); connect(ui->mGetChaletLogButton,SIGNAL(clicked(bool)),this,SLOT(GetChaletLogsBtnClicked()));
connect(ui->mWiFiGetRemoteSettingsBtn,SIGNAL(clicked(bool)),this,SLOT(GetDeviceWiFiParamsButtonClicked(bool))); connect(ui->mWiFiGetRemoteSettingsBtn,SIGNAL(clicked(bool)),this,SLOT(GetDeviceWiFiParamsButtonClicked(bool)));
connect(ui->mWiFiSetRemoteSettingsBtn,SIGNAL(clicked(bool)),this,SLOT(SetDeviceWiFiParamsButtonClicked(bool))); connect(ui->mWiFiSetRemoteSettingsBtn,SIGNAL(clicked(bool)),this,SLOT(SetDeviceWiFiParamsButtonClicked(bool)));
connect(ui->mGetFirmwareVersionBtn,SIGNAL(clicked(bool)),this,SLOT(GetFirmwareVersionBtnClicked()));
connect(ui->mStartSyslogShellBtn,SIGNAL(clicked(bool)),this,SLOT(StartSyslogShellBtnClicked()));
connect(ui->mStartTerminalShellBtn,SIGNAL(clicked(bool)),this,SLOT(StartTerminalShellBtnClicked()));
connect(mGetFimwVersionButtonColorTimer,SIGNAL(timeout()),this,SLOT(GetFirmwVersionBtnColorTimerExpired()));
connect(mGetWifiParamsButtonColorTimer,SIGNAL(timeout()),this,SLOT(GetWifiParamsBtnColorTimerExpired()));
mBatteryPlotWidget = new QCustomPlot(ui->mPlotWidget); mBatteryPlotWidget = new QCustomPlot(ui->mPlotWidget);
mBatteryPlotWidget->resize(ui->mPlotWidget->size()); mBatteryPlotWidget->resize(ui->mPlotWidget->size());
@ -59,12 +73,18 @@ CChaletGui::CChaletGui(QWidget *parent) :
mBatteryPlotWidget->graph(0)->addData(now,13.5); mBatteryPlotWidget->graph(0)->addData(now,13.5);
mBatteryPlotWidget->replot(); mBatteryPlotWidget->replot();
mFirmVersionDefaultBtnPal = ui->mGetFirmwareVersionBtn->palette();
mWifiDefaultBtnPal = ui->mGetFirmwareVersionBtn->palette();
} }
CChaletGui::~CChaletGui() CChaletGui::~CChaletGui()
{ {
delete ui; delete ui;
delete mBatteryPlotWidget; delete mBatteryPlotWidget;
delete mGetFimwVersionButtonColorTimer;
delete mGetWifiParamsButtonColorTimer;
} }
int CChaletGui::UpdateChaletStatus(CChaletMainStatus Status) int CChaletGui::UpdateChaletStatus(CChaletMainStatus Status)
@ -87,7 +107,8 @@ int CChaletGui::UpdateChaletStatus(CChaletMainStatus Status)
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("Solar Panel Current: Unknown"); ui->mSolarPanelCurrentLabel->setText("Raw Solar Panel Current: 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->mChaletTemperatureLbl->setText("Temperature: -100)");
@ -186,9 +207,17 @@ 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("Solar Panel Current: %1").arg(Status.mBatteryCurrent); QString Current = QString("Raw Solar Panel Current: %1").arg(Status.mBatteryCurrent);
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;
ConvertedCurrent -= (3.3/2);
ConvertedCurrent *= 25;
QString CnvCurrent = QString("Solar Panel Current (A): %1").arg(ConvertedCurrent);
ui->mSolarPanelCurrentCnvLbl->setText(CnvCurrent);
QString SOC = QString("Battery SOC: %1").arg(Status.mBatterySOC); QString SOC = QString("Battery SOC: %1").arg(Status.mBatterySOC);
ui->mBatterySOCLabel->setText(SOC); ui->mBatterySOCLabel->setText(SOC);
@ -331,4 +360,60 @@ void CChaletGui::RebootCPUButtonClicked()
{ {
ui->mWiFiIPAddressEditBx->setText(IP.toString()); ui->mWiFiIPAddressEditBx->setText(IP.toString());
ui->mWiFiGatewayAddressEditBx->setText(Gateway.toString()); ui->mWiFiGatewayAddressEditBx->setText(Gateway.toString());
QPalette pal = ui->mWiFiGetRemoteSettingsBtn->palette();
pal.setColor(QPalette::Button, QColor(Qt::green));
ui->mWiFiGetRemoteSettingsBtn->setAutoFillBackground(true);
ui->mWiFiGetRemoteSettingsBtn->setPalette(pal);
ui->mWiFiGetRemoteSettingsBtn->update();
mGetWifiParamsButtonColorTimer->start();
}
void CChaletGui::GetFirmwareVersionBtnClicked()
{
mProgramHandle->RequestFirmwareVersion();
}
void CChaletGui::UpdateFirmwareVersion(QByteArray Version)
{
QString VersionString(Version);
VersionString.prepend("Firmware version: ");
ui->mFirmwareVersionLabel->setText(VersionString);
QPalette pal = ui->mGetFirmwareVersionBtn->palette();
pal.setColor(QPalette::Button, QColor(Qt::green));
ui->mGetFirmwareVersionBtn->setAutoFillBackground(true);
ui->mGetFirmwareVersionBtn->setPalette(pal);
ui->mGetFirmwareVersionBtn->update();
mGetFimwVersionButtonColorTimer->start();
}
void CChaletGui::StartSyslogShellBtnClicked()
{
//system("c:\\progra~1\\putty\\putty.exe -load \"0-ChaletDuino_Syslog\"");
// QProcess Putty;
QProcess::startDetached("c:\\progra~1\\putty\\putty.exe -load \"0-ChaletDuino_Syslog\"");
}
void CChaletGui::StartTerminalShellBtnClicked()
{
// system("c:\\program files\\putty\\putty.exe -load \"0-ChaletDuino_Terminal\"");
QProcess::startDetached("c:\\progra~1\\putty\\putty.exe -load \"0-ChaletDuino_Terminal\"");
}
void CChaletGui::GetFirmwVersionBtnColorTimerExpired()
{
ui->mGetFirmwareVersionBtn->setAutoFillBackground(true);
ui->mGetFirmwareVersionBtn->setPalette(mFirmVersionDefaultBtnPal);
ui->mGetFirmwareVersionBtn->update();
}
void CChaletGui::GetWifiParamsBtnColorTimerExpired()
{
ui->mWiFiGetRemoteSettingsBtn->setAutoFillBackground(true);
ui->mWiFiGetRemoteSettingsBtn->setPalette(mFirmVersionDefaultBtnPal);
ui->mWiFiGetRemoteSettingsBtn->update();
} }

View File

@ -26,6 +26,8 @@ public:
int UpdateChaletStatus(CChaletMainStatus Status); int UpdateChaletStatus(CChaletMainStatus Status);
int UpdateChaletLogPlot(QByteArray* Log); int UpdateChaletLogPlot(QByteArray* Log);
int ChaletCommActivity(); int ChaletCommActivity();
QTimer *mGetWifiParamsButtonColorTimer, *mGetFimwVersionButtonColorTimer;
QPalette mFirmVersionDefaultBtnPal, mWifiDefaultBtnPal;
private: private:
Ui::CChaletGui *ui; Ui::CChaletGui *ui;
@ -42,6 +44,14 @@ public slots:
void GetDeviceWiFiParamsButtonClicked(bool); void GetDeviceWiFiParamsButtonClicked(bool);
void SetDeviceWiFiParamsButtonClicked(bool); void SetDeviceWiFiParamsButtonClicked(bool);
void UpdateDeviceWiFiParameters(QHostAddress IP,QHostAddress Gateway); void UpdateDeviceWiFiParameters(QHostAddress IP,QHostAddress Gateway);
void GetFirmwareVersionBtnClicked();
void UpdateFirmwareVersion(QByteArray Version);
void StartSyslogShellBtnClicked();
void StartTerminalShellBtnClicked();
void GetWifiParamsBtnColorTimerExpired();
void GetFirmwVersionBtnColorTimerExpired();
}; };
#endif // CHALETGUI_H #endif // CHALETGUI_H

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1024</width> <width>1443</width>
<height>598</height> <height>662</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -236,14 +236,14 @@
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>Solar Panel Current: </string> <string>Raw Solar Panel Current: </string>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="mBatterySOCLabel"> <widget class="QLabel" name="mBatterySOCLabel">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>187</x> <x>190</x>
<y>280</y> <y>300</y>
<width>241</width> <width>241</width>
<height>16</height> <height>16</height>
</rect> </rect>
@ -255,8 +255,8 @@
<widget class="QLabel" name="mCurrentSensorStateLbl"> <widget class="QLabel" name="mCurrentSensorStateLbl">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>187</x> <x>190</x>
<y>300</y> <y>320</y>
<width>241</width> <width>241</width>
<height>16</height> <height>16</height>
</rect> </rect>
@ -283,7 +283,7 @@
<rect> <rect>
<x>420</x> <x>420</x>
<y>240</y> <y>240</y>
<width>571</width> <width>1021</width>
<height>321</height> <height>321</height>
</rect> </rect>
</property> </property>
@ -341,7 +341,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>190</x> <x>190</x>
<y>320</y> <y>340</y>
<width>241</width> <width>241</width>
<height>16</height> <height>16</height>
</rect> </rect>
@ -457,6 +457,76 @@
<string>WiFi parameters (stored in flash)</string> <string>WiFi parameters (stored in flash)</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="mSolarPanelCurrentCnvLbl">
<property name="geometry">
<rect>
<x>190</x>
<y>280</y>
<width>201</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Solar Panel Current (A):</string>
</property>
</widget>
<widget class="QLabel" name="mFirmwareVersionLabel">
<property name="geometry">
<rect>
<x>180</x>
<y>520</y>
<width>231</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Firmware Version: ?</string>
</property>
</widget>
<widget class="QPushButton" name="mGetFirmwareVersionBtn">
<property name="geometry">
<rect>
<x>90</x>
<y>520</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>GET</string>
</property>
</widget>
<widget class="QPushButton" name="mStartTerminalShellBtn">
<property name="geometry">
<rect>
<x>60</x>
<y>590</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Terminal</string>
</property>
</widget>
<widget class="QPushButton" name="mStartSyslogShellBtn">
<property name="geometry">
<rect>
<x>150</x>
<y>590</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Syslog</string>
</property>
</widget>
<zorder>groupBox_2</zorder> <zorder>groupBox_2</zorder>
<zorder>groupBox</zorder> <zorder>groupBox</zorder>
<zorder>MainPageLabel</zorder> <zorder>MainPageLabel</zorder>
@ -488,6 +558,11 @@
<zorder>label</zorder> <zorder>label</zorder>
<zorder>mWiFiGatewayAddressEditBx</zorder> <zorder>mWiFiGatewayAddressEditBx</zorder>
<zorder>label_2</zorder> <zorder>label_2</zorder>
<zorder>mSolarPanelCurrentCnvLbl</zorder>
<zorder>mFirmwareVersionLabel</zorder>
<zorder>mGetFirmwareVersionBtn</zorder>
<zorder>mStartTerminalShellBtn</zorder>
<zorder>mStartSyslogShellBtn</zorder>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>

View File

@ -94,6 +94,11 @@ int CChaletMasterCtrlInterface::DeviceFrameReceived(int TargetDeviceID, int Targ
{ {
break; break;
} }
case CHALET_INTERFACE_GET_FIRMWARE_VERSION_RESPONSE:
{
mProgramHandle->DeviceFirmwareVersionReceived(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

@ -9,6 +9,7 @@ CGuiMain::CGuiMain(QWidget *parent)
mAvReceiverGui = new CAvReceiverGui(this); mAvReceiverGui = new CAvReceiverGui(this);
mMainTabWidget = new QTabWidget(this); mMainTabWidget = new QTabWidget(this);
mChaletGui = new CChaletGui(this); mChaletGui = new CChaletGui(this);
mIspindelGui = new CIspindelGUI(this);
mTowerLightShowGui = new CTowerLightShowGui; mTowerLightShowGui = new CTowerLightShowGui;
mPICUploaderGui = new CPICUploaderGui; mPICUploaderGui = new CPICUploaderGui;
setCentralWidget(mMainTabWidget); setCentralWidget(mMainTabWidget);
@ -18,8 +19,9 @@ CGuiMain::CGuiMain(QWidget *parent)
mMainTabWidget->addTab(mChaletGui,"Chalet"); mMainTabWidget->addTab(mChaletGui,"Chalet");
mMainTabWidget->addTab(mTowerLightShowGui,"Lightshow"); mMainTabWidget->addTab(mTowerLightShowGui,"Lightshow");
mMainTabWidget->addTab(mPICUploaderGui,"Firmware Upload"); mMainTabWidget->addTab(mPICUploaderGui,"Firmware Upload");
mMainTabWidget->addTab(mIspindelGui,"ISpindel");
resize(1024,768); resize(1700,768);
} }
CGuiMain::~CGuiMain() CGuiMain::~CGuiMain()

View File

@ -10,6 +10,7 @@
#include "ChaletGui.h" #include "ChaletGui.h"
#include "TowerLightShowGui.h" #include "TowerLightShowGui.h"
#include "PICUploaderGui.h" #include "PICUploaderGui.h"
#include "IspindelGUI.h"
class CGuiMain : public QMainWindow class CGuiMain : public QMainWindow
{ {
@ -26,6 +27,7 @@ public:
QTabWidget *mMainTabWidget; QTabWidget *mMainTabWidget;
CTowerLightShowGui *mTowerLightShowGui; CTowerLightShowGui *mTowerLightShowGui;
CPICUploaderGui *mPICUploaderGui; CPICUploaderGui *mPICUploaderGui;
CIspindelGUI *mIspindelGui;
int RespawnMainWindow(); int RespawnMainWindow();
int HideMainWindow(); int HideMainWindow();

View File

@ -0,0 +1,123 @@
#include "Ispindel.h"
#include <QDataStream>
#include "IspindelInterface.h"
CIspindel::CIspindel(CIspindelGUI *IspindelGui)
{
mIspindelGui = IspindelGui;
IspindelGui->mProgramHandle = this;
mNetworkInterface = new CIspindelInterface(this);
}
CIspindel::~CIspindel()
{
delete mNetworkInterface;
}
void CIspindel::Start()
{
mNetworkInterface->ConnectToMasterCtrl();
}
void CIspindel::IspindelFullBufferReceived(QByteArray *Data)
{
int NbItems;
QDataStream Strm(Data,QIODevice::ReadOnly | QIODevice::Unbuffered);
Strm >> NbItems;
if(NbItems == 0)
{
qDebug("Received empty Ispindel buffer...");
return;
}
ClearIspindleDataList();
for(int i = 0; i < NbItems; i++)
{
CIspindelData *NewFrame = new CIspindelData;
Strm >> *NewFrame;
mIspindelDataList.append(NewFrame);
}
SetLasFrameTextInGUI(*mIspindelDataList.last());
mIspindelGui->UpdateIspindelPlot(&mIspindelDataList);
}
void CIspindel::IspindelLastFrameReceived(QByteArray Data)
{
int DataSize;
QDataStream Strm(&Data,QIODevice::ReadOnly | QIODevice::Unbuffered);
if(Data.size() == 0)
return;
CIspindelData *NewData = new CIspindelData();
Strm >> *NewData;
mIspindelDataList.append(NewData);
SetLasFrameTextInGUI(*NewData);
mIspindelGui->NewIspindelFrameReceived(NewData);
// qDebug("Latest Ispindel data received");
}
void CIspindel::ClearIspindleDataList()
{
for(int i = 0; i < mIspindelDataList.size(); i++)
{
delete mIspindelDataList[i];
}
mIspindelDataList.clear();
}
void CIspindel::ConnectedToMaster(bool connected)
{
if(connected)
{
mNetworkInterface->SendMasterCtrlCommand(ISPINDEL_GET_FULL_DATA_BUFFER_REQUEST,QByteArray());
}
}
void CIspindel::SetLasFrameTextInGUI(CIspindelData Frame)
{
QString FrameText;
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------------------------------")\
.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"));
// FrameText = QString("\nLast Frame\n\
// 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);
}

View File

@ -0,0 +1,39 @@
#ifndef ISPINDEL_H
#define ISPINDEL_H
#include <QObject>
#include "IspindelGUI.h"
#include "IspindelData.h"
#include <QList>
#include "QCustomPlot/qcustomplot.h"
class CIspindelInterface;
class CIspindel : public QObject
{
Q_OBJECT
public:
explicit CIspindel(CIspindelGUI *IspindelGui);
~CIspindel();
CIspindelGUI *mIspindelGui;
void Start();
void IspindelFullBufferReceived(QByteArray *Data);
void IspindelLastFrameReceived(QByteArray Data);
void ClearIspindleDataList();
void ConnectedToMaster(bool connected);
void SetLasFrameTextInGUI(CIspindelData Frame);
QList<CIspindelData*> mIspindelDataList;
CIspindelInterface *mNetworkInterface;
signals:
public slots:
};
#endif // ISPINDEL_H

View File

@ -0,0 +1,54 @@
#include "IspindelData.h"
CIspindelData::CIspindelData()
{
mIspindelID = mRSSI = mInterval = 0;
mIspindelName = mTemperatureUnits = "";
mAngle = mBattery = mGravity = mTemperature = 0.0;
mSampleDateTime = QDateTime::currentDateTime();
}
QDataStream &operator<<(QDataStream &out, const CIspindelData &source)
{
out << source.mAngle
<< source.mBattery
<< source.mGravity
<< source.mInterval
<< source.mIspindelID
<< source.mIspindelName
<< source.mRSSI
<< source.mTemperature
<< source.mTemperatureUnits
<< source.mSampleDateTime;
return out;
}
QDataStream &operator>>(QDataStream &in, CIspindelData &dest)
{
in >> dest.mAngle
>> dest.mBattery
>> dest.mGravity
>> dest.mInterval
>> dest.mIspindelID
>> dest.mIspindelName
>> dest.mRSSI
>> dest.mTemperature
>> dest.mTemperatureUnits
>> dest.mSampleDateTime;
return in;
}
QByteArray CIspindelData::ToByteArray()
{
QByteArray Array;
QDataStream Strm(&Array,QIODevice::WriteOnly | QIODevice::Unbuffered);
Strm << *this;
return Array;
}

View File

@ -0,0 +1,25 @@
#ifndef CISPINDELDATA_H
#define CISPINDELDATA_H
#include <QString>
#include <QDataStream>
#include <QDateTime>
class CIspindelData
{
public:
CIspindelData();
int mIspindelID, mRSSI, mInterval;
QString mIspindelName, mTemperatureUnits;
double mAngle, mBattery, mGravity, mTemperature;
QDateTime mSampleDateTime;
QByteArray ToByteArray();
};
QDataStream &operator<<(QDataStream &out, const CIspindelData &source);
QDataStream &operator>>(QDataStream &in, CIspindelData &dest);
#endif // CISPINDELDATA_H

View File

@ -0,0 +1,110 @@
#include "IspindelGUI.h"
#include "ui_IspindelGUI.h"
#include "Ispindel.h"
#include "IspindelData.h"
#include "GlobalDefine.h"
CIspindelGUI::CIspindelGUI(QWidget *parent) :
QDialog(parent),
ui(new Ui::CIspindelGUI)
{
ui->setupUi(this);
mIspindelPlot = new QCustomPlot(ui->mIspindelPlot);
mIspindelPlot->resize(ui->mIspindelPlot->size());
// create graph and assign data to it:
mIspindelPlot->addGraph();
mIspindelPlot->addGraph(mIspindelPlot->xAxis,mIspindelPlot->yAxis2);
// give the axes some labels:
mIspindelPlot->xAxis->setLabel("Time");
mIspindelPlot->yAxis->setLabel("Gravity");
mIspindelPlot->yAxis2->setLabel("Temprature (C)");
mIspindelPlot->yAxis2->setVisible(true);
double now = QDateTime::currentDateTime().toSecsSinceEpoch();
QSharedPointer<QCPAxisTickerDateTime> dateTicker(new QCPAxisTickerDateTime);
dateTicker->setDateTimeFormat("hh:mm:ss\ndd MMM");
mIspindelPlot->xAxis->setTicker(dateTicker);
mIspindelPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables);
QList<QCPAxis*> xAxis, yAxis;
xAxis.append(mIspindelPlot->xAxis);
yAxis.append(mIspindelPlot->yAxis);
yAxis.append(mIspindelPlot->yAxis2);
mIspindelPlot->axisRect()->setRangeDragAxes(xAxis,yAxis);
mIspindelPlot->axisRect()->setRangeZoomAxes(xAxis,yAxis);
// mIspindelPlot->yAxis2->axisRect()->setRangeZoomAxes(0,mIspindelPlot->yAxis2);
QDateTime Now = QDateTime::currentDateTime().toLocalTime();
QDateTime midnight = Now;
midnight.setTime(QTime(0,0,0));
QDateTime eod = Now;
eod.setTime(QTime(23,59,0));
//mIspindelPlot->xAxis->setRange(0/*QCPAxisTickerDateTime::dateTimeToKey(midnight)*/,QCPAxisTickerDateTime::dateTimeToKey(eod));
// mIspindelPlot->xAxis->setRange(now, now+(2*3600));
mIspindelPlot->xAxis->setRange(midnight.toSecsSinceEpoch(), eod.toSecsSinceEpoch());
mIspindelPlot->yAxis->setRange(1.000,1.01);
mIspindelPlot->yAxis2->setRange(15,25);
// mIspindelPlot->graph(0)->addData(now,1.005);
// mIspindelPlot->graph(1)->addData(now,20);
mIspindelPlot->replot();
}
CIspindelGUI::~CIspindelGUI()
{
delete ui;
}
void CIspindelGUI::SetLastIspindelFrameData(QString Data)
{
ui->mLastFrameDataLbl->setText(Data);
}
int CIspindelGUI::UpdateIspindelPlot(QList<CIspindelData *> *Data)
{
if(Data->size() == 0)
return RET_ERROR;
QVector<double> x,y,ty;
for(int i = 0; i < Data->size(); i++)
{
x.append(Data->at(i)->mSampleDateTime.toSecsSinceEpoch());
y.append(Data->at(i)->mGravity);
ty.append(Data->at(i)->mTemperature);
}
if(x.size() == 0 || y.size() == 0)
return RET_ERROR;
mIspindelPlot->graph(0)->data().clear();
mIspindelPlot->graph(0)->setData(x,y);
mIspindelPlot->xAxis->setRange(x.first(),x.last());
mIspindelPlot->yAxis->setRange(y.first(),y.last());
mIspindelPlot->graph(1)->setPen(QColor(Qt::red));
mIspindelPlot->graph(1)->setName("Température");
mIspindelPlot->graph(1)->setData(x,ty);
mIspindelPlot->yAxis2->setRange(10,30);
mIspindelPlot->replot();
return RET_OK;
}
int CIspindelGUI::NewIspindelFrameReceived(CIspindelData *Data)
{
mIspindelPlot->graph(0)->addData(Data->mSampleDateTime.toSecsSinceEpoch(),Data->mGravity);
mIspindelPlot->graph(1)->addData(Data->mSampleDateTime.toSecsSinceEpoch(),Data->mTemperature);
mIspindelPlot->replot();
}

View File

@ -0,0 +1,34 @@
#ifndef ISPINDELGUI_H
#define ISPINDELGUI_H
#include <QDialog>
#include "QCustomPlot/qcustomplot.h"
#include <QList>
namespace Ui {
class CIspindelGUI;
}
class CIspindel;
class CIspindelData;
class CIspindelGUI : public QDialog
{
Q_OBJECT
public:
explicit CIspindelGUI(QWidget *parent = 0);
~CIspindelGUI();
CIspindel *mProgramHandle;
void SetLastIspindelFrameData(QString Data);
int UpdateIspindelPlot(QList<CIspindelData*> *Data);
int NewIspindelFrameReceived(CIspindelData *Data);
QCustomPlot *mIspindelPlot;
private:
Ui::CIspindelGUI *ui;
};
#endif // ISPINDELGUI_H

View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CIspindelGUI</class>
<widget class="QDialog" name="CIspindelGUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1123</width>
<height>629</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>510</x>
<y>20</y>
<width>91</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>ISpindel</string>
</property>
</widget>
<widget class="QWidget" name="mIspindelPlot" native="true">
<property name="geometry">
<rect>
<x>520</x>
<y>100</y>
<width>661</width>
<height>461</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="mLastFrameDataLbl">
<property name="geometry">
<rect>
<x>60</x>
<y>50</y>
<width>381</width>
<height>211</height>
</rect>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>No data...</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QTableWidget" name="tableWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>290</y>
<width>461</width>
<height>331</height>
</rect>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,64 @@
#include "IspindelInterface.h"
#include "IspindelData.h"
#include "Ispindel.h"
#include "ProtocolDefs.h"
CIspindelInterface::CIspindelInterface(CIspindel *ProgramHandle)
{
mMyDeviceID = ID_ISPINDEL_INTERFACE;
mNetworkPort = 2182;
mMasterCtrlIPAddress = "127.0.0.1";
mNetworkCommSocket = 0;
mDeviceAddress = 1;
mProgramHandle = ProgramHandle;
}
int CIspindelInterface::DeviceConnectedToMaster(bool Connected)
{
if(Connected)
{
qDebug("Ispindel Interface connected to Master.");
mProgramHandle->ConnectedToMaster(Connected);
}
else
return RET_ERROR;
return RET_OK;
}
int CIspindelInterface::DeviceFrameReceived(int TargetDeviceID, int TargetDeviceAddress, int SenderID, int SenderAddress, int MessageID, int DataSize, QByteArray Data)
{
Q_UNUSED(DataSize)
Q_UNUSED(SenderID)
Q_UNUSED(SenderAddress)
if(TargetDeviceID == mMyDeviceID && (TargetDeviceAddress == BROADCAST_VALUE || TargetDeviceAddress == mDeviceAddress))
{
switch(MessageID)
{
case ISPINDEL_GET_FULL_DATA_BUFFER_RESPONSE:
{
mProgramHandle->IspindelFullBufferReceived(&Data);
break;
}
case ISPINDLE_LATEST_DATA_RESPONSE:
{
mProgramHandle->IspindelLastFrameReceived(Data);
break;
}
case ISPINDEL_GET_FULL_DATA_BUFFER_REQUEST:
case ISPINDLE_LATEST_DATA_REQUEST:
default:
{
qDebug("Ispindel: Invalid Ethernet Msg received from MasterCtrl: %d",MessageID);
break;
}
}
}
return RET_OK;
}

View File

@ -0,0 +1,20 @@
#ifndef ISPINDELINTERFACE_H
#define ISPINDELINTERFACE_H
#include "MasterCtrlInterface.h"
class CIspindel;
class CIspindelInterface : public CMasterCtrlInterface
{
public:
CIspindelInterface(CIspindel *ProgramHandle);
int DeviceFrameReceived(int TargetDeviceID, int TargetDeviceAddress, int SenderID, int SenderAddress, int MessageID, int DataSize, QByteArray Data);
int DeviceConnectedToMaster(bool Connected);
private:
CIspindel *mProgramHandle;
};
#endif // ISPINDELINTERFACE_H

View File

@ -56,7 +56,7 @@
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>192.168.50.126</string> <string>192.168.30.125</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="mOpenedHexFilePathLbl"> <widget class="QLabel" name="mOpenedHexFilePathLbl">

View File

@ -59,10 +59,11 @@ enum DEVICES_IDS
ID_DEADBOLT_INTERFACE, ID_DEADBOLT_INTERFACE,
ID_AVRECEIVER_INTERFACE, ID_AVRECEIVER_INTERFACE,
ID_CHALET_INTERFACE, ID_CHALET_INTERFACE,
ID_CHALET_DEVICE,
ID_ISPINDEL_INTERFACE,
ID_NB_DEVICE_ID ID_NB_DEVICE_ID
}; };
// Commands definitions // Commands definitions
enum MASTER_CMD enum MASTER_CMD
@ -273,6 +274,8 @@ enum CHALET_INTERFACE_CMDS
CHALET_INTERFACE_WIFI_GET_DEVICE_PARAMS_RESPONSE, CHALET_INTERFACE_WIFI_GET_DEVICE_PARAMS_RESPONSE,
CHALET_INTERFACE_WIFI_SET_DEVICE_PARAMS_REQUEST, CHALET_INTERFACE_WIFI_SET_DEVICE_PARAMS_REQUEST,
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_RESPONSE,
MAX_CHALET_INTERFACE_CMD MAX_CHALET_INTERFACE_CMD
@ -342,4 +345,15 @@ enum BOOTLOADER_CMDS
MAX_BOOTLOADER_CMD MAX_BOOTLOADER_CMD
}; };
enum ISPINDLE_CMDS
{
ISPINDLE_ACK = 1,
ISPINDLE_LATEST_DATA_REQUEST,
ISPINDLE_LATEST_DATA_RESPONSE,
ISPINDEL_GET_FULL_DATA_BUFFER_REQUEST,
ISPINDEL_GET_FULL_DATA_BUFFER_RESPONSE,
MAX_ISPINDLE_CMDS
};
#endif #endif

View File

@ -10,6 +10,7 @@ CSystemGui::CSystemGui(QObject *parent) : QObject(parent)
mAvReceiver = new CAvReceiver(mGui->mAvReceiverGui); mAvReceiver = new CAvReceiver(mGui->mAvReceiverGui);
mChalet = new CChalet(mGui->mChaletGui); mChalet = new CChalet(mGui->mChaletGui);
mPICUploader = new CPICUploader(mGui->mPICUploaderGui); mPICUploader = new CPICUploader(mGui->mPICUploaderGui);
mIspindel = new CIspindel(mGui->mIspindelGui);
mSysTrayMgr = new CSystemTrayManager(); mSysTrayMgr = new CSystemTrayManager();
mSysTrayMgr->mProgramHandle=this; mSysTrayMgr->mProgramHandle=this;
@ -26,6 +27,7 @@ CSystemGui::~CSystemGui()
delete mAvReceiver; delete mAvReceiver;
delete mChalet; delete mChalet;
delete mPICUploader; delete mPICUploader;
delete mIspindel;
} }
@ -37,6 +39,7 @@ void CSystemGui::Start()
mAvReceiver->Start(); mAvReceiver->Start();
mChalet->Start(); mChalet->Start();
mPICUploader->Start(); mPICUploader->Start();
mIspindel->Start();
} }

View File

@ -11,6 +11,7 @@
#include "AvReceiver.h" #include "AvReceiver.h"
#include "CChalet.h" #include "CChalet.h"
#include "PICUploader.h" #include "PICUploader.h"
#include "Ispindel.h"
class CSystemGui : public QObject class CSystemGui : public QObject
@ -37,6 +38,7 @@ private:
CAvReceiver *mAvReceiver; CAvReceiver *mAvReceiver;
CChalet *mChalet; CChalet *mChalet;
CPICUploader *mPICUploader; CPICUploader *mPICUploader;
CIspindel *mIspindel;
signals: signals:

View File

@ -29,6 +29,7 @@ INCLUDEPATH += Sources\
Sources/Chalet\ Sources/Chalet\
Sources/Tower\ Sources/Tower\
Sources/PICUploader\ Sources/PICUploader\
Sources/Ispindel \
SOURCES += \ SOURCES += \
Sources/Chalet/CChalet.cpp \ Sources/Chalet/CChalet.cpp \
@ -71,7 +72,11 @@ SOURCES += \
Sources/PICUploader/HexFile.cpp \ Sources/PICUploader/HexFile.cpp \
Sources/PICUploader/HexRecord.cpp \ Sources/PICUploader/HexRecord.cpp \
Sources/PICUploader/BootloaderProtocol.cpp \ Sources/PICUploader/BootloaderProtocol.cpp \
Sources/CRC32.cpp Sources/CRC32.cpp \
Sources/Ispindel/IspindelGUI.cpp \
Sources/Ispindel/Ispindel.cpp \
Sources/Ispindel/IspindelInterface.cpp \
Sources/Ispindel/IspindelData.cpp
HEADERS += Sources/AbstractNetworkInterface.h \ HEADERS += Sources/AbstractNetworkInterface.h \
Sources/Chalet/CChalet.h \ Sources/Chalet/CChalet.h \
@ -115,7 +120,11 @@ HEADERS += Sources/AbstractNetworkInterface.h \
Sources/PICUploader/HexFile.h \ Sources/PICUploader/HexFile.h \
Sources/PICUploader/HexRecord.h \ Sources/PICUploader/HexRecord.h \
Sources/PICUploader/BootloaderProtocol.h \ Sources/PICUploader/BootloaderProtocol.h \
Sources/CRC32.h Sources/CRC32.h \
Sources/Ispindel/IspindelGUI.h \
Sources/Ispindel/Ispindel.h \
Sources/Ispindel/IspindelInterface.h \
Sources/Ispindel/IspindelData.h
FORMS += \ FORMS += \
SMSGui.ui \ SMSGui.ui \
@ -124,4 +133,5 @@ FORMS += \
Sources/Sprinkler/SprinklerGui.ui \ Sources/Sprinkler/SprinklerGui.ui \
Sources/Sprinkler/SprinklerDeviceGuiItem.ui \ Sources/Sprinkler/SprinklerDeviceGuiItem.ui \
Sources/AvReceiver/AvReceiverGui.ui \ Sources/AvReceiver/AvReceiverGui.ui \
Sources/Tower/TowerLightShowGui.ui Sources/Tower/TowerLightShowGui.ui \
Sources/Ispindel/IspindelGUI.ui

View File

@ -56,12 +56,17 @@ public:
QLineEdit *mWiFiGatewayAddressEditBx; QLineEdit *mWiFiGatewayAddressEditBx;
QLabel *label_2; QLabel *label_2;
QGroupBox *groupBox_2; QGroupBox *groupBox_2;
QLabel *mSolarPanelCurrentCnvLbl;
QLabel *mFirmwareVersionLabel;
QPushButton *mGetFirmwareVersionBtn;
QPushButton *mStartTerminalShellBtn;
QPushButton *mStartSyslogShellBtn;
void setupUi(QWidget *CChaletGui) void setupUi(QWidget *CChaletGui)
{ {
if (CChaletGui->objectName().isEmpty()) if (CChaletGui->objectName().isEmpty())
CChaletGui->setObjectName(QString::fromUtf8("CChaletGui")); CChaletGui->setObjectName(QString::fromUtf8("CChaletGui"));
CChaletGui->resize(1024, 598); CChaletGui->resize(1443, 662);
MainPageLabel = new QLabel(CChaletGui); MainPageLabel = new QLabel(CChaletGui);
MainPageLabel->setObjectName(QString::fromUtf8("MainPageLabel")); MainPageLabel->setObjectName(QString::fromUtf8("MainPageLabel"));
MainPageLabel->setGeometry(QRect(460, 10, 71, 31)); MainPageLabel->setGeometry(QRect(460, 10, 71, 31));
@ -124,16 +129,16 @@ public:
mSolarPanelCurrentLabel->setGeometry(QRect(187, 260, 241, 16)); mSolarPanelCurrentLabel->setGeometry(QRect(187, 260, 241, 16));
mBatterySOCLabel = new QLabel(CChaletGui); mBatterySOCLabel = new QLabel(CChaletGui);
mBatterySOCLabel->setObjectName(QString::fromUtf8("mBatterySOCLabel")); mBatterySOCLabel->setObjectName(QString::fromUtf8("mBatterySOCLabel"));
mBatterySOCLabel->setGeometry(QRect(187, 280, 241, 16)); mBatterySOCLabel->setGeometry(QRect(190, 300, 241, 16));
mCurrentSensorStateLbl = new QLabel(CChaletGui); mCurrentSensorStateLbl = new QLabel(CChaletGui);
mCurrentSensorStateLbl->setObjectName(QString::fromUtf8("mCurrentSensorStateLbl")); mCurrentSensorStateLbl->setObjectName(QString::fromUtf8("mCurrentSensorStateLbl"));
mCurrentSensorStateLbl->setGeometry(QRect(187, 300, 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(600, 190, 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, 571, 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(600, 170, 47, 16));
@ -148,7 +153,7 @@ public:
mGetChaletLogButton->setGeometry(QRect(900, 210, 75, 23)); mGetChaletLogButton->setGeometry(QRect(900, 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, 320, 241, 16)); mChaletTemperatureLbl->setGeometry(QRect(190, 340, 241, 16));
mWiFiIPAddressEditBx = new QLineEdit(CChaletGui); mWiFiIPAddressEditBx = new QLineEdit(CChaletGui);
mWiFiIPAddressEditBx->setObjectName(QString::fromUtf8("mWiFiIPAddressEditBx")); mWiFiIPAddressEditBx->setObjectName(QString::fromUtf8("mWiFiIPAddressEditBx"));
mWiFiIPAddressEditBx->setGeometry(QRect(160, 430, 221, 20)); mWiFiIPAddressEditBx->setGeometry(QRect(160, 430, 221, 20));
@ -176,6 +181,22 @@ public:
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(80, 370, 321, 131));
mSolarPanelCurrentCnvLbl = new QLabel(CChaletGui);
mSolarPanelCurrentCnvLbl->setObjectName(QString::fromUtf8("mSolarPanelCurrentCnvLbl"));
mSolarPanelCurrentCnvLbl->setGeometry(QRect(190, 280, 201, 16));
mFirmwareVersionLabel = new QLabel(CChaletGui);
mFirmwareVersionLabel->setObjectName(QString::fromUtf8("mFirmwareVersionLabel"));
mFirmwareVersionLabel->setGeometry(QRect(180, 520, 231, 20));
mFirmwareVersionLabel->setFont(font2);
mGetFirmwareVersionBtn = new QPushButton(CChaletGui);
mGetFirmwareVersionBtn->setObjectName(QString::fromUtf8("mGetFirmwareVersionBtn"));
mGetFirmwareVersionBtn->setGeometry(QRect(90, 520, 75, 23));
mStartTerminalShellBtn = new QPushButton(CChaletGui);
mStartTerminalShellBtn->setObjectName(QString::fromUtf8("mStartTerminalShellBtn"));
mStartTerminalShellBtn->setGeometry(QRect(60, 590, 75, 23));
mStartSyslogShellBtn = new QPushButton(CChaletGui);
mStartSyslogShellBtn->setObjectName(QString::fromUtf8("mStartSyslogShellBtn"));
mStartSyslogShellBtn->setGeometry(QRect(150, 590, 75, 23));
groupBox_2->raise(); groupBox_2->raise();
groupBox->raise(); groupBox->raise();
MainPageLabel->raise(); MainPageLabel->raise();
@ -207,6 +228,11 @@ public:
label->raise(); label->raise();
mWiFiGatewayAddressEditBx->raise(); mWiFiGatewayAddressEditBx->raise();
label_2->raise(); label_2->raise();
mSolarPanelCurrentCnvLbl->raise();
mFirmwareVersionLabel->raise();
mGetFirmwareVersionBtn->raise();
mStartTerminalShellBtn->raise();
mStartSyslogShellBtn->raise();
retranslateUi(CChaletGui); retranslateUi(CChaletGui);
@ -231,7 +257,7 @@ public:
mDoHarakiriButton->setText(QCoreApplication::translate("CChaletGui", "DO HARAKIRI !!!", nullptr)); mDoHarakiriButton->setText(QCoreApplication::translate("CChaletGui", "DO HARAKIRI !!!", nullptr));
mBatteryVoltageLabel->setText(QCoreApplication::translate("CChaletGui", "Battery Voltage", nullptr)); mBatteryVoltageLabel->setText(QCoreApplication::translate("CChaletGui", "Battery Voltage", nullptr));
mChaletOnlineStatusLbl->setText(QCoreApplication::translate("CChaletGui", "OFFLINE", nullptr)); mChaletOnlineStatusLbl->setText(QCoreApplication::translate("CChaletGui", "OFFLINE", nullptr));
mSolarPanelCurrentLabel->setText(QCoreApplication::translate("CChaletGui", "Solar Panel Current: ", nullptr)); mSolarPanelCurrentLabel->setText(QCoreApplication::translate("CChaletGui", "Raw Solar Panel Current: ", nullptr));
mBatterySOCLabel->setText(QCoreApplication::translate("CChaletGui", "Battery SOC: ", nullptr)); mBatterySOCLabel->setText(QCoreApplication::translate("CChaletGui", "Battery SOC: ", nullptr));
mCurrentSensorStateLbl->setText(QCoreApplication::translate("CChaletGui", "Current Sensor:", nullptr)); mCurrentSensorStateLbl->setText(QCoreApplication::translate("CChaletGui", "Current Sensor:", nullptr));
mLostReqPercentLbl->setText(QCoreApplication::translate("CChaletGui", "Lost requests: ", nullptr)); mLostReqPercentLbl->setText(QCoreApplication::translate("CChaletGui", "Lost requests: ", nullptr));
@ -246,6 +272,11 @@ public:
mWiFiGatewayAddressEditBx->setText(QCoreApplication::translate("CChaletGui", "?", nullptr)); mWiFiGatewayAddressEditBx->setText(QCoreApplication::translate("CChaletGui", "?", nullptr));
label_2->setText(QCoreApplication::translate("CChaletGui", "Gatweway:", nullptr)); label_2->setText(QCoreApplication::translate("CChaletGui", "Gatweway:", nullptr));
groupBox_2->setTitle(QCoreApplication::translate("CChaletGui", "WiFi parameters (stored in flash)", nullptr)); groupBox_2->setTitle(QCoreApplication::translate("CChaletGui", "WiFi parameters (stored in flash)", nullptr));
mSolarPanelCurrentCnvLbl->setText(QCoreApplication::translate("CChaletGui", "Solar Panel Current (A):", nullptr));
mFirmwareVersionLabel->setText(QCoreApplication::translate("CChaletGui", "Firmware Version: ?", nullptr));
mGetFirmwareVersionBtn->setText(QCoreApplication::translate("CChaletGui", "GET", nullptr));
mStartTerminalShellBtn->setText(QCoreApplication::translate("CChaletGui", "Terminal", nullptr));
mStartSyslogShellBtn->setText(QCoreApplication::translate("CChaletGui", "Syslog", nullptr));
} // retranslateUi } // retranslateUi
}; };

78
ui_IspindelGUI.h Normal file
View File

@ -0,0 +1,78 @@
/********************************************************************************
** Form generated from reading UI file 'IspindelGUI.ui'
**
** Created by: Qt User Interface Compiler version 5.14.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_ISPINDELGUI_H
#define UI_ISPINDELGUI_H
#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QDialog>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QLabel>
#include <QtWidgets/QTableWidget>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_CIspindelGUI
{
public:
QLabel *label;
QWidget *mIspindelPlot;
QLabel *mLastFrameDataLbl;
QTableWidget *tableWidget;
void setupUi(QDialog *CIspindelGUI)
{
if (CIspindelGUI->objectName().isEmpty())
CIspindelGUI->setObjectName(QString::fromUtf8("CIspindelGUI"));
CIspindelGUI->resize(1123, 629);
label = new QLabel(CIspindelGUI);
label->setObjectName(QString::fromUtf8("label"));
label->setGeometry(QRect(510, 20, 91, 41));
QFont font;
font.setPointSize(12);
label->setFont(font);
mIspindelPlot = new QWidget(CIspindelGUI);
mIspindelPlot->setObjectName(QString::fromUtf8("mIspindelPlot"));
mIspindelPlot->setGeometry(QRect(520, 100, 661, 461));
mLastFrameDataLbl = new QLabel(CIspindelGUI);
mLastFrameDataLbl->setObjectName(QString::fromUtf8("mLastFrameDataLbl"));
mLastFrameDataLbl->setGeometry(QRect(60, 50, 381, 211));
QFont font1;
font1.setFamily(QString::fromUtf8("Tahoma"));
font1.setPointSize(11);
font1.setBold(true);
font1.setWeight(75);
mLastFrameDataLbl->setFont(font1);
mLastFrameDataLbl->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);
tableWidget = new QTableWidget(CIspindelGUI);
tableWidget->setObjectName(QString::fromUtf8("tableWidget"));
tableWidget->setGeometry(QRect(10, 290, 461, 331));
retranslateUi(CIspindelGUI);
QMetaObject::connectSlotsByName(CIspindelGUI);
} // setupUi
void retranslateUi(QDialog *CIspindelGUI)
{
CIspindelGUI->setWindowTitle(QCoreApplication::translate("CIspindelGUI", "Dialog", nullptr));
label->setText(QCoreApplication::translate("CIspindelGUI", "ISpindel", nullptr));
mLastFrameDataLbl->setText(QCoreApplication::translate("CIspindelGUI", "No data...", nullptr));
} // retranslateUi
};
namespace Ui {
class CIspindelGUI: public Ui_CIspindelGUI {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_ISPINDELGUI_H

View File

@ -137,7 +137,7 @@ public:
CPICUploaderGui->setWindowTitle(QCoreApplication::translate("CPICUploaderGui", "Dialog", nullptr)); CPICUploaderGui->setWindowTitle(QCoreApplication::translate("CPICUploaderGui", "Dialog", nullptr));
label->setText(QCoreApplication::translate("CPICUploaderGui", "Firmware Uploader", nullptr)); label->setText(QCoreApplication::translate("CPICUploaderGui", "Firmware Uploader", nullptr));
mHexFileSelectBtn->setText(QCoreApplication::translate("CPICUploaderGui", "Open Hex File", nullptr)); mHexFileSelectBtn->setText(QCoreApplication::translate("CPICUploaderGui", "Open Hex File", nullptr));
mIPAddressEdit->setText(QCoreApplication::translate("CPICUploaderGui", "192.168.50.126", nullptr)); mIPAddressEdit->setText(QCoreApplication::translate("CPICUploaderGui", "192.168.30.125", nullptr));
mOpenedHexFilePathLbl->setText(QCoreApplication::translate("CPICUploaderGui", "No File Opened", nullptr)); mOpenedHexFilePathLbl->setText(QCoreApplication::translate("CPICUploaderGui", "No File Opened", nullptr));
mHexFileStatsLbl->setText(QString()); mHexFileStatsLbl->setText(QString());
mConnectBtn->setText(QCoreApplication::translate("CPICUploaderGui", "Connect", nullptr)); mConnectBtn->setText(QCoreApplication::translate("CPICUploaderGui", "Connect", nullptr));