/*******************************************************************************
*                                                                              *
* Société de Transports de Montréal.                                    	   *
* 2012                                                                         *
*                                                                              *
* Projet Zones Tests                                                           *
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/
/*
    Description:
    Description du fichier si nécessaire.

*/

/* ************************************************************************** */
/* Revision:
### 20131024 JFM
    Verision d'origine.

### YYYMMDD Description du besoin ou du bug
    Description du changement.
 */

/* ************************************************************************** */


#ifndef LOGSLISTPAGE_H
#define LOGSLISTPAGE_H

#include "GlobalDefine.h"
#include <QGraphicsWidget>
#include "Guipage.h"
#include <QString>
#include "PushButton.h"
#include "TextButtonWidget.h"
#include "LogMgr.h"
#include <QTableWidget>
#include <QCheckBox>
#include <QComboBox>

#define MAX_DETECTION_LIST_NBR 6

class COutilZT;

class CLogsListPage : public CGuiPage
{
Q_OBJECT
public:
    virtual ~CLogsListPage();
	CLogsListPage(QGraphicsWidget *Parent = 0);


    COutilZT *mProgramHandle;
	CLogMgr *mLogMgrHandle;

	unsigned int RefreshList();
    void EnableEngineeringMode();

	virtual void resizeEvent(QGraphicsSceneResizeEvent *event);
	virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
	virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);

private:

	QTableWidget *mLogsTable;
    QGraphicsTextItem *mSummaryText;
	CTextButtonWidget *mViewLogDataButton;
    CTextButtonWidget *mExportCSVLogButton;

    QCheckBox *mShowZT1ItemsChkBx, *mShowZT2ItemsChkBx, *mShowNoDetectionsChkBx;
    QCheckBox *mShowFNChkBx, *mShowCountChkBx, *mShowPGChkBx, *mShowPPChkBx,*mShowMPM10ChkBx, *mShowMRChkBx, *mShowProblematicTrainsChkbx;//, *mShowAllChkBx;

    QTimer *mListParsingTimer;
    QComboBox *mStationsFilterComboBox;

    QString mStationFilter;

    CPushButton *mViewZTLogBtn, *mSaveCSVLogBtn,*mDeleteFileButton;
    QCheckBox *mProtectLogChkBx;

    //bool mShowZT1Items,mShowZT2Items,mShowNoDetections,mUSBDetected;

	void ClearTable();



public slots:
	void ButtonClicked(CTextButtonWidget *);
	void LogsTableCellClicked(int, int);
    void LogsTableCellSelected(int,int,int,int);
    void CheckBoxClicked(int);
    void TableDoubleClicked(int,int);
    void StationFilterSelected(int);
    void ViewZTLogBtnClicked(CPushButton *);
    void SaveCSVLogBtnClicked(CPushButton *);
    void DeleteSelectedLog(CPushButton*);
    void ProtectLogCheckBoxClicked();
//    void ParsingTimerExipred();

};

#endif // LOGSLISTPAGE_H
