| | |
| | | |
| | | <root> |
| | | <mysql_ramdb_recreate_en>false</mysql_ramdb_recreate_en> |
| | | <mysql_server_ip>127.0.0.1</mysql_server_ip> |
| | | <mysql_server_ip>118.89.139.230</mysql_server_ip> |
| | | <!--SOURCE_BATTDATA_TYPE_FBSDEV = 0--> |
| | | <!--SOURCE_BATTDATA_TYPE_SQLSERVER = 1--> |
| | | <!--SOURCE_BATTDATA_TYPE_C_INTERFACE = 2--> |
| | |
| | | final public static String DB_Motor_Realhistory = "`db_motor_realhistory`";
|
| | |
|
| | | final public static String DB_ElectricSystem = "`db_electricsystem`";
|
| | | |
| | | final public static String DB_Watersystem = "`db_watersystem`"; |
| | | |
| | | //--------------------------------------------------------------------------------------------//
|
| | | public final static String TB_HardDevSmsState = "tb_hard_dev_sms_state";
|
| | | //--------------------------------------------------------------------------------------------//
|
| | |
| | | public final static String Tb_Electric_State = DB_ElectricSystem + ".tb_electric_state";
|
| | | public final static String Tb_Electric_Switch = DB_ElectricSystem + ".tb_electric_switch";
|
| | |
|
| | | //-----------------------------------------------------------------------------------------------// |
| | | /* 水冷系统相关表 */ |
| | | public final static String Tb_water_inf = DB_Watersystem + ".tb_water_inf"; //水冷系统信息 |
| | | public final static String Tb_water_rt = DB_Watersystem + ".tb_water_rt"; //水冷系统实时数据 |
| | | public final static String Tb_water_brach = DB_Watersystem + ".tb_water_brach"; //水冷系统分支实时数据 |
| | | public final static String Tb_water_state = DB_Watersystem + ".tb_water_state"; //水冷系统实时状态 |
| | |
|
| | | //--------------------------------------------------------------------------------------------//
|
| | | public Connection mysql_con;
|
New file |
| | |
| | | package com.watersystem.monitor; |
| | | |
| | | import java.security.interfaces.RSAKey; |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.List; |
| | | |
| | | import com.sql.MysqlConnPool; |
| | | import com.sql.Sql_Mysql; |
| | | |
| | | public class Water_Task_SQL { |
| | | |
| | | /** |
| | | * 查询所有的水冷记录 |
| | | * @param pool |
| | | * @param electric |
| | | */ |
| | | public static void queryAllWater(MysqlConnPool pool,List<Water_inf> winfs) { |
| | | String sql_str = " select * from " + Sql_Mysql.Tb_water_inf+ " order by water_id;"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn()); |
| | | ResultSet res = null; |
| | | try { |
| | | res = sql.sqlMysqlQuery(sql_str); |
| | | while(res.next()) { |
| | | Water_inf winf=new Water_inf(); |
| | | winf.setWater_id(res.getInt("water_id")); |
| | | winf.setWater_name(res.getString("water_name")); |
| | | winf.setWater_ip(res.getString("water_ip")); |
| | | winf.setWater_type(res.getInt("water_type")); |
| | | winfs.add(winf); |
| | | } |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if(res != null) { |
| | | try { |
| | | res.close(); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | sql.close_con(); |
| | | } |
| | | } |
| | | /** |
| | | * 创建水冷系统数据库 |
| | | * @param pool |
| | | */ |
| | | public static void createDB_WaterSystem(MysqlConnPool pool) { |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn()); |
| | | try { |
| | | sql.sqlMysqlExecute("CREATE DATABASE IF NOT EXISTS " + Sql_Mysql.DB_Watersystem); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | sql.close_con(); |
| | | } |
| | | } |
| | | /** |
| | | * 创建水冷信息表 |
| | | * @param pool |
| | | */ |
| | | public static void createTb_water_inf(MysqlConnPool pool) { |
| | | String sql_str = "CREATE TABLE IF NOT EXISTS "+Sql_Mysql.Tb_water_inf+" (" + |
| | | " num bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'," + |
| | | " water_id int(11) NOT NULL DEFAULT '5001' COMMENT '水冷系统id'," + |
| | | " water_name varchar(255) NOT NULL DEFAULT '' COMMENT '水冷系统名称'," + |
| | | " water_type int(11) NOT NULL DEFAULT '0' COMMENT '水冷系统类型(备用)'," + |
| | | " water_ip varchar(255) NOT NULL DEFAULT '127.0.0.1' COMMENT '水冷系统ip(重要)'," + |
| | | " note varchar(255) NOT NULL DEFAULT ''," + |
| | | " PRIMARY KEY (num)," + |
| | | " KEY water_id_key (water_id)" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn()); |
| | | try { |
| | | sql.sqlMysqlExecute(sql_str); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | sql.close_con(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建水冷系统实时信息表 |
| | | * @param pool |
| | | */ |
| | | public static void createTb_water_rt(MysqlConnPool pool) { |
| | | String sql_str = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_water_rt + " (" + |
| | | " num bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'," + |
| | | " water_id int(11) NOT NULL DEFAULT '5001' COMMENT '水冷系统id'," + |
| | | " cooling_flow float NOT NULL DEFAULT '0' COMMENT '冷却水流量'," + |
| | | " supply_tmp float NOT NULL DEFAULT '0' COMMENT '供水温度'," + |
| | | " Supply_pre float NOT NULL DEFAULT '0' COMMENT '供水压力'," + |
| | | " back_tem float NOT NULL DEFAULT '0' COMMENT '回水温度'," + |
| | | " back_pre float NOT NULL DEFAULT '0' COMMENT '回水压力'," + |
| | | " Cooling_ser float NOT NULL DEFAULT '0' COMMENT '冷却水电导率'," + |
| | | " Buffer_tank_level float NOT NULL DEFAULT '0' COMMENT '缓冲罐液位'," + |
| | | " Buffer_tank_pre float NOT NULL DEFAULT '0' COMMENT '缓冲罐压力'," + |
| | | " Humidity_chamber float NOT NULL DEFAULT '0' COMMENT '阀厅湿度'," + |
| | | " Tem_chamber float NOT NULL DEFAULT '0' COMMENT '阀厅温度'," + |
| | | " External_tmp float NOT NULL DEFAULT '0' COMMENT '外水温度'," + |
| | | " External_pre float NOT NULL DEFAULT '0' COMMENT '外水压力'," + |
| | | " note varchar(255) NOT NULL DEFAULT ''," + |
| | | " PRIMARY KEY (num)," + |
| | | " UNIQUE KEY water_id_key (water_id) USING BTREE " + |
| | | ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn()); |
| | | try { |
| | | sql.sqlMysqlExecute(sql_str); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | sql.close_con(); |
| | | } |
| | | } |
| | | /** |
| | | * 创建水冷系统分支信息表 |
| | | * @param pool |
| | | */ |
| | | public static void createTb_water_brach(MysqlConnPool pool) { |
| | | String sql_str = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_water_brach + " (" + |
| | | " num bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'," + |
| | | " water_id int(11) NOT NULL DEFAULT '5001' COMMENT '水冷系统id'," + |
| | | " Branch_flow_1 float NOT NULL DEFAULT '0' COMMENT '1#支路流量'," + |
| | | " Branch_flow_2 float NOT NULL DEFAULT '0' COMMENT '2#支路流量'," + |
| | | " Branch_flow_3 float NOT NULL DEFAULT '0' COMMENT '3#支路流量'," + |
| | | " Branch_flow_4 float NOT NULL DEFAULT '0' COMMENT '4#支路流量'," + |
| | | " Branch_flow_5 float NOT NULL DEFAULT '0' COMMENT '5#支路流量'," + |
| | | " Branch_flow_6 float NOT NULL DEFAULT '0' COMMENT '6#支路流量'," + |
| | | " Branch_flow_7 float NOT NULL DEFAULT '0' COMMENT '7#支路流量'," + |
| | | " Branch_flow_8 float NOT NULL DEFAULT '0' COMMENT '8#支路流量'," + |
| | | " Branch_flow_9 float NOT NULL DEFAULT '0' COMMENT '9#支路流量'," + |
| | | " " + |
| | | " Branch_tmp_1 float NOT NULL DEFAULT '0' COMMENT '1#支路温度'," + |
| | | " Branch_tmp_2 float NOT NULL DEFAULT '0' COMMENT '2#支路温度'," + |
| | | " Branch_tmp_3 float NOT NULL DEFAULT '0' COMMENT '3#支路温度'," + |
| | | " Branch_tmp_4 float NOT NULL DEFAULT '0' COMMENT '4#支路温度'," + |
| | | " Branch_tmp_5 float NOT NULL DEFAULT '0' COMMENT '5#支路温度'," + |
| | | " Branch_tmp_6 float NOT NULL DEFAULT '0' COMMENT '6#支路温度'," + |
| | | " Branch_tmp_7 float NOT NULL DEFAULT '0' COMMENT '7#支路温度'," + |
| | | " Branch_tmp_8 float NOT NULL DEFAULT '0' COMMENT '8#支路温度'," + |
| | | " Branch_tmp_9 float NOT NULL DEFAULT '0' COMMENT '9#支路温度'," + |
| | | " " + |
| | | " Branch_pre_1 float NOT NULL DEFAULT '0' COMMENT '1#支路压力'," + |
| | | " Branch_pre_2 float NOT NULL DEFAULT '0' COMMENT '2#支路压力'," + |
| | | " Branch_pre_3 float NOT NULL DEFAULT '0' COMMENT '3#支路压力'," + |
| | | " Branch_pre_4 float NOT NULL DEFAULT '0' COMMENT '4#支路压力'," + |
| | | " Branch_pre_5 float NOT NULL DEFAULT '0' COMMENT '5#支路压力'," + |
| | | " Branch_pre_6 float NOT NULL DEFAULT '0' COMMENT '6#支路压力'," + |
| | | " Branch_pre_7 float NOT NULL DEFAULT '0' COMMENT '7#支路压力'," + |
| | | " Branch_pre_8 float NOT NULL DEFAULT '0' COMMENT '8#支路压力'," + |
| | | " Branch_pre_9 float NOT NULL DEFAULT '0' COMMENT '9#支路压力'," + |
| | | " " + |
| | | " note varchar(255) NOT NULL DEFAULT ''," + |
| | | " PRIMARY KEY (num)," + |
| | | " UNIQUE KEY water_id_key (water_id) USING BTREE " + |
| | | ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn()); |
| | | try { |
| | | sql.sqlMysqlExecute(sql_str); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | sql.close_con(); |
| | | } |
| | | } |
| | | /** |
| | | * 创建水冷系统状态表 |
| | | * @param pool |
| | | */ |
| | | public static void createTb_water_state(MysqlConnPool pool) { |
| | | String sql_str = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_water_state + " (" + |
| | | " num bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'," + |
| | | " water_id int(11) NOT NULL DEFAULT '5001' COMMENT '水冷系统id'," + |
| | | " P01_main_pump int(11) NOT NULL DEFAULT '0' COMMENT 'P01主泵运行'," + |
| | | " P11_replenish_pump int(11) NOT NULL DEFAULT '0' COMMENT 'P11补水泵运行'," + |
| | | " P12_pretest_pump int(11) NOT NULL DEFAULT '0' COMMENT 'P12试压泵运行'," + |
| | | " P13_replenish_pump int(11) NOT NULL DEFAULT '0' COMMENT 'P13补气泵运行'," + |
| | | " H01_electric_heater int(11) NOT NULL DEFAULT '0' COMMENT 'H01电加热器运行'," + |
| | | " H02_electric_heater int(11) NOT NULL DEFAULT '0' COMMENT 'H02电加热器运行'," + |
| | | " Solenoid_openflag int(11) NOT NULL DEFAULT '0' COMMENT '电磁阀开限位'," + |
| | | " Solenoid_shutflag int(11) NOT NULL DEFAULT '0' COMMENT '电磁阀关限位'," + |
| | | " valve_start int(11) NOT NULL DEFAULT '0' COMMENT '阀打开'," + |
| | | " Exhaust_start int(11) NOT NULL DEFAULT '0' COMMENT '排气阀打开'," + |
| | | " remote_start int(11) NOT NULL DEFAULT '0' COMMENT '远程启动水冷系统'," + |
| | | " remote_stop int(11) NOT NULL DEFAULT '0' COMMENT '远程停止水冷系统'," + |
| | | "" + |
| | | " Operation_ooled_devices int(11) NOT NULL DEFAULT '0' COMMENT '被冷却器件投运'," + |
| | | " Auto_control_state int(11) NOT NULL DEFAULT '0' COMMENT '水冷系统自动控制状态'," + |
| | | " Manual_control_state int(11) NOT NULL DEFAULT '0' COMMENT '水冷系统手动控制状态'," + |
| | | " remote_control_state int(11) NOT NULL DEFAULT '0' COMMENT '水冷系统远程控制状态'," + |
| | | " Water_system_function int(11) NOT NULL DEFAULT '0' COMMENT '水冷系统运行'," + |
| | | " note varchar(255) NOT NULL DEFAULT ''," + |
| | | " PRIMARY KEY (num)," + |
| | | " UNIQUE KEY water_id_key (water_id) USING BTREE" + |
| | | ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn()); |
| | | try { |
| | | sql.sqlMysqlExecute(sql_str); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | sql.close_con(); |
| | | } |
| | | } |
| | | /** |
| | | * 初始化数据库表 |
| | | * @param pool |
| | | */ |
| | | public static void init(MysqlConnPool pool) { |
| | | createDB_WaterSystem(pool); |
| | | |
| | | createTb_water_inf(pool); |
| | | |
| | | createTb_water_rt(pool); |
| | | |
| | | createTb_water_brach(pool); |
| | | |
| | | createTb_water_state(pool); |
| | | } |
| | | |
| | | //插入或更新水冷系统实时信息表 |
| | | public static void replace_water_rt(MysqlConnPool pool,Water_rt wrt) { |
| | | String sql_str = " replace into "+ Sql_Mysql.Tb_water_rt+"(water_id,cooling_flow,supply_tmp,Supply_pre,back_tem,back_pre,Cooling_ser,Buffer_tank_level,Buffer_tank_pre,Humidity_chamber,Tem_chamber,External_tmp,External_pre) " |
| | | + " values("+wrt.water_id+","+wrt.cooling_flow+","+wrt.supply_tmp+","+wrt.Supply_pre+","+wrt.back_tem+","+wrt.back_pre+","+wrt.Cooling_ser+","+wrt.Buffer_tank_level+","+wrt.Buffer_tank_pre+","+wrt.Humidity_chamber+","+wrt.Tem_chamber+","+wrt.External_tmp+","+wrt.External_pre+")"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn()); |
| | | try { |
| | | sql.sqlMysqlExecute(sql_str); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | sql.close_con(); |
| | | } |
| | | } |
| | | //插入或更新水冷系统实时分支信息表 |
| | | public static void replace_water_brach(MysqlConnPool pool,Water_brach wbrach) { |
| | | String sql_str = " replace into "+ Sql_Mysql.Tb_water_brach+"(water_id,Branch_flow_1,Branch_flow_2,Branch_flow_3,Branch_flow_4,Branch_flow_5,Branch_flow_6,Branch_flow_7,Branch_flow_8,Branch_flow_9,Branch_tmp_1,Branch_tmp_2,Branch_tmp_3,Branch_tmp_4,Branch_tmp_5,Branch_tmp_6,Branch_tmp_7,Branch_tmp_8,Branch_tmp_9,Branch_pre_1,Branch_pre_2,Branch_pre_3,Branch_pre_4,Branch_pre_5,Branch_pre_6,Branch_pre_7,Branch_pre_8,Branch_pre_9) " |
| | | + " values("+wbrach.water_id+","+wbrach.Branch_flow_1+","+wbrach.Branch_flow_2+","+wbrach.Branch_flow_3+","+wbrach.Branch_flow_4+","+wbrach.Branch_flow_5+","+wbrach.Branch_flow_6+","+wbrach.Branch_flow_7+","+wbrach.Branch_flow_8+","+wbrach.Branch_flow_9 |
| | | +","+wbrach.Branch_tmp_1+","+wbrach.Branch_tmp_2+","+wbrach.Branch_tmp_3+","+wbrach.Branch_tmp_4+","+wbrach.Branch_tmp_5+","+wbrach.Branch_tmp_6+","+wbrach.Branch_tmp_7+","+wbrach.Branch_tmp_8+","+wbrach.Branch_tmp_9 |
| | | +","+wbrach.Branch_pre_1+","+wbrach.Branch_pre_2+","+wbrach.Branch_pre_3+","+wbrach.Branch_pre_4+","+wbrach.Branch_pre_5+","+wbrach.Branch_pre_6+","+wbrach.Branch_pre_7+","+wbrach.Branch_pre_8+","+wbrach.Branch_pre_9+")"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn()); |
| | | try { |
| | | sql.sqlMysqlExecute(sql_str); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | sql.close_con(); |
| | | } |
| | | } |
| | | //插入或更新水冷系统实时信息表 |
| | | public static void replace_water_state(MysqlConnPool pool,Water_state wstate) { |
| | | String sql_str = " replace into "+ Sql_Mysql.Tb_water_state+"(water_id,P01_main_pump,P11_replenish_pump,P12_pretest_pump,P13_replenish_pump,H01_electric_heater,H02_electric_heater,Solenoid_openflag,Solenoid_shutflag,valve_start,Exhaust_start,remote_start,remote_stop,Operation_ooled_devices,Auto_control_state,Manual_control_state,remote_control_state,Water_system_function) " |
| | | + " values("+wstate.water_id+","+wstate.P01_main_pump+","+wstate.P11_replenish_pump+","+wstate.P12_pretest_pump+","+wstate.P13_replenish_pump+","+wstate.H01_electric_heater+","+wstate.H02_electric_heater+","+wstate.Solenoid_openflag+","+wstate.Solenoid_shutflag+","+wstate.valve_start+","+wstate.Exhaust_start+","+wstate.remote_start+","+wstate.remote_stop |
| | | +","+wstate.Operation_ooled_devices+","+wstate.Auto_control_state+","+wstate.Manual_control_state+","+wstate.remote_control_state+","+wstate.Water_system_function+")"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn()); |
| | | try { |
| | | sql.sqlMysqlExecute(sql_str); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | sql.close_con(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.watersystem.monitor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class Water_brach implements Serializable{ |
| | | public int num;//'主键', |
| | | public int water_id;//'水冷系统id', |
| | | public float Branch_flow_1;//'1#支路流量', |
| | | public float Branch_flow_2;//'2#支路流量', |
| | | public float Branch_flow_3;//'3#支路流量', |
| | | public float Branch_flow_4;//'4#支路流量', |
| | | public float Branch_flow_5;//'5#支路流量', |
| | | public float Branch_flow_6;//'6#支路流量', |
| | | public float Branch_flow_7;//'7#支路流量', |
| | | public float Branch_flow_8;//'8#支路流量', |
| | | public float Branch_flow_9;//'9#支路流量', |
| | | |
| | | public float Branch_tmp_1;//'1#支路温度', |
| | | public float Branch_tmp_2;//'2#支路温度', |
| | | public float Branch_tmp_3;//'3#支路温度', |
| | | public float Branch_tmp_4;//'4#支路温度', |
| | | public float Branch_tmp_5;//'5#支路温度', |
| | | public float Branch_tmp_6;//'6#支路温度', |
| | | public float Branch_tmp_7;//'7#支路温度', |
| | | public float Branch_tmp_8;//'8#支路温度', |
| | | public float Branch_tmp_9;//'9#支路温度', |
| | | |
| | | public float Branch_pre_1;//'1#支路压力', |
| | | public float Branch_pre_2;//'2#支路压力', |
| | | public float Branch_pre_3;//'3#支路压力', |
| | | public float Branch_pre_4;//'4#支路压力', |
| | | public float Branch_pre_5;//'5#支路压力', |
| | | public float Branch_pre_6;//'6#支路压力', |
| | | public float Branch_pre_7;//'7#支路压力', |
| | | public float Branch_pre_8;//'8#支路压力', |
| | | public float Branch_pre_9;//'9#支路压力', |
| | | |
| | | public String note;// |
| | | |
| | | |
| | | |
| | | public Water_brach(int water_id) { |
| | | super(); |
| | | this.water_id = water_id; |
| | | } |
| | | |
| | | public int getNum() { |
| | | return num; |
| | | } |
| | | |
| | | public void setNum(int num) { |
| | | this.num = num; |
| | | } |
| | | |
| | | public int getWater_id() { |
| | | return water_id; |
| | | } |
| | | |
| | | public void setWater_id(int water_id) { |
| | | this.water_id = water_id; |
| | | } |
| | | |
| | | public float getBranch_flow_1() { |
| | | return Branch_flow_1; |
| | | } |
| | | |
| | | public void setBranch_flow_1(float branch_flow_1) { |
| | | Branch_flow_1 = branch_flow_1; |
| | | } |
| | | |
| | | public float getBranch_flow_2() { |
| | | return Branch_flow_2; |
| | | } |
| | | |
| | | public void setBranch_flow_2(float branch_flow_2) { |
| | | Branch_flow_2 = branch_flow_2; |
| | | } |
| | | |
| | | public float getBranch_flow_3() { |
| | | return Branch_flow_3; |
| | | } |
| | | |
| | | public void setBranch_flow_3(float branch_flow_3) { |
| | | Branch_flow_3 = branch_flow_3; |
| | | } |
| | | |
| | | public float getBranch_flow_4() { |
| | | return Branch_flow_4; |
| | | } |
| | | |
| | | public void setBranch_flow_4(float branch_flow_4) { |
| | | Branch_flow_4 = branch_flow_4; |
| | | } |
| | | |
| | | public float getBranch_flow_5() { |
| | | return Branch_flow_5; |
| | | } |
| | | |
| | | public void setBranch_flow_5(float branch_flow_5) { |
| | | Branch_flow_5 = branch_flow_5; |
| | | } |
| | | |
| | | public float getBranch_flow_6() { |
| | | return Branch_flow_6; |
| | | } |
| | | |
| | | public void setBranch_flow_6(float branch_flow_6) { |
| | | Branch_flow_6 = branch_flow_6; |
| | | } |
| | | |
| | | public float getBranch_flow_7() { |
| | | return Branch_flow_7; |
| | | } |
| | | |
| | | public void setBranch_flow_7(float branch_flow_7) { |
| | | Branch_flow_7 = branch_flow_7; |
| | | } |
| | | |
| | | public float getBranch_flow_8() { |
| | | return Branch_flow_8; |
| | | } |
| | | |
| | | public void setBranch_flow_8(float branch_flow_8) { |
| | | Branch_flow_8 = branch_flow_8; |
| | | } |
| | | |
| | | public float getBranch_flow_9() { |
| | | return Branch_flow_9; |
| | | } |
| | | |
| | | public void setBranch_flow_9(float branch_flow_9) { |
| | | Branch_flow_9 = branch_flow_9; |
| | | } |
| | | |
| | | public float getBranch_tmp_1() { |
| | | return Branch_tmp_1; |
| | | } |
| | | |
| | | public void setBranch_tmp_1(float branch_tmp_1) { |
| | | Branch_tmp_1 = branch_tmp_1; |
| | | } |
| | | |
| | | public float getBranch_tmp_2() { |
| | | return Branch_tmp_2; |
| | | } |
| | | |
| | | public void setBranch_tmp_2(float branch_tmp_2) { |
| | | Branch_tmp_2 = branch_tmp_2; |
| | | } |
| | | |
| | | public float getBranch_tmp_3() { |
| | | return Branch_tmp_3; |
| | | } |
| | | |
| | | public void setBranch_tmp_3(float branch_tmp_3) { |
| | | Branch_tmp_3 = branch_tmp_3; |
| | | } |
| | | |
| | | public float getBranch_tmp_4() { |
| | | return Branch_tmp_4; |
| | | } |
| | | |
| | | public void setBranch_tmp_4(float branch_tmp_4) { |
| | | Branch_tmp_4 = branch_tmp_4; |
| | | } |
| | | |
| | | public float getBranch_tmp_5() { |
| | | return Branch_tmp_5; |
| | | } |
| | | |
| | | public void setBranch_tmp_5(float branch_tmp_5) { |
| | | Branch_tmp_5 = branch_tmp_5; |
| | | } |
| | | |
| | | public float getBranch_tmp_6() { |
| | | return Branch_tmp_6; |
| | | } |
| | | |
| | | public void setBranch_tmp_6(float branch_tmp_6) { |
| | | Branch_tmp_6 = branch_tmp_6; |
| | | } |
| | | |
| | | public float getBranch_tmp_7() { |
| | | return Branch_tmp_7; |
| | | } |
| | | |
| | | public void setBranch_tmp_7(float branch_tmp_7) { |
| | | Branch_tmp_7 = branch_tmp_7; |
| | | } |
| | | |
| | | public float getBranch_tmp_8() { |
| | | return Branch_tmp_8; |
| | | } |
| | | |
| | | public void setBranch_tmp_8(float branch_tmp_8) { |
| | | Branch_tmp_8 = branch_tmp_8; |
| | | } |
| | | |
| | | public float getBranch_tmp_9() { |
| | | return Branch_tmp_9; |
| | | } |
| | | |
| | | public void setBranch_tmp_9(float branch_tmp_9) { |
| | | Branch_tmp_9 = branch_tmp_9; |
| | | } |
| | | |
| | | public float getBranch_pre_1() { |
| | | return Branch_pre_1; |
| | | } |
| | | |
| | | public void setBranch_pre_1(float branch_pre_1) { |
| | | Branch_pre_1 = branch_pre_1; |
| | | } |
| | | |
| | | public float getBranch_pre_2() { |
| | | return Branch_pre_2; |
| | | } |
| | | |
| | | public void setBranch_pre_2(float branch_pre_2) { |
| | | Branch_pre_2 = branch_pre_2; |
| | | } |
| | | |
| | | public float getBranch_pre_3() { |
| | | return Branch_pre_3; |
| | | } |
| | | |
| | | public void setBranch_pre_3(float branch_pre_3) { |
| | | Branch_pre_3 = branch_pre_3; |
| | | } |
| | | |
| | | public float getBranch_pre_4() { |
| | | return Branch_pre_4; |
| | | } |
| | | |
| | | public void setBranch_pre_4(float branch_pre_4) { |
| | | Branch_pre_4 = branch_pre_4; |
| | | } |
| | | |
| | | public float getBranch_pre_5() { |
| | | return Branch_pre_5; |
| | | } |
| | | |
| | | public void setBranch_pre_5(float branch_pre_5) { |
| | | Branch_pre_5 = branch_pre_5; |
| | | } |
| | | |
| | | public float getBranch_pre_6() { |
| | | return Branch_pre_6; |
| | | } |
| | | |
| | | public void setBranch_pre_6(float branch_pre_6) { |
| | | Branch_pre_6 = branch_pre_6; |
| | | } |
| | | |
| | | public float getBranch_pre_7() { |
| | | return Branch_pre_7; |
| | | } |
| | | |
| | | public void setBranch_pre_7(float branch_pre_7) { |
| | | Branch_pre_7 = branch_pre_7; |
| | | } |
| | | |
| | | public float getBranch_pre_8() { |
| | | return Branch_pre_8; |
| | | } |
| | | |
| | | public void setBranch_pre_8(float branch_pre_8) { |
| | | Branch_pre_8 = branch_pre_8; |
| | | } |
| | | |
| | | public float getBranch_pre_9() { |
| | | return Branch_pre_9; |
| | | } |
| | | |
| | | public void setBranch_pre_9(float branch_pre_9) { |
| | | Branch_pre_9 = branch_pre_9; |
| | | } |
| | | |
| | | public String getNote() { |
| | | return note; |
| | | } |
| | | |
| | | public void setNote(String note) { |
| | | this.note = note; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Water_brach [num=" + num + ", water_id=" + water_id + ", Branch_flow_1=" + Branch_flow_1 |
| | | + ", Branch_flow_2=" + Branch_flow_2 + ", Branch_flow_3=" + Branch_flow_3 + ", Branch_flow_4=" |
| | | + Branch_flow_4 + ", Branch_flow_5=" + Branch_flow_5 + ", Branch_flow_6=" + Branch_flow_6 |
| | | + ", Branch_flow_7=" + Branch_flow_7 + ", Branch_flow_8=" + Branch_flow_8 + ", Branch_flow_9=" |
| | | + Branch_flow_9 + ", Branch_tmp_1=" + Branch_tmp_1 + ", Branch_tmp_2=" + Branch_tmp_2 |
| | | + ", Branch_tmp_3=" + Branch_tmp_3 + ", Branch_tmp_4=" + Branch_tmp_4 + ", Branch_tmp_5=" + Branch_tmp_5 |
| | | + ", Branch_tmp_6=" + Branch_tmp_6 + ", Branch_tmp_7=" + Branch_tmp_7 + ", Branch_tmp_8=" + Branch_tmp_8 |
| | | + ", Branch_tmp_9=" + Branch_tmp_9 + ", Branch_pre_1=" + Branch_pre_1 + ", Branch_pre_2=" + Branch_pre_2 |
| | | + ", Branch_pre_3=" + Branch_pre_3 + ", Branch_pre_4=" + Branch_pre_4 + ", Branch_pre_5=" + Branch_pre_5 |
| | | + ", Branch_pre_6=" + Branch_pre_6 + ", Branch_pre_7=" + Branch_pre_7 + ", Branch_pre_8=" + Branch_pre_8 |
| | | + ", Branch_pre_9=" + Branch_pre_9 + ", note=" + note + "]"; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.watersystem.monitor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class Water_inf implements Serializable{ |
| | | public int num;//'主键', |
| | | public int water_id ;// '水冷系统id', |
| | | public String water_name ;// '水冷系统名称', |
| | | public int water_type;// '水冷系统类型(备用)', |
| | | public String water_ip;// '水冷系统ip(重要)', |
| | | public String note;// |
| | | public int getNum() { |
| | | return num; |
| | | } |
| | | public void setNum(int num) { |
| | | this.num = num; |
| | | } |
| | | public int getWater_id() { |
| | | return water_id; |
| | | } |
| | | public void setWater_id(int water_id) { |
| | | this.water_id = water_id; |
| | | } |
| | | public String getWater_name() { |
| | | return water_name; |
| | | } |
| | | public void setWater_name(String water_name) { |
| | | this.water_name = water_name; |
| | | } |
| | | public int getWater_type() { |
| | | return water_type; |
| | | } |
| | | public void setWater_type(int water_type) { |
| | | this.water_type = water_type; |
| | | } |
| | | public String getWater_ip() { |
| | | return water_ip; |
| | | } |
| | | public void setWater_ip(String water_ip) { |
| | | this.water_ip = water_ip; |
| | | } |
| | | public String getNote() { |
| | | return note; |
| | | } |
| | | public void setNote(String note) { |
| | | this.note = note; |
| | | } |
| | | @Override |
| | | public String toString() { |
| | | return "Water_inf [num=" + num + ", water_id=" + water_id + ", water_name=" + water_name + ", water_type=" |
| | | + water_type + ", water_ip=" + water_ip + ", note=" + note + "]"; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.watersystem.monitor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class Water_rt implements Serializable{ |
| | | public int num;//'主键', |
| | | public int water_id ;//'水冷系统id', |
| | | public float cooling_flow;//'冷却水流量', |
| | | public float supply_tmp;//'供水温度', |
| | | public float Supply_pre;//'供水压力', |
| | | public float back_tem;//'回水温度', |
| | | public float back_pre;//'回水压力', |
| | | public float Cooling_ser;//'冷却水电导率', |
| | | public float Buffer_tank_level;//'缓冲罐液位', |
| | | public float Buffer_tank_pre;//'缓冲罐压力', |
| | | public float Humidity_chamber;//'阀厅湿度', |
| | | public float Tem_chamber;//'阀厅温度', |
| | | public float External_tmp;//'外水温度', |
| | | public float External_pre;//'外水压力', |
| | | public String note;// |
| | | |
| | | public Water_rt(int water_id) { |
| | | super(); |
| | | this.water_id = water_id; |
| | | } |
| | | public int getNum() { |
| | | return num; |
| | | } |
| | | public void setNum(int num) { |
| | | this.num = num; |
| | | } |
| | | public int getWater_id() { |
| | | return water_id; |
| | | } |
| | | public void setWater_id(int water_id) { |
| | | this.water_id = water_id; |
| | | } |
| | | public float getCooling_flow() { |
| | | return cooling_flow; |
| | | } |
| | | public void setCooling_flow(float cooling_flow) { |
| | | this.cooling_flow = cooling_flow; |
| | | } |
| | | public float getSupply_tmp() { |
| | | return supply_tmp; |
| | | } |
| | | public void setSupply_tmp(float supply_tmp) { |
| | | this.supply_tmp = supply_tmp; |
| | | } |
| | | public float getSupply_pre() { |
| | | return Supply_pre; |
| | | } |
| | | public void setSupply_pre(float supply_pre) { |
| | | Supply_pre = supply_pre; |
| | | } |
| | | public float getBack_tem() { |
| | | return back_tem; |
| | | } |
| | | public void setBack_tem(float back_tem) { |
| | | this.back_tem = back_tem; |
| | | } |
| | | public float getBack_pre() { |
| | | return back_pre; |
| | | } |
| | | public void setBack_pre(float back_pre) { |
| | | this.back_pre = back_pre; |
| | | } |
| | | public float getCooling_ser() { |
| | | return Cooling_ser; |
| | | } |
| | | public void setCooling_ser(float cooling_ser) { |
| | | Cooling_ser = cooling_ser; |
| | | } |
| | | public float getBuffer_tank_level() { |
| | | return Buffer_tank_level; |
| | | } |
| | | public void setBuffer_tank_level(float buffer_tank_level) { |
| | | Buffer_tank_level = buffer_tank_level; |
| | | } |
| | | public float getBuffer_tank_pre() { |
| | | return Buffer_tank_pre; |
| | | } |
| | | public void setBuffer_tank_pre(float buffer_tank_pre) { |
| | | Buffer_tank_pre = buffer_tank_pre; |
| | | } |
| | | public float getHumidity_chamber() { |
| | | return Humidity_chamber; |
| | | } |
| | | public void setHumidity_chamber(float humidity_chamber) { |
| | | Humidity_chamber = humidity_chamber; |
| | | } |
| | | public float getTem_chamber() { |
| | | return Tem_chamber; |
| | | } |
| | | public void setTem_chamber(float tem_chamber) { |
| | | Tem_chamber = tem_chamber; |
| | | } |
| | | public float getExternal_tmp() { |
| | | return External_tmp; |
| | | } |
| | | public void setExternal_tmp(float external_tmp) { |
| | | External_tmp = external_tmp; |
| | | } |
| | | public float getExternal_pre() { |
| | | return External_pre; |
| | | } |
| | | public void setExternal_pre(float external_pre) { |
| | | External_pre = external_pre; |
| | | } |
| | | public String getNote() { |
| | | return note; |
| | | } |
| | | public void setNote(String note) { |
| | | this.note = note; |
| | | } |
| | | @Override |
| | | public String toString() { |
| | | return "Water_rt [num=" + num + ", water_id=" + water_id + ", cooling_flow=" + cooling_flow + ", supply_tmp=" |
| | | + supply_tmp + ", Supply_pre=" + Supply_pre + ", back_tem=" + back_tem + ", back_pre=" + back_pre |
| | | + ", Cooling_ser=" + Cooling_ser + ", Buffer_tank_level=" + Buffer_tank_level + ", Buffer_tank_pre=" |
| | | + Buffer_tank_pre + ", Humidity_chamber=" + Humidity_chamber + ", Tem_chamber=" + Tem_chamber |
| | | + ", External_tmp=" + External_tmp + ", External_pre=" + External_pre + ", note=" + note + "]"; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.watersystem.monitor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class Water_state implements Serializable{ |
| | | public int num;//'主键', |
| | | public int water_id;//'水冷系统id', |
| | | public int P01_main_pump;//'P01主泵运行', |
| | | public int P11_replenish_pump;//'P11补水泵运行', |
| | | public int P12_pretest_pump;//'P12试压泵运行', |
| | | public int P13_replenish_pump;//'P13补气泵运行', |
| | | public int H01_electric_heater;//'H01电加热器运行', |
| | | public int H02_electric_heater;//'H02电加热器运行', |
| | | public int Solenoid_openflag;//'电磁阀开限位', |
| | | public int Solenoid_shutflag;//'电磁阀关限位', |
| | | public int valve_start;//'阀打开', |
| | | public int Exhaust_start;//'排气阀打开', |
| | | public int remote_start;//'远程启动水冷系统', |
| | | public int remote_stop;//'远程停止水冷系统', |
| | | |
| | | public int Operation_ooled_devices;//'被冷却器件投运', |
| | | |
| | | public int Auto_control_state;//'水冷系统自动控制状态', |
| | | public int Manual_control_state;//'水冷系统手动控制状态', |
| | | public int remote_control_state;//'水冷系统远程控制状态', |
| | | public int Water_system_function;//'水冷系统运行', |
| | | public String note;// |
| | | |
| | | public Water_state(int water_id) { |
| | | super(); |
| | | this.water_id = water_id; |
| | | } |
| | | public int getNum() { |
| | | return num; |
| | | } |
| | | public void setNum(int num) { |
| | | this.num = num; |
| | | } |
| | | public int getWater_id() { |
| | | return water_id; |
| | | } |
| | | public void setWater_id(int water_id) { |
| | | this.water_id = water_id; |
| | | } |
| | | public int getP01_main_pump() { |
| | | return P01_main_pump; |
| | | } |
| | | public void setP01_main_pump(int p01_main_pump) { |
| | | P01_main_pump = p01_main_pump; |
| | | } |
| | | public int getP11_replenish_pump() { |
| | | return P11_replenish_pump; |
| | | } |
| | | public void setP11_replenish_pump(int p11_replenish_pump) { |
| | | P11_replenish_pump = p11_replenish_pump; |
| | | } |
| | | public int getP12_pretest_pump() { |
| | | return P12_pretest_pump; |
| | | } |
| | | public void setP12_pretest_pump(int p12_pretest_pump) { |
| | | P12_pretest_pump = p12_pretest_pump; |
| | | } |
| | | public int getP13_replenish_pump() { |
| | | return P13_replenish_pump; |
| | | } |
| | | public void setP13_replenish_pump(int p13_replenish_pump) { |
| | | P13_replenish_pump = p13_replenish_pump; |
| | | } |
| | | public int getH01_electric_heater() { |
| | | return H01_electric_heater; |
| | | } |
| | | public void setH01_electric_heater(int h01_electric_heater) { |
| | | H01_electric_heater = h01_electric_heater; |
| | | } |
| | | public int getH02_electric_heater() { |
| | | return H02_electric_heater; |
| | | } |
| | | public void setH02_electric_heater(int h02_electric_heater) { |
| | | H02_electric_heater = h02_electric_heater; |
| | | } |
| | | |
| | | public int getExhaust_start() { |
| | | return Exhaust_start; |
| | | } |
| | | public void setExhaust_start(int exhaust_start) { |
| | | Exhaust_start = exhaust_start; |
| | | } |
| | | public int getRemote_start() { |
| | | return remote_start; |
| | | } |
| | | public void setRemote_start(int remote_start) { |
| | | this.remote_start = remote_start; |
| | | } |
| | | public int getRemote_stop() { |
| | | return remote_stop; |
| | | } |
| | | public void setRemote_stop(int remote_stop) { |
| | | this.remote_stop = remote_stop; |
| | | } |
| | | public int getOperation_ooled_devices() { |
| | | return Operation_ooled_devices; |
| | | } |
| | | public void setOperation_ooled_devices(int operation_ooled_devices) { |
| | | Operation_ooled_devices = operation_ooled_devices; |
| | | } |
| | | public int getAuto_control_state() { |
| | | return Auto_control_state; |
| | | } |
| | | public void setAuto_control_state(int auto_control_state) { |
| | | Auto_control_state = auto_control_state; |
| | | } |
| | | public int getManual_control_state() { |
| | | return Manual_control_state; |
| | | } |
| | | public void setManual_control_state(int manual_control_state) { |
| | | Manual_control_state = manual_control_state; |
| | | } |
| | | public int getRemote_control_state() { |
| | | return remote_control_state; |
| | | } |
| | | public void setRemote_control_state(int remote_control_state) { |
| | | this.remote_control_state = remote_control_state; |
| | | } |
| | | public int getWater_system_function() { |
| | | return Water_system_function; |
| | | } |
| | | public void setWater_system_function(int water_system_function) { |
| | | Water_system_function = water_system_function; |
| | | } |
| | | public String getNote() { |
| | | return note; |
| | | } |
| | | public void setNote(String note) { |
| | | this.note = note; |
| | | } |
| | | public int getSolenoid_openflag() { |
| | | return Solenoid_openflag; |
| | | } |
| | | public void setSolenoid_openflag(int solenoid_openflag) { |
| | | Solenoid_openflag = solenoid_openflag; |
| | | } |
| | | public int getSolenoid_shutflag() { |
| | | return Solenoid_shutflag; |
| | | } |
| | | public void setSolenoid_shutflag(int solenoid_shutflag) { |
| | | Solenoid_shutflag = solenoid_shutflag; |
| | | } |
| | | public int getValve_start() { |
| | | return valve_start; |
| | | } |
| | | public void setValve_start(int valve_start) { |
| | | this.valve_start = valve_start; |
| | | } |
| | | @Override |
| | | public String toString() { |
| | | return "Water_state [num=" + num + ", water_id=" + water_id + ", P01_main_pump=" + P01_main_pump |
| | | + ", P11_replenish_pump=" + P11_replenish_pump + ", P12_pretest_pump=" + P12_pretest_pump |
| | | + ", P13_replenish_pump=" + P13_replenish_pump + ", H01_electric_heater=" + H01_electric_heater |
| | | + ", H02_electric_heater=" + H02_electric_heater + ", Solenoid_openflag=" + Solenoid_openflag |
| | | + ", Solenoid_shutflag=" + Solenoid_shutflag + ", valve_start=" + valve_start + ", Exhaust_start=" |
| | | + Exhaust_start + ", remote_start=" + remote_start + ", remote_stop=" + remote_stop |
| | | + ", Operation_ooled_devices=" + Operation_ooled_devices + ", Auto_control_state=" + Auto_control_state |
| | | + ", Manual_control_state=" + Manual_control_state + ", remote_control_state=" + remote_control_state |
| | | + ", Water_system_function=" + Water_system_function + ", note=" + note + "]"; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.watersystem.monitor; |
| | | |
| | | public class Watersystem_ModbusAddress { |
| | | |
| | | //获取水冷系统的地址 |
| | | public static int Cooling_flow=1250;//冷却水流量 |
| | | public static int Supply_tmp=1251;//供水温度 |
| | | public static int Supply_pre=1252;//供水压力 |
| | | public static int back_tem=1253;//回水温度 |
| | | public static int back_pre=1254;//回水压力 |
| | | public static int Cooling_ser=1255;//冷却水电导率 |
| | | public static int Buffer_tank_level=1256;//缓冲罐液位 |
| | | public static int Buffer_tank_pre=1257;//缓冲罐压力 |
| | | public static int Humidity_chamber=1258;//阀厅湿度 |
| | | public static int Tem_chamber=1259;//阀厅温度 |
| | | |
| | | public static int External_tmp=1260;//外水温度 |
| | | public static int External_pre=1261;//外水压力 |
| | | |
| | | public static int Branch_flow_1=1262;//1#支路流量 |
| | | public static int Branch_flow_2=1263;//2#支路流量 |
| | | public static int Branch_flow_3=1264;//3#支路流量 |
| | | public static int Branch_flow_4=1265;//4#支路流量 |
| | | public static int Branch_flow_5=1266;//5#支路流量 |
| | | public static int Branch_flow_6=1267;//6#支路流量 |
| | | public static int Branch_flow_7=1268;//7#支路流量 |
| | | public static int Branch_flow_8=1269;//8#支路流量 |
| | | public static int Branch_flow_9=1270;//9#支路流量 |
| | | |
| | | public static int Branch_tmp_1=1271;//1#支路温度 |
| | | public static int Branch_tmp_2=1272;//2#支路温度 |
| | | public static int Branch_tmp_3=1273;//3#支路温度 |
| | | public static int Branch_tmp_4=1274;//4#支路温度 |
| | | public static int Branch_tmp_5=1275;//5#支路温度 |
| | | public static int Branch_tmp_6=1276;//6#支路温度 |
| | | public static int Branch_tmp_7=1277;//7#支路温度 |
| | | public static int Branch_tmp_8=1278;//8#支路温度 |
| | | public static int Branch_tmp_9=1279;//9#支路温度 |
| | | |
| | | public static int Branch_pre_1=1280;//1#支路压力 |
| | | public static int Branch_pre_2=1281;//2#支路压力 |
| | | public static int Branch_pre_3=1282;//3#支路压力 |
| | | public static int Branch_pre_4=1283;//4#支路压力 |
| | | public static int Branch_pre_5=1284;//5#支路压力 |
| | | public static int Branch_pre_6=1285;//6#支路压力 |
| | | public static int Branch_pre_7=1286;//7#支路压力 |
| | | public static int Branch_pre_8=1287;//8#支路压力 |
| | | public static int Branch_pre_9=1288;//9#支路压力 |
| | | |
| | | public static int Watersystem_All_Operation=1291;//水冷系统各部件运行情况 |
| | | public static int Watersystem_All_State=1292;//'水冷系统自动控制状态', |
| | | public static int Watersystem_Operation_Fault=1293;//冷却系统各部件故障信息 |
| | | public static int Watersystem_BranchFlowTmp_Fault=1294;//冷却系统支路流量/温度故障信息 |
| | | public static int Watersystem_Pre_Fault=1295;//冷却水压力故障 |
| | | public static int Watersystem_Operation_highorlow=1296;//冷却系统各部件低/高 |
| | | public static int Watersystem_Tmp_highorlow=1297;//冷却系统温度高/超高 |
| | | public static int Watersystem_TmpFlow_highorlow=1298;//冷却系统支路温度/流量低/超低 |
| | | public static int Watersystem_Flow_ighorlow=1299;//冷却水部分支路流量低/超低 |
| | | |
| | | } |
New file |
| | |
| | | package com.watersystem.monitor; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.base.Com; |
| | | import com.sql.MysqlConnPool; |
| | | |
| | | public class Watersystem_ServerSocket_Thread implements Runnable{ |
| | | public List<Water_inf> winfs; |
| | | public MysqlConnPool conn_pool; |
| | | public Map<Integer, Watersystem_SocketClient_Thread> winfthreads; |
| | | |
| | | public Watersystem_ServerSocket_Thread(MysqlConnPool conn_pool,List<Water_inf> winfs) { |
| | | this.winfs = winfs; |
| | | this.conn_pool = conn_pool; |
| | | this.winfthreads = new HashMap<Integer,Watersystem_SocketClient_Thread>(); |
| | | } |
| | | |
| | | @Override |
| | | public void run() { |
| | | // TODO Auto-generated method stub |
| | | System.out.println(" Watersystem_ServerSocket_Thread Start at " +Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)); |
| | | for(int i = 0;i<winfs.size();i++) { |
| | | //插入或更新水冷系统实时信息表 |
| | | Water_Task_SQL.replace_water_rt(conn_pool, new Water_rt(winfs.get(i).getWater_id())); |
| | | //插入或更新水冷系统分支实时信息表 |
| | | Water_Task_SQL.replace_water_brach(conn_pool, new Water_brach(winfs.get(i).getWater_id())); |
| | | //插入或更新水冷系统实时状态表 |
| | | Water_Task_SQL.replace_water_state(conn_pool, new Water_state(winfs.get(i).getWater_id())); |
| | | |
| | | Watersystem_SocketClient_Thread thread = new Watersystem_SocketClient_Thread(winfs.get(i),conn_pool); |
| | | winfthreads.put(winfs.get(i).water_id, thread); |
| | | new Thread(thread).start(); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.watersystem.monitor; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.modbus.data.MyModbusMaster; |
| | | import com.modbus.data.MyModbusUtils; |
| | | import com.serotonin.modbus4j.code.DataType; |
| | | import com.sql.MysqlConnPool; |
| | | |
| | | public class Watersystem_SocketClient_Thread implements Runnable{ |
| | | public MysqlConnPool conn_pool; |
| | | public Water_inf winf; |
| | | |
| | | public Water_rt wrt; |
| | | public Water_brach wbrach; |
| | | public Water_state wstate; |
| | | |
| | | public MyModbusMaster master; |
| | | |
| | | //public static final int MAX_READALARM_COUNT = 20; //一次读取告警节点的最大数量 |
| | | //public int read_alarm_index = 0; //读取告警索引 |
| | | |
| | | public Watersystem_SocketClient_Thread(Water_inf winf,MysqlConnPool conn_pool) { |
| | | this.conn_pool = conn_pool; |
| | | this.winf = winf; |
| | | |
| | | wrt = new Water_rt(winf.getWater_id()); |
| | | wstate = new Water_state(winf.getWater_id()); |
| | | wbrach = new Water_brach(winf.getWater_id()); |
| | | master = new MyModbusMaster(winf.getWater_ip(), MyModbusMaster.SLAVEID_DEFAULT); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void run() { |
| | | int runCount = 0; |
| | | while(true) { |
| | | try { |
| | | |
| | | if(runCount %2 == 0) { |
| | | //*************************** 更新水冷系统实时信息******************************//* |
| | | readWater_rt(master,wrt); |
| | | Water_Task_SQL.replace_water_rt(conn_pool, wrt); |
| | | |
| | | //**************************** 更新水冷系统分支实时信息 *****************************//* |
| | | readWater_brach(master,wbrach); |
| | | Water_Task_SQL.replace_water_brach(conn_pool, wbrach); |
| | | |
| | | //**************************** 更新水冷系统状态信息 *****************************//* |
| | | readWater_state(master,wstate); |
| | | Water_Task_SQL.replace_water_state(conn_pool, wstate); |
| | | |
| | | } |
| | | |
| | | if(runCount %4 == 0) { |
| | | //*************************** 读取水冷信息故障 ******************************//* |
| | | //Date start = new Date(); |
| | | //readElectricalAlarmData(master,eAlarm); |
| | | //Electrical_Task_SQL.inswrtOrUpdateElectrical_alarmTable(conn_pool, listAlarm); |
| | | //Date end = new Date(); |
| | | //System.out.println((end.getTime()-start.getTime())/1000); |
| | | } |
| | | |
| | | if(runCount%10 == 0) { |
| | | //更新当前设备ip |
| | | master.setTarget_ip(winf.water_ip); |
| | | } |
| | | if(runCount > 999900) { |
| | | runCount = 0; |
| | | } |
| | | runCount ++; |
| | | Thread.sleep(200); |
| | | } catch (Exception e) { |
| | | try { |
| | | Thread.sleep(1000); |
| | | } catch (InterruptedException e1) { |
| | | //e1.printStackTrace(); |
| | | } |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 更新水冷系统实时信息 |
| | | * @param master |
| | | * @param load_state |
| | | */ |
| | | private void readWater_rt(MyModbusMaster master, Water_rt wrt) { |
| | | wrt.cooling_flow = (float) master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Cooling_flow, DataType.TWO_BYTE_INT_SIGNED, master), wrt.cooling_flow); //'冷却水流量', |
| | | wrt.supply_tmp = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Supply_tmp, DataType.TWO_BYTE_INT_SIGNED, master), wrt.supply_tmp); //'供水温度', |
| | | wrt.Supply_pre = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Supply_pre, DataType.TWO_BYTE_INT_SIGNED,master), wrt.Supply_pre); //'供水压力', |
| | | wrt.back_tem = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.back_tem, DataType.TWO_BYTE_INT_SIGNED,master), wrt.back_tem); //'回水温度', |
| | | wrt.back_pre = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.back_pre, DataType.TWO_BYTE_INT_SIGNED,master), wrt.back_pre); //'回水压力', |
| | | wrt.Cooling_ser = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Cooling_ser,DataType.TWO_BYTE_INT_SIGNED,master), wrt.Cooling_ser); //'冷却水电导率', |
| | | wrt.Buffer_tank_level = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Buffer_tank_level,DataType.TWO_BYTE_INT_SIGNED,master), wrt.Buffer_tank_level);//'缓冲罐液位' |
| | | wrt.Buffer_tank_pre = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Buffer_tank_pre, DataType.TWO_BYTE_INT_SIGNED,master), wrt.Buffer_tank_pre); //'缓冲罐压力', |
| | | wrt.Humidity_chamber = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Humidity_chamber, DataType.TWO_BYTE_INT_SIGNED,master), wrt.Humidity_chamber);//'阀厅湿度', |
| | | wrt.Tem_chamber = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Tem_chamber,DataType.TWO_BYTE_INT_SIGNED, master), wrt.Tem_chamber); //'阀厅温度', |
| | | wrt.External_tmp = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.External_tmp,DataType.TWO_BYTE_INT_SIGNED, master), wrt.External_tmp); //'外水温度', |
| | | wrt.External_pre = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.External_pre, DataType.TWO_BYTE_INT_SIGNED, master), wrt.External_pre);//'外水压力', |
| | | } |
| | | /* 更新电源实时信息 |
| | | * @param master |
| | | * @param load_state |
| | | */ |
| | | private void readWater_brach(MyModbusMaster master, Water_brach wbrach) { |
| | | wbrach.Branch_flow_1 = (float) master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress. Branch_flow_1, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_flow_1); //'1#支路流量', |
| | | wbrach.Branch_flow_2 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_flow_2, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_flow_2); //'2#支路流量', |
| | | wbrach.Branch_flow_3 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress. Branch_flow_3, DataType.TWO_BYTE_INT_SIGNED,master), wbrach.Branch_flow_3); //'3#支路流量', |
| | | wbrach.Branch_flow_4 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress. Branch_flow_4, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_flow_4); //'4#支路流量', |
| | | wbrach.Branch_flow_5 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_flow_5, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_flow_5); //'5#支路流量', |
| | | wbrach.Branch_flow_6= (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_flow_6, DataType.TWO_BYTE_INT_SIGNED,master), wbrach.Branch_flow_6); //'6#支路流量', |
| | | wbrach.Branch_flow_7 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_flow_7, DataType.TWO_BYTE_INT_SIGNED,master), wbrach.Branch_flow_7); //'7#支路流量', |
| | | wbrach.Branch_flow_8 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_flow_8, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_flow_8); //'8#支路流量', |
| | | wbrach.Branch_flow_9 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_flow_9, DataType.TWO_BYTE_INT_SIGNED,master), wbrach.Branch_flow_9); //'9#支路流量', |
| | | |
| | | wbrach.Branch_tmp_1 = (float) master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress. Branch_tmp_1, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_tmp_1); //'1#支路温度', |
| | | wbrach.Branch_tmp_2 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_tmp_2, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_tmp_2); //'2#支路温度', |
| | | wbrach.Branch_tmp_3 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress. Branch_tmp_3, DataType.TWO_BYTE_INT_SIGNED,master), wbrach.Branch_tmp_3); //'3#支路温度', |
| | | wbrach.Branch_tmp_4 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress. Branch_tmp_4, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_tmp_4); //'4#支路温度', |
| | | wbrach.Branch_tmp_5 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_tmp_5, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_tmp_5); //'5#支路温度', |
| | | wbrach.Branch_tmp_6= (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_tmp_6, DataType.TWO_BYTE_INT_SIGNED,master), wbrach.Branch_tmp_6); //'6#支路温度', |
| | | wbrach.Branch_tmp_7 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_tmp_7, DataType.TWO_BYTE_INT_SIGNED,master), wbrach.Branch_tmp_7); //'7#支路温度', |
| | | wbrach.Branch_tmp_8 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_tmp_8, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_tmp_8); //'8#支路温度', |
| | | wbrach.Branch_tmp_9 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_tmp_9, DataType.TWO_BYTE_INT_SIGNED,master), wbrach.Branch_tmp_9); //'9#支路温度', |
| | | |
| | | wbrach.Branch_pre_1 = (float) master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress. Branch_pre_1, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_pre_1); //'1#支路压力', |
| | | wbrach.Branch_pre_2 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_pre_2, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_pre_2); //'2#支路压力', |
| | | wbrach.Branch_pre_3 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress. Branch_pre_3, DataType.TWO_BYTE_INT_SIGNED,master), wbrach.Branch_pre_3); //'3#支路压力', |
| | | wbrach.Branch_pre_4 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress. Branch_pre_4, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_pre_4); //'4#支路压力', |
| | | wbrach.Branch_pre_5 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_pre_5, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_pre_5);//'5#支路压力', |
| | | wbrach.Branch_pre_6= (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_pre_6, DataType.TWO_BYTE_INT_SIGNED,master), wbrach.Branch_pre_6); //'6#支路压力', |
| | | wbrach.Branch_pre_7 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_pre_7, DataType.TWO_BYTE_INT_SIGNED,master), wbrach.Branch_pre_7); //'7#支路压力', |
| | | wbrach.Branch_pre_8 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_pre_8, DataType.TWO_BYTE_INT_SIGNED, master), wbrach.Branch_pre_8); //'8#支路压力', |
| | | wbrach.Branch_pre_9 = (float)master.checkNullData(MyModbusUtils.readHoldingRegister(Watersystem_ModbusAddress.Branch_pre_9, DataType.TWO_BYTE_INT_SIGNED,master), wbrach.Branch_pre_9); //'9#支路压力', |
| | | |
| | | } |
| | | /** |
| | | * 更新水冷系统实时状态信息 |
| | | * @param master |
| | | * @param load_state |
| | | */ |
| | | private void readWater_state(MyModbusMaster master, Water_state wstate) { |
| | | int Watersystem_All_Operation= (int) master.checkNullData(MyModbusUtils.readCoilStatus(Watersystem_ModbusAddress.Watersystem_All_Operation, master), 0);//水冷系统各部件运行情况 |
| | | wstate.P01_main_pump=(Watersystem_All_Operation>>8&1); |
| | | wstate.P11_replenish_pump=(Watersystem_All_Operation>>9&1); |
| | | wstate.P12_pretest_pump=(Watersystem_All_Operation>>10&1); |
| | | wstate.P13_replenish_pump=(Watersystem_All_Operation>>11&1); |
| | | wstate.H01_electric_heater=(Watersystem_All_Operation>>12&1); |
| | | wstate.H02_electric_heater=(Watersystem_All_Operation>>13&1); |
| | | wstate.Solenoid_openflag=(Watersystem_All_Operation>>14&1); |
| | | wstate.Solenoid_shutflag=(Watersystem_All_Operation>>15&1); |
| | | wstate.valve_start=(Watersystem_All_Operation>>0&1); |
| | | wstate.Exhaust_start=(Watersystem_All_Operation>>8&1); |
| | | wstate.remote_start=(Watersystem_All_Operation>>8&5); |
| | | wstate.remote_stop=(Watersystem_All_Operation>>8&6); |
| | | wstate.Operation_ooled_devices=(Watersystem_All_Operation>>8&7); |
| | | |
| | | int Watersystem_All_State= (int)master.checkNullData(MyModbusUtils.readCoilStatus(Watersystem_ModbusAddress.Watersystem_All_State, master), 0);//故障复位信号 |
| | | wstate.Auto_control_state=(Watersystem_All_State>>8&1); |
| | | wstate.Manual_control_state=(Watersystem_All_State>>9&1); |
| | | wstate.remote_control_state=(Watersystem_All_State>>10&1); |
| | | wstate.Water_system_function=(Watersystem_All_State>>11&1); |
| | | |
| | | } |
| | | public static void main(String[] args) { |
| | | int b=13; |
| | | String a=Integer.toBinaryString(b>>0&1); |
| | | System.out.println(a); |
| | | } |
| | | } |
| | |
| | | package main;
|
| | | import java.sql.Connection;
|
| | | import java.sql.SQLException;
|
| | | import java.util.ArrayList; |
| | | import java.util.Date;
|
| | | import java.util.List; |
| | |
|
| | | import com.base.Com;
|
| | | import com.config.AppConfig;
|
| | | import com.config.AppParam;
|
| | | import com.sql.MysqlConnPool;
|
| | | import com.sql.Sql_Mysql; |
| | | import com.watersystem.monitor.Water_Task_SQL; |
| | | import com.watersystem.monitor.Water_inf; |
| | | import com.watersystem.monitor.Watersystem_ServerSocket_Thread; |
| | |
|
| | | public class main_WaterSystem_MonitorServer {
|
| | | /**************************************************************************/
|
| | |
| | | private static MysqlConnPool GB_MysqlConnPool;
|
| | | public static AppParam GB_App_Param;
|
| | |
|
| | | public static List<Water_inf> winfs=new ArrayList(); |
| | | |
| | |
|
| | | /*********************************************************************************************/
|
| | | /*********************************************************************************************/
|
| | |
| | | checkingMySQLServerStart(); //检测数据库服务是否启动
|
| | | /*********************************************************************************/
|
| | | /*********************************************************************************/
|
| | | //初始化数据库 |
| | | Water_Task_SQL.init(GB_MysqlConnPool); |
| | |
|
| | | //获取所有的水冷系统 |
| | | Water_Task_SQL.queryAllWater(GB_MysqlConnPool, winfs); |
| | |
|
| | | |
| | | //读取每套水冷系统的信息 |
| | | Watersystem_ServerSocket_Thread server = new Watersystem_ServerSocket_Thread(GB_MysqlConnPool,winfs); |
| | | new Thread(server).start(); |
| | | while(true) {
|
| | | try {
|
| | | Thread.sleep(5000);
|