/************************** Copyright (c) **********************************
|
** FUZHOU FUGUANG ELECTRONICS Co.,LTD.
|
** ¸£Öݸ£¹âµç×ÓÓÐÏÞ¹«Ë¾
|
** http://www.fuguang.com
|
**
|
**-------------- File Info -------------------------------------------------
|
** File name: ChargePage.c
|
** Last modified Date: 2008-11-16
|
** Last Version: 1.0
|
** Descriptions: Charge test module functions
|
**
|
**--------------------------------------------------------------------------
|
** Created by: mxpopstar
|
** Created date: 2008-11-16
|
** Version: 1.0
|
** Descriptions: The original version
|
**
|
**--------------------------------------------------------------------------
|
** Modified by: mxpopstar
|
** Modified date: 2008-11-20
|
** Version:
|
** Descriptions: Charge test module functions
|
**
|
***************************************************************************/
|
//
|
#include <avr/io.h>
|
#include <avr/interrupt.h>
|
#include "ChargePage.h"
|
#include "MainMenu.h"
|
#include "TFT_Driver.h"
|
#include "NRF905_Driver.h"
|
#include "AD7843_Driver.h"
|
#include "DS1302_Driver.h"
|
#include "M64ADC_Driver.h"
|
#include "MessageBox.h"
|
#include "74HC595_Driver.h"
|
#include "SingleVol.h"
|
#include "WorkingPage.h"
|
#include "FileManage.h"
|
#include "M64Timer1.h"
|
#include "SYSSetPage.h"
|
#include <avr/wdt.h>
|
|
|
extern FBO_Data GB_FBO_Data;
|
extern SYS_State GB_SYS_State;
|
extern File_Inf GB_TestDataInf;
|
extern unsigned int GB_TestingParm[16];
|
|
#if(SoftLanguage == CN)
|
const prog_uchar CPText[12][6] =
|
{
|
{55, 56, 200,57, 59},//³äµç¼à²â
|
{132,133,134,135,59},//µ±Ç°×´Ì¬
|
{83, 84, 56, 86, 59},//ÔÚÏßµçѹ
|
{68, 69, 56, 86, 59},//×é¶Ëµçѹ
|
{55, 56, 225, 56, 82, 59},//³äµç×ܵçÁ÷
|
{85, 55, 225, 62, 63, 59},//Òѳä×ÜÈÝÁ¿
|
{85, 55, 64, 65, 59},//Òѳäʱ¼ä
|
{70, 71, 36, 63, 59},//µ¥ÌåÊýÁ¿
|
{91, 92, 70, 71, 59},//×îµÍµ¥Ìå
|
{91, 93, 70, 71, 59},//×î¸ßµ¥Ìå
|
{56, 201,68, 36, 59},//µç³Ø×éÊý
|
{40, 41, 65, 79, 59},//±£´æ¼ä¸ô
|
};
|
//
|
|
const prog_uchar CPSubText[8][4] =
|
{
|
{68, 101}, //×é
|
{56, 82}, //µçÁ÷
|
{62, 63}, //ÈÝÁ¿
|
{91, 93, 70, 71}, //×î¸ßµ¥Ìå
|
{91, 92, 70, 71}, //×îµÍµ¥Ìå
|
{227,101}, //¸ö
|
{240}, //ǯ¿Úͼ±ê
|
{101},
|
};
|
//
|
const prog_uchar CPSubTextEXT[3][4] =
|
{
|
{223,10,224,101},//(A)
|
{223,10,17,224},//(AH)
|
{223,31,224,101},//(V)
|
};
|
//
|
|
const prog_uchar CPStateText[6][7] =
|
{
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
#if(MashineType == FBO48CT)
|
{ 85, 80, 81, 55, 56, 137,101},//ÒÑÍ£Ö¹³äµç!
|
{ 85,124, 80, 55, 56, 137,101},//ÒÑÔÝÍ£³äµç!
|
#else
|
{ 85, 80, 81, 200,57, 137,101},//ÒÑÍ£Ö¹³äµç!
|
{ 85,124, 80, 200,57, 137,101},//ÒÑÔÝÍ£³äµç!
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
{138, 83, 72, 82, 55, 56, 137},//ÕýÔÚÏÞÁ÷³äµç!
|
{138, 83,165,143, 55, 56, 137},//ÕýÔÚÖ±Á¬³äµç!
|
{138, 83, 55, 56, 200,57, 137},//ÕýÔÚ³äµç¼à²â!
|
#if(MashineType == FBO48CT)
|
{ 83, 84, 56, 86, 92,137, 101},//ÔÚÏßµçѹµÍ!
|
#else
|
{152, 56, 153,148,137,101}, //ÊеçÖжÏ!
|
#endif
|
};
|
//
|
|
const prog_uchar CPButtonItem[7][2] =
|
{
|
{ 72, 82},//ÏÞÁ÷
|
{165, 55},//Ö±³ä
|
{124, 80},//ÔÝÍ£
|
{ 80, 81},//Í£Ö¹
|
{ 70, 71},//µ¥Ìå
|
{ 52, 53},//Í˳ö
|
{199,118},//Æô¶¯
|
};
|
//
|
|
const prog_uchar CPAlarmText[7][13] =
|
{
|
{138,83,55, 56,136, 45, 46,125, 52, 53,127,128,101}, //ÕýÔÚ³äµç£¬È·¶¨ÒªÍ˳öÂð?
|
{ 55,56,56, 142,143,144,145,146,137,101,101,101,101}, //³äµçµçÀÂÁ¬½Ó´íÎó!
|
{101,101,157,70, 71, 158,159,168,169,137,101,101,101}, //XXºÅµ¥ÌåÄ£¿éÒì³£!
|
{119,41,120,121,136, 85, 80, 81, 40, 41, 36, 37,137}, //ÄÚ´æ²»×ã,ÒÑÍ£Ö¹±£´æÊý¾Ý!
|
{119,41,120,121,136, 85, 80, 81, 55, 56, 200,57,137}, //ÄÚ´æ²»×ã,ÒÑÍ£Ö¹³äµç¼à²â!
|
{101,101,157,56, 82, 206,207,168,169,137,101,101},//XXºÅµçÁ÷ǯ¿ÚÒì³£!
|
{239, 84,56, 82, 206,207,168,169,137,101,101,101},//ÎÞÏßµçÁ÷ǯ¿ÚÒì³£!
|
};
|
//
|
#else
|
const prog_uchar CPText[12][14] =
|
{
|
{100,59,76,91,63}, //"³äµç¼à²â"5
|
{110,107,110,111,107,124,106,101,97,26},//µ±Ç°×´Ì¬10
|
{0},//ÔÚÏßµçѹ
|
{106,59,75,76,26}, //×é¶Ëµçѹ5
|
{111,74,70,26}, //·ÅµçµçÁ÷4
|
{98,72,70,74,77,78,88,26}, //ÒÑ·ÅÈÝÁ¿8
|
{94,76,64,72,91,26}, //ÒÑ·Åʱ¼ä6
|
{103,74,71,14,67,71,26}, //µ¥ÌåÊýÁ¿
|
{72,68,73,26}, //×îµÍµ¥Ìå4
|
{72,59,70,77,26}, //×î¸ßµ¥Ìå5
|
{103,74,71,14,62,76,26}, //µç³Ø×éÊý7
|
{101,73,78,64,76,61,14,77,74,81,76,14,26}, //±£´æ¼ä¸ô13
|
};
|
//
|
|
const prog_uchar CPSubText[8][5] =
|
{
|
{62,76}, //×é2
|
{111,74,70}, //µçÁ÷3
|
{98,105,103}, //ÈÝÁ¿3
|
{105,59,70,77}, //×î¸ßµ¥Ìå4
|
{105,68,73}, //×îµÍµ¥Ìå3
|
{3}, //¸ö#
|
{240}, //ǯ¿Úͼ±ê1
|
{0},
|
};
|
const prog_uchar CPSubTextEXT[4][4] =
|
{
|
{8,33,9},//(A)
|
{8,33,116,9},//(AH)
|
{8,34,9},//(V)
|
{116},
|
};
|
//
|
|
const prog_uchar CPStateText[6][18] =
|
{
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
#if(MashineType == FBO48CT)
|
"Stopped! ",//ÒÑÍ£Ö¹³äµç!
|
"Paused! ",//ÒÑÔÝÍ£³äµç!
|
#else
|
{74,77,78,59,73,74,61,71,64,73,74,1,0},//ÒÑÍ£Ö¹³äµç!13
|
{108,59,79,67,59,1,0,0,0,0,0,0,0}, //ÒÑÔÝÍ£³äµç!
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
{107,62,76,59,73,14,78,74,70,59,1,0,0},//ÕýÔÚÏÞÁ÷³äµç!
|
{108,76,91,72,14,67,59,76,91,63,1,0,0},//ÕýÔÚÖ±Á¬³äµç!
|
{103,74,73,78,76,14,67,59,76,91,63,59,1},//ÕýÔÚ³äµç¼à²â!
|
#if(MashineType == FBO48CT)
|
"OnlineVol Low! "//ÔÚÏßµçѹµÍ!
|
#else
|
{106,64,78,0,110,64,78,68,1,0,0,0,0},//ÊеçÖжÏ!
|
#endif
|
};
|
//
|
|
const prog_uchar CPButtonItem[7][9] =
|
{
|
{108,79,77,70}, //ÏÞÁ÷4
|
{93,64,67,107,62,76,59,73}, //Ö±³ä8
|
{108,59,79,67,59}, //ÔÝÍ£5
|
{110,78,74,75}, //Í£Ö¹4
|
{108,76,74,77,72,74,78,76}, //µ¥Ìå8
|
{94,87,81,74,63}, //Í˳ö5
|
{108,79,77,70}, //Æô¶¯4
|
};
|
//
|
|
const prog_uchar CPAlarmText[7][46] =
|
{
|
{101,63,65,78,0,67,59,76,91,63,12,74,77,78,59,73,74,61,68,78,88,31},
|
//"It is charging now, exit?", ÕýÔÚ³äµç,È·¶¨ÒªÍ˳öÂð?22
|
{108,76,74,61,64,76,88,0,75,74,63,70,71,90,83,64,73,68,64,0,122,108,112,1},
|
//"Charge electric cable error!", ³äµçµçÀÂÁ¬½Ó´íÎó!24
|
{108,76,74,61,64,76,88,0,77,64,73,77,74,76,0,125},
|
//" # module error! ", XXºÅµ¥ÌåÄ£¿éÒì³£!16
|
{108,59,72,91,78,88,0,75,64,76,64,75,74,71,73,64,73,59,12,73,64,0,72,74,62,79,0,77,74,81,76,59,73,91,78,88,0,63,59,73,73,87,64,1},
|
//"Memory over, stop to save data!", ÄÚ´æ²»×ã,ÒÑÍ£Ö¹±£´æÊý¾Ý!44
|
{108,59,72,91,78,88,0,75,64,76,64,75,74,71,73,64,73,59,12,67,59,75,68,77,88,0,63,59,73,73,87,81,0,74,77,78,59,73,74,61,71,64,73,59,1},
|
//"Memory over, stop to charge!", ÄÚ´æ²»×ã,ÒÑÍ£Ö¹³äµç¼à²â!45
|
{108,76,74,61,64,76,88,0,78,74,70,74,61,87,64,0,70,71,64,85,68,0,46,74},
|
//" # clamp error! ", XXºÅµçÁ÷ǯ¿ÚÒì³£!24
|
{108,76,74,61,64,76,88,0,60,64,77,75,76,74,61,74,63,73,87,64,0,78,74,70,74,61,87,64,0,70,71,64,85,68,1},
|
//"Wireless clamp error!", ÎÞÏßµçÁ÷ǯ¿ÚÒì³£!35
|
};
|
//
|
#endif
|
//
|
|
|
static unsigned char (*CPParentPage)(void) = DSPChargePage;
|
static unsigned char (*CPChildPage)(void) = DSPChargePage;
|
static unsigned int ChargePower = DischargeControlInit;
|
static unsigned char ChargeWorkState = CPStopCharging;
|
static unsigned char AutoStartCharge = 0;
|
static unsigned int CPChargeCurrentRes = 300; //ÏÞÁ÷³äµçµçÁ÷Ìø×ªÖµÎª10A
|
static unsigned char OverCurrentTime = 0; //¹ýÁ÷³äµçµÄʱ¼ä
|
|
unsigned char DSPChargePage(void)
|
{
|
DisableCustomInput();
|
if(CPChildPage != GB_SYS_State.CurrentPage) //ÅжÏÊÇ·ñ´Ó×ÓÒ³Ãæ·µ»Ø
|
{
|
CPParentPage = GB_SYS_State.CurrentPage; //±£´æ¸¸Ò³ÃæÖ¸Õë
|
GB_FBO_Data.m_TestTime.second = 0;
|
GB_FBO_Data.m_TestTime.minute = 0;
|
GB_FBO_Data.m_TestTime.hour = 0; //ʵʱʱÖÓÇåÁã(hh:mm:ss)
|
GB_FBO_Data.AllCap = 0; //ÒѲâÈÝÁ¿ÇåÁã
|
for(unsigned char n=0; n<4; n++)
|
{
|
GB_FBO_Data.SubCap[n] = 0;
|
}
|
if(GB_FBO_Data.OnlineVol < GB_SYS_State.OnlineLowLimit)
|
{
|
GB_TestingParm[0] = 1;//ÉèÖÃΪÀëÏß²âÊÔ·½Ê½
|
}
|
if(GetMemoryRest() <= 33)
|
{
|
GetAndDspMemoryRest(338, 360);//ÏÔʾÄÚ´æÓàÁ¿
|
}
|
}
|
GB_SYS_State.CurrentPage = DSPChargePage;
|
CPChildPage = DSPChargePage;
|
GB_SYS_State.GetInput = GetChargePageButtonDown;
|
GB_SYS_State.TestType = TestTypeCharge; //ÉèÖòâÊÔÀàÐÍΪ³äµç
|
EnableMonomerVolGether();
|
|
CPChargeCurrentRes = 100; //ÏÞÁ÷³äµçµçÁ÷Ìø×ªÖµÎª10A
|
|
DSPChargePageText();
|
|
UpdateCPStateText(ChargeWorkState);
|
DrawCPControlButton(ChargeWorkState);
|
return 0;
|
}
|
//
|
|
void DSPChargePageText(void)
|
{
|
DSP16x24Str(CPText[0], 5, 14, 24, 24, blue, yellow); //³äµç²âÊÔ
|
#if(SoftLanguage == CN)
|
DrawLine(24, 50, 12, 0, blue, white, linebold, 2);
|
#else
|
DrawLine(24, 48, 9, 0, blue, white, linebold, 2);
|
#endif
|
|
DSP16x24Str(CPText[1], 10, 14, 18, 360, blue, yellow); //µ±Ç°×´Ì¬
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ########################
|
#if(MashineType == FBO48CT)
|
DSP24x24Str(CPText[2], 5, 24, 48, 64, blue, white); //ÔÚÏßµçѹ
|
DSP24x24Str(CPText[3], 5, 24, 48, 96, blue, white); //×é¶Ëµçѹ
|
DSP24x24Str(CPText[4], 6, 24, 48, 128, blue, white); //·Åµç×ܵçÁ÷
|
DSP24x24Str(CPText[6], 5, 24, 340, 64, blue, white); //ÒÑ·Åʱ¼ä
|
DSP24x24Str(CPText[5], 6, 24, 340, 128, blue, white); //ÒÑ·Å×ÜÈÝÁ¿
|
#else
|
DSP16x24Str(CPText[3], 5, 16, 48, 80, blue, white); //×é¶Ëµçѹ
|
DSP16x24Str(CPText[4], 4, 16, 48, 128, blue, white); //·Åµç×ܵçÁ÷
|
DSP16x24Str(CPText[6], 6, 16, 340, 80, blue, white); //ÒÑ·Åʱ¼ä
|
DSP16x24Str(CPText[5], 8, 16, 340, 128, blue, white); //ÒÑ·Å×ÜÈÝÁ¿
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ########################
|
|
DrawLine(20, 180, 76, 0, blue, white, linebold, 1);//-
|
DrawLine(20, 348, 76, 0, blue, white, linebold, 1);//-
|
DrawLine(20, 180, 21, 1, blue, white, linebold, 1);//|
|
DrawLine(628, 180, 21, 1, blue, white, linebold, 1);//|
|
|
DSP16x24Str(CPSubText[0], 2, 14, 24, 188, blue, white); //µç³Ø×é
|
DSP16x24Str(CPSubText[1], 3, 14, 69, 188, blue, white); //µçÁ÷
|
//#if(SoftLanguage == CN)
|
DSP16x24Str(CPSubTextEXT[0], 3, 16,110, 188, blue, white); //(A)
|
//#endif
|
DSP16x24Str(CPSubText[2], 3, 15, 172, 188, blue, white); //ÈÝÁ¿
|
//#if(SoftLanguage == CN)
|
DSP16x24Str(CPSubTextEXT[1], 4, 16, 215, 188, blue, white); //(AH)
|
//#endif
|
DSP16x24Str(CPSubText[3], 4, 16, 294, 188, blue, green7);//×î¸ßµ¥Ìå
|
//#if(SoftLanguage == CN)
|
DSP16x24Str(CPSubTextEXT[2], 3, 16, 370, 188, blue, green7);//(V)
|
//#endif
|
DSP16x24Str(CPSubText[4], 3, 16, 480, 188, blue, red); //×îµÍµ¥Ìå
|
//#if(SoftLanguage == CN)
|
DSP16x24Str(CPSubTextEXT[2], 3, 16, 550, 188, blue, red); //(V)
|
|
GetDateTime(&(GB_SYS_State.DateTime));
|
CPUpdateValue();
|
}
|
//
|
void CPUpdateValue(void)
|
{
|
unsigned char fcl = white;
|
if((GB_FBO_Data.OnlineVol<GB_SYS_State.OnlineLowLimit)
|
&&(GB_FBO_Data.OnlineVol>SUM_VOL_TOOLOW))
|
{
|
fcl = red;
|
}
|
else fcl = white;
|
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ################################
|
#if(MashineType == FBO48CT)
|
#if(SoftLanguage == CN)
|
PrintValue(1, 1, GB_FBO_Data.OnlineVol, "V", 16, 168, 64, blue, fcl); //ÔÚÏßµçѹ
|
PrintValue(1, 1, GB_FBO_Data.SumVoltage, "V", 16, 168, 96, blue, white);//×é¶Ëµçѹ
|
PrintTime(&(GB_FBO_Data.m_TestTime), ':', HMS, 460, 64, blue, white); //³äµçʱ¼ä
|
#else
|
PrintValue(1, 1, GB_FBO_Data.OnlineVol, "V", 16, 192, 64, blue, fcl); //ÔÚÏßµçѹ
|
PrintValue(1, 1, GB_FBO_Data.SumVoltage, "V", 16, 192, 96, blue, white);//×é¶Ëµçѹ
|
PrintTime(&(GB_FBO_Data.m_TestTime), ':', HMS, 484, 64, blue, white); //³äµçʱ¼ä
|
#endif
|
PrintValue(1, 1, GB_FBO_Data.SumCurrent, "A", 16, 192, 128, blue, fcl); //³äµç×ܵçÁ÷
|
PrintValue(1, 0, GB_FBO_Data.AllCap, "AH", 16, 484, 128, blue, white); //Òѳä×ÜÈÝÁ¿
|
#else
|
#if(SoftLanguage == CN)
|
PrintValue(1, 1, GB_FBO_Data.SumVoltage, "V", 16, 168, 80, blue, white);//×é¶Ëµçѹ
|
PrintTime(&(GB_FBO_Data.m_TestTime), ':', HMS, 460, 80, blue, white); //³äµçʱ¼ä
|
#else
|
PrintValue(1, 1, GB_FBO_Data.SumVoltage, " B", 16, 160, 80, blue, white);//×é¶Ëµçѹ
|
PrintTime(&(GB_FBO_Data.m_TestTime), ':', HMS, 478, 80, blue, white); //³äµçʱ¼ä
|
#endif
|
PrintValue(1, 1, GB_FBO_Data.SumCurrent, " A", 16, 160, 128, blue, fcl); //³äµç×ܵçÁ÷
|
PrintValue(1, 0, GB_FBO_Data.AllCap, " AH", 16, 478, 128, blue, white); //Òѳä×ÜÈÝÁ¿
|
//DSP16x24Str(CPSubTextEXT[3], 1, 12, 556, 128, blue, white);//H
|
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ################################
|
|
for(unsigned char n=0; n<GB_FBO_Data.BattGroup; n++)
|
{
|
PrintValue(4, 0, n+1, "", 16, 24, 220+32*n, blue, white);
|
PrintValue(1, 1, GB_FBO_Data.SubCurrent[n], "", 16, 70, 220+32*n, blue, white); //·ÖÖ§µçÁ÷
|
PrintValue(1, 0, GB_FBO_Data.SubCap[n], "", 16, 186, 220+32*n, blue, white); //·ÖÖ§ÈÝÁ¿
|
PrintValue(2, 0, GetMonomerMaxIndex(n)+1, "-", 16, 276, 220+32*n, blue, green7); //×î¸ßµ¥ÌåºÅ
|
PrintValue(0, 3, GetMonomerMaxVol(n), "", 16, 340, 220+32*n, blue, green7); //×î¸ßµ¥Ìå
|
PrintValue(2, 0, GetMonomerMinIndex(n)+1, "-", 16, 462, 220+32*n, blue, red); //×îµÍµ¥ÌåºÅ
|
PrintValue(0, 3, GetMonomerMinVol(n), "", 16, 526, 220+32*n, blue, red); //×îµÍµ¥Ìå
|
}
|
|
if(GetClampType() == ClampTypeNull)
|
DSP24x24Graph(CPSubText[7], 1, 24, 148, 24, blue, yellow);
|
else DSP24x24Graph(CPSubText[6], 1, 24, 148, 24, blue, yellow);
|
|
DSPMonomerModuleType(184, 24, yellow);
|
DSPTemperature(210, 24, yellow);
|
PrintTime(&(GB_SYS_State.DateTime), ':', YYMDHMS, 316, 24, blue, yellow);
|
}
|
//
|
|
unsigned char GetCPStateIndex(void)
|
{
|
return ChargeWorkState;
|
}
|
//
|
unsigned int GetChargePowerState(void)
|
{
|
return ChargePower;
|
}
|
//
|
|
void UpdateCPStateText(unsigned char stateindex)
|
{
|
if(stateindex >= CPSmallCharging)
|
{
|
//---------------- ÀëÏß³äµç·½Ê½ -----------------------
|
if(GB_FBO_Data.OnlineVol < GB_SYS_State.OnlineLowLimit)
|
{
|
stateindex = 4;
|
}
|
}
|
|
DSP16x24Str(CPStateText[stateindex], 13, 14, 156, 360, blue, yellow);//µ±Ç°×´Ì¬µÄÖµ
|
|
if(GB_SYS_State.WorkState == Charging)
|
{
|
DSP24x24Space(15, 338, 360, blue, yellow);//ÏÈÌî³ä¿Õ¸ñ
|
//---------- Èç¹ûÄÚ´æ²»×ã,ÔòÏÔʾ"ÄÚ´æ²»×ã,ÒÑÍ£Ö¹±£´æÊý¾Ý" ----------
|
if(FileExists() == 0)
|
{
|
DSP12x16Str(CPAlarmText[3], 44, 10, 338, 360, blue, red);//
|
}
|
//---------- Èç¹ûÓе¥ÌåÄ£¿éÒì³£,ÔòÏÔʾ"XXºÅÄ£¿éÒì³£" ---------------
|
else if(GetModuleDropIndex() > 0)
|
{
|
DSP16x24Str(CPAlarmText[2], 16, 14, 340, 360, blue, yellow);
|
PrintValue(3, 0, GetModuleDropIndex(), "!",16, 578, 360, blue, yellow);
|
}
|
//---------- Èç¹ûÓÐÎÞÏßµçÁ÷ǯÒì³£,ÔòÏÔʾ"XXºÅµçÁ÷ǯÒì³£" -----------
|
else if(GetClampDropIndex() > 0)
|
{
|
if(GetClampDropIndex() == 1)
|
DSP24x24Str(CPAlarmText[6], 10, 24, 316, 360, blue, yellow);
|
else
|
{
|
DSP24x24Str(CPAlarmText[5], 10, 24, 316, 360, blue, yellow);
|
PrintValue(3, 0, GetClampDropIndex()-1, "",16, 324, 360, blue, yellow);
|
}
|
}
|
#if(MashineType == FBO48CT)
|
//---------- ÈôÊÇÔÚÏ߷ŵ粢ÇÒÔÚÏßµçѹ<52V,ÌáʾÔÚÏßµçѹµÍ -----------
|
else if( (GB_FBO_Data.OnlineVol<GB_SYS_State.OnlineLowLimit)
|
&&(GB_FBO_Data.OnlineVol>SUM_VOL_TOOLOW) )
|
{
|
DSP24x24Str(CPStateText[5], 6, 24, 316, 360, blue, yellow);
|
}
|
#else
|
else if(GB_SYS_State.OnlineVolLow == 1)
|
{
|
DSP24x24Str(CPStateText[5], 6, 24, 316, 360, blue, yellow);
|
}
|
#endif
|
}
|
}
|
//
|
void DrawCPControlButton(const unsigned char state)
|
{
|
if(state == CPStopCharging)
|
DrawButtonH48(2, CPButtonItem[2], 5, 14, 12, 274, 400, gray1, gray2);//ÔÝÍ£ÎÞЧ
|
else if(state == CPPauseCharging)
|
DrawButtonH48(2, CPButtonItem[3], 4, 14, 12, 274, 400, gray1, white);//Í£Ö¹ÓÐЧ
|
else
|
DrawButtonH48(2, CPButtonItem[2], 5, 14, 12, 274, 400, gray1, white);//ÔÝÍ£ÓÐЧ
|
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ####################################
|
#if(MashineType == FBO48CT)
|
if(GB_FBO_Data.OnlineVol >= GB_SYS_State.OnlineLowLimit)//ÈôÊÇÔÚÏ߷ŵç(ÔÚÏßµçѹÕý³£)
|
{
|
if(state==CPSmallCharging)
|
DrawButtonH48(2, CPButtonItem[0], 4, 16, 15, 24, 400, gray1, gray2); //ÏÞÁ÷ÎÞЧ
|
else DrawButtonH48(2, CPButtonItem[0], 4, 16, 15, 24, 400, gray1, white);//ÏÞÁ÷ÓÐЧ
|
}
|
else//·ñÔò
|
{
|
if(state==CPNullCharging)
|
DrawButtonH48(2, CPButtonItem[6], 4, 16, 15, 24, 400, gray1, gray2); //Æô¶¯ÎÞЧ
|
else DrawButtonH48(2, CPButtonItem[6], 4, 16, 15, 24, 400, gray1, white);//Æô¶¯ÓÐЧ
|
}
|
|
if((state==CPLargeCharging) || (GB_FBO_Data.OnlineVol < GB_SYS_State.OnlineLowLimit))//Èç¹ûÊÇÀëÏß²âÊÔ
|
DrawButtonH48`(2, CPButtonItem[1], 8, 10, 1, 149, 400, gray1, gray2); //Ö±Á¬ÎÞЧ
|
else DrawButtonH481(2, CPButtonItem[1], 8, 10, 1, 149, 400, gray1, white); //Ö±Á¬ÓÐЧ
|
#else
|
if(state==CPNullCharging)
|
DrawButtonH48(2, CPButtonItem[6],4, 16, 15,24, 400, gray1, gray2); //Æô¶¯ÎÞЧ
|
else DrawButtonH48(2, CPButtonItem[6],4, 16, 15, 24, 400, gray1, white);//Æô¶¯ÓÐЧ
|
|
DrawButtonH481(2, CPButtonItem[1], 8, 11, 2, 149, 400, gray1, gray2); //Ö±Á¬ÎÞЧ
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ####################################
|
|
if(GB_FBO_Data.BattSum > 0)
|
DrawButtonH481(2, CPButtonItem[4], 8, 11, 2, 399, 400, gray1, white); //µ¥Ìå
|
else DrawButtonH481(2, CPButtonItem[4], 8, 11, 2, 399, 400, gray1, gray2); //µ¥Ìå
|
|
DrawButtonH48(2, CPButtonItem[5], 5, 14, 10, 524, 400, gray1, red); //Í˳ö
|
}
|
//
|
|
unsigned char InitChargingParm(void)
|
{
|
GB_FBO_Data.m_TestTime.second = 0;
|
GB_FBO_Data.m_TestTime.minute = 0;
|
GB_FBO_Data.m_TestTime.hour = 0; //ʵʱʱÖÓÇåÁã(hh:mm:ss)
|
GB_FBO_Data.AllCap = 0; //ÒѲâÈÝÁ¿ÇåÁã
|
GB_SYS_State.APS = 0;
|
for(unsigned char n=0; n<4; n++)
|
{
|
GB_SYS_State.SubAPS[n] = 0;
|
}
|
|
//------------------ »ñÈ¡µ¥ÌåµçѹÀàÐÍ ----------------------------------
|
if(GetMonomerMaxVol(0) < 4000)
|
GB_TestDataInf.TestStartInf.MonomerVol = 2; //µ¥ÌåµçѹÀàÐÍ,2V,6V,12V
|
else if((GetMonomerMaxVol(0) > 9000))
|
GB_TestDataInf.TestStartInf.MonomerVol = 12;//µ¥ÌåµçѹÀàÐÍ,2V,6V,12V
|
else GB_TestDataInf.TestStartInf.MonomerVol = 6;//µ¥ÌåµçѹÀàÐÍ,2V,6V,12V
|
//----------------------------------------------------------------------
|
|
GB_TestDataInf.TestStartInf.DataType = 0xFC; //0xFC±íʾ³äµçÊý¾Ý
|
GB_FBO_Data.m_DataType.TypeTag0 = 0xFC;
|
GB_FBO_Data.m_DataType.TypeTag1 = 0xFC;
|
GB_FBO_Data.m_DataType.TypeTag2 = 0xFC;
|
GB_FBO_Data.m_DataType.TypeTag3 = 0xFC;
|
|
GB_SYS_State.SaveDateEN = 0; //ÔÊÐí±£´æÊý¾Ý±êʶÇåÁã
|
GB_SYS_State.SendRTDataEN = 0; //ÔÊÐí·¢ËÍʵʱ232Êý¾ÝÇåÁã
|
GB_SYS_State.WorkState = Stopped; //ϵͳ¹¤×÷״̬ÉèÖÃΪ"Í£Ö¹"
|
|
//--------------------- ÉèÖÃÊý¾ÝÍ·ÐÅÏ¢ ---------------------------------
|
GetDateTime(&(GB_TestDataInf.TestStartInf.TestStartTime)); //»ñÈ¡·Åµç¿ªÊ¼µÄʱ¼ä
|
GB_TestDataInf.TestStartInf.Device = MashineType; //ÒDZíÀàÐÍ
|
GB_TestDataInf.TestStartInf.DataVersion= DATAVERSION; //Êý¾Ý°æ±¾
|
GB_TestDataInf.TestStartInf.STDCap = GB_TestingParm[2];
|
GB_TestDataInf.TestStartInf.HourRate = GB_TestingParm[3];
|
GB_TestDataInf.TestStartInf.TestCur = GB_TestingParm[4];
|
GB_TestDataInf.TestStartInf.MVLLimit = GB_TestingParm[7];
|
GB_TestDataInf.TestStartInf.SumVLLimit = GB_TestingParm[8];
|
GB_TestDataInf.TestStartInf.BattSum = GB_TestingParm[9];
|
GB_TestDataInf.TestStartInf.BattGroup = GB_TestingParm[10];
|
GB_TestDataInf.TestStartInf.MVLLimitCount = GB_TestingParm[11];
|
GB_TestDataInf.TestStartInf.SaveInterval = GB_TestingParm[12];
|
//----------------------------------------------------------------------
|
|
//-------------------- ÄÚ´æ²»×ã,ÎÞ·¨³äµç! ------------------------------
|
if((GetAutoStartCharge()==0) && (GetMemoryRest()<16))
|
{
|
CPChildPage = DSPMessageBoxNull;
|
DSPMessageBox4(CPAlarmText[4], 45, MB_OK, FlashUPStop,25,0);
|
return 0;
|
}
|
//----------------------------------------------------------------------
|
|
return 1;
|
}
|
//
|
|
|
void OpenChargePower(const unsigned char powertype)
|
{
|
ChargePower = DischargeControlInit;
|
//ChargePower |= WIND; //¿ªÍ¨·çÉÈ×é
|
|
if(powertype == CPSmallCharging)
|
{
|
ChargePower &= ~(CtrlPowerAll); //¿ªÍ¨×ܵçÔ´,¿ªÊ¼ÏÞÁ÷³äµç
|
SendDataToHC595(ChargePower);
|
Delay_MS(250);
|
wdt_reset(); //ι¹·
|
ChargePower &= ~(SmallCharge); //¿ªÍ¨ÏÞÁ÷³äµç
|
ChargePower |= (LargeCharge); //¹Ø±ÕÖ±Á¬³äµç
|
}
|
else if(powertype == CPLargeCharging)
|
{
|
ChargePower &= ~(CtrlPowerAll); //¿ªÍ¨×ܵçÔ´
|
SendDataToHC595(ChargePower);
|
Delay_MS(250);
|
wdt_reset(); //ι¹·
|
ChargePower |= SmallCharge; //¹Ø±ÕÏÞÁ÷³äµç
|
ChargePower &= (~LargeCharge); //¿ªÍ¨Ö±Á¬³äµç
|
}
|
SendDataToHC595(ChargePower);
|
Delay_MS(250);
|
wdt_reset(); //ι¹·
|
}
|
//
|
|
void CloseChargePower(void)
|
{
|
ChargePower = DischargeControlInit;
|
|
//ChargePower |= WIND; //±£³Ö·çÉÈ×鿪ͨ
|
|
ChargePower |= LargeCharge; //¹Ø±ÕÖ±Á¬³äµç
|
SendDataToHC595(ChargePower);
|
Delay_MS(250);
|
wdt_reset(); //ι¹·
|
|
ChargePower |= CtrlPowerAll; //¹Ø±Õ×ܵçÔ´
|
SendDataToHC595(ChargePower);
|
Delay_MS(250);
|
wdt_reset(); //ι¹·
|
|
ChargePower |= SmallCharge; //¹Ø±ÕÏÞÁ÷³äµç
|
SendDataToHC595(ChargePower);
|
Delay_MS(250);
|
wdt_reset(); //ι¹·
|
}
|
//
|
|
unsigned char GetAutoStartCharge(void)
|
{
|
return AutoStartCharge;
|
}
|
void SetAutoStartCharge(const unsigned char value)
|
{
|
AutoStartCharge = value;
|
}
|
//
|
|
void StartCharging(const unsigned char chargetype)
|
{
|
unsigned char res = 0;
|
if(InitChargingParm() == 0) //³õʼ»¯Ê§°ÜÍ˳ö;
|
return;
|
|
SetOringinMonomerVol(GB_FBO_Data.SingleVol);
|
res = CreateFile();
|
|
CPChargeCurrentRes = 300; //ÏÞÁ÷³äµçµçÁ÷Ìø×ªÖµÎª30A
|
ResumeCharging(chargetype);
|
|
if(res == 0)
|
{
|
CPChildPage = DSPMessageBoxNull;
|
DSPMessageBox1(CPAlarmText[3], 44, MB_OK, FlashUPStop);//ÄÚ´æ²»×ã,ÒÑÍ£Ö¹Êý¾Ý±£´æ!
|
return;
|
}
|
|
#if(MashineType == FBO48CT)
|
#else
|
Set_ACPOWER_Work(ACPOWER_CK_ENABLE);
|
for(unsigned char n=0; n<20; n++)
|
{
|
Check_ACPOWER_State();
|
}
|
if(Get_ACPOWER_State() > 10)
|
{
|
GB_SYS_State.OnlineVolLow = 0;
|
Set_ACPOWER_Work(ACPOWER_CK_DISABLE);
|
}
|
else
|
{
|
GB_SYS_State.OnlineVolLow = 0;
|
Set_ACPOWER_Work(ACPOWER_CK_ENABLE);
|
}
|
#endif
|
}
|
//
|
|
void ResumeCharging(const unsigned char chargetype)
|
{
|
InitM64Timer1();//------³õʼ»¯1ÃëÖÓ¶¨Ê±Æ÷
|
|
if(GB_SYS_State.WorkState != Charging)
|
{
|
ClearModuleError(); //Çå³ýµ¥ÌåÄ£¿éÒì³£±êʶ
|
GB_SYS_State.OnlineVolLow = 0; //Çå³ýÔÚÏßµçѹÒì³£±êʶ
|
}
|
|
OverCurrentTime = 0;
|
GB_SYS_State.DealTimer1Up = TestingTimeUp; //ÉèÖÃTimer1¶¨Ê±Öжϴ¦Àíº¯Êý
|
GB_SYS_State.SaveDateEN = 1; //±£´æµÚÒ»±ÊÊý¾Ý
|
GB_SYS_State.SendRTDataEN = 1; //·¢Ë͵ÚÒ»±ÊʵʱÊý¾Ý
|
|
GB_SYS_State.WorkState = Charging; //ϵͳ¹¤×÷״̬Ϊ£º³äµçÖÐ
|
ChargeWorkState = chargetype; //²âÊÔ״̬:³äµç½çÃæ³äµçÖÐ
|
|
if(GB_SYS_State.CurrentPage == DSPChargePage)
|
{
|
UpdateCPStateText(ChargeWorkState);
|
DrawCPControlButton(ChargeWorkState);
|
}
|
|
OpenChargePower(chargetype); //Æô¶¯·Åµç¹¦ÂÊ¿ØÖÆ
|
|
StartM64Timer1(); //-----¿ªÆô¶¨Ê±Æ÷1
|
}
|
//
|
|
void SuspendCharging(const unsigned char pausetype)
|
{
|
StopM64Timer1();
|
CloseChargePower();
|
|
GB_SYS_State.WorkState = Paused;//ϵͳ¹¤×÷״̬
|
GB_SYS_State.DealTimer1Up = M64Timer1UpNull;
|
GB_SYS_State.SaveDateEN = 0;
|
ChargeWorkState = pausetype;//ÓÃÀ´ÏÔʾ״̬Îı¾
|
|
SaveFile(&GB_FBO_Data); //±£´æÔÝͣʱµÄÊý¾Ý
|
|
StopAlarmBeep();
|
|
if(GB_SYS_State.CurrentPage == DSPChargePage)
|
{
|
UpdateCPStateText(ChargeWorkState);
|
DrawCPControlButton(ChargeWorkState);
|
}
|
}
|
//
|
|
void StopCharging(const unsigned char stoptype)
|
{
|
StopM64Timer1();
|
CloseChargePower();
|
|
GB_SYS_State.WorkState = Stopped; //ϵͳ¹¤×÷״̬
|
GB_SYS_State.DealTimer1Up = M64Timer1UpNull;
|
ChargeWorkState = stoptype; //ÓÃÀ´ÏÔʾ״̬Îı¾
|
|
SaveFile(&GB_FBO_Data); //±£´æÍ£Ö¹Ê±µÄÊý¾Ý
|
CloseFile(&(GB_FBO_Data), ChargeWorkState);//¹Ø±ÕÎļþ
|
GB_SYS_State.SaveDateEN = 0;
|
|
StopAlarmBeep();
|
|
if(GB_SYS_State.CurrentPage == DSPChargePage)
|
{
|
UpdateCPStateText(ChargeWorkState);
|
DrawCPControlButton(ChargeWorkState);
|
}
|
}
|
//
|
|
void SetOverCurrentTime(const unsigned char time)
|
{
|
OverCurrentTime = time;
|
}
|
unsigned char GetOverCurrentTime(void)
|
{
|
return OverCurrentTime;
|
}
|
//
|
|
void CPControlChargeCurrent(volatile const FBO_Data *fbodata)
|
{
|
if((ChargeWorkState == CPSmallCharging)
|
&&(fbodata->OnlineVol>=GB_SYS_State.OnlineLowLimit)
|
&&(fbodata->SumCurrent <= CPChargeCurrentRes)//ÏÞÁ÷³äµçµçÁ÷<=É趨µÄÇл»Öµ
|
&&(OverCurrentTime >= 30)) //ÏÞÁ÷³äµç³ÖÐø30Ãë
|
{
|
BuzzerBeep(200);
|
_delay_ms(100);
|
BuzzerBeep(200);
|
ResumeCharging(CPLargeCharging); //´óµçÁ÷³äµç
|
OverCurrentTime = 0;
|
}
|
|
else if((ChargeWorkState == CPLargeCharging)
|
&&(fbodata->SumCurrent >= 1500) //Ö±³äµçÁ÷³¬¹ý150A
|
&&(OverCurrentTime >= 30)) //Ö±³ä¹ýÁ÷³ÖÐø30ÃëÒÔÉϾÍתÏÞÁ÷
|
{
|
BuzzerBeep(500);
|
ResumeCharging(CPSmallCharging); //СµçÁ÷³äµç
|
OverCurrentTime = 0;
|
if(CPChargeCurrentRes > 60)
|
CPChargeCurrentRes -= 20; //ÏÞÁ÷³äµçµçÁ÷-2A;
|
}
|
}
|
//
|
|
//----------------------- ³äµç¹ý³ÌÖÐÒì³£¼ì²â -------------------------------
|
void CPCheckAbnormalAlarm(void)
|
{
|
static unsigned char flashisup = 0;
|
|
#if(MashineType == FBO48CT)
|
//------------------- ÔÚÏßµçѹµÍ´¦Àí ----------------------
|
if((GB_SYS_State.OnlineVolLow==0)
|
&& (GB_FBO_Data.OnlineVol<GB_SYS_State.OnlineLowLimit)
|
&& (GB_FBO_Data.OnlineVol>SUM_VOL_TOOLOW))
|
{
|
GB_SYS_State.OnlineVolLow = 1;
|
StartAlarmBeep(MonomerModleDrop);//¿ªÆôÉùÒô¸æ¾¯
|
//------------- ¸üÐÂ״̬À¸ÐÅÏ¢ ---------------
|
if(GB_SYS_State.CurrentPage == DSPSingleVolData)
|
{
|
QuitSingleVolPage();
|
}
|
else if(GB_SYS_State.CurrentPage == DSPChargePage)
|
{
|
UpdateCPStateText(ChargeWorkState);
|
}
|
}
|
//------------- ÔÚÏßµçѹ»Ö¸´´¦Àí -----------------
|
else if((GB_SYS_State.OnlineVolLow==1)
|
&& (GB_FBO_Data.OnlineVol>=GB_SYS_State.OnlineLowLimit))
|
{
|
GB_SYS_State.OnlineVolLow = 0;
|
StopAlarmBeep();
|
//------------- ¸üÐÂ״̬À¸ÐÅÏ¢ ---------------
|
if(GB_SYS_State.CurrentPage == DSPSingleVolData)
|
{
|
QuitSingleVolPage();
|
}
|
else if(GB_SYS_State.CurrentPage == DSPChargePage)
|
{
|
UpdateCPStateText(ChargeWorkState);
|
}
|
}
|
#else
|
if((GB_SYS_State.OnlineVolLow==0)&&(Get_ACPOWER_State()>10))
|
{
|
GB_SYS_State.OnlineVolLow = 1;
|
StartAlarmBeep(MonomerModleDrop);//¿ªÆôÉùÒô¸æ¾¯
|
//------------- ¸üÐÂ״̬À¸ÐÅÏ¢ ---------------
|
if(GB_SYS_State.CurrentPage == DSPSingleVolData)
|
{
|
QuitSingleVolPage();
|
}
|
else if(GB_SYS_State.CurrentPage == DSPChargePage)
|
{
|
UpdateCPStateText(ChargeWorkState);
|
}
|
}
|
else if((GB_SYS_State.OnlineVolLow==1)&&(Get_ACPOWER_State()==0))
|
{
|
GB_SYS_State.OnlineVolLow = 0;
|
StopAlarmBeep();
|
//------------- ¸üÐÂ״̬À¸ÐÅÏ¢ ---------------
|
if(GB_SYS_State.CurrentPage == DSPSingleVolData)
|
{
|
QuitSingleVolPage();
|
}
|
else if(GB_SYS_State.CurrentPage == DSPChargePage)
|
{
|
UpdateCPStateText(ChargeWorkState);
|
}
|
}
|
#endif
|
|
//------------- ÄÚ´æ²»×ã,ÒÑÍ£Ö¹Êý¾Ý±£´æ ----------
|
if((flashisup==0) && (FileExists()==0))
|
{
|
flashisup = 1;
|
if(GB_SYS_State.CurrentPage == DSPSingleVolData)
|
{
|
QuitSingleVolPage();
|
}
|
else if(GB_SYS_State.CurrentPage == DSPChargePage)
|
{
|
UpdateCPStateText(ChargeWorkState);
|
}
|
}
|
else if((flashisup==1) && (FileExists()==1))
|
{
|
flashisup = 0;
|
}
|
}
|
//
|
|
void GetChargePageButtonDown(void)
|
{
|
static unsigned char lastkey = ButtonNull;
|
static unsigned char getlastkeycount = 0;
|
static unsigned char count = 0;
|
unsigned char touched_item;
|
|
//------------- ÒÔÒ»¶¨µÄƵÂÊË¢ÐÂÊýÖµ ------------
|
if((count++ % 64) == 0)
|
{
|
CPUpdateValue();
|
GetDateTime(&(GB_SYS_State.DateTime));
|
if(GetAutoStartCharge() == 1)
|
{
|
StartCharging(CPSmallCharging);
|
SetAutoStartCharge(0);
|
return;
|
}
|
}
|
|
//----------- »ñÈ¡´¥ÃþÆÁºÍ°´¼üµÄÊäÈë ------------
|
touched_item = GetTouchLocal();
|
|
//----------- Èç¹û°´¼üΪ¿ÕÔòÖ±½Ó·µ»Ø ------------
|
if(touched_item == ButtonNull)
|
{
|
lastkey = ButtonNull;
|
getlastkeycount = 0;
|
return;
|
}
|
else if(touched_item != lastkey)
|
{
|
getlastkeycount = 0;
|
}
|
lastkey = touched_item;
|
if(getlastkeycount<40)
|
getlastkeycount++;
|
|
//---------- "ÏÞÁ÷"¼ü´¦Àí ------------------------
|
if((touched_item==Button0) && (ChargeWorkState!=CPSmallCharging) && (ChargeWorkState!=CPNullCharging))
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ####################################
|
#if(MashineType == FBO48CT)
|
//----------- ÔÚÏß³äµç¼à²â,µçѹ̫¸ß¼ì²â -------------
|
if(GB_FBO_Data.OnlineVol>=GB_SYS_State.OnlineLowLimit)
|
{
|
if(StartErrorCheck())
|
{
|
CPChildPage = DSPMessageBoxNull;
|
DSPMessageBox(CPAlarmText[1],24,MB_OK,FDLineConnectError);
|
return;
|
}
|
if(ChargeWorkState == CPStopCharging)
|
{
|
StartCharging(CPSmallCharging);
|
}
|
else if(ChargeWorkState >= CPPauseCharging)
|
{
|
ResumeCharging(CPSmallCharging);
|
}
|
}
|
//----------- ÀëÏß³äµç¼à²â -------------------------
|
else
|
{
|
if(ChargeWorkState == CPStopCharging)
|
{
|
StartCharging(CPNullCharging);
|
}
|
else if(ChargeWorkState >= CPPauseCharging)
|
{
|
ResumeCharging(CPNullCharging);
|
}
|
}
|
#else
|
if(ChargeWorkState == CPStopCharging)
|
{
|
StartCharging(CPNullCharging);
|
}
|
else if(ChargeWorkState >= CPPauseCharging)
|
{
|
ResumeCharging(CPNullCharging);
|
}
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ####################################
|
}
|
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ####################################
|
#if(MashineType == FBO48CT)
|
//----------- "Ö±Á¬"¼ü´¦Àí --------------------------
|
else if((touched_item==Button1)
|
&&(ChargeWorkState!=CPLargeCharging)
|
&&(GB_FBO_Data.OnlineVol>=GB_SYS_State.OnlineLowLimit))//ÔÚÏß³äµç
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
if(GB_FBO_Data.OnlineVol>=GB_SYS_State.OnlineLowLimit)
|
{
|
if(StartErrorCheck())
|
{
|
CPChildPage = DSPMessageBoxNull;
|
DSPMessageBox(CPAlarmText[1],24,MB_OK,FDLineConnectError);
|
return;
|
}
|
}
|
if(ChargeWorkState == CPStopCharging)
|
{
|
StartCharging(CPLargeCharging);
|
}
|
else if(ChargeWorkState >= CPPauseCharging)
|
{
|
ResumeCharging(CPLargeCharging);
|
}
|
}
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ####################################
|
|
//------------ "Í£Ö¹"¼ü´¦Àí ---------------------------
|
else if((touched_item == Button2) && (ChargeWorkState>=CPPauseCharging))
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
if(ChargeWorkState > CPPauseCharging)
|
{
|
SuspendCharging(CPPauseCharging);
|
}
|
else if(ChargeWorkState == CPPauseCharging)
|
{
|
StopCharging(CPStopCharging);
|
}
|
}
|
//------------ "µ¥Ìå"¼ü´¦Àí ---------------------------
|
else if((touched_item==Button3) && (GB_FBO_Data.BattSum>0))
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
CPChildPage = DSPSingleVolData;
|
BackColorCH();
|
CPChildPage();
|
StopAlarmBeep();//¹Ø±ÕÉùÒô¸æ¾¯
|
return;
|
}
|
//------------ "Í˳ö"¼ü´¦Àí ---------------------------
|
else if(touched_item == Button4)
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
StopAlarmBeep();
|
if(GB_SYS_State.WorkState == Stopped)
|
{
|
BackColorCH();
|
CPParentPage();
|
CPParentPage = DSPChargePage; //»Ö¸´¸¸Ò³ÃæÖ¸ÕëΪ×Ô¼ºµÄÒ³Ãæ
|
}
|
else
|
{
|
CPChildPage = DSPMessageBoxNull;
|
if(DSPMessageBox(CPAlarmText[0],22,MB_YESNO,BeepNull) == ButtonOK)
|
{
|
StopCharging(CPStopCharging);
|
BackColorCH();
|
CPParentPage();
|
CPParentPage = DSPChargePage;//»Ö¸´¸¸Ò³ÃæÖ¸ÕëΪ×Ô¼ºµÄÒ³Ãæ
|
}
|
}
|
return;
|
}
|
|
//------- ÑÓʱ150msºóÍ˳ö,ÒÔÃâ°´¼üË«»÷Ì«¿ì ---------
|
if(getlastkeycount == 0)
|
{
|
_delay_ms(150);
|
}
|
}
|
//
|
|
/********************** END OF FILE (ChargePage.c)*************************/
|