#ifndef _BLV_NOR_DEV_SCENERESTORE_H_
#define _BLV_NOR_DEV_SCENERESTORE_H_


#include "stdint.h"
#include "BLV_All_Dev_Init.h"

#define SAVE_DEV_LOOP_MAX       	40       //场景还原支持的最大动作数
#define SCENE_TEMP_LIST_MAX       	15


typedef struct 
{	
	uint16_t set_t : 8;    			//设置温度	
	uint16_t valve : 2;        		// 1阀开  0阀关
	uint16_t fan : 2;      			// 1低速,2中速,3高速,0停止,4自动
	uint16_t mode : 2;     			// 1制冷,2制热,3送风,0自动
	uint16_t on_off : 2;   			// 1开,2关
}TemCtrl; 



typedef struct 
{
	uint8_t  DevType;            //设备类型
	uint8_t  DevAddr;            //设备地址
	uint16_t DevOutputLoop;      //设备输出地址
	uint16_t DevCtrlState;       //设备控制状态	
}SAVE_ACTION;    //保存设备状态



typedef struct
{
	uint8_t Addr;
	uint8_t Temp;
	uint8_t SetTemp;
}SCENE_TEMPDEV;


typedef struct 
{
	uint8_t LoopValidNum;
	
	uint8_t SceneState;
	uint8_t SceneCtrlFlag;
	
	uint8_t DevAction;
	
	uint8_t StateSaveFlag;     //场景保存标记
	uint8_t SaveNum;           //保存的动作数
	
	uint16_t SceneOpenNo;      //事件开场景编号
	uint16_t SceneCloseNo;     //事件关场景编号
	
	uint32_t SceneOpenAddr;    //事件开场景动作地址
	uint32_t SceneCloseAddr;   //事件关场景动作地址
	
	uint8_t OpenAddrGetFlag;   
	uint8_t CloseAddrGetFlag;
	
	SAVE_ACTION SaveAction[SAVE_DEV_LOOP_MAX];
	
	SCENE_TEMPDEV TempInf[SCENE_TEMP_LIST_MAX];
	uint8_t TempInfFlag[SCENE_TEMP_LIST_MAX];
	

}NOR_SRESTORE_INFO;					



void BLV_Nor_Dev_SceneRestore_For_Logic_Init(LOGICFILE_DEVICE_INFO *dev_info,uint8_t *data,uint16_t data_len);

#endif



