mxpopstar
2022-05-03 e75ef5f04f61aa5fbd89fd5c413dcee1819b7a91
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package com.dev.fbs9600_zdhj;
 
import javax.swing.JPanel;
 
import java.awt.GridLayout;
 
import javax.swing.border.TitledBorder;
 
import com.teechart.TBarChart_fbs;
 
import java.awt.BorderLayout;
 
public class zdhj_page_chart extends JPanel {
    private TBarChart_fbs m_TBarMonVolChart;
    private TBarChart_fbs m_TBarMonTmpChart;
    private TBarChart_fbs m_TBarMonResChart;
    private TBarChart_fbs m_TBarMonCurrChart;
    private SPCommZDHJ SerialComm_ZDHJ = null;
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
 
    /**
     * Create the panel.
     */
    public zdhj_page_chart() {
        setLayout(new GridLayout(0, 2, 0, 0));
        
        JPanel panel = new JPanel();
        panel.setBorder(new TitledBorder(null, "\u5355\u4F53\u7535\u538B(V)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        add(panel);
        panel.setLayout(new BorderLayout(0, 0));
        m_TBarMonVolChart = new TBarChart_fbs(TBarChart_fbs.Bar_Type_MonVol);
        panel.add(m_TBarMonVolChart, BorderLayout.CENTER);
        
        JPanel panel_1 = new JPanel();
        panel_1.setBorder(new TitledBorder(null, "\u5355\u4F53\u6E29\u5EA6(\u2103)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        add(panel_1);
        panel_1.setLayout(new BorderLayout(0, 0));
        m_TBarMonTmpChart = new TBarChart_fbs(TBarChart_fbs.Bar_Type_MonTmp);
        panel_1.add(m_TBarMonTmpChart, BorderLayout.CENTER);
        
        JPanel panel_2 = new JPanel();
        panel_2.setBorder(new TitledBorder(null, "\u5355\u4F53\u5185\u963B(m\u03A9)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        add(panel_2);
        panel_2.setLayout(new BorderLayout(0, 0));
        m_TBarMonResChart = new TBarChart_fbs(TBarChart_fbs.Bar_Type_MonRes);
        panel_2.add(m_TBarMonResChart, BorderLayout.CENTER);
        
        JPanel panel_3 = new JPanel();
        panel_3.setBorder(new TitledBorder(null, "\u5355\u4F53\u5747\u8861\u7535\u6D41(mA)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        add(panel_3);
        panel_3.setLayout(new BorderLayout(0, 0));
        m_TBarMonCurrChart = new TBarChart_fbs(TBarChart_fbs.Bar_Type_MonSer);
        panel_3.add(m_TBarMonCurrChart, BorderLayout.CENTER);
 
    }
    
    public void setSerialComm_ZDHJ(SPCommZDHJ sz) {
        SerialComm_ZDHJ = sz;
    }
    
    public void updateDate() {
        if(null == SerialComm_ZDHJ) {
            return;
        }
        
        int mon_cnt = SerialComm_ZDHJ.ZDHJ_BattCount;
        m_TBarMonVolChart.updateChartData(TBarChart_fbs.Bar_Type_MonVol, SerialComm_ZDHJ.monVol, mon_cnt);
        m_TBarMonResChart.updateChartData(TBarChart_fbs.Bar_Type_MonRes, SerialComm_ZDHJ.monRes, mon_cnt);
        m_TBarMonTmpChart.updateChartData(TBarChart_fbs.Bar_Type_MonTmp, SerialComm_ZDHJ.monTmp, mon_cnt);
        m_TBarMonCurrChart.updateChartData(TBarChart_fbs.Bar_Type_MonSer, SerialComm_ZDHJ.monJHCurr, mon_cnt);
    }
}