ElectricalSystem_MonitorServer_4KW/src/com/electrical/FourKW/Electric_Control_Single.java
@@ -17,6 +17,8 @@ public float dccurr; //直流电流 public float controlangle; //控制角 public float screen_reset; //触摸屏复位(上位机复位) //单套电源输出合闸 public int switchon; //开关柜合闸指令 public int switchoff; //开关柜分闸指令 @@ -34,6 +36,7 @@ this.startposition = 0; this.stopposition = 0; this.resetposition = 0; this.screen_reset = 0; //this.fanstart = 0; //this.fanstop = 0; this.dcvol = 0; @@ -119,6 +122,16 @@ } this.concurrcontrol = concurrcontrol; } public float getScreen_reset() { return screen_reset; } public void setScreen_reset(float screen_reset) { this.screen_reset = screen_reset; } /*public void setOthermodes(int othermodes) { if(othermodes > 0) { control_en = true; ElectricalSystem_MonitorServer_4KW/src/com/electrical/FourKW/Electric_Rt.java
@@ -37,7 +37,7 @@ public int switchoff_2; //开关2 public int comm_state; //ͨѶ״̬ public int screen_reset; //触摸屏复位 public int screen_reset; //触摸屏复位/上位机复位 public int fan_control; //风机控制 public int emergency_trip; //紧急跳闸 ElectricalSystem_MonitorServer_4KW/src/com/electrical/FourKW/Electrical_4KW_SocketClient_Thread.java
@@ -217,6 +217,18 @@ if(ecs.resetposition >0) { MyModbusUtils.writeCoil(Electric_4KW_ModbusAddress.getAddress(ecs.getElectric_id(), "resetposition"),true,master); } //故障复位 if(ecs.screen_reset >0) { MyModbusUtils.writeCoil(Electric_4KW_ModbusAddress.getAddress(ecs.getElectric_id(), "screen_reset"),true,master); try { Thread.sleep(300); //300毫秒复原 MyModbusUtils.writeCoil(Electric_4KW_ModbusAddress.getAddress(ecs.getElectric_id(), "screen_reset"),false,master); } catch (InterruptedException e) { e.printStackTrace(); } } /*if(ecs.fanstart >0) { MyModbusUtils.writeCoil(Electric_4KW_ModbusAddress.getAddress(ecs.getElectric_id(), "fanstart"),true, master); } ElectricalSystem_MonitorServer_4KW/src/com/electrical/FourKW/Electrical_Task_SQL.java
@@ -351,6 +351,7 @@ " startposition int(11) NOT NULL DEFAULT '0' COMMENT '启动位'," + " stopposition int(11) NOT NULL DEFAULT '0' COMMENT 'ֹͣλ'," + " resetposition int(11) NOT NULL DEFAULT '0' COMMENT '复位'," + " screen_reset int(11) NOT NULL DEFAULT '0' COMMENT '触摸屏复位/上位机复位'," + " fanstart int(11) NOT NULL DEFAULT '0' COMMENT '风机启动'," + " fanstop int(11) NOT NULL DEFAULT '0' COMMENT '风机停止'," + " dcvol float NOT NULL DEFAULT '0' COMMENT '直流电压'," + @@ -362,8 +363,18 @@ " UNIQUE KEY electric_id_key (electric_id) USING BTREE " + ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { sql.sqlMysqlExecute(sql_str); //添加触摸屏复位/上位机复位字段screen_reset res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_electricsystem'" + " AND table_name='tb_electric_control_single'" + " AND column_name='screen_reset'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Tb_Electric_Control_Single + " ADD COLUMN screen_reset int(11) NOT NULL DEFAULT '0' COMMENT '触摸屏复位/上位机复位' after resetposition;"); } } catch (SQLException e) { e.printStackTrace(); } finally { @@ -646,6 +657,7 @@ ecs.setUpsetvol(res.getFloat("upsetvol")); ecs.setConvolcontrol(res.getInt("convolcontrol")); ecs.setConcurrcontrol(res.getInt("concurrcontrol")); ecs.setScreen_reset(res.getInt("screen_reset")); //ecs.setOthermodes(res.getInt("othermodes")); //ecs.setParallelmodes(res.getInt("parallelmodes")); ecs.setStartposition(res.getInt("startposition")); @@ -784,6 +796,7 @@ + " startposition ="+ecs.startposition+"," + " stopposition ="+ecs.stopposition+"," + " resetposition ="+ecs.resetposition+"," + " screen_reset = "+ecs.screen_reset+"," + " fanstart = "+ecs.fanstart+"," + " fanstop = "+ecs.fanstop+"," + " dcvol = "+ecs.dcvol+","