LAN Devices presence
This commit is contained in:
@@ -53,7 +53,7 @@ CLoggingSettingsPage::CLoggingSettingsPage(QWidget *parent) :
|
||||
ui->mDevicePresenceAdd5LineEdit->setText("192.168.10.555");
|
||||
|
||||
QStringList BitsList;
|
||||
for(int i = 31; i < 64; i++)
|
||||
for(int i = 32; i < 64; i++)
|
||||
{
|
||||
//BitsList.append(QString("%1").arg(i));
|
||||
|
||||
@@ -260,6 +260,100 @@ int CLoggingSettingsPage::UpdateCPUWatchdogParams()
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CLoggingSettingsPage::SetLANDevicesPresenceStatus(QList<bool> LANDevicesPresenceList)
|
||||
{
|
||||
if(LANDevicesPresenceList.size() != MAX_NB_LAN_DEVICE_DETECTION)
|
||||
{
|
||||
return RET_GENERAL_ERROR;
|
||||
}
|
||||
|
||||
if(ui->mDevicePresenceActive1ChkBx->isChecked())
|
||||
{
|
||||
if(LANDevicesPresenceList.at(0) == true)
|
||||
ui->mLANDevice1PresStatusLbl->setText("ONLINE");
|
||||
else
|
||||
ui->mLANDevice1PresStatusLbl->setText("OFFLINE");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->mLANDevice1PresStatusLbl->setText("N/A");
|
||||
}
|
||||
|
||||
if(ui->mDevicePresenceActive2ChkBx->isChecked())
|
||||
{
|
||||
if(LANDevicesPresenceList.at(1) == true)
|
||||
ui->mLANDevice2PresStatusLbl->setText("ONLINE");
|
||||
else
|
||||
ui->mLANDevice2PresStatusLbl->setText("OFFLINE");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->mLANDevice2PresStatusLbl->setText("N/A");
|
||||
}
|
||||
|
||||
if(ui->mDevicePresenceActive3ChkBx->isChecked())
|
||||
{
|
||||
if(LANDevicesPresenceList.at(2) == true)
|
||||
ui->mLANDevice3PresStatusLbl->setText("ONLINE");
|
||||
else
|
||||
ui->mLANDevice3PresStatusLbl->setText("OFFLINE");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->mLANDevice3PresStatusLbl->setText("N/A");
|
||||
}
|
||||
|
||||
if(ui->mDevicePresenceActive4ChkBx->isChecked())
|
||||
{
|
||||
if(LANDevicesPresenceList.at(3) == true)
|
||||
ui->mLANDevice4PresStatusLbl->setText("ONLINE");
|
||||
else
|
||||
ui->mLANDevice4PresStatusLbl->setText("OFFLINE");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->mLANDevice4PresStatusLbl->setText("N/A");
|
||||
}
|
||||
if(ui->mDevicePresenceActive5ChkBx->isChecked())
|
||||
{
|
||||
if(LANDevicesPresenceList.at(4) == true)
|
||||
ui->mLANDevice5PresStatusLbl->setText("ONLINE");
|
||||
else
|
||||
ui->mLANDevice5PresStatusLbl->setText("OFFLINE");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->mLANDevice5PresStatusLbl->setText("N/A");
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
void CLoggingSettingsPage::SetInternetPresenceStatus(bool IsPresent)
|
||||
{
|
||||
if(IsPresent == true)
|
||||
{
|
||||
ui->mInternetPresenceStatusLbl->setText("ONLINE");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->mInternetPresenceStatusLbl->setText("OFFLINE");
|
||||
}
|
||||
}
|
||||
|
||||
int CLoggingSettingsPage::SetMQTTPresenceStatus(bool IsPresent)
|
||||
{
|
||||
if(IsPresent)
|
||||
{
|
||||
ui->mMQTTPresenceStatusLbl->setText("ONLINE");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->mMQTTPresenceStatusLbl->setText("OFFLINE");
|
||||
}
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
void CLoggingSettingsPage::VerbosityParamsChanged(int value)
|
||||
{
|
||||
Q_UNUSED(value)
|
||||
|
||||
@@ -25,6 +25,8 @@ public:
|
||||
int SetGeneralSettingsParams(const CGeneralSystemParams *GeneralParams);
|
||||
int SetCPUWatchdogSettings(const CCPUWatchdogConfig *CPUWatchdogParams);
|
||||
int SetDeviceConfigSettings(const CDeviceDetectionConfig *DevDetectCfgParams);
|
||||
int SetMQTTPresenceStatus(bool);
|
||||
int SetLANDevicesPresenceStatus(QList<bool> LANDevicesPresenceList);
|
||||
|
||||
|
||||
|
||||
@@ -60,6 +62,9 @@ public slots:
|
||||
void DevicePresenceEnableChkBxChanged(int state);
|
||||
void DevicePresenceModifyParamsBtnPressed();
|
||||
void DevicePresenceCancelBtnPressed();
|
||||
void SetInternetPresenceStatus(bool);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -508,19 +508,19 @@
|
||||
<rect>
|
||||
<x>1020</x>
|
||||
<y>80</y>
|
||||
<width>341</width>
|
||||
<width>421</width>
|
||||
<height>311</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Assignations des flags à un signal CAN</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="mInternetPresenceLbl_3">
|
||||
<widget class="QLabel" name="mBITLbl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>280</x>
|
||||
<x>190</x>
|
||||
<y>70</y>
|
||||
<width>41</width>
|
||||
<width>51</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -530,7 +530,7 @@
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>BIT</string>
|
||||
<string>BIT CAN</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mWatchdogMsgIDLbl">
|
||||
@@ -576,7 +576,7 @@
|
||||
<widget class="QLabel" name="mInternetPresenceLbl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<x>40</x>
|
||||
<y>100</y>
|
||||
<width>131</width>
|
||||
<height>16</height>
|
||||
@@ -618,7 +618,7 @@
|
||||
<widget class="QComboBox" name="mInternetPresBitComboBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<x>180</x>
|
||||
<y>100</y>
|
||||
<width>65</width>
|
||||
<height>22</height>
|
||||
@@ -628,10 +628,10 @@
|
||||
<number>63</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mMQTTPresenceLbl_4">
|
||||
<widget class="QLabel" name="mMQTTPresenceLbl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<x>30</x>
|
||||
<y>130</y>
|
||||
<width>141</width>
|
||||
<height>16</height>
|
||||
@@ -652,7 +652,7 @@
|
||||
<widget class="QComboBox" name="mMQTTPresenceBitComboBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<x>180</x>
|
||||
<y>130</y>
|
||||
<width>65</width>
|
||||
<height>22</height>
|
||||
@@ -686,7 +686,7 @@
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>160</y>
|
||||
<width>171</width>
|
||||
<width>101</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -694,7 +694,7 @@
|
||||
<widget class="QComboBox" name="mDevicePresenceBit1ComboBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<x>180</x>
|
||||
<y>160</y>
|
||||
<width>65</width>
|
||||
<height>22</height>
|
||||
@@ -719,7 +719,7 @@
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>190</y>
|
||||
<width>171</width>
|
||||
<width>101</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -727,7 +727,7 @@
|
||||
<widget class="QComboBox" name="mDevicePresenceBit2ComboBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<x>180</x>
|
||||
<y>190</y>
|
||||
<width>65</width>
|
||||
<height>22</height>
|
||||
@@ -739,7 +739,7 @@
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>220</y>
|
||||
<width>171</width>
|
||||
<width>101</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -747,7 +747,7 @@
|
||||
<widget class="QComboBox" name="mDevicePresenceBit3ComboBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<x>180</x>
|
||||
<y>220</y>
|
||||
<width>65</width>
|
||||
<height>22</height>
|
||||
@@ -783,7 +783,7 @@
|
||||
<widget class="QComboBox" name="mDevicePresenceBit4ComboBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<x>180</x>
|
||||
<y>250</y>
|
||||
<width>65</width>
|
||||
<height>22</height>
|
||||
@@ -795,7 +795,7 @@
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>250</y>
|
||||
<width>171</width>
|
||||
<width>101</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -818,7 +818,7 @@
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>280</y>
|
||||
<width>171</width>
|
||||
<width>101</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -826,7 +826,7 @@
|
||||
<widget class="QComboBox" name="mDevicePresenceBit5ComboBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<x>180</x>
|
||||
<y>280</y>
|
||||
<width>65</width>
|
||||
<height>22</height>
|
||||
@@ -836,10 +836,10 @@
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>60</y>
|
||||
<width>241</width>
|
||||
<height>31</height>
|
||||
<x>290</x>
|
||||
<y>20</y>
|
||||
<width>121</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
@@ -847,9 +847,104 @@
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Les bits 0 à 30 sont utilisés pour
|
||||
la date et l'heure</string>
|
||||
<string>Les bits 0 à 31 sont
|
||||
utilisés pour la date
|
||||
et l'heure</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mLANDevice1PresStatusLbl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>160</y>
|
||||
<width>47</width>
|
||||
<height>14</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OFFLINE</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mLANDevice2PresStatusLbl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>190</y>
|
||||
<width>47</width>
|
||||
<height>14</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OFFLINE</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mLANDevice3PresStatusLbl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>220</y>
|
||||
<width>47</width>
|
||||
<height>14</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OFFLINE</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mLANDevice4PresStatusLbl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>250</y>
|
||||
<width>47</width>
|
||||
<height>14</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OFFLINE</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mLANDevice5PresStatusLbl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>280</y>
|
||||
<width>47</width>
|
||||
<height>14</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OFFLINE</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mMQTTPresenceStatusLbl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>130</y>
|
||||
<width>47</width>
|
||||
<height>14</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OFFLINE</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mInternetPresenceStatusLbl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>100</y>
|
||||
<width>47</width>
|
||||
<height>14</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OFFLINE</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
Reference in New Issue
Block a user