/*******************************************************************************
*                                                                              *
* 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 NETWORKCTRLPAGE_H
#define NETWORKCTRLPAGE_H

#include "GlobalDefine.h"
#include <QGraphicsWidget>
#include "Guipage.h"
#include <QString>
#include "ToggleTextButtonWidget.h"
#include "TextButtonWidget.h"
#include "TxRxWidget.h"
#include <QRadioButton>
#include <QButtonGroup>

class COutilZT;

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


    COutilZT *mProgramHandle;

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

    void DisableNetworkButtons();
    void EnableNetworkButtons();

private:
    CToggleTextButtonWidget *mNetworkConnectButton;
    CTextButtonWidget *mZTStatusRefreshButton;
    CTxRxWidget *mTxRxWidget;
    CTextButtonWidget *mZTLogDownloadButton;
    CTextButtonWidget *mTrainLogsDownloadButton;
    QRadioButton *mViewRemoteTrainLogsRadioBtn, *mViewRemoteControlRadioBtn, *mViewRemoteLiveZtRadioBtn;
    QButtonGroup *mRadioButtonsGroup;

    bool mIsConnecting;


public slots:
	void ButtonClicked(CTextButtonWidget *);
    void ConnectButtonPressed();
    void ConnectButtonReleased();
    void NetworkZTConnected(int);
    void NetworkZTConnectionFailed(int);
    void NetworkTx();
    void NetworkRx();
    void RemoteViewRadioButtonToggled(bool);

//    void ParsingTimerExipred();

};

#endif // NETWORKCTRLPAGE_H
