Affichage du MAC Address

Ajout de l'affichage du MAC Address dans la page des paramètres Modbus
This commit is contained in:
jfmartel 2018-06-19 08:08:55 -04:00
parent fcfa86a27b
commit 83ef8cbad9
4 changed files with 19 additions and 3 deletions

View File

@ -76,10 +76,10 @@ ENGLOG=3
#STATION=ANGRIGNON #STATION=ANGRIGNON
#STATION=HENRI_BOURASSA #STATION=HENRI_BOURASSA
#STATION=COTE_VERTU #STATION=COTE_VERTU
STATION=BERRI_UQAM #STATION=BERRI_UQAM
#STATION=LONGUEIL #STATION=LONGUEIL
#STATION=SAINT_MICHEL #STATION=SAINT_MICHEL
#STATION=SNOWDON_L5 STATION=SNOWDON_L5
#STATION=MONTMORENCY #STATION=MONTMORENCY
#STATION=MONTMORENCY_10_12 #STATION=MONTMORENCY_10_12
#STATION=MONTMORENCY_10_22 #STATION=MONTMORENCY_10_22

Binary file not shown.

View File

@ -36,8 +36,10 @@
#include <QFont> #include <QFont>
#include <QGraphicsProxyWidget> #include <QGraphicsProxyWidget>
#include <QMessageBox> #include <QMessageBox>
#include <QNetworkInterface>
//#include <sys/time.h> //#include <sys/time.h>
#include "ZTLog.h" #include "ZTLog.h"
#include <QDebug>
@ -133,6 +135,14 @@ CModbusSettingsPage::CModbusSettingsPage(QGraphicsWidget *Parent)
Proxy->setPos(100,100); Proxy->setPos(100,100);
connect(mUseModbusChkBox,SIGNAL(stateChanged(int)),this,SLOT(CheckBoxStatedChanged(int))); connect(mUseModbusChkBox,SIGNAL(stateChanged(int)),this,SLOT(CheckBoxStatedChanged(int)));
IpSettingsPosx = 100, IpSettingsPosy = 250;
mMACAddress = new QGraphicsTextItem("Adresse MAC: xx:xx:xx:xx",this);
mMACAddress->setFont(font);
mMACAddress->setPos(IpSettingsPosx,IpSettingsPosy);
IpSettingsPosx = 100; IpSettingsPosx = 100;
IpSettingsPosy += 50; IpSettingsPosy += 50;
font.setPointSize(14); font.setPointSize(14);
@ -222,6 +232,12 @@ int CModbusSettingsPage::SetActualSettings(bool UseModbus, QHostAddress CCHostAd
mIPChunk1->setValue(add & 0x000000FF); mIPChunk1->setValue(add & 0x000000FF);
mApplyButton->hide(); mApplyButton->hide();
QNetworkInterface IfInfo = QNetworkInterface::interfaceFromName("eth0");
QString MacAddress = IfInfo.hardwareAddress();
mMACAddress->setPlainText(MacAddress.prepend("Adresse MAC: " ));
return RET_OK; return RET_OK;
} }

View File

@ -66,7 +66,7 @@ private:
QSpinBox *mIPChunk1, *mIPChunk2, *mIPChunk3, *mIPChunk4; QSpinBox *mIPChunk1, *mIPChunk2, *mIPChunk3, *mIPChunk4;
QString mCurIP; QString mCurIP;
QCheckBox *mUseModbusChkBox; QCheckBox *mUseModbusChkBox;
QGraphicsTextItem *mModbusCCConnectionState, *mModbusCCLinkState; QGraphicsTextItem *mMACAddress, *mModbusCCConnectionState, *mModbusCCLinkState;
QGraphicsPixmapItem *mCCConnectionLED, *mCCModbusLinkLED; QGraphicsPixmapItem *mCCConnectionLED, *mCCModbusLinkLED;
void ShowApplyButton(); void ShowApplyButton();