#ifndef  __USER_TEATER_H
#define  __USER_TEATER_H

#include "van_com_algorithm.h"

#define SystemPreHeat     1
#define SystemIdle        2
#define SysPreHeatUP      3
#define SysPreKepTemp     4
#define SysPreCoolDown    5
#define SysPreConTemp     6
#define SysNorHeatUP      7
#define SysNorHeatHold     8
#define SysERRORHeat     10


typedef struct
{
	unsigned char   heat_state;            		//串口控制加热状态
	unsigned char   temp_stable_sta;            	//加热稳定状态
	unsigned char   fan_state;   					//风扇状态
	unsigned char   card_state;   				//插卡状态
    unsigned int  stabletime;
	float     SetTempVal;
	unsigned int  PresetTempTime;
	float     PresetTempVal;
    float readyTemp;	  //就绪温度
	float    HoldTemp;       //稳定温度
	float	offset;		//温度补偿
	unsigned int   PreHeatTime;					//上电预热时间,min
	float     adJTarget;					//根据环境温度，修正目标温度
    unsigned int timenum;
    unsigned int HeatState;	  
    unsigned int overtempnum;
    float     targetAfterAdj;	       
    pid_def  pid;	
    unsigned int pwdId; 
    unsigned int needpreheat;  
}heat_ctrl_def;


uint32_t get_heater_master_st(float *temp,unsigned int *st);
uint32_t get_heater_slave_st(float *temp,unsigned int *st);
uint32_t check_heater_master_needPreheat(void);
void updatParm_heater_master(void);
void heater_work(heat_ctrl_def *heater);
#endif
