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/CANDevice.cpp \
|
||||
Sources/CANSignal.cpp \
|
||||
Sources/SystemConfig.cpp
|
||||
Sources/SystemConfig.cpp \
|
||||
Sources/CANDeviceConfig.cpp
|
||||
|
||||
HEADERS += Sources/MainWindow.h \
|
||||
Sources/PCANInterface.h \
|
||||
@ -60,7 +61,8 @@ HEADERS += Sources/MainWindow.h \
|
||||
Sources/CANDatabase/CANDatabase.h \
|
||||
Sources/CANDevice.h \
|
||||
Sources/CANSignal.h \
|
||||
Sources/SystemConfig.h
|
||||
Sources/SystemConfig.h \
|
||||
Sources/CANDeviceConfig.h
|
||||
|
||||
FORMS += Sources/Gui/MainWindow.ui \
|
||||
Sources/Gui/GeneralStatusPage.ui \
|
||||
|
||||
@ -1,32 +1,39 @@
|
||||
#include "CANDevice.h"
|
||||
#include "OtarcikCan.h"
|
||||
|
||||
|
||||
|
||||
CCANDevice::CCANDevice(QObject *parent)
|
||||
{
|
||||
Q_UNUSED(parent)
|
||||
|
||||
mMessageList.clear();
|
||||
mMessagesListLoaded = false;
|
||||
mCANAnalyzer.mDevicePtr = this;
|
||||
mProgramPtr = 0;
|
||||
mCANDeviceDatabaseFilename.clear();
|
||||
mCANDeviceID = -1;
|
||||
mCANDeviceBaudrate = -1;
|
||||
mDeviceDescription.clear();
|
||||
mDeviceName.clear();
|
||||
mDevicePollPeriod = 0;
|
||||
// mCANDeviceDatabaseFilename.clear();
|
||||
// mCANDeviceID = -1;
|
||||
// mCANDeviceBaudrate = -1;
|
||||
// mDeviceDescription.clear();
|
||||
// mDeviceName.clear();
|
||||
// mDevicePollPeriod = 0;
|
||||
}
|
||||
|
||||
CCANDevice::CCANDevice(CCANDevice &Other)
|
||||
CCANDevice::CCANDevice(CCANDeviceConfig &SysConfig)
|
||||
{
|
||||
mMessageList.clear();
|
||||
mMessagesListLoaded = false;
|
||||
mCANAnalyzer.mDevicePtr = this;
|
||||
mProgramPtr = 0;
|
||||
|
||||
mCANDeviceID = Other.mCANDeviceID;
|
||||
mCANDeviceBaudrate = Other.mCANDeviceBaudrate;
|
||||
mCANDeviceDatabaseFilename = Other.mCANDeviceDatabaseFilename;
|
||||
mDeviceName = Other.mDeviceName;
|
||||
mDeviceDescription = Other.mDeviceDescription;
|
||||
mDeviceConfigInfo = SysConfig;
|
||||
|
||||
// mCANDeviceID = SysConfig.mCANDeviceID;
|
||||
// mCANDeviceBaudrate = SysConfig.mCANDeviceBaudrate;
|
||||
// mCANDeviceDatabaseFilename = SysConfig.mCANDeviceDatabaseFilename;
|
||||
// mDeviceName = SysConfig.mDeviceName;
|
||||
// mDeviceDescription = SysConfig.mDeviceDescription;
|
||||
// mDevicePollPeriod = SysConfig.mDevicePollPeriod;
|
||||
}
|
||||
|
||||
CCANDevice::~CCANDevice()
|
||||
@ -39,15 +46,15 @@ CCANDevice::~CCANDevice()
|
||||
|
||||
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");
|
||||
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)
|
||||
{
|
||||
@ -59,24 +66,24 @@ int CCANDevice::Init()
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
int CCANDevice::Init(QString DatabaseFileName, TPCANHandle CANDeviceID, TPCANBaudrate CANDeviceBaudRate, QString DevDescription, QString DeviceName, unsigned int DevicePollPeriod)
|
||||
{
|
||||
mCANDeviceID = CANDeviceID;
|
||||
mCANDeviceBaudrate = CANDeviceBaudRate;
|
||||
mCANDeviceDatabaseFilename = DatabaseFileName;
|
||||
mDeviceDescription = DevDescription;
|
||||
mDeviceName = DeviceName;
|
||||
mDevicePollPeriod = DevicePollPeriod;
|
||||
mDeviceConfigInfo.mCANDeviceID = CANDeviceID;
|
||||
mDeviceConfigInfo.mCANDeviceBaudrate = CANDeviceBaudRate;
|
||||
mDeviceConfigInfo.mCANDeviceDatabaseFilename = DatabaseFileName;
|
||||
mDeviceConfigInfo.mDeviceDescription = DevDescription;
|
||||
mDeviceConfigInfo.mDeviceName = DeviceName;
|
||||
mDeviceConfigInfo.mDevicePollPeriod = DevicePollPeriod;
|
||||
|
||||
Init();
|
||||
|
||||
@ -85,7 +92,7 @@ int CCANDevice::Init(QString DatabaseFileName, TPCANHandle CANDeviceID, TPCANBau
|
||||
|
||||
int CCANDevice::NewMessageParsed()
|
||||
{
|
||||
mProgramPtr->UpdateCANViewerDataRequest(&mMessageList);
|
||||
return mProgramPtr->UpdateCANViewerDataRequest(&mMessageList);
|
||||
}
|
||||
|
||||
|
||||
@ -94,41 +101,25 @@ int CCANDevice::NewMessageParsed()
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const CCANDevice &source)
|
||||
{
|
||||
out << source.mCANDeviceID
|
||||
<< source.mCANDeviceBaudrate
|
||||
<< source.mCANDeviceDatabaseFilename
|
||||
<< source.mDeviceDescription
|
||||
<< source.mDeviceName
|
||||
<< source.mDevicePollPeriod;
|
||||
out << source.mDeviceConfigInfo;
|
||||
return out;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &in, CCANDevice &dest)
|
||||
{
|
||||
in >> dest.mCANDeviceID
|
||||
>> dest.mCANDeviceBaudrate
|
||||
>> dest.mCANDeviceDatabaseFilename
|
||||
>> dest.mDeviceDescription
|
||||
>> dest.mDeviceName
|
||||
>> dest.mDevicePollPeriod;
|
||||
|
||||
in >> dest.mDeviceConfigInfo;
|
||||
return in;
|
||||
}
|
||||
|
||||
//CAREFUL!!! OPERATOR = DOES NOT COPY THE MESSAGES, ONLY THE DEVICE DESCRIPTION !!//
|
||||
CCANDevice& CCANDevice::operator=(const CCANDevice *source)
|
||||
{
|
||||
if(source == this)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
////CAREFUL!!! OPERATOR = DOES NOT COPY THE MESSAGES, ONLY THE DEVICE DESCRIPTION !!//
|
||||
//CCANDevice& CCANDevice::operator=(const CCANDevice *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;
|
||||
// this->mDeviceConfigInfo = source->mDeviceConfigInfo;
|
||||
|
||||
return *this;
|
||||
}
|
||||
// return *this;
|
||||
//}
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
#include "CANDatabase.h"
|
||||
#include <QList>
|
||||
#include "PCANBasic.h"
|
||||
#include "CANDeviceConfig.h"
|
||||
|
||||
class COtarcikCan;
|
||||
|
||||
@ -17,28 +18,23 @@ class CCANDevice : public QObject
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CCANDevice(QObject *parent = 0);
|
||||
CCANDevice(CCANDevice &Other);
|
||||
CCANDevice(CCANDeviceConfig &SysConfig);
|
||||
~CCANDevice();
|
||||
|
||||
int Init(QString DatabaseFileName, TPCANHandle CANDeviceID, TPCANBaudrate CANDeviceBaudRate, QString DevDescription, QString DeviceName, unsigned int DevicePollPeriod);
|
||||
int Init();
|
||||
|
||||
public:
|
||||
TPCANHandle mCANDeviceID;
|
||||
TPCANBaudrate mCANDeviceBaudrate;
|
||||
QString mCANDeviceDatabaseFilename;
|
||||
QString mDeviceDescription;
|
||||
QString mDeviceName;
|
||||
COtarcikCan *mProgramPtr;
|
||||
unsigned int mDevicePollPeriod;
|
||||
CCANDeviceConfig mDeviceConfigInfo;
|
||||
|
||||
COtarcikCan *mProgramPtr;
|
||||
bool mMessagesListLoaded;
|
||||
CCANAnalyzer mCANAnalyzer; //The module that handles the USB puck and decodes the data
|
||||
CCANDatabase mCANDatabase; //The device's database loaded from dbc file
|
||||
|
||||
QList<CCANMessage*> mMessageList;
|
||||
|
||||
CCANDevice &operator=(const CCANDevice *source);
|
||||
// CCANDevice &operator=(const CCANDevice *source);
|
||||
|
||||
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 "ui_GeneralStatusPage.h"
|
||||
#include "QStringList"
|
||||
#include <QScrollBar>
|
||||
|
||||
CGeneralStatusPage::CGeneralStatusPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
@ -8,6 +9,7 @@ CGeneralStatusPage::CGeneralStatusPage(QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->mClearGenMsgTxtBtn,&QPushButton::clicked,this,&CGeneralStatusPage::ClearGenMsgAreaBtnPressed);
|
||||
}
|
||||
|
||||
CGeneralStatusPage::~CGeneralStatusPage()
|
||||
@ -43,6 +45,10 @@ int CGeneralStatusPage::AddGeneralMsgBoxLineEntry(QString 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;
|
||||
|
||||
}
|
||||
|
||||
void CGeneralStatusPage::ClearGenMsgAreaBtnPressed()
|
||||
{
|
||||
mGenMsgListBoxTextLines.clear();
|
||||
ui->mGenMsgTextEdit->clear();
|
||||
}
|
||||
|
||||
@ -38,6 +38,9 @@ private:
|
||||
|
||||
int AddColoredLineToGenMsgBox(QString Line);
|
||||
|
||||
public slots:
|
||||
void ClearGenMsgAreaBtnPressed();
|
||||
|
||||
};
|
||||
|
||||
#endif // GENERALSTATUSPAGE_H
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1456</width>
|
||||
<height>492</height>
|
||||
<height>527</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -16,9 +16,9 @@
|
||||
<widget class="QTextEdit" name="mGenMsgTextEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>460</x>
|
||||
<y>30</y>
|
||||
<width>651</width>
|
||||
<x>30</x>
|
||||
<y>20</y>
|
||||
<width>1141</width>
|
||||
<height>451</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -34,6 +34,19 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</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>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
@ -2,9 +2,10 @@
|
||||
#include "ui_ProgramSettingsPage.h"
|
||||
|
||||
#include "CANDevice.h"
|
||||
#include "OtarcikCan.h"
|
||||
#include <QFileDialog>
|
||||
#include <QFileInfo>
|
||||
#include "SystemConfig.h"
|
||||
#include "OtarcikCan.h"
|
||||
|
||||
|
||||
CProgramSettingsPage::CProgramSettingsPage(QWidget *parent) :
|
||||
@ -15,6 +16,7 @@ CProgramSettingsPage::CProgramSettingsPage(QWidget *parent) :
|
||||
|
||||
mProgramPtr = 0;
|
||||
mDevicesList = 0;
|
||||
mCurModifiedDevConfig = 0;
|
||||
mDeviceChangeModeEnabled = false;
|
||||
|
||||
ui->mDBSignalDetailsTable->setColumnCount(10);
|
||||
@ -72,6 +74,8 @@ CProgramSettingsPage::CProgramSettingsPage(QWidget *parent) :
|
||||
connect(ui->mModifyDevParamsBtn,&QPushButton::clicked,this,&CProgramSettingsPage::ModifyDeviceBtnPressed);
|
||||
connect(ui->mCancelModifyParamsBtn,&QPushButton::clicked,this,&CProgramSettingsPage::CancelModifyDevBtnPressed);
|
||||
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);
|
||||
|
||||
@ -79,6 +83,11 @@ CProgramSettingsPage::CProgramSettingsPage(QWidget *parent) :
|
||||
|
||||
CProgramSettingsPage::~CProgramSettingsPage()
|
||||
{
|
||||
while(!mDeviceConfigList.isEmpty())
|
||||
{
|
||||
delete mDeviceConfigList.takeFirst();
|
||||
}
|
||||
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@ -99,7 +108,7 @@ int CProgramSettingsPage::SetDevicesList(QList<CCANDevice *> *DevicesList)
|
||||
ui->mDevicesList->clear();
|
||||
for(int i = 0; i < mDevicesList->size(); i++)
|
||||
{
|
||||
QString name = mDevicesList->at(i)->mDeviceName;
|
||||
QString name = mDevicesList->at(i)->mDeviceConfigInfo.mDeviceName;
|
||||
if(name.isEmpty())
|
||||
{
|
||||
name = QString("Device %1").arg(i+1);
|
||||
@ -133,20 +142,21 @@ int CProgramSettingsPage::UpdatePage()
|
||||
|
||||
if(Device != 0)
|
||||
{
|
||||
CCANDeviceConfig *DevConfigInfo = &Device->mDeviceConfigInfo;
|
||||
//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
|
||||
ui->mDeviceNameEditBx->setPlainText(Device->mDeviceName);
|
||||
ui->mCANBaudrateComboBx->setCurrentIndex(ui->mCANBaudrateComboBx->findData(Device->mCANDeviceBaudrate));
|
||||
ui->mCANIDComboBx->setCurrentIndex(ui->mCANIDComboBx->findData(Device->mCANDeviceID));
|
||||
ui->mDeviceDescriptionTxtEdit->setPlainText(Device->mDeviceDescription);
|
||||
ui->mDeviceNameEditBx->setPlainText(DevConfigInfo->mDeviceName);
|
||||
ui->mCANBaudrateComboBx->setCurrentIndex(ui->mCANBaudrateComboBx->findData(DevConfigInfo->mCANDeviceBaudrate));
|
||||
ui->mCANIDComboBx->setCurrentIndex(ui->mCANIDComboBx->findData(DevConfigInfo->mCANDeviceID));
|
||||
ui->mDeviceDescriptionTxtEdit->setPlainText(DevConfigInfo->mDeviceDescription);
|
||||
|
||||
QFileInfo FileInfo(Device->mCANDeviceDatabaseFilename);
|
||||
QFileInfo FileInfo(DevConfigInfo->mCANDeviceDatabaseFilename);
|
||||
ui->mDatabaseFileNameLbl->setText(FileInfo.fileName());
|
||||
ui->mDatabaseFileNameLbl->setToolTip(Device->mCANDeviceDatabaseFilename);
|
||||
ui->mDatabaseFileNameLbl->setToolTip(DevConfigInfo->mCANDeviceDatabaseFilename);
|
||||
// ui->mDatabaseFileNameLbl->setText(QString("%1").arg(Device->mCANDeviceDatabaseFilename));
|
||||
|
||||
ui->mDevicePollPeriodSpinBx->setValue(Device->mDevicePollPeriod);
|
||||
ui->mDevicePollPeriodSpinBx->setValue(DevConfigInfo->mDevicePollPeriod);
|
||||
//update device database information
|
||||
ui->mDBMessagesListWidget->clear();
|
||||
ui->mDBSignalDetailsTable->clearContents();
|
||||
@ -173,7 +183,7 @@ int CProgramSettingsPage::UpdatePage()
|
||||
|
||||
|
||||
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CProgramSettingsPage::UpdateMessageInformation()
|
||||
@ -302,6 +312,8 @@ int CProgramSettingsPage::UpdateMessageInformation()
|
||||
}
|
||||
ui->mDBSignalDetailsTable->resizeColumnsToContents();
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
void CProgramSettingsPage::DeviceSelectionChanged()
|
||||
@ -318,17 +330,34 @@ void CProgramSettingsPage::MessageSelectionChanged()
|
||||
{
|
||||
UpdateMessageInformation();
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
//Save Data
|
||||
|
||||
int index = ui->mDevicesList->currentRow();
|
||||
if(index >= 0 && index < mDevicesList->size())
|
||||
if(mCurModifiedDevConfig != 0)
|
||||
{
|
||||
CCANDevice *ModifiedDevice = mDevicesList->at(index);
|
||||
CCANDeviceConfig *ModifiedDevice = mCurModifiedDevConfig; //mDeviceConfigList.at(index);
|
||||
|
||||
ModifiedDevice->mCANDeviceBaudrate = ui->mCANBaudrateComboBx->currentData().toInt();
|
||||
ModifiedDevice->mCANDeviceID = ui->mCANIDComboBx->currentData().toInt();
|
||||
@ -337,7 +366,7 @@ void CProgramSettingsPage::ModifyDeviceBtnPressed()
|
||||
ModifiedDevice->mDeviceName = ui->mDeviceNameEditBx->toPlainText();
|
||||
ModifiedDevice->mDevicePollPeriod = ui->mDevicePollPeriodSpinBx->value();
|
||||
|
||||
mProgramPtr->SaveSystemConfigRequest();
|
||||
mProgramPtr->SaveSystemConfigRequest(&mDeviceConfigList);
|
||||
}
|
||||
|
||||
|
||||
@ -352,12 +381,14 @@ void CProgramSettingsPage::ModifyDeviceBtnPressed()
|
||||
ui->mCancelModifyParamsBtn->hide();
|
||||
ui->mDeviceNameEditBx->setEnabled(false);
|
||||
mDeviceChangeModeEnabled = false;
|
||||
ui->mAddDeviceBtn->setEnabled(true);
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//Modify data
|
||||
ui->mDeviceDescriptionTxtEdit->setEnabled(true);
|
||||
ui->mDatabaseFileSelectBtn->show();
|
||||
@ -368,9 +399,12 @@ void CProgramSettingsPage::ModifyDeviceBtnPressed()
|
||||
ui->mModifyDevParamsBtn->setText("Sauvegarder");
|
||||
ui->mCancelModifyParamsBtn->show();
|
||||
ui->mDeviceNameEditBx->setEnabled(true);
|
||||
ui->mAddDeviceBtn->setEnabled(true);
|
||||
|
||||
mDeviceChangeModeEnabled = true;
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
void CProgramSettingsPage::CancelModifyDevBtnPressed()
|
||||
@ -384,6 +418,7 @@ void CProgramSettingsPage::CancelModifyDevBtnPressed()
|
||||
ui->mModifyDevParamsBtn->setText("Modifier");
|
||||
ui->mCancelModifyParamsBtn->hide();
|
||||
ui->mDeviceNameEditBx->setEnabled(false);
|
||||
ui->mAddDeviceBtn->setEnabled(true);
|
||||
mDeviceChangeModeEnabled = false;
|
||||
|
||||
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 CCANSignal;
|
||||
class COtarcikCan;
|
||||
class CCANDeviceConfig;
|
||||
|
||||
|
||||
namespace Ui {
|
||||
@ -25,14 +26,19 @@ public:
|
||||
int ClearDatabaseData();
|
||||
int UpdatePage();
|
||||
int UpdateMessageInformation();
|
||||
int ModifyDeviceConfig();
|
||||
|
||||
|
||||
COtarcikCan *mProgramPtr;
|
||||
|
||||
private:
|
||||
Ui::CProgramSettingsPage *ui;
|
||||
QList<CCANDevice *> *mDevicesList;
|
||||
const QList<CCANDevice *> *mDevicesList;
|
||||
QList<CCANDeviceConfig*> mDeviceConfigList;
|
||||
bool mDeviceChangeModeEnabled;
|
||||
CCANDeviceConfig* mCurModifiedDevConfig;
|
||||
|
||||
int PopulateDevicesConfigList();
|
||||
|
||||
public slots:
|
||||
void DeviceSelectionChanged();
|
||||
@ -41,6 +47,9 @@ public slots:
|
||||
void ModifyDeviceBtnPressed();
|
||||
void CancelModifyDevBtnPressed();
|
||||
void SelectDBFileBtnPressed();
|
||||
void AddDeviceBtnPressed();
|
||||
void DeleteDeviceBtnPressed();
|
||||
|
||||
};
|
||||
|
||||
#endif // PROGRAMSETTINGSPAGE_H
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1475</width>
|
||||
<height>604</height>
|
||||
<height>693</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -377,6 +377,32 @@
|
||||
</property>
|
||||
</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>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
COtarcikCan::COtarcikCan(QObject *parent) : QObject(parent)
|
||||
{
|
||||
mMainWindow.mProgramSettingsPage->mProgramPtr = this;
|
||||
|
||||
}
|
||||
|
||||
COtarcikCan::~COtarcikCan()
|
||||
@ -36,8 +36,10 @@ COtarcikCan::~COtarcikCan()
|
||||
|
||||
int COtarcikCan::Start()
|
||||
{
|
||||
mMainWindow.show();
|
||||
|
||||
mMainWindow.mProgramSettingsPage->mProgramPtr = this;
|
||||
|
||||
mMainWindow.show();
|
||||
|
||||
|
||||
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);
|
||||
// SaveSystemConfigRequest();
|
||||
|
||||
// mMainWindow.mProgramSettingsPage->SetDevicesList(&mCANDevicesList);
|
||||
mMainWindow.mProgramSettingsPage->SetDevicesList(&mCANDevicesList);
|
||||
|
||||
// NewCANDevice = new CCANDevice();
|
||||
// mCANDevicesList.append(NewCANDevice);
|
||||
@ -93,10 +95,10 @@ int COtarcikCan::InitCANViewer(QList<CCANMessage *> *MsgList)
|
||||
|
||||
//The device configuration has been modified directly in the master list
|
||||
//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();
|
||||
|
||||
@ -118,5 +120,10 @@ int COtarcikCan::SaveSystemConfigRequest()
|
||||
mMainWindow.mProgramSettingsPage->SetDevicesList(&mCANDevicesList);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return RET_GENERAL_ERROR;
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ public:
|
||||
int UpdateCANViewerDataRequest(QList<CCANMessage *> *MsgList);
|
||||
|
||||
|
||||
int SaveSystemConfigRequest();
|
||||
int SaveSystemConfigRequest(QList<CCANDeviceConfig*> *DevicesConfigList);
|
||||
|
||||
private:
|
||||
QList<CCANDevice*> mCANDevicesList;
|
||||
|
||||
@ -22,8 +22,6 @@ int CSystemConfig::LoadConfig(QList<CCANDevice *> *DevicesList)
|
||||
{
|
||||
if(ConfigFile->open(QIODevice::ReadOnly | QIODevice::Unbuffered) == false)
|
||||
{
|
||||
// LoadDefaultSettings(Settings);
|
||||
// SaveSettings(Settings);
|
||||
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);
|
||||
return RET_GENERAL_ERROR;
|
||||
@ -31,7 +29,6 @@ int CSystemConfig::LoadConfig(QList<CCANDevice *> *DevicesList)
|
||||
}
|
||||
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);
|
||||
qDebug("CSystemConfig: Invalid QFile pointer in config loading...");
|
||||
return RET_GENERAL_ERROR;
|
||||
@ -46,7 +43,6 @@ int CSystemConfig::LoadConfig(QList<CCANDevice *> *DevicesList)
|
||||
*InputStream >> MagicNbr;
|
||||
if(MagicNbr != OTARCIK_CONFIG_FILE_MAGIC_NBR)
|
||||
{
|
||||
// LoadDefaultSettings(Settings);
|
||||
return RET_GENERAL_ERROR;
|
||||
}
|
||||
|
||||
@ -56,9 +52,9 @@ int CSystemConfig::LoadConfig(QList<CCANDevice *> *DevicesList)
|
||||
*InputStream >> NbDevices;
|
||||
for(int i = 0; i < NbDevices; i++)
|
||||
{
|
||||
CCANDevice *NewDevice = new CCANDevice;
|
||||
*InputStream >> *NewDevice;
|
||||
DevicesList->append(NewDevice);
|
||||
CCANDeviceConfig NewDeviceConfig;
|
||||
*InputStream >> NewDeviceConfig;
|
||||
DevicesList->append(new CCANDevice(NewDeviceConfig));
|
||||
}
|
||||
|
||||
|
||||
@ -70,8 +66,13 @@ int CSystemConfig::LoadConfig(QList<CCANDevice *> *DevicesList)
|
||||
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..."));
|
||||
|
||||
QFile *ConfigFile = new QFile("./Config/Station.cfg");
|
||||
@ -100,10 +101,10 @@ int CSystemConfig::SaveConfig(QList<CCANDevice *> *DevicesList)
|
||||
*OutputStream << FileVersion;
|
||||
|
||||
//Save the CAN devices config info
|
||||
*OutputStream << DevicesList->size(); //Number of devices
|
||||
for(int i = 0; i < DevicesList->size(); i++)
|
||||
*OutputStream << DevicesConfigList->size(); //Number of devices
|
||||
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();
|
||||
@ -116,3 +117,10 @@ int CSystemConfig::SaveConfig(QList<CCANDevice *> *DevicesList)
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
////////////Class CCANDeviceConfig implementation ////////////
|
||||
|
||||
|
||||
@ -5,9 +5,11 @@
|
||||
#include <QList>
|
||||
#include <QFile>
|
||||
#include <QDataStream>
|
||||
#include "CANDeviceConfig.h"
|
||||
|
||||
#define OTARCIK_CURRENT_CONFIG_FILE_VERSION 0x01
|
||||
#define OTARCIK_CONFIG_FILE_MAGIC_NBR 0xDEADBEEF
|
||||
//class CCANDeviceConfig;
|
||||
|
||||
class CSystemConfig
|
||||
{
|
||||
@ -15,8 +17,10 @@ public:
|
||||
CSystemConfig();
|
||||
|
||||
int LoadConfig(QList<CCANDevice*> *DevicesList);
|
||||
int SaveConfig(QList<CCANDevice*> *DevicesList);
|
||||
int SaveConfig(QList<CCANDeviceConfig*> *DevicesConfigList);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // SYSTEMCONFIG_H
|
||||
|
||||
Binary file not shown.
@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_DEPRECATED
|
||||
struct qt_meta_stringdata_CGeneralStatusPage_t {
|
||||
QByteArrayData data[1];
|
||||
char stringdata0[19];
|
||||
QByteArrayData data[3];
|
||||
char stringdata0[46];
|
||||
};
|
||||
#define QT_MOC_LITERAL(idx, ofs, 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 = {
|
||||
{
|
||||
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
|
||||
|
||||
@ -45,21 +48,32 @@ static const uint qt_meta_data_CGeneralStatusPage[] = {
|
||||
8, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
0, 0, // methods
|
||||
1, 14, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
0, 0, // constructors
|
||||
0, // flags
|
||||
0, // signalCount
|
||||
|
||||
// slots: name, argc, parameters, tag, flags
|
||||
1, 0, 19, 2, 0x0a /* Public */,
|
||||
|
||||
// slots: parameters
|
||||
QMetaType::Void,
|
||||
|
||||
0 // eod
|
||||
};
|
||||
|
||||
void CGeneralStatusPage::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
Q_UNUSED(_o);
|
||||
Q_UNUSED(_id);
|
||||
Q_UNUSED(_c);
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
auto *_t = static_cast<CGeneralStatusPage *>(_o);
|
||||
Q_UNUSED(_t)
|
||||
switch (_id) {
|
||||
case 0: _t->ClearGenMsgAreaBtnPressed(); break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
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)
|
||||
{
|
||||
_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;
|
||||
}
|
||||
QT_WARNING_POP
|
||||
|
||||
@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_DEPRECATED
|
||||
struct qt_meta_stringdata_CProgramSettingsPage_t {
|
||||
QByteArrayData data[8];
|
||||
char stringdata0[164];
|
||||
QByteArrayData data[10];
|
||||
char stringdata0[207];
|
||||
};
|
||||
#define QT_MOC_LITERAL(idx, ofs, 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(5, 92, 22), // "ModifyDeviceBtnPressed"
|
||||
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"
|
||||
"\0SignalSelectionChanged\0MessageSelectionChanged\0"
|
||||
"ModifyDeviceBtnPressed\0CancelModifyDevBtnPressed\0"
|
||||
"SelectDBFileBtnPressed"
|
||||
"SelectDBFileBtnPressed\0AddDeviceBtnPressed\0"
|
||||
"DeleteDeviceBtnPressed"
|
||||
};
|
||||
#undef QT_MOC_LITERAL
|
||||
|
||||
@ -55,7 +58,7 @@ static const uint qt_meta_data_CProgramSettingsPage[] = {
|
||||
8, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
6, 14, // methods
|
||||
8, 14, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
0, 0, // constructors
|
||||
@ -63,12 +66,14 @@ static const uint qt_meta_data_CProgramSettingsPage[] = {
|
||||
0, // signalCount
|
||||
|
||||
// slots: name, argc, parameters, tag, flags
|
||||
1, 0, 44, 2, 0x0a /* Public */,
|
||||
3, 0, 45, 2, 0x0a /* Public */,
|
||||
4, 0, 46, 2, 0x0a /* Public */,
|
||||
5, 0, 47, 2, 0x0a /* Public */,
|
||||
6, 0, 48, 2, 0x0a /* Public */,
|
||||
7, 0, 49, 2, 0x0a /* Public */,
|
||||
1, 0, 54, 2, 0x0a /* Public */,
|
||||
3, 0, 55, 2, 0x0a /* Public */,
|
||||
4, 0, 56, 2, 0x0a /* Public */,
|
||||
5, 0, 57, 2, 0x0a /* Public */,
|
||||
6, 0, 58, 2, 0x0a /* Public */,
|
||||
7, 0, 59, 2, 0x0a /* Public */,
|
||||
8, 0, 60, 2, 0x0a /* Public */,
|
||||
9, 0, 61, 2, 0x0a /* Public */,
|
||||
|
||||
// slots: parameters
|
||||
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,
|
||||
|
||||
0 // eod
|
||||
@ -93,6 +100,8 @@ void CProgramSettingsPage::qt_static_metacall(QObject *_o, QMetaObject::Call _c,
|
||||
case 3: _t->ModifyDeviceBtnPressed(); break;
|
||||
case 4: _t->CancelModifyDevBtnPressed(); break;
|
||||
case 5: _t->SelectDBFileBtnPressed(); break;
|
||||
case 6: _t->AddDeviceBtnPressed(); break;
|
||||
case 7: _t->DeleteDeviceBtnPressed(); break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
@ -128,13 +137,13 @@ int CProgramSettingsPage::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
if (_id < 6)
|
||||
if (_id < 8)
|
||||
qt_static_metacall(this, _c, _id, _a);
|
||||
_id -= 6;
|
||||
_id -= 8;
|
||||
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
|
||||
if (_id < 6)
|
||||
if (_id < 8)
|
||||
*reinterpret_cast<int*>(_a[0]) = -1;
|
||||
_id -= 6;
|
||||
_id -= 8;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ debug/CANDatabase.o
|
||||
debug/CANDevice.o
|
||||
debug/CANSignal.o
|
||||
debug/SystemConfig.o
|
||||
debug/CANDeviceConfig.o
|
||||
debug/moc_MainWindow.o
|
||||
debug/moc_PCANInterface.o
|
||||
debug/moc_OtarcikCan.o
|
||||
|
||||
@ -12,6 +12,7 @@ release/CANDatabase.o
|
||||
release/CANDevice.o
|
||||
release/CANSignal.o
|
||||
release/SystemConfig.o
|
||||
release/CANDeviceConfig.o
|
||||
release/moc_MainWindow.o
|
||||
release/moc_PCANInterface.o
|
||||
release/moc_OtarcikCan.o
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QPushButton>
|
||||
#include <QtWidgets/QTextEdit>
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
@ -20,15 +21,16 @@ class Ui_CGeneralStatusPage
|
||||
{
|
||||
public:
|
||||
QTextEdit *mGenMsgTextEdit;
|
||||
QPushButton *mClearGenMsgTxtBtn;
|
||||
|
||||
void setupUi(QWidget *CGeneralStatusPage)
|
||||
{
|
||||
if (CGeneralStatusPage->objectName().isEmpty())
|
||||
CGeneralStatusPage->setObjectName(QString::fromUtf8("CGeneralStatusPage"));
|
||||
CGeneralStatusPage->resize(1456, 492);
|
||||
CGeneralStatusPage->resize(1456, 527);
|
||||
mGenMsgTextEdit = new QTextEdit(CGeneralStatusPage);
|
||||
mGenMsgTextEdit->setObjectName(QString::fromUtf8("mGenMsgTextEdit"));
|
||||
mGenMsgTextEdit->setGeometry(QRect(460, 30, 651, 451));
|
||||
mGenMsgTextEdit->setGeometry(QRect(30, 20, 1141, 451));
|
||||
QFont font;
|
||||
font.setFamily(QString::fromUtf8("System"));
|
||||
font.setPointSize(12);
|
||||
@ -36,6 +38,9 @@ public:
|
||||
font.setWeight(75);
|
||||
mGenMsgTextEdit->setFont(font);
|
||||
mGenMsgTextEdit->setReadOnly(true);
|
||||
mClearGenMsgTxtBtn = new QPushButton(CGeneralStatusPage);
|
||||
mClearGenMsgTxtBtn->setObjectName(QString::fromUtf8("mClearGenMsgTxtBtn"));
|
||||
mClearGenMsgTxtBtn->setGeometry(QRect(30, 480, 80, 22));
|
||||
|
||||
retranslateUi(CGeneralStatusPage);
|
||||
|
||||
@ -45,6 +50,7 @@ public:
|
||||
void retranslateUi(QWidget *CGeneralStatusPage)
|
||||
{
|
||||
CGeneralStatusPage->setWindowTitle(QCoreApplication::translate("CGeneralStatusPage", "Form", nullptr));
|
||||
mClearGenMsgTxtBtn->setText(QCoreApplication::translate("CGeneralStatusPage", "Nettoyer", nullptr));
|
||||
} // retranslateUi
|
||||
|
||||
};
|
||||
|
||||
@ -53,6 +53,8 @@ public:
|
||||
QListWidget *mDBMessagesListWidget;
|
||||
QLabel *mDBMessageNameLbl_2;
|
||||
QTableWidget *mDBSignalDetailsTable;
|
||||
QPushButton *mAddDeviceBtn;
|
||||
QPushButton *mDeleteDeviceBtn;
|
||||
|
||||
void setupUi(QWidget *CProgramSettingsPage)
|
||||
{
|
||||
@ -157,6 +159,12 @@ public:
|
||||
mDBSignalDetailsTable = new QTableWidget(mDatabaseGroupBox);
|
||||
mDBSignalDetailsTable->setObjectName(QString::fromUtf8("mDBSignalDetailsTable"));
|
||||
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);
|
||||
|
||||
@ -183,6 +191,8 @@ public:
|
||||
mDBMessageLengthLbl->setText(QCoreApplication::translate("CProgramSettingsPage", "Message Length", nullptr));
|
||||
mDBMessageNbSignalsLbl->setText(QCoreApplication::translate("CProgramSettingsPage", "Number of signals: ", nullptr));
|
||||
mDBMessageNameLbl_2->setText(QCoreApplication::translate("CProgramSettingsPage", "Messages", nullptr));
|
||||
mAddDeviceBtn->setText(QCoreApplication::translate("CProgramSettingsPage", "Ajouter", nullptr));
|
||||
mDeleteDeviceBtn->setText(QCoreApplication::translate("CProgramSettingsPage", "Supprimer", nullptr));
|
||||
} // retranslateUi
|
||||
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user