| | |
| | | private JTextField tf_respm_s2; |
| | | private JTextField tf_respm_s3; |
| | | private JTextField tf_respm_s4; |
| | | |
| | | private JTextField tf_mon_floatvol; //单体浮充电压 系数0.001V,可设置2150~2300或12900~13800 |
| | | private JTextField tf_errcurr_limit; //异常漂移电流阀值 系数0.1A,可设置10~150 |
| | | |
| | | |
| | | private JPanel panel; |
| | | private JPanel panel_1; |
| | | private JPanel panel_2; |
| | |
| | | |
| | | JPanel panel_80 = new JPanel(); |
| | | panel_80.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7EBF\u7F06\u8865\u507F(D1,D2,D3,D4 / S1,S2,S3,S4)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0))); |
| | | panel_48.add(panel_80); |
| | | //panel_48.add(panel_80); |
| | | panel_80.setLayout(new GridLayout(0, 8, 2, 0)); |
| | | |
| | | tf_respm_d1 = new JTextField(); |
| | |
| | | tf_respm_s4.setDocument(new LimitedDocument(6, "0123456789.")); |
| | | panel_80.add(tf_respm_s4); |
| | | tf_respm_s4.setColumns(10); |
| | | |
| | | |
| | | JPanel panel_90 = new JPanel(); |
| | | panel_48.add(panel_90); |
| | | panel_90.setLayout(new GridLayout(0, 6, 5, 5)); |
| | | |
| | | JPanel panel_91 = new JPanel(); |
| | | panel_91.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u5355\u4f53\u6d6e\u5145\u7535\u538b(V)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0))); |
| | | panel_90.add(panel_91); |
| | | panel_91.setLayout(new BorderLayout()); |
| | | |
| | | tf_mon_floatvol = new JTextField(); |
| | | tf_mon_floatvol.setFont(new Font("Dialog", Font.PLAIN, 18)); |
| | | tf_mon_floatvol.setDocument(new LimitedDocument(6, "0123456789.")); |
| | | panel_91.add(tf_mon_floatvol,BorderLayout.CENTER); |
| | | tf_mon_floatvol.setColumns(10); |
| | | |
| | | |
| | | JPanel panel_92 = new JPanel(); |
| | | panel_92.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u5f02\u5e38\u6f02\u79fb\u7535\u6d41\u9600\u503c(A)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0))); |
| | | panel_90.add(panel_92); |
| | | panel_92.setLayout(new BorderLayout()); |
| | | |
| | | tf_errcurr_limit = new JTextField(); |
| | | tf_errcurr_limit.setFont(new Font("Dialog", Font.PLAIN, 18)); |
| | | tf_errcurr_limit.setDocument(new LimitedDocument(7, "0123456789.")); |
| | | panel_92.add(tf_errcurr_limit,BorderLayout.CENTER); |
| | | tf_errcurr_limit.setColumns(10); |
| | | |
| | | |
| | | panel_54.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0))); |
| | | panel_48.add(panel_54); |
| | | panel_54.setLayout(new BoxLayout(panel_54, BoxLayout.X_AXIS)); |
| | |
| | | tf_param_set_inf.setFont(new Font("Dialog", Font.PLAIN, 18)); |
| | | panel_54.add(tf_param_set_inf); |
| | | tf_param_set_inf.setColumns(10); |
| | | |
| | | |
| | | |
| | | JPanel panel_65 = new JPanel(); |
| | | panel_54.add(panel_65); |
| | |
| | | JOptionPane.showMessageDialog(null, tmp_str + SPCommZDHJ.ZDHJ_MON_COUNT_MAX); |
| | | return; |
| | | } |
| | | double mon_floatvol = Double.parseDouble(tf_mon_floatvol.getText()); |
| | | double errcurr_limit = Double.parseDouble(tf_errcurr_limit.getText()); |
| | | if(mon_floatvol<2.15 || (2.3 < mon_floatvol && mon_floatvol < 12.9) || 13.8 < mon_floatvol) { |
| | | JOptionPane.showMessageDialog(null, "单体浮充电压超出范围(2.15~2.3)或(12.9~13.8)"); |
| | | return; |
| | | } |
| | | if(errcurr_limit < 1 || 15 < errcurr_limit) { |
| | | JOptionPane.showMessageDialog(null, "异常漂移电流阀值超出范围(2.15~2.3)或(12.9~13.8)"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | zdhj_param_data[1] = ch1_cnt; |
| | | zdhj_param_data[2] = ch2_cnt; |
| | |
| | | zdhj_param_data[20] = (short) (Double.parseDouble(tf_respm_d4.getText())*10000); |
| | | zdhj_param_data[21] = (short) (Double.parseDouble(tf_respm_s1.getText())*10000); |
| | | zdhj_param_data[22] = (short) (Double.parseDouble(tf_respm_s2.getText())*10000); |
| | | zdhj_param_data[23] = (short) (Double.parseDouble(tf_respm_s3.getText())*10000); |
| | | zdhj_param_data[24] = (short) (Double.parseDouble(tf_respm_s4.getText())*10000); |
| | | //zdhj_param_data[23] = (short) (Double.parseDouble(tf_respm_s3.getText())*10000); |
| | | //zdhj_param_data[24] = (short) (Double.parseDouble(tf_respm_s4.getText())*10000); |
| | | zdhj_param_data[23] = (short) (Double.parseDouble(tf_mon_floatvol.getText())*1000); |
| | | zdhj_param_data[24] = (short) (Double.parseDouble(tf_errcurr_limit.getText())*10); |
| | | |
| | | //--------------------------------------------------------------------------------// |
| | | String tmp_str = "确定要设置 '配置参数' 吗?"; |
| | | if(LANG_TYPE_EN == LANG_TYPE) { |
| | |
| | | //frmSerialport.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); |
| | | //--------------------------------------------------------------------------------// |
| | | } catch (Exception e1) { |
| | | // e1.printStackTrace(); |
| | | e1.printStackTrace(); |
| | | String tmp_str = "请输入合法的 '模块参数' 值!"; |
| | | if(LANG_TYPE_EN == LANG_TYPE) { |
| | | tmp_str = "Please input the rightful param values!"; |
| | |
| | | tf_respm_s2.setText(String.format("%1.4f", SerialComm_ZDHJ.dev_param_resparam_s[1])); |
| | | tf_respm_s3.setText(String.format("%1.4f", SerialComm_ZDHJ.dev_param_resparam_s[2])); |
| | | tf_respm_s4.setText(String.format("%1.4f", SerialComm_ZDHJ.dev_param_resparam_s[3])); |
| | | |
| | | tf_mon_floatvol.setText(String.format("%1.3f", SerialComm_ZDHJ.dev_param_mon_floatvol)); |
| | | tf_errcurr_limit.setText(String.format("%1.1f", SerialComm_ZDHJ.dev_param_errcurr_limit)); |
| | | } |
| | | |
| | | String inf_t = ""; |