whyclj
2020-12-14 dbbdd1006f15da8579d709598ce11116e8f70bfe
修复bug
3个文件已修改
23 ■■■■ 已修改文件
Central_Monitor/src/com/data/Central_RT_Data.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Central_Monitor/src/com/data/Comm/Central_DataParsing_Thread_SQL.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Central_Monitor/src/com/data/Comm/Central_Data_SocketServer_Thread.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Central_Monitor/src/com/data/Central_RT_Data.java
@@ -38,14 +38,14 @@
    public void putBatchResult(BatchResults<Integer> res) {
        if(null != res) {
            switch_close = (int)res.getValue(0);    // '开关合闸状态',
            switch_open = (int)res.getValue(1);     // '开关分闸状态',
            switch_fault = (int)res.getValue(2);    // '开关故障状态',
            switch_close = MyModbusUtils.readBooleanToInt(res.getValue(0));    // '开关合闸状态',
            switch_open = MyModbusUtils.readBooleanToInt(res.getValue(1));     // '开关分闸状态',
            switch_fault = MyModbusUtils.readBooleanToInt(res.getValue(2));    // '开关故障状态',
            if(10001 == dev_id) {
                panel_vol  = (int)res.getValue(3);    // '进线屏电压',
                panel_curr = (int)res.getValue(4) ;   // '进线屏电流',
                panel_vol  = MyModbusUtils.readShortToInt(res.getValue(3));    // '进线屏电压',
                panel_curr = MyModbusUtils.readShortToInt(res.getValue(4));   // '进线屏电流',
            }else {
                panel_curr = (int)res.getValue(3) ;   // '进线屏电流',
                panel_curr = MyModbusUtils.readShortToInt(res.getValue(3));   // '进线屏电流',
            }
        }
    }
Central_Monitor/src/com/data/Comm/Central_DataParsing_Thread_SQL.java
@@ -55,9 +55,9 @@
     */
    public static void insertOrUpdateTb_Central_Monitor_Sys_St(MysqlConnPool pool,Central_ST_Data stdata) {
        String sql_str_sel = " select dev_id from " + Sql_Mysql.Tb_Central_Monitor_Sys_St + " where dev_id = " + stdata.getDev_id();
        String sql_str_ins = " intsert into " + Sql_Mysql.Tb_Central_Monitor_Sys_St + "(dev_id) values("+stdata.getDev_id()+")";
        String sql_str_ins = " insert into " + Sql_Mysql.Tb_Central_Monitor_Sys_St + "(dev_id) values("+stdata.getDev_id()+")";
        String sql_str_upd = " update " + Sql_Mysql.Tb_Central_Monitor_Sys_St + ""
                + " SET record_time '" + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)
                + " SET record_time = '" + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)
                + "',switch_close_1st_2500A = " + stdata.getSwitch_close_1st_2500A()
                + ",switch_open_1st_2500A = " + stdata.getSwitch_open_1st_2500A()
                + ",switch_fault_1st_2500A = " + stdata.getSwitch_fault_1st_2500A()
@@ -108,9 +108,9 @@
     */
    public static void insertOrUpdateTb_Central_Monitor_Sys_Rt(MysqlConnPool pool,Central_RT_Data rtdata) {
        String sql_str_sel = " select dev_id from " + Sql_Mysql.Tb_Central_Monitor_Sys_Rt + " where dev_id = " + rtdata.getDev_id();
        String sql_str_ins = " intsert into " + Sql_Mysql.Tb_Central_Monitor_Sys_Rt + "(dev_id) values("+rtdata.getDev_id()+")";
        String sql_str_ins = " insert into " + Sql_Mysql.Tb_Central_Monitor_Sys_Rt + "(dev_id) values("+rtdata.getDev_id()+")";
        String sql_str_upd = " update " + Sql_Mysql.Tb_Central_Monitor_Sys_Rt + ""
                + " SET record_time '" + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)
                + " SET record_time = '" + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)
                + "',switch_close = " + rtdata.getSwitch_close()
                + ",switch_open = " + rtdata.getSwitch_open()
                + ",switch_fault = " + rtdata.getSwitch_fault()
Central_Monitor/src/com/data/Comm/Central_Data_SocketServer_Thread.java
@@ -31,7 +31,8 @@
        logger.trace(" Central_Data_SocketServer_Thread Start at " + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms));
        for(int i = 0;i<motors.size();i++) {
            Motor_inf motor = motors.get(i);
            Central_Data_SocketClient_Thread socket = new Central_Data_SocketClient_Thread(pool,motor);
            Central_Data_SocketClient_Thread socket = new Central_Data_SocketClient_Thread(pool,motor);
            new Thread(socket).start();
        }
    }
}