CAN Config fonctionnel.
This commit is contained in:
parent
d183780f1b
commit
251825f7d5
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -43,7 +43,8 @@ SOURCES += Sources/main.cpp \
|
|||||||
Sources/CANDatabase/CANDatabase.cpp \
|
Sources/CANDatabase/CANDatabase.cpp \
|
||||||
Sources/CANDevice.cpp \
|
Sources/CANDevice.cpp \
|
||||||
Sources/CANSignal.cpp \
|
Sources/CANSignal.cpp \
|
||||||
Sources/SystemConfig.cpp
|
Sources/SystemConfig.cpp \
|
||||||
|
Sources/CANDeviceConfig.cpp
|
||||||
|
|
||||||
HEADERS += Sources/MainWindow.h \
|
HEADERS += Sources/MainWindow.h \
|
||||||
Sources/PCANInterface.h \
|
Sources/PCANInterface.h \
|
||||||
@ -60,7 +61,8 @@ HEADERS += Sources/MainWindow.h \
|
|||||||
Sources/CANDatabase/CANDatabase.h \
|
Sources/CANDatabase/CANDatabase.h \
|
||||||
Sources/CANDevice.h \
|
Sources/CANDevice.h \
|
||||||
Sources/CANSignal.h \
|
Sources/CANSignal.h \
|
||||||
Sources/SystemConfig.h
|
Sources/SystemConfig.h \
|
||||||
|
Sources/CANDeviceConfig.h
|
||||||
|
|
||||||
FORMS += Sources/Gui/MainWindow.ui \
|
FORMS += Sources/Gui/MainWindow.ui \
|
||||||
Sources/Gui/GeneralStatusPage.ui \
|
Sources/Gui/GeneralStatusPage.ui \
|
||||||
|
|||||||
@ -1,32 +1,39 @@
|
|||||||
#include "CANDevice.h"
|
#include "CANDevice.h"
|
||||||
#include "OtarcikCan.h"
|
#include "OtarcikCan.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CCANDevice::CCANDevice(QObject *parent)
|
CCANDevice::CCANDevice(QObject *parent)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(parent)
|
||||||
|
|
||||||
mMessageList.clear();
|
mMessageList.clear();
|
||||||
mMessagesListLoaded = false;
|
mMessagesListLoaded = false;
|
||||||
mCANAnalyzer.mDevicePtr = this;
|
mCANAnalyzer.mDevicePtr = this;
|
||||||
mProgramPtr = 0;
|
mProgramPtr = 0;
|
||||||
mCANDeviceDatabaseFilename.clear();
|
// mCANDeviceDatabaseFilename.clear();
|
||||||
mCANDeviceID = -1;
|
// mCANDeviceID = -1;
|
||||||
mCANDeviceBaudrate = -1;
|
// mCANDeviceBaudrate = -1;
|
||||||
mDeviceDescription.clear();
|
// mDeviceDescription.clear();
|
||||||
mDeviceName.clear();
|
// mDeviceName.clear();
|
||||||
mDevicePollPeriod = 0;
|
// mDevicePollPeriod = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CCANDevice::CCANDevice(CCANDevice &Other)
|
CCANDevice::CCANDevice(CCANDeviceConfig &SysConfig)
|
||||||
{
|
{
|
||||||
mMessageList.clear();
|
mMessageList.clear();
|
||||||
mMessagesListLoaded = false;
|
mMessagesListLoaded = false;
|
||||||
mCANAnalyzer.mDevicePtr = this;
|
mCANAnalyzer.mDevicePtr = this;
|
||||||
mProgramPtr = 0;
|
mProgramPtr = 0;
|
||||||
|
|
||||||
mCANDeviceID = Other.mCANDeviceID;
|
mDeviceConfigInfo = SysConfig;
|
||||||
mCANDeviceBaudrate = Other.mCANDeviceBaudrate;
|
|
||||||
mCANDeviceDatabaseFilename = Other.mCANDeviceDatabaseFilename;
|
// mCANDeviceID = SysConfig.mCANDeviceID;
|
||||||
mDeviceName = Other.mDeviceName;
|
// mCANDeviceBaudrate = SysConfig.mCANDeviceBaudrate;
|
||||||
mDeviceDescription = Other.mDeviceDescription;
|
// mCANDeviceDatabaseFilename = SysConfig.mCANDeviceDatabaseFilename;
|
||||||
|
// mDeviceName = SysConfig.mDeviceName;
|
||||||
|
// mDeviceDescription = SysConfig.mDeviceDescription;
|
||||||
|
// mDevicePollPeriod = SysConfig.mDevicePollPeriod;
|
||||||
}
|
}
|
||||||
|
|
||||||
CCANDevice::~CCANDevice()
|
CCANDevice::~CCANDevice()
|
||||||
@ -39,15 +46,15 @@ CCANDevice::~CCANDevice()
|
|||||||
|
|
||||||
int CCANDevice::Init()
|
int CCANDevice::Init()
|
||||||
{
|
{
|
||||||
if(mCANDeviceID < 0 || mCANDeviceBaudrate < 0 || mDevicePollPeriod == 0 || mCANDeviceDatabaseFilename.isEmpty() || mDeviceName.isEmpty())
|
if(mDeviceConfigInfo.mCANDeviceID < 0 || mDeviceConfigInfo.mCANDeviceBaudrate < 0 || mDeviceConfigInfo.mDevicePollPeriod == 0 || mDeviceConfigInfo.mCANDeviceDatabaseFilename.isEmpty() || mDeviceConfigInfo.mDeviceName.isEmpty())
|
||||||
{
|
{
|
||||||
qDebug("CCANDevice: trying to initialize a CCANDevice with invalid parameters");
|
qDebug("CCANDevice: trying to initialize a CCANDevice with invalid parameters");
|
||||||
return RET_GENERAL_ERROR;
|
return RET_GENERAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(QString("Initialisation du dispositif [%1]").arg(mDeviceName));
|
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(QString("Initialisation du dispositif [%1]").arg(mDeviceConfigInfo.mDeviceName));
|
||||||
|
|
||||||
if(mCANDatabase.Init(mCANDeviceDatabaseFilename) == RET_OK)
|
if(mCANDatabase.Init(mDeviceConfigInfo.mCANDeviceDatabaseFilename) == RET_OK)
|
||||||
{
|
{
|
||||||
if(mCANDatabase.BuildMessageList(&mMessageList) == RET_OK)
|
if(mCANDatabase.BuildMessageList(&mMessageList) == RET_OK)
|
||||||
{
|
{
|
||||||
@ -59,24 +66,24 @@ int CCANDevice::Init()
|
|||||||
mMessagesListLoaded = false;
|
mMessagesListLoaded = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(mCANAnalyzer.Init(mCANDeviceID,mCANDeviceBaudrate,&mMessageList,mDevicePollPeriod) != RET_OK)
|
if(mCANAnalyzer.Init(mDeviceConfigInfo.mCANDeviceID,mDeviceConfigInfo.mCANDeviceBaudrate,&mMessageList,mDeviceConfigInfo.mDevicePollPeriod) != RET_OK)
|
||||||
{
|
{
|
||||||
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(QString("Le dispositif [%1] n'a pas pu s'initialiser").arg(mDeviceName),true,CGeneralMessagesLogDispatcher::GEN_MSG_TXT_ERROR_STATUS);
|
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(QString("Le dispositif [%1] n'a pas pu s'initialiser").arg(mDeviceConfigInfo.mDeviceName),true,CGeneralMessagesLogDispatcher::GEN_MSG_TXT_ERROR_STATUS);
|
||||||
return RET_GENERAL_ERROR;
|
return RET_GENERAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(QString("Dispositif [%1] initialisé avec succès!").arg(mDeviceName),true,CGeneralMessagesLogDispatcher::GEN_MSG_TXT_SUCCESS_STATUS);
|
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(QString("Dispositif [%1] initialisé avec succès!").arg(mDeviceConfigInfo.mDeviceName),true,CGeneralMessagesLogDispatcher::GEN_MSG_TXT_SUCCESS_STATUS);
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CCANDevice::Init(QString DatabaseFileName, TPCANHandle CANDeviceID, TPCANBaudrate CANDeviceBaudRate, QString DevDescription, QString DeviceName, unsigned int DevicePollPeriod)
|
int CCANDevice::Init(QString DatabaseFileName, TPCANHandle CANDeviceID, TPCANBaudrate CANDeviceBaudRate, QString DevDescription, QString DeviceName, unsigned int DevicePollPeriod)
|
||||||
{
|
{
|
||||||
mCANDeviceID = CANDeviceID;
|
mDeviceConfigInfo.mCANDeviceID = CANDeviceID;
|
||||||
mCANDeviceBaudrate = CANDeviceBaudRate;
|
mDeviceConfigInfo.mCANDeviceBaudrate = CANDeviceBaudRate;
|
||||||
mCANDeviceDatabaseFilename = DatabaseFileName;
|
mDeviceConfigInfo.mCANDeviceDatabaseFilename = DatabaseFileName;
|
||||||
mDeviceDescription = DevDescription;
|
mDeviceConfigInfo.mDeviceDescription = DevDescription;
|
||||||
mDeviceName = DeviceName;
|
mDeviceConfigInfo.mDeviceName = DeviceName;
|
||||||
mDevicePollPeriod = DevicePollPeriod;
|
mDeviceConfigInfo.mDevicePollPeriod = DevicePollPeriod;
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
|
|
||||||
@ -85,7 +92,7 @@ int CCANDevice::Init(QString DatabaseFileName, TPCANHandle CANDeviceID, TPCANBau
|
|||||||
|
|
||||||
int CCANDevice::NewMessageParsed()
|
int CCANDevice::NewMessageParsed()
|
||||||
{
|
{
|
||||||
mProgramPtr->UpdateCANViewerDataRequest(&mMessageList);
|
return mProgramPtr->UpdateCANViewerDataRequest(&mMessageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -94,41 +101,25 @@ int CCANDevice::NewMessageParsed()
|
|||||||
|
|
||||||
QDataStream &operator<<(QDataStream &out, const CCANDevice &source)
|
QDataStream &operator<<(QDataStream &out, const CCANDevice &source)
|
||||||
{
|
{
|
||||||
out << source.mCANDeviceID
|
out << source.mDeviceConfigInfo;
|
||||||
<< source.mCANDeviceBaudrate
|
|
||||||
<< source.mCANDeviceDatabaseFilename
|
|
||||||
<< source.mDeviceDescription
|
|
||||||
<< source.mDeviceName
|
|
||||||
<< source.mDevicePollPeriod;
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDataStream &operator>>(QDataStream &in, CCANDevice &dest)
|
QDataStream &operator>>(QDataStream &in, CCANDevice &dest)
|
||||||
{
|
{
|
||||||
in >> dest.mCANDeviceID
|
in >> dest.mDeviceConfigInfo;
|
||||||
>> dest.mCANDeviceBaudrate
|
|
||||||
>> dest.mCANDeviceDatabaseFilename
|
|
||||||
>> dest.mDeviceDescription
|
|
||||||
>> dest.mDeviceName
|
|
||||||
>> dest.mDevicePollPeriod;
|
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
//CAREFUL!!! OPERATOR = DOES NOT COPY THE MESSAGES, ONLY THE DEVICE DESCRIPTION !!//
|
////CAREFUL!!! OPERATOR = DOES NOT COPY THE MESSAGES, ONLY THE DEVICE DESCRIPTION !!//
|
||||||
CCANDevice& CCANDevice::operator=(const CCANDevice *source)
|
//CCANDevice& CCANDevice::operator=(const CCANDevice *source)
|
||||||
{
|
//{
|
||||||
if(source == this)
|
// if(source == this)
|
||||||
{
|
// {
|
||||||
return *this;
|
// return *this;
|
||||||
}
|
// }
|
||||||
|
|
||||||
this->mCANDeviceID = source->mCANDeviceID;
|
// this->mDeviceConfigInfo = source->mDeviceConfigInfo;
|
||||||
this->mCANDeviceBaudrate = source->mCANDeviceBaudrate;
|
|
||||||
this->mCANDeviceDatabaseFilename = source->mCANDeviceDatabaseFilename;
|
|
||||||
this->mDeviceDescription = source->mDeviceDescription;
|
|
||||||
this->mDeviceName = source->mDeviceName;
|
|
||||||
this->mDevicePollPeriod = source->mDevicePollPeriod;
|
|
||||||
|
|
||||||
return *this;
|
// return *this;
|
||||||
}
|
//}
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
#include "CANDatabase.h"
|
#include "CANDatabase.h"
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include "PCANBasic.h"
|
#include "PCANBasic.h"
|
||||||
|
#include "CANDeviceConfig.h"
|
||||||
|
|
||||||
class COtarcikCan;
|
class COtarcikCan;
|
||||||
|
|
||||||
@ -17,28 +18,23 @@ class CCANDevice : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit CCANDevice(QObject *parent = 0);
|
explicit CCANDevice(QObject *parent = 0);
|
||||||
CCANDevice(CCANDevice &Other);
|
CCANDevice(CCANDeviceConfig &SysConfig);
|
||||||
~CCANDevice();
|
~CCANDevice();
|
||||||
|
|
||||||
int Init(QString DatabaseFileName, TPCANHandle CANDeviceID, TPCANBaudrate CANDeviceBaudRate, QString DevDescription, QString DeviceName, unsigned int DevicePollPeriod);
|
int Init(QString DatabaseFileName, TPCANHandle CANDeviceID, TPCANBaudrate CANDeviceBaudRate, QString DevDescription, QString DeviceName, unsigned int DevicePollPeriod);
|
||||||
int Init();
|
int Init();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TPCANHandle mCANDeviceID;
|
CCANDeviceConfig mDeviceConfigInfo;
|
||||||
TPCANBaudrate mCANDeviceBaudrate;
|
|
||||||
QString mCANDeviceDatabaseFilename;
|
|
||||||
QString mDeviceDescription;
|
|
||||||
QString mDeviceName;
|
|
||||||
COtarcikCan *mProgramPtr;
|
|
||||||
unsigned int mDevicePollPeriod;
|
|
||||||
|
|
||||||
|
COtarcikCan *mProgramPtr;
|
||||||
bool mMessagesListLoaded;
|
bool mMessagesListLoaded;
|
||||||
CCANAnalyzer mCANAnalyzer; //The module that handles the USB puck and decodes the data
|
CCANAnalyzer mCANAnalyzer; //The module that handles the USB puck and decodes the data
|
||||||
CCANDatabase mCANDatabase; //The device's database loaded from dbc file
|
CCANDatabase mCANDatabase; //The device's database loaded from dbc file
|
||||||
|
|
||||||
QList<CCANMessage*> mMessageList;
|
QList<CCANMessage*> mMessageList;
|
||||||
|
|
||||||
CCANDevice &operator=(const CCANDevice *source);
|
// CCANDevice &operator=(const CCANDevice *source);
|
||||||
|
|
||||||
int NewMessageParsed();
|
int NewMessageParsed();
|
||||||
|
|
||||||
|
|||||||
54
Otarcik_CAN/Sources/CANDeviceConfig.cpp
Normal file
54
Otarcik_CAN/Sources/CANDeviceConfig.cpp
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
#include "CANDeviceConfig.h"
|
||||||
|
|
||||||
|
CCANDeviceConfig::CCANDeviceConfig()
|
||||||
|
{
|
||||||
|
//Assign default values
|
||||||
|
mCANDeviceID = PCAN_USBBUS1;
|
||||||
|
mCANDeviceBaudrate = PCAN_BAUD_500K;
|
||||||
|
mCANDeviceDatabaseFilename = "./";
|
||||||
|
mDeviceDescription = "Description du module";
|
||||||
|
mDeviceName = "Nom du module";
|
||||||
|
mDevicePollPeriod = 200;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QDataStream &operator>>(QDataStream &in, CCANDeviceConfig &dest)
|
||||||
|
{
|
||||||
|
in >> dest.mCANDeviceID
|
||||||
|
>> dest.mCANDeviceBaudrate
|
||||||
|
>> dest.mCANDeviceDatabaseFilename
|
||||||
|
>> dest.mDeviceDescription
|
||||||
|
>> dest.mDeviceName
|
||||||
|
>> dest.mDevicePollPeriod;
|
||||||
|
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
QDataStream &operator<<(QDataStream &out, const CCANDeviceConfig &source)
|
||||||
|
{
|
||||||
|
out << source.mCANDeviceID
|
||||||
|
<< source.mCANDeviceBaudrate
|
||||||
|
<< source.mCANDeviceDatabaseFilename
|
||||||
|
<< source.mDeviceDescription
|
||||||
|
<< source.mDeviceName
|
||||||
|
<< source.mDevicePollPeriod;
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
CCANDeviceConfig& CCANDeviceConfig::operator=(const CCANDeviceConfig *source)
|
||||||
|
{
|
||||||
|
if(source == this)
|
||||||
|
{
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
this->mCANDeviceID = source->mCANDeviceID;
|
||||||
|
this->mCANDeviceBaudrate = source->mCANDeviceBaudrate;
|
||||||
|
this->mCANDeviceDatabaseFilename = source->mCANDeviceDatabaseFilename;
|
||||||
|
this->mDeviceDescription = source->mDeviceDescription;
|
||||||
|
this->mDeviceName = source->mDeviceName;
|
||||||
|
this->mDevicePollPeriod = source->mDevicePollPeriod;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
27
Otarcik_CAN/Sources/CANDeviceConfig.h
Normal file
27
Otarcik_CAN/Sources/CANDeviceConfig.h
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#ifndef CANDEVICECONFIG_H
|
||||||
|
#define CANDEVICECONFIG_H
|
||||||
|
#include "PCANBasic.h"
|
||||||
|
#include <QDataStream>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
|
class CCANDeviceConfig
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CCANDeviceConfig();
|
||||||
|
|
||||||
|
TPCANHandle mCANDeviceID;
|
||||||
|
TPCANBaudrate mCANDeviceBaudrate;
|
||||||
|
QString mCANDeviceDatabaseFilename;
|
||||||
|
QString mDeviceDescription;
|
||||||
|
QString mDeviceName;
|
||||||
|
unsigned int mDevicePollPeriod;
|
||||||
|
|
||||||
|
CCANDeviceConfig &operator=(const CCANDeviceConfig *source);
|
||||||
|
};
|
||||||
|
|
||||||
|
QDataStream &operator<<(QDataStream &out, const CCANDeviceConfig &source);
|
||||||
|
QDataStream &operator>>(QDataStream &in, CCANDeviceConfig &dest);
|
||||||
|
|
||||||
|
#endif // CANDEVICECONFIG_H
|
||||||
|
|
||||||
@ -1,6 +1,7 @@
|
|||||||
#include "GeneralStatusPage.h"
|
#include "GeneralStatusPage.h"
|
||||||
#include "ui_GeneralStatusPage.h"
|
#include "ui_GeneralStatusPage.h"
|
||||||
#include "QStringList"
|
#include "QStringList"
|
||||||
|
#include <QScrollBar>
|
||||||
|
|
||||||
CGeneralStatusPage::CGeneralStatusPage(QWidget *parent) :
|
CGeneralStatusPage::CGeneralStatusPage(QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
@ -8,6 +9,7 @@ CGeneralStatusPage::CGeneralStatusPage(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
connect(ui->mClearGenMsgTxtBtn,&QPushButton::clicked,this,&CGeneralStatusPage::ClearGenMsgAreaBtnPressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGeneralStatusPage::~CGeneralStatusPage()
|
CGeneralStatusPage::~CGeneralStatusPage()
|
||||||
@ -43,6 +45,10 @@ int CGeneralStatusPage::AddGeneralMsgBoxLineEntry(QString LineTxt)
|
|||||||
AddColoredLineToGenMsgBox(LineTxt);
|
AddColoredLineToGenMsgBox(LineTxt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui->mGenMsgTextEdit->verticalScrollBar()->setValue(ui->mGenMsgTextEdit->verticalScrollBar()->maximum());
|
||||||
|
|
||||||
|
|
||||||
|
return RET_OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,3 +88,9 @@ int CGeneralStatusPage::AddColoredLineToGenMsgBox(QString Line)
|
|||||||
return RET_OK;
|
return RET_OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGeneralStatusPage::ClearGenMsgAreaBtnPressed()
|
||||||
|
{
|
||||||
|
mGenMsgListBoxTextLines.clear();
|
||||||
|
ui->mGenMsgTextEdit->clear();
|
||||||
|
}
|
||||||
|
|||||||
@ -38,6 +38,9 @@ private:
|
|||||||
|
|
||||||
int AddColoredLineToGenMsgBox(QString Line);
|
int AddColoredLineToGenMsgBox(QString Line);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void ClearGenMsgAreaBtnPressed();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GENERALSTATUSPAGE_H
|
#endif // GENERALSTATUSPAGE_H
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1456</width>
|
<width>1456</width>
|
||||||
<height>492</height>
|
<height>527</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -16,9 +16,9 @@
|
|||||||
<widget class="QTextEdit" name="mGenMsgTextEdit">
|
<widget class="QTextEdit" name="mGenMsgTextEdit">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>460</x>
|
<x>30</x>
|
||||||
<y>30</y>
|
<y>20</y>
|
||||||
<width>651</width>
|
<width>1141</width>
|
||||||
<height>451</height>
|
<height>451</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -34,6 +34,19 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QPushButton" name="mClearGenMsgTxtBtn">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>30</x>
|
||||||
|
<y>480</y>
|
||||||
|
<width>80</width>
|
||||||
|
<height>22</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Nettoyer</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
@ -2,9 +2,10 @@
|
|||||||
#include "ui_ProgramSettingsPage.h"
|
#include "ui_ProgramSettingsPage.h"
|
||||||
|
|
||||||
#include "CANDevice.h"
|
#include "CANDevice.h"
|
||||||
#include "OtarcikCan.h"
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include "SystemConfig.h"
|
||||||
|
#include "OtarcikCan.h"
|
||||||
|
|
||||||
|
|
||||||
CProgramSettingsPage::CProgramSettingsPage(QWidget *parent) :
|
CProgramSettingsPage::CProgramSettingsPage(QWidget *parent) :
|
||||||
@ -15,6 +16,7 @@ CProgramSettingsPage::CProgramSettingsPage(QWidget *parent) :
|
|||||||
|
|
||||||
mProgramPtr = 0;
|
mProgramPtr = 0;
|
||||||
mDevicesList = 0;
|
mDevicesList = 0;
|
||||||
|
mCurModifiedDevConfig = 0;
|
||||||
mDeviceChangeModeEnabled = false;
|
mDeviceChangeModeEnabled = false;
|
||||||
|
|
||||||
ui->mDBSignalDetailsTable->setColumnCount(10);
|
ui->mDBSignalDetailsTable->setColumnCount(10);
|
||||||
@ -72,6 +74,8 @@ CProgramSettingsPage::CProgramSettingsPage(QWidget *parent) :
|
|||||||
connect(ui->mModifyDevParamsBtn,&QPushButton::clicked,this,&CProgramSettingsPage::ModifyDeviceBtnPressed);
|
connect(ui->mModifyDevParamsBtn,&QPushButton::clicked,this,&CProgramSettingsPage::ModifyDeviceBtnPressed);
|
||||||
connect(ui->mCancelModifyParamsBtn,&QPushButton::clicked,this,&CProgramSettingsPage::CancelModifyDevBtnPressed);
|
connect(ui->mCancelModifyParamsBtn,&QPushButton::clicked,this,&CProgramSettingsPage::CancelModifyDevBtnPressed);
|
||||||
connect(ui->mDatabaseFileSelectBtn,&QPushButton::clicked,this,&CProgramSettingsPage::SelectDBFileBtnPressed);
|
connect(ui->mDatabaseFileSelectBtn,&QPushButton::clicked,this,&CProgramSettingsPage::SelectDBFileBtnPressed);
|
||||||
|
connect(ui->mAddDeviceBtn,&QPushButton::clicked,this,&CProgramSettingsPage::AddDeviceBtnPressed);
|
||||||
|
connect(ui->mDeleteDeviceBtn,&QPushButton::clicked,this,&CProgramSettingsPage::DeleteDeviceBtnPressed);
|
||||||
|
|
||||||
// connect(ui->mDBSignalDetailsTable,&QTableWidget::itemSelectionChanged,this,&CProgramSettingsPage::SignalSelectionChanged);
|
// connect(ui->mDBSignalDetailsTable,&QTableWidget::itemSelectionChanged,this,&CProgramSettingsPage::SignalSelectionChanged);
|
||||||
|
|
||||||
@ -79,6 +83,11 @@ CProgramSettingsPage::CProgramSettingsPage(QWidget *parent) :
|
|||||||
|
|
||||||
CProgramSettingsPage::~CProgramSettingsPage()
|
CProgramSettingsPage::~CProgramSettingsPage()
|
||||||
{
|
{
|
||||||
|
while(!mDeviceConfigList.isEmpty())
|
||||||
|
{
|
||||||
|
delete mDeviceConfigList.takeFirst();
|
||||||
|
}
|
||||||
|
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +108,7 @@ int CProgramSettingsPage::SetDevicesList(QList<CCANDevice *> *DevicesList)
|
|||||||
ui->mDevicesList->clear();
|
ui->mDevicesList->clear();
|
||||||
for(int i = 0; i < mDevicesList->size(); i++)
|
for(int i = 0; i < mDevicesList->size(); i++)
|
||||||
{
|
{
|
||||||
QString name = mDevicesList->at(i)->mDeviceName;
|
QString name = mDevicesList->at(i)->mDeviceConfigInfo.mDeviceName;
|
||||||
if(name.isEmpty())
|
if(name.isEmpty())
|
||||||
{
|
{
|
||||||
name = QString("Device %1").arg(i+1);
|
name = QString("Device %1").arg(i+1);
|
||||||
@ -133,20 +142,21 @@ int CProgramSettingsPage::UpdatePage()
|
|||||||
|
|
||||||
if(Device != 0)
|
if(Device != 0)
|
||||||
{
|
{
|
||||||
|
CCANDeviceConfig *DevConfigInfo = &Device->mDeviceConfigInfo;
|
||||||
//Update device name in the list (it might have just changed)
|
//Update device name in the list (it might have just changed)
|
||||||
ui->mDevicesList->item(ui->mDevicesList->currentRow())->setText(Device->mDeviceName);
|
ui->mDevicesList->item(ui->mDevicesList->currentRow())->setText(DevConfigInfo->mDeviceName);
|
||||||
//update device information
|
//update device information
|
||||||
ui->mDeviceNameEditBx->setPlainText(Device->mDeviceName);
|
ui->mDeviceNameEditBx->setPlainText(DevConfigInfo->mDeviceName);
|
||||||
ui->mCANBaudrateComboBx->setCurrentIndex(ui->mCANBaudrateComboBx->findData(Device->mCANDeviceBaudrate));
|
ui->mCANBaudrateComboBx->setCurrentIndex(ui->mCANBaudrateComboBx->findData(DevConfigInfo->mCANDeviceBaudrate));
|
||||||
ui->mCANIDComboBx->setCurrentIndex(ui->mCANIDComboBx->findData(Device->mCANDeviceID));
|
ui->mCANIDComboBx->setCurrentIndex(ui->mCANIDComboBx->findData(DevConfigInfo->mCANDeviceID));
|
||||||
ui->mDeviceDescriptionTxtEdit->setPlainText(Device->mDeviceDescription);
|
ui->mDeviceDescriptionTxtEdit->setPlainText(DevConfigInfo->mDeviceDescription);
|
||||||
|
|
||||||
QFileInfo FileInfo(Device->mCANDeviceDatabaseFilename);
|
QFileInfo FileInfo(DevConfigInfo->mCANDeviceDatabaseFilename);
|
||||||
ui->mDatabaseFileNameLbl->setText(FileInfo.fileName());
|
ui->mDatabaseFileNameLbl->setText(FileInfo.fileName());
|
||||||
ui->mDatabaseFileNameLbl->setToolTip(Device->mCANDeviceDatabaseFilename);
|
ui->mDatabaseFileNameLbl->setToolTip(DevConfigInfo->mCANDeviceDatabaseFilename);
|
||||||
// ui->mDatabaseFileNameLbl->setText(QString("%1").arg(Device->mCANDeviceDatabaseFilename));
|
// ui->mDatabaseFileNameLbl->setText(QString("%1").arg(Device->mCANDeviceDatabaseFilename));
|
||||||
|
|
||||||
ui->mDevicePollPeriodSpinBx->setValue(Device->mDevicePollPeriod);
|
ui->mDevicePollPeriodSpinBx->setValue(DevConfigInfo->mDevicePollPeriod);
|
||||||
//update device database information
|
//update device database information
|
||||||
ui->mDBMessagesListWidget->clear();
|
ui->mDBMessagesListWidget->clear();
|
||||||
ui->mDBSignalDetailsTable->clearContents();
|
ui->mDBSignalDetailsTable->clearContents();
|
||||||
@ -173,7 +183,7 @@ int CProgramSettingsPage::UpdatePage()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CProgramSettingsPage::UpdateMessageInformation()
|
int CProgramSettingsPage::UpdateMessageInformation()
|
||||||
@ -302,6 +312,8 @@ int CProgramSettingsPage::UpdateMessageInformation()
|
|||||||
}
|
}
|
||||||
ui->mDBSignalDetailsTable->resizeColumnsToContents();
|
ui->mDBSignalDetailsTable->resizeColumnsToContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CProgramSettingsPage::DeviceSelectionChanged()
|
void CProgramSettingsPage::DeviceSelectionChanged()
|
||||||
@ -318,17 +330,34 @@ void CProgramSettingsPage::MessageSelectionChanged()
|
|||||||
{
|
{
|
||||||
UpdateMessageInformation();
|
UpdateMessageInformation();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CProgramSettingsPage::ModifyDeviceBtnPressed()
|
void CProgramSettingsPage::ModifyDeviceBtnPressed()
|
||||||
|
{
|
||||||
|
if(mDeviceChangeModeEnabled == false)
|
||||||
|
{
|
||||||
|
//Populate the devices config list with present devices
|
||||||
|
PopulateDevicesConfigList();
|
||||||
|
|
||||||
|
//Find the selected device index
|
||||||
|
int index = ui->mDevicesList->currentRow();
|
||||||
|
if(index >=0 && index < mDeviceConfigList.size())
|
||||||
|
{
|
||||||
|
mCurModifiedDevConfig = mDeviceConfigList.at(index);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ModifyDeviceConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
int CProgramSettingsPage::ModifyDeviceConfig()
|
||||||
{
|
{
|
||||||
if(mDeviceChangeModeEnabled)
|
if(mDeviceChangeModeEnabled)
|
||||||
{
|
{
|
||||||
//Save Data
|
//Save Data
|
||||||
|
if(mCurModifiedDevConfig != 0)
|
||||||
int index = ui->mDevicesList->currentRow();
|
|
||||||
if(index >= 0 && index < mDevicesList->size())
|
|
||||||
{
|
{
|
||||||
CCANDevice *ModifiedDevice = mDevicesList->at(index);
|
CCANDeviceConfig *ModifiedDevice = mCurModifiedDevConfig; //mDeviceConfigList.at(index);
|
||||||
|
|
||||||
ModifiedDevice->mCANDeviceBaudrate = ui->mCANBaudrateComboBx->currentData().toInt();
|
ModifiedDevice->mCANDeviceBaudrate = ui->mCANBaudrateComboBx->currentData().toInt();
|
||||||
ModifiedDevice->mCANDeviceID = ui->mCANIDComboBx->currentData().toInt();
|
ModifiedDevice->mCANDeviceID = ui->mCANIDComboBx->currentData().toInt();
|
||||||
@ -337,7 +366,7 @@ void CProgramSettingsPage::ModifyDeviceBtnPressed()
|
|||||||
ModifiedDevice->mDeviceName = ui->mDeviceNameEditBx->toPlainText();
|
ModifiedDevice->mDeviceName = ui->mDeviceNameEditBx->toPlainText();
|
||||||
ModifiedDevice->mDevicePollPeriod = ui->mDevicePollPeriodSpinBx->value();
|
ModifiedDevice->mDevicePollPeriod = ui->mDevicePollPeriodSpinBx->value();
|
||||||
|
|
||||||
mProgramPtr->SaveSystemConfigRequest();
|
mProgramPtr->SaveSystemConfigRequest(&mDeviceConfigList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -352,12 +381,14 @@ void CProgramSettingsPage::ModifyDeviceBtnPressed()
|
|||||||
ui->mCancelModifyParamsBtn->hide();
|
ui->mCancelModifyParamsBtn->hide();
|
||||||
ui->mDeviceNameEditBx->setEnabled(false);
|
ui->mDeviceNameEditBx->setEnabled(false);
|
||||||
mDeviceChangeModeEnabled = false;
|
mDeviceChangeModeEnabled = false;
|
||||||
|
ui->mAddDeviceBtn->setEnabled(true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
//Modify data
|
//Modify data
|
||||||
ui->mDeviceDescriptionTxtEdit->setEnabled(true);
|
ui->mDeviceDescriptionTxtEdit->setEnabled(true);
|
||||||
ui->mDatabaseFileSelectBtn->show();
|
ui->mDatabaseFileSelectBtn->show();
|
||||||
@ -368,9 +399,12 @@ void CProgramSettingsPage::ModifyDeviceBtnPressed()
|
|||||||
ui->mModifyDevParamsBtn->setText("Sauvegarder");
|
ui->mModifyDevParamsBtn->setText("Sauvegarder");
|
||||||
ui->mCancelModifyParamsBtn->show();
|
ui->mCancelModifyParamsBtn->show();
|
||||||
ui->mDeviceNameEditBx->setEnabled(true);
|
ui->mDeviceNameEditBx->setEnabled(true);
|
||||||
|
ui->mAddDeviceBtn->setEnabled(true);
|
||||||
|
|
||||||
mDeviceChangeModeEnabled = true;
|
mDeviceChangeModeEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CProgramSettingsPage::CancelModifyDevBtnPressed()
|
void CProgramSettingsPage::CancelModifyDevBtnPressed()
|
||||||
@ -384,6 +418,7 @@ void CProgramSettingsPage::CancelModifyDevBtnPressed()
|
|||||||
ui->mModifyDevParamsBtn->setText("Modifier");
|
ui->mModifyDevParamsBtn->setText("Modifier");
|
||||||
ui->mCancelModifyParamsBtn->hide();
|
ui->mCancelModifyParamsBtn->hide();
|
||||||
ui->mDeviceNameEditBx->setEnabled(false);
|
ui->mDeviceNameEditBx->setEnabled(false);
|
||||||
|
ui->mAddDeviceBtn->setEnabled(true);
|
||||||
mDeviceChangeModeEnabled = false;
|
mDeviceChangeModeEnabled = false;
|
||||||
|
|
||||||
UpdatePage();
|
UpdatePage();
|
||||||
@ -404,3 +439,65 @@ void CProgramSettingsPage::SelectDBFileBtnPressed()
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CProgramSettingsPage::AddDeviceBtnPressed()
|
||||||
|
{
|
||||||
|
//Populate the devices config list with present devices
|
||||||
|
PopulateDevicesConfigList();
|
||||||
|
//add an empty config and enable modification
|
||||||
|
CCANDeviceConfig *NewDevConfig = new CCANDeviceConfig;
|
||||||
|
mDeviceConfigList.append(NewDevConfig);
|
||||||
|
//update device information
|
||||||
|
ui->mDeviceNameEditBx->setPlainText(NewDevConfig->mDeviceName);
|
||||||
|
ui->mCANBaudrateComboBx->setCurrentIndex(ui->mCANBaudrateComboBx->findData(NewDevConfig->mCANDeviceBaudrate));
|
||||||
|
ui->mCANIDComboBx->setCurrentIndex(ui->mCANIDComboBx->findData(NewDevConfig->mCANDeviceID));
|
||||||
|
ui->mDeviceDescriptionTxtEdit->setPlainText(NewDevConfig->mDeviceDescription);
|
||||||
|
ui->mDatabaseFileNameLbl->setText(NewDevConfig->mCANDeviceDatabaseFilename);
|
||||||
|
ui->mDatabaseFileNameLbl->setToolTip(NewDevConfig->mCANDeviceDatabaseFilename);
|
||||||
|
|
||||||
|
ui->mDevicePollPeriodSpinBx->setValue(NewDevConfig->mDevicePollPeriod);
|
||||||
|
//update device database information
|
||||||
|
ui->mDBMessagesListWidget->clear();
|
||||||
|
ui->mDBSignalDetailsTable->clearContents();
|
||||||
|
ui->mDBSignalDetailsTable->setRowCount(0);
|
||||||
|
|
||||||
|
mCurModifiedDevConfig = NewDevConfig;
|
||||||
|
ModifyDeviceConfig();
|
||||||
|
|
||||||
|
ui->mAddDeviceBtn->setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CProgramSettingsPage::DeleteDeviceBtnPressed()
|
||||||
|
{
|
||||||
|
|
||||||
|
//Populate the devices config list with present devices
|
||||||
|
PopulateDevicesConfigList();
|
||||||
|
|
||||||
|
//Find the selected device index
|
||||||
|
int index = ui->mDevicesList->currentRow();
|
||||||
|
if(index >=0 && index < mDeviceConfigList.size())
|
||||||
|
{
|
||||||
|
delete mDeviceConfigList.takeAt(index);
|
||||||
|
}
|
||||||
|
mProgramPtr->SaveSystemConfigRequest(&mDeviceConfigList);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int CProgramSettingsPage::PopulateDevicesConfigList()
|
||||||
|
{
|
||||||
|
while(!mDeviceConfigList.isEmpty())
|
||||||
|
{
|
||||||
|
delete mDeviceConfigList.takeFirst();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Gather the actual data in the change buffer.
|
||||||
|
for(int device = 0; device < mDevicesList->size(); device++)
|
||||||
|
{
|
||||||
|
const CCANDevice *CurDevice = mDevicesList->at(device);
|
||||||
|
CCANDeviceConfig *DevConfig = new CCANDeviceConfig;
|
||||||
|
*DevConfig = CurDevice->mDeviceConfigInfo;
|
||||||
|
mDeviceConfigList.append(DevConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
return RET_OK;
|
||||||
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ class CCANDevice;
|
|||||||
class CCANMessage;
|
class CCANMessage;
|
||||||
class CCANSignal;
|
class CCANSignal;
|
||||||
class COtarcikCan;
|
class COtarcikCan;
|
||||||
|
class CCANDeviceConfig;
|
||||||
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
@ -25,14 +26,19 @@ public:
|
|||||||
int ClearDatabaseData();
|
int ClearDatabaseData();
|
||||||
int UpdatePage();
|
int UpdatePage();
|
||||||
int UpdateMessageInformation();
|
int UpdateMessageInformation();
|
||||||
|
int ModifyDeviceConfig();
|
||||||
|
|
||||||
|
|
||||||
COtarcikCan *mProgramPtr;
|
COtarcikCan *mProgramPtr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::CProgramSettingsPage *ui;
|
Ui::CProgramSettingsPage *ui;
|
||||||
QList<CCANDevice *> *mDevicesList;
|
const QList<CCANDevice *> *mDevicesList;
|
||||||
|
QList<CCANDeviceConfig*> mDeviceConfigList;
|
||||||
bool mDeviceChangeModeEnabled;
|
bool mDeviceChangeModeEnabled;
|
||||||
|
CCANDeviceConfig* mCurModifiedDevConfig;
|
||||||
|
|
||||||
|
int PopulateDevicesConfigList();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void DeviceSelectionChanged();
|
void DeviceSelectionChanged();
|
||||||
@ -41,6 +47,9 @@ public slots:
|
|||||||
void ModifyDeviceBtnPressed();
|
void ModifyDeviceBtnPressed();
|
||||||
void CancelModifyDevBtnPressed();
|
void CancelModifyDevBtnPressed();
|
||||||
void SelectDBFileBtnPressed();
|
void SelectDBFileBtnPressed();
|
||||||
|
void AddDeviceBtnPressed();
|
||||||
|
void DeleteDeviceBtnPressed();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PROGRAMSETTINGSPAGE_H
|
#endif // PROGRAMSETTINGSPAGE_H
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1475</width>
|
<width>1475</width>
|
||||||
<height>604</height>
|
<height>693</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -377,6 +377,32 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QPushButton" name="mAddDeviceBtn">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>200</x>
|
||||||
|
<y>420</y>
|
||||||
|
<width>41</width>
|
||||||
|
<height>22</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Ajouter</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="mDeleteDeviceBtn">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>50</x>
|
||||||
|
<y>420</y>
|
||||||
|
<width>61</width>
|
||||||
|
<height>22</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Supprimer</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
COtarcikCan::COtarcikCan(QObject *parent) : QObject(parent)
|
COtarcikCan::COtarcikCan(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
mMainWindow.mProgramSettingsPage->mProgramPtr = this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
COtarcikCan::~COtarcikCan()
|
COtarcikCan::~COtarcikCan()
|
||||||
@ -36,8 +36,10 @@ COtarcikCan::~COtarcikCan()
|
|||||||
|
|
||||||
int COtarcikCan::Start()
|
int COtarcikCan::Start()
|
||||||
{
|
{
|
||||||
mMainWindow.show();
|
|
||||||
|
|
||||||
|
mMainWindow.mProgramSettingsPage->mProgramPtr = this;
|
||||||
|
|
||||||
|
mMainWindow.show();
|
||||||
|
|
||||||
|
|
||||||
CGeneralMessagesLogDispatcher::instance()->BindGuiPageHandle(mMainWindow.mGeneralStatusPage);
|
CGeneralMessagesLogDispatcher::instance()->BindGuiPageHandle(mMainWindow.mGeneralStatusPage);
|
||||||
@ -64,7 +66,7 @@ int COtarcikCan::Start()
|
|||||||
// NewCANDevice->Init("IVT-S_all-variations_12082020.dbc",PCAN_USBBUS1,PCAN_BAUD_500K,"Puck CAN USB branchée sur le module Parker qui contrôle la patente", "Module Parker",1000);
|
// NewCANDevice->Init("IVT-S_all-variations_12082020.dbc",PCAN_USBBUS1,PCAN_BAUD_500K,"Puck CAN USB branchée sur le module Parker qui contrôle la patente", "Module Parker",1000);
|
||||||
// SaveSystemConfigRequest();
|
// SaveSystemConfigRequest();
|
||||||
|
|
||||||
// mMainWindow.mProgramSettingsPage->SetDevicesList(&mCANDevicesList);
|
mMainWindow.mProgramSettingsPage->SetDevicesList(&mCANDevicesList);
|
||||||
|
|
||||||
// NewCANDevice = new CCANDevice();
|
// NewCANDevice = new CCANDevice();
|
||||||
// mCANDevicesList.append(NewCANDevice);
|
// mCANDevicesList.append(NewCANDevice);
|
||||||
@ -93,10 +95,10 @@ int COtarcikCan::InitCANViewer(QList<CCANMessage *> *MsgList)
|
|||||||
|
|
||||||
//The device configuration has been modified directly in the master list
|
//The device configuration has been modified directly in the master list
|
||||||
//Just save it and refresh display.
|
//Just save it and refresh display.
|
||||||
int COtarcikCan::SaveSystemConfigRequest()
|
int COtarcikCan::SaveSystemConfigRequest(QList<CCANDeviceConfig *> *DevicesConfigList)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(mSystemConfig.SaveConfig(&mCANDevicesList) == RET_OK)
|
if(mSystemConfig.SaveConfig(DevicesConfigList) == RET_OK)
|
||||||
{
|
{
|
||||||
// mMainWindow.mProgramSettingsPage->UpdatePage();
|
// mMainWindow.mProgramSettingsPage->UpdatePage();
|
||||||
|
|
||||||
@ -118,5 +120,10 @@ int COtarcikCan::SaveSystemConfigRequest()
|
|||||||
mMainWindow.mProgramSettingsPage->SetDevicesList(&mCANDevicesList);
|
mMainWindow.mProgramSettingsPage->SetDevicesList(&mCANDevicesList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return RET_GENERAL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ public:
|
|||||||
int UpdateCANViewerDataRequest(QList<CCANMessage *> *MsgList);
|
int UpdateCANViewerDataRequest(QList<CCANMessage *> *MsgList);
|
||||||
|
|
||||||
|
|
||||||
int SaveSystemConfigRequest();
|
int SaveSystemConfigRequest(QList<CCANDeviceConfig*> *DevicesConfigList);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<CCANDevice*> mCANDevicesList;
|
QList<CCANDevice*> mCANDevicesList;
|
||||||
|
|||||||
@ -22,8 +22,6 @@ int CSystemConfig::LoadConfig(QList<CCANDevice *> *DevicesList)
|
|||||||
{
|
{
|
||||||
if(ConfigFile->open(QIODevice::ReadOnly | QIODevice::Unbuffered) == false)
|
if(ConfigFile->open(QIODevice::ReadOnly | QIODevice::Unbuffered) == false)
|
||||||
{
|
{
|
||||||
// LoadDefaultSettings(Settings);
|
|
||||||
// SaveSettings(Settings);
|
|
||||||
qDebug("CSystemConfig: Failed to open config file in config loading");
|
qDebug("CSystemConfig: Failed to open config file in config loading");
|
||||||
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(QString("Échec de sauvegarde de la config système. Impossible d'ouvrir le fichier /Config/Station.cfg"),true,CGeneralMessagesLogDispatcher::GEN_MSG_TXT_ERROR_STATUS);
|
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(QString("Échec de sauvegarde de la config système. Impossible d'ouvrir le fichier /Config/Station.cfg"),true,CGeneralMessagesLogDispatcher::GEN_MSG_TXT_ERROR_STATUS);
|
||||||
return RET_GENERAL_ERROR;
|
return RET_GENERAL_ERROR;
|
||||||
@ -31,7 +29,6 @@ int CSystemConfig::LoadConfig(QList<CCANDevice *> *DevicesList)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// LoadDefaultSettings(Settings);
|
|
||||||
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(QString("Échec de sauvegarde de la config système. Pointeur vers QFile invalide !!!"),true,CGeneralMessagesLogDispatcher::GEN_MSG_TXT_ERROR_STATUS);
|
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(QString("Échec de sauvegarde de la config système. Pointeur vers QFile invalide !!!"),true,CGeneralMessagesLogDispatcher::GEN_MSG_TXT_ERROR_STATUS);
|
||||||
qDebug("CSystemConfig: Invalid QFile pointer in config loading...");
|
qDebug("CSystemConfig: Invalid QFile pointer in config loading...");
|
||||||
return RET_GENERAL_ERROR;
|
return RET_GENERAL_ERROR;
|
||||||
@ -46,7 +43,6 @@ int CSystemConfig::LoadConfig(QList<CCANDevice *> *DevicesList)
|
|||||||
*InputStream >> MagicNbr;
|
*InputStream >> MagicNbr;
|
||||||
if(MagicNbr != OTARCIK_CONFIG_FILE_MAGIC_NBR)
|
if(MagicNbr != OTARCIK_CONFIG_FILE_MAGIC_NBR)
|
||||||
{
|
{
|
||||||
// LoadDefaultSettings(Settings);
|
|
||||||
return RET_GENERAL_ERROR;
|
return RET_GENERAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,9 +52,9 @@ int CSystemConfig::LoadConfig(QList<CCANDevice *> *DevicesList)
|
|||||||
*InputStream >> NbDevices;
|
*InputStream >> NbDevices;
|
||||||
for(int i = 0; i < NbDevices; i++)
|
for(int i = 0; i < NbDevices; i++)
|
||||||
{
|
{
|
||||||
CCANDevice *NewDevice = new CCANDevice;
|
CCANDeviceConfig NewDeviceConfig;
|
||||||
*InputStream >> *NewDevice;
|
*InputStream >> NewDeviceConfig;
|
||||||
DevicesList->append(NewDevice);
|
DevicesList->append(new CCANDevice(NewDeviceConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -70,8 +66,13 @@ int CSystemConfig::LoadConfig(QList<CCANDevice *> *DevicesList)
|
|||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CSystemConfig::SaveConfig(QList<CCANDevice *> *DevicesList)
|
int CSystemConfig::SaveConfig(QList<CCANDeviceConfig *> *DevicesConfigList)
|
||||||
{
|
{
|
||||||
|
if(DevicesConfigList == 0)
|
||||||
|
{
|
||||||
|
qDebug("CSystemConfig: Trying to save an invalid config list pointer");
|
||||||
|
return RET_GENERAL_ERROR;
|
||||||
|
}
|
||||||
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(QString("Sauvegarde de la configuration système..."));
|
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(QString("Sauvegarde de la configuration système..."));
|
||||||
|
|
||||||
QFile *ConfigFile = new QFile("./Config/Station.cfg");
|
QFile *ConfigFile = new QFile("./Config/Station.cfg");
|
||||||
@ -100,10 +101,10 @@ int CSystemConfig::SaveConfig(QList<CCANDevice *> *DevicesList)
|
|||||||
*OutputStream << FileVersion;
|
*OutputStream << FileVersion;
|
||||||
|
|
||||||
//Save the CAN devices config info
|
//Save the CAN devices config info
|
||||||
*OutputStream << DevicesList->size(); //Number of devices
|
*OutputStream << DevicesConfigList->size(); //Number of devices
|
||||||
for(int i = 0; i < DevicesList->size(); i++)
|
for(int i = 0; i < DevicesConfigList->size(); i++)
|
||||||
{
|
{
|
||||||
*OutputStream << *DevicesList->at(i); //Add each device info to config file
|
*OutputStream << *DevicesConfigList->at(i); //Add each device info to config file
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigFile->flush();
|
ConfigFile->flush();
|
||||||
@ -116,3 +117,10 @@ int CSystemConfig::SaveConfig(QList<CCANDevice *> *DevicesList)
|
|||||||
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
////////////Class CCANDeviceConfig implementation ////////////
|
||||||
|
|
||||||
|
|||||||
@ -5,9 +5,11 @@
|
|||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
|
#include "CANDeviceConfig.h"
|
||||||
|
|
||||||
#define OTARCIK_CURRENT_CONFIG_FILE_VERSION 0x01
|
#define OTARCIK_CURRENT_CONFIG_FILE_VERSION 0x01
|
||||||
#define OTARCIK_CONFIG_FILE_MAGIC_NBR 0xDEADBEEF
|
#define OTARCIK_CONFIG_FILE_MAGIC_NBR 0xDEADBEEF
|
||||||
|
//class CCANDeviceConfig;
|
||||||
|
|
||||||
class CSystemConfig
|
class CSystemConfig
|
||||||
{
|
{
|
||||||
@ -15,8 +17,10 @@ public:
|
|||||||
CSystemConfig();
|
CSystemConfig();
|
||||||
|
|
||||||
int LoadConfig(QList<CCANDevice*> *DevicesList);
|
int LoadConfig(QList<CCANDevice*> *DevicesList);
|
||||||
int SaveConfig(QList<CCANDevice*> *DevicesList);
|
int SaveConfig(QList<CCANDeviceConfig*> *DevicesConfigList);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // SYSTEMCONFIG_H
|
#endif // SYSTEMCONFIG_H
|
||||||
|
|||||||
Binary file not shown.
@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE
|
|||||||
QT_WARNING_PUSH
|
QT_WARNING_PUSH
|
||||||
QT_WARNING_DISABLE_DEPRECATED
|
QT_WARNING_DISABLE_DEPRECATED
|
||||||
struct qt_meta_stringdata_CGeneralStatusPage_t {
|
struct qt_meta_stringdata_CGeneralStatusPage_t {
|
||||||
QByteArrayData data[1];
|
QByteArrayData data[3];
|
||||||
char stringdata0[19];
|
char stringdata0[46];
|
||||||
};
|
};
|
||||||
#define QT_MOC_LITERAL(idx, ofs, len) \
|
#define QT_MOC_LITERAL(idx, ofs, len) \
|
||||||
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
|
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
|
||||||
@ -32,10 +32,13 @@ struct qt_meta_stringdata_CGeneralStatusPage_t {
|
|||||||
)
|
)
|
||||||
static const qt_meta_stringdata_CGeneralStatusPage_t qt_meta_stringdata_CGeneralStatusPage = {
|
static const qt_meta_stringdata_CGeneralStatusPage_t qt_meta_stringdata_CGeneralStatusPage = {
|
||||||
{
|
{
|
||||||
QT_MOC_LITERAL(0, 0, 18) // "CGeneralStatusPage"
|
QT_MOC_LITERAL(0, 0, 18), // "CGeneralStatusPage"
|
||||||
|
QT_MOC_LITERAL(1, 19, 25), // "ClearGenMsgAreaBtnPressed"
|
||||||
|
QT_MOC_LITERAL(2, 45, 0) // ""
|
||||||
|
|
||||||
},
|
},
|
||||||
"CGeneralStatusPage"
|
"CGeneralStatusPage\0ClearGenMsgAreaBtnPressed\0"
|
||||||
|
""
|
||||||
};
|
};
|
||||||
#undef QT_MOC_LITERAL
|
#undef QT_MOC_LITERAL
|
||||||
|
|
||||||
@ -45,21 +48,32 @@ static const uint qt_meta_data_CGeneralStatusPage[] = {
|
|||||||
8, // revision
|
8, // revision
|
||||||
0, // classname
|
0, // classname
|
||||||
0, 0, // classinfo
|
0, 0, // classinfo
|
||||||
0, 0, // methods
|
1, 14, // methods
|
||||||
0, 0, // properties
|
0, 0, // properties
|
||||||
0, 0, // enums/sets
|
0, 0, // enums/sets
|
||||||
0, 0, // constructors
|
0, 0, // constructors
|
||||||
0, // flags
|
0, // flags
|
||||||
0, // signalCount
|
0, // signalCount
|
||||||
|
|
||||||
|
// slots: name, argc, parameters, tag, flags
|
||||||
|
1, 0, 19, 2, 0x0a /* Public */,
|
||||||
|
|
||||||
|
// slots: parameters
|
||||||
|
QMetaType::Void,
|
||||||
|
|
||||||
0 // eod
|
0 // eod
|
||||||
};
|
};
|
||||||
|
|
||||||
void CGeneralStatusPage::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
|
void CGeneralStatusPage::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
|
||||||
{
|
{
|
||||||
Q_UNUSED(_o);
|
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||||
Q_UNUSED(_id);
|
auto *_t = static_cast<CGeneralStatusPage *>(_o);
|
||||||
Q_UNUSED(_c);
|
Q_UNUSED(_t)
|
||||||
|
switch (_id) {
|
||||||
|
case 0: _t->ClearGenMsgAreaBtnPressed(); break;
|
||||||
|
default: ;
|
||||||
|
}
|
||||||
|
}
|
||||||
Q_UNUSED(_a);
|
Q_UNUSED(_a);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,6 +103,17 @@ void *CGeneralStatusPage::qt_metacast(const char *_clname)
|
|||||||
int CGeneralStatusPage::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
int CGeneralStatusPage::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||||
{
|
{
|
||||||
_id = QWidget::qt_metacall(_c, _id, _a);
|
_id = QWidget::qt_metacall(_c, _id, _a);
|
||||||
|
if (_id < 0)
|
||||||
|
return _id;
|
||||||
|
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||||
|
if (_id < 1)
|
||||||
|
qt_static_metacall(this, _c, _id, _a);
|
||||||
|
_id -= 1;
|
||||||
|
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
|
||||||
|
if (_id < 1)
|
||||||
|
*reinterpret_cast<int*>(_a[0]) = -1;
|
||||||
|
_id -= 1;
|
||||||
|
}
|
||||||
return _id;
|
return _id;
|
||||||
}
|
}
|
||||||
QT_WARNING_POP
|
QT_WARNING_POP
|
||||||
|
|||||||
@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE
|
|||||||
QT_WARNING_PUSH
|
QT_WARNING_PUSH
|
||||||
QT_WARNING_DISABLE_DEPRECATED
|
QT_WARNING_DISABLE_DEPRECATED
|
||||||
struct qt_meta_stringdata_CProgramSettingsPage_t {
|
struct qt_meta_stringdata_CProgramSettingsPage_t {
|
||||||
QByteArrayData data[8];
|
QByteArrayData data[10];
|
||||||
char stringdata0[164];
|
char stringdata0[207];
|
||||||
};
|
};
|
||||||
#define QT_MOC_LITERAL(idx, ofs, len) \
|
#define QT_MOC_LITERAL(idx, ofs, len) \
|
||||||
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
|
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
|
||||||
@ -39,13 +39,16 @@ QT_MOC_LITERAL(3, 45, 22), // "SignalSelectionChanged"
|
|||||||
QT_MOC_LITERAL(4, 68, 23), // "MessageSelectionChanged"
|
QT_MOC_LITERAL(4, 68, 23), // "MessageSelectionChanged"
|
||||||
QT_MOC_LITERAL(5, 92, 22), // "ModifyDeviceBtnPressed"
|
QT_MOC_LITERAL(5, 92, 22), // "ModifyDeviceBtnPressed"
|
||||||
QT_MOC_LITERAL(6, 115, 25), // "CancelModifyDevBtnPressed"
|
QT_MOC_LITERAL(6, 115, 25), // "CancelModifyDevBtnPressed"
|
||||||
QT_MOC_LITERAL(7, 141, 22) // "SelectDBFileBtnPressed"
|
QT_MOC_LITERAL(7, 141, 22), // "SelectDBFileBtnPressed"
|
||||||
|
QT_MOC_LITERAL(8, 164, 19), // "AddDeviceBtnPressed"
|
||||||
|
QT_MOC_LITERAL(9, 184, 22) // "DeleteDeviceBtnPressed"
|
||||||
|
|
||||||
},
|
},
|
||||||
"CProgramSettingsPage\0DeviceSelectionChanged\0"
|
"CProgramSettingsPage\0DeviceSelectionChanged\0"
|
||||||
"\0SignalSelectionChanged\0MessageSelectionChanged\0"
|
"\0SignalSelectionChanged\0MessageSelectionChanged\0"
|
||||||
"ModifyDeviceBtnPressed\0CancelModifyDevBtnPressed\0"
|
"ModifyDeviceBtnPressed\0CancelModifyDevBtnPressed\0"
|
||||||
"SelectDBFileBtnPressed"
|
"SelectDBFileBtnPressed\0AddDeviceBtnPressed\0"
|
||||||
|
"DeleteDeviceBtnPressed"
|
||||||
};
|
};
|
||||||
#undef QT_MOC_LITERAL
|
#undef QT_MOC_LITERAL
|
||||||
|
|
||||||
@ -55,7 +58,7 @@ static const uint qt_meta_data_CProgramSettingsPage[] = {
|
|||||||
8, // revision
|
8, // revision
|
||||||
0, // classname
|
0, // classname
|
||||||
0, 0, // classinfo
|
0, 0, // classinfo
|
||||||
6, 14, // methods
|
8, 14, // methods
|
||||||
0, 0, // properties
|
0, 0, // properties
|
||||||
0, 0, // enums/sets
|
0, 0, // enums/sets
|
||||||
0, 0, // constructors
|
0, 0, // constructors
|
||||||
@ -63,12 +66,14 @@ static const uint qt_meta_data_CProgramSettingsPage[] = {
|
|||||||
0, // signalCount
|
0, // signalCount
|
||||||
|
|
||||||
// slots: name, argc, parameters, tag, flags
|
// slots: name, argc, parameters, tag, flags
|
||||||
1, 0, 44, 2, 0x0a /* Public */,
|
1, 0, 54, 2, 0x0a /* Public */,
|
||||||
3, 0, 45, 2, 0x0a /* Public */,
|
3, 0, 55, 2, 0x0a /* Public */,
|
||||||
4, 0, 46, 2, 0x0a /* Public */,
|
4, 0, 56, 2, 0x0a /* Public */,
|
||||||
5, 0, 47, 2, 0x0a /* Public */,
|
5, 0, 57, 2, 0x0a /* Public */,
|
||||||
6, 0, 48, 2, 0x0a /* Public */,
|
6, 0, 58, 2, 0x0a /* Public */,
|
||||||
7, 0, 49, 2, 0x0a /* Public */,
|
7, 0, 59, 2, 0x0a /* Public */,
|
||||||
|
8, 0, 60, 2, 0x0a /* Public */,
|
||||||
|
9, 0, 61, 2, 0x0a /* Public */,
|
||||||
|
|
||||||
// slots: parameters
|
// slots: parameters
|
||||||
QMetaType::Void,
|
QMetaType::Void,
|
||||||
@ -76,6 +81,8 @@ static const uint qt_meta_data_CProgramSettingsPage[] = {
|
|||||||
QMetaType::Void,
|
QMetaType::Void,
|
||||||
QMetaType::Void,
|
QMetaType::Void,
|
||||||
QMetaType::Void,
|
QMetaType::Void,
|
||||||
|
QMetaType::Void,
|
||||||
|
QMetaType::Void,
|
||||||
QMetaType::Void,
|
QMetaType::Void,
|
||||||
|
|
||||||
0 // eod
|
0 // eod
|
||||||
@ -93,6 +100,8 @@ void CProgramSettingsPage::qt_static_metacall(QObject *_o, QMetaObject::Call _c,
|
|||||||
case 3: _t->ModifyDeviceBtnPressed(); break;
|
case 3: _t->ModifyDeviceBtnPressed(); break;
|
||||||
case 4: _t->CancelModifyDevBtnPressed(); break;
|
case 4: _t->CancelModifyDevBtnPressed(); break;
|
||||||
case 5: _t->SelectDBFileBtnPressed(); break;
|
case 5: _t->SelectDBFileBtnPressed(); break;
|
||||||
|
case 6: _t->AddDeviceBtnPressed(); break;
|
||||||
|
case 7: _t->DeleteDeviceBtnPressed(); break;
|
||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,13 +137,13 @@ int CProgramSettingsPage::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
|||||||
if (_id < 0)
|
if (_id < 0)
|
||||||
return _id;
|
return _id;
|
||||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||||
if (_id < 6)
|
if (_id < 8)
|
||||||
qt_static_metacall(this, _c, _id, _a);
|
qt_static_metacall(this, _c, _id, _a);
|
||||||
_id -= 6;
|
_id -= 8;
|
||||||
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
|
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
|
||||||
if (_id < 6)
|
if (_id < 8)
|
||||||
*reinterpret_cast<int*>(_a[0]) = -1;
|
*reinterpret_cast<int*>(_a[0]) = -1;
|
||||||
_id -= 6;
|
_id -= 8;
|
||||||
}
|
}
|
||||||
return _id;
|
return _id;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@ debug/CANDatabase.o
|
|||||||
debug/CANDevice.o
|
debug/CANDevice.o
|
||||||
debug/CANSignal.o
|
debug/CANSignal.o
|
||||||
debug/SystemConfig.o
|
debug/SystemConfig.o
|
||||||
|
debug/CANDeviceConfig.o
|
||||||
debug/moc_MainWindow.o
|
debug/moc_MainWindow.o
|
||||||
debug/moc_PCANInterface.o
|
debug/moc_PCANInterface.o
|
||||||
debug/moc_OtarcikCan.o
|
debug/moc_OtarcikCan.o
|
||||||
|
|||||||
@ -12,6 +12,7 @@ release/CANDatabase.o
|
|||||||
release/CANDevice.o
|
release/CANDevice.o
|
||||||
release/CANSignal.o
|
release/CANSignal.o
|
||||||
release/SystemConfig.o
|
release/SystemConfig.o
|
||||||
|
release/CANDeviceConfig.o
|
||||||
release/moc_MainWindow.o
|
release/moc_MainWindow.o
|
||||||
release/moc_PCANInterface.o
|
release/moc_PCANInterface.o
|
||||||
release/moc_OtarcikCan.o
|
release/moc_OtarcikCan.o
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include <QtCore/QVariant>
|
#include <QtCore/QVariant>
|
||||||
#include <QtWidgets/QApplication>
|
#include <QtWidgets/QApplication>
|
||||||
|
#include <QtWidgets/QPushButton>
|
||||||
#include <QtWidgets/QTextEdit>
|
#include <QtWidgets/QTextEdit>
|
||||||
#include <QtWidgets/QWidget>
|
#include <QtWidgets/QWidget>
|
||||||
|
|
||||||
@ -20,15 +21,16 @@ class Ui_CGeneralStatusPage
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QTextEdit *mGenMsgTextEdit;
|
QTextEdit *mGenMsgTextEdit;
|
||||||
|
QPushButton *mClearGenMsgTxtBtn;
|
||||||
|
|
||||||
void setupUi(QWidget *CGeneralStatusPage)
|
void setupUi(QWidget *CGeneralStatusPage)
|
||||||
{
|
{
|
||||||
if (CGeneralStatusPage->objectName().isEmpty())
|
if (CGeneralStatusPage->objectName().isEmpty())
|
||||||
CGeneralStatusPage->setObjectName(QString::fromUtf8("CGeneralStatusPage"));
|
CGeneralStatusPage->setObjectName(QString::fromUtf8("CGeneralStatusPage"));
|
||||||
CGeneralStatusPage->resize(1456, 492);
|
CGeneralStatusPage->resize(1456, 527);
|
||||||
mGenMsgTextEdit = new QTextEdit(CGeneralStatusPage);
|
mGenMsgTextEdit = new QTextEdit(CGeneralStatusPage);
|
||||||
mGenMsgTextEdit->setObjectName(QString::fromUtf8("mGenMsgTextEdit"));
|
mGenMsgTextEdit->setObjectName(QString::fromUtf8("mGenMsgTextEdit"));
|
||||||
mGenMsgTextEdit->setGeometry(QRect(460, 30, 651, 451));
|
mGenMsgTextEdit->setGeometry(QRect(30, 20, 1141, 451));
|
||||||
QFont font;
|
QFont font;
|
||||||
font.setFamily(QString::fromUtf8("System"));
|
font.setFamily(QString::fromUtf8("System"));
|
||||||
font.setPointSize(12);
|
font.setPointSize(12);
|
||||||
@ -36,6 +38,9 @@ public:
|
|||||||
font.setWeight(75);
|
font.setWeight(75);
|
||||||
mGenMsgTextEdit->setFont(font);
|
mGenMsgTextEdit->setFont(font);
|
||||||
mGenMsgTextEdit->setReadOnly(true);
|
mGenMsgTextEdit->setReadOnly(true);
|
||||||
|
mClearGenMsgTxtBtn = new QPushButton(CGeneralStatusPage);
|
||||||
|
mClearGenMsgTxtBtn->setObjectName(QString::fromUtf8("mClearGenMsgTxtBtn"));
|
||||||
|
mClearGenMsgTxtBtn->setGeometry(QRect(30, 480, 80, 22));
|
||||||
|
|
||||||
retranslateUi(CGeneralStatusPage);
|
retranslateUi(CGeneralStatusPage);
|
||||||
|
|
||||||
@ -45,6 +50,7 @@ public:
|
|||||||
void retranslateUi(QWidget *CGeneralStatusPage)
|
void retranslateUi(QWidget *CGeneralStatusPage)
|
||||||
{
|
{
|
||||||
CGeneralStatusPage->setWindowTitle(QCoreApplication::translate("CGeneralStatusPage", "Form", nullptr));
|
CGeneralStatusPage->setWindowTitle(QCoreApplication::translate("CGeneralStatusPage", "Form", nullptr));
|
||||||
|
mClearGenMsgTxtBtn->setText(QCoreApplication::translate("CGeneralStatusPage", "Nettoyer", nullptr));
|
||||||
} // retranslateUi
|
} // retranslateUi
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -53,6 +53,8 @@ public:
|
|||||||
QListWidget *mDBMessagesListWidget;
|
QListWidget *mDBMessagesListWidget;
|
||||||
QLabel *mDBMessageNameLbl_2;
|
QLabel *mDBMessageNameLbl_2;
|
||||||
QTableWidget *mDBSignalDetailsTable;
|
QTableWidget *mDBSignalDetailsTable;
|
||||||
|
QPushButton *mAddDeviceBtn;
|
||||||
|
QPushButton *mDeleteDeviceBtn;
|
||||||
|
|
||||||
void setupUi(QWidget *CProgramSettingsPage)
|
void setupUi(QWidget *CProgramSettingsPage)
|
||||||
{
|
{
|
||||||
@ -157,6 +159,12 @@ public:
|
|||||||
mDBSignalDetailsTable = new QTableWidget(mDatabaseGroupBox);
|
mDBSignalDetailsTable = new QTableWidget(mDatabaseGroupBox);
|
||||||
mDBSignalDetailsTable->setObjectName(QString::fromUtf8("mDBSignalDetailsTable"));
|
mDBSignalDetailsTable->setObjectName(QString::fromUtf8("mDBSignalDetailsTable"));
|
||||||
mDBSignalDetailsTable->setGeometry(QRect(0, 250, 851, 241));
|
mDBSignalDetailsTable->setGeometry(QRect(0, 250, 851, 241));
|
||||||
|
mAddDeviceBtn = new QPushButton(CProgramSettingsPage);
|
||||||
|
mAddDeviceBtn->setObjectName(QString::fromUtf8("mAddDeviceBtn"));
|
||||||
|
mAddDeviceBtn->setGeometry(QRect(200, 420, 41, 22));
|
||||||
|
mDeleteDeviceBtn = new QPushButton(CProgramSettingsPage);
|
||||||
|
mDeleteDeviceBtn->setObjectName(QString::fromUtf8("mDeleteDeviceBtn"));
|
||||||
|
mDeleteDeviceBtn->setGeometry(QRect(50, 420, 61, 22));
|
||||||
|
|
||||||
retranslateUi(CProgramSettingsPage);
|
retranslateUi(CProgramSettingsPage);
|
||||||
|
|
||||||
@ -183,6 +191,8 @@ public:
|
|||||||
mDBMessageLengthLbl->setText(QCoreApplication::translate("CProgramSettingsPage", "Message Length", nullptr));
|
mDBMessageLengthLbl->setText(QCoreApplication::translate("CProgramSettingsPage", "Message Length", nullptr));
|
||||||
mDBMessageNbSignalsLbl->setText(QCoreApplication::translate("CProgramSettingsPage", "Number of signals: ", nullptr));
|
mDBMessageNbSignalsLbl->setText(QCoreApplication::translate("CProgramSettingsPage", "Number of signals: ", nullptr));
|
||||||
mDBMessageNameLbl_2->setText(QCoreApplication::translate("CProgramSettingsPage", "Messages", nullptr));
|
mDBMessageNameLbl_2->setText(QCoreApplication::translate("CProgramSettingsPage", "Messages", nullptr));
|
||||||
|
mAddDeviceBtn->setText(QCoreApplication::translate("CProgramSettingsPage", "Ajouter", nullptr));
|
||||||
|
mDeleteDeviceBtn->setText(QCoreApplication::translate("CProgramSettingsPage", "Supprimer", nullptr));
|
||||||
} // retranslateUi
|
} // retranslateUi
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user