From 17abf30f43f493cb09904267e74ac51fd1ea96b1 Mon Sep 17 00:00:00 2001
From: whyclj <1525436766@qq.com>
Date: 星期四, 10 九月 2020 19:57:54 +0800
Subject: [PATCH] 111

---
 ElectricalSystem_MonitorServer_2KW/src/com/electrical/TwoKW/Electrical_2KWTask_SQL.java |  110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 109 insertions(+), 1 deletions(-)

diff --git a/ElectricalSystem_MonitorServer_2KW/src/com/electrical/TwoKW/Electrical_2KWTask_SQL.java b/ElectricalSystem_MonitorServer_2KW/src/com/electrical/TwoKW/Electrical_2KWTask_SQL.java
index ef7fb13..9b45d8e 100644
--- a/ElectricalSystem_MonitorServer_2KW/src/com/electrical/TwoKW/Electrical_2KWTask_SQL.java
+++ b/ElectricalSystem_MonitorServer_2KW/src/com/electrical/TwoKW/Electrical_2KWTask_SQL.java
@@ -109,6 +109,7 @@
 				"  local_remote_control int(11) NOT NULL DEFAULT '0' COMMENT '就地远程控制状态'," +
 				
 				"  pulse_blocking int(11) NOT NULL DEFAULT '0' COMMENT '脉冲封锁'," + 
+				"  dc_voltage_state int(11) NOT NULL DEFAULT '0' COMMENT '高压开关状态'," + 
 				
 				"  curve_charge_mode int(11) NOT NULL DEFAULT '0' COMMENT '曲线充电模式状态'," + 
 				"  start_curve_charge_mode int(11) NOT NULL DEFAULT '0' COMMENT '启动曲线充电模式'," + 
@@ -204,7 +205,7 @@
 				"  start_screen_set int(11) NOT NULL DEFAULT '0' COMMENT '启动触摸屏给定'," + 
 				"  start_upper_set int(11) NOT NULL DEFAULT '0' COMMENT '启动上位机给定'," + 
 				"  consvolswitch int(11) NOT NULL DEFAULT '0' COMMENT '恒压切换'," + 
-				"  othermode int(11) NOT NULL," + 
+				"  othermode int(11) NOT NULL COMMENT '4并或2串2并以外模式'," + 
 				"  consvol_distribution int(11) NOT NULL DEFAULT '0' COMMENT '四串恒压电压分配位'," + 
 				"  PRIMARY KEY (num)," + 
 				"  UNIQUE KEY electric2KW_id_key (electric2KW_id) USING BTREE" + 
@@ -312,6 +313,10 @@
 				+ " othermode = "+ert.othermode+","
 				+ " consvol_distribution = "+ert.consvol_distribution+","
 				+ " local_remote_control = "+ert.local_remote_control+","
+				
+				+ " pulse_blocking = "+ert.pulse_blocking+","				//脉冲封锁
+				+ " dc_voltage_state = "+ert.dc_voltage_state+","			//高压开关状态
+				
 				+ " curve_charge_mode = "+ert.curve_charge_mode+","
 				+ " start_curve_charge_mode = "+ert.start_curve_charge_mode+","
 				+ " stop_curve_charge_mode = "+ert.stop_curve_charge_mode+" "
@@ -325,6 +330,9 @@
 			sql.close_con();
 		}
 	}
+	
+	
+	
 	//更新2mw电源控制信息表
 	public static void update_Electric_Control_2KW(MysqlConnPool pool,Electric_Control_Single_2kw econ) {
 		String sql_str = " UPDATE "+ Sql_Mysql.Tb_electric2MW_control  +""
@@ -351,6 +359,106 @@
 			sql.close_con();
 		}
 	}
+
+	/**
+	 * 更新模拟量状态表
+	 * @param conn_pool
+	 * @param state
+	 */
+	public static void update_Electric_State_2KW(MysqlConnPool conn_pool, Electric_State_2kw state) {
+		String sql_str = " UPDATE "+Sql_Mysql.Tb_Electric_Control_Single +
+				" Set brachdcvol= " + state.brachdcvol +
+				",brachdccurr=" + state.brachdccurr +
+				",alldcvol=" + state.alldcvol +
+				",alldccurr=" + state.alldccurr +
+				",stopchargevol_one=" + state.stopchargevol_one +
+				",stopchargevol_two=" + state.stopchargevol_two +
+				",stopchargevol_three=" + state.stopchargevol_three + 
+				",stopchargevol_four=" + state.stopchargevol_four +
+				",stopchargevol_five=" + state.stopchargevol_five +
+				",controlangle=" + state.controlangle +
+				",localgivevol=" + state.localgivevol +
+				",volset=" + state.volset +
+				",localgivecurr=" + state.localgivecurr +
+				",currset=" + state.currset +
+				",chargecurr_one=" + state.chargecurr_one +
+				",chargecurr_two=" + state.chargecurr_two +
+				",chargecurr_three=" + state.chargecurr_three +
+				",chargecurr_four=" + state.chargecurr_four +
+				",chargecurr_five=" + state.chargecurr_five +
+				",consvolmode_chargecurr=" +state.consvolmode_chargecurr+ 
+				" Where electric2KW_id = " + state.electric2KW_id;
+		Sql_Mysql sql = new Sql_Mysql(conn_pool.getConn());
+		try {
+			sql.sqlMysqlExecute(sql_str);
+		} catch (SQLException e) {
+			e.printStackTrace();
+		} finally {
+			sql.close_con();
+		}
+	}
+	
+	/**
+	 *	查询单点控制表
+	 * @param conn_pool
+	 * @param control
+	 */
+	public static void queryElectric_Control_2KW(MysqlConnPool conn_pool,Electric_Control_Single_2kw control) {
+		String sql_str = "SELECT * FROM "+Sql_Mysql.Tb_electric2MW_control;
+		ResultSet res = null;
+		Sql_Mysql sql = new Sql_Mysql(conn_pool.getConn());
+		try {
+			res = sql.sqlMysqlQuery(sql_str);
+			while(res.next()) {
+				control.upper_pulse_block = res.getInt("upper_pulse_block");				//上位机脉冲封锁
+				control.remote_start= res.getInt("remote_start");							//远程启动
+				control.fault_reset= res.getInt("fault_reset");								//故障复位
+				control.conscurrswitch= res.getInt("conscurrswitch");						//恒流切换
+				control.constantvol= res.getInt("constantvol");								//4并或2串2并恒压
+				control.volset_confirm= res.getInt("volset_confirm");						//电压给定确认
+				control.currset_confirm= res.getInt("currset_confirm");						//电流给定确认
+				control.remote_stop= res.getInt("remote_stop");								//远程停止
+				control.start_screen_set= res.getInt("start_screen_set");					//启动触摸屏给定
+				control.start_upper_set= res.getInt("start_upper_set");						//启动上位机给定
+				control.consvolswitch= res.getInt("consvolswitch");							//恒压切换
+				control.othermode= res.getInt("othermode");									//4并或2串2并以外模式
+				control.consvol_distribution= res.getInt("consvol_distribution");			//四串恒压电压分配位
+			  
+				control.consvolmode_chargecurr= res.getFloat("consvolmode_chargecurr") ;	// '转为恒压模式充电电压值',
+				control.chargecurr_one = res.getFloat("chargecurr_one") ;					// '第1阶段充电电流值',
+				control.chargecurr_two = res.getFloat("chargecurr_two") ;					// '第2阶段充电电流值',
+				control.chargecurr_three = res.getFloat("chargecurr_three") ;				// '第3阶段充电电流值',
+				control.chargecurr_four = res.getFloat("chargecurr_four") ;					// '第4阶段充电电流值',
+				control.chargecurr_five = res.getFloat("chargecurr_five") ;					// '第5阶段充电电流值',
+				control.currset = res.getFloat("currset") ;									// '电流设定值',
+			 
+				control.volset = res.getFloat("volset") ;									// '电压设定值',
+				control.stopchargevol_one = res.getFloat("stopchargevol_one") ;				// '第1阶段充电终止电压',
+				control.stopchargevol_two = res.getFloat("stopchargevol_two") ;				// '第2阶段充电终止电压',
+				control.stopchargevol_three = res.getFloat("stopchargevol_three") ;			// '第3阶段充电终止电压',
+				control.stopchargevol_four = res.getFloat("stopchargevol_four") ;			// '第4阶段充电终止电压',
+				control.stopchargevol_five = res.getFloat("stopchargevol_five") ;			// '第5阶段充电终止电压',
+			}
+		} catch (SQLException e) {
+			e.printStackTrace();
+		} finally {
+			if(res != null) {
+				try {
+					res.close();
+				} catch (SQLException e) {
+					e.printStackTrace();
+				}
+			}
+			sql.close_con();
+		}
+	}
+	
+	public static void updateElectrical_2KW_Control(MysqlConnPool pool,Electric_Control_Single_2kw control) {
+		//String sql_str = " update " + Sql_Mysql;
+		
+	}
+	
+	
 }
 
 

--
Gitblit v1.9.1