/*
********************************************************************************************************
*  @Module        Scenario
*  @Filename     Setup_Scenario.H
*  @Project        SST-3000
*------------------------------------------------------------------------------------------------------
*  @Controller     AT90CAN32
*
*  @Compiler      AVR GCC
*
*  @Frequency   Using external clock 16MHz
* 
*  @Codegenerator 0.1
* 
*  @Description    Potentiometers Header  
* 
*--------------------------------------------------------------------------------------------------------
*  @Date          2013-03-15 15:15:00
* 
********************************************************************************************************
*/


#ifndef _SETUP_SCENARIO_H_
#define _SETUP_SCENARIO_H_

#ifdef _SETUP_SCENARIO_C_
#define _SETUP_
#else
#define _SETUP_ extern
#endif


_SETUP_ U16 Set_AC_Voltage;
_SETUP_ U16 CT_Sensor_AC_Voltage;
_SETUP_ U16 CT_Sensor_AC_Voltage_Old;
#ifdef SET_CRT_VOLTAGE
_SETUP_ U16 Get_Setted_Voltage(U8 ID);
#endif
#define MAX_U16 32767
#define MAX_U32 4294967295

#define AUTO_AC_VOLTAGE	220 // 220v
#define DEFAULT_AC_VOLTAGE 220

#define Long_Key_Tick  200   // ms 

/*
*********************************************************************************************************
									@Typedefs
*********************************************************************************************************
*/

typedef enum {
	
	NORMAL_OPERATION =0,
		
	POWERDOWN_MODE,
	NULL_STATE_MODE
	
}OPERATION_MODE;



typedef enum {
	
	TOP_OPERATION =0,
	TIME_SET,
	BILLING_RATE,         // cmlee
	NORMAL_RATE,		 // cmlee   C3
	BILL_INPUT,	// C4 
#ifdef SET_CRT_VOLTAGE
	SET_CRT_VTG,	// C5 
#endif
	//SET_PEAK_TIME,        //C7	
	SET_MOMENT_POWER_MAX,//C7
	SET_MONTH_TARGRT_VALUE,    // C8
	DATA_ERASE,
	//DISPLAY_RSSI,      // if you need this item, please change temperature display.
	DISPLAY_TEMP, 
	//COST_UNIT,

	PAIRING,
	EXIT_SET_OPERATION
}SET_OPERATION;

typedef enum {  
	TINME_DSP=0,
	YEAR_DSP,
	MOONTH_DAY_DSP,
	DISPLAY_EXIT
}TIME_Displey_OPERATION;



_SETUP_ SET_OPERATION Set_Operation_Mode;

_SETUP_ SET_OPERATION  Set_Operation_Select;

_SETUP_ TIME_Displey_OPERATION Day_Display_Count;

typedef enum {
	
	TOP_OPERATION_PARING =0,

	RF_RADIO_NOT_SET,

	PARING_ID_SET,

	PARING_VOLTEGE_SET,
	
	PARING_EXIT,
	
	EXIT_SET_PARING
	
}SET_OPERATION_PARING_SUB;

_SETUP_  SET_OPERATION_PARING_SUB  Set_Operation_Paring_State;   
	


#endif  // _SETUP_SCENARIO_H_


