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

*/

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

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

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


#ifndef FUNCTIONSELECTIONPAGE_H
#define FUNCTIONSELECTIONPAGE_H

#include "GlobalDefine.h"
#include <QGraphicsWidget>
#include "Guipage.h"
#include <QString>
#include "PushButton.h"
#include "ZTSimulator.h"
#include "ToggleButtonWidget.h"
#include "ZTData.h"


class CZoneTest;

class CFunctionSelectionPage : public CGuiPage
{
Q_OBJECT
public:
	CFunctionSelectionPage(QGraphicsWidget *Parent = 0);
	CZoneTest *mProgramHandle;

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

    unsigned int SetConfig(CZTDetectionFunctionConfig* Config);
    void UpdateDisplay();

private:
	CZTSimulator *mZTSimulatorPtr;
	QGraphicsRectItem *mBackgroundRect;
	CTextButtonWidget *mCancelButton;
	CTextButtonWidget *mAcceptButton;

	CToggleButtonWidget *mFNFuncToggleBtn, *mFNTKToggleBtn;
	CToggleButtonWidget *mPGFuncToggleBtn, *mPGTKToggleBtn;
	CToggleButtonWidget *mPPFuncToggleBtn, *mPPTKToggleBtn;
	CToggleButtonWidget *mPP2FuncToggleBtn, *mPP2TKToggleBtn;
    CToggleButtonWidget *mZT1FuncToggleBtn, *mZT1TKToggleBtn;
    CToggleButtonWidget *mZT2FuncToggleBtn, *mZT2TKToggleBtn;

	CZTDetectionFunctionConfig mZTConfig;


	void UpdateConfig();


public slots:
	void ButtonClicked(CTextButtonWidget *);
    void ToggleButtonToggled(CToggleButtonWidget*);

};

#endif // FUNCTIONSELECTIONPAGE_H

