package com.dev.ntm;
|
|
import java.awt.BorderLayout;
|
import java.awt.Font;
|
import java.awt.GridLayout;
|
import java.awt.event.ComponentAdapter;
|
import java.awt.event.ComponentEvent;
|
import java.io.IOException;
|
import java.io.InputStream;
|
import java.util.ArrayList;
|
import java.util.Properties;
|
|
import javax.swing.JLabel;
|
import javax.swing.JPanel;
|
import javax.swing.JSlider;
|
import javax.swing.JSplitPane;
|
import javax.swing.JTextField;
|
import javax.swing.SwingConstants;
|
import javax.swing.border.Border;
|
import javax.swing.border.CompoundBorder;
|
import javax.swing.border.EtchedBorder;
|
import javax.swing.border.TitledBorder;
|
import javax.swing.event.ChangeEvent;
|
import javax.swing.event.ChangeListener;
|
|
import com.Com;
|
import com.dev.ntm.BattTestData.MonData;
|
import com.dev.ntm.BattTestData.TestData;
|
import com.dev.ntm.data.fbo.FboData;
|
import com.dev.ntm.data.fbo.FboDataInf;
|
import com.steema.teechart.drawing.Color;
|
import com.teechart.TBarChart;
|
import com.teechart.TBarChart_fbs;
|
import com.teechart.TMultVolLineChart;
|
|
import javax.swing.BoxLayout;
|
import javax.swing.JCheckBox;
|
import java.awt.event.ItemListener;
|
import java.awt.event.ItemEvent;
|
|
public class ntm_page_datamanage_chart extends JPanel{
|
private static final String PropertiesFileName = "cn.properties";
|
public final static int TestDataType_RT_MONITOR = 0;
|
public final static int TestDataType_ALL_TESTDATA = 1;
|
public final static int TestDataType_DISCHARGE = 2;
|
public final static int TestDataType_CHARGE = 3;
|
public final static int TestDataType_RES_SER = 4;
|
|
public final static int ChartType_GroupVol = 0;
|
public final static int ChartType_Current = 1;
|
public final static int ChartType_MonBar = 2;
|
public final static int ChartType_MonLine = 3;
|
|
public final static byte ShowBattLowType_None = 0;
|
public final static byte ShowBattLowType_All = 1;
|
public final static byte ShowBattLowType_Now = 2;
|
public final static byte ShowBattLowType_Sel = 3;
|
|
private static final long serialVersionUID = 1L;
|
private boolean mChartViewStateMax = false;
|
|
public int mBattGroupId = 10001;
|
private String mBattGroupName = "";
|
public BattTestData mBattTestData = new BattTestData();
|
|
public TBarChart m_TBarMonVolChart;
|
public TBarChart m_TBarMonTmpChart;
|
public TBarChart m_TBarMonResChart;
|
public TBarChart m_TBarConnResChart;
|
|
public TMultVolLineChart m_MonVolLineChart;
|
public TMultVolLineChart m_MonTmpLineChart;
|
public TMultVolLineChart m_GroupLineChart;
|
public TMultVolLineChart m_CurrLineChart;
|
|
public BattGroupInf m_BattGroupInf = new BattGroupInf();
|
private byte m_ShowBattLowType = ShowBattLowType_None;
|
private byte m_TBarChartDataType = BattTestData.MonData_Vol;
|
private int m_TBarChartDataIndex = 0;
|
public ArrayList<Integer> m_MonLineShowList = new ArrayList<Integer>();
|
|
private JLabel Label_ChartTitle;
|
private JLabel lb_battstate;
|
private JLabel lb_groupvol;
|
private JLabel lb_battcurr;
|
private JLabel lb_testtime;
|
private JLabel lb_testtimelong;
|
private JLabel lb_testcap;
|
private JLabel lb_restcap;
|
//private JLabel lb_resttime;
|
|
private JTextField tf_BattState;
|
private JTextField tf_TestStartTime;
|
private JTextField tf_TestTimeLong;
|
private JTextField tf_TestCap;
|
public JSlider m_DataIndexSlider;
|
private JSplitPane m_SplitPane_Chart;
|
private JSplitPane m_SplitPane_Chart_1;
|
private JSplitPane m_SplitPane_Chart_2;
|
private JSplitPane m_SplitPane_ListTable;
|
private JTextField tf_TestCurr;
|
private JTextField tf_GroupVol;
|
private JTextField tf_RestCap;
|
private JTextField tf_RestTime;
|
|
private Properties mProperties = null;
|
public JCheckBox max_CheckBox;
|
private JPanel parent_panel = null;
|
|
public ntm_page_datamanage_chart(JPanel parent_panel_t)
|
{
|
parent_panel = parent_panel_t;
|
|
InputStream fis = this.getClass().getResourceAsStream(PropertiesFileName);
|
mProperties = new Properties();
|
try {
|
mProperties.load(fis);
|
fis.close();
|
} catch (IOException e1) {
|
// TODO Auto-generated catch block
|
e1.printStackTrace();
|
}
|
|
this.setLayout(new BorderLayout(0, 0));
|
m_TBarMonTmpChart = new TBarChart(this, TBarChart_fbs.Bar_Type_MonTmp);
|
m_TBarMonResChart = new TBarChart(this, TBarChart_fbs.Bar_Type_MonRes);
|
m_TBarConnResChart = new TBarChart(this, TBarChart_fbs.Bar_Type_ConnRes);
|
m_MonTmpLineChart = new TMultVolLineChart(this, TMultVolLineChart.LineType_MonTmp);
|
/*******************************************************************************************/
|
/*******************************************************************************************/
|
JPanel panel_chart = new JPanel();
|
panel_chart.setLayout(new BorderLayout(0, 0));
|
this.add(panel_chart, BorderLayout.CENTER);
|
|
JPanel TeeChart_panel = new JPanel();
|
add(TeeChart_panel, BorderLayout.CENTER);
|
TeeChart_panel.setLayout(new BorderLayout(0, 0));
|
m_DataIndexSlider = new JSlider();
|
m_DataIndexSlider.setMaximum(0);
|
m_DataIndexSlider.setMinimum(0);
|
m_DataIndexSlider.setValue(0);
|
m_DataIndexSlider.addChangeListener(new ChangeListener(){
|
@Override
|
public void stateChanged(ChangeEvent arg0) {
|
if(m_DataIndexSlider.getMaximum() > 0) {
|
upDateSingleRecordMonvol(m_DataIndexSlider.getValue(), false);
|
}
|
}
|
});
|
|
JPanel panel = new JPanel();
|
TeeChart_panel.add(panel, BorderLayout.NORTH);
|
panel.setLayout(new BorderLayout(0, 0));
|
|
Label_ChartTitle = new JLabel();
|
Label_ChartTitle.setFont(new Font("Dialog", Font.BOLD, 12));
|
panel.add(Label_ChartTitle);
|
Label_ChartTitle.setHorizontalAlignment(SwingConstants.CENTER);
|
Label_ChartTitle.setText(" ");
|
|
max_CheckBox = new JCheckBox("\u9690\u85CF\u5DE6\u680F");
|
max_CheckBox.addItemListener(new ItemListener() {
|
public void itemStateChanged(ItemEvent arg0) {
|
parent_panel.setVisible(!max_CheckBox.isSelected());
|
}
|
});
|
//panel.add(max_CheckBox, BorderLayout.WEST);
|
|
m_TBarMonVolChart = new TBarChart(this, TBarChart_fbs.Bar_Type_MonVol);
|
|
m_GroupLineChart = new TMultVolLineChart(this, TMultVolLineChart.LineType_GroupVol);
|
m_CurrLineChart = new TMultVolLineChart(this, TMultVolLineChart.LineType_BattCurr);
|
m_MonVolLineChart = new TMultVolLineChart(this, TMultVolLineChart.LineType_MonVol);
|
|
m_SplitPane_Chart_1 = new JSplitPane();
|
m_SplitPane_Chart_1.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
|
m_SplitPane_Chart_1.addComponentListener(new ComponentAdapter(){
|
@Override public void componentResized(ComponentEvent e){
|
if(false == mChartViewStateMax)
|
{
|
m_SplitPane_Chart_1.setDividerLocation(0.5);
|
}
|
}
|
});
|
|
m_SplitPane_Chart_2 = new JSplitPane();
|
m_SplitPane_Chart_2.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
|
m_SplitPane_Chart_2.addComponentListener(new ComponentAdapter(){
|
@Override public void componentResized(ComponentEvent e){
|
if(false == mChartViewStateMax)
|
{
|
m_SplitPane_Chart_2.setDividerLocation(0.5);
|
}
|
}
|
});
|
|
m_SplitPane_Chart = new JSplitPane();
|
m_SplitPane_Chart.setOrientation(JSplitPane.VERTICAL_SPLIT);
|
m_SplitPane_Chart.setTopComponent(m_SplitPane_Chart_1);
|
|
TeeChart_panel.add(m_SplitPane_Chart, BorderLayout.CENTER);
|
m_SplitPane_Chart.setBottomComponent(m_SplitPane_Chart_2);
|
|
m_SplitPane_Chart.setResizeWeight(0);
|
m_SplitPane_Chart.addComponentListener(new ComponentAdapter(){
|
@Override public void componentResized(ComponentEvent e){
|
if(false == mChartViewStateMax)
|
{
|
m_SplitPane_Chart.setDividerLocation(0.5);
|
}
|
}
|
});
|
TeeChart_panel.add(m_DataIndexSlider, BorderLayout.SOUTH);
|
|
JPanel panel_1 = new JPanel();
|
panel_1.setBorder(new CompoundBorder((Border) new TitledBorder((Border) new EtchedBorder(EtchedBorder.LOWERED, null, null), "", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)), null));
|
this.add(panel_1, BorderLayout.NORTH);
|
panel_1.setLayout(new GridLayout(0, 4, 8, 2));
|
|
JPanel panel_testtype = new JPanel();
|
panel_1.add(panel_testtype);
|
panel_testtype.setLayout(new BoxLayout(panel_testtype, BoxLayout.X_AXIS));
|
//panel.setLayout(new BorderLayout(0, 0));
|
|
lb_battstate = new JLabel(mProperties.getProperty("monitor_page_tf_label_testtype"));
|
panel_testtype.add(lb_battstate/*, BorderLayout.WEST*/);
|
lb_battstate.setHorizontalAlignment(SwingConstants.TRAILING);
|
|
tf_BattState = new JTextField();
|
panel_testtype.add(tf_BattState/*, BorderLayout.CENTER*/);
|
tf_BattState.setColumns(10);
|
|
JPanel panel_groupvol = new JPanel();
|
panel_1.add(panel_groupvol);
|
panel_groupvol.setLayout(new BoxLayout(panel_groupvol, BoxLayout.X_AXIS));
|
|
lb_groupvol = new JLabel(mProperties.getProperty("monitor_page_tf_label_groupvol"));
|
panel_groupvol.add(lb_groupvol);
|
|
tf_GroupVol = new JTextField();
|
panel_groupvol.add(tf_GroupVol);
|
tf_GroupVol.setColumns(10);
|
|
JPanel panel_battcurr = new JPanel();
|
panel_1.add(panel_battcurr);
|
panel_battcurr.setLayout(new BoxLayout(panel_battcurr, BoxLayout.X_AXIS));
|
|
lb_battcurr = new JLabel(mProperties.getProperty("monitor_page_tf_label_battcurr"));
|
panel_battcurr.add(lb_battcurr);
|
|
tf_TestCurr = new JTextField();
|
panel_battcurr.add(tf_TestCurr);
|
tf_TestCurr.setColumns(10);
|
|
JPanel panel_teststarttime = new JPanel();
|
panel_1.add(panel_teststarttime);
|
panel_teststarttime.setLayout(new BoxLayout(panel_teststarttime, BoxLayout.X_AXIS));
|
|
lb_testtime = new JLabel(mProperties.getProperty("monitor_page_tf_label_testtime"));
|
panel_teststarttime.add(lb_testtime);
|
lb_testtime.setHorizontalAlignment(SwingConstants.TRAILING);
|
|
tf_TestStartTime = new JTextField();
|
panel_teststarttime.add(tf_TestStartTime);
|
tf_TestStartTime.setColumns(10);
|
|
JPanel panel_testtimelong = new JPanel();
|
panel_1.add(panel_testtimelong);
|
panel_testtimelong.setLayout(new BoxLayout(panel_testtimelong, BoxLayout.X_AXIS));
|
|
lb_testtimelong = new JLabel(mProperties.getProperty("monitor_page_tf_label_testlong"));
|
panel_testtimelong.add(lb_testtimelong);
|
lb_testtimelong.setHorizontalAlignment(SwingConstants.TRAILING);
|
|
tf_TestTimeLong = new JTextField();
|
panel_testtimelong.add(tf_TestTimeLong);
|
tf_TestTimeLong.setColumns(10);
|
|
JPanel panel_testcap = new JPanel();
|
panel_1.add(panel_testcap);
|
panel_testcap.setLayout(new BoxLayout(panel_testcap, BoxLayout.X_AXIS));
|
|
lb_testcap = new JLabel(mProperties.getProperty("monitor_page_tf_label_testcap"));
|
panel_testcap.add(lb_testcap);
|
lb_testcap.setHorizontalAlignment(SwingConstants.TRAILING);
|
|
tf_TestCap = new JTextField();
|
panel_testcap.add(tf_TestCap);
|
tf_TestCap.setColumns(10);
|
|
JPanel panel_restcap = new JPanel();
|
panel_1.add(panel_restcap);
|
panel_restcap.setLayout(new BoxLayout(panel_restcap, BoxLayout.X_AXIS));
|
|
lb_restcap = new JLabel(mProperties.getProperty("monitor_page_tf_label_restcap"));
|
panel_restcap.add(lb_restcap);
|
|
tf_RestCap = new JTextField();
|
panel_restcap.add(tf_RestCap);
|
tf_RestCap.setColumns(10);
|
|
JPanel panel_resttime = new JPanel();
|
panel_1.add(panel_resttime);
|
|
//lb_resttime = new JLabel(mProperties.getProperty("monitor_page_tf_label_resttime"));
|
tf_RestTime = new JTextField();
|
tf_RestTime.setColumns(10);
|
panel_resttime.setLayout(new BorderLayout(0, 0));
|
panel_resttime.add(max_CheckBox, BorderLayout.CENTER);
|
//panel_resttime.add(tf_RestTime);
|
/*******************************************************************************************/
|
|
setChartViewType();
|
setChartViewState(ChartType_MonBar, false);
|
}
|
|
public void putAndShowFBOData(String ntm_sel_file, FboDataInf data_inf,
|
ArrayList<FboData> al_fbo_data) {
|
Label_ChartTitle.setText(ntm_sel_file);
|
|
m_BattGroupInf.MonCapStd = data_inf.STDCap;
|
m_BattGroupInf.BattCount = data_inf.BattSum;
|
m_BattGroupInf.MonVolStd = data_inf.MonomerVol;
|
|
mBattTestData.clearAllData();
|
mBattTestData = new BattTestData();
|
mBattTestData.BattTestStopType = data_inf.StopType;
|
mBattTestData.MonCount = data_inf.BattSum;
|
for(int n=0; n<al_fbo_data.size(); n++) {
|
TestData td = new TestData();
|
FboData fd = al_fbo_data.get(n);
|
td.testType = BattTestData.getTestTypeFromFBOData(fd.m_DataType.TypeTag0);
|
td.onlineVol = fd.OnlineVol;
|
td.groupVol = fd.SumVoltage;
|
td.testCurr = fd.SumCurrent;
|
td.testCap = fd.AllCap;
|
td.testTimeLong = fd.m_TestTime.hour*3600 + fd.m_TestTime.minute*60 + fd.m_TestTime.second;
|
for(int mn=0; mn<data_inf.BattSum; mn++) {
|
MonData md = new MonData();
|
md.monVol = fd.SingleVol[mn];
|
td.MonVol.add(md);
|
}
|
mBattTestData.al_TestData.add(td);
|
}
|
|
m_GroupLineChart.updateChartData(mBattTestData);
|
m_CurrLineChart.updateChartData(mBattTestData);
|
m_MonVolLineChart.updateChartData(mBattTestData);
|
|
m_TBarChartDataIndex = mBattTestData.al_TestData.size()-1;
|
m_DataIndexSlider.setMaximum(m_TBarChartDataIndex);
|
m_DataIndexSlider.setMinimum(0);
|
m_DataIndexSlider.setValue(m_DataIndexSlider.getMaximum());
|
|
setBarChartDataType(BattTestData.MonData_CapVol);
|
}
|
|
public void initUI_TabBattMonitState()
|
{
|
m_SplitPane_ListTable.setDividerLocation(0.5);
|
}
|
/*
|
private void setLabelText(int test_type_option)
|
{
|
String option_text = "";
|
lb_battstate.setText(mProperties.getProperty("monitor_page_tf_label_battstate" + option_text));
|
lb_groupvol.setText(mProperties.getProperty("monitor_page_tf_label_groupvol" + option_text));
|
lb_battcurr.setText(mProperties.getProperty("monitor_page_tf_label_battcurr" + option_text));
|
lb_testtime.setText(mProperties.getProperty("monitor_page_tf_label_testtime" + option_text));
|
lb_testtimelong.setText(mProperties.getProperty("monitor_page_tf_label_testlong" + option_text));
|
lb_testcap.setText(mProperties.getProperty("monitor_page_tf_label_testcap" + option_text));
|
lb_restcap.setText(mProperties.getProperty("monitor_page_tf_label_restcap" + option_text));
|
lb_resttime.setText(mProperties.getProperty("monitor_page_tf_label_resttime" + option_text));
|
}
|
*/
|
|
public boolean getChartViewState()
|
{
|
return mChartViewStateMax;
|
}
|
|
public void setMonLineChartType(int chart_type)
|
{
|
switch(chart_type) {
|
case TMultVolLineChart.LineType_MonVol:
|
m_SplitPane_Chart_2.setRightComponent(m_MonVolLineChart);
|
m_MonVolLineChart.setGridViewIndex(3);
|
setChartViewState(3, false);
|
break;
|
case TMultVolLineChart.LineType_MonTmp:
|
m_SplitPane_Chart_2.setRightComponent(m_MonTmpLineChart);
|
m_MonTmpLineChart.setGridViewIndex(3);
|
setChartViewState(3, false);
|
break;
|
default: break;
|
}
|
}
|
|
public void setChartViewType()
|
{/*
|
if((TestDataType_RT_MONITOR == getTestDataTypeOption())
|
|| (TestDataType_RES_SER == getTestDataTypeOption()))
|
{
|
m_SplitPane_Chart_1.setLeftComponent(m_TBarMonResChart);
|
m_TBarMonResChart.setGridViewIndex(0);
|
m_SplitPane_Chart_1.setRightComponent(m_TBarConnResChart);
|
m_TBarConnResChart.setGridViewIndex(1);
|
m_SplitPane_Chart_2.setLeftComponent(m_TBarMonVolChart);
|
m_TBarMonVolChart.setGridViewIndex(2);
|
m_SplitPane_Chart_2.setRightComponent(m_TBarMonTmpChart);
|
m_TBarMonTmpChart.setGridViewIndex(3);
|
}
|
else*/
|
{
|
m_SplitPane_Chart_1.setLeftComponent(m_GroupLineChart);
|
m_GroupLineChart.setGridViewIndex(0);
|
m_SplitPane_Chart_1.setRightComponent(m_CurrLineChart);
|
m_CurrLineChart.setGridViewIndex(1);
|
m_SplitPane_Chart_2.setLeftComponent(m_TBarMonVolChart);
|
m_TBarMonVolChart.setGridViewIndex(2);
|
m_SplitPane_Chart_2.setRightComponent(m_MonVolLineChart);
|
m_MonVolLineChart.setGridViewIndex(3);
|
}
|
}
|
public void setChartViewState(int chart_index, boolean chart_view_max)
|
{
|
mChartViewStateMax = chart_view_max;
|
if(true == chart_view_max)
|
{
|
m_SplitPane_Chart.setDividerLocation(0.0);
|
m_SplitPane_Chart_1.getLeftComponent().setVisible(false);
|
m_SplitPane_Chart_1.getRightComponent().setVisible(false);
|
m_SplitPane_Chart_1.setVisible(false);
|
m_SplitPane_Chart_1.setDividerLocation(0.0);
|
|
m_SplitPane_Chart_2.getLeftComponent().setVisible(false);
|
m_SplitPane_Chart_2.getRightComponent().setVisible(false);
|
m_SplitPane_Chart_2.setVisible(false);
|
m_SplitPane_Chart_2.setDividerLocation(0.0);
|
|
switch(chart_index)
|
{
|
case 0:
|
m_SplitPane_Chart_1.getLeftComponent().setVisible(true);
|
m_SplitPane_Chart_1.setVisible(true);
|
m_SplitPane_Chart_1.setDividerLocation(1.0);
|
m_SplitPane_Chart.setDividerLocation(1.0);
|
break;
|
case 1:
|
m_SplitPane_Chart_1.getRightComponent().setVisible(true);
|
m_SplitPane_Chart_1.setVisible(true);
|
m_SplitPane_Chart_1.setDividerLocation(0.0);
|
m_SplitPane_Chart.setDividerLocation(1.0);
|
break;
|
case 2:
|
m_SplitPane_Chart_2.getLeftComponent().setVisible(true);
|
m_SplitPane_Chart_2.setVisible(true);
|
m_SplitPane_Chart_2.setDividerLocation(1.0);
|
m_SplitPane_Chart.setDividerLocation(0.0);
|
break;
|
case 3:
|
m_SplitPane_Chart_2.getRightComponent().setVisible(true);
|
m_SplitPane_Chart_2.setVisible(true);
|
m_SplitPane_Chart_2.setDividerLocation(0.0);
|
m_SplitPane_Chart.setDividerLocation(0.0);
|
break;
|
}
|
}
|
else
|
{
|
m_SplitPane_Chart_1.getLeftComponent().setVisible(true);
|
m_SplitPane_Chart_1.getRightComponent().setVisible(true);
|
m_SplitPane_Chart_2.getLeftComponent().setVisible(true);
|
m_SplitPane_Chart_2.getRightComponent().setVisible(true);
|
|
m_SplitPane_Chart_1.setVisible(true);
|
m_SplitPane_Chart_2.setVisible(true);
|
m_SplitPane_Chart.setDividerLocation(0.5);
|
m_SplitPane_Chart_1.setDividerLocation(0.5);
|
m_SplitPane_Chart_2.setDividerLocation(0.5);
|
}
|
}
|
|
public void setShowBattLowType(byte type)
|
{
|
m_ShowBattLowType = type;
|
if(ShowBattLowType_None == m_ShowBattLowType)
|
{
|
m_MonLineShowList.clear();
|
m_TBarMonVolChart.restoreZoom();
|
}
|
}
|
|
public byte getShowBattLowType()
|
{
|
return m_ShowBattLowType;
|
}
|
|
public void upDateLineChartShowNums(boolean update_data)
|
{
|
ArrayList<Integer> val_index = m_MonLineShowList;
|
if(val_index.size() > 0)
|
{
|
m_MonVolLineChart.setLineSerialVisiable(-1, false);
|
m_MonTmpLineChart.setLineSerialVisiable(-1, false);
|
for(int n=0; n<val_index.size(); n++) {
|
m_MonVolLineChart.setLineSerialVisiable(val_index.get(n), true);
|
m_MonTmpLineChart.setLineSerialVisiable(val_index.get(n), true);
|
}
|
}
|
|
if(true == update_data) {
|
upDateSingleRecordMonvol(m_TBarChartDataIndex, false);
|
}
|
}
|
public void setBarChartDataType(byte type)
|
{
|
m_TBarChartDataType = type;
|
upDateSingleRecordMonvol(m_TBarChartDataIndex, false);
|
}
|
public byte getBarChartDataType()
|
{
|
return m_TBarChartDataType;
|
}
|
/*
|
public String getStationName()
|
{
|
return mStationName;
|
}*/
|
public String getBattGroupName()
|
{
|
return mBattGroupName;
|
}
|
//================================================================================================//
|
public float[] getBattMonData(byte datatype)
|
{
|
float[] data = mBattTestData.getMonData(datatype, m_TBarChartDataIndex);
|
return data;
|
}
|
public float[] getFisrtMonVolData()
|
{
|
float[] data = mBattTestData.getMonData(BattTestData.MonData_Vol, 0);
|
return data;
|
}
|
public void clearBattData()
|
{
|
m_MonVolLineChart.clearAllSerialData();
|
m_MonTmpLineChart.clearAllSerialData();
|
m_GroupLineChart.clearAllSerialData();
|
m_CurrLineChart.clearAllSerialData();
|
m_TBarMonVolChart.clearSerialData();
|
m_TBarMonTmpChart.clearSerialData();
|
m_TBarMonResChart.clearSerialData();
|
m_TBarConnResChart.clearSerialData();
|
|
tf_BattState.setText("");
|
tf_TestCurr.setText("");
|
tf_GroupVol.setText("");
|
tf_TestStartTime.setText("");
|
tf_TestTimeLong.setText("");
|
tf_TestCap.setText("");
|
tf_RestCap.setText("");
|
tf_RestTime.setText("");
|
}
|
public void upDateSingleRecordMonvol(int rec_index, boolean manulBarBottomAx)
|
{
|
//if(0 == getTestDataTypeOption())
|
// return;
|
|
m_TBarChartDataIndex = rec_index;
|
m_MonVolLineChart.setMLinePosition(rec_index, 0, 0);
|
m_MonTmpLineChart.setMLinePosition(rec_index, 0, 0);
|
m_GroupLineChart.setMLinePosition(rec_index, 0, 0);
|
m_CurrLineChart.setMLinePosition(rec_index, 0, 0);
|
|
int bar_type = TBarChart.Bar_Type_MonCapVol;
|
if(BattTestData.MonData_Tmp == m_TBarChartDataType) {
|
bar_type = TBarChart.Bar_Type_MonCapTmp;
|
} else if(BattTestData.MonData_RealCap == m_TBarChartDataType) {
|
bar_type = TBarChart.Bar_Type_MonRealCap;
|
} else if(BattTestData.MonData_RestCap == m_TBarChartDataType) {
|
bar_type = TBarChart.Bar_Type_MonRestCap;
|
} else if(BattTestData.MonData_CapPercent == m_TBarChartDataType) {
|
bar_type = TBarChart.Bar_Type_MonCapPercent;
|
}
|
float std_var = 0;
|
if (TBarChart.Bar_Type_MonCapVol == bar_type) {
|
std_var = m_BattGroupInf.MonVolStd;
|
} else if (TBarChart.Bar_Type_MonCapTmp == bar_type) {
|
std_var = m_BattGroupInf.MonTmpStd;
|
} else if (TBarChart.Bar_Type_MonRealCap == bar_type) {
|
std_var = m_BattGroupInf.MonCapStd;
|
} else if (TBarChart.Bar_Type_MonCapPercent == bar_type) {
|
std_var = 1;
|
}
|
m_TBarMonVolChart.updateChartData(bar_type, std_var,
|
mBattTestData.getMonData(m_TBarChartDataType, rec_index),
|
mBattTestData.MonCount,
|
m_MonVolLineChart.maxValue);
|
|
if(mBattTestData.al_TestData.size() < 1) {
|
return;
|
}
|
|
BattTestData.TestData tmp_data = mBattTestData.al_TestData.get(rec_index);
|
if(tmp_data.testType == BattTestData.BATTSTATE_DISCHARGE) {
|
tf_BattState.setText(mProperties.getProperty("test_type3")
|
+ " (ÖÕÖ¹ÔÒò: " + FboDataInf.getStopType(mBattTestData.BattTestDevType,
|
mBattTestData.BattTestStopType) + ")");
|
} else {
|
tf_BattState.setText(mProperties.getProperty("test_type2")
|
/*+ " (ÖÕÖ¹ÔÒò: " + FboDataInf.getStopType(mBattTestData.BattTestDevType,
|
mBattTestData.BattTestStopType) + ")"*/);
|
}
|
|
tf_TestCurr.setText(String.format("%1.1fA", tmp_data.testCurr));
|
tf_GroupVol.setText(String.format("ÔÚÏß:%1.1fV,×é¶Ë:%1.1fV", tmp_data.onlineVol, tmp_data.groupVol));
|
tf_TestStartTime.setText(Com.get_DTF(tmp_data.startTestTime, Com.DTF_YMDhms));
|
tf_TestTimeLong.setText(String.format("%02d:%02d:%02d", tmp_data.testTimeLong/3600,
|
(tmp_data.testTimeLong%3600)/60,
|
tmp_data.testTimeLong%60));
|
tf_TestCap.setText(String.format("%1.1fAH", tmp_data.testCap));
|
|
double cap = FBS_ComBase.GetMonomerCap(mBattTestData.MonCapStd,
|
FBS_ComBase.GetHourRate(mBattTestData.MonCapStd, tmp_data.testCurr),
|
tmp_data.testCap,
|
tmp_data.getMaxMonVol(),
|
tmp_data.getMinMonVol(),
|
mBattTestData.MonVolStd,
|
FBS_ComBase.CapType_Rest);
|
tf_RestCap.setText(String.format("%1.1fAH", cap));
|
|
int t_rest = FBS_ComBase.GetRestTimeSecond(cap, tmp_data.testCurr);
|
tf_RestTime.setText(String.format("%02dH%02dM", t_rest/3600, (t_rest%3600)/60));
|
}
|
//================================================================================================//
|
//================================================================================================//
|
public void upDate_MonResSer_TestData()
|
{
|
m_TBarChartDataIndex = 0;
|
|
float[] vol = mBattTestData.getMonData(BattTestData.MonData_Vol, 0);
|
//float[] tmp = mBattTestData.getMonData(BattTestData.MonData_Tmp, 0);
|
float[] res = mBattTestData.getMonData(BattTestData.MonData_Res, 0);
|
float[] ser = mBattTestData.getMonData(BattTestData.MonData_Ser, 0);
|
float[] ser_percent = mBattTestData.getMonData(BattTestData.MonData_SerPercent, 0);
|
//float[] conn_res = mBattTestData.getMonData(BattTestData.MonData_ConnRes, 0);
|
int batt_count = m_BattGroupInf.BattCount;
|
m_MonVolLineChart.setMLinePosition(0, 0, 0);
|
m_MonTmpLineChart.setMLinePosition(0, 0, 0);
|
m_GroupLineChart.setMLinePosition(0, 0, 0);
|
m_CurrLineChart.setMLinePosition(0, 0, 0);
|
m_TBarMonVolChart.updateChartData(TBarChart_fbs.Bar_Type_MonVol, m_BattGroupInf.MonVolStd, vol, batt_count, 0);
|
m_TBarMonTmpChart.updateChartData(TBarChart_fbs.Bar_Type_MonSer, m_BattGroupInf.MonSerStd, ser, batt_count, 0);
|
m_TBarMonResChart.updateChartData(TBarChart_fbs.Bar_Type_MonRes, m_BattGroupInf.MonResStd, res, batt_count, 0);
|
m_TBarConnResChart.updateChartData(TBarChart_fbs.Bar_Type_MonSerPercent, 1, ser_percent, batt_count, 0);
|
}
|
//================================================================================================//
|
}
|