/*******************************************************************************
* @Copyright (c)    :(C)2016, Qingdao ieslab Co., Ltd
* @FileName         :Gp22Gas_valve_app.h
* @Author           :Kv-L
* @Version          :V1.0
* @Date             :2016年5月25日 13:56:16
* @Description      :the function of the entity of Gp22Gas_valve_app.h
*******************************************************************************/

#ifndef __UWater_VALVE_APP_H
#define __UWater_VALVE_APP_H

#include "sys_config.h"
#ifdef __cplusplus
extern "C" {
#endif

#include "type.h"

//阀控状态机状态
enum{
	VALVE_DEAL_S0 = 0,
	VALVE_DEAL_COMMON,
	VALVE_DEAL_ACTIVE_HALF,
	VALVE_DEAL_ACTIVE_OPEN,
	VALVE_DEAL_EE,
	VALVE_DEAL_END
};

#define VALVE_AUTO_CHECK_OPEN		0xAA	//阀门自检开启
#define VALVE_AUTO_CHECK_CLOSE		0xBB	//阀门自检关闭

#define MAX_EMERGENCY_NUM		999		//最大应急用水量

#define VALVE_CLOSE_UPLOAD_TIME        1
#define NO_VALVE_CLOSE_UPLOAD_TIME     0


void ValveDealAppStart(u8 valve_order);
u8 ValveGetStateApp(void);
u8 ValveGetUploadStateApp(void);
void ValveDealAppMachine(void); 
u8 ValveDealAppMachineIfIdle(void);
#ifdef __cplusplus
}
#endif

#endif /* __UWater_VALVE_APP_H */

