| | |
| | | |
| | | dyna.button = new Dynamicload_button(dyna.dev_id); |
| | | dyna.control = new Dynamicload_control(dyna.dev_id,dyna.getFZ_button_num()); |
| | | dyna.state = new Dynamicload_state(dyna.dev_id,0); |
| | | dyna.state = new Dynamicload_state(dyna.dev_id,dyna.getFZ_button_num()); |
| | | dys.add(dyna); |
| | | } |
| | | } catch (Exception e) { |
New file |
| | |
| | | package com.dev.base.data;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.base.Com;
|
| | | import com.sql.MysqlConnPool;
|
| | |
|
| | | public class Dynamicload_RealDataRecord_Thread implements Runnable{
|
| | | public static final int TESTDATA_RECORD_INTERVAL = 1; //记录数据间隔
|
| | | public static final int MAX_SAVE_DAY_COUNT = 180;
|
| | | |
| | | |
| | | public MysqlConnPool pool;
|
| | | public List<TestData_Record_Thread> threads;
|
| | | public List<Dynamicload_inf> dinfs;
|
| | | |
| | | public Dynamicload_RealDataRecord_Thread(MysqlConnPool pool,List<Dynamicload_inf> dinfs){
|
| | | this.pool = pool;
|
| | | this.dinfs = dinfs;
|
| | | threads = new ArrayList<>();
|
| | | }
|
| | | |
| | | @Override
|
| | | public void run() {
|
| | | System.out.println("Dynamicload_RealDataRecord_Thread Start at "+Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms));
|
| | | Date now = null;
|
| | | Date last = new Date(0);
|
| | | while(true) {
|
| | | try {
|
| | | now = new Date();
|
| | | |
| | | for(int i=0;i<dinfs.size();i++) {
|
| | | boolean isExist = false;
|
| | | Dynamicload_inf dinf = dinfs.get(i);
|
| | | for(int k=0;k<threads.size();k++) {
|
| | | if(threads.get(k).dinf.dev_id == dinf.dev_id) {
|
| | | isExist = true;
|
| | | break;
|
| | | }
|
| | | }
|
| | | if(!isExist) {
|
| | | TestData_Record_Thread thread = new TestData_Record_Thread(pool, dinf);
|
| | | threads.add(thread);
|
| | | new Thread(thread).start();
|
| | | }
|
| | | |
| | | //构造今天和明天的历史实时数据表
|
| | | Dynamicload_Task_SQL.createTb_Dynamicload_realdata(pool, dinf.dev_id, now);
|
| | | Dynamicload_Task_SQL.createTb_Dynamicload_realdata(pool, dinf.dev_id, tomorrow(now));
|
| | | |
| | | }
|
| | | Date del_time = getDateBefore(now,MAX_SAVE_DAY_COUNT);
|
| | | Dynamicload_Task_SQL.deleteHistoryData(pool, del_time);
|
| | | //System.out.println(Com.getDateTimeFormat(del_time, Com.DTF_YMDhms));
|
| | | Thread.sleep(3000);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | Thread.sleep(5000);
|
| | | } catch (InterruptedException e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | class TestData_Record_Thread implements Runnable{
|
| | | public MysqlConnPool pool;
|
| | | public Dynamicload_inf dinf;
|
| | | |
| | | public TestData_Record_Thread(MysqlConnPool pool,Dynamicload_inf dinf) {
|
| | | this.pool = pool;
|
| | | this.dinf = dinf;
|
| | | }
|
| | | |
| | | @Override
|
| | | public void run() {
|
| | | Date last = new Date(0); //上一次测试的时间
|
| | | Date now = null; //当前时间
|
| | | |
| | | while(true) {
|
| | | try {
|
| | | now = new Date();
|
| | | long timelong = (now.getTime()-last.getTime())/1000;
|
| | | //System.out.println(timelong);
|
| | | if(timelong >= TESTDATA_RECORD_INTERVAL) {
|
| | | if(dinf.conn_state == 1) {
|
| | | //通讯正常
|
| | | Dynamicload_Task_SQL.insertTb_dynamicload_realdata(pool, dinf, now);
|
| | | last = now;
|
| | | }
|
| | | } |
| | | Thread.sleep(10);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 返回明天日期
|
| | | * @param today
|
| | | * @return
|
| | | */
|
| | | public Date tomorrow(Date today) {
|
| | | Calendar calendar = Calendar.getInstance();
|
| | | calendar.setTime(today);
|
| | | calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) + 1);
|
| | | return calendar.getTime();
|
| | | }
|
| | | |
| | | /**
|
| | | * 获取指定时间之前多少天的时间
|
| | | * @param d
|
| | | * @param day
|
| | | * @return
|
| | | */
|
| | | public static Date getDateBefore(Date d,int day){
|
| | | Calendar now =Calendar.getInstance();
|
| | | now.setTime(d);
|
| | | now.set(Calendar.DATE,now.get(Calendar.DATE)-day);
|
| | | return now.getTime();
|
| | | }
|
| | | }
|
| | |
| | | this.conn_pool = conn_pool; |
| | | this.dinf = dinf; |
| | | |
| | | dbutton = new Dynamicload_button(dinf.getDev_id()); |
| | | dcontrol = new Dynamicload_control(dinf.getDev_id(),dinf.getFZ_button_num()); |
| | | dstate = new Dynamicload_state(dinf.getDev_id(),dinf.getFZ_button_num()); |
| | | dbutton = dinf.button; |
| | | dcontrol = dinf.control; |
| | | dstate = dinf.state; |
| | | |
| | | //dbutton = new Dynamicload_button(dinf.getDev_id()); |
| | | //dcontrol = new Dynamicload_control(dinf.getDev_id(),dinf.getFZ_button_num()); |
| | | //dstate = new Dynamicload_state(dinf.getDev_id(),dinf.getFZ_button_num()); |
| | | master = new MyModbusMaster(dinf.getDev_ip(), MyModbusMaster.SLAVEID_DEFAULT); |
| | | //System.out.println("master: "+master); |
| | | } |
| | |
| | | //System.err.println(dinf.dev_id + "=====" + ((new Date()).getTime() - last.getTime())); |
| | | last = new Date(); |
| | | PowerArk_Task_SQL.insertOrUpdateDeviceConnectState(conn_pool, dinf.dev_id, master); |
| | | dinf.conn_state = master.getConnectState(); |
| | | if (runCount % 10 == 0) { |
| | | // 更新当前设备ip |
| | | master.setTarget_ip(dinf.dev_ip); |
New file |
| | |
| | | package com.dev.base.data;
|
| | |
|
| | | import java.sql.ResultSet;
|
| | | import java.sql.SQLException;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.base.Com;
|
| | | import com.sql.MysqlConnPool;
|
| | | import com.sql.Sql_Mysql;
|
| | |
|
| | | public class Dynamicload_Task_SQL {
|
| | |
|
| | | /**
|
| | | * 创建指定时间的历史实时数据库表
|
| | | * @param pool
|
| | | * @param dev_id
|
| | | * @param now
|
| | | */
|
| | | public static void createTb_Dynamicload_realdata(MysqlConnPool pool, int dev_id, Date now) {
|
| | | String sql_str = "CREATE TABLE IF NOT EXISTS "+Sql_Mysql.Tb_Dynamicload_RealData+dev_id+"_"+Com.getDateTimeFormat(now, Com.DTF_Y_M_D)+" (" + |
| | | " num int(11) NOT NULL AUTO_INCREMENT COMMENT '主键'," + |
| | | " dev_id int(11) NOT NULL DEFAULT '1' COMMENT '设备id'," + |
| | | " record_time datetime NOT NULL DEFAULT '2000-01-01 00:00:00'," + |
| | | " FZ_b1 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ按钮1'," + |
| | | " FZ_b2 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ按钮2'," + |
| | | " FZ_b3 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ按钮3'," + |
| | | " FZ_b4 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ按钮4'," + |
| | | " FZ_b5 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ按钮5'," + |
| | | " FZ_b6 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ按钮6'," + |
| | | " FZ_b7 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ按钮7'," + |
| | | " FZ_b8 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ按钮8'," + |
| | | " FZ_b9 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ按钮9'," + |
| | | " FZ_b10 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ按钮10'," + |
| | | " FZ_b11 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ按钮11'," + |
| | | " FZ_fw1 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ反馈按钮1'," + |
| | | " FZ_fw2 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ反馈按钮2'," + |
| | | " FZ_fw3 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ反馈按钮3'," + |
| | | " FZ_fw4 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ反馈按钮4'," + |
| | | " FZ_fw5 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ反馈按钮5'," + |
| | | " FZ_fw6 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ反馈按钮6'," + |
| | | " FZ_fw7 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ反馈按钮7'," + |
| | | " FZ_fw8 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ反馈按钮8'," + |
| | | " FZ_fw9 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ反馈按钮9'," + |
| | | " FZ_fw10 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ反馈按钮10'," + |
| | | " FZ_fw11 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ反馈按钮11'," + |
| | | " FZ_ex1 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ输出按钮1'," + |
| | | " FZ_ex2 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ输出按钮2'," + |
| | | " FZ_ex3 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ输出按钮3'," + |
| | | " FZ_ex4 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ输出按钮4'," + |
| | | " FZ_ex5 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ输出按钮5'," + |
| | | " FZ_ex6 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ输出按钮6'," + |
| | | " FZ_ex7 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ输出按钮7'," + |
| | | " FZ_ex8 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ输出按钮8'," + |
| | | " FZ_ex9 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ输出按钮9'," + |
| | | " FZ_ex10 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ输出按钮10'," + |
| | | " FZ_ex11 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ输出按钮11'," + |
| | | " start_auto int(11) NOT NULL DEFAULT '1' COMMENT '启动自动加载'," + |
| | | " stop_auto int(11) NOT NULL DEFAULT '1' COMMENT '停止自动加载'," + |
| | | " sudden_crease int(11) NOT NULL DEFAULT '1' COMMENT '突加突卸'," + |
| | | " all_open int(11) NOT NULL DEFAULT '1' COMMENT '全部分闸'," + |
| | | " actual_set_power float NOT NULL DEFAULT '1' COMMENT '实际设定功率'," + |
| | | " output_power float NOT NULL DEFAULT '1' COMMENT '已输出功率'," + |
| | | " set_power float NOT NULL DEFAULT '1' COMMENT '设定功率'," + |
| | | " interval_time float NOT NULL DEFAULT '1' COMMENT '间隔时间s'," + |
| | | " actual_curr float NOT NULL DEFAULT '1' COMMENT '实际电流'," + |
| | | " actual_mov float NOT NULL DEFAULT '1' COMMENT '实际电压'," + |
| | | " switch_on int(11) NOT NULL DEFAULT '1' COMMENT '是否合闸'," + |
| | | " FZ_autostate1 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ自动状态1'," + |
| | | " FZ_autostate2 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ自动状态2'," + |
| | | " FZ_autostate3 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ自动状态3'," + |
| | | " FZ_autostate4 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ自动状态4'," + |
| | | " FZ_autostate5 int(11) NOT NULL DEFAULT '1' COMMENT 'FZ自动状态5'," + |
| | | " react_overtem int(11) NOT NULL DEFAULT '1' COMMENT '电抗超温'," + |
| | | " water_overtem int(11) NOT NULL DEFAULT '1' COMMENT '冷却水超温'," + |
| | | " water_level_low int(11) NOT NULL DEFAULT '1' COMMENT '冷却水液位低'," + |
| | | " water_pressure_high int(11) NOT NULL DEFAULT '1' COMMENT '冷却水压高'," + |
| | | " local_control int(11) NOT NULL DEFAULT '1' COMMENT '就地控制'," + |
| | | " back_control int(11) NOT NULL DEFAULT '1' COMMENT '后台控制'," + |
| | | " central_control int(11) NOT NULL DEFAULT '1' COMMENT '中控控制'," + |
| | | " switch_state int(11) NOT NULL DEFAULT '1' COMMENT '开关柜状态'," + |
| | | " inter_volume_M200 int(11) NOT NULL DEFAULT '1' COMMENT '中间量M200'," + |
| | | " fan_button int(11) NOT NULL DEFAULT '1' COMMENT '风机按钮'," + |
| | | " fan_output int(11) NOT NULL DEFAULT '1' COMMENT '风机输出'," + |
| | | " allow_close int(11) NOT NULL DEFAULT '0' COMMENT '是否允许合闸'," + |
| | | " note varchar(255) NOT NULL DEFAULT ''," + |
| | | " PRIMARY KEY (num)," + |
| | | " KEY dev_id_key (dev_id)," + |
| | | " KEY index_record_time (record_time) 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 conn_pool
|
| | | * @param deldate |
| | | */
|
| | | public static void deleteHistoryData(MysqlConnPool conn_pool,Date deldate) {
|
| | | String sql_select_strs = " select TABLE_NAME,UPDATE_TIME,CREATE_TIME " + |
| | | " from information_schema.tables " + |
| | | " where table_schema='db_dynamicsystem' " + |
| | | " AND TABLE_NAME like 'tb_dynamicload_realdata_%' " + |
| | | " AND CREATE_TIME <= '"+Com.getDateTimeFormat(deldate, Com.DTF_YMDhms)+"';" ;
|
| | | String sql_delete_strs = " DROP TABLE IF EXISTS ";
|
| | | Sql_Mysql sql = new Sql_Mysql(conn_pool.getConn());
|
| | | ResultSet res = null;
|
| | | int count = 0;
|
| | | res = sql.sqlMysqlQuery(sql_select_strs);
|
| | | try {
|
| | | while(res.next()) {
|
| | | if(count > 0) {
|
| | | sql_delete_strs += ",";
|
| | | }
|
| | | |
| | | sql_delete_strs += "db_dynamicsystem." + res.getString("TABLE_NAME");
|
| | | System.out.println("删除:"+res.getString("TABLE_NAME")+"\t at "+Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms));
|
| | | count++;
|
| | | }
|
| | | if(count >0) {
|
| | | sql.sqlMysqlExecute(sql_delete_strs);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | if(res != null) {
|
| | | try {
|
| | | res.close();
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * |
| | | * @param pool
|
| | | * @param dinf
|
| | | * @param now
|
| | | */
|
| | | public static void insertTb_dynamicload_realdata(MysqlConnPool pool, Dynamicload_inf dinf, Date now) {
|
| | | Dynamicload_button btn = dinf.button;
|
| | | Dynamicload_state state = dinf.state;
|
| | | String sql_str = "INSERT INTO " + Sql_Mysql.Tb_Dynamicload_RealData+dinf.dev_id+"_"+Com.getDateTimeFormat(now, Com.DTF_Y_M_D) +
|
| | | "(dev_id,record_time,FZ_b1,FZ_b2,FZ_b3,FZ_b4,FZ_b5,FZ_b6,FZ_b7,FZ_b8,FZ_b9,FZ_b10,FZ_b11,FZ_fw1,FZ_fw2,FZ_fw3,FZ_fw4,FZ_fw5,FZ_fw6,FZ_fw7,FZ_fw8,FZ_fw9,FZ_fw10,FZ_fw11,FZ_ex1,FZ_ex2,FZ_ex3,FZ_ex4,FZ_ex5,FZ_ex6,FZ_ex7,FZ_ex8,FZ_ex9,FZ_ex10,FZ_ex11,start_auto,stop_auto,sudden_crease,all_open,actual_set_power,output_power,set_power,interval_time,actual_curr,actual_mov,switch_on,FZ_autostate1,FZ_autostate2,FZ_autostate3,FZ_autostate4,FZ_autostate5,react_overtem,water_overtem,water_level_low,water_pressure_high,local_control,back_control,central_control,switch_state,inter_volume_M200,fan_button,fan_output,allow_close) " + |
| | | "VALUES("+dinf.dev_id+",'"+Com.getDateTimeFormat(now, Com.DTF_YMDhms)+"',"+btn.FZ_b1+","+btn.FZ_b2+","+btn.FZ_b3+","+btn.FZ_b4+","+btn.FZ_b5+","+btn.FZ_b6+","+btn.FZ_b7+","+btn.FZ_b8+","+btn.FZ_b9+","+btn.FZ_b10+","+btn.FZ_b11+","+btn.FZ_fw1+","+btn.FZ_fw2+","+btn.FZ_fw3+","+btn.FZ_fw4+","+btn.FZ_fw5+","+btn.FZ_fw6+","+btn.FZ_fw7+","+btn.FZ_fw8+","+btn.FZ_fw9+","+btn.FZ_fw10+","+btn.FZ_fw11+","+btn.FZ_ex1+","+btn.FZ_ex2+","+btn.FZ_ex3+","+btn.FZ_ex4+","+btn.FZ_ex5+","+btn.FZ_ex6+","+btn.FZ_ex7+","+btn.FZ_ex8+","+btn.FZ_ex9+","+btn.FZ_ex10+","+btn.FZ_ex11+","+state.start_auto+","+state.stop_auto+","+state.sudden_crease+","+state.all_open+","+state.actual_set_power+","+state.output_power+","+state.set_power+","+state.interval_time+","+state.actual_curr+","+state.actual_mov+","+state.switch_on+","+state.FZ_autostate1+","+state.FZ_autostate2+","+state.FZ_autostate3+","+state.FZ_autostate4+","+state.FZ_autostate5+","+state.react_overtem+","+state.water_overtem+","+state.water_level_low+","+state.water_pressure_high+","+state.local_control+","+state.back_control+","+state.central_control+","+state.switch_state+","+state.inter_volume_M200+","+state.fan_button+","+state.fan_output+","+state.allow_close+");";
|
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
| | | try {
|
| | | sql.sqlMysqlExecute(sql_str);
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public int FZ_button_num; //负载柜按钮数量 |
| | | public String note; |
| | | |
| | | public int conn_state = 0; |
| | | public Dynamicload_button button; |
| | | public Dynamicload_control control; |
| | | public Dynamicload_state state; |
| | |
| | | batch.addLocator(3,MyModbusUtils.createBaseLocator(11, master));//全部分闸 |
| | | if(fz_button_num==11){ |
| | | batch.addLocator(4,MyModbusUtils.createBaseLocator(1,DataType.TWO_BYTE_INT_SIGNED, master)); //实际设定功率4 |
| | | batch.addLocator(5,MyModbusUtils.createBaseLocator(2,DataType.TWO_BYTE_INT_SIGNED, master));//已输出功率 |
| | | batch.addLocator(6,MyModbusUtils.createBaseLocator(4,DataType.TWO_BYTE_INT_SIGNED, master));//设定功率 |
| | | batch.addLocator(7,MyModbusUtils.createBaseLocator(6,DataType.TWO_BYTE_INT_SIGNED,master)); //间隔时间 |
| | | batch.addLocator(8,MyModbusUtils.createBaseLocator(7,DataType.TWO_BYTE_INT_SIGNED, master));//实际电流 |
| | | batch.addLocator(9,MyModbusUtils.createBaseLocator(8,DataType.TWO_BYTE_INT_SIGNED, master));//实际电压4 |
| | | batch.addLocator(5,MyModbusUtils.createBaseLocator(2,DataType.TWO_BYTE_INT_SIGNED, master)); //已输出功率 |
| | | batch.addLocator(6,MyModbusUtils.createBaseLocator(4,DataType.TWO_BYTE_INT_SIGNED, master)); //设定功率 |
| | | batch.addLocator(7,MyModbusUtils.createBaseLocator(6,DataType.TWO_BYTE_INT_SIGNED,master)); //间隔时间 |
| | | batch.addLocator(8,MyModbusUtils.createBaseLocator(7,DataType.TWO_BYTE_INT_SIGNED, master)); //实际电流 |
| | | batch.addLocator(9,MyModbusUtils.createBaseLocator(8,DataType.TWO_BYTE_INT_SIGNED, master)); //实际电压4 |
| | | |
| | | }else { |
| | | batch.addLocator(4,MyModbusUtils.createBaseLocator(2,DataType.TWO_BYTE_INT_SIGNED, master)); //实际设定功率4 |
| | |
| | | public final static String Tb_Dynamicload_Control = DB_DynamicSystem + ".tb_dynamicload_control"; //电源柜控制表
|
| | |
|
| | | public final static String Tb_Device_ConnectState = DB_Electric2MWSystem+".tb_device_connectstate"; //设备通讯状态表
|
| | | public final static String Tb_Dynamicload_RealData = DB_DynamicSystem+".tb_dynamicload_realdata_"; //历史实时数据记录表
|
| | | //--------------------------------------------------------------------------------------------//
|
| | | public Connection mysql_con;
|
| | |
|
| | |
| | | 中船重工电源柜通讯程序
|
| | |
|
| | | V1.201
|
| | | 添加设备通讯中断监测记录功能 |
| | | 添加设备通讯中断监测记录功能
|
| | | |
| | | V1.202 2020-10-15 by lijun
|
| | | 1.添加历史实时数据记录功能
|
| | | |
| | |
| | | import com.data.PowerArk_ServerSocket_Thread_SQL; |
| | | import com.data.PowerArk_SocketCliet_Thread; |
| | | import com.data.PowerArk_Task_SQL; |
| | | import com.dev.base.data.Dynamicload_RealDataRecord_Thread; |
| | | import com.dev.base.data.Dynamicload_ServerSocket_Thread; |
| | | import com.dev.base.data.Dynamicload_inf; |
| | | import com.sql.MysqlConnPool; |
| | |
| | | //读取每套负载系统的信息 |
| | | Dynamicload_ServerSocket_Thread server = new Dynamicload_ServerSocket_Thread(GB_MysqlConnPool,GB_DevData); |
| | | new Thread(server).start(); |
| | | |
| | | /**************** 历史实时数据记录线程 *************************************/ |
| | | { |
| | | Dynamicload_RealDataRecord_Thread record_thread = new Dynamicload_RealDataRecord_Thread(GB_MysqlConnPool, GB_DevData); |
| | | new Thread(record_thread).start(); |
| | | } |
| | | |
| | | /*********************************************************************************/ |
| | | } |
| | | |