Ajout du support pour les fichiers CAN database .dbc

Ajout shortcut pour RDP vers le PC dans le champs
This commit is contained in:
2023-01-09 16:45:23 -05:00
parent c888a889f2
commit 087245571a
47 changed files with 7885 additions and 692 deletions
+62 -2
View File
@@ -1,11 +1,13 @@
#include "GeneralStatusPage.h"
#include "ui_GeneralStatusPage.h"
#include "QStringList"
CGeneralStatusPage::CGeneralStatusPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::CGeneralStatusPage)
{
ui->setupUi(this);
}
CGeneralStatusPage::~CGeneralStatusPage()
@@ -13,8 +15,66 @@ CGeneralStatusPage::~CGeneralStatusPage()
delete ui;
}
int CGeneralStatusPage::SetGeneralMsgText(QString Txt)
int CGeneralStatusPage::SetGeneralMsgText(QStringList Txt)
{
ui->mGenMsgTextEdit->setText(Txt);
/*if you're populating the text box programatically, is to use textEdit->setTextColor(QColor&).You can create the QColor object yourself, or use one of the predefined colours in the Qt namespace (Qt::black, Qt::red, etc). It will apply the specified colour to any text you add, until it is called again with a different one.*/
return RET_OK;
}
int CGeneralStatusPage::AddGeneralMsgBoxLineEntry(QString LineTxt)
{
//Limit the number of lines in the MsgBox to avoid overruns...
if(mGenMsgListBoxTextLines.size() >= GENERAL_MESSAGES_MAX_LOG_LINES)
{
mGenMsgListBoxTextLines.removeFirst();
mGenMsgListBoxTextLines.append(LineTxt);
ui->mGenMsgTextEdit->clear();
for(int i = 0; i < mGenMsgListBoxTextLines.size(); i++)
{
AddColoredLineToGenMsgBox(mGenMsgListBoxTextLines[i]);
}
}
else
{
mGenMsgListBoxTextLines.append(LineTxt);
AddColoredLineToGenMsgBox(LineTxt);
}
}
int CGeneralStatusPage::AddColoredLineToGenMsgBox(QString Line)
{
if(Line.isEmpty())
{
return RET_GENERAL_ERROR;
}
if(Line.at(0) == QChar('%'))
{
if(Line.at(1) == QChar('E')) //The line is describing an error... write it red
{
ui->mGenMsgTextEdit->setTextColor(Qt::red);
}
else if(Line.at(1) == QChar('W')) //The line is describing a warning... write it yellow
{
ui->mGenMsgTextEdit->setTextColor(Qt::blue);
}
else
{
qDebug("GeneralStatusPage: Logic error in general message box line encoding... you should check into that");
return RET_GENERAL_ERROR;
}
Line.remove(0,2);
}
ui->mGenMsgTextEdit->insertPlainText(Line);
ui->mGenMsgTextEdit->setTextColor(Qt::black);
return RET_OK;
}
+17 -1
View File
@@ -14,14 +14,30 @@ class CGeneralStatusPage : public QWidget
Q_OBJECT
public:
enum eGeneralStatusPgTxtErrorValue
{
GEN_STATUS_PG_NO_ERROR_TEXT_VALUE = 0,
GEN_STATUS_PG_WARNING_TEXT_VALUE,
GEN_STATUS_PG_ERROR_TEXT_VALUE,
GEN_STATUS_PG_MAX_TEXT_VALUE
};
explicit CGeneralStatusPage(QWidget *parent = 0);
~CGeneralStatusPage();
int SetGeneralMsgText(QString Txt);
int SetGeneralMsgText(QStringList Txt);
int AddGeneralMsgBoxLineEntry(QString LineTxt);
private:
Ui::CGeneralStatusPage *ui;
QStringList mGenMsgListBoxTextLines;
int AddColoredLineToGenMsgBox(QString Line);
};
#endif // GENERALSTATUSPAGE_H
+6 -3
View File
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>1147</width>
<width>1456</width>
<height>492</height>
</rect>
</property>
@@ -16,12 +16,15 @@
<widget class="QTextEdit" name="mGenMsgTextEdit">
<property name="geometry">
<rect>
<x>660</x>
<x>460</x>
<y>30</y>
<width>441</width>
<width>651</width>
<height>451</height>
</rect>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</widget>
<resources/>
-415
View File
@@ -13,421 +13,6 @@
<height>511</height>
</rect>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>203</red>
<green>203</green>
<blue>203</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>229</red>
<green>229</green>
<blue>229</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>101</red>
<green>101</green>
<blue>101</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>135</red>
<green>135</green>
<blue>135</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>206</red>
<green>206</green>
<blue>206</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>229</red>
<green>229</green>
<blue>229</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>203</red>
<green>203</green>
<blue>203</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>229</red>
<green>229</green>
<blue>229</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>101</red>
<green>101</green>
<blue>101</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>135</red>
<green>135</green>
<blue>135</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>206</red>
<green>206</green>
<blue>206</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>229</red>
<green>229</green>
<blue>229</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>101</red>
<green>101</green>
<blue>101</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>203</red>
<green>203</green>
<blue>203</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>229</red>
<green>229</green>
<blue>229</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>101</red>
<green>101</green>
<blue>101</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>135</red>
<green>135</green>
<blue>135</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>101</red>
<green>101</green>
<blue>101</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>101</red>
<green>101</green>
<blue>101</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>203</red>
<green>203</green>
<blue>203</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="windowTitle">
<string>Otracik</string>
</property>
@@ -0,0 +1,14 @@
#include "ProgramSettingsPage.h"
#include "ui_ProgramSettingsPage.h"
CProgramSettingsPage::CProgramSettingsPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::CProgramSettingsPage)
{
ui->setupUi(this);
}
CProgramSettingsPage::~CProgramSettingsPage()
{
delete ui;
}
@@ -0,0 +1,22 @@
#ifndef PROGRAMSETTINGSPAGE_H
#define PROGRAMSETTINGSPAGE_H
#include <QWidget>
namespace Ui {
class CProgramSettingsPage;
}
class CProgramSettingsPage : public QWidget
{
Q_OBJECT
public:
explicit CProgramSettingsPage(QWidget *parent = 0);
~CProgramSettingsPage();
private:
Ui::CProgramSettingsPage *ui;
};
#endif // PROGRAMSETTINGSPAGE_H
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CProgramSettingsPage</class>
<widget class="QWidget" name="CProgramSettingsPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>929</width>
<height>529</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>350</x>
<y>70</y>
<width>161</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Otarcik CAN settings</string>
</property>
</widget>
<widget class="QSpinBox" name="spinBox">
<property name="geometry">
<rect>
<x>320</x>
<y>160</y>
<width>43</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>140</x>
<y>162</y>
<width>171</width>
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The PCAN USB module CAN ID that is communicating with the Parker module&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Parker Module CAN device ID:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>