iec61850_forFoShanAES_Model/src/com/dec/fbs9100/BTS_61850_SocketClient.java
@@ -69,6 +69,9 @@
   String FBSDeviceIp = "192.168.0.18";
   private List<BTS61850_EventRecord> events; // 事件记录表
   
   private int sign_type;                  //验签类型0-标准1托1   1-标准1托2
   private String ZJDYCPSS = "ZJDYCPSS";
   /*********************************************************************************************/
@@ -214,6 +217,10 @@
         
         while (true == Get_AppAliveState()) {
            try {
               if(null != m_RTData[0]) {
                  sign_type = m_RTData[0].sign_type;
               }
               if (m_StatAndParam != null) {
                  if (0 == (DevReadCount % 2)) {
                     FBS9100_Task_Thread_SQL.queryFbs9100SetParamBydev_id(m_ConnPool, m_StatAndParam); // 查询放电参数表
@@ -1188,25 +1195,25 @@
            sleep(1500);
             **************************************************************************/
            if (true == write_res_t) {
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para1.setMag.f")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para1.setMag.f")) return false;
               comm_res = writeNodeData(FBSDeviceName + "/ncdGGIO1.Para1.setMag.f", "SP",(float) m_StatAndParam.m_FBS_DiscParam.DisCurr);
               float dis_hour_t = m_StatAndParam.m_FBS_DiscParam.DisTime;
               dis_hour_t = dis_hour_t / 60;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para2.setMag.f")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para2.setMag.f")) return false;
               comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para2.setMag.f", "SP", (float) dis_hour_t);
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para3.setMag.f")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para3.setMag.f")) return false;
               comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para3.setMag.f", "SP",   (float) m_StatAndParam.m_FBS_DiscParam.DisCap);
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para4.setMag.f")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para4.setMag.f")) return false;
               comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para4.setMag.f", "SP",   (float) m_StatAndParam.m_FBS_DiscParam.getMonomerLowCount());
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para5.setMag.f")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para5.setMag.f")) return false;
               comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para5.setMag.f", "SP",   (float) m_StatAndParam.m_FBS_DiscParam.GroupVol_LOW);
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para6.setMag.f")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para6.setMag.f")) return false;
               comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para6.setMag.f", "SP",   (float) m_StatAndParam.m_FBS_DiscParam.MonomerVol_LOW);
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para7.setMag.f")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para7.setMag.f")) return false;
               comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para7.setMag.f", "SP",   (float) m_StatAndParam.m_FBS_DiscParam.MonomerTmp_High);
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/btgGGIO1.Para1.setMag.f")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/btgGGIO1.Para1.setMag.f")) return false;
               comm_res = comm_res&&writeNodeData(FBSDeviceName + "/btgGGIO1.Para1.setMag.f", "SP",   (float) m_StatAndParam.m_FBS_DiscParam.ChargeCurrSet);
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/btgGGIO1.Para2.setMag.f")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/btgGGIO1.Para2.setMag.f")) return false;
               comm_res = comm_res&&writeNodeData(FBSDeviceName + "/btgGGIO1.Para2.setMag.f", "SP",   (float) m_StatAndParam.m_FBS_DiscParam.DCVolHighLimit);
               
               //sleep(2000);
@@ -1280,7 +1287,7 @@
                                 FBSDeviceIp, m_FBS_DiscParamFromDev);
            //-------------------------------------------------------------------------------------//
         } else if (FBS9100_ComBase.CMD_Stop == cmd) {
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO1")) return false;
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO1")) return false;
            comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO1.Oper", false);
            int count = 1;
            if (m_FBS_VCData.m_SysState.WorkState == 2 || m_FBS_VCData.m_SysState.WorkState == 3) {
@@ -1295,21 +1302,21 @@
            logger.printf(Level.WARN, "DevIp:%s operate FBS9100_ComBase.CMD_Stop, res:%b", FBSDeviceIp, comm_res);
            //-------------------------------------------------------------------------------------//
         } else if (FBS9100_ComBase.CMD_StartDischarge == cmd) {
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO1")) return false;
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO1")) return false;
            comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO1.Oper", true);
            comm_res = checkMakeSuccess(0);
            //---------------------------------Log Level.WARN-------------------------------------//
            logger.printf(Level.WARN, "DevIp:%s DevId:%d operate FBS9100_ComBase.CMD_StartDischarge, res:%b", FBSDeviceIp,m_FBSDevId, comm_res);
            //-------------------------------------------------------------------------------------//
         } else if (FBS9100_ComBase.CMD_StartResDischarge == cmd) {
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO2")) return false;
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO2")) return false;
            comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO2.Oper", true);
            comm_res = checkMakeSuccess(2);
            //---------------------------------Log Level.WARN-------------------------------------//
            logger.printf(Level.WARN, "DevIp:%s operate FBS9100_ComBase.CMD_StartResDischarge, res:%b", FBSDeviceIp, comm_res);
            //-------------------------------------------------------------------------------------//
         } else if (FBS9100_ComBase.CMD_StartKIDI == cmd) {
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO3")) return false;
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO3")) return false;
            comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO3.Oper", true);
            comm_res = checkMakeSuccess(1);
            //---------------------------------Log Level.WARN-------------------------------------//
@@ -1356,13 +1363,13 @@
            long ip = Long.parseLong(Stringip.toString());
            // System.out.println("ip:"+ip);
            long ipWG = Long.parseLong(StringipWG.toString());
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para8.setMag.i")) return false;
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para8.setMag.i")) return false;
            comm_res = writeNodeDataInt(FBSDeviceName + "/ncdGGIO1.Para8.setMag.i", "SP", ip);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para9.setMag.i")) return false;
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para9.setMag.i")) return false;
            comm_res = comm_res&&writeNodeDataInt(FBSDeviceName + "/ncdGGIO1.Para9.setMag.i", "SP", ipWG);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para10.setMag.i")) return false;
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para10.setMag.i")) return false;
            comm_res = comm_res&&writeNodeDataInt(FBSDeviceName + "/ncdGGIO1.Para10.setMag.i", "SP", ipYM);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO5")) return false;
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO5")) return false;
            comm_res = comm_res&&BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO5.Oper", (FBS9100_ComBase.CMD_SetIp==cmd));
            //---------------------------------Log Level.WARN-------------------------------------//
            logger.printf(Level.WARN, "DevIp:%s operate FBS9100_ComBase.CMD_SetIp, op_bool:%b, "
@@ -1483,64 +1490,64 @@
                                 FBSDeviceIp, m_StatAndParam.clParam);
            //-------------------------------------------------------------------------------------//
         } else if (FBS9100_ComBase.CMD_WriteFodParam == cmd) {
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para12.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para12.setMag.f"));
            comm_res = writeNodeData(FBSDeviceName + "/ncdGGIO1.Para12.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.STDCap_one);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para13.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para13.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para13.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.FloatVol_one);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para14.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para14.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para14.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.Strength_one);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para15.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para15.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para15.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.YHStrength_one);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para16.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para16.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para16.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.TimeLong_one);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para18.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para18.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para18.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.STDCap_two);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para19.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para19.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para19.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.FloatVol_two);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para20.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para20.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para20.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.Strength_two);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para21.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para21.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para21.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.YHStrength_two);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para22.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para22.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para22.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.TimeLong_two);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para24.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para24.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para24.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.STDCap_three);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para25.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para25.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para25.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.FloatVol_three);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para26.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para26.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para26.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.Strength_three);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para27.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para27.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para27.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.YHStrength_three);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para28.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para28.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para28.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.TimeLong_three);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para30.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para30.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para30.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.STDCap_four);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para31.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para31.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para31.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.FloatVol_four);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para32.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para32.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para32.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.Strength_four);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para33.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para33.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para33.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.YHStrength_four);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para34.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para34.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para34.setMag.f", "SP",
                  (float) m_StatAndParam.clParam.TimeLong_four);
            //comm_res = true;
@@ -1555,19 +1562,19 @@
            // System.out.println(m_StatAndParam.clParam.num);
            switch (m_StatAndParam.clParam.GroupNum) {
            case 1:{
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO6")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO6")) return false;
               comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO6.Oper", true); // 模块1除硫
            }break;
            case 2:{
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO7")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO7")) return false;
               comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO7.Oper", true); // 模块21除硫
            }break;
            case 3:{
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO8")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO8")) return false;
               comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO8.Oper", true); // 模块31除硫
            }break;
            case 4:{
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO9")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO9")) return false;
               comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO9.Oper", true); // 模块41除硫
            }break;
            }
@@ -1580,27 +1587,27 @@
            // System.out.println(m_StatAndParam.clParam.GroupNum);
            switch (m_StatAndParam.clParam.GroupNum) {
               case 1:{
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO6"));
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO6"));
                  comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO6.Oper", false);
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO10"));
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO10"));
                  comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO10.Oper", false);
               }break;
               case 2:{
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO7"));
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO7"));
                  comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO7.Oper", false);
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO11"));
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO11"));
                  comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO11.Oper", false);
               }break;
               case 3:{
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO8")) return false;
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO8")) return false;
                  comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO8.Oper", false);
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCS12"));
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCS12"));
                  comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCS12.Oper", false);
               }break;
               case 4:{
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO9")) return false;
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO9")) return false;
                  comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO9.Oper", false);
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO13"));
                  if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO13"));
                  comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO13.Oper", false);
               }break;
            }
@@ -1612,19 +1619,19 @@
         } else if (FBS9100_ComBase.CMD_Start_FODYH_test == cmd) {
            switch (m_StatAndParam.clParam.GroupNum) {
            case 1:{
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO10")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO10")) return false;
               comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO10.Oper", true);
            }break;
            case 2:{
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO11")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO11")) return false;
               comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO11.Oper", true);
            }break;
            case 3:{
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO12")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO12")) return false;
               comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO12.Oper", true);
            }break;
            case 4:{
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO13")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO13")) return false;
               comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO13.Oper", true);
            }break;
            }
@@ -1660,16 +1667,16 @@
            boolean write_res_t = true;
            if (true == write_res_t) {
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para35.setMag.f")) return false;
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para35.setMag.f")) return false;
               // 离线养护周期
               comm_res = writeNodeData(FBSDeviceName + "/ncdGGIO1.Para35.setMag.f", "SP",
                     (float) m_StatAndParam.m_FBS_DiscParam.OffLineYH_Cycle);
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para36.setMag.f"));
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para36.setMag.f"));
               // 在线压低
               comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para36.setMag.f", "SP",
                     (float) m_StatAndParam.m_FBS_DiscParam.OnLineVol_Low);
               sleep(1500);
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para7.setMag.f"));
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para7.setMag.f"));
               // 单体温度上限
               comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para7.setMag.f", "SP",
                     (float) m_StatAndParam.m_FBS_DiscParam.MonomerTmp_High);
@@ -1684,21 +1691,21 @@
                              m_StatAndParam.m_FBS_DiscParam.MonomerTmp_High);
            //------------------------------------------------------------------------------------//
         } else if (FBS9100_ComBase.CMD_StartOffLineYH == cmd) {
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO14")) return false;
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO14")) return false;
            comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO14.Oper", true);
            comm_res = checkMakeSuccess(5);
            //---------------------------------Log Level.WARN-------------------------------------//
            logger.printf(Level.WARN, "DevIp:%s operate FBS9100_ComBase.CMD_StartOffLineYH, res:%b", FBSDeviceIp, comm_res);
            //------------------------------------------------------------------------------------//
         } else if (FBS9100_ComBase.CMD_StopOffLineYH == cmd) {
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO14")) return false;
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO14")) return false;
            comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO14.Oper", false);
            comm_res = checkMakeSuccess(10);
            //---------------------------------Log Level.WARN-------------------------------------//
            logger.printf(Level.WARN, "DevIp:%s operate FBS9100_ComBase.CMD_StopOffLineYH, res:%b", FBSDeviceIp, comm_res);
            //------------------------------------------------------------------------------------//
         } else if (FBS9100_ComBase.CMD_ResetSystem == cmd) {
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO4")) return false;
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO4")) return false;
            comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO4.Oper", true);
            //判断最终验签验证结果
            comm_res = checkSysRestartState();
@@ -1729,30 +1736,30 @@
                              + "\n m_FBS_SysParam param:%s ", FBSDeviceIp, m_FBS_SysParam);
            //-------------------------------------------------------------------------------------//
         } else if (FBS9100_ComBase.CMD_SetSYSSetParam == cmd) {
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para37.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para37.setMag.f"));
            // 电压过低阀值
            comm_res = writeNodeData(FBSDeviceName + "/ncdGGIO1.Para37.setMag.f", "SP",
                  (float) m_FBS_SysParam.POF_BG_Boost_VolStart);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para38.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para38.setMag.f"));
            // 电压过高阀值
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para38.setMag.f", "SP",
                  (float) m_FBS_SysParam.POF_BG_Boost_VolStop);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para39.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para39.setMag.f"));
            // 电流异常阀值
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para39.setMag.f", "SP",
                  (float) m_FBS_SysParam.PowerBreakChargeCurr);
            sleep(1500);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para40.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para40.setMag.f"));
            // 浮充电流阀值
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para40.setMag.f", "SP",
                  ((float) m_FBS_SysParam.CurrentTyte) / 10);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para41.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para41.setMag.f"));
            // 在线电压低阀值
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para41.setMag.f", "SP",
                  ((float) m_FBS_SysParam.GroupVolSorce) / 10);
            sleep(1500);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para42.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.Para42.setMag.f"));
            // 设置主从机模式
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para42.setMag.f", "SP", ((float) m_FBS_SysParam.MonomerOrder));
            
@@ -1762,7 +1769,7 @@
            logger.printf(Level.WARN, "DevIp:%s operate FBS9100_ComBase.CMD_SetSYSSetParam: %s", FBSDeviceIp, m_FBS_SysParam);
            //------------------------------------------------------------------------------------//
         } else if (FBS9100_ComBase.CMD_ClearSysAlarm == cmd) {
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO15")) return false;
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SPCSO15")) return false;
            // 清除设备告警
            comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO15.Oper", true);
            //---------------------------------Log Level.WARN-------------------------------------//
@@ -1781,19 +1788,19 @@
            //      "JunHeng_StCurr;"+m_FBS_SysParam.JunHeng_StCurr + "\t");
         
         }else if(FBS9100_ComBase.CMD_SetJuHengParam == cmd) {
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/btgGGIO1.Para3.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/btgGGIO1.Para3.setMag.f"));
            //均衡功能启用状态
            comm_res = writeNodeData(FBSDeviceName + "/btgGGIO1.Para3.setMag.f", "SP",   m_FBS_SysParam.JunHeng_Enabled*1000);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/btgGGIO1.Para4.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/btgGGIO1.Para4.setMag.f"));
            //均衡停止电压阀值
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/btgGGIO1.Para4.setMag.f", "SP",(float)m_FBS_SysParam.JunHeng_StVol);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/btgGGIO1.Para5.setMag.f"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/btgGGIO1.Para5.setMag.f"));
            //均衡停止电流阀值
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/btgGGIO1.Para5.setMag.f", "SP",(float)m_FBS_SysParam.JunHeng_StCurr);
         
         }else if(FBS9100_ComBase.CMD_UpdateXZTime == cmd) {
            long time_l = Long.parseLong(Com.get_DTF(m_StatAndParam.m_FBS_DiscParam.OffLineYHstarttime, Com.DTFYMDhms));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SysTime_SYS.setMag.i"));
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/ncdGGIO1.SysTime_SYS.setMag.i"));
            comm_res = writeNodeData_Int64(FBSDeviceName + "/ncdGGIO1.SysTime_SYS.setMag.i", "SP",time_l);
            logger.printf(Level.WARN, "DevIp:%s operate FBS9100_ComBase.CMD_UpdateXZTime , SetTime:"+Com.getDateTimeFormat(m_StatAndParam.m_FBS_DiscParam.OffLineYHstarttime, Com.DTFYMDhms), FBSDeviceIp);
         }
@@ -2195,15 +2202,15 @@
               double minvol = getMinMonomerVol(vc_data.vol);
               // System.out.println("maxvol:"+maxvol);
               // System.out.println("minvol:"+minvol);
               m_FBS_DiscParamFromDev.HourRate = (int) GetHourRate(MonVolStd, vc_data.battcurr[n]);
               float restcap = getResCapData(MonStdCap, m_FBS_DiscParamFromDev.HourRate, vc_data.battcap[n],
                     maxvol, minvol, MonVolStd, CapType_Rest);
               float realcap = getResCapData(MonStdCap, m_FBS_DiscParamFromDev.HourRate, vc_data.battcap[n],
                     maxvol, minvol, MonVolStd, CapType_Real);
//               m_FBS_DiscParamFromDev.HourRate = (int) GetHourRate(MonVolStd, vc_data.battcurr[n]);
//               float restcap = getResCapData(MonStdCap, m_FBS_DiscParamFromDev.HourRate, vc_data.battcap[n],
//                     maxvol, minvol, MonVolStd, CapType_Rest);
//               float realcap = getResCapData(MonStdCap, m_FBS_DiscParamFromDev.HourRate, vc_data.battcap[n],
//                     maxvol, minvol, MonVolStd, CapType_Real);
               // System.out.println("restcap"+restcap);
               // System.out.println("realcap"+realcap);
               m_RTData[n].mTestData.updatebattRestCap(restcap);
               m_RTData[n].mTestData.updatebattRealCap(realcap);
               //m_RTData[n].mTestData.updatebattRestCap(restcap);
               //m_RTData[n].mTestData.updatebattRealCap(realcap);
               // System.out.println(mTestData.battRestCap);
               m_RTData[n].updata_BattRtData_To_RamDb();
               m_RTData[n].updata_BattRtSate_To_RamDb();
@@ -2235,7 +2242,7 @@
    * @param agree
    * @return
    */
   public static String getUKEYRootDomStr(String agree) {
   public static String getUKEYRootDomStr(String agree,int sign_type) {
      String str1=agree.substring(0, agree.indexOf("BTSE"));
      /**
       * @lijun 兼容佛山三期版本,签名中的BTSE路径一拖一和一拖二均为BTSE
@@ -2243,11 +2250,14 @@
//      if(str1.length() > 0) {
//         return "BTSE";
//      }
      if(sign_type == BattData_RT.SIGN_TYPE_Default) {
         return "BTSE";
      }
       return agree.substring(str1.length(), agree.length());
   }
   
   public static void main(String[] args) {
      System.out.println(getUKEYRootDomStr("ZJDYBTSE2"));
      System.out.println(getUKEYRootDomStr("ZJDYBTSE",0));
      String btsid = "1234567890BTSE/ncdGGIO1.SPCSO2";
      String keyid = "37395256AD72043037395256AD720430";