Affichage du MAC Address
Ajout de l'affichage du MAC Address dans la page des paramètres Modbus
This commit is contained in:
@@ -36,8 +36,10 @@
|
||||
#include <QFont>
|
||||
#include <QGraphicsProxyWidget>
|
||||
#include <QMessageBox>
|
||||
#include <QNetworkInterface>
|
||||
//#include <sys/time.h>
|
||||
#include "ZTLog.h"
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
|
||||
@@ -133,6 +135,14 @@ CModbusSettingsPage::CModbusSettingsPage(QGraphicsWidget *Parent)
|
||||
Proxy->setPos(100,100);
|
||||
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;
|
||||
IpSettingsPosy += 50;
|
||||
font.setPointSize(14);
|
||||
@@ -222,6 +232,12 @@ int CModbusSettingsPage::SetActualSettings(bool UseModbus, QHostAddress CCHostAd
|
||||
mIPChunk1->setValue(add & 0x000000FF);
|
||||
|
||||
mApplyButton->hide();
|
||||
|
||||
QNetworkInterface IfInfo = QNetworkInterface::interfaceFromName("eth0");
|
||||
QString MacAddress = IfInfo.hardwareAddress();
|
||||
|
||||
mMACAddress->setPlainText(MacAddress.prepend("Adresse MAC: " ));
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
QSpinBox *mIPChunk1, *mIPChunk2, *mIPChunk3, *mIPChunk4;
|
||||
QString mCurIP;
|
||||
QCheckBox *mUseModbusChkBox;
|
||||
QGraphicsTextItem *mModbusCCConnectionState, *mModbusCCLinkState;
|
||||
QGraphicsTextItem *mMACAddress, *mModbusCCConnectionState, *mModbusCCLinkState;
|
||||
QGraphicsPixmapItem *mCCConnectionLED, *mCCModbusLinkLED;
|
||||
|
||||
void ShowApplyButton();
|
||||
|
||||
Reference in New Issue
Block a user