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

/* ************************************************************************** */
/* Revision:
### YYYMMDD JFM
	Verision d'origine.
	
### YYYYMMDD Description du besoin ou du bug
	Description du changement.
 */

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

#ifndef TRAINLOGFILEMGR_H
#define TRAINLOGFILEMGR_H

#include "GlobalDefine.h"
#include "ZTData.h"



class CLogElement;

class CTrainLogFileMgr
{
public:

	//CTrainLogFileMgr is a singleton class
	static CTrainLogFileMgr* instance(){return &mSingleton;}
	static CTrainLogFileMgr mSingleton;


	CTrainLogFileMgr();
	unsigned int SaveTrainLog(QString LogFilePathName,CZT1Log *ZT1Log,QVector<CZTDetectionData*> *ZT1DetectionsLog,QString StationName);
	unsigned int SaveTrainLog(QString LogFilePathName,QVector<CZT2LogData*> *ZT2Log,QVector<CZTDetectionData*> *ZT2DetectionsLog,QString StationName);
	CLogElement *OpenTrainLog(QString LogFilePathName,unsigned int &RetValue,CLogElement *TargetElement = 0,bool LoadData = false);
	unsigned int SaveCSVFile(QString CSVFilePathName,QVector<CZT1LogData*> *ZT1Log,CZT1FlagsData *ZT1Flags,QVector<CZTDetectionData*> *ZT1DetectionsLog, QString StationName);
	unsigned int SaveCSVFile(QString CSVFilePathName,CZT1Log *ZT1Log,QVector<CZTDetectionData*> *ZT1DetectionsLog, QString StationName);
	unsigned int SaveCSVFile(QString CSVFilePathName,QVector<CZT2LogData*> *ZT2Log,QVector<CZTDetectionData*> *ZT2DetectionsLog, QString StationName);

    unsigned int SetTrainLogProtected(bool IsProtected,QString LogFilePathName);

	unsigned int SaveBINFromCSV(QString CSVFilePathName);
};

#endif // TRAINLOGFILEMGR_H

