V3.506 edit by lijun	@  2025-03-13
1.修复在linux系统上Socket超时导致设备通信故障延迟较高
2.修复在设备状态是停电放电时,电池组状态显示问题
电流>0 电池状态-充电
电流<0 电池状态-放电
17个文件已修改
144 ■■■■ 已修改文件
iec61850for118/bin/com/battdata_rt/BattData_RT.class 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/bin/com/battdata_rt/BattData_RT_RamDB_Thread_SQL.class 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/bin/com/dec/fbs9100/BTS_61850_SocketClient.class 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/bin/com/dec/fbs9100/MyUtil.class 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/bin/com/dec/fbs9100/main_BTS_APP_IEC61850.class 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/bin/com/version_inf/version_inf.txt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/bin/config.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/bin/log4j2_batt_61850_dev_x64.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/bin/org/openmuc/jositransport/TConnection.class 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/config.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/log4j2_batt_61850_dev_x64.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/src/com/battdata_rt/BattData_RT.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/src/com/dec/fbs9100/BTS_61850_SocketClient.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/src/com/dec/fbs9100/MyUtil.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/src/com/dec/fbs9100/main_BTS_APP_IEC61850.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/src/com/version_inf/version_inf.txt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/src/org/openmuc/jositransport/TConnection.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iec61850for118/bin/com/battdata_rt/BattData_RT.class
Binary files differ
iec61850for118/bin/com/battdata_rt/BattData_RT_RamDB_Thread_SQL.class
Binary files differ
iec61850for118/bin/com/dec/fbs9100/BTS_61850_SocketClient.class
Binary files differ
iec61850for118/bin/com/dec/fbs9100/MyUtil.class
Binary files differ
iec61850for118/bin/com/dec/fbs9100/main_BTS_APP_IEC61850.class
Binary files differ
iec61850for118/bin/com/version_inf/version_inf.txt
@@ -5,6 +5,11 @@
    均衡供电(旧版本)
    除硫模块
    均衡电流
V3.505 edit by lijun    @  2025-03-04
    1.修复因缓存导致,设备通信故障
    
V3.504 edit by lijun    @  2024-10-24
    1.新增交直流监控屏实时数据读取    
iec61850for118/bin/config.xml
@@ -2,7 +2,7 @@
<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-->
iec61850for118/bin/log4j2_batt_61850_dev_x64.xml
@@ -53,7 +53,7 @@
    </Appenders>
    <Loggers>
        <Root level="trace">
        <Root level="info">
            <AppenderRef ref="Console" />
            <appenderRef ref="INFO" />
            <appenderRef ref="ERROR" />
iec61850for118/bin/org/openmuc/jositransport/TConnection.class
Binary files differ
iec61850for118/config.xml
@@ -2,7 +2,7 @@
<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-->
iec61850for118/log4j2_batt_61850_dev_x64.xml
@@ -53,7 +53,7 @@
    </Appenders>
    <Loggers>
        <Root level="trace">
        <Root level="info">
            <AppenderRef ref="Console" />
            <appenderRef ref="INFO" />
            <appenderRef ref="ERROR" />
iec61850for118/src/com/battdata_rt/BattData_RT.java
@@ -599,6 +599,7 @@
        /***********************************************************************/
        if(false == getStoreDataBusyTag())
        {
            logger.info("battgroupid:" + BattGroupId + "111\tbattState:" + mTestData.battState +"\tbattTestState:"+mTestData.battTestState);
            float tmp_curr = mTestData.TestCurr_RT;
            
            if((Math.abs(tmp_curr) < mBattFloatCurrLevel)
@@ -612,6 +613,7 @@
                }
            }
            
            logger.info("battgroupid:" + BattGroupId + "222\tbattState:" + mTestData.battState+"\tbattTestState:"+mTestData.battTestState);
            if(false == store_state)
            {
                if(tmp_curr >= (mBattFloatCurrLevel+2))
@@ -652,12 +654,12 @@
                }
            }
            
            logger.info("battgroupid:" + BattGroupId + "333\tbattState:" + mTestData.battState+"\tbattTestState:"+mTestData.battTestState);
            if(false == store_state)
            {
                mTestData.testCurr = tmp_curr;
            }
        }
        if((BattStatData.BATTSTATE_DISCHARGE == mTestData.battTestState)
            || (BattStatData.BATTSTATE_CHARGE == mTestData.battTestState))
        {
@@ -682,7 +684,6 @@
                mTestData.battState = BattStatData.BATTSTATE_FLOAT;
            }
        }
        /************************** edit by mxpopstar @ 2020-08-30 ****************************/
        if(true == store_state) {
            BattData_RT_SQL.queryAppParamFromDataBase(m_Conn_Pool, mTestData.appparam);
@@ -704,7 +705,6 @@
            if(true == store_state)
                setStoreDataBusyTag();
        }
        /***********************************************************************/
        return store_state;
    }
iec61850for118/src/com/dec/fbs9100/BTS_61850_SocketClient.java
@@ -3,6 +3,7 @@
import java.io.IOException;
import java.net.InetAddress;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -155,13 +156,28 @@
            }
            try {
                m_ClientSap = new ClientSap();
                m_Association = m_ClientSap.associate(InetAddress.getByName(FBSDeviceIp), 102, null, null);
                m_ClientSap.setMaxMmsPduSize(65000);
                m_ClientSap.setResponseTimeout(30000);
                m_ClientSap.setMessageFragmentTimeout(30000);
//                m_Association = m_ClientSap.associate(InetAddress.getByName(FBSDeviceIp), 102, null, null);
                m_Association = m_ClientSap.associate(InetAddress.getByName(FBSDeviceIp), commPort, null, null);
            } catch (Exception e) {
                logger.debug("BTS_IEC61850_Client Unable to connect to device IP:" + FBSDeviceIp + " Port:" + commPort);
                logger.info("BTS_IEC61850_Client Unable to connect to device IP:" + FBSDeviceIp + " Port:" + commPort);
                if(null != m_Association) {
                    try {
                        m_Association.disconnect();
                        m_Association.close();
                    } catch (Exception e1) {
                        e1.printStackTrace();
                    }
                }
                continue;
            }
            logger.debug("Successfully connected to ied server " + FBSDeviceIp + " " + FBSDeviceName);
            logger.info("Successfully connected to ied server " + FBSDeviceIp + " " + FBSDeviceName);
            logger.debug("IP:" + FBSDeviceIp + " - BTS_IEC61850_Client retrieving model...");
            /*
            try {
@@ -201,7 +217,7 @@
            logger.debug("IP:" + FBSDeviceIp + " - BTS_IEC61850_VersionInf: " + m_StatAndParam.m_DevVersion);
            
            m_FBS_VCData.m_SysState.resetErrCommCount();
            FBS9100_Task_Thread_SQL.inseartOrUpdateFBS9100SFODParam(m_ConnPool, m_StatAndParam.clParam, m_StatAndParam);
            //FBS9100_Task_Thread_SQL.inseartOrUpdateFBS9100SFODParam(m_ConnPool, m_StatAndParam.clParam, m_StatAndParam);
            FBS9100_Task_Thread_SQL.queryBTS61850OffLineyhPlanOnRam(m_ConnPool, m_StatAndParam);
            
@@ -368,8 +384,8 @@
                        if (m_StatAndParam != null) {
                            // System.err.println(m_StatAndParam);
                            FBS9100_Task_Thread_SQL.updateFbs9100StateByDev_Id(m_ConnPool, m_StatAndParam);
                            FBS9100_Task_Thread_SQL.inseartOrUpdateFBS9100SFODState(m_ConnPool, m_StatAndParam,
                                    m_StatAndParam.fbs9100s_fod_state);
//                            FBS9100_Task_Thread_SQL.inseartOrUpdateFBS9100SFODState(m_ConnPool, m_StatAndParam,
//                                    m_StatAndParam.fbs9100s_fod_state);
                            FBS9100_Task_Thread_SQL.insertOrUpdateJhStateTable(m_ConnPool, m_StatAndParam);
@@ -399,12 +415,16 @@
                    }
                    //---------------------------------------------------------------------------------//
                    if (m_FBS_VCData.m_SysState.ErrCommCount > 20) {
                        logger.printf(Level.DEBUG, "DevId:%d, DevIp:%s, ComErrorCnt:%d, CommThread break now.",
                        logger.printf(Level.ERROR, "DevId:%d, DevIp:%s, ComErrorCnt:%d, CommThread break now.",
                                        m_StatAndParam.dev_id,
                                        m_StatAndParam.dev_ipaddr,
                                        m_FBS_VCData.m_SysState.ErrCommCount);
                        
                        m_Association.close();
                        if(null != m_Association){
                            m_Association.disconnect();
                            Thread.sleep(1000);
                            m_Association.close();
                        }
                        //m_ServerModel = null;
                        break;
                    }
@@ -413,10 +433,17 @@
                    logger.error("IP:" + FBSDeviceIp + " " + this.getName() + " - BTS_IEC61850_ClientThread DisConnect By "  +e.toString(), e);
                    
                    try {
                        if(null != m_Association) {
                            try {
                                m_Association.disconnect();
                                m_Association.close();
                            } catch (Exception e1) {
                                e1.printStackTrace();
                            }
                        }
                        sleep(1000);
                        break;
                    } catch (InterruptedException e1) {
                        // TODO Auto-generated catch block
                    } catch (Exception e1) {
                        logger.error(e1.toString(), e1);
                    }
                }
@@ -424,9 +451,11 @@
        }
        
        try {
            m_Association.disconnect();
            Thread.sleep(1000);
            m_Association.close();
            if(null != m_Association){
                m_Association.disconnect();
                Thread.sleep(1000);
                m_Association.close();
            }
            //m_ServerModel = null;
        } catch (Exception e) {
            logger.error(e.toString(), e);
@@ -985,7 +1014,7 @@
                    }            
                    FBS9100_Task_Thread_SQL.updateAcDc_SecuityBydev_id(m_ConnPool, m_FBSDevId, mAcDc_Secuity);
                }
                m_FBS_VCData.m_SysState.resetErrCommCount();
                //m_FBS_VCData.m_SysState.resetErrCommCount();
                
            } else if (FBS9100_ComBase.CMD_SetDischargeParm == cmd) {
                boolean write_res_t = true;
@@ -1486,10 +1515,14 @@
            }
            comm_res = true;
        } catch (Exception e) {
            // TODO Auto-generated catch block
            logger.error(e.toString(), e);
            m_FBS_VCData.m_SysState.setErrCommCountInc(0);
            //m_FBS_VCData.m_SysState.setErrCommCountInc(0);
            //if((e instanceof SocketException) || (e instanceof IOException)) {
                m_FBS_VCData.m_SysState.ErrCommCount = 30;
//                m_FBS_VCData.m_SysState.setErrCommCountInc(0);
            //}
            logger.error("ErrorCount:" + m_FBS_VCData.m_SysState.ErrCommCount);
            comm_res = false;
        }
        return comm_res;
@@ -1713,23 +1746,27 @@
                    }
                    byte test_type = 1;
                    switch (m_FBS_VCData.m_SysState.WorkState) {
                        case 0:
                            test_type = 1;
                        case 0:                    //直连充电
                            test_type = 1;        //电池状态-浮充
                            break;
                        case 1:
                            test_type = 2;
                        case 1:                    //预充电
                            test_type = 2;        //电池状态-充电
                            break;
                        case 2:
                            test_type = 3;
                        case 2:                    //核容测试
                            test_type = 3;        //电池状态-放电
                            break;
                        case 3:
                            test_type = 3;
                        case 3:                    //停电放电
                            if(vc_data.battcurr[n] > 0 ) {
                                test_type = 2;        //电池状态-充电
                            }else {
                                test_type = 3;        //电池状态-放电
                            }
                            break;
                        case 4:
                            test_type = 1;
                        case 4:                    //内阻测试
                            test_type = 1;        //电池状态-浮充
                            break;
                        case 5:
                            test_type = 3;
                        case 5:                    //KD测试
                            test_type = 3;        //电池状态-放电
                            break;
                    }
                    
iec61850for118/src/com/dec/fbs9100/MyUtil.java
@@ -13,5 +13,18 @@
    
    public static void main(String[] args) {
        System.out.println(1&3);
        test();
    }
    private static void test() {
        int ss = 0;
        try {
            System.out.println(15/ss);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
iec61850for118/src/com/dec/fbs9100/main_BTS_APP_IEC61850.java
@@ -28,7 +28,7 @@
    /**************************************************************************/
    /**************************************************************************/
    public final static boolean app_debug = false;
    public final static double m_VersionNum = 3.504;
    public final static double m_VersionNum = 3.506;
    public final static String m_Version = "Welcome To Use BattMonitor_BTS_IEC61850 V" 
                                            + m_VersionNum + " RC_20201003";
    /**************************************************************************/
iec61850for118/src/com/version_inf/version_inf.txt
@@ -5,6 +5,15 @@
    均衡供电(旧版本)
    除硫模块
    均衡电流
V3.506 edit by lijun    @  2025-03-13
    1.修复在linux系统上Socket超时导致设备通信故障延迟较高
    2.修复在设备状态是停电放电时,电池组状态显示问题
        电流>0  电池状态-充电
        电流<0 电池状态-放电
V3.505 edit by lijun    @  2025-03-04
    1.修复因缓存导致,设备通信故障
    
V3.504 edit by lijun    @  2024-10-24
    1.新增交直流监控屏实时数据读取    
iec61850for118/src/org/openmuc/jositransport/TConnection.java
@@ -591,7 +591,11 @@
        int li = 0;
        int tPduCode;
        socket.setSoTimeout(messageTimeout);
        //System.err.println("超时时间:"+messageTimeout);
        //修复Linux环境下不超时,通信故障延迟严重问题
        //socket.setSoTimeout(messageTimeout);
        socket.setSoTimeout(30000);
        byte version;
        try {
            version = is.readByte();