00001 #ifndef CCONSOLE_H
00002 #define CCONSOLE_H
00003
00004
00005
00006
00007
00008 #include "ui_CConsole.h"
00009
00010 #include <QIcon>
00011 #include <QListWidgetItem>
00012 #include <QTimer>
00013 #include <QMutex>
00014 #include <QQueue>
00015
00016 #include "Definitions.h"
00017 #include "Memory/mmgr.h"
00018
00019
00020
00021
00022 class CConsole : public QMainWindow
00023 {
00024 Q_OBJECT
00025
00026
00027
00028
00029 public:
00030 CConsole(QWidget *parent = 0);
00031 ~CConsole();
00032
00033
00034 inline void SetLogStatus(int what,bool tf);
00035
00036 void Log(QString &text,int id);
00037 void Log(const char* text,int id){Log(QString(text),id);}
00038 void Log(int nmb,int id){Log(QString().setNum(nmb),id);}
00039 void Log(float nmb,int id){Log(QString().setNum(nmb),id);}
00040 void Log(double nmb,int id){Log(QString().setNum(nmb),id);}
00041 void Log(QVariant & log,int id){};
00042
00043 signals:
00044 void LogStatusChange(int,bool);
00045
00046
00047
00048
00049 protected:
00050 void showEvent(QShowEvent *event);
00051 void hideEvent(QHideEvent *event);
00052
00053
00054
00055
00056 private slots:
00057 void on_qualitySlider_valueChanged(int);
00058 void on_logAllCheckbox_clicked(bool);
00059 void update();
00060 void on_actionSave_triggered();
00061 void on_actionClear_triggered();
00062 void on_actionOpenGL_triggered();
00063
00064
00065
00066
00067 private:
00068
00069 void statusChange(int what,bool tf);
00070
00071 Ui::CConsoleClass ui;
00072
00073 QQueue<QString> logQueue;
00074 QMutex logQueueLocker;
00075
00076 QThread *pCreateThread;
00077
00078 QTimer *pTimer;
00079
00080 QIcon iconEnable;
00081 QIcon iconDisable;
00082
00083 volatile int rowNmb;
00084
00085 volatile bool bOpenGlLog;
00086 volatile bool bLogAll;
00087 volatile int quality,q;
00088
00089 bool consoleIsHidden;
00090 };
00091
00092 #endif // CCONSOLE_H