2026-03-20 21:16:58 +08:00
|
|
|
#include "../main/SystemInclude.h"
|
|
|
|
|
//==============================================================================
|
|
|
|
|
|
|
|
|
|
//##############################################################################
|
|
|
|
|
#ifndef ENABLE_LCD_DISPLAY
|
|
|
|
|
#pragma message("[undefined] ENABLE_LCD_DISPLAY")
|
|
|
|
|
#elif(ENABLE_LCD_DISPLAY)
|
|
|
|
|
//##############################################################################
|
|
|
|
|
|
|
|
|
|
unsigned int displayBit;
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
// Numeric preparation for output and display
|
|
|
|
|
void NumericPrepForOutputAndDisplay(void)
|
|
|
|
|
{
|
|
|
|
|
if(currentMode.Bit.TurnOffSystem)
|
|
|
|
|
{
|
|
|
|
|
ClearDisplay();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FlowrateDisplay(flowDisUnit);
|
|
|
|
|
TotalFlowRateDisplay(AccDisUnit);
|
|
|
|
|
TemperatureDisplay(voltageDetected[TPCB]);
|
|
|
|
|
ErrorDisplay(alarmState);
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
#ifndef ENABLE_PRESSURE
|
|
|
|
|
#pragma message("[undefined] ENABLE_PRESSURE")
|
|
|
|
|
#elif(ENABLE_PRESSURE)
|
|
|
|
|
PressDisplay();
|
|
|
|
|
#else
|
|
|
|
|
if(currentMode.Bit.ZeroCalib) ZeroCalibDisplay();
|
|
|
|
|
else if(currentMode.Bit.DebugMode) DebugDisplay();
|
|
|
|
|
else if(currentMode.Bit.CalibMode) CalibrationDisplay();
|
|
|
|
|
else if((alarmState & HARD_ALARM) == HARD_ALARM) HardWareAlarmInfo(alarmState);
|
2026-03-20 21:19:04 +08:00
|
|
|
else if(isCurrentGas) GasChangeDisplay();
|
|
|
|
|
else CommAddrDisplay(localAddress);
|
2026-03-20 21:16:58 +08:00
|
|
|
#endif
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
BatteryGridDisplay(batteryGrid);
|
|
|
|
|
//LcdModeInit();
|
|
|
|
|
LcdWriteDisplay();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//******************************************************************************
|
|
|
|
|
void AlarmFlashDisplay(void)
|
|
|
|
|
{
|
|
|
|
|
//ClearACCDisplay();
|
|
|
|
|
//ErrorDisplay(alarmState);
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
#ifndef ENABLE_LEAK_DETECT
|
|
|
|
|
#pragma message("[undefined] ENABLE_LEAK_DETECT")
|
|
|
|
|
#elif(ENABLE_LEAK_DETECT)
|
|
|
|
|
if((alarmState1 & LEAK_ALARM) == LEAK_ALARM)
|
|
|
|
|
{
|
|
|
|
|
ClearDisplay();
|
|
|
|
|
OtherAlarmInfo(alarmState1);
|
|
|
|
|
LcdWriteDisplay();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
#ifndef ENABLE_AUTO_CALIB_ATYPE_OFFSET
|
|
|
|
|
#pragma message("[undefined] ENABLE_AUTO_CALIB_ATYPE_OFFSET")
|
|
|
|
|
#elif(ENABLE_AUTO_CALIB_ATYPE_OFFSET)
|
|
|
|
|
if(userInitial == NEED_FOR_INIT)
|
|
|
|
|
{
|
|
|
|
|
NoIniFlashDisplayFlowRate();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
ClearErrorDisplay(alarmState);
|
|
|
|
|
LcdWriteDisplay();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//******************************************************************************
|
|
|
|
|
//void ZeroFlowrateDisplay(void)
|
|
|
|
|
//{
|
|
|
|
|
// SetFlowDisplayToZero();
|
|
|
|
|
// TotalFlowRateDisplay();
|
|
|
|
|
// BatteryGridDisplay(batteryGrid);
|
|
|
|
|
// TemperatureDisplay(voltageDetected[TPCB]);
|
|
|
|
|
// ErrorDisplay(alarmState);
|
|
|
|
|
//
|
|
|
|
|
// if((alarmState & HARD_ALARM) == HARD_ALARM) HardWareAlarmInfo(alarmState);
|
2026-03-20 21:19:04 +08:00
|
|
|
// else if(isCurrentGas) GasChangeDisplay();
|
|
|
|
|
// else CommAddrDisplay(localAddress);
|
2026-03-20 21:16:58 +08:00
|
|
|
//
|
|
|
|
|
// LcdModeInit();
|
|
|
|
|
// LcdWriteDisplay();
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
//******************************************************************************
|
|
|
|
|
//void AlarmFlashDisplay(void)
|
|
|
|
|
//{
|
|
|
|
|
// ClearErrorDisplay(alarmState);
|
|
|
|
|
// LcdWriteDisplay();
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
//******************************************************************************
|
|
|
|
|
void DisplayInit(void)
|
|
|
|
|
{
|
|
|
|
|
LcdModeInit();
|
|
|
|
|
DisplayAll();
|
|
|
|
|
delay_ms(1500);
|
|
|
|
|
ClearDisplay();
|
|
|
|
|
delay_ms(1000);
|
|
|
|
|
|
|
|
|
|
MeterInfoDisplay();
|
|
|
|
|
//delay_ms(3000);
|
|
|
|
|
|
|
|
|
|
//delay_ms(500);
|
|
|
|
|
//ClearDisplay();
|
|
|
|
|
//NumericPrepForOutputAndDisplay();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//##############################################################################
|
|
|
|
|
#endif
|
|
|
|
|
//##############################################################################
|
|
|
|
|
|