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

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

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

#ifndef SNOWDON_H
#define SNOWDON_H
#include "Station.h"

#define SNOWDON_STATION_KEY 0x0040000
#define SNOWDON_NB_EXTERNAL_INPUT_430_MODULES 1
#define SNOWDON_NB_EXTERNAL_OUTPUT_440_MODULES 1
#define SNOWDON_NB_EXTERNAL_MIXED_470_MODULES 0

//Since it's necessary to execute a very fast acquisition and analysis
//of magnetic sensors through the PCI I/O adapter, we will use masks
//instead of bitfields for those sensors.  This will accelerate
//treatment by avoiding the use of a memcpy().
#define SNOWDON_ZT1_S1_MASK 0x00000001
#define SNOWDON_ZT1_S2_MASK 0x00000002
#define SNOWDON_ZT1_PI_MASK 0x00000004
#define SNOWDON_ZT1_PE_MASK 0x00000008
#define SNOWDON_ZT1_FN_MASK 0x00000010
#define SNOWDON_ZT2_S1_MASK 0x00000020
#define SNOWDON_ZT2_PI_MASK 0x00000040
#define SNOWDON_ZT2_PE_MASK 0x00000080

//External (ethernet) input module masks for SNOWDON
//#define SNOWDON_IN_CDV_22B_MASK	 0x00000001
//#define SNOWDON_IN_CDV_22A_MASK	 0x00000002
//#define SNOWDON_IN_CDV_22C_MASK	 0x00000004
//#define SNOWDON_IN_CDV_23_MASK	 0x00000008
//#define SNOWDON_IN_CDV_24A_MASK	 0x00000010
//#define SNOWDON_IN_CDV_21_MASK	 0x00000020
//#define SNOWDON_IN_CDV_20B_MASK	 0x00000040
//#define SNOWDON_IN_CDV_20C_MASK   0x00000080
//#define SNOWDON_IN_CDV_20A_MASK	 0x00000100
//#define SNOWDON_IN_ZT1_ITI_MASK	 0x00000200
//#define SNOWDON_IN_ZT2_ITI_MASK	 0x00000400
//#define SNOWDON_IN_ZT1_AN_MASK	 0x00000800
//#define SNOWDON_IN_ZT2_AN_MASK	 0x00001000
//#define SNOWDON_IN_ZT1_ARF_MASK	 0x00002000
//#define SNOWDON_IN_ZT2_ARF_MASK	 0x00004000
//#define SNOWDON_IN_STATION_ID_MASK 0x00078000

#define SNOWDON_IN_CDV_22B_MASK	 0x00000004 //2.1
#define SNOWDON_IN_CDV_22A_MASK	 0x00000001 //1.2
#define SNOWDON_IN_CDV_22C_MASK	 0x00000008 //2.2
#define SNOWDON_IN_CDV_23_MASK	 0x00000010 //3.1
#define SNOWDON_IN_CDV_24A_MASK	 0x00000040 //10.1
#define SNOWDON_IN_CDV_21_MASK	 0x00000020 //9.2
#define SNOWDON_IN_CDV_20B_MASK	 0x00000100 //13.2
#define SNOWDON_IN_CDV_20C_MASK  0x00000002 //1.1
#define SNOWDON_IN_CDV_20A_MASK	 0x00000080 //13.1
#define SNOWDON_IN_ZT1_ITI_MASK	 0x00000200
#define SNOWDON_IN_ZT2_ITI_MASK	 0x00000400
#define SNOWDON_IN_ZT1_AN_MASK	 0x00000800
#define SNOWDON_IN_ZT2_AN_MASK	 0x00001000
#define SNOWDON_IN_ZT1_ARF_MASK	 0x00002000
#define SNOWDON_IN_ZT2_ARF_MASK	 0x00004000
#define SNOWDON_IN_STATION_ID_MASK 0x00078000

//External (ethernet) output module masks for SNOWDON
#define SNOWDON_OUT_VP1_MASK		0x00000001
#define SNOWDON_OUT_VP2_MASK		0x00000002
#define SNOWDON_OUT_VP3_MASK		0x00000004
#define SNOWDON_OUT_VP4_MASK		0x00000008
#define SNOWDON_OUT_VP5_MASK		0x00000010
#define SNOWDON_OUT_VP6_MASK		0x00000020
#define SNOWDON_OUT_VF1_MASK		0x00000040
#define SNOWDON_OUT_VF2_MASK		0x00000080
#define SNOWDON_OUT_VF3_MASK		0x00000100
#define SNOWDON_OUT_VF4_MASK		0x00000200
#define SNOWDON_OUT_VF5_MASK		0x00000400
#define SNOWDON_OUT_WP1_MASK		0x00000800
#define SNOWDON_OUT_WP2_MASK		0x00001000
#define SNOWDON_OUT_WP3_MASK		0x00002000
#define SNOWDON_OUT_WP4_MASK		0x00004000
#define SNOWDON_OUT_WP5_MASK		0x00008000
#define SNOWDON_OUT_WP6_MASK		0x00010000
#define SNOWDON_OUT_DPE_MASK		0x00020000
#define SNOWDON_OUT_DPI_MASK		0x00040000
#define SNOWDON_OUT_V00_MASK		0x00080000
#define SNOWDON_OUT_DPG_MASK		0x00100000
#define SNOWDON_OUT_DFR_MASK		0x00200000
#define SNOWDON_OUT_RF_MASK		0x00400000
#define SNOWDON_OUT_RF2_MASK		0x00800000
#define SNOWDON_OUT_VEL_MASK		0x01000000
#define SNOWDON_OUT_VEL2_MASK		0x02000000
#define SNOWDON_OUT_DPI2_MASK		0x04000000
#define SNOWDON_OUT_DPE2_MASK		0x08000000
#define SNOWDON_OUT_V002_MASK		0x10000000
#define SNOWDON_OUT_PEQ1_MASK     0x20000000
#define SNOWDON_OUT_PEQ2_MASK     0x40000000
#define SNOWDON_OUT_WATCHDOG_MASK 0x80000000

#define SNOWDON_SDF_ACQUISITION_CHANNEL 0

class CSnowdonStation : public CStation
{
public:

    CSnowdonStation();

    virtual bool IsZT1AnalysisFinished();
    virtual bool IsZT1CDVOccupied();
    CCDV *mCDV22C, *mCDV22A;



private:
    virtual unsigned int BuildStationCDVList();
};

#endif // SNOWDON_H

