Dev.... GUI, Log dispatcher, etc...
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
#include "GeneralMessagesLogDispatcher.h"
|
||||
|
||||
|
||||
|
||||
//singleton instantiation
|
||||
CGeneralMessagesLogDispatcher CGeneralMessagesLogDispatcher::mSingleton;
|
||||
|
||||
|
||||
CGeneralMessagesLogDispatcher::CGeneralMessagesLogDispatcher()
|
||||
{
|
||||
mGeneralStatusPageHandle = 0;
|
||||
|
||||
mNbLinesInGUILog = 0;
|
||||
|
||||
}
|
||||
|
||||
CGeneralMessagesLogDispatcher::~CGeneralMessagesLogDispatcher()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int CGeneralMessagesLogDispatcher::AddLogMessage(QString LogLine, bool AddToGUILogPanel)
|
||||
{
|
||||
//TODO: Add text to log file...
|
||||
|
||||
LogLine.remove('\n');
|
||||
LogLine.remove('\r');
|
||||
LogLine.append('\n');
|
||||
|
||||
|
||||
|
||||
if(AddToGUILogPanel == true)
|
||||
{
|
||||
if(mNbLinesInGUILog == GENERAL_MESSAGES_MAX_LOG_LINES)
|
||||
{
|
||||
//Make shure we are able to remove first line
|
||||
int FirstLineLength = mGeneralMsgGUILog.indexOf(QChar('\n'));
|
||||
if(FirstLineLength != -1)
|
||||
{
|
||||
mGeneralMsgGUILog.remove(0,FirstLineLength+1);
|
||||
mGeneralMsgGUILog.append(LogLine);
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug("Something fucked-up happened in CGeneralMessagesLogDispatch::AddLogMessage");
|
||||
return RET_GENERAL_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mGeneralMsgGUILog.append(LogLine);
|
||||
mNbLinesInGUILog++;
|
||||
}
|
||||
|
||||
if(mGeneralStatusPageHandle != 0)
|
||||
{
|
||||
mGeneralStatusPageHandle->SetGeneralMsgText(mGeneralMsgGUILog);
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug("Someone forgot to assing their pointers in CGeneralMessagesLogDispatch::AddLogMessage!! This needs to be fixed");
|
||||
return RET_GENERAL_ERROR;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CGeneralMessagesLogDispatcher::BindGuiPageHandle(CGeneralStatusPage *Handle)
|
||||
{
|
||||
if(Handle == 0)
|
||||
{
|
||||
return RET_GENERAL_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
mGeneralStatusPageHandle = Handle;
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef GENERALMESSAGESLOGDISPATCHER_H
|
||||
#define GENERALMESSAGESLOGDISPATCHER_H
|
||||
|
||||
#include <QString>
|
||||
#include "defines.h"
|
||||
#include "GeneralStatusPage.h"
|
||||
|
||||
|
||||
class CGeneralMessagesLogDispatcher
|
||||
{
|
||||
public:
|
||||
|
||||
//CGeneralMessagesLogDispatcher is a singleton class
|
||||
static CGeneralMessagesLogDispatcher* instance(){return &mSingleton;}
|
||||
static CGeneralMessagesLogDispatcher mSingleton;
|
||||
|
||||
CGeneralMessagesLogDispatcher();
|
||||
virtual ~CGeneralMessagesLogDispatcher();
|
||||
|
||||
int AddLogMessage(QString LogLine, bool AddToGUILogPanel = true);
|
||||
CGeneralStatusPage *mGeneralStatusPageHandle;
|
||||
int BindGuiPageHandle(CGeneralStatusPage *Handle);
|
||||
|
||||
private:
|
||||
QString mGeneralMsgGUILog;
|
||||
unsigned int mNbLinesInGUILog; //Keep the count of lines displayed in the GUI so we don't EVER buffer overrun
|
||||
|
||||
};
|
||||
|
||||
#endif // GENERALMESSAGESLOGDISPATCHER_H
|
||||
@@ -0,0 +1,20 @@
|
||||
#include "GeneralStatusPage.h"
|
||||
#include "ui_GeneralStatusPage.h"
|
||||
|
||||
CGeneralStatusPage::CGeneralStatusPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::CGeneralStatusPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
CGeneralStatusPage::~CGeneralStatusPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
int CGeneralStatusPage::SetGeneralMsgText(QString Txt)
|
||||
{
|
||||
ui->mGenMsgTextEdit->setText(Txt);
|
||||
return RET_OK;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef GENERALSTATUSPAGE_H
|
||||
#define GENERALSTATUSPAGE_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "defines.h"
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class CGeneralStatusPage;
|
||||
}
|
||||
|
||||
class CGeneralStatusPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CGeneralStatusPage(QWidget *parent = 0);
|
||||
~CGeneralStatusPage();
|
||||
|
||||
int SetGeneralMsgText(QString Txt);
|
||||
|
||||
|
||||
private:
|
||||
Ui::CGeneralStatusPage *ui;
|
||||
};
|
||||
|
||||
#endif // GENERALSTATUSPAGE_H
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CGeneralStatusPage</class>
|
||||
<widget class="QWidget" name="CGeneralStatusPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1147</width>
|
||||
<height>492</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QTextEdit" name="mGenMsgTextEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>660</x>
|
||||
<y>30</y>
|
||||
<width>441</width>
|
||||
<height>451</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,24 +1,446 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CMainWindow</class>
|
||||
<widget class="QMainWindow" name="CMainWindow" >
|
||||
<property name="geometry" >
|
||||
<widget class="QMainWindow" name="CMainWindow">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
<width>1186</width>
|
||||
<height>511</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>CMainWindow</string>
|
||||
<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>
|
||||
<widget class="QMenuBar" name="menuBar" />
|
||||
<widget class="QToolBar" name="mainToolBar" />
|
||||
<widget class="QWidget" name="centralWidget" />
|
||||
<widget class="QStatusBar" name="statusBar" />
|
||||
<property name="windowTitle">
|
||||
<string>Otracik</string>
|
||||
</property>
|
||||
<property name="windowOpacity">
|
||||
<double>3.000000000000000</double>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget"/>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
</widget>
|
||||
<layoutDefault spacing="6" margin="11" />
|
||||
<pixmapfunction></pixmapfunction>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -6,9 +6,18 @@ CMainWindow::CMainWindow(QWidget *parent) :
|
||||
ui(new Ui::CMainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
mGeneralStatusPage = new CGeneralStatusPage(this);
|
||||
mMainWindowWidget = new QTabWidget(this);
|
||||
|
||||
setCentralWidget(mMainWindowWidget);
|
||||
mMainWindowWidget->addTab(mGeneralStatusPage,"Status");
|
||||
|
||||
resize(1700,768);
|
||||
}
|
||||
|
||||
CMainWindow::~CMainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QTabWidget>
|
||||
#include "GeneralStatusPage.h"
|
||||
#include <QTextEdit>
|
||||
|
||||
namespace Ui {
|
||||
class CMainWindow;
|
||||
@@ -15,6 +18,10 @@ public:
|
||||
explicit CMainWindow(QWidget *parent = 0);
|
||||
~CMainWindow();
|
||||
|
||||
QTabWidget *mMainWindowWidget;
|
||||
CGeneralStatusPage *mGeneralStatusPage;
|
||||
|
||||
|
||||
private:
|
||||
Ui::CMainWindow *ui;
|
||||
};
|
||||
|
||||
@@ -12,6 +12,14 @@ COtarcikCan::~COtarcikCan()
|
||||
|
||||
int COtarcikCan::Start()
|
||||
{
|
||||
w.show();
|
||||
|
||||
CGeneralMessagesLogDispatcher::instance()->BindGuiPageHandle(w.mGeneralStatusPage);
|
||||
|
||||
|
||||
|
||||
CGeneralMessagesLogDispatcher::instance()->AddLogMessage("OtarcikCan modules starting...");
|
||||
|
||||
mPCANInterface->Init();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
#define OTARCIKCAN_H
|
||||
|
||||
#include <QObject>
|
||||
#include "MainWindow.h"
|
||||
#include "PCANInterface.h"
|
||||
#include "GeneralMessagesLogDispatcher.h"
|
||||
|
||||
class COtarcikCan : public QObject
|
||||
{
|
||||
@@ -10,6 +12,7 @@ class COtarcikCan : public QObject
|
||||
public:
|
||||
explicit COtarcikCan(QObject *parent = 0);
|
||||
~COtarcikCan();
|
||||
CMainWindow w;
|
||||
|
||||
int Start();
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "PCANInterface.h"
|
||||
#include "GeneralMessagesLogDispatcher.h"
|
||||
|
||||
CPCANInterface::CPCANInterface(QObject *parent) : QObject(parent)
|
||||
{
|
||||
@@ -16,6 +17,8 @@ int CPCANInterface::Init()
|
||||
char strMsg[256];
|
||||
CAN_GetErrorText(Result, 0, strMsg);
|
||||
qDebug("%s",strMsg);
|
||||
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(strMsg);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,25 @@
|
||||
#ifndef DEFINES_H
|
||||
#define DEFINES_H
|
||||
|
||||
|
||||
|
||||
#define GENERAL_MESSAGES_MAX_LOG_LINES 5000 //The number of lines of general status log we keep in the general status window (avoids fucking up because you know.... RAM)
|
||||
|
||||
enum eOtarcikGeneralReturns
|
||||
{
|
||||
RET_OK = 0,
|
||||
RET_GENERAL_ERROR,
|
||||
|
||||
|
||||
|
||||
RET_MAX_ERROR
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // DEFINES_H
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include "MainWindow.h"
|
||||
#include <QApplication>
|
||||
#include "OtarcikCan.h"
|
||||
|
||||
@@ -6,11 +5,10 @@
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
CMainWindow w;
|
||||
COtarcikCan OtarcikCanProgram; //Instanciate the program
|
||||
|
||||
|
||||
w.show();
|
||||
|
||||
OtarcikCanProgram.Start();
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user