/************************** Copyright (c) **********************************
|
** FUZHOU FUGUANG ELECTRONICS Co.,LTD.
|
** ¸£Öݸ£¹âµç×ÓÓÐÏÞ¹«Ë¾
|
** http://www.fuguang.com
|
**
|
**-------------- File Info -------------------------------------------------
|
** File name: WorkingPage.c
|
** Last modified Date: 2008-11-16
|
** Last Version: 1.0
|
** Descriptions: Discharge test control 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: Discharge test control functions
|
**
|
***************************************************************************/
|
//
|
|
#include "Define.h"
|
#include "WorkingPage.h"
|
#include "KeyBoard_Driver.h"
|
#include "ChargePage.h"
|
#include "TFT_Driver.h"
|
#include "M64ADC_Driver.h"
|
#include "AD7843_Driver.h"
|
#include "DS1302_Driver.h"
|
#include "FileManage.h"
|
#include "MainMenu.h"
|
#include "SingleVol.h"
|
#include "MessageBox.h"
|
#include "74HC595_Driver.h"
|
#include "M64PWM_Driver.h"
|
#include "M64ADC_Driver.h"
|
#include "M64Timer1.h"
|
#include "NRF905_Driver.h"
|
#include "SYSSetPage.h"
|
#include "AboutPage.h"
|
#include "RelayContorl.h"
|
#include <avr/wdt.h>
|
#include <stdlib.h>
|
|
|
extern FBO_Data GB_FBO_Data;
|
extern SYS_State GB_SYS_State;
|
extern File_Inf GB_TestDataInf;
|
extern unsigned int EEPTestingParm[8][16] __attribute__((section(".eeprom")));
|
extern unsigned int GB_TestingParm[16];
|
|
#if(SoftLanguage == CN)
|
const prog_uchar WPText_ex[5][5] =
|
{
|
//-----------------------------
|
{83, 84, 54, 56},//ÔÚÏ߷ŵç
|
{89, 84, 54, 56},//ÀëÏ߷ŵç
|
{80, 81, 54, 56},//Í£Ö¹·Åµç
|
{87, 88, 54, 56},//¼ÌÐø·Åµç
|
{54, 56, 195,36,59},//·Åµç²ÎÊý
|
//-----------------------------
|
};
|
//
|
|
const prog_uchar WPText[23][7] =
|
{
|
{132, 133, 134, 135, 59}, //µ±Ç°×´Ì¬
|
{54, 56, 57, 58, 59}, //·Åµç²âÊÔ
|
{83, 84, 56, 86, 59}, //ÔÚÏßµçѹ
|
{68, 69, 56, 86, 59}, //×é¶Ëµçѹ
|
{54, 56, 225, 56, 82, 59}, //·ÅµçµçÁ÷
|
{85, 54, 225, 62, 63, 59}, //ÒÑ·ÅÈÝÁ¿
|
{85, 54, 64, 65, 59}, //ÒÑ·Åʱ¼ä
|
{91, 92, 70, 71, 59}, //×îµÍµ¥Ìå
|
{91, 93, 70, 71, 59}, //×î¸ßµ¥Ìå
|
{85, 108,48, 72, 70, 71, 59},//Òѵ½ÏÂÏÞµ¥Ìå
|
|
{54, 56, 73, 74, 59},//·Åµçģʽ-10
|
{80, 56, 77, 78, 59},//Í£µç´¦Àí
|
{60, 61, 62, 63, 59},//±ê³ÆÈÝÁ¿
|
{66, 64, 67, 166,59},//СʱÂʦÎ
|
{90, 54, 56, 82, 59},//Ô¤·ÅµçÁ÷
|
{90, 54, 62, 63, 59},//Ô¤·ÅÈÝÁ¿
|
{90, 54, 64, 65, 59},//Ô¤·Åʱ¼ä
|
{70, 71, 48, 72, 59},//µ¥ÌåÏÂÏÞ
|
{68, 69, 48, 72, 59},//×é¶ËÏÂÏÞ
|
{226,68, 70, 71, 59},//ÿ×éµ¥Ìå
|
{57, 58, 68, 36, 59},//²âÊÔ×éÊý
|
{48, 72, 36, 63, 59},//ÏÂÏÞÊýÁ¿
|
{40, 41, 65, 79, 59},//±£´æ¼ä¸ô-22
|
};
|
//
|
|
const prog_uchar WPSubText[8][4] =
|
{
|
{68, 101}, //×é
|
{56, 82}, //µçÁ÷
|
{62, 63}, //ÈÝÁ¿
|
{91, 93, 70, 71}, //×î¸ßµ¥Ìå
|
{91, 92, 70, 71}, //×îµÍµ¥Ìå
|
{227,101}, //¸ö
|
{240}, //ǯ¿Úͼ±ê
|
{101},
|
};
|
//
|
const prog_uchar WPSubTextEXT[3][4] =
|
{
|
{223,10,224,101},//(A)
|
{223,10,17,224},//(AH)
|
{223,31,224,101},//(V)
|
};
|
//
|
|
const prog_uchar WPPresetButtonItem[10][3] =
|
{
|
{90, 94, 1},//Ô¤ÖÃ1
|
{90, 94, 2},//Ô¤ÖÃ2
|
{90, 94, 3},//Ô¤ÖÃ3
|
{90, 94, 4},//Ô¤ÖÃ4
|
{90, 94, 5},//Ô¤ÖÃ1
|
{90, 94, 6},//Ô¤ÖÃ2
|
{90, 94, 7},//Ô¤ÖÃ3
|
{90, 94, 8},//Ô¤ÖÃ4
|
{48,49,101},//ÏÂÒ³
|
{47,49,101},//ÉÏÒ³
|
};
|
//
|
|
const prog_uchar WPButtonItem[13][2] =
|
{
|
{ 54, 56},//·Åµç
|
{ 80, 81},//Í£Ö¹
|
{ 70, 71},//µ¥Ìå
|
{ 52, 53},//Í˳ö
|
{ 95, 96},//ÐÞ¸Ä
|
{114, 101},//+
|
{115, 101},//-
|
{ 97, 98},//È¡Ïû
|
{ 99, 100},//Ó¦ÓÃ
|
{124, 80},//ÔÝÍ£
|
{ 50, 51},//Ñ¡Ôñ
|
{195, 36},//²ÎÊý
|
{241, 242},//·µ»Ø
|
};
|
//
|
|
const prog_uchar WPAlarmText[8][12] =
|
{
|
{ 45, 46,125, 99,100, 95,96,126,129, 36,127,128},//È·¶¨ÒªÓ¦ÓÃÐ޸ĵIJÎÊýÂð?
|
{138, 83, 54, 56,136, 45,46,125, 52, 53,127,128},//ÕýÔڷŵ磬ȷ¶¨ÒªÍ˳öÂð?
|
{101,101,167,172,151,173,72, 82, 55, 56,137,101},//XXÃëºó¿ªÊ¼ÏÞÁ÷³äµç!;
|
{ 83, 84, 56, 86,168,169,136,170,171,55, 56,137},//ÔÚÏßµçѹÒì³£,µÈ´ý³äµç!
|
{138, 83,170,171, 55, 56,136, 45,46, 52, 53,128},//ÕýÔڵȴý³äµç,È·¶¨Í˳ö£¿
|
{101,101,157,70, 71, 158,159,168,169,137,101,101},//XXºÅµ¥ÌåÄ£¿éÒì³£!
|
{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},//ÎÞÏßµçÁ÷ǯ¿ÚÒì³£!
|
};
|
//
|
|
const prog_uchar WPStateText[11][6] =
|
{
|
{117,118, 80, 81, 137,101},//ÊÖ¶¯Í£Ö¹!
|
{ 54, 56, 64, 65, 108,137},//·Åµçʱ¼äµ½!
|
{ 54, 56, 62, 63, 108,137},//·ÅµçÈÝÁ¿µ½!
|
{ 70, 71, 48, 72, 108,137},//µ¥ÌåÏÂÏÞµ½!
|
{ 68, 69, 48, 72, 108,137},//×é¶ËÏÂÏÞµ½!
|
#if(MashineType == FBO48CT)
|
{ 83, 84, 56, 86, 92,137}, //ÔÚÏßµçѹµÍ!
|
#else
|
{152, 56, 153,148,137,101}, //ÊеçÖжÏ!
|
#endif
|
{119, 41,120,121, 137,101},//ÄÚ´æ²»×ã!
|
{193,194,168,169, 93,137},//ζÈÒì³£¸ß!
|
{138, 83, 54, 56, 137,101},//ÕýÔڷŵç!
|
{117,118,124, 80, 137,101},//ÊÖ¶¯ÔÝÍ£!
|
{124, 80, 54, 56, 137,101},//ÔÝÍ£·Åµç!
|
};
|
//
|
|
const prog_uchar WPErrorAlarmText[4][16] =
|
{
|
//·ÅµçµçÀÂÁ¬½Ó´íÎó»ò¶Ï·Æ÷ÒѶϿª£¡
|
{54,56,56,142,143,144,145,146,147,148,149,150,85,148,151,137},
|
//00ºÅÄ£¿é½ÓÏß¿ªÂ·,ÒÑÔÝÍ£·Åµç!
|
{101,101,157,158,159,144,84,151,149,136,85,124,80,54, 56,137},
|
//ÄÚ´æ²»×ã,ÒÑÍ£Ö¹·Åµç!
|
{119,41,120,121,136,85,80,81,54,56,137,101,101,101,101,101},
|
//·ÅµçµçÁ÷¼ì²â¹ÊÕÏ,ÒÑÔÝÍ£·Åµç!
|
{54,56,56,82,200,57,140,141,136,85,124,80,54, 56,137,101},
|
//²¢»úÄ£¿éδÕýÈ·Á¬½Ó»ò¿ªÆô!
|
//{},
|
};
|
//
|
#else
|
const prog_uchar WPText_ex[6][13] =////////RU.
|
{
|
//-----------------------------
|
{0,0}, //ÔÚÏ߷ŵç
|
{0,0}, //ÀëÏ߷ŵç
|
{107,77,78,59,73,74,61,68,78,88}, //Í£Ö¹·Åµç10
|
{108,76,74,63,74,71,66,68,78,88}, //¼ÌÐø·Åµç10
|
{108,59,76,59,72,64,78,76,87}, //·Åµç²ÎÊý9
|
{103,74,73,80,68,62,79,76,59,82,68,91,26}, //Ô¤ÖòÎÊý13
|
//-----------------------------
|
};
|
//
|
|
const prog_uchar WPText[25][16] = //////RU.
|
{
|
{110,107,110,111,107,124,106,101,97,26},//µ±Ç°×´Ì¬10
|
{109,59,67,76,91,63}, //"·Åµç²âÊÔ"6
|
{0,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
|
{72,68,73,26}, //×îµÍµ¥Ìå4
|
{72,59,70,77,26}, //×î¸ßµ¥Ìå5
|
{103,74,71,14,89,71,14,53,73,68,67,26}, //Òѵ½ÏÂÏÞµ¥Ìå9
|
//
|
{103,74,73,80,68,62,79,76,59,82,68,91,26}, //·Åµçģʽ13
|
{108,76,74,75,59,63,14,77,64,78,68,26}, //Í£µç´¦Àí12
|
{106,74,72,68,73,14,65,72,70,26}, //±ê³ÆÈÝÁ¿10
|
{111,68,75,0,76,59,67,76,91,63,59,26}, //СʱÂʦΠ12
|
{109,64,66,14,78,64,77,78,59,26}, //²âÊÔģʽ10
|
{111,74,70,0,76,59,67,76,91,63,59,26}, //Ô¤·ÅµçÁ÷12
|
{105,74,85,73,74,77,78,88,26}, //Ô¤·Å¹¦ÂÊ9
|
{107,62,76,14,65,72,70,14,76,59,67,76,26}, //Ô¤·ÅÈÝÁ¿13
|
{107,62,76,14,61,76,64,72,14,76,59,67,76,26}, //Ô¤·Åʱ¼ä14
|
{107,62,76,14,73,59,75,76,14,89,71,26}, //µ¥ÌåÏÂÏÞ12
|
{107,62,76,14,73,59,75,76,14,62,76,26}, //×é¶ËÏÂÏÞ12
|
{103,74,71,14,89,71,26}, //ÿ×éµ¥Ìå7
|
{103,74,71,14,62,76,26}, //²âÊÔ×éÊý7
|
{103,74,71,14,89,71,14,53,73,68,67,26}, //ÏÂÏÞÊýÁ¿12
|
{101,73,78,64,76,61,14,77,74,81,76,26}, //±£´æ¼ä¸ô12
|
};
|
//
|
|
const prog_uchar WPModeSelText[4][10] = ////RU.ºã¹¦ÂÊ£¬ºãµçÁ÷£¬·Åµç¹¦ÂÊ
|
{
|
{108,74,77,78,14,78,74,70,0}, //ºãµçÁ÷9
|
{108,74,77,78,14,72,74,85,73},//ºã¹¦ÂÊ9
|
{108,74,77,78,14,77,74,75,76},//ºã×èÖµ9
|
{105,74,85,73,26}, //·Åµç¹¦ÂÊ5
|
};
|
|
const prog_uchar WPSubText[9][5] = ////RU.
|
{
|
{95,76}, //×é2
|
{111,74,70}, //µçÁ÷3
|
{98,105,103}, //ÈÝÁ¿3
|
{105,59,70,77}, //×î¸ßµ¥Ìå4
|
{105,68,73}, //×îµÍµ¥Ìå3
|
{89,71}, //¸ö#
|
{240}, //ǯ¿Úͼ±ê1
|
{0},
|
{70,94,78}, //¶íÎÄKW£¬kBt
|
};
|
//
|
|
|
const prog_uchar WPPresetButtonItem[10][7] = ////RU.
|
{
|
{103,74,73,80,17}, //Ô¤ÖÃ1-6
|
{103,74,73,80,18},
|
{103,74,73,80,19},
|
{103,74,73,80,20},
|
{103,74,73,80,21},
|
{103,74,73,80,22},
|
{103,74,73,80,23},
|
{103,74,73,80,24},
|
{94,75,64,76,64,63},//ÏÂÒ³6
|
{106,59,67,59,63}, //ÉÏÒ³5
|
|
};
|
//
|
const prog_uchar WPSubTextEXT[4][4] =
|
{
|
{8,33,9},//(A)
|
{8,33,116,9},//(AH)
|
{8,34,9},//(V)
|
{116},
|
};
|
//
|
const prog_uchar WPButtonItem[13][10] = ///RU.
|
{
|
{108,79,77,70}, //·Åµç4
|
{110,78,74,75}, //Í£Ö¹4
|
{108,76,74,77,72,74,78,76}, //µ¥Ìå8
|
{94,87,81,74,63}, //Í˳ö5
|
|
{101,67,72,64,73,68,78,88}, //ÐÞ¸Ä8
|
{11},//+1
|
{13},//-1
|
{107,78,72,64,73,59}, //È¡Ïû6
|
{110,74,81,76,59,73}, //Ó¦ÓÃ6
|
{108,59,79,67,59}, //ÔÝÍ£5
|
{94,87,60,74,76}, //Ñ¡Ôñ5
|
{103,74,73,80,68,62}, //²ÎÊý6
|
{106,59,67,59,63}, //·µ»Ø3
|
};
|
//
|
|
const prog_uchar WPAlarmText[10][50] =
|
{
|
{110,74,81,76,59,73,68,78,88,0,77,63,64,71,59,73,73,87,64,0,68,67,72,64,73,64,73,68,91,31},
|
//"Will you apply new parameters?",È·¶¨ÒªÓ¦ÓÃÐ޸ĵIJÎÊýÂð?30
|
{101,63,65,78,0,76,59,67,76,91,63,12,74,77,78,59,73,74,61,68,78,88,31},
|
//"It is discharging now, exit?",ÕýÔڷŵ磬ȷ¶¨ÒªÍ˳öÂð?
|
{0,0},
|
//" seconds from charge!",XXÃëºó¿ªÊ¼ÏÞÁ÷³äµç!;
|
{0,0},
|
//"Online error, wait charge!",ÔÚÏßµçѹÒì³£,µÈ´ý³äµç!
|
{0,0},
|
//"It is waiting for charge, exit?",ÕýÔڵȴý³äµç,È·¶¨Í˳ö£¿
|
{108,76,74,61,64,76,88,0,77,64,73,77,74,76,0,125},
|
//" # module error! ",XXºÅµ¥ÌåÄ£¿éÒì³£!16
|
{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
|
{108,74,66,59,71,79,69,77,78,59,12,61,70,71,90,83,68,78,64,0,59,61,78,74,72,59,78,0,38,16,12,38,17,1},
|
//"Please Turn ON The Switch F1!", //Çë±ÕºÏ¶Ï·Æ÷F1!--31+3
|
{112,60,64,63,68,78,64,77,88,12,83,78,74,0,61,77,64,0,61,64,73,78,68,71,91,78,74,76,87,0,76,59,60,74,78,59,90,78,1},
|
//"Make Sure The Fans Running ON!", //È·¶¨·çÉÈÒÑת¶¯!---39
|
};
|
//
|
|
const prog_uchar WPStateText[11][36] = //Çë×¢Òâ×ÖĸÊýÎñ±ØÒ»Ö³¤¶È
|
{
|
{109,79,83,14,77,78,74,75,1,0}, //ÊÖ¶¯Í£Ö¹!10
|
// {94,76,64,72,91,1,0,0,0,0}, //·Åµçʱ¼äµ½!
|
// {108,74,71,73,14,65,73,70,1,0}, //·ÅµçÈÝÁ¿µ½!
|
{107,62,76,14,61,76,64,72,64,73,68,1},//·Åµçʱ¼äµ½//12
|
{107,62,76,14,65,72,70,74,77,78,68,1},//ÈÝÁ¿µ½//12
|
{106,68,67,70,14,53,89,71,1,0}, //µ¥ÌåÏÂÏÞµ½!
|
{106,68,67,70,14,53,62,76,1,0}, //×é¶ËÏÂÏÞµ½!
|
#if(MashineType == FBO48CT)
|
"OnlineLow!",//ÔÚÏßµçѹµÍ!
|
#else
|
{106,64,78,110,64,78,68,1,0,0}, //ÊеçÖжÏ!
|
#endif
|
{106,64,78,108,59,72,91,78,68,1},//ÄÚ´æ²»×ã!
|
{107,77,78,59,73,74,61,70,59,0,75,74,0,70,74,72,59,73,63,64,0,68,71,68,0,75,64,76,64,62,76,64,61,79,1}, //35PCSÖ÷»úÍ£Ö¹»òÕßζȹý¸ß£¡//{111,64,72,75,13,76,59,1,0,0},//ζÈÒì³£¸ß!
|
{109,59,67,76,91,63,1,0,0,0}, //ÕýÔڷŵç!
|
{108,59,79,67,59,1,0,0,0,0}, //ÊÖ¶¯ÔÝÍ£!
|
{108,59,79,67,59,1,0,0,0,0}, //ÔÝÍ£·Åµç!
|
};
|
//
|
|
const prog_uchar WPErrorAlarmText[7][60] =
|
{
|
{107,84,68,60,70,59,0,75,74,63,70,71,90,83,64,73,68,91,0,70,59,60,64,71,64,69,0,68,71,68,0,61,87,70,71 ,0,59,61,78,74,72,59,78 ,1},
|
//·ÅµçµçÀÂÁ¬½Ó´íÎó»ò¶Ï·Æ÷ÒѶϿª£¡"Discharge electric cable error!",43*******
|
//*********¼ÓÈëF0×ÖÑù************//
|
{110,64,73,77,74,76,0,46,74,16,0,73,64,0,68,77,75,76,59,61,64,73,12,76,59,67,76,91,63,0,60,79,63,64,78,0,75,76,68,74,77,78,59,73,74,61,71,64,73,1},
|
//00ºÅÄ£¿é½ÓÏß¿ªÂ·,ÒÑÔÝÍ£·Åµç!" # wireless module error, paused!",49
|
{108,59,72,91,78,88,0,75,64,76,64,75,74,71,73,64,73,59,12,76,59,67,76,91,63,0,74,77,78,59,73,74,61,71,64,73,1},
|
//ÄÚ´æ²»×ã,ÒÑÍ£Ö¹·Åµç!"Memory over, discharge stopped!",37
|
{106,64,78,0,73,59,62,76,79,67,70,68,0,68,71,68,0,59,61,78,74,72,59,78,0,61,87,70,71,90,83,64,73,12,75,59,79,67,59,1},
|
//·ÅµçµçÁ÷¼ì²â¹ÊÕÏ,ÒÑÔÝÍ£·Åµç!"Discharge current error, paused!",44+3
|
//******ÐèÒª»»³ÉÕâ¾ä--µçÁ÷¼ì²â¹ÊÕÏ»ò¶Ï·Æ÷F1ÒѶϿª! "Current error or F1 is off, paused!",
|
{108,64,76,64,62,76,79,67,70,59,12,74,78,70,71,90,83,68,78,64,0,109,96,112,1},
|
//µçÁ÷Òì³£,¶Ï¿ª¶Ï·Æ÷!"Current Abnormal, Break The Switch!",-----26
|
{107,84,68,60,70,59,0,70,74,73,78,76,74,71,71,64,76,59,1},
|
//ͨÐŹÊÕÏ---PCB¹ÊÕÏ//³¤¶È19
|
{107,84,68,60,70,59,0,70,74,73,78,76,74,71,71,64,76,59,12,75,59,79,67,59,1},
|
//ͨÐŹÊÕÏ,ÒÑÔÝÍ£·Åµç£¡//³¤¶È25
|
};
|
#endif
|
//
|
static unsigned char (*WPParentPage)(void) = DSPWorkingPage; //¶¨Òå¸¸Ò³Ãæº¯ÊýÖ¸Õë
|
static unsigned char (*WPChildPage)(void) = DSPWorkingPage; //¶¨Òå×ÓÒ³Ãæº¯ÊýÖ¸Õë
|
static unsigned int DischargePower = DischargeControlInit; //¹¦ÂÊ¿ØÖÆ
|
static unsigned char TestingParmIndex = 0; //Ô¤ÖòÎÊýË÷Òý0-7
|
static unsigned char ModifyItemIndex = 0; //Ϊ0ʱûѡÖÐÈκÎÒªÐ޸ĵÄÏî
|
static unsigned char WPWorkState = WPMANUALPSTOP;
|
static unsigned char ChargeWaitCountDown = 60; //³äµçµ¹¼ÆÊ±
|
static unsigned int PWMControlRate = 64;
|
static unsigned int WorkPageDSPMode = PageMode_Set;
|
static unsigned int TempTestingParm[16] = {0}; //ÉèÖ÷ŵç²ÎÊýÓõÄÔÝ´æÆ÷
|
static unsigned char WPWorkModeResLock = FALSE;
|
static unsigned char VolRange = 0;
|
|
//############################ ¿ØÖÆÀà #######################################
|
//-------------- Ò»ÃëÖÓ¶¨Ê±Öжϴ¦Àí³ÌÐò -----------------
|
void TestingTimeUp(void)
|
{
|
unsigned long sencondsum;
|
|
//********* ·ÅµçÖмÆÊ±Óï¾ä********
|
GB_FBO_Data.m_TestTime.second++; //-- Ãë ¼Ó1
|
if(GB_FBO_Data.m_TestTime.second == 60)
|
{
|
GB_FBO_Data.m_TestTime.second = 0;
|
GB_FBO_Data.m_TestTime.minute++;//-- ·Ö ¼Ó1
|
}
|
if(GB_FBO_Data.m_TestTime.minute == 60)
|
{
|
GB_FBO_Data.m_TestTime.minute = 0;
|
GB_FBO_Data.m_TestTime.hour++;//-- ʱ ¼Ó1
|
}
|
if(GB_FBO_Data.m_TestTime.hour == 99)
|
GB_FBO_Data.m_TestTime.hour = 0;
|
|
#if(MashineType == FBO48CT)
|
#else
|
if((GB_SYS_State.WorkState==Charging) && (GB_SYS_State.OnlineVolLow==1))
|
return;
|
#endif
|
|
//-------------- °²Ê±ÊýÀÛ¼Ó ----------------
|
GB_SYS_State.APS += GB_FBO_Data.SumCurrent;
|
for(unsigned char n=0; n<4; n++)
|
{
|
GB_SYS_State.SubAPS[n] += GB_FBO_Data.SubCurrent[n];
|
}
|
if(GB_SYS_State.APS >= 36000)//µçÁ÷À©´óÁË10±¶
|
{
|
GB_SYS_State.APS -= 36000;
|
GB_FBO_Data.AllCap++; //--"°²Ê±Êý"¼Ó1
|
}
|
for(unsigned char n=0; n<4; n++)
|
{
|
if(GB_SYS_State.SubAPS[n] >= 36000)//µçÁ÷À©´óÁË10±¶
|
{
|
GB_SYS_State.SubAPS[n] -= 36000;
|
GB_FBO_Data.SubCap[n]++; //--"°²Ê±Êý"¼Ó1
|
}
|
}
|
|
//-------------- ¹ýÁ÷³äµç³ÖÐøÊ±¼ä ----------
|
if(GB_SYS_State.WorkState == Charging)
|
{
|
if(GetOverCurrentTime() < 30)
|
SetOverCurrentTime(GetOverCurrentTime()+1);
|
}
|
|
//----------- ͳ¼Æ²âÊÔʱ¼ä×ܺÍ(Ãë) -----------
|
sencondsum =3600*GB_FBO_Data.m_TestTime.hour
|
+ 60*GB_FBO_Data.m_TestTime.minute
|
+ GB_FBO_Data.m_TestTime.second;
|
//-------- ǰ3·ÖÖÓÿ6ÃëÖÓ±£´æÒ»±ÊÊý¾Ý --------
|
if((sencondsum<180) && (sencondsum%6 == 0))
|
{
|
if(FileExists() == 1)
|
{
|
GB_SYS_State.SaveDateEN = 1;
|
}
|
}
|
//----------- 3·ÖÖÓÒÔºó°´ÕÕÉ趨µÄʱ¼ä¼ä¸ô±£´æÊý¾Ý ------------
|
else if((sencondsum>=180) && (GB_FBO_Data.m_TestTime.second==0)
|
&&((sencondsum/60)%GB_TestingParm[12] == 0))
|
{
|
if(FileExists() == 1)
|
{
|
GB_SYS_State.SaveDateEN = 1;
|
}
|
}
|
|
//--------------- ÿ6ÃëÖÓ·¢ËÍÒ»´ÎʵʱÊý¾Ý ----------------
|
if(sencondsum%6 == 0)
|
{
|
GB_SYS_State.SendRTDataEN =1;
|
}
|
}
|
//
|
|
unsigned char GetChargeWaitCountDown(void)
|
{
|
return ChargeWaitCountDown;
|
}
|
//------------------ ÑÓʱһ·ÖÖÓ½øÐгäµçµÄ³ÌÐò ------------------
|
void BeginChargeCountDown(void)
|
{
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ################################
|
#if(MashineType == FBO48CT)
|
unsigned char index = 2;
|
//----------------- Èç¹ûÔÚÏßµçѹÕý³£ ---------------------
|
if(GB_FBO_Data.OnlineVol >= GB_SYS_State.OnlineLowLimit)
|
{
|
if(ChargeWaitCountDown > 0)
|
ChargeWaitCountDown--;
|
if(ChargeWaitCountDown == 0)
|
{
|
StopM64Timer1();
|
}
|
}
|
//---------- ÔÚÏßµçѹ²»Õý³£Êdzäµçµ¹¼ÆÊ±±£³ÖΪ60 ----------
|
else
|
{
|
ChargeWaitCountDown = 60;
|
}
|
|
//----------------- ÏÔʾ³äµçµ¹¼ÆÊ± -----------------------
|
if(ChargeWaitCountDown < 60)
|
index = 2;
|
else
|
index = 3;
|
//----------------- ÏûÏ¢¿òÖеĵ¹¼ÆÊ±ÏÔʾ --------------------
|
if(GB_SYS_State.CurrentPage == DSPMessageBoxNull)
|
{
|
PostBoxMessage(WPAlarmText[index], 12);
|
}
|
//---------------- ³äµçÑÓʱµ½,·µ»Ø·Åµç²âÊÔ½çÃæ ---------------
|
if((ChargeWaitCountDown < 1) && (GB_SYS_State.CurrentPage != DSPWorkingPage))
|
{
|
if(GB_SYS_State.CurrentPage == DSPMessageBoxNull)
|
{
|
TerminateMSGBox();
|
}
|
else
|
{
|
DisableCustomInput();//½ûÓÃËùÓа´¼üÊäÈë
|
GB_SYS_State.GetInput = GetWorkingPageButtonDown;//Ö´ÐÐ×Ô¶¯³äµçÇл»ÈÎÎñ;
|
}
|
}
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ################################
|
}
|
//
|
|
unsigned int GetDischargePowerState(void)
|
{
|
return DischargePower;
|
}
|
void SetDischargePowerState(unsigned int setdata)
|
{
|
DischargePower |= setdata;
|
}
|
//
|
void ClearDischargePowerState(unsigned int cleardata)
|
{
|
DischargePower &= ~cleardata;
|
}
|
|
unsigned char GetTestingParmIndex(void)
|
{
|
return TestingParmIndex;
|
}
|
//
|
|
unsigned char InitTestingParm(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;
|
GB_FBO_Data.SubCap[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 = 0xFD; //0xFD±íʾ·ÅµçÊý¾Ý
|
GB_FBO_Data.m_DataType.TypeTag0 = 0xFD;
|
GB_FBO_Data.m_DataType.TypeTag1 = 0xFD;
|
GB_FBO_Data.m_DataType.TypeTag2 = 0xFD;
|
GB_FBO_Data.m_DataType.TypeTag3 = 0xFD;
|
|
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(GetMemoryRest() < 24)
|
{
|
WPChildPage = DSPMessageBoxNull;
|
DSPMessageBox4(WPErrorAlarmText[2], 37, MB_OK, FlashUPStop,19,0);
|
return 0;
|
}
|
|
if(CreateFile() == 0)
|
{
|
WPChildPage = DSPMessageBoxNull;
|
DSPMessageBox4(WPErrorAlarmText[2], 37, MB_OK, FlashUPStop,19,0);
|
return 0;
|
}
|
//----------------------------------------------------------------------
|
|
return 1;
|
}
|
//
|
|
void CheckIfStop(const volatile FBO_Data *fbodata, const volatile unsigned int *parm)
|
{
|
static unsigned int count = 0;
|
unsigned int time = fbodata->m_TestTime.hour;
|
time = time*60 + fbodata->m_TestTime.minute;
|
|
//---------- ζÈÒì³£¸ß,·Åµç²âÊÔ½áÊø -----------
|
if(GB_SYS_State.TempHighCount >= 10)
|
{
|
StopTesting(WPTEMPHIGHSTOP);
|
if(GB_SYS_State.WorkState == Stopped)
|
{
|
ResetTempHighAlert();
|
}
|
return;
|
}
|
//---------- ·ÅµçµçÁ÷¼à²â¹ÊÕÏ,ÒÑÔÝÍ£·Åµç£¡------
|
if((ROK5_1) || ((GetM64PWM1Value()>100) && (GB_FBO_Data.SumCurrent<30)))
|
{
|
SuspendTesting(WPAUTOPAUSE);//×Ô¶¯ÔÝÍ£
|
if(GB_SYS_State.CurrentPage == DSPSingleVolData)
|
{
|
QuitSingleVolPage();
|
}
|
|
if(GB_SYS_State.CurrentPage == DSPWorkingPage)
|
{
|
WPChildPage = DSPMessageBoxNull;
|
DSPMessageBox1(WPErrorAlarmText[3], 41, MB_OK, FDMonomerVolLimit);
|
}
|
|
return;
|
}
|
//---------------ͨÐŹÊÕÏ£¬×Ô¶¯ÔÝÍ£--------------------------------------
|
if(GetCommError() == 1)
|
{
|
SuspendTesting(WPAUTOPAUSE);//×Ô¶¯ÔÝÍ£
|
if(GB_SYS_State.CurrentPage == DSPSingleVolData)
|
{
|
QuitSingleVolPage();
|
}
|
|
if(GB_SYS_State.CurrentPage == DSPWorkingPage)
|
{
|
WPChildPage = DSPMessageBoxNull;
|
DSPMessageBox(WPErrorAlarmText[6], 19, MB_OK, FDMonomerVolLimit);
|
}
|
|
return;
|
}
|
//---------- ÄÚ´æ²»×ã,·Åµç²âÊÔ½áÊø -------------
|
if(FileExists() == 0)
|
{
|
StopTesting(WPFLASHUPSTOP);
|
return;
|
}
|
|
//---------- ·Åµçʱ¼äµ½,·Åµç²âÊÔ½áÊø -----------
|
if(time >= parm[6])
|
{
|
StopTesting(WPTIMESTOP);
|
return;
|
}
|
//---------- ·ÅµçÈÝÁ¿µ½,·Åµç²âÊÔ½áÊø -----------
|
else if(fbodata->AllCap >= parm[5])
|
{
|
StopTesting(WPCAPSTOP);
|
return;
|
}
|
//---------- µ¥ÌåÏÂÏÞµ½,ÔÝÍ£·Åµç²âÊÔ -----------
|
else if((fbodata->BattSum>0) && (GetStopMonomerVolStop()>0))
|
{
|
if(GetMonomerLowLimitAction() == 1)
|
{
|
SuspendTesting(WPAUTOPAUSE);//×Ô¶¯ÔÝÍ£
|
if(GB_SYS_State.CurrentPage == DSPSingleVolData)
|
{
|
QuitSingleVolPage();
|
}
|
|
if(GB_SYS_State.CurrentPage == DSPWorkingPage)
|
{
|
UpdateValue();
|
WPChildPage = DSPMessageBoxNull;
|
DSPMessageBox(WPStateText[3], 10, MB_OK, FDMonomerVolLimit);
|
}
|
return;
|
}
|
else
|
{
|
DisableMonomerVolGether();
|
StopTesting(WPMVLLSTOP);
|
return;
|
}
|
}
|
//---------- ×é¶ËÏÂÏÞµ½,·Åµç²âÊÔ½áÊø -----------
|
else if(fbodata->SumVoltage <= parm[8])
|
{
|
StopTesting(WPSVLLSTOP);
|
return;
|
}
|
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ################################
|
#if(MashineType == FBO48CT)
|
//-------------------------- ÔÚÏßµçѹµÍ´¦Àí -----------------------------------
|
if((parm[0]==0) && (GB_SYS_State.OnlineVolLow==0)
|
&& (fbodata->OnlineVol<GB_SYS_State.OnlineLowLimit))
|
{
|
GB_SYS_State.OnlineVolLow = 1;
|
//------------- ¸üÐÂ״̬À¸ÐÅÏ¢ ---------------
|
if(GB_SYS_State.CurrentPage == DSPSingleVolData)
|
{
|
QuitSingleVolPage();
|
}
|
else if(GB_SYS_State.CurrentPage == DSPWorkingPage)
|
{
|
UpdateWPStateText(WPWorkState);
|
}
|
StartAlarmBeep(MonomerModleDrop);//¿ªÆôÉùÒô¸æ¾¯
|
}
|
//--------------------------- ÔÚÏßµçѹ»Ö¸´´¦Àí ---------------------------------
|
else if((parm[0]==0) && (GB_SYS_State.OnlineVolLow==1)
|
&& (fbodata->OnlineVol>=GB_SYS_State.OnlineLowLimit))
|
{
|
GB_SYS_State.OnlineVolLow = 0;
|
//---------------- Èç¹ûûÓе¥ÌåÒì³£¸æ¾¯ ----------------------------
|
if(GetModuleDropIndex() == 0)
|
{
|
StopAlarmBeep();
|
}
|
if(GB_SYS_State.CurrentPage == DSPSingleVolData)
|
{
|
QuitSingleVolPage();
|
}
|
else if(GB_SYS_State.CurrentPage == DSPWorkingPage)
|
{
|
UpdateWPStateText(WPWorkState);
|
}
|
}
|
#else
|
if((GB_SYS_State.OnlineVolLow==0) && (Get_ACPOWER_State()>10))
|
{
|
GB_SYS_State.OnlineVolLow = 1;
|
//------------- ¸üÐÂ״̬À¸ÐÅÏ¢ ---------------
|
if(GB_SYS_State.CurrentPage == DSPSingleVolData)
|
{
|
QuitSingleVolPage();
|
}
|
else if(GB_SYS_State.CurrentPage == DSPWorkingPage)
|
{
|
UpdateWPStateText(WPWorkState);
|
}
|
StartAlarmBeep(MonomerModleDrop);//¿ªÆôÉùÒô¸æ¾¯
|
}
|
//--------------------------- ÔÚÏßµçѹ»Ö¸´´¦Àí ---------------------------------
|
else if((GB_SYS_State.OnlineVolLow==1) && (Get_ACPOWER_State()==0))
|
{
|
GB_SYS_State.OnlineVolLow = 0;
|
//---------------- Èç¹ûûÓе¥ÌåÒì³£¸æ¾¯ ----------------------------
|
if(GetModuleDropIndex() == 0)
|
{
|
StopAlarmBeep();
|
}
|
if(GB_SYS_State.CurrentPage == DSPSingleVolData)
|
{
|
QuitSingleVolPage();
|
}
|
else if(GB_SYS_State.CurrentPage == DSPWorkingPage)
|
{
|
UpdateWPStateText(WPWorkState);
|
}
|
}
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ################################
|
//----------------------------- ¿ØÖƷŵçµçÁ÷ ---------------------------------------
|
if((count++ % PWMControlRate) == 0)
|
{
|
if((parm[1]==1) || (GB_SYS_State.OnlineVolLow==0))
|
{
|
ControlCurrent(GB_FBO_Data.SumCurrent, GB_FBO_Data.SumVoltage);
|
}
|
else if((parm[1]==0) && (GetM64PWM1Value()>0) && (GB_SYS_State.OnlineVolLow==1))
|
{
|
//------ ¹Ø±ÕÄÚ²¿¸ºÔØ,²âÊÔ¼ÌÐø½øÐÐ-------
|
CloseDisChargePower(Paused);
|
}
|
CheckTempHighAlert();
|
}
|
}
|
//
|
void ControlCurrent(const unsigned int current, const unsigned int sumvol)
|
{
|
static unsigned char ControlIndex = 0;
|
unsigned char offsetvalue = 0;
|
unsigned int settedparam = 0;
|
unsigned int settedcurrent = GB_TestingParm[4] * 10;
|
unsigned int Settedpower = GB_TestingParm[15];
|
unsigned long value = 0;
|
unsigned int CurrentMax = 0;
|
unsigned long PowerAll = 0;
|
|
PowerAll = GetDisChargeI();
|
PowerAll *= GetInnerSumVol();
|
PowerAll /= 100;
|
|
if(GetInnerSumVol() > 1600) CurrentMax = 650; //×î´óµçÁ÷65.0A
|
else CurrentMax = 1250; //×î´óµçÁ÷125.0A
|
|
if((GB_TestingParm[14]==Static_Res) && (WPWorkModeResLock==TRUE))
|
{
|
return;
|
}
|
|
ControlIndex++;
|
|
if((GB_TestingParm[14]==Static_Curr) || (GB_TestingParm[14]==Static_Res))
|
{
|
offsetvalue = 5; //Èç¹ûʵ¼Ê·ÅµçµçÁ÷±ÈÉ趨µÄÆ«²î0.5AÒÔÉÏ
|
value = current;
|
settedparam = settedcurrent;
|
|
//---- Ïà²î10AÒÔÉÏ¿ìËÙµ÷ÖÆ,·ñÔòÂýËÙµ÷ÖÆ ----
|
if(((value>settedparam)&&(value-settedparam>100)) || ((settedparam>value)&&((settedparam-value)>100)))
|
PWMControlRate = 64;
|
else PWMControlRate = 256;
|
}
|
else if(GB_TestingParm[14] == Static_Power)
|
{
|
offsetvalue = 2; //Èç¹ûʵ¼Ê·ÅµçµçÁ÷±ÈÉ趨µÄÆ«²î0.2KWÒÔÉÏ
|
value = current;
|
value *= sumvol;
|
value /= 10000;
|
settedparam = Settedpower;
|
//---- Ïà²î2KWÒÔÉÏ¿ìËÙµ÷ÖÆ,·ñÔòÂýËÙµ÷ÖÆ ----
|
if(((value>settedparam)&&(value-settedparam>5)) || ((settedparam>value)&&((settedparam-value)>5)))
|
PWMControlRate = 64;
|
else PWMControlRate = 256;
|
}
|
|
if((settedparam>value) && ((settedparam-value)>offsetvalue))
|
{
|
if(WPGetVolRange() == 1)//´óÓÚ160V,Ö»¿ªÒ»Â·PWM
|
{
|
//---- Èç¹ûPWM´¦ÓڹرÕ״̬ÔòÏÈ¿ªÆôPWM1 -----
|
if(GetM64PWM1Value() == 0)
|
Start_M64PWM1();
|
|
//-- Èç¹ûPWM1δµ½×î´óÖµ250,ÔòÔÙÖ»µ÷ÕûÂö¿í --
|
else if((GetM64PWM1Value() < PWMValueMax) && (GetDisChargeI()<(CurrentMax+20)) && (PowerAll<PowerMax))
|
SetM64PWM1Value(GetM64PWM1Value()+1);
|
|
/* else if(DischargePower & ParallelCtrl)//¼òÒ×°æ²¢»úÄ£¿é¿ØÖÆ
|
{
|
DischargePower &= (~ParallelCtrl);
|
SendDataToHC595(DischargePower);
|
_delay_ms(10);
|
}*///2016-7-28 ÐÞ¸Ä ¹Ø±Õ²¢»ú¹¦ÄÜ Ôö¼Ó²¢»ú»¥¿Ø¹¦ÄÜ
|
}
|
else
|
{
|
if((ControlIndex%3) == 1)
|
{
|
//---- Èç¹ûPWM´¦ÓڹرÕ״̬ÔòÏÈ¿ªÆôPWM1 -----
|
if(GetM64PWM1Value() == 0)
|
Start_M64PWM1();
|
|
//-- Èç¹ûPWM1δµ½×î´óÖµ250,ÔòÔÙÖ»µ÷ÕûÂö¿í --
|
else if((GetM64PWM1Value() < PWMValueMax) && (GetDisChargeI()<(CurrentMax+20)) && (PowerAll<PowerMax))
|
SetM64PWM1Value(GetM64PWM1Value()+1);
|
}
|
else if((ControlIndex%3) == 2)
|
{
|
//---- Èç¹ûPWM2´¦ÓڹرÕ״̬ÔòÏÈ¿ªÆôPWM2 ----
|
if(GetM64PWM2Value() == 0)
|
Start_M64PWM2();
|
|
//-- Èç¹ûPWM2δµ½×î´óÖµ250,ÔòÔÙÖ»µ÷ÕûÂö¿í --
|
else if((GetM64PWM2Value() < PWMValueMax) && (GetDisChargeI()<(CurrentMax+20)) && (PowerAll<PowerMax))
|
SetM64PWM2Value(GetM64PWM2Value()+1);
|
}
|
else
|
{
|
//---- Èç¹ûPWM2´¦ÓڹرÕ״̬ÔòÏÈ¿ªÆôPWM2 ----
|
if(GetM64PWM3Value() == 0)
|
Start_M64PWM3();
|
|
//-- Èç¹ûPWM2δµ½×î´óÖµ250,ÔòÔÙÖ»µ÷ÕûÂö¿í --
|
else if((GetM64PWM3Value() < PWMValueMax) && (GetDisChargeI()<(CurrentMax+20)) && (PowerAll<PowerMax))
|
SetM64PWM3Value(GetM64PWM3Value()+1);
|
/*
|
else if(DischargePower & ParallelCtrl)//¼òÒ×°æ²¢»úÄ£¿é¿ØÖÆ
|
{
|
DischargePower &= (~ParallelCtrl);
|
SendDataToHC595(DischargePower);
|
_delay_ms(10);
|
}*/
|
}
|
}
|
}
|
else if((PowerAll>(PowerMax+500)) || ((value>settedparam) && ((value-settedparam)>offsetvalue)))
|
{
|
if(WPGetVolRange() == 1)//´óÓÚ160V,Ö»¿ªÒ»Â·PWM
|
{
|
//--- Èç¹ûPWM1δµ½×îÐÖµ¡10,ÔòÔÙÖ»µ÷ÕûÂö¿í ---
|
if(GetM64PWM1Value() > PWMValueMin)
|
SetM64PWM1Value(GetM64PWM1Value()-1);
|
else
|
{
|
Stop_M64PWM();
|
}
|
}
|
else
|
{
|
//--- Èç¹ûPWM1δµ½×îÐÖµ¡10,ÔòÔÙÖ»µ÷ÕûÂö¿í ---
|
if(GetM64PWM1Value() > PWMValueMin)
|
SetM64PWM1Value(GetM64PWM1Value()-1);
|
//--- Èç¹ûPWM2δµ½×îÐÖµ¡10,ÔòÔÙÖ»µ÷ÕûÂö¿í ---
|
if(GetM64PWM2Value() > PWMValueMin)
|
SetM64PWM2Value(GetM64PWM2Value()-1);
|
//--- Èç¹ûPWM3δµ½×îÐÖµ¡10,ÔòÔÙÖ»µ÷ÕûÂö¿í ---
|
if(GetM64PWM3Value() > PWMValueMin)
|
SetM64PWM3Value(GetM64PWM3Value()-1);
|
//- Èç¹ûPWM1,PWM2´¦ÓÚ¿ªÆô״̬,Ôò×îÖչرÕPWM -
|
else
|
{
|
Stop_M64PWM();
|
}
|
}
|
}
|
else
|
{
|
if(GB_TestingParm[14] == Static_Res)
|
{
|
WPWorkModeResLock = TRUE;
|
}
|
}
|
}
|
//
|
unsigned char SetPowerStep(void)
|
{
|
unsigned char RChannel = 0;
|
|
return RChannel;
|
}
|
unsigned char StartErrorCheck(void)
|
{
|
unsigned char res = 0;
|
|
//------ ¼ì²âÊäÈëµÄ·ÅµçµçÀ¶˵çѹÊÇ·ñ¹ý¸ß»ò¹ýµÍ ------
|
if(GetInnerSumVol() > SUM_VOL_TOOHIGHT)
|
{
|
res = 1;
|
}
|
if(GetInnerSumVol() < SUM_VOL_TOOLOW)
|
{
|
res = 1;
|
}
|
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ################################
|
#if(MashineType == FBO48CT)
|
//--------------- ¼ì²âÔÚÏßµçѹÊÇ·ñ¹ý¸ß ---------------
|
if(GB_FBO_Data.OnlineVol > SUM_VOL_TOOHIGHT)
|
{
|
res = 1;
|
}
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ################################
|
|
if(res != 0)
|
{
|
DischargePower = (DischargeControlInit|WIND);
|
SendDataToHC595(DischargePower);
|
}
|
else
|
{
|
DischargePower &= ~(PowerSwitch);
|
SendDataToHC595(DischargePower);
|
WPChildPage = DSPMessageBoxNull;
|
DSPMessageBox1(WPAlarmText[8],34, MB_OK, BeepNull);
|
}
|
//----- ¼ì²âͨ¹ý·µ»Ø0 -----
|
return res;
|
}
|
//
|
//************************************************************************************
|
//-------------------¼ÓÈëÍÑ¿ÛÆ÷-----------------------------------------------------
|
void SetPowerSwitchEnabled(void)
|
{
|
if(GB_SYS_State.WorkState == Stopped)
|
{
|
DischargePower = DischargeControlInit;
|
}
|
|
//--------- ÏÈ¿ª·çÉÈ ------------
|
DischargePower |= (WIND);
|
//--------- ÔÊÐí¶Ï·Æ÷ÍÑ¿ÛÆ÷ʹÄÜ ------------
|
DischargePower &= ~(PowerSwitch);
|
SendDataToHC595(DischargePower);
|
_delay_ms(200);
|
}
|
//--------------------------------------------------------------------------------------------------
|
void SetPowerSwitchDisabled(void)
|
{
|
//--------- ÔÊÐí¶Ï·Æ÷ÍÑ¿ÛÆ÷ʹÄÜ ------------
|
DischargePower |= (PowerSwitch);
|
SendDataToHC595(DischargePower);
|
_delay_ms(200);
|
}
|
//--------------------------------------------------------------------------------------------------
|
void InitDisChargePower(void)
|
{
|
if(GB_SYS_State.WorkState == Stopped)
|
{
|
DischargePower = DischargeControlInit;
|
}
|
|
//--------- ÏÈ¿ª·çÉÈ ------------
|
DischargePower |= (WIND);
|
SendDataToHC595(DischargePower);
|
_delay_ms(100);
|
wdt_reset(); //ι¹·
|
}
|
//************************************************************************************
|
|
void OpenDisChargePower(const unsigned char workstate)
|
{
|
//---¿ª¹¦ÂÊʱȷ±£²¢»úÐźÅδ·¢³ö---
|
DischargePower |= ParallelCtrl;
|
|
//------- ¿ªÍ¨µç×ܵçÔ´ ----------
|
DischargePower &= ~(CtrlPowerAll);
|
SendDataToHC595(DischargePower);
|
_delay_ms(200);
|
|
wdt_reset(); //ι¹·
|
|
SendVoltage();//¿ØÖƼ̵çÆ÷
|
|
wdt_reset(); //ι¹·
|
|
if(GetInnerSumVol() > 1600)//´óÓÚ160Ϊ1.
|
{
|
VolRange = 1;
|
}
|
else
|
{
|
VolRange = 0;
|
}
|
|
//----- ÑÓʱ500msºóÆô¶¯PWM ------
|
Delay_MS(500);
|
|
Start_M64PWM1();
|
wdt_reset(); //ι¹·
|
}
|
|
unsigned char WPGetVolRange(void) //ÓÃÓÚ±êʶ¸ßÓÚ160V»òµÍÓÚ160V
|
{
|
return VolRange;
|
}
|
//
|
//--------¶Ï¿ª×Ô¼ºµÄ¼ÌµçÆ÷-----------
|
void CloseSelfRelay(void)
|
{
|
if(!(DischargePower & ParallelCtrl))
|
{
|
DischargePower |= ParallelCtrl;
|
SendDataToHC595(DischargePower);
|
_delay_ms(10);
|
}
|
}
|
void CloseDisChargePower(const unsigned char workstate)
|
{
|
//-------- ÏȹرÕPWM ---------
|
Stop_M64PWM();
|
_delay_ms(500);
|
wdt_reset(); //ι¹·
|
|
|
SendStopCMD();//¿ØÖƼ̵çÆ÷
|
|
//-------- ×Ô¶¯¶Ï¿ª¶Ï·Æ÷ -----------------
|
DischargePower |= (PowerSwitch);
|
SendDataToHC595(DischargePower);
|
Delay_MS(500);
|
wdt_reset(); //ι¹·
|
|
//--------- ÏȹضÏËùÓÐMOS¹Ü,°üÀ¨²¢»úµÄMOS¹Ü ----------
|
DischargePower = (DischargeControlInit|WIND);
|
//---ͨ¹ý²¢»úÐźÅÍ£Ö¹´Ó»ú¹¤×÷---
|
DischargePower &= (~ParallelCtrl);
|
SendDataToHC595(DischargePower);
|
SetSumVolParam(5);
|
|
//--------- ÑÓʱ200ms --------
|
_delay_ms(200);
|
wdt_reset(); //ι¹·
|
}
|
//
|
void StartTestingFrom(const unsigned char workstate)
|
{
|
if(InitTestingParm() == 0)//³õʼ»¯Ê§°ÜÍ˳ö;
|
return;
|
#if(MashineType == FBO48CT)
|
#else
|
if(GB_TestingParm[1] == 0)
|
{
|
Set_ACPOWER_Work(ACPOWER_CK_ENABLE);
|
}
|
else
|
{
|
Set_ACPOWER_Work(ACPOWER_CK_DISABLE);
|
}
|
#endif
|
SetOringinMonomerVol(GB_FBO_Data.SingleVol);
|
ResumeTestingFrom(workstate);
|
}
|
//
|
|
void ResumeTestingFrom(const unsigned char workstate)
|
{
|
// unsigned char n = 0;
|
|
ClearModuleError(); //Çå³ýµ¥ÌåÄ£¿éÒì³£±êʶ
|
GB_SYS_State.OnlineVolLow = 0; //Çå³ýÔÚÏßµçѹÒì³£±êʶ
|
EnableMonomerVolGether();
|
/*
|
//----- ²âÊÔ¿ªÊ¼Ç°ÏȲɼ¯1´ÎËùÓеĵ¥Ìåµçѹ -----
|
n = GetModuleSum();
|
while(n--)
|
{
|
Get_Vol_Datas(&GB_FBO_Data, &GB_SYS_State);
|
_delay_ms(50);
|
}
|
*/
|
InitM64Timer1();//------³õʼ»¯1ÃëÖÓ¶¨Ê±Æ÷
|
GB_SYS_State.DealTimer1Up = TestingTimeUp; //ÉèÖÃTimer1¶¨Ê±Öжϴ¦Àíº¯Êý
|
GB_SYS_State.SaveDateEN = 1; //±£´æµÚÒ»±ÊÊý¾Ý
|
GB_SYS_State.SendRTDataEN = 1; //·¢Ë͵ÚÒ»±ÊʵʱÊý¾Ý
|
ChargeWaitCountDown = 60;
|
|
WPWorkModeResLock = FALSE; //ºãµç×è·Åµçµ÷ÖÆ½âËø
|
|
GB_SYS_State.WorkState = Discharging; //ϵͳ¹¤×÷״̬Ϊ£º·ÅµçÖÐ
|
WPWorkState = WPDISCHARGING; //²âÊÔ״̬:·Åµç½çÃæ·ÅµçÖÐ
|
UpdateWPStateText(WPWorkState); //¸üзŵç½çÃæ×´Ì¬ÐÅÏ¢
|
DrawControlButton(GB_SYS_State.WorkState);
|
|
OpenDisChargePower(workstate); //Æô¶¯·Åµç¹¦ÂÊ¿ØÖÆ
|
|
StartM64Timer1(); //-----¿ªÆô1ÃëÖÓ¶¨Ê±Æ÷
|
}
|
//
|
|
void SuspendTesting(const unsigned char pausetype)
|
{
|
StopM64Timer1(); //¹Ø±Õ1ÃëÖÓ¶¨Ê±Æ÷
|
StopAlarmBeep(); //¹Ø±ÕÈκθ澯µÄ·äÃùÆ÷
|
CloseDisChargePower(Paused); //ÇÐ¶Ï·Åµç»ØÂ·
|
GB_SYS_State.DealTimer1Up = M64Timer1UpNull; //ÖÃ1Ã붨ʱÖжϴ¦Àíº¯ÊýΪ¿Õº¯Êý
|
|
if(GB_SYS_State.CurrentPage == DSPMessageBoxNull)//´¦ÓÚÏûÏ¢¿òÒ³Ãæ
|
{
|
TerminateMSGBox();
|
return;
|
}
|
|
GB_SYS_State.WorkState = Paused; //ÖÃϵͳ¹¤×÷״̬ΪÔÝÍ£
|
WPWorkState = pausetype; //ÉèÖõ±Ç°¹¤×÷״̬
|
|
SaveFile(&GB_FBO_Data); //±£´æÔÝͣʱµÄÊý¾Ý
|
GB_SYS_State.SaveDateEN = 0;
|
|
if(GB_SYS_State.CurrentPage == DSPWorkingPage) //¸üÐÂ״̬À¸ºÍ°´Å¥
|
{
|
UpdateWPStateText(WPWorkState);
|
if(PageMode_View == WorkPageDSPMode)
|
DrawControlButton(GB_SYS_State.WorkState);
|
}
|
}
|
//
|
|
void StopTesting(const unsigned char stoptype)
|
{
|
StopM64Timer1(); //¹Ø±Õ1ÃëÖÓ¶¨Ê±Æ÷
|
StopAlarmBeep(); //¹Ø±ÕÈκθ澯µÄ·äÃùÆ÷
|
DisableMonomerVolGether();
|
CloseDisChargePower(Stopped); //ÇÐ¶Ï·Åµç»ØÂ·
|
GB_SYS_State.DealTimer1Up = M64Timer1UpNull; //ÖÃ1Ã붨ʱÖжϴ¦Àíº¯ÊýΪ¿Õº¯Êý
|
|
if(GB_SYS_State.CurrentPage == DSPMessageBoxNull)//´¦ÓÚÏûÏ¢¿òÒ³Ãæ
|
{
|
TerminateMSGBox();
|
return;
|
}
|
|
GB_SYS_State.WorkState = Stopped; //ÖÃϵͳ¹¤×÷״̬Ϊֹͣ
|
WPWorkState = stoptype; //ÉèÖõ±Ç°¹¤×÷״̬Ϊֹͣ
|
|
SaveFile(&GB_FBO_Data); //±£´æÍ£Ö¹Ê±µÄÊý¾Ý
|
CloseFile(&(GB_FBO_Data), WPWorkState); //¹Ø±ÕÎļþ
|
GB_SYS_State.SaveDateEN = 0; //ÇåÁãÊý¾Ý±£´æ±êʶ
|
|
if(GB_SYS_State.CurrentPage == DSPWorkingPage) //¸üÐÂ״̬À¸ºÍ°´Å¥
|
{
|
UpdateValue();
|
UpdateWPStateText(WPWorkState);
|
if(PageMode_View == WorkPageDSPMode)
|
DrawControlButton(GB_SYS_State.WorkState);
|
}
|
|
//------------------- Èç¹û²»ÊÇÈ˹¤Í£Ö¹»òÔÝÍ£ --------------------
|
if((WPWorkState!=WPMANUALPAUSE) && (WPWorkState!=WPMANUALPSTOP))
|
{
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
#if(MashineType == FBO48CT)
|
//----------- Èç¹û²âÊÔģʽΪÔÚÏ߷ŵç --------------
|
if(GB_TestingParm[0] == 0)
|
{
|
GB_SYS_State.WorkState = WaitForCharging;
|
GB_SYS_State.DealTimer1Up = BeginChargeCountDown;//ÉèÖÃTimer1¶¨Ê±Öжϴ¦Àíº¯ÊýΪ³äµç¿ªÊ¼µ¹¼ÆÊ±
|
InitM64Timer1(); //³õʼ»¯1ÃëÖÓ¶¨Ê±Æ÷
|
StartM64Timer1(); //¿ªÆô1ÃëÖÓ¶¨Ê±Æ÷
|
}
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
|
//------------------ ÏÔʾÐÅÏ¢¿ò -------------------
|
if(GB_SYS_State.CurrentPage == DSPSingleVolData) //ÏÈÍ˳öµ¥ÌåÒ³Ãæ
|
{
|
QuitSingleVolPage();
|
}
|
WPChildPage = DSPMessageBoxNull;
|
if(7 == WPWorkState)
|
{
|
DSPMessageBox(WPStateText[WPWorkState], 35, MB_OK, FDCapFinished);
|
}
|
else
|
{
|
if((WPWorkState == 1)||(WPWorkState == 2))
|
DSPMessageBox(WPStateText[WPWorkState], 12, MB_OK, FDCapFinished);
|
else
|
DSPMessageBox(WPStateText[WPWorkState], 10, MB_OK, FDCapFinished);
|
}
|
//DSPMessageBox(WPStateText[WPWorkState], 10, MB_OK, FDCapFinished);
|
}
|
else //Èç¹ûÊÇÈ˹¤Í£Ö¹»òÔÝÍ£
|
{
|
EnableMonomerVolGether();
|
}
|
}
|
//
|
|
|
//############################ ½çÃæÀà ######################################
|
unsigned char DSPWorkingPage(void)
|
{
|
DisableCustomInput();
|
if(WPChildPage != GB_SYS_State.CurrentPage) //ÅжÏÊÇ·ñ´Ó×ÓÒ³Ãæ·µ»Ø
|
{
|
WPParentPage = GB_SYS_State.CurrentPage;//±£´æ¸¸Ò³ÃæÖ¸Õë
|
WPWorkState = WPMANUALPSTOP; //³õʼ»¯·Åµç¹¦ÄÜÄ£¿é״̬
|
WorkPageDSPMode = PageMode_Set;
|
EnableMonomerVolGether(); //ÔÊÐí²É¼¯µ¥Ìå
|
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(GetMemoryRest() <= 33)
|
{
|
GetAndDspMemoryRest(320, 360); //ÏÔʾÄÚ´æÓàÁ¿
|
}
|
}
|
|
GB_SYS_State.CurrentPage = DSPWorkingPage;
|
WPChildPage = DSPWorkingPage;
|
GB_SYS_State.GetInput = GetWorkingPageButtonDown;
|
GB_SYS_State.TestType = TestTypeDischarge; //ÉèÖòâÊÔÀàÐÍΪ·Åµç
|
|
//------- Ð޸IJÎÊýµÄË÷ÒýÇåÁã -------
|
ModifyItemIndex = 0;
|
|
//------- Ãè»æÔ¤Öð´Å¥ ------------------
|
if(WorkPageDSPMode == PageMode_Set)
|
{
|
DSPTestingParmItem(ModifyItemIndex, white, blue);
|
UpdateTestingParm(GB_TestingParm);
|
DrawPresetButton(GB_SYS_State.WorkState);
|
}
|
|
else//------- ÏÔʾÎı¾ºÍ״̬ ------------
|
{
|
DSPWorkingPageText();
|
//------- Ãè»æ¿ØÖư´Å¥ ------------------
|
DrawControlButton(GB_SYS_State.WorkState);
|
}
|
|
UpdateWPStateText(WPWorkState);
|
//------- ¸üÐÂÊýÖµÏÔʾ --------------
|
|
return 0;
|
}
|
//
|
|
void DrawControlButton(const unsigned char sysstate)
|
{
|
//------------------------ ÈôÊǷŵç״̬ --------------------------------
|
if(sysstate == Discharging)
|
{
|
DrawButtonH48(2, WPButtonItem[0], 4, 14, 18, 24, 400, gray1, gray2); //·ÅµçÎÞЧ
|
DrawButtonH48(2, WPButtonItem[9], 5, 14, 12, 149, 400, gray1, white);//ÔÝÍ£ÓÐЧ
|
}
|
//------------------------ ·ñÔò ----------------------------------------
|
else
|
{
|
if((sysstate==WaitForCharging)||((WPWorkState!=WPAUTOPAUSE)&&(WPWorkState!=WPMANUALPAUSE)&&(WPWorkState!=WPMANUALPSTOP)))
|
{
|
DrawButtonH48(2, WPButtonItem[0], 4, 14, 18, 24, 400, gray1, gray2); //·ÅµçÎÞЧ
|
DrawButtonH48(2, WPButtonItem[9], 5, 14, 12, 149, 400, gray1, gray2);//ÔÝÍ£ÎÞЧ
|
}
|
else
|
DrawButtonH48(2, WPButtonItem[0], 4, 14, 18, 24, 400, gray1, white); //·ÅµçÓÐЧ
|
|
if(sysstate == Stopped)
|
DrawButtonH48(2, WPButtonItem[9], 5, 14, 12, 149, 400, gray1, gray2);//ÔÝÍ£ÎÞЧ
|
else if(sysstate == Paused)
|
DrawButtonH48(2, WPButtonItem[1], 4, 14, 18, 149, 400, gray1, white);//Í£Ö¹ÓÐЧ
|
}
|
|
if(GB_FBO_Data.BattSum > 0)
|
DrawButtonH481(2, WPButtonItem[2], 8, 11, 2, 274, 400, gray1, white);//µ¥Ìå
|
else DrawButtonH481(2, WPButtonItem[2], 8, 11, 2, 274, 400, gray1, gray2);//µ¥Ìå
|
|
DrawButtonH48(2, WPButtonItem[11], 6, 14, 6, 399, 400, gray1, white);//²ÎÊý
|
DrawButtonH48(2, WPButtonItem[3], 5, 14, 10, 524, 400, gray1, red); //Í˳ö
|
}
|
//
|
|
//------------------ Ô¤Öð´Å¥ ---------------------
|
void DrawPresetButton(const unsigned char sysstate)
|
{
|
unsigned char fcl;
|
if(WPWorkState == WPMANUALPSTOP)
|
DrawButtonH48(2, WPButtonItem[0], 4, 14, 20, 24, 400, gray1, white); //·Åµç
|
else
|
DrawButtonH48(2, WPButtonItem[12], 5, 14, 12, 24, 400, gray1, white); //·µ»Ø
|
|
if(ModifyItemIndex == 0)
|
{
|
DrawButtonH481(2, WPButtonItem[4], 8, 11, 2, 524, 48, gray1, white); //ÐÞ¸Ä
|
DrawButtonH48(2, WPButtonItem[7], 6, 14, 2, 524, 306, gray1, gray2);//È¡Ïû
|
DrawButtonH48(2, WPButtonItem[8], 6, 14, 3, 399, 400, gray1, gray2);//Ó¦ÓÃ
|
DrawButtonH48(2, WPPresetButtonItem[TestingParmIndex], 5, 16, 12, 274, 400, gray1, white);//Ô¤ÖÃ
|
}
|
else
|
{
|
DrawButtonH48(2, WPButtonItem[10], 5, 14, 12, 524, 48, gray1, white);//Ñ¡Ôñ
|
DrawButtonH48(2, WPButtonItem[7], 6, 14, 2, 524, 306, gray1, white);//È¡Ïû
|
DrawButtonH48(2, WPButtonItem[8], 6, 14, 3, 399, 400, gray1, white);//Ó¦ÓÃ
|
DrawButtonH48(2, WPPresetButtonItem[TestingParmIndex], 5, 16, 10, 274, 400, gray1, gray2);//Ô¤ÖÃ
|
}
|
|
if(WPWorkState != WPMANUALPSTOP)
|
DrawButtonH48(2, WPPresetButtonItem[TestingParmIndex], 5, 16, 10, 274, 400, gray1, gray2);//Ô¤ÖÃ
|
|
if((ModifyItemIndex==0)
|
|| (((ModifyItemIndex==1)||(ModifyItemIndex==12)||(ModifyItemIndex==13))
|
&&(GB_SYS_State.WorkState!=Stopped)))
|
{
|
fcl = gray2;
|
}
|
else fcl = white;
|
|
DrawButtonH48(2, WPButtonItem[5], 1, 30, 40, 524, 134, gray1, fcl);//+
|
DrawButtonH48(2, WPButtonItem[6], 1, 30, 40, 524, 220, gray1, fcl);//-
|
DrawButtonH48(2, WPButtonItem[3], 5, 14, 10, 524, 400, gray1, red); //Í˳ö
|
}
|
//
|
|
void DSPWorkingPageText(void)
|
{
|
DSP16x24Str(WPText[1], 6, 14, 24, 16, blue, yellow); //·Åµç²âÊÔ
|
#if(SoftLanguage == CN)
|
DrawLine(24, 42, 12, 0, blue, white, linebold, 2);
|
#else
|
DrawLine(24, 40, 11, 0, blue, white, linebold, 2);
|
#endif
|
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ########################
|
#if(MashineType == FBO48CT)
|
DSP24x24Str(WPText[2], 5, 24, 48, 64, blue, white); //ÔÚÏßµçѹ
|
DSP24x24Str(WPText[3], 5, 24, 48, 96, blue, white); //×é¶Ëµçѹ
|
DSP24x24Str(WPText[4], 6, 24, 48, 128, blue, white); //·ÅµçµçÁ÷
|
DSP24x24Str(WPText[9], 7, 24, 340, 64, blue, white); //Òѵ½ÏÂÏÞ
|
DSP24x24Str(WPSubText[5], 1, 24, 556, 64, blue, white); //¸ö
|
DSP24x24Str(WPText[6], 5, 24, 340, 96, blue, white); //ÒÑ·Åʱ¼ä
|
DSP24x24Str(WPText[5], 6, 24, 340, 128, blue, white); //ÒÑ·ÅÈÝÁ¿
|
#else
|
DSP16x24Str(WPText[3], 5, 14, 48, 64, blue, white); //×é¶Ëµçѹ
|
DSP16x24Str(WPText[4], 4, 14, 48, 96, blue, white); //·ÅµçµçÁ÷
|
DSP16x24Str(WPModeSelText[3], 5, 16, 48, 128, blue, white); //·Åµç¹¦ÂÊ
|
DSP16x24Str(WPText[5], 8, 14, 340, 64, blue, white); //ÒÑ·ÅÈÝÁ¿
|
DSP16x24Str(WPText[9], 12, 14, 340, 96, blue, white); //Òѵ½ÏÂÏÞ
|
DSP16x24Str(WPSubText[5], 2, 15, 570, 96, blue, white); //¸ö
|
DSP16x24Str(WPText[6], 6, 14, 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(WPSubText[0], 2, 14, 24, 188, blue, white); //µç³Ø×é
|
DSP16x24Str(WPSubText[1], 3, 14, 69, 188, blue, white); //µçÁ÷
|
//#if(SoftLanguage == CN)
|
DSP16x24Str(WPSubTextEXT[0], 3, 16,110, 188, blue, white); //(A)
|
//#endif
|
DSP16x24Str(WPSubText[2], 3, 15, 172, 188, blue, white); //ÈÝÁ¿
|
//#if(SoftLanguage == CN)
|
DSP16x24Str(WPSubTextEXT[1], 4, 16, 215, 188, blue, white); //(AH)
|
//#endif
|
DSP16x24Str(WPSubText[3], 4, 16, 294, 188, blue, green7);//×î¸ßµ¥Ìå
|
//#if(SoftLanguage == CN)
|
DSP16x24Str(WPSubTextEXT[2], 3, 16, 370, 188, blue, green7);//(V)
|
//#endif
|
DSP16x24Str(WPSubText[4], 3, 16, 480, 188, blue, red); //×îµÍµ¥Ìå
|
//#if(SoftLanguage == CN)
|
DSP16x24Str(WPSubTextEXT[2], 3, 16, 550, 188, blue, red); //(V)
|
//#endif
|
|
UpdateValue();
|
DSP16x24Str(WPText[0], 10, 14, 24, 360, blue, yellow); //µ±Ç°×´Ì¬
|
}
|
//
|
|
void DSPTestingParmItem(unsigned char index, unsigned char Bcolor, unsigned char Fcolor)
|
{
|
unsigned char n = 0;
|
unsigned char Bcl,Fcl;
|
|
if(PageMode_Set == WorkPageDSPMode)
|
{
|
DSP16x24Str(WPText_ex[4], 9, 14, 24, 16, blue, yellow); //·Åµç²ÎÊý
|
#if(SoftLanguage == CN)
|
DrawLine(24, 42, 12, 0, blue, white, linebold, 2);
|
DSP16x24Str(WPText_ex[4], 9, 14, 24, 64, blue, white);//·Åµç²ÎÊý
|
#else
|
DrawLine(24, 40, 16, 0, blue, white, linebold, 2);
|
DSP12x16Str(WPText_ex[5], 13, 12, 24, 64, blue, white);//·Åµç²ÎÊý
|
#endif
|
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
#if(MashineType == FBO48CT)
|
for(n=10; n<23; n++)
|
{
|
if(n == index+9)
|
{
|
Bcl = Bcolor; Fcl = Fcolor;
|
}
|
else
|
{
|
Bcl = blue; Fcl = green7;
|
}
|
if(n < 17)
|
DSP24x24Str(WPText[n], 5, 24, 24, 64+32*(n-9), Bcl, Fcl); //Ô¤·ÅÐÅÏ¢
|
else DSP24x24Str(WPText[n], 5, 24, 292, 64+32*(n-16), Bcl, Fcl);//Ô¤·ÅÐÅÏ¢
|
}
|
DSP24x24Str(WPSubText[5], 2, 12, 460, 160, blue, green7); //¸ö
|
DSP24x24Str(WPSubText[0], 2, 12, 460, 192, blue, green7); //×é
|
DSP24x24Str(WPSubText[5], 2, 12, 460, 224, blue, green7); //¸ö
|
#else
|
for(n=11; n<25; n++)
|
{
|
if(n == index+9)
|
{
|
Bcl = Bcolor; Fcl = Fcolor;
|
}
|
else
|
{
|
Bcl = blue; Fcl = green7;
|
}
|
switch(n)
|
{
|
case 11:
|
DSP12x16Str(WPText[n], 12, 11, 24, 64+32*(n-10), Bcl, Fcl);//Í£µç´¦Àí
|
break;
|
case 12:
|
DSP12x16Str(WPText[n], 10, 11, 24, 64+32*(n-10), Bcl, Fcl);//±ê³ÆÈÝÁ¿
|
break;
|
case 13:
|
DSP12x16Str(WPText[n], 12, 11, 24, 64+32*(n-10), Bcl, Fcl);//СʱÂÊ
|
break;
|
case 14:
|
DSP12x16Str(WPText[n], 10, 11, 24, 64+32*(n-10), Bcl, Fcl);//²âÊÔģʽ
|
break;
|
case 15:
|
DSP12x16Str(WPText[n], 12, 11, 24, 64+32*(n-10), Bcl, Fcl);//Ô¤·ÅµçÁ÷
|
break;
|
case 16:
|
DSP12x16Str(WPText[n], 9, 11, 24, 64+32*(n-10), Bcl, Fcl);//Ô¤·Å¹¦ÂÊ
|
break;
|
case 17:
|
//DSP12x16Str(WPText[n], 13, 11, 24, 64+32*(n-10), Bcl, Fcl);//Ô¤·ÅÈÝÁ¿
|
DSP12x16Str(WPText[n], 13, 11, 292, 96, Bcl, Fcl);//Ô¤·ÅÈÝÁ¿
|
break;
|
////////
|
case 18:
|
DSP12x16Str(WPText[n], 14, 11, 292, 64+32*(n-17)+32, Bcl, Fcl);//Ô¤·Åʱ¼ä
|
break;
|
case 19:
|
DSP12x16Str(WPText[n], 12, 11, 292, 64+32*(n-17)+32, Bcl, Fcl);//µ¥ÌåÏÂÏÞ
|
break;
|
////
|
case 20:
|
DSP12x16Str(WPText[n],12, 11, 292, 64+32*(n-17)+32, Bcl, Fcl);//×é¶ËÏÂÏÞ
|
break;
|
case 21:
|
DSP12x16Str(WPText[n],7, 11, 292, 64+32*(n-17)+32, Bcl, Fcl);//ÿ×éµ¥Ìå
|
break;
|
case 22:
|
DSP12x16Str(WPText[n],7, 11, 292, 64+32*(n-17)+32, Bcl, Fcl);//²âÊÔ×éÊý
|
break;
|
case 23:
|
DSP12x16Str(WPText[n],12, 11, 292, 64+32*(n-17)+32, Bcl, Fcl);//ÏÂÏÞÊýÁ¿
|
break;
|
case 24:
|
//DSP12x16Str(WPText[n],12, 11, 292, 64+32*(n-17)+32, Bcl, Fcl);//±£´æ¼ä¸ô
|
DSP12x16Str(WPText[n],12, 11, 24, 288, Bcl, Fcl);//±£´æ¼ä¸ô
|
break;
|
default : break;
|
}
|
}
|
DSP12x16Str(WPSubText[5], 2, 12, 460, 128+32*2+32, blue, green7); //¸ö
|
DSP12x16Str(WPSubText[0], 2, 12, 460, 160+32*2+32, blue, green7); //×é
|
DSP12x16Str(WPSubText[5], 2, 12, 470, 192+32*2+32, blue, green7); //¸ö
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
|
DSP16x24Str(WPText[0], 10, 14, 24, 360, blue, yellow); //µ±Ç°×´Ì¬
|
}
|
}
|
//
|
|
unsigned char GetWPStateIndex(void)
|
{
|
return WPWorkState;
|
}
|
//
|
|
void UpdateWPStateText(unsigned char stateindex)
|
{
|
if(7 == stateindex) //Ö÷»úÍ£Ö¹»òÕßζȹý¸ß£¡
|
stateindex = 0; //Í£Ö¹
|
if((stateindex == 1)||(stateindex ==2))
|
DSP16x24Str(WPStateText[stateindex], 12, 14, 165, 360, blue, yellow);//µ±Ç°×´Ì¬µÄÖµ
|
else
|
DSP16x24Str(WPStateText[stateindex], 10, 14, 165, 360, blue, yellow);//µ±Ç°×´Ì¬µÄÖµ
|
|
if(GB_SYS_State.WorkState == Discharging)
|
{
|
DSP24x24Space(16, 320, 360, blue, yellow);//ÏÈÌî³ä¿Õ¸ñ
|
//---------- Èç¹ûÓе¥ÌåÄ£¿éÒì³£,ÔòÏÔʾ"XXºÅÄ£¿éÒì³£" ---------------
|
if(GetModuleDropIndex() > 0)
|
{
|
DSP16x24Str(WPAlarmText[5], 16, 14, 320, 360, blue, yellow);
|
PrintValue(3, 0, GetModuleDropIndex(), "!",16, 560, 360, blue, yellow);
|
}
|
//---------- Èç¹ûÓÐÎÞÏßµçÁ÷ǯÒì³£,ÔòÏÔʾ"XXºÅµçÁ÷ǯÒì³£" -----------
|
else if(GetClampDropIndex() > 0)
|
{
|
if(GetClampDropIndex() == 1)
|
DSP24x24Str(WPAlarmText[7], 10, 24, 292, 360, blue, yellow);
|
else
|
{
|
DSP24x24Str(WPAlarmText[6], 10, 24, 292, 360, blue, yellow);
|
PrintValue(3, 0, GetClampDropIndex()-1, "",16, 300, 360, blue, yellow);
|
}
|
}
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
#if(MashineType == FBO48CT)
|
//---------- ÈôÊÇÔÚÏ߷ŵ粢ÇÒÔÚÏßµçѹ<52V,ÌáʾÔÚÏßµçѹµÍ -----------
|
else if((GB_TestingParm[0]==0) && (GB_SYS_State.OnlineVolLow==1))
|
{
|
DSP24x24Str(WPStateText[WPPOWERBREAKSTOP], 10, 24, 292, 360, blue, yellow);
|
}
|
#else
|
else if((GB_TestingParm[1]==0) && (GB_SYS_State.OnlineVolLow==1))
|
{
|
DSP16x24Str(WPStateText[WPPOWERBREAKSTOP], 10, 16, 320, 360, blue, yellow);
|
}
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
}
|
}
|
//
|
void UpdateTestingParm(const unsigned int *Parm)
|
{
|
if(PageMode_Set == WorkPageDSPMode)
|
{
|
Test_Time tmptime;
|
tmptime.hour = Parm[6]/60;
|
tmptime.minute = Parm[6]%60;
|
|
PrintValue1(4, 0, TestingParmIndex+1, "", 12, 180, 64, blue, white);//Ô¤·ÅÐÅÏ¢
|
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
#if(MashineType == FBO48CT)
|
DSP24x24Str(WPText_ex[Parm[0]], 4, 24, 144, 96, blue, green7); //ÔÚÏ߷ŵç
|
DSP24x24Str(WPText_ex[Parm[1]+2], 4, 24, 144, 128, blue, green7);//Í£µç´¦Àí//Í£Ö¹·Åµç
|
PrintValue(1, 0, Parm[2], "AH", 16, 144, 160, blue, green7); //±ê³ÆÈÝÁ¿
|
PrintValue(3, 0, Parm[3], " ", 16, 144, 192, blue, green7); //СʱÂÊ
|
PrintValue(2, 0, Parm[4], "A", 16, 144, 224, blue, green7); //Ô¤·ÅµçÁ÷
|
PrintValue(1, 0, Parm[5], "AH", 16, 144, 256, blue, green7); //Ô¤·ÅÈÝÁ¿
|
PrintTime1(&tmptime, ':', HM, 144, 288, blue, green7); //Ô¤·Åʱ¼ä
|
PrintValue(1, 2, Parm[7], "V", 16, 412, 96, blue, green7); //µ¥ÌåÏÂÏÞ
|
PrintValue(1, 1, Parm[8], "V", 16, 412, 128, blue, green7); //×é¶ËÏÂÏÞ
|
PrintValue(2, 0, Parm[9], "", 16, 412, 160, blue, green7); //µ¥ÌåÊýÁ¿
|
PrintValue(2, 0, Parm[10], "", 16, 412, 192, blue, green7); //µç³Ø×éÊý
|
PrintValue(2, 0, Parm[11], "", 16, 412, 224, blue, green7); //µ¥ÌåÏÂÏÞÊýÁ¿
|
PrintValue(2, 0, Parm[12], "M", 16, 412, 256, blue, green7); //Êý¾Ý±£´æ¼ä¸ô
|
#else
|
DSP12x16Str(WPText_ex[Parm[1]+2], 10, 12, 160, 96, blue, green7);//Í£µç´¦Àí//Í£Ö¹·Åµç
|
PrintValue1(1, 0, Parm[2], " AH", 12, 180, 128, blue, green7); //±ê³ÆÈÝÁ¿
|
//DSP12x16Str(WPSubTextEXT[3], 1, 12, 205, 128, blue, green7);//H
|
PrintValue1(3, 0, Parm[3]/60, "H", 12, 180, 160, blue, green7); //СʱÂÊ
|
PrintValue1(3, 0, Parm[3]%60, "M", 12, 216, 160, blue, green7); //СʱÂÊ
|
DSP12x16Str(WPModeSelText[Parm[14]], 9, 12, 180, 192, blue, green7);//²âÊÔģʽ£ººãµçÁ÷£¬ºã¹¦ÂÊ
|
|
if(Parm[14] == Static_Power)
|
{
|
PrintValue1(2, 0, Parm[4], " A", 12, 180, 192+32, blue, gray2); //Ô¤·ÅµçÁ÷
|
PrintValue1(2, 1, Parm[15], " ", 12, 180, 192+64, blue, green7); //Ô¤É蹦ÂÊ
|
DSP12x16Str( WPSubText[8], 3, 12, 236, 192+64, blue, green7);//KW
|
}
|
else
|
{
|
PrintValue1(2, 0, Parm[4], " A", 12, 180, 192+32, blue, green7); //Ô¤·ÅµçÁ÷
|
PrintValue1(2, 1, Parm[15], " ", 12, 180, 192+64, blue, gray2); //Ô¤É蹦ÂÊ//2OR1?
|
DSP12x16Str( WPSubText[8], 3, 12, 236, 192+64, blue, gray2);//KW
|
}
|
//PrintValue1(1, 0, Parm[5], " AH", 12, 180, 224+32*2, blue, green7); //Ô¤·ÅÈÝÁ¿
|
PrintValue1(1, 0, Parm[5], "AH", 12, 449, 96, blue, green7); //Ô¤·ÅÈÝÁ¿
|
PrintTime1(&tmptime, ':', HM, 449, 96+32, blue, green7); //Ô¤·Åʱ¼ä
|
PrintValue1(1, 2, Parm[7], " B", 12, 425, 128+32, blue, green7); //µ¥ÌåÏÂÏÞ
|
|
PrintValue1(1, 1, Parm[8], " B", 12, 425, 96+32*2+32, blue, green7); //×é¶ËÏÂÏÞ
|
PrintValue1(2, 0, Parm[9], "", 12, 400, 128+32*2+32, blue, green7); //µ¥ÌåÊýÁ¿
|
PrintValue1(2, 0, Parm[10], "", 12, 400, 160+32*2+32, blue, green7); //µç³Ø×éÊý
|
PrintValue1(2, 0, Parm[11], "", 12, 428, 192+32*2+32, blue, green7); //µ¥ÌåÏÂÏÞÊýÁ¿
|
//PrintValue1(2, 0, Parm[12], " M", 12, 435, 224+32*2+32, blue, green7); //Êý¾Ý±£´æ¼ä¸ô
|
PrintValue1(2, 0, Parm[12], " M", 12, 180, 224+32*2, blue, green7); //Êý¾Ý±£´æ¼ä¸ô
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
}
|
}
|
//
|
void UpdateValue(void)
|
{
|
unsigned long P_Power = 0;
|
unsigned char fcl = white;
|
unsigned char fcl1 = white;
|
unsigned char fcl2 = white;
|
|
unsigned char IsUpdated = 0;
|
|
#if(SoftLanguage == CN)
|
if(GetClampType() == ClampTypeNull)
|
DSP24x24Graph(WPSubText[7], 1, 24, 148, 16, blue, yellow);
|
else DSP24x24Graph(WPSubText[6], 1, 24, 148, 16, blue, yellow);
|
#else
|
if(GetClampType() == ClampTypeNull)
|
DSP24x24Graph(WPSubText[7], 1, 24, 160, 16, blue, yellow);
|
else DSP24x24Graph(WPSubText[6], 1, 24, 160, 16, blue, yellow);
|
#endif
|
|
DSPMonomerModuleType(184, 16, yellow);
|
DSPTemperature(210, 16, yellow);
|
PrintTime(&(GB_SYS_State.DateTime), ':', YYMDHMS, 316, 16, blue, yellow);
|
|
//------- ÔÚ²ÎÊýÉèÖýçÃæ²»¸üÐÂÊýÖµ --------
|
if(PageMode_Set == WorkPageDSPMode)
|
return;
|
|
if((GB_FBO_Data.OnlineVol<GB_SYS_State.OnlineLowLimit)
|
&&(GB_FBO_Data.OnlineVol>SUM_VOL_TOOLOW))
|
{
|
fcl = red;
|
}
|
else fcl = white;
|
|
//-------------- ¼ÆËã×ܹ¦ÂÊ -----------------------
|
P_Power = GB_FBO_Data.SumCurrent;
|
P_Power *= GB_FBO_Data.SumVoltage;
|
|
P_Power /= 1000;//À©´ó10ÓÃÓÚÏÔʾÅжÏ
|
|
if(GB_SYS_State.WorkState == Discharging)
|
{
|
if(GB_TestingParm[14] == Static_Power)
|
{
|
if(((P_Power>GB_TestingParm[15]*10) && (P_Power-GB_TestingParm[15]*10)>20)
|
|| ((GB_TestingParm[15]*10>P_Power) && (GB_TestingParm[15]*10-P_Power)>20))
|
{
|
fcl2 = red;
|
}
|
//---------------- ¶ÔÏÔʾֵ½øÐÐÐÞÊÎ --------------------
|
if(abs(P_Power-GB_TestingParm[15]*10) <= 22)//²îֵΪ20W
|
{
|
IsUpdated = 2;//¹¦ÂÊÐÞÊÎ
|
}
|
}
|
else
|
{
|
if(((GB_FBO_Data.SumCurrent>GB_TestingParm[4]*10) && (GB_FBO_Data.SumCurrent-GB_TestingParm[4]*10)>10)
|
|| ((GB_FBO_Data.SumCurrent<GB_TestingParm[4]*10) &&(GB_TestingParm[4]*10-GB_FBO_Data.SumCurrent)>10))
|
{
|
fcl1 = red;
|
}
|
|
//---------------- ¶ÔÏÔʾֵ½øÐÐÐÞÊÎ --------------------
|
if(((GB_FBO_Data.SumCurrent>GB_TestingParm[4]*10)&&(GB_FBO_Data.SumCurrent-GB_TestingParm[4]*10)<6)
|
||((GB_FBO_Data.SumCurrent<GB_TestingParm[4]*10)&&(GB_TestingParm[4]*10-GB_FBO_Data.SumCurrent)<6))
|
{
|
IsUpdated = 1;//µçÁ÷ÐÞÊÎ
|
}
|
}
|
}
|
|
P_Power /= 10;//ÏÔʾʹÓà 2017-5-18ÐÞ¸Ä
|
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ·Åµç½çÃæ±à³Ì############################
|
#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, 96, blue, white); //·Åµçʱ¼ä
|
PrintValue(2, 0, GetMLimitVolCount(), "", 16, 508, 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, 185, 96, blue, white); //×ܵçѹ
|
PrintTime(&(GB_FBO_Data.m_TestTime), ':', HMS, 480, 96, blue, white); //·Åµçʱ¼ä
|
PrintValue(2, 0, GetMLimitVolCount(), "", 16, 500, 64, blue, white); //Òѵ½ÏÂÏÞ
|
#endif
|
if(1 == IsUpdated)
|
{
|
//----------------- ÓÃÓÚÐÞÊÎ----------------------
|
PrintValue(1, 1, (GB_TestingParm[4]*10), " A", 16, 145, 96, blue, fcl1); //·ÅµçµçÁ÷
|
}
|
else
|
PrintValue(1, 1, GB_FBO_Data.SumCurrent, "A", 16, 185, 128, blue, fcl1); //·ÅµçµçÁ÷
|
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, 64, blue, white); //×ܵçѹ
|
PrintTime(&(GB_FBO_Data.m_TestTime), ':', HMS, 460, 128, blue, white); //·Åµçʱ¼ä
|
PrintValue(2, 0, GetMLimitVolCount(), "", 16, 508, 64, blue, white); //Òѵ½ÏÂÏÞ
|
#else
|
PrintValue(1, 1, GB_FBO_Data.SumVoltage, " B", 16, 145, 64, blue, white); //×ܵçѹ
|
PrintTime(&(GB_FBO_Data.m_TestTime), ':', HMS, 460, 128, blue, white); //·Åµçʱ¼ä
|
PrintValue(2, 0, GetMLimitVolCount(), "", 16, 516, 96, blue, white); //Òѵ½ÏÂÏÞ
|
#endif
|
if(1 == IsUpdated)
|
{
|
//----------------- ÓÃÓÚÐÞÊÎ----------------------
|
PrintValue(1, 1, (GB_TestingParm[4]*10), " A", 16, 145, 96, blue, fcl1); //·ÅµçµçÁ÷
|
}
|
else
|
PrintValue(1, 1, GB_FBO_Data.SumCurrent, " A", 16, 145, 96, blue, fcl1); //·ÅµçµçÁ÷
|
|
if(2 == IsUpdated)
|
PrintValue(1, 1, GB_TestingParm[15], " ", 16, 145, 128, blue, fcl2);
|
else
|
PrintValue(1, 1, (unsigned int)P_Power, " ", 16, 145, 128, blue, fcl2);
|
DSP16x24Str( WPSubText[8], 3, 14, 230, 128, blue, fcl2);//KW
|
PrintValue(1, 0, GB_FBO_Data.AllCap, " AH", 16, 491, 64, blue, white); //ÒÑ·ÅÈÝÁ¿
|
//DSP16x24Str(WPSubTextEXT[3], 1, 12, 570, 64, 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);
|
if(1 == IsUpdated)
|
{
|
PrintValue(1, 1, ((GB_TestingParm[4]*10)/GB_FBO_Data.BattGroup), "", 16, 70, 220+32*n, blue, white);//·ÖÖ§µçÁ÷
|
}
|
else
|
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); //×îµÍµ¥Ìå
|
}
|
}
|
//
|
void ChangeToChargeTask(void)
|
{
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
#if(MashineType == FBO48CT)
|
static unsigned char countvalue = 0;
|
if((ChargeWaitCountDown>=1) && (countvalue != ChargeWaitCountDown))
|
{
|
countvalue = ChargeWaitCountDown;
|
|
if(ChargeWaitCountDown < 60)//xxÃëºó¿ªÊ¼ÏÞÁ÷³äµç£¡
|
{
|
DSP24x24Str(WPAlarmText[2], 12, 24, 292, 360, blue, yellow);
|
PrintValue(3, 0, ChargeWaitCountDown, "", 16, 300, 360, blue, yellow);
|
}
|
else//ÔÚÏßµçѹÒì³£,µÈ´ý³äµç£¡
|
{
|
DSP24x24Str(WPAlarmText[3], 12, 24, 292, 360, blue, yellow);
|
countvalue = 0;
|
}
|
}
|
else if(ChargeWaitCountDown < 1)
|
{
|
if(GB_SYS_State.CurrentPage == DSPSingleVolData)
|
{
|
QuitSingleVolPage();
|
}
|
else if(GB_SYS_State.CurrentPage == DSPMessageBoxNull)
|
{
|
TerminateMSGBox();
|
return;
|
}
|
|
WPParentPage = DSPWorkingPage;//»Ö¸´¸¸Ò³ÃæÖ¸ÕëΪ×Ô¼ºµÄÒ³Ãæ
|
GB_SYS_State.CurrentPage = DSPMainMenu;
|
cli();//--------¿ª×ÜÖжÏ
|
BackColorCH();
|
DSPChargePage();
|
sei();//--------¿ª×ÜÖжÏ
|
BuzzerBeep(500);
|
SetAutoStartCharge(1);//¿ªÆô×Ô¶¯³äµç±êʶ
|
}
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
}
|
//
|
|
void GetWorkingPageButtonDown(void)
|
{
|
static unsigned char lastkey = ButtonNull;
|
static unsigned char getlastkeycount = 0;
|
static unsigned char count = 0;
|
unsigned char touched_item;
|
|
count++;
|
|
//---------------------- ¸üÐÂÖ÷Ò³Ãæ -----------------------
|
if((count % 64) == 0)
|
{
|
GetDateTime(&(GB_SYS_State.DateTime));
|
UpdateValue();
|
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
#if(MashineType == FBO48CT)
|
if(GB_SYS_State.WorkState == WaitForCharging)
|
{
|
ChangeToChargeTask();//ÔËÐÐ×Ô¶¯³äµçÈÎÎñ
|
return;
|
}
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
}
|
|
//---------- »ñÈ¡´¥ÃþÆÁºÍ°´¼üµÄÊäÈë -------------
|
touched_item = GetTouchLocal();
|
|
if(touched_item == ButtonNull)//Èç¹û°´¼üΪ¿ÕÔòÖ±½Ó·µ»Ø;
|
{
|
lastkey = ButtonNull;
|
if(getlastkeycount>0)
|
{
|
getlastkeycount = 0;
|
}
|
return;
|
}
|
else if(touched_item != lastkey)
|
{
|
getlastkeycount = 0;
|
}
|
lastkey = touched_item;
|
if(getlastkeycount<60)
|
getlastkeycount++;
|
|
#if(MashineType == FBO48CT)
|
//---------------- Èç¹û°´ÏµÄÊÇʧЧµÄ°´Å¥ÔòÍ˳ö ------------------------
|
if(((ModifyItemIndex==2)&&(TempTestingParm[0]==1))||(ModifyItemIndex==0)
|
|| (((ModifyItemIndex==1)||(ModifyItemIndex==12)||(ModifyItemIndex==13))
|
&& (GB_SYS_State.WorkState!=Stopped)))
|
{
|
if((touched_item==Button6) || (touched_item==Button7))
|
{
|
return;
|
}
|
}
|
#else
|
if((ModifyItemIndex==0)
|
|| (((ModifyItemIndex==1)||(ModifyItemIndex==12)||(ModifyItemIndex==13))
|
&& (GB_SYS_State.WorkState!=Stopped)))
|
{
|
if((touched_item==Button6) || (touched_item==Button7))
|
{
|
return;
|
}
|
}
|
#endif
|
|
//---------------- "·Åµç"¼ü´¦Àí ----------------------------------------
|
if(touched_item==Button0)
|
{ if((WorkPageDSPMode==PageMode_View)
|
&& ((WPWorkState==WPMANUALPAUSE)||(WPWorkState==WPAUTOPAUSE)||(WPWorkState==WPMANUALPSTOP)))
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
InitDisChargePower();
|
WPChildPage = DSPMessageBoxNull;
|
if(DSPMessageBox1(WPAlarmText[9], 39, MB_YESNO, BeepNull) == ButtonCancel)
|
return;
|
|
if(StartErrorCheck())
|
{
|
SetPowerSwitchDisabled();
|
WPChildPage = DSPMessageBoxNull;
|
DSPMessageBox1(WPErrorAlarmText[0],43,MB_OK,FDLineConnectError);
|
return;
|
}
|
|
if(GetCommError() == 1)//Èç¹ûͨÐŹÊÕÏ,ÎÞ·¨¿ªÊ¼·Åµç
|
{
|
SetPowerSwitchDisabled();
|
WPChildPage = DSPMessageBoxNull;
|
DSPMessageBox(WPErrorAlarmText[5],19,MB_OK,FDLineConnectError);
|
return;
|
}
|
|
if(GB_SYS_State.WorkState == Stopped)
|
StartTestingFrom(Stopped);
|
else if(GB_SYS_State.WorkState == Paused)
|
ResumeTestingFrom(Paused);
|
}
|
else if(WorkPageDSPMode==PageMode_Set)
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
WorkPageDSPMode = PageMode_View;
|
BackColorCH();
|
DSPWorkingPage();
|
}
|
}
|
//--------------- "Í£Ö¹/ÔÝÍ£"¼ü´¦Àí ------------------------------------
|
else if((touched_item==Button1)&&(WorkPageDSPMode==PageMode_View)
|
&&((WPWorkState>=WPDISCHARGING)&&(WPWorkState<=WPAUTOPAUSE)))
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
_delay_ms(200);
|
//------------- ÔÝÍ£´¦Àí --------------
|
if(GB_SYS_State.WorkState==Discharging)
|
{
|
SuspendTesting(WPMANUALPAUSE);
|
}
|
//------------- Í£Ö¹´¦Àí --------------
|
else if(GB_SYS_State.WorkState == Paused)
|
{
|
StopTesting(WPMANUALPSTOP);
|
EnableMonomerVolGether();
|
}
|
}
|
//--------------- "Ô¤ÖÃn/µ¥Ìå"¼ü´¦Àí -----------------------------------------
|
else if((touched_item==Button2))
|
{
|
if((WorkPageDSPMode==PageMode_View)&&(GB_FBO_Data.BattSum>0))
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
WPChildPage = DSPSingleVolData;
|
BackColorCH();
|
WPChildPage();
|
StopAlarmBeep();//¹Ø±ÕÉùÒô¸æ¾¯
|
return;
|
}
|
else if((WorkPageDSPMode==PageMode_Set)&&(WPWorkState==WPMANUALPSTOP)&&(ModifyItemIndex==0))
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
TestingParmIndex++;
|
if(TestingParmIndex>=8)
|
{
|
TestingParmIndex = 0;
|
}
|
GetTestingParm(TestingParmIndex);
|
UpdateTestingParm(GB_TestingParm);
|
DrawPresetButton(GB_SYS_State.WorkState);
|
_delay_ms(200);
|
}
|
}
|
//--------------- "²ÎÊý/Ó¦ÓÃ"¼ü´¦Àí -----------------------------------
|
else if(touched_item == Button3)
|
{
|
unsigned char n;
|
//---------------------- Ô¤Öô¦Àí ---------------------------
|
if(WorkPageDSPMode==PageMode_View)
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
WorkPageDSPMode = PageMode_Set;
|
BackColorCH();
|
DSPWorkingPage();
|
}
|
//--------------------- Ó¦Óô¦Àí ----------------------------
|
else if((WorkPageDSPMode==PageMode_Set)&&(ModifyItemIndex>0))
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
WPChildPage = DSPMessageBoxNull;
|
if(DSPMessageBox(WPAlarmText[0],30,MB_YESNO, BeepNull) == ButtonOK)
|
{
|
for(n=0; n<16; n++)
|
{
|
GB_TestingParm[n] = TempTestingParm[n];
|
}
|
|
if((GB_TestingParm[0]==0) && (GB_TestingParm[1]==1))
|
{
|
GB_TestingParm[1] = 0;
|
eeprom_busy_wait();
|
eeprom_write_block(GB_TestingParm, EEPTestingParm[TestingParmIndex], sizeof(GB_TestingParm));
|
GB_TestingParm[1] = 1;
|
}
|
else
|
{
|
eeprom_busy_wait();
|
eeprom_write_block(GB_TestingParm, EEPTestingParm[TestingParmIndex], sizeof(GB_TestingParm));
|
}
|
#if(MashineType == FBO48CT)
|
#else
|
if(GB_TestingParm[1] == 0)
|
{
|
Set_ACPOWER_Work(ACPOWER_CK_ENABLE);
|
}
|
else
|
{
|
Set_ACPOWER_Work(ACPOWER_CK_DISABLE);
|
}
|
#endif
|
GB_FBO_Data.BattSum = GB_TestingParm[9]*GB_TestingParm[10]; //»ñÈ¡µç³Ø½ÚÊý
|
GB_FBO_Data.BattGroup = GB_TestingParm[10]; //»ñÈ¡µç³Ø×éÊý
|
SetEachGroupBattSum(GB_TestingParm[9]);
|
SetMonomerSum(GB_TestingParm[9], (unsigned char)(GB_TestingParm[10]));//ÉèÖõ¥ÌåÄ£¿éµÄÊýÁ¿
|
UpdateTestingParm(GB_TestingParm);
|
|
//-------------- ºãµç×è·Åµçµ÷ÖÆ½âËø -------------------
|
if(GB_TestingParm[14] == Static_Res)
|
{
|
WPWorkModeResLock = FALSE;
|
}
|
}
|
}
|
}
|
//---------------- "Í˳ö"¼ü´¦Àí ----------------------------------------
|
else if(touched_item == Button4)//
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
StopAlarmBeep();
|
//------------ ֹͣ״̬ÏÂÍ˳ö --------------------
|
if(GB_SYS_State.WorkState == Stopped)
|
{
|
StopM64Timer1();
|
BackColorCH();
|
WPParentPage();
|
WPParentPage = DSPWorkingPage;//»Ö¸´¸¸Ò³ÃæÖ¸ÕëΪ×Ô¼ºµÄÒ³Ãæ
|
}
|
//------------ ·Çֹͣ״̬ÏÂÍ˳ö ------------------
|
else
|
{
|
WPChildPage = DSPMessageBoxNull;
|
if(DSPMessageBox(WPAlarmText[1],23,MB_YESNO,BeepNull) == ButtonOK)
|
{
|
if((GB_SYS_State.WorkState==Discharging)||(GB_SYS_State.WorkState==Paused))
|
{
|
StopTesting(WPMANUALPSTOP);
|
}
|
StopM64Timer1();
|
GB_SYS_State.WorkState = Stopped;
|
GB_SYS_State.DealTimer1Up = M64Timer1UpNull;
|
BackColorCH();
|
WPParentPage();
|
WPParentPage = DSPWorkingPage;//»Ö¸´¸¸Ò³ÃæÖ¸ÕëΪ×Ô¼ºµÄÒ³Ãæ
|
}
|
}
|
return;
|
}
|
//-------------------- "ÐÞ¸Ä"¼ü´¦Àí ------------------------------------
|
else if((touched_item==Button8)&&(PageMode_Set==WorkPageDSPMode))
|
{
|
unsigned char n;
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
|
if(ModifyItemIndex == 0)
|
{
|
for(n=0; n<16; n++)
|
{
|
TempTestingParm[n] = GB_TestingParm[n];
|
}
|
ModifyItemIndex = 3; //´Ó²âÊÔģʽ¿ªÊ¼
|
}
|
else
|
{
|
if(ModifyItemIndex == 7)
|
ModifyItemIndex = 15;
|
else if(ModifyItemIndex == 15)
|
ModifyItemIndex = 8;
|
else if(ModifyItemIndex == 14)
|
ModifyItemIndex = 20;
|
else
|
ModifyItemIndex++;
|
|
|
}
|
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
#if(MashineType == FBO48CT)
|
if(ModifyItemIndex >= 16)
|
ModifyItemIndex = 1;
|
#else
|
if(ModifyItemIndex >= 16)
|
ModifyItemIndex = 3;
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ############################
|
|
DrawPresetButton(GB_SYS_State.WorkState);
|
DSPTestingParmItem(ModifyItemIndex, white, blue);
|
_delay_ms(100);
|
}
|
//-------------------- "+"¼ü´¦Àí ---------------------------------------
|
else if((touched_item==Button7)&&(PageMode_Set==WorkPageDSPMode))
|
{
|
if(getlastkeycount == 1)
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
}
|
if(ModifyItemIndex > 0)
|
{
|
if((getlastkeycount == 1) || (getlastkeycount>=50))
|
{
|
SetAndUpdateParm(TempTestingParm, ModifyItemIndex-1, 0);
|
UpdateTestingParm(TempTestingParm);
|
if(ModifyItemIndex <= 2)
|
{
|
_delay_ms(250);
|
}
|
}
|
}
|
}
|
//-------------------- "-"¼ü´¦Àí ---------------------------------------
|
else if((touched_item==Button6)&&(PageMode_Set==WorkPageDSPMode))
|
{
|
if(getlastkeycount == 1)
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
}
|
if(ModifyItemIndex > 0)
|
{
|
if((getlastkeycount == 1) || (getlastkeycount>=50))
|
{
|
SetAndUpdateParm(TempTestingParm, ModifyItemIndex-1, 1);
|
UpdateTestingParm(TempTestingParm);
|
if(ModifyItemIndex <= 2)
|
{
|
_delay_ms(250);
|
}
|
}
|
}
|
}
|
//-------------------- "È¡Ïû"¼ü´¦Àí ------------------------------------
|
else if((touched_item==Button5)&&(PageMode_Set==WorkPageDSPMode))
|
{
|
if(ModifyItemIndex > 0)
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
ModifyItemIndex = 0;
|
UpdateTestingParm(GB_TestingParm);
|
DrawPresetButton(GB_SYS_State.WorkState);
|
DSPTestingParmItem(ModifyItemIndex, blue, white);
|
}
|
}
|
//------------- ÑÓʱ150msºóÍ˳ö,ÒÔÃâ°´¼üË«»÷Ì«¿ì -----------------------
|
if(getlastkeycount == 0)
|
{
|
_delay_ms(150);
|
}
|
}
|
//
|
|
void SetAndUpdateParm(unsigned int *parm, unsigned char index, unsigned char setdirection)
|
{
|
unsigned int max = 3000;
|
unsigned int min = 0;
|
unsigned char value = 1;
|
unsigned char itemindex = index;
|
|
switch(index)
|
{
|
case 0:
|
case 1: max = 1;//Í£µç´¦Àí
|
min = 0;
|
value = 1;
|
break;
|
case 2: max = 9990;//±ê³ÆÈÝÁ¿
|
min = 0;
|
value = 1;
|
break;
|
case 3: max = 1200;//СʱÂÊ
|
min = 1;
|
value = 1;
|
break;
|
case 4: itemindex = 14;
|
max = 1;//²âÊÔģʽ//2017-5-18ÐÞ¸Ä ½«×î´óÖµÐÞ¸ÄΪ1 ¼´Ö»ÄÜÐ޸IJÎÊýµ½ºã¹¦ÂÊģʽȥµôºã×èģʽ
|
min = 0;
|
value = 1;
|
break;
|
case 5: itemindex = 4;
|
max = 300;//µçÁ÷
|
min = 0;
|
value = 1;
|
break;
|
case 6: itemindex = 15;
|
max = 999;//¹¦ÂÊ
|
min = 0;
|
value = 1;
|
break;
|
case 7: itemindex = 5;
|
max = 9999;//ÈÝÁ¿
|
min = 0;
|
value = 1;
|
break;
|
case 8: itemindex = 6;
|
max = 5999;
|
min = 0;
|
value = 1;
|
break;
|
case 9: itemindex = 7;
|
max = 1500;//µ¥ÌåÏÂÏÞ
|
min = 0;
|
value = 1;
|
break;
|
case 10:itemindex = 8;
|
max = 3000;//×é¶ËÏÂÏÞ
|
min = 0;
|
value = 1;
|
break;
|
case 11:itemindex = 9;
|
max = 150;//ÿ×éµ¥Ìå
|
min = 0;
|
value = 1;
|
break;
|
case 12:itemindex = 10;
|
max = 2;//µ¥Ìå×éÊý
|
min = 1;
|
value = 1;
|
break;
|
case 13:itemindex = 11;
|
max = parm[9]*parm[10];//ÏÂÏÞÊýÁ¿
|
min = 1;
|
value = 1;
|
break;
|
case 14:itemindex = 12;
|
max = 99;//ʱ¼ä¼ä¸ô
|
min = 1;
|
value = 1;
|
break;
|
default:break;
|
}
|
//------------------- "¼Ó1"²Ù×÷ ----------------------------
|
if(setdirection == 0)
|
{
|
if(itemindex <= 1)
|
{
|
parm[itemindex] += value;
|
if(parm[itemindex] > max)
|
parm[itemindex] = min;
|
}
|
else
|
{
|
if(itemindex == 3)
|
{
|
if(parm[itemindex] <= 59)
|
value = 1;
|
else
|
value = 60;
|
}
|
|
if(parm[itemindex] < max)
|
{
|
parm[itemindex] += value;
|
}
|
else
|
{
|
BuzzerBeep(50);
|
_delay_ms(30);
|
}
|
}
|
|
/*if((itemindex==3)&&(parm[itemindex] > 10)&&(parm[itemindex] < 20))
|
{
|
parm[itemindex] = 20;
|
}*/
|
}
|
//------------------- "¼õ1"²Ù×÷ ----------------------------
|
else
|
{
|
if(itemindex <= 1)
|
{
|
if(parm[itemindex] > min)
|
parm[itemindex] -= value;
|
else parm[itemindex] = max;
|
}
|
else
|
{
|
if(itemindex == 3)
|
{
|
if(parm[itemindex] <= 60)
|
value = 1;
|
else
|
value = 60;
|
}
|
|
if(parm[itemindex] > min)
|
{
|
parm[itemindex] -= value;
|
}
|
else
|
{
|
BuzzerBeep(50);
|
_delay_ms(30);
|
}
|
}
|
/*if((itemindex==3)&&(parm[itemindex] > 10)&&(parm[itemindex] < 20))
|
{
|
parm[itemindex] = 10;
|
}*/
|
}
|
|
//------------ ½«"²âÊÔģʽ"ºÍ"Í£µç´¦Àí"½øÐйØÁª ------------
|
if(index == 0)
|
{
|
if(parm[index] == 0)
|
parm[1] = 0;
|
else if(parm[index] == 1)
|
parm[1] = 1;
|
}
|
|
//------------ ½«"СʱÂÊ"ºÍ"Ô¤·ÅµçÁ÷"½øÐйØÁª --------------
|
if((index==2) || (index==3))
|
{
|
//parm[4] = GetFDCurrent(parm[2], parm[3]);
|
}
|
else if(index == 4)
|
{
|
//parm[3] = GetHourRate(parm[2], parm[4]);
|
}
|
if(parm[4] > 999)
|
{
|
parm[4] = 999;
|
//parm[3] = GetHourRate(parm[2], parm[4]);
|
}
|
}
|
//
|
|
unsigned char GetHourRate(unsigned int stdah,unsigned int current)
|
{
|
unsigned char index;
|
unsigned int value[11]={514,306,250,200,166,146,131,118,108,100,55};
|
unsigned int res;
|
res = (current*100)/(stdah/10);
|
if(res>=514) return 1;
|
else if(res<=55) return 20;
|
else
|
{
|
for(index=0; index<10; index++)
|
{
|
if((res<=value[index]) && (res>value[index+1]))
|
break;
|
else continue;
|
}
|
if((value[index]-res) < (res-value[index+1]))
|
{
|
return (index+1);
|
}
|
else
|
{
|
if(index+2 > 10)
|
return (20);
|
else return (index+2);
|
}
|
}
|
}
|
//
|
|
unsigned int GetFDCurrent(unsigned int stdcap, unsigned char hourrate)
|
{
|
unsigned int res = 55;
|
unsigned long current = 0;
|
switch(hourrate)
|
{
|
case 1: res = 514;break;
|
case 2: res = 306;break;
|
case 3: res = 250;break;
|
case 4: res = 200;break;
|
case 5: res = 166;break;
|
case 6: res = 146;break;
|
case 7: res = 131;break;
|
case 8: res = 118;break;
|
case 9: res = 108;break;
|
case 10: res = 100;break;
|
case 20: res = 55;break;
|
default: res = 55;break;
|
}
|
|
current = stdcap;
|
current *= res;
|
current /= 1000;
|
return ((unsigned int)current);
|
}
|
//
|
/********************* END OF FILE (WorkingPage.c)*************************/
|