#ifndef USER_FORM_PRESENT
#define USER_FORM_PRESENT

#include "type.h"

void Form_Refresh();
void Form_OnKey(u8 key);
void Form_OnTimer();
void Form_ResetTimer();

void Form_Start();

// 是否在测试界面
uint8_t MeterInSamplePage();
// 是否主界面
uint8_t MeterInMeterPage();
// 是否需要切换显示
uint8_t MeterNeedRoll();
// 切换显示
void MeterRoll();
// 切换显示第一路（差压）
void MeterRollFirst();

// 多路滚动显示序号
extern volatile uint8_t Form_rollIdx;

// 是否允许充装
extern volatile uint8_t Charge_Enabled, last_Charge_Enabled;
extern volatile uint32_t Charge_Pulse_Time;

// 是否允许报警
extern volatile uint8_t Alarm_Enabled, Low_Alarm_Enabled, Leak_Alarm_Enabled;
extern volatile uint8_t Press_Alarm_Enabled, Low_Press_Alarm_Enabled, ExtPress_Alarm_Enabled, Low_ExtPress_Alarm_Enabled;
extern volatile uint8_t Alarm_Output, Low_Alarm_Output, Leak_Alarm_Output;
extern volatile uint8_t Press_Alarm_Output, Low_Press_Alarm_Output, ExtPress_Alarm_Output, Low_ExtPress_Alarm_Output;

// 是否匹配槽车
extern volatile uint8_t Truck_Matched, Truck_Charging;
extern volatile uint8_t Match_Charging;			// 回持区间，未充满

// 充液泵控制
extern volatile uint32_t Pump_Stop_Time;
extern volatile uint8_t Pump_Stop_posState;
extern volatile uint32_t Pump_Stop_Longitude, Pump_Stop_Latitude;

// 手动启动充装
extern volatile uint8_t Manual_Charing;

#endif
