00001 #ifndef NOTIFYSAMPLEDLG_H 00002 #define NOTIFYSAMPLEDLG_H 00003 00004 #include <QtGui> 00005 #include "ui_NotifySampleDlg.h" 00006 00007 #include "../../../../fedm-classlib/src/FedmIscCore.h" 00008 00009 //void cbsFct1(void* pAny, int iError, unsigned char ucCmd); 00010 00011 class QMenu; 00012 class QSignalMapper; 00013 00014 class NotifySampleDlg : public QMainWindow 00015 { 00016 Q_OBJECT 00017 QSignalMapper *mapper; 00018 public: 00019 NotifySampleDlg(); 00020 ~NotifySampleDlg(); 00021 00022 void startTask(); 00023 00024 /* The static callback helper function for FEISC_EVENT_INIT 00025 below must know of the actual instance to trigger onProtocolEvent(). 00026 setGetClassInstance() does the trick to save the pointer to the current 00027 instance which we need by the static callback function protCallBackHelper */ 00028 static NotifySampleDlg* setGetClassInstance(NotifySampleDlg* classInstance); 00029 /* This static helper function is called by the FEISC_PRT_EVENT event. 00030 It triggers the onProtocolEvent signal which can then be used to update the ui. */ 00031 static void protCallBackHelper(int iMsg,int iLen); 00032 00033 /* FEDM_TASK_INIT can take a parameter pAny. The helper function above isn't 00034 needed for this callback */ 00035 static void cbsFct1(void* pAny, int iError, unsigned char ucCmd); 00036 signals: 00037 void onProtocolEvent(int iMsg,int iLen); 00038 void onDataEvent(void* pAny, int iError, unsigned char ucCmd); 00039 00040 public slots: 00041 void displayProtocol(int iMsg,int iLen); 00042 void displayData(void* pAny, int iError, unsigned char ucCmd); 00043 void displayError(int iError); 00044 00045 void writeToFileClicked(); 00046 void listenButtonClicked(); 00047 00048 private: 00049 char* getISOMfrCode(unsigned char ucMfr); 00050 void writeLogFile(); 00051 Ui::NotifySampleDlg ui; 00052 FEDM_ISCReaderModule* m_iscReader; 00053 //FEDM_TASK_INIT m_taskInit; 00054 bool m_bRunning; 00055 char m_cLogTxt[1024]; 00056 char m_cLineTxt[1024]; 00057 char m_cFileName[256]; 00058 int m_iLineCnt; 00059 00060 }; 00061 00062 #endif