package com.dev.ntm.data.fbo;
|
|
import java.nio.ByteBuffer;
|
import java.nio.ByteOrder;
|
import java.util.GregorianCalendar;
|
|
import com.dev.ntm.data.idc.IdcDataInf;
|
|
public class FboDataInf {
|
static public final int DataExt_IDC = 0;
|
static public final int DataExt_FBO = 1;
|
|
public FboDateTime TestStartTime = new FboDateTime(); //·Åµç¿ªÊ¼µÄʱ¼ä
|
public int Device; //ÒDZíÀàÐÍ
|
public int DataVersion; //Êý¾Ý°æ±¾
|
public int DataType; //Êý¾ÝÀàÐÍ;0xFD±íʾ·Åµç,0xFC±íʾ³äµç
|
public int SourceDataExt = DataExt_FBO; //Êý¾ÝÎļþÀ©Õ¹Ãû,¼°Êý¾ÝÀàÐÍ,ÊÇ.FBOÊý¾Ý»¹ÊÇ.IDCÊý¾Ý
|
public int HourRate; //СʱÂÊ
|
public int SaveInterval; //²É¼¯¼ä¸ô
|
public float MonomerVol; //µ¥ÌåµçѹÀàÐÍ
|
public int STDCap; //±ê³ÆÈÝÁ¿
|
public float TestCur; //²âÊÔµçÁ÷
|
public float MVLLimit; //µ¥ÌåÏÂÏÞ
|
public float SumVLLimit; //×é¶ËÏÂÏÞ
|
public int BattSum; //µ¥ÌåÊýÁ¿
|
public int BattGroup; //µç³Ø×éÊý
|
public float MVLLimitCount; //µ¥ÌåÏÂÏÞ¸öÊý
|
|
public FboTestTime TestTimeLong = new FboTestTime(); //²âÊÔʱ³¤
|
public int StopType; //½áÊø·½Ê½
|
public int BlockSum; //±£´æÊý¾ÝµÄ×Ü¿éÊý
|
public int StandBy; //±£Áô±¸ÓÃ
|
public int[] SMaxIndex = new int[4]; //×î¸ßµ¥ÌåË÷Òý
|
public int[] SMinIndex = new int[4]; //×îµÍµ¥ÌåË÷Òý
|
public float[] SMaxVol = new float[4]; //×î¸ßµ¥Ìå
|
public float[] SMinVol = new float[4]; //×îµÍµ¥Ìå
|
public float TestCap; //²âÊÔÈÝÁ¿
|
|
public void setDataInf(byte[] inf_data)
|
{
|
ByteBuffer bf = ByteBuffer.allocate(2048);
|
bf.order(ByteOrder.LITTLE_ENDIAN);
|
bf.put(inf_data);
|
bf.position(0);
|
|
SourceDataExt = DataExt_FBO;
|
|
TestStartTime.year = (int) (bf.get()&0xFF);
|
TestStartTime.month = (int) (bf.get()&0xFF) - 1;
|
TestStartTime.day = (int) (bf.get()&0xFF);
|
TestStartTime.hour = (int) (bf.get()&0xFF);
|
TestStartTime.minute = (int) (bf.get()&0xFF);
|
TestStartTime.second = (int) (bf.get()&0xFF);
|
|
Device = (int) (bf.get()&0xFF);
|
DataVersion = (int) (bf.get()&0xFF); //Êý¾Ý°æ±¾
|
DataType = (int) (bf.get()&0xFF); //Êý¾ÝÀàÐÍ;0xFD±íʾ·Åµç,0xFC±íʾ³äµç
|
HourRate = (int) (bf.get()&0xFF); //СʱÂÊ
|
SaveInterval = (int) (bf.get()&0xFF); //²É¼¯¼ä¸ô
|
MonomerVol = (int) (bf.get()&0xFF); //µ¥ÌåµçѹÀàÐÍ
|
STDCap = (int) (bf.getShort()&0xFFFF); //±ê³ÆÈÝÁ¿
|
TestCur = (float) (bf.getShort()&0xFFFF); //²âÊÔµçÁ÷
|
MVLLimit = ((float) (bf.getShort()&0xFFFF)) / 1000; //µ¥ÌåÏÂÏÞ
|
SumVLLimit = ((float) (bf.getShort()&0xFFFF)) / 10; //×é¶ËÏÂÏÞ
|
BattSum = (int) (bf.getShort()&0xFFFF); //µ¥ÌåÊýÁ¿
|
BattGroup = (int) (bf.getShort()&0xFFFF); //µç³Ø×éÊý
|
MVLLimitCount = (int) (bf.getShort()&0xFFFF); //µ¥ÌåÏÂÏÞ¸öÊý
|
|
TestTimeLong.hour = (int) (bf.get()&0xFF);
|
TestTimeLong.minute = (int) (bf.get()&0xFF);
|
TestTimeLong.second = (int) (bf.get()&0xFF);
|
StopType = (int) (bf.get()&0xFF);
|
BlockSum = (int) (bf.get()&0xFF);
|
StandBy = (int) (bf.get()&0xFF);
|
for(int n=0; n<4; n++)
|
{
|
SMaxIndex[n] = (int) (bf.getShort()&0xFFFF);
|
}
|
for(int n=0; n<4; n++)
|
{
|
SMinIndex[n] = (int) (bf.getShort()&0xFFFF);
|
}
|
for(int n=0; n<4; n++)
|
{
|
SMaxVol[n] = ((float) (bf.getShort()&0xFFFF)) / 1000;
|
}
|
for(int n=0; n<4; n++)
|
{
|
SMinVol[n] = ((float) (bf.getShort()&0xFFFF)) / 1000;
|
}
|
|
TestCap = (float) (bf.getShort()&0xFFFF);
|
}
|
|
public void setDataInf(IdcDataInf d_inf)
|
{
|
SourceDataExt = DataExt_IDC;
|
|
GregorianCalendar gc = (GregorianCalendar) GregorianCalendar.getInstance();
|
gc.setTime(d_inf.m_TestTime);
|
|
TestStartTime.year = gc.get(GregorianCalendar.YEAR);
|
TestStartTime.month = gc.get(GregorianCalendar.MONTH)-1;
|
TestStartTime.day = gc.get(GregorianCalendar.DATE);
|
TestStartTime.hour = gc.get(GregorianCalendar.HOUR);
|
TestStartTime.minute = gc.get(GregorianCalendar.MINUTE);
|
TestStartTime.second = gc.get(GregorianCalendar.SECOND);
|
|
Device = IdcDataInf.DevType_Idc;
|
DataVersion = 0; //Êý¾Ý°æ±¾
|
DataType = d_inf.m_TestType; //Êý¾ÝÀàÐÍ;0xFD±íʾ·Åµç,0xFC±íʾ³äµç
|
HourRate = d_inf.m_HourRate; //СʱÂÊ
|
SaveInterval = 0; //²É¼¯¼ä¸ô
|
MonomerVol = (int) d_inf.m_MonomerVol; //µ¥ÌåµçѹÀàÐÍ
|
STDCap = d_inf.m_STDAH; //±ê³ÆÈÝÁ¿
|
TestCur = 0; //²âÊÔµçÁ÷
|
MVLLimit = d_inf.m_MonomerVolLL; //µ¥ÌåÏÂÏÞ
|
SumVLLimit = d_inf.m_SumVolLL; //×é¶ËÏÂÏÞ
|
BattSum = d_inf.m_EachBattSum * d_inf.m_BattGroup; //µ¥ÌåÊýÁ¿
|
BattGroup = d_inf.m_BattGroup; //µç³Ø×éÊý
|
MVLLimitCount = 1; //µ¥ÌåÏÂÏÞ¸öÊý
|
|
TestTimeLong.hour = 0;
|
TestTimeLong.minute = 0;
|
TestTimeLong.second = 0;
|
StopType = 0;
|
BlockSum = 0;
|
StandBy = 0;
|
for(int n=0; n<4; n++)
|
{
|
SMaxIndex[n] = 0;
|
}
|
for(int n=0; n<4; n++)
|
{
|
SMinIndex[n] = 0;
|
}
|
for(int n=0; n<4; n++)
|
{
|
SMaxVol[n] = 0;
|
}
|
for(int n=0; n<4; n++)
|
{
|
SMinVol[n] = 0;
|
}
|
|
TestCap = 0;
|
}
|
|
public static String getDeviceType(int type)
|
{
|
String dev_type = "δ֪";
|
switch(type) //²âÊÔÒDZíÀàÐÍ
|
{
|
case 0xFB : dev_type = "FBO4815-CT"; break;
|
case 0xDC : dev_type = "IDCE4815-CT";break;
|
case 0x2F : dev_type = "FBO2205-CT"; break;
|
case 0x2E : dev_type = "IDCE2205-CT";break;
|
case 0x26 : dev_type = "FBO2206-CT"; break;
|
case 0x25 : dev_type = "IDCE2206-CT";break;
|
case 0x3F : dev_type = "FBO4830-CT"; break;
|
case 0x3E : dev_type = "IDCE4830-CT";break;
|
case 0x6F : dev_type = "FBO6003-CT"; break;
|
case 0x6E : dev_type = "IDCE6003-CT";break;
|
case 0x66 : dev_type = "FBO6006-CT"; break;
|
case 0x67 : dev_type = "IDCE6006-CT";break;
|
case 0x60 : dev_type = "FBO60010-CT";break;
|
case 0x61 : dev_type = "IDCE60010-CT";break;
|
case 0x0F : dev_type = "FBO1101-CT"; break;
|
case 0x0E : dev_type = "IDCE1101-CT";break;
|
case 0x1F : dev_type = "FBO1110-CT"; break;
|
case 0x1E : dev_type = "IDCE1110-CT";break;
|
case 0xF2 : dev_type = "FBI-4548CT";break;
|
case 0xF3 : dev_type = "FBI-3048CT";break;
|
case 0xF1 : dev_type = "FBI-3015CT";break;
|
case 0xF4 : dev_type = "FBI-10480CT";break;
|
case 0xF5 : dev_type = "FBI-05480CT";break;
|
case 0xF6 : dev_type = "FBI-15480CT";break;
|
case 0xF7 : dev_type = "FBI-20480CT";break;
|
case 0xE1 : dev_type = "FBI-05240CT";break;
|
case 0xE2 : dev_type = "FBI-10240CT";break;
|
case 0xE3 : dev_type = "FBI-15240CT";break;
|
case 0xE4 : dev_type = "FBI-20240CT";break;
|
case 0x22 : dev_type = "FBO2210-CT"; break;
|
case 0x21 : dev_type = "IDCE2210-CT";break;
|
case 0x15 : dev_type = "FBO2415-CT"; break;
|
case 0x16 : dev_type = "IDCE2415-CT";break;
|
case 0x12 : dev_type = "FBO1230-CT";break;
|
case 0x11 : dev_type = "IDCE1230-CT";break;
|
case 0x84 : dev_type = "FBO840-CT";break;
|
case 0x85 : dev_type = "IDCE840-CT";break;
|
case 0x13 : dev_type = "IDC_DEV";break;
|
case 0x45 : dev_type = "Ser_DEV";break;
|
case 0x46 : dev_type = "FBR_DEV";break;
|
}
|
|
return dev_type;
|
}
|
|
public static String getTestType(int type)
|
{
|
String test_type = "δ֪";
|
switch(type)
|
{
|
case 0xFD : test_type = "·Åµç"; break;
|
case 0xFC : test_type = "³äµç"; break;
|
case 0xCD : test_type = "³ä·Åµç"; break;
|
//case CsvData.DevType_CSV : test_type = "µçµ¼"; break;
|
//case CsvData.DevType_FBR : test_type = "ÄÚ×è"; break;
|
}
|
return test_type;
|
}
|
|
public static String getStopType(int dev_type, int stop_type_t)
|
{
|
String stop_type = "δ֪";
|
//if(BattTestData.TEST_LOADER_FBI_IDCE == dev_type) {
|
switch(stop_type_t)
|
{
|
case 0 : stop_type = "ÊÖ¶¯Í£Ö¹"; break;
|
case 1 : stop_type = "·Åµçʱ¼äµ½"; break;
|
case 2 : stop_type = "·ÅµçÈÝÁ¿µ½"; break;
|
case 3 : stop_type = "µ¥ÌåÏÂÏÞµ½"; break;
|
case 4 : stop_type = "×é¶ËÏÂÏÞµ½"; break;
|
case 5 : stop_type = "ÊеçÖжÏ"; break;
|
case 6 : stop_type = "ÄÚ´æ²»×ã"; break;
|
case 7 : stop_type = "ζÈÒì³£"; break;
|
}
|
/*
|
} else if(BattTestData.TEST_LOADER_FBS9100S == dev_type){
|
switch(stop_type_t)
|
{
|
case 0 : stop_type = "ÊÖ¶¯Í£Ö¹"; break;
|
case 1 : stop_type = "ÔÝÍ£"; break;
|
case 2 : stop_type = "ÕýÔڷŵç²âÊÔ"; break;
|
case 3 : stop_type = "ÕýÔڵȴý·Åµç"; break;
|
case 4 : stop_type = "ÕýÔÚÏÞÁ÷³äµç"; break;
|
case 5 : stop_type = "ÕýÔÚÖ±Á¬³äµç"; break;
|
case 6 : stop_type = "ÕýÔڵȴý³äµç"; break;
|
case 7 : stop_type = "·Åµçʱ¼äµ½"; break;
|
case 8 : stop_type = "·ÅµçÈÝÁ¿µ½"; break;
|
case 9 : stop_type = "µ¥ÌåÏÂÏÞµ½"; break;
|
case 10 : stop_type = "×é¶ËÏÂÏÞµ½"; break;
|
case 11 : stop_type = "ÊеçÖжÏÍ£Ö¹"; break;
|
case 12 : stop_type = "´æ´¢Êý¾ÝÂú"; break;
|
case 13 : stop_type = "»úÄÚζÈÒì³£"; break;
|
case 14 : stop_type = "·ÅµçµçÁ÷¹ýÁ÷"; break;
|
case 15 : stop_type = "ºǫ́ͨÐÅÖжÏ"; break;
|
case 16 : stop_type = "¸ºÔØÄ£¿éÖжÏ"; break;
|
case 17 : stop_type = "ÔÚÏßÄ£¿éÖжÏ"; break;
|
case 18 : stop_type = "¸ºÔØÄ£¿é¹ý¹¦ÂÊ"; break;
|
case 19 : stop_type = "ÄÚ²¿³ÌÐòÒì³£"; break;
|
}
|
} else {
|
stop_type = "ÊÖ¶¯Í£Ö¹";
|
}*/
|
|
return stop_type;
|
}
|
}
|