4146 lines
90 KiB
C
4146 lines
90 KiB
C
|
|
#include "includes.h"
|
|||
|
|
#include "drv_dtu.h"
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ID
|
|||
|
|
typedef enum
|
|||
|
|
{
|
|||
|
|
FORM_ID_START, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_METER, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
|
FORM_ID_PWD, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_000, // <20><><EFBFBD>˵<EFBFBD>
|
|||
|
|
FORM_ID_100, // PSN<53><4E><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_200, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_210, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_220, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_230, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_240, // ֱ<><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_250, // <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_251, // <20><>Һλ<D2BA>ٷֱ<D9B7><D6B1><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_260, // <20>ܶ<EFBFBD><DCB6><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_270, // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_271, // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_272, //apex ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_273, //apex ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_280, // <20>ݻ<EFBFBD><DDBB><EFBFBD>ʾ
|
|||
|
|
FORM_ID_285, // 4~20mA<6D><41><EFBFBD><EFBFBD>Һλ<D2BA>߶ȣ<DFB6><C8A3>ù<EFBFBD><C3B9><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD>ʿͻ<CABF>Ӧ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>Ϊѡ<CEAA><D1A1>4-20mA<6D><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>
|
|||
|
|
FORM_ID_290, // Modbusͨ<73>ŵ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_300, // <20>ϱ<EFBFBD><CFB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_310, // <20>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_320, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_400, // <20>궨<EFBFBD><EAB6A8><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_410, // <20><><EFBFBD>ݱ궨
|
|||
|
|
FORM_ID_411, // C1<43><31>100pF<70><46><EFBFBD>궨
|
|||
|
|
FORM_ID_412, // C2<43><32>400pF<70><46><EFBFBD>궨
|
|||
|
|
FORM_ID_413, // <20><><EFBFBD><EFBFBD><EFBFBD>궨
|
|||
|
|
FORM_ID_420, // ѹ<><D1B9><EFBFBD>궨
|
|||
|
|
FORM_ID_421, // <20><>ѹ<EFBFBD><D1B9><EFBFBD>궨
|
|||
|
|
FORM_ID_422, // <20><>ѹ<EFBFBD><D1B9><EFBFBD>궨
|
|||
|
|
FORM_ID_430, // <20>¶ȱ궨
|
|||
|
|
FORM_ID_431, // <20><><EFBFBD>¶ȱ궨
|
|||
|
|
FORM_ID_432, // <20><><EFBFBD>¶ȱ궨
|
|||
|
|
FORM_ID_500, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_510, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_511, // <20><EFBFBD><D7B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_512, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_520, // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_521, // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_522, // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_530, // <20>¶<EFBFBD><C2B6><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_531, // <20>¶ȵ<C2B6><C8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_532, // <20>¶ȸ<C2B6><C8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FORM_ID_600, // ϵͳ<CFB5><CDB3>Ϣ
|
|||
|
|
FORM_ID_700, // <20>鿴<EFBFBD><E9BFB4><EFBFBD>ն<EFBFBD>
|
|||
|
|
} TForm_Id;
|
|||
|
|
|
|||
|
|
void Change_Form(TForm_Id formId);
|
|||
|
|
uint32_t Comm_Sample();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
typedef struct
|
|||
|
|
{
|
|||
|
|
u8 blinkVisible; // <20><>˸״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϩ
|
|||
|
|
u8 menuIdx[3]; // <20><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>ǰ<EFBFBD><C7B0>
|
|||
|
|
u8 privilege; // <20><><EFBFBD><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>0-<2D><>ѯ<EFBFBD><D1AF>1-<2D><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>2-<2D>궨
|
|||
|
|
u8 meterPage; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾҳ<CABE>棺<EFBFBD><E6A3BA><EFBFBD><EFBFBD>ҳ<EFBFBD>桢GPRS/GPSҳ<53><D2B3>1<EFBFBD><31>GPRS/GPSҳ<53><D2B3>2<EFBFBD><32><EFBFBD>궨ҳ<EAB6A8><D2B3>
|
|||
|
|
u8 infoPage; // <20><>Ϣ<EFBFBD><CFA2>ʾҳ<CABE>棺<EFBFBD><E6A3BA><EFBFBD><EFBFBD><EFBFBD>汾<EFBFBD><E6B1BE>Ӳ<EFBFBD><D3B2><EFBFBD>汾
|
|||
|
|
u8 caliIdx; // <20>궨<EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
|
|||
|
|
} TForm_Params;
|
|||
|
|
|
|||
|
|
TForm_Params formParam;
|
|||
|
|
|
|||
|
|
// <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ
|
|||
|
|
volatile uint8_t Charge_Enabled = 0, last_Charge_Enabled = 0, Anti_Enabled = 1;
|
|||
|
|
volatile uint32_t Charge_Pulse_Time = 0, Anti_Pulse_Time = 0;
|
|||
|
|
|
|||
|
|
// <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
volatile uint8_t Alarm_Enabled = 1, Low_Alarm_Enabled = 1, Leak_Alarm_Enabled = 1;
|
|||
|
|
volatile uint8_t Press_Alarm_Enabled = 1, Low_Press_Alarm_Enabled = 1, ExtPress_Alarm_Enabled = 1, Low_ExtPress_Alarm_Enabled = 1;
|
|||
|
|
volatile uint8_t Alarm_Output = 0, Low_Alarm_Output = 0, Leak_Alarm_Output = 0;
|
|||
|
|
volatile uint8_t Press_Alarm_Output = 0, Low_Press_Alarm_Output = 0, ExtPress_Alarm_Output = 0, Low_ExtPress_Alarm_Output = 0;
|
|||
|
|
|
|||
|
|
// <20>Ƿ<EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD>۳<EFBFBD>
|
|||
|
|
volatile uint8_t Truck_Matched = 0, Truck_Charging = 0;
|
|||
|
|
volatile uint8_t Match_Charging = 1; // <20>س<EFBFBD><D8B3><EFBFBD><EFBFBD>䣬δ<E4A3AC><CEB4><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
// <20><>Һ<EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>
|
|||
|
|
volatile uint32_t Pump_Stop_Time = 0;
|
|||
|
|
volatile uint8_t Pump_Stop_posState = 0;
|
|||
|
|
volatile uint32_t Pump_Stop_Longitude = 0, Pump_Stop_Latitude = 0;
|
|||
|
|
|
|||
|
|
// <20>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ
|
|||
|
|
volatile uint8_t Manual_Charing = 0;
|
|||
|
|
|
|||
|
|
// <20>Ƿ<EFBFBD><C7B7>ڲ<EFBFBD><DAB2>Խ<EFBFBD><D4BD><EFBFBD>
|
|||
|
|
uint8_t MeterInSamplePage()
|
|||
|
|
{
|
|||
|
|
return (formParam.meterPage == 3);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>鵱ǰ<E9B5B1><C7B0>ʾ<EFBFBD><CABE>λ<EFBFBD>Ƿ<EFBFBD><C7B7>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD>粻<EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺϷ<C4BA><CFB7><EFBFBD>λ<EFBFBD><CEBB>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
void Check_L_Unit(u8 key)
|
|||
|
|
{
|
|||
|
|
while(((dcBuff.configBottle.dispMode == DISP_MODE_DPRESS || dcBuff.configBottle.dispMode == DISP_MODE_KG) && dcBuff.configDisplay.L_Unit == UNIT_L)
|
|||
|
|
|| ((dcBuff.configBottle.dispMode == DISP_MODE_DPRESS || dcBuff.configBottle.dispMode == DISP_MODE_L) && dcBuff.configDisplay.L_Unit == UNIT_KG)
|
|||
|
|
|| ((dcBuff.configDisplay.op_USE_CAPACITY_SENSOR || dcBuff.configDisplay.op_USE_HEIGHT_LEVEL || dcBuff.configDisplay.op_USE_PCT_LEVEL)
|
|||
|
|
&& (dcBuff.configDisplay.L_Unit == UNIT_KPA || dcBuff.configDisplay.L_Unit == UNIT_MMH2O))
|
|||
|
|
|| (dcBuff.configDisplay.op_DISP_MMWC_ONLY && dcBuff.configDisplay.L_Unit != UNIT_MMH2O)
|
|||
|
|
|| (dcBuff.configDisplay.L_Unit == UNIT_M3 || dcBuff.configDisplay.L_Unit == UNIT_CAL || dcBuff.configDisplay.L_Unit == UNIT_PSI || dcBuff.configDisplay.L_Unit == UNIT_INH2O)
|
|||
|
|
)
|
|||
|
|
{
|
|||
|
|
if(key == KEY_UP)
|
|||
|
|
{
|
|||
|
|
if(dcBuff.configDisplay.L_Unit == UNIT_PCT)
|
|||
|
|
dcBuff.configDisplay.L_Unit = UNIT_CAL;
|
|||
|
|
else
|
|||
|
|
dcBuff.configDisplay.L_Unit++;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if(dcBuff.configDisplay.L_Unit == UNIT_CAL)
|
|||
|
|
dcBuff.configDisplay.L_Unit = UNIT_PCT;
|
|||
|
|
else
|
|||
|
|
dcBuff.configDisplay.L_Unit--;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><>ʾ<EFBFBD>ݻ<EFBFBD><DDBB>ٷֱȣ<D6B1>ָ<EFBFBD>룩
|
|||
|
|
void Meter_DispNeedle()
|
|||
|
|
{
|
|||
|
|
u8 needle;
|
|||
|
|
|
|||
|
|
if(dcBuff.sampleData.staDPress.notConnect)
|
|||
|
|
{
|
|||
|
|
Disp_WriteNeedle(0);
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.underFlow)
|
|||
|
|
{
|
|||
|
|
Disp_WriteNeedle(0);
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.overFlow)
|
|||
|
|
{
|
|||
|
|
Disp_WriteNeedle(0);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
// <20>ٷֱȣ<D6B1>10<31><30><EFBFBD><EFBFBD>ʾ
|
|||
|
|
needle = (u8) ((dcBuff.sampleData.volumePct / 100 + 5) / 10);
|
|||
|
|
Disp_WriteNeedle(needle);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><>ʾ<EFBFBD><CABE>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>
|
|||
|
|
void Meter_DispDiffData()
|
|||
|
|
{
|
|||
|
|
s8 text[10];
|
|||
|
|
float quotient = 0;
|
|||
|
|
|
|||
|
|
Disp_Fld1PointOff();
|
|||
|
|
Disp_Fld1MultiOff();
|
|||
|
|
if(dcBuff.sampleData.staDPress.notConnect)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("---");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.underFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("-EE");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.overFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("+EE");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if(dcBuff.sampleData.diff >= 10000)
|
|||
|
|
{
|
|||
|
|
// <20><>ʾx1000
|
|||
|
|
Disp_Fld1MultiOn();
|
|||
|
|
|
|||
|
|
quotient = dcBuff.sampleData.diff / 1000;
|
|||
|
|
if(quotient >= 1000)
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) quotient);
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ʾС<CABE><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
}
|
|||
|
|
else if(quotient >= 100)
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (quotient * 10));
|
|||
|
|
// <20><>ʾ1λС<CEBB><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
Disp_Fld1PointOn(1);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (quotient * 100));
|
|||
|
|
// <20><>ʾ2λС<CEBB><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
Disp_Fld1PointOn(2);
|
|||
|
|
}
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.diff >= 1000) // <20><><EFBFBD><EFBFBD>ʾС<CABE><D0A1>
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (dcBuff.sampleData.diff));
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.diff >= 100) // <20><>ʾ1λС<CEBB><D0A1>
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (dcBuff.sampleData.diff * 10));
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
Disp_Fld1PointOn(1);
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.diff >= 10) // <20><>ʾ2λС<CEBB><D0A1>
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (dcBuff.sampleData.diff * 100));
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
Disp_Fld1PointOn(2);
|
|||
|
|
}
|
|||
|
|
else // <20><>ʾ3λС<CEBB><D0A1>
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%04d", (uint16_t) (dcBuff.sampleData.diff * 1000));
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
Disp_Fld1PointOn(3);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><>ʾҺλ<D2BA><CEBB><EFBFBD><EFBFBD>
|
|||
|
|
void Meter_DispLevelData()
|
|||
|
|
{
|
|||
|
|
s8 text[10];
|
|||
|
|
float quotient = 0;
|
|||
|
|
|
|||
|
|
Disp_Fld1PointOff();
|
|||
|
|
Disp_Fld1MultiOff();
|
|||
|
|
if(dcBuff.sampleData.staDPress.notConnect)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("---");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.underFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("-EE");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.overFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("+EE");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if(dcBuff.sampleData.height >= 10000)
|
|||
|
|
{
|
|||
|
|
// <20><>ʾx1000
|
|||
|
|
Disp_Fld1MultiOn();
|
|||
|
|
|
|||
|
|
quotient = dcBuff.sampleData.height / 1000;
|
|||
|
|
if(quotient >= 1000)
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) quotient);
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ʾС<CABE><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
}
|
|||
|
|
else if(quotient >= 100)
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (quotient * 10));
|
|||
|
|
// <20><>ʾ1λС<CEBB><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
Disp_Fld1PointOn(1);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (quotient * 100));
|
|||
|
|
// <20><>ʾ2λС<CEBB><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
Disp_Fld1PointOn(2);
|
|||
|
|
}
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
}
|
|||
|
|
else // <20><><EFBFBD><EFBFBD>ʾС<CABE><D0A1>
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (dcBuff.sampleData.height));
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
void Meter_DispQualityData()
|
|||
|
|
{
|
|||
|
|
s8 text[10];
|
|||
|
|
float quotient = 0;
|
|||
|
|
|
|||
|
|
Disp_Fld1PointOff();
|
|||
|
|
Disp_Fld1MultiOff();
|
|||
|
|
if(dcBuff.sampleData.staDPress.notConnect)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("---");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.underFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("-EE");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.overFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("+EE");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if(dcBuff.sampleData.weight >= 10000)
|
|||
|
|
{
|
|||
|
|
// <20><>ʾx1000
|
|||
|
|
Disp_Fld1MultiOn();
|
|||
|
|
|
|||
|
|
quotient = ((float) dcBuff.sampleData.weight) / 1000;
|
|||
|
|
if(quotient >= 1000)
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) quotient);
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ʾС<CABE><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
}
|
|||
|
|
else if(quotient >= 100)
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (quotient * 10));
|
|||
|
|
// <20><>ʾ1λС<CEBB><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
Disp_Fld1PointOn(1);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (quotient * 100));
|
|||
|
|
// <20><>ʾ2λС<CEBB><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
Disp_Fld1PointOn(2);
|
|||
|
|
}
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
}
|
|||
|
|
else // <20><><EFBFBD><EFBFBD>ʾС<CABE><D0A1>
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (dcBuff.sampleData.weight));
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><>ʾmmWC<57><43><EFBFBD><EFBFBD>
|
|||
|
|
void Meter_DispmmH2OData()
|
|||
|
|
{
|
|||
|
|
s8 text[10];
|
|||
|
|
float mmH2O = KPa2mmH2O(dcBuff.sampleData.diff);
|
|||
|
|
float quotient = 0;
|
|||
|
|
|
|||
|
|
Disp_Fld1PointOff();
|
|||
|
|
Disp_Fld1MultiOff();
|
|||
|
|
if(dcBuff.sampleData.staDPress.notConnect)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("---");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.underFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("-EE");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.overFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("+EE");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if(mmH2O >= 10000)
|
|||
|
|
{
|
|||
|
|
// <20><>ʾx1000
|
|||
|
|
Disp_Fld1MultiOn();
|
|||
|
|
|
|||
|
|
quotient = mmH2O / 1000;
|
|||
|
|
if(quotient >= 1000)
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) quotient);
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ʾС<CABE><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
}
|
|||
|
|
else if(quotient >= 100)
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (quotient * 10));
|
|||
|
|
// <20><>ʾ1λС<CEBB><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
Disp_Fld1PointOn(1);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (quotient * 100));
|
|||
|
|
// <20><>ʾ2λС<CEBB><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
Disp_Fld1PointOn(2);
|
|||
|
|
}
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
}
|
|||
|
|
else // <20><><EFBFBD><EFBFBD>ʾС<CABE><D0A1>
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (mmH2O));
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
void Meter_DispVolumeData()
|
|||
|
|
{
|
|||
|
|
s8 text[10];
|
|||
|
|
float quotient = 0;
|
|||
|
|
|
|||
|
|
Disp_Fld1PointOff();
|
|||
|
|
Disp_Fld1MultiOff();
|
|||
|
|
if(dcBuff.sampleData.staDPress.notConnect)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("---");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.underFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("-EE");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.overFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("+EE");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if(dcBuff.sampleData.volume >= 10000)
|
|||
|
|
{
|
|||
|
|
// <20><>ʾx1000
|
|||
|
|
Disp_Fld1MultiOn();
|
|||
|
|
|
|||
|
|
quotient = ((float) dcBuff.sampleData.volume) / 1000;
|
|||
|
|
if(quotient >= 1000)
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) quotient);
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ʾС<CABE><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
}
|
|||
|
|
else if(quotient >= 100)
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (quotient * 10));
|
|||
|
|
// <20><>ʾ1λС<CEBB><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
Disp_Fld1PointOn(1);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (quotient * 100));
|
|||
|
|
// <20><>ʾ2λС<CEBB><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
Disp_Fld1PointOn(2);
|
|||
|
|
}
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
}
|
|||
|
|
else // <20><><EFBFBD><EFBFBD>ʾС<CABE><D0A1>
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (dcBuff.sampleData.volume));
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><>ʾ<EFBFBD>ٷֱ<D9B7><D6B1><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
void Meter_DispPercentData()
|
|||
|
|
{
|
|||
|
|
s8 text[10];
|
|||
|
|
|
|||
|
|
Disp_Fld1PointOff();
|
|||
|
|
Disp_Fld1MultiOff();
|
|||
|
|
if(dcBuff.sampleData.staDPress.notConnect)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("---");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.underFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("-EE");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.overFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("+EE");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staDPress.full)
|
|||
|
|
{
|
|||
|
|
Disp_Fld1Text("FULL");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if(dcBuff.sampleData.volumePct >= 10000)
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", (uint16_t) (dcBuff.sampleData.volumePct / 100));
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%03d", (uint16_t) (dcBuff.sampleData.volumePct / 10));
|
|||
|
|
// <20><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>ʾ<EFBFBD><CABE>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
|
|||
|
|
if(text[0] == '0')
|
|||
|
|
Disp_Fld1Text(text + 1);
|
|||
|
|
else
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
Disp_Fld1PointOn(1);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><>ʾѹ<CABE><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
void Meter_DispPres1Data()
|
|||
|
|
{
|
|||
|
|
s8 text[10];
|
|||
|
|
|
|||
|
|
Disp_Fld4PointOff();
|
|||
|
|
if(dcBuff.sampleData.staPress.notConnect)
|
|||
|
|
{
|
|||
|
|
Disp_Fld4Text("---");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staPress.underFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld4Text("-EE");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staPress.overFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld4Text("+EE");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%03d", (uint16_t) ((dcBuff.sampleData.pressure + 5) / 10));
|
|||
|
|
Disp_Fld4Text(text);
|
|||
|
|
Disp_Fld4PointOn(2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Meter_DispPres2Data()
|
|||
|
|
{
|
|||
|
|
s8 text[10];
|
|||
|
|
|
|||
|
|
Disp_Fld3PointOff();
|
|||
|
|
if(dcBuff.sampleData.staExtPress[0].notConnect)
|
|||
|
|
{
|
|||
|
|
Disp_Fld3Text("---");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staExtPress[0].underFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld3Text("-EE");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staExtPress[0].overFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld3Text("+EE");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%03d", (uint16_t) ((dcBuff.sampleData.extPressure[0] + 5) / 100));
|
|||
|
|
Disp_Fld3Text(text);
|
|||
|
|
Disp_Fld3PointOn(1);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><>ʾ<EFBFBD>¶<EFBFBD><C2B6><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
void Meter_DispTemp1Data()
|
|||
|
|
{
|
|||
|
|
s8 text[10];
|
|||
|
|
|
|||
|
|
if(dcBuff.sampleData.staExtTempr[0].notConnect)
|
|||
|
|
{
|
|||
|
|
Disp_Fld3Text("---");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staExtTempr[0].underFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld3Text("-EE");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staExtTempr[0].overFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld3Text("+EE");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", dcBuff.sampleData.extTempr[0]);
|
|||
|
|
Disp_Fld3Text(text);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><>ʾ<EFBFBD>¶<EFBFBD><C2B6><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
void Meter_DispTemp2Data()
|
|||
|
|
{
|
|||
|
|
s8 text[10];
|
|||
|
|
|
|||
|
|
if(dcBuff.sampleData.staExtTempr[1].notConnect)
|
|||
|
|
{
|
|||
|
|
Disp_Fld4Text("---");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staExtTempr[1].underFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld4Text("-EE");
|
|||
|
|
}
|
|||
|
|
else if(dcBuff.sampleData.staExtTempr[1].overFlow)
|
|||
|
|
{
|
|||
|
|
Disp_Fld4Text("+EE");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%d", dcBuff.sampleData.extTempr[1]);
|
|||
|
|
Disp_Fld4Text(text);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
void Meter_DispVacuData()
|
|||
|
|
{
|
|||
|
|
s8 text[10];
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
|
if(dcBuff.configBottle.hideVacu)
|
|||
|
|
return;
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
|
if(dcBuff.sampleData.vacuum[0].staVacuum == VACUUM_STATUS_COMM_FAULT)
|
|||
|
|
return;
|
|||
|
|
|
|||
|
|
if(dcBuff.sampleData.vacuum[0].staVacuum == VACUUM_STATUS_FAULT || dcBuff.sampleData.vacuum[0].vacuum > 99.99999999)
|
|||
|
|
Disp_Fld2Text("+EE");
|
|||
|
|
else if(dcBuff.sampleData.vacuum[0].vacuum > 0.00999999)
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%04d", (uint16_t) (dcBuff.sampleData.vacuum[0].vacuum * 100));
|
|||
|
|
// <20><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>ʾ<EFBFBD><CABE>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
|
|||
|
|
if(text[0] == '0')
|
|||
|
|
Disp_Fld2Text(text + 1);
|
|||
|
|
else
|
|||
|
|
Disp_Fld2Text(text);
|
|||
|
|
Disp_Fld2PointOn(2);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
Disp_Fld2Text("-EE");
|
|||
|
|
|
|||
|
|
// <20><>ʾ<EFBFBD><CABE>λ
|
|||
|
|
Disp_Fld2UnitOn(UNIT_PV_PA);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ˢ<><CBA2>״̬<D7B4><CCAC>Ϣ<EFBFBD><CFA2>gprs<72>źţ<C5BA><C5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>
|
|||
|
|
void Meter_RefreshStatus()
|
|||
|
|
{
|
|||
|
|
Disp_WriteBattery((dcBuff.dtuData.batPct + 12) / 25);
|
|||
|
|
Disp_WriteStrength((dcBuff.dtuData.rssi + 12) / 25);
|
|||
|
|
Disp_WriteCommunication(!VCC_POWER_STATUS() && dcBuff.dtuData.batLow);
|
|||
|
|
Disp_WriteAlarm(0);
|
|||
|
|
Disp_WriteError(0);
|
|||
|
|
if(!dcBuff.configDisplay.op_ANTI_NORM_OPEN)
|
|||
|
|
Disp_WriteFill(Charge_Enabled || (Manual_Charing && Truck_Matched));
|
|||
|
|
else
|
|||
|
|
Disp_WriteFill(IS_NORM_OPEN_ENABLED());
|
|||
|
|
Disp_WritePower(VCC_POWER_STATUS());
|
|||
|
|
Disp_WriteGPS(dcBuff.dtuData.posState);
|
|||
|
|
Disp_WriteRF(RF_initStatus);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Meter_DispData()
|
|||
|
|
{
|
|||
|
|
if(!dcBuff.configDisplay.op_DISP_MMWC_ONLY)
|
|||
|
|
{
|
|||
|
|
Meter_DispNeedle();
|
|||
|
|
|
|||
|
|
if(dcBuff.configDisplay.L_Unit == UNIT_KPA)
|
|||
|
|
Meter_DispDiffData();
|
|||
|
|
else if(dcBuff.configDisplay.L_Unit == UNIT_KG)
|
|||
|
|
Meter_DispQualityData();
|
|||
|
|
else if(dcBuff.configDisplay.L_Unit == UNIT_L)
|
|||
|
|
Meter_DispVolumeData();
|
|||
|
|
else if(dcBuff.configDisplay.L_Unit == UNIT_MMH2O)
|
|||
|
|
Meter_DispmmH2OData();
|
|||
|
|
else
|
|||
|
|
Meter_DispPercentData();
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
Meter_DispmmH2OData();
|
|||
|
|
|
|||
|
|
if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
{
|
|||
|
|
Meter_DispVacuData();
|
|||
|
|
if(dcBuff.sampleData.staPress.notConnect && !dcBuff.sampleData.staExtTempr[1].notConnect)
|
|||
|
|
Meter_DispTemp2Data();
|
|||
|
|
else
|
|||
|
|
Meter_DispPres1Data();
|
|||
|
|
// if(dcBuff.sampleData.staExtTempr[0].notConnect && !dcBuff.sampleData.staExtPress[0].notConnect)
|
|||
|
|
Meter_DispPres2Data();
|
|||
|
|
// else
|
|||
|
|
// Meter_DispTemp1Data();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Meter_Disp()
|
|||
|
|
{
|
|||
|
|
s8 text[7] = "";
|
|||
|
|
u8 i;
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Disp_Clear();
|
|||
|
|
|
|||
|
|
Meter_RefreshStatus();
|
|||
|
|
if(formParam.meterPage == 0)
|
|||
|
|
{
|
|||
|
|
if(!dcBuff.configDisplay.op_DISP_MMWC_ONLY)
|
|||
|
|
Disp_SwitchSource(dcBuff.configBottle.source); // <20><>ʾҺԴ
|
|||
|
|
|
|||
|
|
if(dcBuff.configDisplay.op_DISP_MMWC_ONLY)
|
|||
|
|
Disp_SwitchDiffUnit(UNIT_MMH2O); // <20><>ʾ<EFBFBD><CABE>λ
|
|||
|
|
else
|
|||
|
|
Disp_SwitchDiffUnit(dcBuff.configDisplay.L_Unit); // <20><>ʾ<EFBFBD><CABE>λ
|
|||
|
|
|
|||
|
|
if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
{
|
|||
|
|
Disp_Fld2UnitOff();
|
|||
|
|
if(dcBuff.sampleData.staExtTempr[0].notConnect && !dcBuff.sampleData.staExtPress[0].notConnect)
|
|||
|
|
Disp_Fld3UnitOn(UNIT_PT_MPA);
|
|||
|
|
else
|
|||
|
|
Disp_Fld3UnitOn(UNIT_PT_C);
|
|||
|
|
if(dcBuff.sampleData.staPress.notConnect && !dcBuff.sampleData.staExtTempr[1].notConnect)
|
|||
|
|
Disp_Fld4UnitOn(UNIT_PT_C);
|
|||
|
|
else
|
|||
|
|
Disp_Fld4UnitOn(UNIT_PT_MPA);
|
|||
|
|
}
|
|||
|
|
Meter_DispData();
|
|||
|
|
}
|
|||
|
|
else if(formParam.meterPage == 1)
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD>ͳɹ<CDB3><C9B9><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
sprintf(text, "%d", dcBuff.powerInfo.gprsSuccCount % 10000);
|
|||
|
|
// sprintf(text, "%d %d", Motion_Detected, Motion_Status);
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
// <20><>λʱ<CEBB><CAB1>
|
|||
|
|
sprintf(text, "%02d%02d%02d", dcBuff.dtuData.sysTime.hour, dcBuff.dtuData.sysTime.minute,
|
|||
|
|
dcBuff.dtuData.sysTime.second);
|
|||
|
|
for(i = 0; i < 6; i++)
|
|||
|
|
Disp_DispChar(8 + i, text[i]);
|
|||
|
|
Disp_Fld3PointOn(1);
|
|||
|
|
Disp_Fld4PointOn(2);
|
|||
|
|
// <20><><EFBFBD>ص<EFBFBD>ѹ
|
|||
|
|
sprintf(text, "%03d", dcBuff.dtuData.batVoltage / 10);
|
|||
|
|
Disp_Fld2Text(text);
|
|||
|
|
Disp_Fld2PointOn(2);
|
|||
|
|
}
|
|||
|
|
else if(formParam.meterPage == 2)
|
|||
|
|
{
|
|||
|
|
// GPRS<52><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Disp_Fld1Text(dcBuff.powerInfo.gprsFailCode);
|
|||
|
|
// sprintf(text, "%d", SYS_RSTSTS); // <20><>λԭ<CEBB><D4AD>;
|
|||
|
|
// Disp_Fld1Text(text);
|
|||
|
|
// <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
|
|||
|
|
sprintf(text, "%02d%02d%02d", dcBuff.dtuData.sysTime.year, dcBuff.dtuData.sysTime.month,
|
|||
|
|
dcBuff.dtuData.sysTime.day);
|
|||
|
|
for(i = 0; i < 6; i++)
|
|||
|
|
Disp_DispChar(8 + i, text[i]);
|
|||
|
|
Disp_Fld3PointOn(1);
|
|||
|
|
Disp_Fld4PointOn(2);
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD>
|
|||
|
|
sprintf(text, "%d", (dcBuff.powerInfo.gprsSendCount - dcBuff.powerInfo.gprsSuccCount) % 10000);
|
|||
|
|
Disp_Fld2Text(text);
|
|||
|
|
}
|
|||
|
|
else // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>ֵ
|
|||
|
|
{
|
|||
|
|
// <20><>ʾKPa
|
|||
|
|
Disp_SwitchDiffUnit(UNIT_KPA);
|
|||
|
|
Meter_DispDiffData();
|
|||
|
|
// <20><>ʾ<EFBFBD>¶Ⱥ<C2B6>ѹ<EFBFBD><D1B9>
|
|||
|
|
// if(dcBuff.sampleData.staExtTempr[0].notConnect && !dcBuff.sampleData.staExtPress[0].notConnect)
|
|||
|
|
// {
|
|||
|
|
Disp_Fld3UnitOn(UNIT_PT_MPA);
|
|||
|
|
Meter_DispPres2Data();
|
|||
|
|
// }
|
|||
|
|
// else
|
|||
|
|
// {
|
|||
|
|
// Disp_Fld3UnitOn(UNIT_PT_C);
|
|||
|
|
// Meter_DispTemp1Data();
|
|||
|
|
// }
|
|||
|
|
if(dcBuff.sampleData.staPress.notConnect && !dcBuff.sampleData.staExtTempr[1].notConnect)
|
|||
|
|
{
|
|||
|
|
Disp_Fld4UnitOn(UNIT_PT_C);
|
|||
|
|
Meter_DispTemp2Data();
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Disp_Fld4UnitOn(UNIT_PT_MPA);
|
|||
|
|
Meter_DispPres1Data();
|
|||
|
|
}
|
|||
|
|
// <20><>ʾ<EFBFBD><CABE><EFBFBD>Խ<EFBFBD><D4BD><EFBFBD>
|
|||
|
|
Disp_WriteAlarm(1);
|
|||
|
|
Disp_WriteError(1);
|
|||
|
|
Disp_WriteFill(0);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Meter_Write_Bat_Volt(float volt)
|
|||
|
|
{
|
|||
|
|
if(volt < 3.74) // 20%
|
|||
|
|
Disp_WriteBattery(0);
|
|||
|
|
else if(volt < 3.79) // 40%
|
|||
|
|
Disp_WriteBattery(1);
|
|||
|
|
else if(volt < 3.87) // 60%
|
|||
|
|
Disp_WriteBattery(2);
|
|||
|
|
else if(volt < 3.98) // 80%
|
|||
|
|
Disp_WriteBattery(3);
|
|||
|
|
else
|
|||
|
|
Disp_WriteBattery(4);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>ڽ<EFBFBD><DABD><EFBFBD>ʵ<EFBFBD><CAB5>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// <20><>ѯ<EFBFBD>˵<EFBFBD>
|
|||
|
|
const char menu_000_items[][5] =
|
|||
|
|
{
|
|||
|
|
"PSN", "PARA", "PERI", "CALI", "RANG", "INFO",
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ò˵<C3B2>
|
|||
|
|
const char menu_001_items[][5] =
|
|||
|
|
{
|
|||
|
|
"PARA",
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// <20>궨<EFBFBD>˵<EFBFBD>
|
|||
|
|
const char menu_002_items[][5] =
|
|||
|
|
{
|
|||
|
|
"PSN", "PERI", "CALI", "RANG",
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>˵<EFBFBD>
|
|||
|
|
const char menu_200_items[][14][5] =
|
|||
|
|
{
|
|||
|
|
//apex {"TYPE", "SRC", "LEN", "DIE", "PCT", "LPCT", "DENS", "ALAR", "ALAH", "VOL", "4-20", "ADDR"},
|
|||
|
|
{"TYPE", "SRC", "LEN", "DIE", "PCT", "LPCT", "DENS", "P1-L", "P1-H","P2-L", "P2-H", "VOL", "4-20", "ADDR"},
|
|||
|
|
{"TYPE", "SRC", "LEN", "DIE", "PCT", "LPCT", "DENS", "VOL", "4-20", "ADDR"}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
|||
|
|
const char menu_210_items[][5] =
|
|||
|
|
{
|
|||
|
|
"STAN", "LIE", "BALL"
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
|||
|
|
const char menu_220_items[][5] =
|
|||
|
|
{
|
|||
|
|
"LNG", "O2", "N2", "AR", "CO2", "H2", "CNG", "HE", "C2H4", "LPG", "NH3", "PENT", "POPO"
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// 4-20mA<6D><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽѡ<CABD><D1A1>
|
|||
|
|
const char menu_285_items[][5] =
|
|||
|
|
{
|
|||
|
|
"RANG", "PCT"
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// <20>ϱ<EFBFBD><CFB1><EFBFBD><EFBFBD>ڲ˵<DAB2>
|
|||
|
|
const char menu_300_items[][5] =
|
|||
|
|
{
|
|||
|
|
"CAPT", "SEND"
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// <20>궨<EFBFBD>˵<EFBFBD>
|
|||
|
|
const char menu_400_items[][5][5] =
|
|||
|
|
{
|
|||
|
|
{"DIFF", "PRS1", "PRS2", "TEP1", "TEP2"},
|
|||
|
|
//{"CAP", "PRS1", "PRS2", "TEP1", "TEP2"}
|
|||
|
|
{"PRS1", "PRS2", "TEP1", "TEP2"}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ݱ궨<DDB1>˵<EFBFBD>
|
|||
|
|
const char menu_410_items[][3][5] =
|
|||
|
|
{
|
|||
|
|
{"LO", "HIGH", "OFFS"}, // <20>͵㡢<CDB5>ߵ㡢ƫ<E3A1A2>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD>㣩
|
|||
|
|
{"C1", "C2"}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// ѹ<><D1B9><EFBFBD>궨<EFBFBD>˵<EFBFBD>
|
|||
|
|
const char menu_420_items[][5] =
|
|||
|
|
{
|
|||
|
|
"LO", "HIGH"
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// <20>¶ȱ궨<C8B1>˵<EFBFBD>
|
|||
|
|
const char menu_430_items[][2][5] =
|
|||
|
|
{
|
|||
|
|
{"LO", "HIGH"},
|
|||
|
|
{"CALT", "CALR"}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>̲˵<CCB2>
|
|||
|
|
const char menu_500_items[][4][5] =
|
|||
|
|
{
|
|||
|
|
{"DIFF", "PRS1", "PRS2", "TEP1"},
|
|||
|
|
{"CAP", "PRS1", "PRS2", "TEP1"}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̲˵<CCB2>
|
|||
|
|
const char menu_510_items[][2][5] =
|
|||
|
|
{
|
|||
|
|
{"LO", "HIGH"},
|
|||
|
|
{"BASE", "REF"}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD>̲˵<CCB2>
|
|||
|
|
const char menu_520_items[][5] =
|
|||
|
|
{
|
|||
|
|
"LO", "HIGH"
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// <20>¶<EFBFBD><C2B6><EFBFBD><EFBFBD>̲˵<CCB2>
|
|||
|
|
const char menu_530_items[][5] =
|
|||
|
|
{
|
|||
|
|
"LO", "HIGH"
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͷ<EFBFBD><CDB6>壺<EFBFBD>¼<EFBFBD>
|
|||
|
|
typedef void (*TEvent)(void);
|
|||
|
|
typedef void (*TKeyEvent)(u8);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ڿؼ<DABF><D8BC>ṹ
|
|||
|
|
typedef struct
|
|||
|
|
{
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
TButton Button1; // <20><>ť<EFBFBD><C5A5><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
TEditBox Edit2; // <20>༭<EFBFBD><E0BCAD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루<EFBFBD><EBA3A8>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡһ<D1A1><D2BB>
|
|||
|
|
TSelectBox Select3; // ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루<EFBFBD><EBA3A8><EFBFBD>༭<EFBFBD><E0BCAD><EFBFBD><EFBFBD>ѡһ<D1A1><D2BB>
|
|||
|
|
TButton Button4; // <20><>ť<EFBFBD><C5A5>YES
|
|||
|
|
TButton Button5; // <20><>ť<EFBFBD><C5A5>ESC
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD>
|
|||
|
|
TEvent OnButton1; // <20><>ť1<C5A5>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
TEvent OnButton4; // <20><>ť4<C5A5>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
TEvent OnButton5; // <20><>ť5<C5A5>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
TEvent OnTimeOut; // <20><>ʱ<EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棩
|
|||
|
|
TEvent OnDrawOthers;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD>ϳ<EFBFBD><CFB3>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD>ţ<EFBFBD>ֱ<EFBFBD>ӵ<EFBFBD><D3B5>õײ㺯<D7B2><E3BAAF>ʵ<EFBFBD><CAB5>
|
|||
|
|
TKeyEvent OnKey; // Ĭ<>ϰ<EFBFBD><CFB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
u8 cursorId; // <20><>ǰ<EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD>0-<2D>ޣ<EFBFBD>1-Button1<6E><31>2-Edit2, 3-Select3<74><33>4-Button4, 5-Button5
|
|||
|
|
} TForm;
|
|||
|
|
|
|||
|
|
volatile u32 Form_timer = 0; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>,<2C><><EFBFBD>ڳ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
|
|||
|
|
volatile u16 Form_timeout = 4; // <20><>ʱʱ<CAB1><CAB1>
|
|||
|
|
volatile u8 Form_timeouted = 0; // <20>Ƿ<EFBFBD><C7B7><EFBFBD>ִ<EFBFBD>г<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ڽṹ
|
|||
|
|
TForm form;
|
|||
|
|
|
|||
|
|
void Form_ResetTimer()
|
|||
|
|
{
|
|||
|
|
S_RTC_TIME_DATA_T sRTC;
|
|||
|
|
|
|||
|
|
// <20><>ȡ<EFBFBD><C8A1>ǰʱ<C7B0><CAB1>
|
|||
|
|
RTC_GetDateAndTime(&sRTC);
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>gps<70><73>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|||
|
|
Form_timer = Calc_SecondsFromYear(INITIAL_YEAR, sRTC.u32Year, sRTC.u32Month, sRTC.u32Day,
|
|||
|
|
sRTC.u32Hour, sRTC.u32Minute, sRTC.u32Second);
|
|||
|
|
Form_timeouted = 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD>ؼ<EFBFBD>
|
|||
|
|
void Form_SetFocus()
|
|||
|
|
{
|
|||
|
|
if(form.cursorId == 1)
|
|||
|
|
Button_SetFocus(&form.Button1);
|
|||
|
|
else if(form.cursorId == 2)
|
|||
|
|
EditBox_SetFocus(&form.Edit2);
|
|||
|
|
else if(form.cursorId == 3)
|
|||
|
|
SelectBox_SetFocus(&form.Select3);
|
|||
|
|
else if(form.cursorId == 4)
|
|||
|
|
Button_SetFocus(&form.Button4);
|
|||
|
|
else if(form.cursorId == 5)
|
|||
|
|
Button_SetFocus(&form.Button5);
|
|||
|
|
else
|
|||
|
|
Disp_ClearCursor();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ؼ<EFBFBD>
|
|||
|
|
void Form_FocusFirst()
|
|||
|
|
{
|
|||
|
|
if(!form.Button1.hide)
|
|||
|
|
form.cursorId = 1;
|
|||
|
|
else if(!form.Edit2.hide)
|
|||
|
|
form.cursorId = 2;
|
|||
|
|
else if(!form.Select3.hide)
|
|||
|
|
form.cursorId = 3;
|
|||
|
|
else if(!form.Button4.hide)
|
|||
|
|
form.cursorId = 4;
|
|||
|
|
else if(!form.Button5.hide)
|
|||
|
|
form.cursorId = 5;
|
|||
|
|
else
|
|||
|
|
form.cursorId = 0;
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD>ؼ<EFBFBD>
|
|||
|
|
Form_SetFocus();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ؼ<EFBFBD>
|
|||
|
|
void Form_FocusNext()
|
|||
|
|
{
|
|||
|
|
if(form.cursorId == 1)
|
|||
|
|
{
|
|||
|
|
if(!form.Edit2.hide)
|
|||
|
|
form.cursorId = 2;
|
|||
|
|
else if(!form.Select3.hide)
|
|||
|
|
form.cursorId = 3;
|
|||
|
|
else if(!form.Button4.hide)
|
|||
|
|
form.cursorId = 4;
|
|||
|
|
else if(!form.Button5.hide)
|
|||
|
|
form.cursorId = 5;
|
|||
|
|
}
|
|||
|
|
else if(form.cursorId == 2)
|
|||
|
|
{
|
|||
|
|
if(!form.Select3.hide)
|
|||
|
|
form.cursorId = 3;
|
|||
|
|
else if(!form.Button4.hide)
|
|||
|
|
form.cursorId = 4;
|
|||
|
|
else if(!form.Button5.hide)
|
|||
|
|
form.cursorId = 5;
|
|||
|
|
else if(!form.Button1.hide)
|
|||
|
|
form.cursorId = 1;
|
|||
|
|
}
|
|||
|
|
else if(form.cursorId == 3)
|
|||
|
|
{
|
|||
|
|
if(!form.Button4.hide)
|
|||
|
|
form.cursorId = 4;
|
|||
|
|
else if(!form.Button5.hide)
|
|||
|
|
form.cursorId = 5;
|
|||
|
|
else if(!form.Button1.hide)
|
|||
|
|
form.cursorId = 1;
|
|||
|
|
else if(!form.Edit2.hide)
|
|||
|
|
form.cursorId = 2;
|
|||
|
|
}
|
|||
|
|
else if(form.cursorId == 4)
|
|||
|
|
{
|
|||
|
|
if(!form.Button5.hide)
|
|||
|
|
form.cursorId = 5;
|
|||
|
|
else if(!form.Button1.hide)
|
|||
|
|
form.cursorId = 1;
|
|||
|
|
else if(!form.Edit2.hide)
|
|||
|
|
form.cursorId = 2;
|
|||
|
|
else if(!form.Select3.hide)
|
|||
|
|
form.cursorId = 3;
|
|||
|
|
}
|
|||
|
|
else if(form.cursorId == 5)
|
|||
|
|
{
|
|||
|
|
if(!form.Button1.hide)
|
|||
|
|
form.cursorId = 1;
|
|||
|
|
else if(!form.Edit2.hide)
|
|||
|
|
form.cursorId = 2;
|
|||
|
|
else if(!form.Select3.hide)
|
|||
|
|
form.cursorId = 3;
|
|||
|
|
else if(!form.Button4.hide)
|
|||
|
|
form.cursorId = 4;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD>ؼ<EFBFBD>
|
|||
|
|
Form_SetFocus();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_OnKey(u8 key)
|
|||
|
|
{
|
|||
|
|
if(form.cursorId == 1 && Button_OnKey(&form.Button1, key) != KEY_INVALID)
|
|||
|
|
{
|
|||
|
|
if(key == KEY_FUNC)
|
|||
|
|
Form_FocusNext();
|
|||
|
|
else if(key == KEY_SET && form.OnButton1 != NULL)
|
|||
|
|
form.OnButton1();
|
|||
|
|
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
if(form.cursorId == 2 && EditBox_OnKey(&form.Edit2, key) != KEY_INVALID)
|
|||
|
|
{
|
|||
|
|
if(key == KEY_FUNC)
|
|||
|
|
Form_FocusNext();
|
|||
|
|
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
if(form.cursorId == 3 && SelectBox_OnKey(&form.Select3, key) != KEY_INVALID)
|
|||
|
|
{
|
|||
|
|
if(key == KEY_FUNC)
|
|||
|
|
Form_FocusNext();
|
|||
|
|
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
if(form.cursorId == 4 && Button_OnKey(&form.Button4, key) != KEY_INVALID)
|
|||
|
|
{
|
|||
|
|
if(key == KEY_FUNC)
|
|||
|
|
Form_FocusNext();
|
|||
|
|
else if(key == KEY_SET && form.OnButton4 != NULL)
|
|||
|
|
form.OnButton4();
|
|||
|
|
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
if(form.cursorId == 5 && Button_OnKey(&form.Button5, key) != KEY_INVALID)
|
|||
|
|
{
|
|||
|
|
if(key == KEY_FUNC)
|
|||
|
|
Form_FocusNext();
|
|||
|
|
else if(key == KEY_SET && form.OnButton5 != NULL)
|
|||
|
|
form.OnButton5();
|
|||
|
|
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(form.OnKey != NULL)
|
|||
|
|
form.OnKey(key);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ˢ<>¿ؼ<C2BF>
|
|||
|
|
void Form_RefreshCtrls()
|
|||
|
|
{
|
|||
|
|
if(!form.Button1.hide)
|
|||
|
|
Button_Refresh(&form.Button1);
|
|||
|
|
if(!form.Edit2.hide)
|
|||
|
|
EditBox_Refresh(&form.Edit2);
|
|||
|
|
if(!form.Select3.hide)
|
|||
|
|
SelectBox_Refresh(&form.Select3);
|
|||
|
|
if(!form.Button4.hide)
|
|||
|
|
Button_Refresh(&form.Button4);
|
|||
|
|
if(!form.Button5.hide)
|
|||
|
|
Button_Refresh(&form.Button5);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_Refresh()
|
|||
|
|
{
|
|||
|
|
if(form.OnDrawOthers != NULL)
|
|||
|
|
form.OnDrawOthers();
|
|||
|
|
Form_RefreshCtrls();
|
|||
|
|
|
|||
|
|
// ʵ<><CAB5>д<EFBFBD><D0B4>
|
|||
|
|
HT1621_Refresh();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_OnTimer()
|
|||
|
|
{
|
|||
|
|
S_RTC_TIME_DATA_T sRTC;
|
|||
|
|
|
|||
|
|
// <20>л<EFBFBD><D0BB><EFBFBD>˸״̬
|
|||
|
|
formParam.blinkVisible = !formParam.blinkVisible;
|
|||
|
|
Disp_SetBlinkVisible(formParam.blinkVisible);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|||
|
|
if(form.OnTimeOut != NULL && !Form_timeouted)
|
|||
|
|
{
|
|||
|
|
// <20><>ȡ<EFBFBD><C8A1>ǰʱ<C7B0><CAB1>
|
|||
|
|
RTC_GetDateAndTime(&sRTC);
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>gps<70><73>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|||
|
|
if(Calc_SecondsFromYear(INITIAL_YEAR, sRTC.u32Year, sRTC.u32Month, sRTC.u32Day,
|
|||
|
|
sRTC.u32Hour, sRTC.u32Minute, sRTC.u32Second) >= Form_timer + Form_timeout)
|
|||
|
|
{
|
|||
|
|
Form_timeouted = 1;
|
|||
|
|
form.OnTimeOut();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Form_Refresh();
|
|||
|
|
}
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܽ<EFBFBD><DCBD>溯<EFBFBD><E6BAAF>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// Ĭ<>ϳ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>鿴30<33>룬<EFBFBD><EBA3AC><EFBFBD><EFBFBD>60<36>룬<EFBFBD>궨120<32><30>
|
|||
|
|
#define OPERATE_TIMEOUT (formParam.privilege == 0 ? 30 : (formParam.privilege == 1 ? 60 : 120))
|
|||
|
|
#define METER_DISP_TIMEOUT 4 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棺4<E6A3BA><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
#define METER_TEST_TIMEOUT 60 // <20><><EFBFBD>Խ<EFBFBD><D4BD>棺1<E6A3BA><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
// <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
void Form_Return2Meter()
|
|||
|
|
{
|
|||
|
|
formParam.menuIdx[0] = 0;
|
|||
|
|
formParam.menuIdx[1] = 0;
|
|||
|
|
formParam.menuIdx[2] = 0;
|
|||
|
|
formParam.meterPage = 0;
|
|||
|
|
Change_Form(FORM_ID_METER);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룬<EFBFBD><EBA3AC><EFBFBD><EFBFBD><EFBFBD>ܽ<EFBFBD><DCBD>淵<EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD>ò˵<C3B2>
|
|||
|
|
void Form_Return2_000()
|
|||
|
|
{
|
|||
|
|
formParam.menuIdx[1] = 0;
|
|||
|
|
formParam.menuIdx[2] = 0;
|
|||
|
|
Change_Form(FORM_ID_000);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
void Form_Start_OnDrawOthers()
|
|||
|
|
{
|
|||
|
|
char psn[20];
|
|||
|
|
u8 i;
|
|||
|
|
|
|||
|
|
// <20><>ʾ13λPSN<53><4E>
|
|||
|
|
sprintf(psn, "20%02d%02d%02d%02d%03d", dcBuff.configBottle.PSN[0], dcBuff.configBottle.PSN[1],
|
|||
|
|
dcBuff.configBottle.PSN[2], dcBuff.configBottle.PSN[3],
|
|||
|
|
(dcBuff.configBottle.PSN[4] << 8) | dcBuff.configBottle.PSN[5]);
|
|||
|
|
for(i = 0; i < 13; i++)
|
|||
|
|
Disp_DispChar(i, psn[i]);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20>ؼ<DEBF><D8BC><EFBFBD>4<EFBFBD>볬ʱ
|
|||
|
|
void Form_Start_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
Button_Hide(&form.Button5);
|
|||
|
|
|
|||
|
|
Form_timeout = 4; // 4<>볬ʱ
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnDrawOthers = Form_Start_OnDrawOthers;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
void Form_Meter_OnDrawOthers()
|
|||
|
|
{
|
|||
|
|
// <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Meter_Disp();
|
|||
|
|
|
|||
|
|
// <20><>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
// Disp_WriteAlarm(1);
|
|||
|
|
// Disp_WriteError(1);
|
|||
|
|
// Disp_WriteFill(1);
|
|||
|
|
// Disp_WritePower(1);
|
|||
|
|
// Disp_WriteGPS(1);
|
|||
|
|
// Disp_WriteRF(1);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>泬ʱ
|
|||
|
|
void Form_Meter_OnTimeOut()
|
|||
|
|
{
|
|||
|
|
if(formParam.meterPage == 3)
|
|||
|
|
{
|
|||
|
|
formParam.meterPage = 0;
|
|||
|
|
Form_timeout = METER_DISP_TIMEOUT;
|
|||
|
|
|
|||
|
|
// ˢ<><CBA2><EFBFBD><EFBFBD>Ļ
|
|||
|
|
xSemaphoreGive(Key_Semaphore);
|
|||
|
|
}
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
LCD_Disabled = 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_Meter_OnKey(u8 key)
|
|||
|
|
{
|
|||
|
|
// <20><>FUNC<4E><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
if(key == KEY_FUNC)
|
|||
|
|
{
|
|||
|
|
formParam.privilege = 0;
|
|||
|
|
Change_Form(FORM_ID_PWD);
|
|||
|
|
}
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
else if(key == KEY_SET)
|
|||
|
|
{
|
|||
|
|
if(IS_ALARM_ON() && formParam.meterPage == 0)
|
|||
|
|
{
|
|||
|
|
// <20>ֶ<EFBFBD><D6B6>رձ<D8B1><D5B1><EFBFBD>
|
|||
|
|
KZ_ALARM_OFF();ALARM_OFF();
|
|||
|
|
|
|||
|
|
if(dcBuff.configDisplay.op_ALARM_OUTPUT && Alarm_Output)
|
|||
|
|
Alarm_Enabled = 0;
|
|||
|
|
if(dcBuff.configDisplay.op_LOW_ALARM_OUTPUT && Low_Alarm_Output)
|
|||
|
|
Low_Alarm_Enabled = 0;
|
|||
|
|
if(dcBuff.configDisplay.op_LEAK_ALARM_OUTPUT && Leak_Alarm_Output)
|
|||
|
|
Leak_Alarm_Enabled = 0;
|
|||
|
|
if(dcBuff.configDisplay.op_PRESS_ALARM_OUTPUT && Press_Alarm_Output)
|
|||
|
|
Press_Alarm_Enabled = 0;
|
|||
|
|
if(dcBuff.configDisplay.op_LOW_PRESS_ALARM_OUTPUT && Low_Press_Alarm_Output)
|
|||
|
|
Low_Press_Alarm_Enabled = 0;
|
|||
|
|
if(dcBuff.powerInfo.hardVer.major == 232 && ExtPress_Alarm_Output)
|
|||
|
|
ExtPress_Alarm_Enabled = 0;
|
|||
|
|
if(dcBuff.powerInfo.hardVer.major == 232 && Low_ExtPress_Alarm_Output)
|
|||
|
|
Low_ExtPress_Alarm_Enabled = 0;
|
|||
|
|
|
|||
|
|
Alarm_Output = 0;
|
|||
|
|
Low_Alarm_Output = 0;
|
|||
|
|
Leak_Alarm_Output = 0;
|
|||
|
|
Press_Alarm_Output = 0;
|
|||
|
|
Low_Press_Alarm_Output = 0;
|
|||
|
|
ExtPress_Alarm_Output = 0;
|
|||
|
|
Low_ExtPress_Alarm_Output = 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(dcBuff.configDisplay.op_LOW_ALARM_OUTPUT && formParam.meterPage == 0)
|
|||
|
|
{
|
|||
|
|
// <20>ֶ<EFBFBD><D6B6>رձ<D8B1><D5B1><EFBFBD>
|
|||
|
|
if(Low_Alarm_Enabled && IS_ALARM_ON())
|
|||
|
|
{
|
|||
|
|
Low_Alarm_Enabled = 0;
|
|||
|
|
KZ_ALARM_OFF();ALARM_OFF();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(dcBuff.configDisplay.op_LEAK_ALARM_OUTPUT && formParam.meterPage == 0)
|
|||
|
|
{
|
|||
|
|
// <20>ֶ<EFBFBD><D6B6><EFBFBD>й¶<D0B9><C2B6><EFBFBD><EFBFBD>
|
|||
|
|
if(Leak_Alarm_Enabled && IS_ALARM_ON())
|
|||
|
|
{
|
|||
|
|
Leak_Alarm_Enabled = 0;
|
|||
|
|
KZ_ALARM_OFF();ALARM_OFF();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(dcBuff.configDisplay.op_ANTI_OVERFILL && formParam.meterPage == 0)
|
|||
|
|
{
|
|||
|
|
// <20>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD>س<EFBFBD>װ
|
|||
|
|
Charge_Enabled = !Charge_Enabled;
|
|||
|
|
if(Charge_Enabled)
|
|||
|
|
Wakeup_SetAlarm(1);
|
|||
|
|
|
|||
|
|
// <20>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Sample_Notify();
|
|||
|
|
}
|
|||
|
|
if(dcBuff.configDisplay.op_ANTI_NORM_OPEN && formParam.meterPage == 0)
|
|||
|
|
{
|
|||
|
|
// <20>ֶ<EFBFBD><D6B6>ϵ磬<CFB5><E7A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
KZ_NORM_OPEN_ENABLE();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(RF_initStatus && !dcBuff.configDisplay.op_SEND_GPS_DATA && !dcBuff.configDisplay.op_BOX_VER && formParam.meterPage == 0)
|
|||
|
|
{
|
|||
|
|
printf("********* Manual_Charing = 1 ****\r\n");
|
|||
|
|
Manual_Charing = 1;
|
|||
|
|
Wakeup_SetAlarm(1);
|
|||
|
|
// <20>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Sample_Notify();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if(key == KEY_DOWN)
|
|||
|
|
{
|
|||
|
|
if(formParam.meterPage >= 3)
|
|||
|
|
formParam.meterPage = 0;
|
|||
|
|
else
|
|||
|
|
formParam.meterPage++;
|
|||
|
|
if(formParam.meterPage == 3)
|
|||
|
|
Form_timeout = METER_TEST_TIMEOUT;
|
|||
|
|
else
|
|||
|
|
Form_timeout = METER_DISP_TIMEOUT;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else if(key == KEY_UP)
|
|||
|
|
{
|
|||
|
|
if(formParam.meterPage == 0)
|
|||
|
|
{
|
|||
|
|
if(dcBuff.configDisplay.L_Unit == UNIT_PCT)
|
|||
|
|
dcBuff.configDisplay.L_Unit = UNIT_CAL;
|
|||
|
|
else
|
|||
|
|
dcBuff.configDisplay.L_Unit++;
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD>
|
|||
|
|
Check_L_Unit(key);
|
|||
|
|
}
|
|||
|
|
else if((formParam.meterPage == 1 || formParam.meterPage == 2) && Key_Wakeup)
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
strcpy(dcBuff.powerInfo.gprsFailCode, "");
|
|||
|
|
dcBuff.powerInfo.gprsSuccCount = 0;
|
|||
|
|
dcBuff.powerInfo.gprsSendCount = 0;
|
|||
|
|
if(formParam.meterPage == 1)
|
|||
|
|
{
|
|||
|
|
// ǿ<><C7BF><EFBFBD>ϴ<EFBFBD>
|
|||
|
|
DTU_dataConn = 1;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
// ǿ<><C7BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ά<EFBFBD><CEAC>ƽ̨
|
|||
|
|
DTU_ldmsConn = 1;
|
|||
|
|
// ǿ<>ƶ<EFBFBD>λ
|
|||
|
|
GPS_Located = 0;
|
|||
|
|
GPS_Locate = 1;
|
|||
|
|
}
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
DTU_semSync = 1;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20>ؼ<DEBF>
|
|||
|
|
void Form_Meter_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
Button_Hide(&form.Button5);
|
|||
|
|
|
|||
|
|
Form_timeout = METER_DISP_TIMEOUT;
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnDrawOthers = Form_Meter_OnDrawOthers;
|
|||
|
|
form.OnTimeOut = Form_Meter_OnTimeOut;
|
|||
|
|
form.OnKey = Form_Meter_OnKey;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD>߰<EFBFBD>ť
|
|||
|
|
void Form_Pwd_OnButton1()
|
|||
|
|
{
|
|||
|
|
if(strcmp(form.Edit2.text, "0ooo") == 0)
|
|||
|
|
Wakeup_SleepDown();
|
|||
|
|
else
|
|||
|
|
Form_Return2Meter();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_Pwd_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룬<EFBFBD><EBA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
|
|||
|
|
if(strcmp(form.Edit2.text, "oooo") == 0)
|
|||
|
|
{
|
|||
|
|
formParam.privilege = 0;
|
|||
|
|
Form_Return2_000();
|
|||
|
|
}
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><C3B4><EFBFBD><DEB2><EFBFBD>
|
|||
|
|
else if(strcmp(form.Edit2.text, dcBuff.configDisplay.pwd1) == 0)
|
|||
|
|
{
|
|||
|
|
formParam.privilege = 1;
|
|||
|
|
//Form_Return2_000();
|
|||
|
|
Change_Form(FORM_ID_200); // һ<><D2BB><EFBFBD>˵<EFBFBD>ֻ<EFBFBD><D6BB>һ<EFBFBD>ֱ<EEA3AC>ӽ<EFBFBD><D3BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD>
|
|||
|
|
}
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD><EFBFBD>ñ궨<C3B1>Ȳ<EFBFBD><C8B2><EFBFBD>
|
|||
|
|
else if(strcmp(form.Edit2.text, dcBuff.configDisplay.pwd2) == 0)
|
|||
|
|
{
|
|||
|
|
formParam.privilege = 2;
|
|||
|
|
Form_Return2_000();
|
|||
|
|
}
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3<EFBFBD><33><EFBFBD>鿴<EFBFBD><E9BFB4><EFBFBD>ն<EFBFBD>
|
|||
|
|
else if(strcmp(form.Edit2.text, "2323") == 0)
|
|||
|
|
{
|
|||
|
|
formParam.privilege = 0;
|
|||
|
|
Change_Form(FORM_ID_700);
|
|||
|
|
}
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺<EFBFBD><EBA3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
else
|
|||
|
|
Form_Return2Meter();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_Pwd_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Create(&form.Button1, 4, 3, "SLP");
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, "oooo");
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ý<EFBFBD><C3BD>㵽<EFBFBD><E3B5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
form.cursorId = 2;
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton1 = Form_Pwd_OnButton1;
|
|||
|
|
form.OnButton4 = Form_Pwd_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2Meter;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD>ò˵<C3B2><CBB5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_000_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
formParam.menuIdx[0] = form.Select3.idx;
|
|||
|
|
|
|||
|
|
if(formParam.privilege == 0)
|
|||
|
|
{
|
|||
|
|
switch(form.Select3.idx)
|
|||
|
|
{
|
|||
|
|
case 0: // <20><><EFBFBD><EFBFBD>PSN
|
|||
|
|
Change_Form(FORM_ID_100);
|
|||
|
|
break;
|
|||
|
|
case 1: // <20><><EFBFBD>ô<EFBFBD><C3B4><EFBFBD><DEB2><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_200);
|
|||
|
|
break;
|
|||
|
|
case 2: // <20><><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD><CFB1><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_300);
|
|||
|
|
break;
|
|||
|
|
case 3: // <20>궨
|
|||
|
|
if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
Change_Form(FORM_ID_400);
|
|||
|
|
else
|
|||
|
|
Change_Form(FORM_ID_410);
|
|||
|
|
break;
|
|||
|
|
case 4: // <20><><EFBFBD><EFBFBD>
|
|||
|
|
if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
Change_Form(FORM_ID_500);
|
|||
|
|
else
|
|||
|
|
Change_Form(FORM_ID_510);
|
|||
|
|
break;
|
|||
|
|
case 5: // <20><>Ϣ
|
|||
|
|
Change_Form(FORM_ID_600);
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if(formParam.privilege == 1) // <20><><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD><D8B7><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>Ϊһ<CEAA><D2BB><EFBFBD>˵<EFBFBD>ֻ<EFBFBD><D6BB>һ<EFBFBD><EFBFBD><EEA3AC>ֱ<EFBFBD>ӽ<EFBFBD><D3BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>
|
|||
|
|
{
|
|||
|
|
switch(form.Select3.idx)
|
|||
|
|
{
|
|||
|
|
case 0: // <20><><EFBFBD>ô<EFBFBD><C3B4><EFBFBD><DEB2><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_200);
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
switch(form.Select3.idx)
|
|||
|
|
{
|
|||
|
|
case 0: // <20><><EFBFBD><EFBFBD>PSN
|
|||
|
|
Change_Form(FORM_ID_100);
|
|||
|
|
break;
|
|||
|
|
case 1: // <20><><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD><CFB1><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_300);
|
|||
|
|
break;
|
|||
|
|
case 2: // <20>궨
|
|||
|
|
if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
Change_Form(FORM_ID_400);
|
|||
|
|
else
|
|||
|
|
Change_Form(FORM_ID_410);
|
|||
|
|
break;
|
|||
|
|
case 3: // <20><><EFBFBD><EFBFBD>
|
|||
|
|
if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
Change_Form(FORM_ID_500);
|
|||
|
|
else
|
|||
|
|
Change_Form(FORM_ID_510);
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_000_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
if(formParam.privilege == 0)
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, 6, menu_000_items, formParam.menuIdx[0]);
|
|||
|
|
else if(formParam.privilege == 1)
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, 1, menu_001_items, formParam.menuIdx[0]);
|
|||
|
|
else
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, 4, menu_002_items, formParam.menuIdx[0]);
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_000_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2Meter;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD>PSN<53><4E><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_100_OnButton4()
|
|||
|
|
{
|
|||
|
|
char psn[20];
|
|||
|
|
u16 serial;
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>PSN
|
|||
|
|
strcpy(psn, form.Edit2.text);
|
|||
|
|
|
|||
|
|
serial = atoi(psn + 10);
|
|||
|
|
dcBuff.configBottle.PSN[5] = serial & 0xFF;
|
|||
|
|
dcBuff.configBottle.PSN[4] = serial >> 8;
|
|||
|
|
|
|||
|
|
psn[10] = 0;
|
|||
|
|
dcBuff.configBottle.PSN[3] = atoi(psn + 8);
|
|||
|
|
psn[8] = 0;
|
|||
|
|
dcBuff.configBottle.PSN[2] = atoi(psn + 6);
|
|||
|
|
psn[6] = 0;
|
|||
|
|
dcBuff.configBottle.PSN[1] = atoi(psn + 4);
|
|||
|
|
psn[4] = 0;
|
|||
|
|
dcBuff.configBottle.PSN[0] = atoi(psn + 2);
|
|||
|
|
dcBuff.configBottle.updateFlag = 1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>־
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_000();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_100_Create()
|
|||
|
|
{
|
|||
|
|
char psn[20];
|
|||
|
|
|
|||
|
|
// <20><>ʾ13λPSN<53><4E>
|
|||
|
|
sprintf(psn, "20%02d%02d%02d%02d%03d", dcBuff.configBottle.PSN[0], dcBuff.configBottle.PSN[1],
|
|||
|
|
dcBuff.configBottle.PSN[2], dcBuff.configBottle.PSN[3],
|
|||
|
|
(dcBuff.configBottle.PSN[4] << 8) | dcBuff.configBottle.PSN[5]);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 13, psn);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_100_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_000;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD><DEB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_200_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
formParam.menuIdx[1] = form.Select3.idx;
|
|||
|
|
|
|||
|
|
switch(form.Select3.idx)
|
|||
|
|
{
|
|||
|
|
case 0: // <20><><EFBFBD><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_210);
|
|||
|
|
break;
|
|||
|
|
case 1: // ҺԴ
|
|||
|
|
Change_Form(FORM_ID_220);
|
|||
|
|
break;
|
|||
|
|
case 2: // <20><><EFBFBD><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_230);
|
|||
|
|
break;
|
|||
|
|
case 3: // ֱ<><D6B1>
|
|||
|
|
Change_Form(FORM_ID_240);
|
|||
|
|
break;
|
|||
|
|
case 4: // <20><>װ<EFBFBD><D7B0>
|
|||
|
|
Change_Form(FORM_ID_250);
|
|||
|
|
break;
|
|||
|
|
case 5: // <20><>Һλ<D2BA>ٷֱ<D9B7>
|
|||
|
|
Change_Form(FORM_ID_251);
|
|||
|
|
break;
|
|||
|
|
case 6: // <20>ܶ<EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_260);
|
|||
|
|
break;
|
|||
|
|
case 7: // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>
|
|||
|
|
// if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
Change_Form(FORM_ID_270);
|
|||
|
|
// else// <20>ݻ<EFBFBD>
|
|||
|
|
// Change_Form(FORM_ID_280);
|
|||
|
|
break;
|
|||
|
|
case 8: // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD>
|
|||
|
|
// if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
Change_Form(FORM_ID_271);
|
|||
|
|
// else // 4~20mA<6D><41><EFBFBD><EFBFBD>Һλ<D2BA>߶<EFBFBD>
|
|||
|
|
// Change_Form(FORM_ID_285);
|
|||
|
|
break;
|
|||
|
|
case 9: //apex ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>
|
|||
|
|
// if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
Change_Form(FORM_ID_272);
|
|||
|
|
// else// <20>ݻ<EFBFBD>
|
|||
|
|
// Change_Form(FORM_ID_280);
|
|||
|
|
break;
|
|||
|
|
case 10: //apex ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD>
|
|||
|
|
// if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
Change_Form(FORM_ID_273);
|
|||
|
|
// else // 4~20mA<6D><41><EFBFBD><EFBFBD>Һλ<D2BA>߶<EFBFBD>
|
|||
|
|
// Change_Form(FORM_ID_285);
|
|||
|
|
break;
|
|||
|
|
case 11: // <20>ݻ<EFBFBD>
|
|||
|
|
if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
Change_Form(FORM_ID_280);
|
|||
|
|
else // Modbusͨ<73>ŵ<EFBFBD>ַ
|
|||
|
|
Change_Form(FORM_ID_290);
|
|||
|
|
break;
|
|||
|
|
case 12:// 4~20mA<6D><41><EFBFBD><EFBFBD>Һλ<D2BA>߶<EFBFBD>
|
|||
|
|
if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
Change_Form(FORM_ID_285);
|
|||
|
|
break;
|
|||
|
|
case 13: // Modbusͨ<73>ŵ<EFBFBD>ַ
|
|||
|
|
if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
Change_Form(FORM_ID_290);
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_200_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY ? 10 : 14,
|
|||
|
|
menu_200_items[dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY], formParam.menuIdx[1]);
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_200_OnButton4;
|
|||
|
|
if(formParam.privilege == 0)
|
|||
|
|
form.OnButton5 = Form_Return2_000;
|
|||
|
|
else // <20><>һ<EFBFBD><D2BB><EFBFBD>˵<EFBFBD>
|
|||
|
|
form.OnButton5 = Form_Return2Meter;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
void Form_Return2_200()
|
|||
|
|
{
|
|||
|
|
formParam.menuIdx[2] = 0;
|
|||
|
|
Change_Form(FORM_ID_200);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_210_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
dcBuff.configBottle.type = form.Select3.idx;
|
|||
|
|
dcBuff.configBottle.updateFlag = 1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>־
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_200();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_210_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, 3, menu_210_items, dcBuff.configBottle.type);
|
|||
|
|
if(formParam.privilege == 1)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
SelectBox_ReadOnly(&form.Select3);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_210_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// ҺԴ<D2BA><D4B4><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_220_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ҺԴ
|
|||
|
|
dcBuff.configBottle.source = form.Select3.idx;
|
|||
|
|
dcBuff.configBottle.updateFlag = 1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>־
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_200();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_220_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, 13, menu_220_items, dcBuff.configBottle.source);
|
|||
|
|
if(formParam.privilege == 1)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
SelectBox_ReadOnly(&form.Select3);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_220_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD><DEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_230_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD>泤<EFBFBD><E6B3A4>
|
|||
|
|
dcBuff.configBottle.len = atoi(form.Edit2.text);
|
|||
|
|
dcBuff.configBottle.updateFlag = 1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>־
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_200();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_230_Create()
|
|||
|
|
{
|
|||
|
|
char len[8];
|
|||
|
|
sprintf(len, "%05d", dcBuff.configBottle.len);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 5, len);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 1)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_230_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_240_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1>
|
|||
|
|
dcBuff.configBottle.diameter = atoi(form.Edit2.text);
|
|||
|
|
dcBuff.configBottle.updateFlag = 1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>־
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_200();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_240_Create()
|
|||
|
|
{
|
|||
|
|
char diameter[8];
|
|||
|
|
sprintf(diameter, "%05d", dcBuff.configBottle.diameter);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 5, diameter);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 1)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_240_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_250_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0>
|
|||
|
|
dcBuff.configBottle.fullPct = atoi(form.Edit2.text) * 100;
|
|||
|
|
dcBuff.configBottle.updateFlag = 1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>־
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_200();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_250_Create()
|
|||
|
|
{
|
|||
|
|
char fullPct[8];
|
|||
|
|
sprintf(fullPct, "%02d", dcBuff.configBottle.fullPct / 100);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 1, 2, 2, fullPct);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 1)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_250_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><>Һλ<D2BA>ٷֱ<D9B7><D6B1><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_251_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0>
|
|||
|
|
dcBuff.configBottle.emptyPct = atoi(form.Edit2.text) * 100;
|
|||
|
|
dcBuff.configBottle.updateFlag = 1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>־
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_200();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_251_Create()
|
|||
|
|
{
|
|||
|
|
char emptyPct[8];
|
|||
|
|
sprintf(emptyPct, "%02d", dcBuff.configBottle.emptyPct / 100);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 1, 2, 2, emptyPct);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 1)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_251_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// Һ<><D2BA><EFBFBD>ܶ<EFBFBD><DCB6><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_260_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ܶ<EFBFBD>
|
|||
|
|
Config_SetDensity(dcBuff.configBottle.source, atoi(form.Edit2.text) * 0.001);
|
|||
|
|
dcBuff.configBottle.updateFlag = 1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>־
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_200();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_260_Create()
|
|||
|
|
{
|
|||
|
|
char density[8];
|
|||
|
|
sprintf(density, "%04d", (uint16_t) (Config_GetDensity(dcBuff.configBottle.source) * 1000));
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, density);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 1)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_260_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
void Form_DispPoint2()
|
|||
|
|
{
|
|||
|
|
Disp_Fld1MultiOff();
|
|||
|
|
Disp_Fld1PointOn(2);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_DispPoint1()
|
|||
|
|
{
|
|||
|
|
Disp_Fld1MultiOff();
|
|||
|
|
Disp_Fld1PointOn(1);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_270_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD>汨<EFBFBD><E6B1A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
dcBuff.configBottle.warnPress = atoi(form.Edit2.text) * 10;
|
|||
|
|
dcBuff.configBottle.updateFlag = 1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>־
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_200();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_270_Create()
|
|||
|
|
{
|
|||
|
|
char warnPress[8];
|
|||
|
|
sprintf(warnPress, "%03d", dcBuff.configBottle.warnPress / 10);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 1, 3, 3, warnPress);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 1)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnDrawOthers = Form_DispPoint2;
|
|||
|
|
form.OnButton4 = Form_270_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_271_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD>汨<EFBFBD><E6B1A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
dcBuff.configBottle.warnPressH = atoi(form.Edit2.text) * 10;
|
|||
|
|
dcBuff.configBottle.updateFlag = 1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>־
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_200();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_271_Create()
|
|||
|
|
{
|
|||
|
|
char warnPressH[8];
|
|||
|
|
sprintf(warnPressH, "%03d", dcBuff.configBottle.warnPressH / 10);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 1, 3, 3, warnPressH);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 1)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnDrawOthers = Form_DispPoint2;
|
|||
|
|
form.OnButton4 = Form_271_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//////////////apex/////////
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_272_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD>汨<EFBFBD><E6B1A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
dcBuff.configBottle.warnPress2 = atoi(form.Edit2.text) * 10;
|
|||
|
|
dcBuff.configBottle.updateFlag = 1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>־
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_200();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_272_Create()
|
|||
|
|
{
|
|||
|
|
char warnPress[8];
|
|||
|
|
sprintf(warnPress, "%04d", dcBuff.configBottle.warnPress2 / 10);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, warnPress);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 1)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnDrawOthers = Form_DispPoint2;
|
|||
|
|
form.OnButton4 = Form_272_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_273_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD>汨<EFBFBD><E6B1A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
dcBuff.configBottle.warnPressH2 = atoi(form.Edit2.text) * 10;
|
|||
|
|
dcBuff.configBottle.updateFlag = 1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>־
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_200();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_273_Create()
|
|||
|
|
{
|
|||
|
|
char warnPressH[8];
|
|||
|
|
sprintf(warnPressH, "%04d", dcBuff.configBottle.warnPressH2 / 10);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, warnPressH);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 1)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnDrawOthers = Form_DispPoint2;
|
|||
|
|
form.OnButton4 = Form_273_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ݻ<EFBFBD><DDBB><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
void Form_280_Create()
|
|||
|
|
{
|
|||
|
|
char volumeTotal[8];
|
|||
|
|
|
|||
|
|
Calculate_Theoretical_Params();
|
|||
|
|
sprintf(volumeTotal, "%06d", Theoretical_Param.v);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 6, volumeTotal);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_Return2_200;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#if 0
|
|||
|
|
// ********************************************
|
|||
|
|
// 4~20mA<6D><41><EFBFBD><EFBFBD>Һλ<D2BA>߶<EFBFBD><DFB6><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
void Form_285_OnButton1()
|
|||
|
|
{
|
|||
|
|
// <20>Զ<EFBFBD><D4B6>ɼ<EFBFBD><C9BC><EFBFBD>ѹֵ
|
|||
|
|
if(Comm_Sample())
|
|||
|
|
{
|
|||
|
|
sprintf(form.Edit2.text, "%05d", (uint16_t) KPa2mmH2O(dcBuff.sampleData.diff));
|
|||
|
|
form.cursorId = 4; // <20><><EFBFBD>굽ȷ<EAB5BD>ϰ<EFBFBD>ť
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
form.cursorId = 5; // <20><><EFBFBD>굽<EFBFBD><EAB5BD><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
Form_SetFocus();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_285_OnButton4()
|
|||
|
|
{
|
|||
|
|
dcBuff.configSensor.levelOutMMWC = atoi(form.Edit2.text);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_200();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_285_Create()
|
|||
|
|
{
|
|||
|
|
char mmWC[10];
|
|||
|
|
|
|||
|
|
sprintf(mmWC, "%05d", dcBuff.configSensor.levelOutMMWC);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 5, mmWC);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 1)
|
|||
|
|
{
|
|||
|
|
Button_Create(&form.Button1, 4, 3, "AUT");
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton1 = Form_285_OnButton1;
|
|||
|
|
form.OnButton4 = Form_285_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
#else
|
|||
|
|
// ********************************************
|
|||
|
|
// 4~20mA<6D><41><EFBFBD><EFBFBD>Һλ<D2BA><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_285_OnButton4()
|
|||
|
|
{
|
|||
|
|
dcBuff.configDisplay.op_420MA_OUT_PCT = form.Select3.idx;
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_200();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_285_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, 2, menu_285_items, dcBuff.configDisplay.op_420MA_OUT_PCT);
|
|||
|
|
if(formParam.privilege == 1)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
SelectBox_ReadOnly(&form.Select3);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_285_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// Modbusͨ<73>ŵ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_290_OnButton4()
|
|||
|
|
{
|
|||
|
|
int16_t addr = atoi(form.Edit2.text);
|
|||
|
|
|
|||
|
|
if(addr < 1 || addr > 247)
|
|||
|
|
{
|
|||
|
|
form.cursorId = 2;
|
|||
|
|
Form_SetFocus();
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
dcBuff.configBottle.addr = addr;
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_200();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_290_Create()
|
|||
|
|
{
|
|||
|
|
char addr[10];
|
|||
|
|
|
|||
|
|
sprintf(addr, "%03d", dcBuff.configBottle.addr);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 1, 3, 3, addr);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 1)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_290_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_200;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_300_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
formParam.menuIdx[1] = form.Select3.idx;
|
|||
|
|
|
|||
|
|
switch(form.Select3.idx)
|
|||
|
|
{
|
|||
|
|
case 0: // <20>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_310);
|
|||
|
|
break;
|
|||
|
|
case 1: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_320);
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_300_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, 2, menu_300_items, formParam.menuIdx[1]);
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_300_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_000;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_Return2_300()
|
|||
|
|
{
|
|||
|
|
formParam.menuIdx[2] = 0;
|
|||
|
|
Change_Form(FORM_ID_300);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_310_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
dcBuff.configData.intervalSample = atoi(form.Edit2.text);
|
|||
|
|
dcBuff.configBottle.updateFlag = 1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>־
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_300();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_310_Create()
|
|||
|
|
{
|
|||
|
|
char intervalSample[8];
|
|||
|
|
sprintf(intervalSample, "%04d", dcBuff.configData.intervalSample);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, intervalSample);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_310_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_300;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20>ϱ<EFBFBD><CFB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_320_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
dcBuff.configData.intervalTrans = atoi(form.Edit2.text);
|
|||
|
|
dcBuff.configBottle.updateFlag = 1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>־
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_300();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_320_Create()
|
|||
|
|
{
|
|||
|
|
char intervalTrans[8];
|
|||
|
|
sprintf(intervalTrans, "%06d", dcBuff.configData.intervalTrans);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 6, intervalTrans);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_320_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_300;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20>궨<EFBFBD><EAB6A8><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_400_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
formParam.menuIdx[1] = form.Select3.idx;
|
|||
|
|
|
|||
|
|
switch(form.Select3.idx)
|
|||
|
|
{
|
|||
|
|
case 0:
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR) // <20><>ѹ<EFBFBD>궨
|
|||
|
|
Change_Form(FORM_ID_410);
|
|||
|
|
else // ѹ<><D1B9>1<EFBFBD>궨
|
|||
|
|
{
|
|||
|
|
formParam.caliIdx = 0;
|
|||
|
|
Change_Form(FORM_ID_420);
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
case 1:
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR) // ѹ<><D1B9>1<EFBFBD>궨
|
|||
|
|
{
|
|||
|
|
formParam.caliIdx = 0;
|
|||
|
|
Change_Form(FORM_ID_420);
|
|||
|
|
}
|
|||
|
|
else // ѹ<><D1B9>2<EFBFBD>궨
|
|||
|
|
{
|
|||
|
|
formParam.caliIdx = 1;
|
|||
|
|
Change_Form(FORM_ID_420);
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
case 2:
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR) // ѹ<><D1B9>2<EFBFBD>궨
|
|||
|
|
{
|
|||
|
|
formParam.caliIdx = 1;
|
|||
|
|
Change_Form(FORM_ID_420);
|
|||
|
|
}
|
|||
|
|
else // <20>¶<EFBFBD>1<EFBFBD>궨
|
|||
|
|
{
|
|||
|
|
formParam.caliIdx = 0;
|
|||
|
|
Change_Form(FORM_ID_430);
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
case 3:
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR) // <20>¶<EFBFBD>1<EFBFBD>궨
|
|||
|
|
{
|
|||
|
|
formParam.caliIdx = 0;
|
|||
|
|
Change_Form(FORM_ID_430);
|
|||
|
|
}
|
|||
|
|
else // <20>¶<EFBFBD>2<EFBFBD>궨
|
|||
|
|
{
|
|||
|
|
formParam.caliIdx = 1;
|
|||
|
|
Change_Form(FORM_ID_430);
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
case 4:
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR) // <20>¶<EFBFBD>2<EFBFBD>궨
|
|||
|
|
{
|
|||
|
|
formParam.caliIdx = 1;
|
|||
|
|
Change_Form(FORM_ID_430);
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_400_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
// 3<><33><EFBFBD><EFBFBD><EFBFBD>¶ȴ<C2B6><C8B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>궨(<28><>v84<38><34>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32>/3<><33><EFBFBD><EFBFBD>)
|
|||
|
|
// SelectBox_Create(&form.Select3, 0, 4, dcBuff.configDisplay.op_PT100_3LINE ? 3 : 5, menu_400_items[dcBuff.configDisplay.op_USE_CAPACITY_SENSOR], formParam.menuIdx[1]);
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, dcBuff.configDisplay.op_USE_CAPACITY_SENSOR ? 4 : 5, menu_400_items[dcBuff.configDisplay.op_USE_CAPACITY_SENSOR], formParam.menuIdx[1]);
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_400_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_000;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
void Form_Return2_400()
|
|||
|
|
{
|
|||
|
|
formParam.menuIdx[2] = 0;
|
|||
|
|
Change_Form(FORM_ID_400);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD>ݱ궨<DDB1><EAB6A8><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_410_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
formParam.menuIdx[2] = form.Select3.idx;
|
|||
|
|
|
|||
|
|
switch(form.Select3.idx)
|
|||
|
|
{
|
|||
|
|
case 0: // C1<43><31><EFBFBD>ݱ궨
|
|||
|
|
Change_Form(FORM_ID_411);
|
|||
|
|
break;
|
|||
|
|
case 1: // C2<43><32><EFBFBD>ݱ궨
|
|||
|
|
Change_Form(FORM_ID_412);
|
|||
|
|
break;
|
|||
|
|
case 2: // ƫ<>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD>㣩<EFBFBD>궨
|
|||
|
|
Change_Form(FORM_ID_413);
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_410_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, dcBuff.configDisplay.op_USE_CAPACITY_SENSOR ? 2 : 3,
|
|||
|
|
menu_410_items[dcBuff.configDisplay.op_USE_CAPACITY_SENSOR], formParam.menuIdx[2]);
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_410_OnButton4;
|
|||
|
|
if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
form.OnButton5 = Form_Return2_400;
|
|||
|
|
else
|
|||
|
|
form.OnButton5 = Form_Return2_000;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
void Form_Return2_410()
|
|||
|
|
{
|
|||
|
|
Change_Form(FORM_ID_410);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// C1<43><31><EFBFBD>ݱ궨<DDB1><EAB6A8><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
void Form_411_OnButton1()
|
|||
|
|
{
|
|||
|
|
// <20>Զ<EFBFBD><D4B6>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>ADֵ
|
|||
|
|
if(Comm_Sample())
|
|||
|
|
{
|
|||
|
|
sprintf(form.Edit2.text, "%04d", dcBuff.sampleData.adDPress);
|
|||
|
|
form.cursorId = 4; // <20><><EFBFBD>굽ȷ<EAB5BD>ϰ<EFBFBD>ť
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
form.cursorId = 5; // <20><><EFBFBD>굽<EFBFBD><EAB5BD><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
Form_SetFocus();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_411_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>C1
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR)
|
|||
|
|
dcBuff.configSensor.sensorDPress.zeroValue = atoi(form.Edit2.text);
|
|||
|
|
else
|
|||
|
|
dcBuff.configSensor.sensorCap.c1ADC = atoi(form.Edit2.text);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_410();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_411_Create()
|
|||
|
|
{
|
|||
|
|
char c1[10];
|
|||
|
|
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR)
|
|||
|
|
sprintf(c1, "%04d", dcBuff.configSensor.sensorDPress.zeroValue);
|
|||
|
|
else
|
|||
|
|
sprintf(c1, "%04d", dcBuff.configSensor.sensorCap.c1ADC);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, c1);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
{
|
|||
|
|
Button_Create(&form.Button1, 4, 3, "AUT");
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton1 = Form_411_OnButton1;
|
|||
|
|
form.OnButton4 = Form_411_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_410;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// C2<43><32><EFBFBD>ݱ궨<DDB1><EAB6A8><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_412_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>C2
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR)
|
|||
|
|
dcBuff.configSensor.sensorDPress.fullValue = atoi(form.Edit2.text);
|
|||
|
|
else
|
|||
|
|
dcBuff.configSensor.sensorCap.c2ADC = atoi(form.Edit2.text);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_410();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_412_Create()
|
|||
|
|
{
|
|||
|
|
char c2[10];
|
|||
|
|
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR)
|
|||
|
|
sprintf(c2, "%04d", dcBuff.configSensor.sensorDPress.fullValue);
|
|||
|
|
else
|
|||
|
|
sprintf(c2, "%04d", dcBuff.configSensor.sensorCap.c2ADC);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, c2);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
{
|
|||
|
|
Button_Create(&form.Button1, 4, 3, "AUT");
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton1 = Form_411_OnButton1;
|
|||
|
|
form.OnButton4 = Form_412_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_410;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// ƫ<>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD>㣩<EFBFBD>궨<EFBFBD><EAB6A8><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_413_OnButton4()
|
|||
|
|
{
|
|||
|
|
int32_t range = dcBuff.configSensor.sensorDPress.fullValue - dcBuff.configSensor.sensorDPress.zeroValue;
|
|||
|
|
dcBuff.configSensor.sensorDPress.zeroValue = atoi(form.Edit2.text);
|
|||
|
|
dcBuff.configSensor.sensorDPress.fullValue = dcBuff.configSensor.sensorDPress.zeroValue + range;
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_410();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_413_Create()
|
|||
|
|
{
|
|||
|
|
char c1[10];
|
|||
|
|
|
|||
|
|
sprintf(c1, "%04d", dcBuff.configSensor.sensorDPress.zeroValue);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, c1);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
{
|
|||
|
|
Button_Create(&form.Button1, 4, 3, "AUT");
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton1 = Form_411_OnButton1;
|
|||
|
|
form.OnButton4 = Form_413_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_410;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// ѹ<><D1B9><EFBFBD>궨<EFBFBD><EAB6A8><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_420_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
formParam.menuIdx[2] = form.Select3.idx;
|
|||
|
|
|
|||
|
|
switch(form.Select3.idx)
|
|||
|
|
{
|
|||
|
|
case 0: // <20><>ѹ<EFBFBD><D1B9><EFBFBD>궨
|
|||
|
|
Change_Form(FORM_ID_421);
|
|||
|
|
break;
|
|||
|
|
case 1: // <20><>ѹ<EFBFBD><D1B9><EFBFBD>궨
|
|||
|
|
Change_Form(FORM_ID_422);
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_420_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, 2, menu_420_items, formParam.menuIdx[2]);
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_420_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_400;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
void Form_Return2_420()
|
|||
|
|
{
|
|||
|
|
Change_Form(FORM_ID_420);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><>ѹ<EFBFBD><D1B9><EFBFBD>궨<EFBFBD><EAB6A8><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
void Form_421_OnButton1()
|
|||
|
|
{
|
|||
|
|
// <20>Զ<EFBFBD><D4B6>ɼ<EFBFBD>ѹ<EFBFBD><D1B9>ADֵ
|
|||
|
|
if(Comm_Sample())
|
|||
|
|
{
|
|||
|
|
if(formParam.caliIdx == 0)
|
|||
|
|
sprintf(form.Edit2.text, "%04d", dcBuff.sampleData.adPress);
|
|||
|
|
else
|
|||
|
|
sprintf(form.Edit2.text, "%04d", dcBuff.sampleData.adExtPress[0]);
|
|||
|
|
form.cursorId = 4; // <20><><EFBFBD>굽ȷ<EAB5BD>ϰ<EFBFBD>ť
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
form.cursorId = 5; // <20><><EFBFBD>굽<EFBFBD><EAB5BD><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
Form_SetFocus();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_421_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9>
|
|||
|
|
if(formParam.caliIdx == 0)
|
|||
|
|
dcBuff.configSensor.sensorPress.zeroValue = atoi(form.Edit2.text);
|
|||
|
|
else
|
|||
|
|
dcBuff.configSensor.sensorEPress[0].zeroValue = atoi(form.Edit2.text);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_420();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_421_Create()
|
|||
|
|
{
|
|||
|
|
char press[10];
|
|||
|
|
|
|||
|
|
if(formParam.caliIdx == 0)
|
|||
|
|
sprintf(press, "%04d", dcBuff.configSensor.sensorPress.zeroValue);
|
|||
|
|
else
|
|||
|
|
sprintf(press, "%04d", dcBuff.configSensor.sensorEPress[0].zeroValue);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, press);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
{
|
|||
|
|
Button_Create(&form.Button1, 4, 3, "AUT");
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton1 = Form_421_OnButton1;
|
|||
|
|
form.OnButton4 = Form_421_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_420;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><>ѹ<EFBFBD><D1B9><EFBFBD>궨<EFBFBD><EAB6A8><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_422_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9>
|
|||
|
|
if(formParam.caliIdx == 0)
|
|||
|
|
dcBuff.configSensor.sensorPress.fullValue = atoi(form.Edit2.text);
|
|||
|
|
else
|
|||
|
|
dcBuff.configSensor.sensorEPress[0].fullValue = atoi(form.Edit2.text);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_420();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_422_Create()
|
|||
|
|
{
|
|||
|
|
char press[10];
|
|||
|
|
|
|||
|
|
if(formParam.caliIdx == 0)
|
|||
|
|
sprintf(press, "%04d", dcBuff.configSensor.sensorPress.fullValue);
|
|||
|
|
else
|
|||
|
|
sprintf(press, "%04d", dcBuff.configSensor.sensorEPress[0].fullValue);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, press);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
{
|
|||
|
|
Button_Create(&form.Button1, 4, 3, "AUT");
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton1 = Form_421_OnButton1;
|
|||
|
|
form.OnButton4 = Form_422_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_420;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20>¶ȱ궨<C8B1><EAB6A8><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_430_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
formParam.menuIdx[2] = form.Select3.idx;
|
|||
|
|
|
|||
|
|
switch(form.Select3.idx)
|
|||
|
|
{
|
|||
|
|
case 0: // <20><><EFBFBD>±궨
|
|||
|
|
Change_Form(FORM_ID_431);
|
|||
|
|
break;
|
|||
|
|
case 1: // <20><><EFBFBD>±궨
|
|||
|
|
Change_Form(FORM_ID_432);
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_430_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
if(formParam.caliIdx == 0)
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, 2, menu_430_items[dcBuff.configDisplay.op_USE_PT100_SENSOR], formParam.menuIdx[2]);
|
|||
|
|
else
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, 2, menu_430_items[1], formParam.menuIdx[2]);
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_430_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_400;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
void Form_Return2_430()
|
|||
|
|
{
|
|||
|
|
Change_Form(FORM_ID_430);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD>±궨<C2B1><EAB6A8><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
void Form_431_OnButton1()
|
|||
|
|
{
|
|||
|
|
// <20>Զ<EFBFBD><D4B6>ɼ<EFBFBD><C9BC>¶<EFBFBD>ADֵ
|
|||
|
|
if(Comm_Sample())
|
|||
|
|
{
|
|||
|
|
sprintf(form.Edit2.text, "%04d", dcBuff.sampleData.adExtTempr[formParam.caliIdx]);
|
|||
|
|
form.cursorId = 4; // <20><><EFBFBD>굽ȷ<EAB5BD>ϰ<EFBFBD>ť
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
form.cursorId = 5; // <20><><EFBFBD>굽<EFBFBD><EAB5BD><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
Form_SetFocus();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_431_OnButton4()
|
|||
|
|
{
|
|||
|
|
if(formParam.caliIdx == 0 && !dcBuff.configDisplay.op_USE_PT100_SENSOR)
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>
|
|||
|
|
dcBuff.configSensor.sensorMTempr[formParam.caliIdx].zeroValue = atoi(form.Edit2.text);
|
|||
|
|
else
|
|||
|
|
// <20><><EFBFBD><EFBFBD>У<D0A3>¶<EFBFBD>
|
|||
|
|
dcBuff.configSensor.sensorPTempr[formParam.caliIdx].calibrateT = atoi(form.Edit2.text);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_430();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_431_Create()
|
|||
|
|
{
|
|||
|
|
char tempr[10];
|
|||
|
|
|
|||
|
|
if(formParam.caliIdx == 0 && !dcBuff.configDisplay.op_USE_PT100_SENSOR)
|
|||
|
|
sprintf(tempr, "%04d", dcBuff.configSensor.sensorMTempr[formParam.caliIdx].zeroValue);
|
|||
|
|
else
|
|||
|
|
sprintf(tempr, "%04d", dcBuff.configSensor.sensorPTempr[formParam.caliIdx].calibrateT);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, tempr);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
{
|
|||
|
|
if(formParam.caliIdx == 0 && !dcBuff.configDisplay.op_USE_PT100_SENSOR)
|
|||
|
|
Button_Create(&form.Button1, 4, 3, "AUT");
|
|||
|
|
else
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
if(formParam.caliIdx == 0 && !dcBuff.configDisplay.op_USE_PT100_SENSOR)
|
|||
|
|
form.OnButton1 = Form_431_OnButton1;
|
|||
|
|
else
|
|||
|
|
form.OnDrawOthers = Form_DispPoint1;
|
|||
|
|
form.OnButton4 = Form_431_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_430;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD>±궨<C2B1><EAB6A8><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
void Form_432_OnButton1()
|
|||
|
|
{
|
|||
|
|
// <20>Զ<EFBFBD><D4B6>ɼ<EFBFBD><C9BC>¶<EFBFBD>ADֵ
|
|||
|
|
if(Comm_Sample())
|
|||
|
|
{
|
|||
|
|
if(formParam.caliIdx == 0 && !dcBuff.configDisplay.op_USE_PT100_SENSOR)
|
|||
|
|
sprintf(form.Edit2.text, "%04d", dcBuff.sampleData.adExtTempr[formParam.caliIdx]);
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if(dcBuff.configDisplay.op_DIFF_RESIST)
|
|||
|
|
sprintf(form.Edit2.text, "%04d", (int16_t) dcBuff.sampleData.adExtTempr[formParam.caliIdx]); // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
|
else
|
|||
|
|
sprintf(form.Edit2.text, "%04d", (int16_t) PT100_CalResit(dcBuff.sampleData.adExtTempr[formParam.caliIdx], 0)); // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
|
}
|
|||
|
|
form.cursorId = 4; // <20><><EFBFBD>굽ȷ<EAB5BD>ϰ<EFBFBD>ť
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
form.cursorId = 5; // <20><><EFBFBD>굽<EFBFBD><EAB5BD><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
Form_SetFocus();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_432_OnButton4()
|
|||
|
|
{
|
|||
|
|
if(formParam.caliIdx == 0 && !dcBuff.configDisplay.op_USE_PT100_SENSOR)
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>
|
|||
|
|
dcBuff.configSensor.sensorMTempr[formParam.caliIdx].fullValue = atoi(form.Edit2.text);
|
|||
|
|
else
|
|||
|
|
// <20><><EFBFBD><EFBFBD>У<D0A3><D7BC><EFBFBD><EFBFBD>
|
|||
|
|
dcBuff.configSensor.sensorPTempr[formParam.caliIdx].calibrateR = atoi(form.Edit2.text) * 10; // <20><><EFBFBD>棺0.1<EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_430();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_432_Create()
|
|||
|
|
{
|
|||
|
|
char tempr[10];
|
|||
|
|
|
|||
|
|
if(formParam.caliIdx == 0 && !dcBuff.configDisplay.op_USE_PT100_SENSOR)
|
|||
|
|
sprintf(tempr, "%04d", dcBuff.configSensor.sensorMTempr[formParam.caliIdx].fullValue);
|
|||
|
|
else
|
|||
|
|
sprintf(tempr, "%04d", dcBuff.configSensor.sensorPTempr[formParam.caliIdx].calibrateR / 10); // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, tempr);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
{
|
|||
|
|
Button_Create(&form.Button1, 4, 3, "AUT");
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
if(formParam.caliIdx == 0 && dcBuff.configDisplay.op_USE_PT100_SENSOR)
|
|||
|
|
{
|
|||
|
|
//form.OnDrawOthers = Form_DispPoint1; // <20><><EFBFBD><EFBFBD>ʾС<CABE><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
}
|
|||
|
|
form.OnButton1 = Form_432_OnButton1;
|
|||
|
|
form.OnButton4 = Form_432_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_430;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_500_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
formParam.menuIdx[1] = form.Select3.idx;
|
|||
|
|
|
|||
|
|
switch(form.Select3.idx)
|
|||
|
|
{
|
|||
|
|
case 0: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_510);
|
|||
|
|
break;
|
|||
|
|
case 1: // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
case 2:
|
|||
|
|
formParam.caliIdx = form.Select3.idx - 1;
|
|||
|
|
Change_Form(FORM_ID_520);
|
|||
|
|
break;
|
|||
|
|
case 3: // <20>¶<EFBFBD><C2B6><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
formParam.caliIdx = form.Select3.idx - 3;
|
|||
|
|
Change_Form(FORM_ID_530);
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_500_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
// PT100<30>¶ȴ<C2B6><C8B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, dcBuff.configDisplay.op_USE_PT100_SENSOR ? 3 : 4, menu_500_items[dcBuff.configDisplay.op_USE_CAPACITY_SENSOR], formParam.menuIdx[1]);
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_500_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_000;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
void Form_Return2_500()
|
|||
|
|
{
|
|||
|
|
formParam.menuIdx[2] = 0;
|
|||
|
|
Change_Form(FORM_ID_500);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_510_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
formParam.menuIdx[2] = form.Select3.idx;
|
|||
|
|
|
|||
|
|
switch(form.Select3.idx)
|
|||
|
|
{
|
|||
|
|
case 0: // <20><EFBFBD><D7B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_511);
|
|||
|
|
break;
|
|||
|
|
case 1: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_512);
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_510_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, 2, menu_510_items[dcBuff.configDisplay.op_USE_CAPACITY_SENSOR], formParam.menuIdx[2]);
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_510_OnButton4;
|
|||
|
|
if(!dcBuff.configDisplay.op_LEVEL_SENSOR_ONLY)
|
|||
|
|
form.OnButton5 = Form_Return2_500;
|
|||
|
|
else
|
|||
|
|
form.OnButton5 = Form_Return2_000;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
void Form_Return2_510()
|
|||
|
|
{
|
|||
|
|
Change_Form(FORM_ID_510);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><EFBFBD><D7B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
void Form_511_OnButton1()
|
|||
|
|
{
|
|||
|
|
// <20>Զ<EFBFBD><D4B6>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|||
|
|
if(Comm_Sample())
|
|||
|
|
{
|
|||
|
|
sprintf(form.Edit2.text, "%04d", (int16_t) (dcBuff.sampleData.diff * 10));
|
|||
|
|
form.cursorId = 4; // <20><><EFBFBD>굽ȷ<EAB5BD>ϰ<EFBFBD>ť
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
form.cursorId = 5; // <20><><EFBFBD>굽<EFBFBD><EAB5BD><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
Form_SetFocus();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_511_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7B5><EFBFBD>
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR)
|
|||
|
|
dcBuff.configSensor.sensorDPress.lowRange = atoi(form.Edit2.text);
|
|||
|
|
else
|
|||
|
|
dcBuff.configSensor.sensorCap.baseC = atoi(form.Edit2.text);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_510();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_511_Create()
|
|||
|
|
{
|
|||
|
|
char baseC[10];
|
|||
|
|
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR)
|
|||
|
|
sprintf(baseC, "%04d", dcBuff.configSensor.sensorDPress.lowRange);
|
|||
|
|
else
|
|||
|
|
sprintf(baseC, "%04d", dcBuff.configSensor.sensorCap.baseC);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, baseC);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
{
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR)
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
else
|
|||
|
|
Button_Create(&form.Button1, 4, 3, "AUT");
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton1 = Form_511_OnButton1;
|
|||
|
|
form.OnButton4 = Form_511_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_510;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
if(dcBuff.configDisplay.op_USE_CAPACITY_SENSOR)
|
|||
|
|
form.OnDrawOthers = Form_DispPoint1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
|
|||
|
|
void Form_512_OnButton1()
|
|||
|
|
{
|
|||
|
|
const float e = e_Src[dcBuff.configBottle.source];
|
|||
|
|
uint32_t d = dcBuff.configBottle.diameter;
|
|||
|
|
uint16_t refC;
|
|||
|
|
|
|||
|
|
if(dcBuff.configBottle.type == BOTTLE_TYPE_STAND)
|
|||
|
|
d = dcBuff.configBottle.len + dcBuff.configBottle.lenExtra * 2 + dcBuff.configBottle.diameter / 2;
|
|||
|
|
|
|||
|
|
// <20>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
refC = (uint16_t) (Adc_Sensor_Tables[0].k * (d - Adc_Sensor_Tables[0].nl_len) * (e - 1) * 10);
|
|||
|
|
sprintf(form.Edit2.text, "%04d", refC);
|
|||
|
|
|
|||
|
|
form.cursorId = 4; // <20><><EFBFBD>굽ȷ<EAB5BD>ϰ<EFBFBD>ť
|
|||
|
|
Form_SetFocus();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_512_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7B5><EFBFBD>
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR)
|
|||
|
|
dcBuff.configSensor.sensorDPress.highRangeX10 = atoi(form.Edit2.text);
|
|||
|
|
else
|
|||
|
|
dcBuff.configSensor.sensorCap.refC = atoi(form.Edit2.text);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_510();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_512_Create()
|
|||
|
|
{
|
|||
|
|
char refC[10];
|
|||
|
|
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR)
|
|||
|
|
sprintf(refC, "%04d", dcBuff.configSensor.sensorDPress.highRangeX10);
|
|||
|
|
else
|
|||
|
|
sprintf(refC, "%04d", dcBuff.configSensor.sensorCap.refC);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, refC);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
{
|
|||
|
|
if(!dcBuff.configDisplay.op_USE_CAPACITY_SENSOR)
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
else
|
|||
|
|
Button_Create(&form.Button1, 4, 3, "AUT");
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton1 = Form_512_OnButton1;
|
|||
|
|
form.OnButton4 = Form_512_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_510;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
if(dcBuff.configDisplay.op_USE_CAPACITY_SENSOR || dcBuff.configSensor.sensorDPress.ishighRangeX10)
|
|||
|
|
form.OnDrawOthers = Form_DispPoint1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_520_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
formParam.menuIdx[2] = form.Select3.idx;
|
|||
|
|
|
|||
|
|
switch(form.Select3.idx)
|
|||
|
|
{
|
|||
|
|
case 0: // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_521);
|
|||
|
|
break;
|
|||
|
|
case 1: // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_522);
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_520_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, 2, menu_520_items, formParam.menuIdx[2]);
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_520_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_500;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
void Form_Return2_520()
|
|||
|
|
{
|
|||
|
|
Change_Form(FORM_ID_520);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_521_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if(formParam.caliIdx == 0)
|
|||
|
|
dcBuff.configSensor.sensorPress.lowRange = atoi(form.Edit2.text) * 10;
|
|||
|
|
else
|
|||
|
|
dcBuff.configSensor.sensorEPress[0].lowRange = atoi(form.Edit2.text) * 10;
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_520();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_521_Create()
|
|||
|
|
{
|
|||
|
|
char range[10];
|
|||
|
|
|
|||
|
|
if(formParam.caliIdx == 0)
|
|||
|
|
sprintf(range, "%03d", dcBuff.configSensor.sensorPress.lowRange / 10);
|
|||
|
|
else
|
|||
|
|
sprintf(range, "%03d", dcBuff.configSensor.sensorEPress[0].lowRange / 10);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 1, 3, 3, range);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnDrawOthers = Form_DispPoint2;
|
|||
|
|
form.OnButton4 = Form_521_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_520;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_522_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if(formParam.caliIdx == 0)
|
|||
|
|
dcBuff.configSensor.sensorPress.highRange = atoi(form.Edit2.text) * 10;
|
|||
|
|
else
|
|||
|
|
dcBuff.configSensor.sensorEPress[0].highRange = atoi(form.Edit2.text) * 10;
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_520();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_522_Create()
|
|||
|
|
{
|
|||
|
|
char range[10];
|
|||
|
|
|
|||
|
|
if(formParam.caliIdx == 0)
|
|||
|
|
sprintf(range, "%04d", dcBuff.configSensor.sensorPress.highRange / 10);
|
|||
|
|
else
|
|||
|
|
sprintf(range, "%04d", dcBuff.configSensor.sensorEPress[0].highRange / 10);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 0, 4, 4, range);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnDrawOthers = Form_DispPoint2;
|
|||
|
|
form.OnButton4 = Form_522_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_520;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20>¶<EFBFBD><C2B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_530_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
formParam.menuIdx[2] = form.Select3.idx;
|
|||
|
|
|
|||
|
|
switch(form.Select3.idx)
|
|||
|
|
{
|
|||
|
|
case 0: // <20>¶ȵ<C2B6><C8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_531);
|
|||
|
|
break;
|
|||
|
|
case 1: // <20>¶ȸ<C2B6><C8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_532);
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_530_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
SelectBox_Create(&form.Select3, 0, 4, 2, menu_530_items, formParam.menuIdx[2]);
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_530_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_500;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
void Form_Return2_530()
|
|||
|
|
{
|
|||
|
|
Change_Form(FORM_ID_530);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20>¶ȵ<C2B6><C8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
void Form_531_OnDrawOthers()
|
|||
|
|
{
|
|||
|
|
Disp_DispChar(0, '-');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_531_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>¶ȵ<C2B6><C8B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
dcBuff.configSensor.sensorMTempr[formParam.caliIdx].lowRange = -atoi(form.Edit2.text);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_530();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_531_Create()
|
|||
|
|
{
|
|||
|
|
char range[10];
|
|||
|
|
|
|||
|
|
sprintf(range, "%03d", -dcBuff.configSensor.sensorMTempr[formParam.caliIdx].lowRange);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 1, 3, 3, range);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnDrawOthers = Form_531_OnDrawOthers;
|
|||
|
|
form.OnButton4 = Form_531_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_530;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20>¶ȸ<C2B6><C8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_532_OnButton4()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>¶ȸ<C2B6><C8B8><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
dcBuff.configSensor.sensorMTempr[formParam.caliIdx].highRange = atoi(form.Edit2.text);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Config_SaveConfig();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>˵<EFBFBD>
|
|||
|
|
Form_Return2_530();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_532_Create()
|
|||
|
|
{
|
|||
|
|
char range[10];
|
|||
|
|
|
|||
|
|
sprintf(range, "%03d", dcBuff.configSensor.sensorMTempr[formParam.caliIdx].highRange);
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Create(&form.Edit2, 1, 3, 3, range);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
if(formParam.privilege == 2)
|
|||
|
|
Button_Create(&form.Button4, 8, 3, "YES");
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
EditBox_ReadOnly(&form.Edit2);
|
|||
|
|
}
|
|||
|
|
Button_Create(&form.Button5, 11, 3, "ESC");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnButton4 = Form_532_OnButton4;
|
|||
|
|
form.OnButton5 = Form_Return2_530;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// ϵͳ<CFB5><CDB3>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
void Form_600_OnDrawOthers()
|
|||
|
|
{
|
|||
|
|
char version[8];
|
|||
|
|
if(formParam.infoPage == 0)
|
|||
|
|
{
|
|||
|
|
sprintf(version, "%02d%02d", dcBuff.displayInfo.softDate.month, dcBuff.displayInfo.softDate.day);
|
|||
|
|
Disp_Fld1Text(version);
|
|||
|
|
sprintf(version, "%3d", dcBuff.displayInfo.softVer.minor);
|
|||
|
|
Disp_Fld2Text(version);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sprintf(version, "%4d", dcBuff.displayInfo.hardVer.major);
|
|||
|
|
Disp_Fld1Text(version);
|
|||
|
|
sprintf(version, "%3d", dcBuff.displayInfo.hardVer.minor);
|
|||
|
|
Disp_Fld2Text(version);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
void Form_600_OnButton5()
|
|||
|
|
{
|
|||
|
|
// <20><>λ
|
|||
|
|
VCC_GSM_OFF();
|
|||
|
|
delay_ms(200);
|
|||
|
|
NVIC_SystemReset();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_600_OnKey(u8 key)
|
|||
|
|
{
|
|||
|
|
if(key == KEY_DOWN)
|
|||
|
|
{
|
|||
|
|
if(formParam.infoPage >= 1)
|
|||
|
|
formParam.infoPage = 0;
|
|||
|
|
else
|
|||
|
|
formParam.infoPage++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_600_Create()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// Ĭ<><C4AC><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>汾
|
|||
|
|
formParam.infoPage = 0;
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Create(&form.Button1, 11, 3, "ESC");
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
Button_Hide(&form.Button4);
|
|||
|
|
Button_Create(&form.Button5, 8, 3, "RST");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnDrawOthers = Form_600_OnDrawOthers;
|
|||
|
|
form.OnButton1 = Form_Return2_000;
|
|||
|
|
form.OnButton5 = Form_600_OnButton5;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
form.OnKey = Form_600_OnKey;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20>鿴<EFBFBD><E9BFB4><EFBFBD>նȽ<D5B6><C8BD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
void Form_700_OnDrawOthers()
|
|||
|
|
{
|
|||
|
|
s8 text[10];
|
|||
|
|
|
|||
|
|
Disp_Fld1MultiOff();
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
|
if(dcBuff.sampleData.vacuum[0].staVacuum == VACUUM_STATUS_COMM_FAULT)
|
|||
|
|
Disp_Fld1Text("---");
|
|||
|
|
else if(dcBuff.sampleData.vacuum[0].staVacuum == VACUUM_STATUS_FAULT || dcBuff.sampleData.vacuum[0].vacuum > 99.99999999)
|
|||
|
|
Disp_Fld1Text("+EE");
|
|||
|
|
else if(dcBuff.sampleData.vacuum[0].vacuum > 0.00999999)
|
|||
|
|
{
|
|||
|
|
sprintf(text, "%04d", (uint16_t) (dcBuff.sampleData.vacuum[0].vacuum * 100));
|
|||
|
|
// <20><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>ʾ3λ<33><CEBB><EFBFBD><EFBFBD>
|
|||
|
|
if(text[0] == '0')
|
|||
|
|
Disp_Fld1Text(text + 1);
|
|||
|
|
else
|
|||
|
|
Disp_Fld1Text(text);
|
|||
|
|
Disp_Fld1PointOn(2);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
Disp_Fld1Text("-EE");
|
|||
|
|
|
|||
|
|
// <20><>ʾ<EFBFBD><CABE><EFBFBD>ն<EFBFBD>
|
|||
|
|
Disp_Fld2Text("vac");
|
|||
|
|
Disp_Fld2UnitOn(UNIT_PV_PA);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_700_OnButton5()
|
|||
|
|
{
|
|||
|
|
while(Sample_Busy())
|
|||
|
|
osDelay(1);
|
|||
|
|
|
|||
|
|
Config_Vacuum_Request = 1; // ǿ<>Ʋ<EFBFBD><C6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ն<EFBFBD>
|
|||
|
|
Config_Sample_Request = 1;
|
|||
|
|
// <20>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Sample_Notify();
|
|||
|
|
while(Config_Sample_Request)
|
|||
|
|
osDelay(1);
|
|||
|
|
|
|||
|
|
form.cursorId = 4; // <20><><EFBFBD>굽<EFBFBD><EAB5BD><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
Form_SetFocus();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_700_Create()
|
|||
|
|
{
|
|||
|
|
memset(&form, 0, sizeof(form));
|
|||
|
|
|
|||
|
|
// <20>ؼ<EFBFBD>
|
|||
|
|
Button_Hide(&form.Button1);
|
|||
|
|
EditBox_Hide(&form.Edit2);
|
|||
|
|
SelectBox_Hide(&form.Select3);
|
|||
|
|
Button_Create(&form.Button4, 11, 3, "ESC");
|
|||
|
|
Button_Create(&form.Button5, 8, 3, "AUT");
|
|||
|
|
|
|||
|
|
Form_timeout = OPERATE_TIMEOUT;
|
|||
|
|
|
|||
|
|
// <20>¼<EFBFBD><C2BC>ص<EFBFBD>
|
|||
|
|
form.OnDrawOthers = Form_700_OnDrawOthers;
|
|||
|
|
form.OnButton4 = Form_Return2Meter;
|
|||
|
|
form.OnButton5 = Form_700_OnButton5;
|
|||
|
|
form.OnTimeOut = Form_Return2Meter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ********************************************
|
|||
|
|
// <20>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܽ<EFBFBD><DCBD><EFBFBD>
|
|||
|
|
// ********************************************
|
|||
|
|
void Change_Form(TForm_Id formId)
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
Disp_Clear();
|
|||
|
|
|
|||
|
|
switch(formId)
|
|||
|
|
{
|
|||
|
|
case FORM_ID_START: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_Start_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_METER: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
|
Form_Meter_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_PWD: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_Pwd_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_000: // <20><><EFBFBD>ò˵<C3B2>
|
|||
|
|
Form_000_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_100: // PSN<53><4E><EFBFBD><EFBFBD>
|
|||
|
|
Form_100_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_200: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
|
|||
|
|
Form_200_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_210: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_210_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_220: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_220_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_230: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_230_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_240: // ֱ<><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_240_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_250: // <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_250_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_251: // <20><>Һλ<D2BA>ٷֱ<D9B7><D6B1><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_251_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_260: // <20>ܶ<EFBFBD><DCB6><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_260_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_270: // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_270_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_271: // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_271_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_272: //apex ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_272_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_273: //apex ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_273_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_280: // <20>ݻ<EFBFBD><DDBB><EFBFBD>ʾ
|
|||
|
|
Form_280_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_285: // 4~20mA<6D><41><EFBFBD><EFBFBD>Һλ<D2BA>߶<EFBFBD>
|
|||
|
|
Form_285_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_290: // Modbusͨ<73>ŵ<EFBFBD>ַ
|
|||
|
|
Form_290_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_300: // <20>ϱ<EFBFBD><CFB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_300_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_310: // <20>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_310_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_320: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_320_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_400: // <20>궨<EFBFBD><EAB6A8><EFBFBD><EFBFBD>
|
|||
|
|
Form_400_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_410: // <20><><EFBFBD>ݱ궨
|
|||
|
|
Form_410_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_411: // C1<43><31>100pF<70><46><EFBFBD>궨
|
|||
|
|
Form_411_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_412: // C2<43><32>400pF<70><46><EFBFBD>궨
|
|||
|
|
Form_412_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_413: // ƫ<>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD>㣩<EFBFBD>궨
|
|||
|
|
Form_413_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_420: // ѹ<><D1B9><EFBFBD>궨
|
|||
|
|
Form_420_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_421: // <20><>ѹ<EFBFBD><D1B9><EFBFBD>궨
|
|||
|
|
Form_421_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_422: // <20><>ѹ<EFBFBD><D1B9><EFBFBD>궨
|
|||
|
|
Form_422_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_430: // <20>¶ȱ궨
|
|||
|
|
Form_430_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_431: // <20><><EFBFBD>¶ȱ궨
|
|||
|
|
Form_431_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_432: // <20><><EFBFBD>¶ȱ궨
|
|||
|
|
Form_432_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_500: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_500_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_510: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_510_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_511: // <20><EFBFBD><D7B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_511_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_512: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_512_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_520: // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_520_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_521: // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_521_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_522: // ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_522_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_530: // <20>¶<EFBFBD><C2B6><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_530_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_531: // <20>¶ȵ<C2B6><C8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_531_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_532: // <20>¶ȸ<C2B6><C8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Form_532_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_600: // ϵͳ<CFB5><CDB3>Ϣ
|
|||
|
|
Form_600_Create();
|
|||
|
|
break;
|
|||
|
|
case FORM_ID_700: // <20>鿴<EFBFBD><E9BFB4><EFBFBD>ն<EFBFBD>
|
|||
|
|
Form_700_Create();
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(form.cursorId != 0)
|
|||
|
|
{
|
|||
|
|
// ָ<><D6B8><EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
Form_SetFocus();
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
// <20><>һ<EFBFBD><D2BB><EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
|
|||
|
|
Form_FocusFirst();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ó<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
|
|||
|
|
Form_ResetTimer();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Form_Start()
|
|||
|
|
{
|
|||
|
|
// <20><>ʼ<EFBFBD><CABC>
|
|||
|
|
memset(&formParam, 0, sizeof(formParam));
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD>
|
|||
|
|
Check_L_Unit(KEY_UP);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Change_Form(FORM_ID_START);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
uint32_t Comm_Sample()
|
|||
|
|
{
|
|||
|
|
while(Sample_Busy())
|
|||
|
|
osDelay(1);
|
|||
|
|
|
|||
|
|
Config_Sample_Request = 1;
|
|||
|
|
// <20>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Sample_Notify();
|
|||
|
|
|
|||
|
|
while(Config_Sample_Request)
|
|||
|
|
osDelay(1);
|
|||
|
|
|
|||
|
|
return TRUE;
|
|||
|
|
}
|