DELL
2024-04-19 cfe3b8044b61ced5772914bfbbdc629fbedf4bd5
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";
   /*********************************************************************************************/
@@ -152,7 +155,7 @@
            m_ClientSap = new ClientSap();
            m_Association = m_ClientSap.associate(InetAddress.getByName(FBSDeviceIp), 102, null, null);
            
            if(!FBSDeviceName.contains(m_ServerModel.getBaseDevName())) {
            if(!FBSDeviceName.contains(m_ServerModel.getBaseDevName()) || null == m_ServerModel) {
               //与预加载的模型文件不一致时
               m_ServerModel = m_Association.retrieveModel();
            }
@@ -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); // 查询放电参数表
@@ -230,6 +237,8 @@
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_SetDischargeParmAck;
                     
                        test_Param.copyBTS61850Param(m_StatAndParam.m_FBS_DiscParam);
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  } else if (FBS9100_ComBase.CMD_Start == m_FBS_DiscParam.op_cmd) {
                     logger.printf(Level.DEBUG, "FBS9100_ComBase.CMD_Start for Dev ip:%s", FBSDeviceIp);
@@ -237,6 +246,8 @@
                     if (true == BTS_IEC61850_SocketComm(cmd)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_StartAck;
                     } else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                        if(cmd == FBS9100_ComBase.CMD_StartDischarge) {
                           int errcode = (int) (readInt64NodeData(FBSDeviceName + "/btgGGIO1.AnIn28.mag.i",Fc.MX));
                           logger.debug("Dev ip:"+m_StatAndParam.dev_ipaddr + ": failed to start cap test, errcode:" + errcode);
@@ -245,6 +256,8 @@
                  } else if (FBS9100_ComBase.CMD_Stop == m_FBS_DiscParam.op_cmd) {
                     if (true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_Stop)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_StopAck;
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  } else if (FBS9100_ComBase.CMD_GetDischargeParm == m_FBS_DiscParam.op_cmd) {
                     if (true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_GetDischargeParm)) {
@@ -264,10 +277,14 @@
                     if (true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_SetIp)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_SetIpAck;
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  } else if (FBS9100_ComBase.CMD_SetIpNow == m_FBS_DiscParam.op_cmd) {
                     if (true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_SetIpNow)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_SetIpAck;
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  } else if (FBS9100_ComBase.CMD_GetOffLineYHParam == m_FBS_DiscParam.op_cmd) {
                     // 读取离线养护参数
@@ -287,25 +304,35 @@
                        m_StatAndParam.bts61850_OffLineYHPlan.copyOffLineYHData(m_FBS_DiscParam);
                        m_StatAndParam.bts61850_OffLineYHPlan.successCount = 0; // 重置成功次数
                        FBS9100_Task_Thread_SQL.updateBTS61850OffLineyhPlanOnRam(m_ConnPool, m_StatAndParam);
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  } else if (FBS9100_ComBase.CMD_StartOffLineYH == m_FBS_DiscParam.op_cmd) {
                     // 启动离线养护
                     if (true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_StartOffLineYH)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_StartOffLineYH_ACK;
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  } else if (FBS9100_ComBase.CMD_StopOffLineYH == m_FBS_DiscParam.op_cmd) {
                     // 停止离线养护
                     if (true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_StopOffLineYH)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_StopOffLineYH_ACK;
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  } else if (FBS9100_ComBase.CMD_ResetSystem == m_FBS_DiscParam.op_cmd) {
                     // 重启系统
                     if (true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_ResetSystem)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_ResetSystemAck;
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  } else if(FBS9100_ComBase.CMD_UpdateXZTime == m_FBS_DiscParam.op_cmd) {
                     if (true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_UpdateXZTime)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_UpdateXZTimeAck;
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  }
@@ -323,11 +350,15 @@
                     // 设置系统参数
                     if (true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_SetSYSSetParam)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_SetSYSSetParamAck;
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  } else if (FBS9100_ComBase.CMD_ClearSysAlarm == m_FBS_SysParam.op_cmd) {
                     // 清除告警
                     if (true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_ClearSysAlarm)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_ClearSysAlarm_ACK;
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  } else if(FBS9100_ComBase.CMD_GetJuHengParam == m_FBS_SysParam.op_cmd) {
                     //获取均衡参数
@@ -339,6 +370,8 @@
                     //设置均衡参数
                     if(true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_SetJuHengParam)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_SetJuHengParamAck;
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  }
                  FBS9100_Task_Thread_SQL.updateFbs9100SysParamCmdBydev_id(m_ConnPool, m_StatAndParam);
@@ -357,18 +390,26 @@
                  } else if (FBS9100_ComBase.CMD_WriteFodParam == cl_param.op_cmd) {
                     if (true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_WriteFodParam)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_WriteFodParamSus;
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  } else if (FBS9100_ComBase.CMD_Start_FODCL_test == cl_param.op_cmd) {
                     if (true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_Start_FODCL_test)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_Start_FODCL_testSus;
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  } else if (FBS9100_ComBase.CMD_Stop_FOD_test == cl_param.op_cmd) {
                     if (true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_Stop_FOD_test)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_Stop_FOD_testSus;
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  } else if (FBS9100_ComBase.CMD_Start_FODYH_test == cl_param.op_cmd) {
                     if (true == BTS_IEC61850_SocketComm(FBS9100_ComBase.CMD_Start_FODYH_test)) {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_Start_FODYH_testSus;
                     }else {
                        m_StatAndParam.op_cmd = FBS9100_ComBase.CMD_FAIL;
                     }
                  }
                  FBS9100_Task_Thread_SQL.updateCL9100SetParamCmdBydev_id(m_ConnPool, m_StatAndParam);
@@ -529,11 +570,11 @@
    * @throws IOException
    * @throws ServiceError
    *******************************************************************************************/
   public void writeNodeData(String reference, String fc_str, double disCurr) {
   public boolean writeNodeData(String reference, String fc_str, double disCurr) {
      FcModelNode fcModelNode = (FcModelNode) m_ServerModel.findModelNode(reference, Fc.fromString(fc_str));
      if (null == fcModelNode) {
         logger.error(reference+"writeNodeData error, no modenode was found....." + reference);
         return;
         return false;
      }
      try {
@@ -545,10 +586,11 @@
         data.write();
         m_Association.setDataValues(fcModelNode);
         m_FBS_VCData.m_SysState.resetErrCommCount();
         return true;
      } catch (ServiceError | IOException e) {
         logger.error(e.toString(), e);
         m_FBS_VCData.m_SysState.addErrCommCount();
         return;
         return false;
      }
   }
   
@@ -572,20 +614,20 @@
      }
   }
   public void writeNodeData_Int64(String reference, String fc_str, long dat) {
   public boolean writeNodeData_Int64(String reference, String fc_str, long dat) {
      FcModelNode fcModelNode = (FcModelNode) m_ServerModel.findModelNode(reference, Fc.fromString(fc_str)).copy();
      if (null == fcModelNode) {
         logger.error("writeNodeDataInt error, no modenode was found.....");
         return;
         return false;
      }
      try {
         ((BdaInt64)fcModelNode).setValue(dat);
         m_Association.setDataValues(fcModelNode);
         return true;
      } catch (ServiceError | IOException e) {
         logger.error(e.toString(), e);
         return;
         return false;
      }
   }
   
@@ -617,12 +659,12 @@
      }
   }
   
   public void writeNodeDataInt(String reference, String fc_str, long disCurr) {
   public boolean writeNodeDataInt(String reference, String fc_str, long disCurr) {
      FcModelNode fcModelNode = (FcModelNode) m_ServerModel.findModelNode(reference, Fc.fromString(fc_str));
      if (null == fcModelNode) {
         logger.error("writeNodeDataInt error, no modenode was found.....");
         m_FBS_VCData.m_SysState.addErrCommCount();
         return;
         return false;
      }
      try {
@@ -634,10 +676,11 @@
         data.write();
         m_Association.setDataValues(fcModelNode);
         m_FBS_VCData.m_SysState.resetErrCommCount();
         return false;
      } catch (ServiceError | IOException e) {
         logger.error(e.toString(), e);
         m_FBS_VCData.m_SysState.addErrCommCount();
         return;
         return false;
      }
   }
@@ -748,7 +791,7 @@
            return null;
        } catch (IOException e) {
           m_FBS_VCData.m_SysState.addErrCommCount();
            System.out.println("Fatal error: " + e.getMessage());
           System.err.println(reference + " Fatal error: " + e.getMessage());
            return null;
        }
       return res_val;  //控制节点TRUE FALSE 
@@ -767,20 +810,9 @@
           m_Association.getDataValues(fcModelNode);  
           m_FBS_VCData.m_SysState.resetErrCommCount();
           ModelNode fc_mode = fcModelNode;
           String a[]= null;
           a = new String[5];
           a = (fc_mode.toString()).split(":");
           res_val = a[2];
           //System.out.println(a[3]);
           String split[]= null;
           split = new String[5];
           split = (res_val.toString()).split(", ");
           String result[]= null;
           result = new String[2];
           result[0] = split[0];
           result[1] = a[3];
           resul = String.format("%s,%s", result);
           if(fc_mode instanceof BdaVisibleString) {
              resul = new String(((BdaVisibleString)fc_mode).getValue());
           }
        } catch (ServiceError e) {
            System.out.println("Service error: " + e.getMessage());
            m_FBS_VCData.m_SysState.addErrCommCount();
@@ -794,7 +826,6 @@
        //System.out.println(resul);
       return resul;  //控制节点TRUE FALSE 
    }
   /*********************************************************************************************/
   public boolean BTS_IEC61850_SocketComm(int cmd) throws InterruptedException {
@@ -804,12 +835,15 @@
            events.clear();
            
            if(0 == (numberDevState%3)) {
               System.out.println();
               //---------------------------------Log Level.TRACE-------------------------------------//
               logger.printf(Level.TRACE, "m_ServerModel.getDataSet(%s/LLN0.dsMeasure)", FBSDeviceName);
               //-------------------------------------------------------------------------------------//
               //-------------------------------------------------------------------------------------//
               DataSet ds = m_ServerModel.getDataSet(FBSDeviceName + "/LLN0.dsMeasure").copy();
               DataSet tmp_ds = m_ServerModel.getDataSet(FBSDeviceName + "/LLN0.dsMeasure");
               if(null == tmp_ds) {
                  return false;
               }
               DataSet ds = tmp_ds.copy();
               int size_cnt = ds.getMembers().size();
               m_Association.getDataSetValues(ds);
               int m = 0;
@@ -958,7 +992,12 @@
                        else if ((n >= (m + 24 * 2)) && (n < (m + 24 * 3))) {
                           m_FBS_VCData.tmp[n - (m + 24 * 2)] = ((BdaFloat32) fc_mode).getFloat();
                        }
                        //跳过剩余剩余容量
                        else if ((n >= (m + 24 * 3)) && (n < (m + 24 * 4))) {
                           m_FBS_VCData.mon_rest_cap[n - (m + 24 * 3)] = ((BdaFloat32) fc_mode).getFloat();
                        }
                        else if ((n >= (m + 24 * 4)) && (n < (m + 24 * 5))) {
                           m_FBS_VCData.mon_JH[n - (m + 24 * 4)] = ((BdaFloat32) fc_mode).getFloat();
                        }
@@ -1000,7 +1039,11 @@
               logger.printf(Level.TRACE, "m_ServerModel.getDataSet(%s/LLN0.dsDevAlarm)", FBSDeviceName);
               //-------------------------------------------------------------------------------------//
               String c[] = null;
               DataSet ds_stat = m_ServerModel.getDataSet(FBSDeviceName + "/LLN0.dsDevAlarm");
               DataSet tmp_ds_stat = m_ServerModel.getDataSet(FBSDeviceName + "/LLN0.dsDevAlarm");
               if(null == tmp_ds_stat) {
                  return false;
               }
               DataSet ds_stat = tmp_ds_stat.copy();
               int size_cnt_stat = ds_stat.getMembers().size();
               c = new String[size_cnt_stat];
               String[] split = null;
@@ -1034,7 +1077,12 @@
               logger.printf(Level.TRACE, "m_ServerModel.getDataSet(%s/LLN0.dsDevState )", FBSDeviceName);
               //-------------------------------------------------------------------------------------//
               comm_res = true;
               DataSet ds = m_ServerModel.getDataSet(FBSDeviceName + "/LLN0.dsDevState");
               DataSet tmp_ds = m_ServerModel.getDataSet(FBSDeviceName + "/LLN0.dsDevState");
               if(null == tmp_ds) {
                  return false;
               }
               DataSet ds = tmp_ds.copy();
               int size_cnt = ds.getMembers().size();
               //System.out.println(FBSDeviceName + "/LLN0.dsDevState 节点数:"+size_cnt);
               m_Association.getDataSetValues(ds);
@@ -1140,26 +1188,26 @@
            sleep(1500);
             **************************************************************************/
            if (true == write_res_t) {
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para1.setMag.f")) return false;
               writeNodeData(FBSDeviceName + "/ncdGGIO1.Para1.setMag.f", "SP",(float) m_StatAndParam.m_FBS_DiscParam.DisCurr);
               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;
               writeNodeData(FBSDeviceName + "/ncdGGIO1.Para2.setMag.f", "SP", (float) dis_hour_t);
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para3.setMag.f")) return false;
               writeNodeData(FBSDeviceName + "/ncdGGIO1.Para3.setMag.f", "SP",   (float) m_StatAndParam.m_FBS_DiscParam.DisCap);
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para4.setMag.f")) return false;
               writeNodeData(FBSDeviceName + "/ncdGGIO1.Para4.setMag.f", "SP",   (float) m_StatAndParam.m_FBS_DiscParam.getMonomerLowCount());
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para5.setMag.f")) return false;
               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;
               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;
               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;
               writeNodeData(FBSDeviceName + "/btgGGIO1.Para1.setMag.f", "SP",   (float) m_StatAndParam.m_FBS_DiscParam.ChargeCurrSet);
               if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/btgGGIO1.Para2.setMag.f")) return false;
               writeNodeData(FBSDeviceName + "/btgGGIO1.Para2.setMag.f", "SP",   (float) m_StatAndParam.m_FBS_DiscParam.DCVolHighLimit);
               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,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,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,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,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,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,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,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);
            }
@@ -1167,7 +1215,7 @@
            logger.printf(Level.WARN, "DevIp:%s operate FBS9100_ComBase.CMD_SetDischargeParm, \n param:%s", 
                                 FBSDeviceIp, m_FBS_DiscParamFromDev);
            //-------------------------------------------------------------------------------------//
            comm_res = true;
            //comm_res = true;
         } else if (FBS9100_ComBase.CMD_GetDischargeParm == cmd) {
            DataSet ds_pm = m_ServerModel.getDataSet(FBSDeviceName + "/LLN0.dsDevState");
            if(null != ds_pm && null !=  ds_pm.getMembers()) {
@@ -1232,7 +1280,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) {
@@ -1247,21 +1295,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-------------------------------------//
@@ -1308,14 +1356,14 @@
            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;
            writeNodeDataInt(FBSDeviceName + "/ncdGGIO1.Para8.setMag.i", "SP", ip);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para9.setMag.i")) return false;
            writeNodeDataInt(FBSDeviceName + "/ncdGGIO1.Para9.setMag.i", "SP", ipWG);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para10.setMag.i")) return false;
            writeNodeDataInt(FBSDeviceName + "/ncdGGIO1.Para10.setMag.i", "SP", ipYM);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.SPCSO5")) return false;
            comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName + "/ncdGGIO1.SPCSO5.Oper", (FBS9100_ComBase.CMD_SetIp==cmd));
            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,sign_type)+"/ncdGGIO1.Para9.setMag.i")) return false;
            comm_res = comm_res&&writeNodeDataInt(FBSDeviceName + "/ncdGGIO1.Para9.setMag.i", "SP", ipWG);
            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,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, "
                                 + "newip:%ld, netmask:%ld, gateway:%ld", 
@@ -1435,67 +1483,67 @@
                                 FBSDeviceIp, m_StatAndParam.clParam);
            //-------------------------------------------------------------------------------------//
         } else if (FBS9100_ComBase.CMD_WriteFodParam == cmd) {
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/ncdGGIO1.Para12.setMag.f"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para12.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para13.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para14.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para15.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para16.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para18.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para19.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para20.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para21.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para22.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para24.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para25.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para26.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para27.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para28.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para30.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para31.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para32.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para33.setMag.f", "SP",
            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"));
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para34.setMag.f", "SP",
            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;
            //comm_res = true;
            //---------------------------------Log Level.WARN-------------------------------------//
            logger.printf(Level.WARN, "DevIp:%s operate FBS9100_ComBase.CMD_WriteFodParam, \n param:%s", 
                                 FBSDeviceIp, m_StatAndParam.clParam);
@@ -1507,19 +1555,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;
            }
@@ -1532,27 +1580,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;
            }
@@ -1564,19 +1612,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;
            }
@@ -1612,21 +1660,21 @@
            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;
               // 离线养护周期
               writeNodeData(FBSDeviceName + "/ncdGGIO1.Para35.setMag.f", "SP",
               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"));
               // 在线压低
               writeNodeData(FBSDeviceName + "/ncdGGIO1.Para36.setMag.f", "SP",
               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"));
               // 单体温度上限
               writeNodeData(FBSDeviceName + "/ncdGGIO1.Para7.setMag.f", "SP",
               comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para7.setMag.f", "SP",
                     (float) m_StatAndParam.m_FBS_DiscParam.MonomerTmp_High);
            }
            comm_res = true;
            //comm_res = true;
            //---------------------------------Log Level.WARN-------------------------------------//
            logger.printf(Level.WARN, "DevIp:%s operate FBS9100_ComBase.CMD_SetOffLineYHParam:" 
                              + " OffLineYH_Cycle:%d, OnLineVol_Low:%1.1fV, MonomerTmp_High:%1.3f℃",
@@ -1636,22 +1684,24 @@
                              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();
            //---------------------------------Log Level.WARN-------------------------------------//
            logger.printf(Level.WARN, "DevIp:%s operate FBS9100_ComBase.CMD_ResetSystem, res:%b", FBSDeviceIp, comm_res);
            //------------------------------------------------------------------------------------//
@@ -1679,32 +1729,32 @@
                              + "\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"));
            // 电压过低阀值
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para37.setMag.f", "SP",
            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"));
            // 电压过高阀值
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para38.setMag.f", "SP",
            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"));
            // 电流异常阀值
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para39.setMag.f", "SP",
            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"));
            // 浮充电流阀值
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para40.setMag.f", "SP",
            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"));
            // 在线电压低阀值
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para41.setMag.f", "SP",
            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"));
            // 设置主从机模式
            writeNodeData(FBSDeviceName + "/ncdGGIO1.Para42.setMag.f", "SP", ((float) m_FBS_SysParam.MonomerOrder));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/ncdGGIO1.Para42.setMag.f", "SP", ((float) m_FBS_SysParam.MonomerOrder));
            
            
            comm_res = true;
@@ -1712,7 +1762,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-------------------------------------//
@@ -1731,25 +1781,24 @@
            //      "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"));
            //均衡功能启用状态
            writeNodeData(FBSDeviceName + "/btgGGIO1.Para3.setMag.f", "SP",   m_FBS_SysParam.JunHeng_Enabled*1000);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/btgGGIO1.Para4.setMag.f"));
            comm_res = writeNodeData(FBSDeviceName + "/btgGGIO1.Para3.setMag.f", "SP",   m_FBS_SysParam.JunHeng_Enabled*1000);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/btgGGIO1.Para4.setMag.f"));
            //均衡停止电压阀值
            writeNodeData(FBSDeviceName + "/btgGGIO1.Para4.setMag.f", "SP",(float)m_FBS_SysParam.JunHeng_StVol);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName)+"/btgGGIO1.Para5.setMag.f"));
            comm_res = comm_res&&writeNodeData(FBSDeviceName + "/btgGGIO1.Para4.setMag.f", "SP",(float)m_FBS_SysParam.JunHeng_StVol);
            if(!setBTSPublicKeyY(getUKEYRootDomStr(FBSDeviceName,sign_type)+"/btgGGIO1.Para5.setMag.f"));
            //均衡停止电流阀值
            writeNodeData(FBSDeviceName + "/btgGGIO1.Para5.setMag.f", "SP",(float)m_FBS_SysParam.JunHeng_StCurr);
            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"));
            writeNodeData_Int64(FBSDeviceName + "/ncdGGIO1.SysTime_SYS.setMag.i", "SP",time_l);
            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);
         }
         comm_res = true;
         //comm_res = true;
      } catch (Exception e) {
         // TODO Auto-generated catch block
         logger.error(e.toString(), e);
         
         m_FBS_VCData.m_SysState.setErrCommCountInc(0);
@@ -1788,6 +1837,39 @@
      }
      return success;
   }
   //判断操作验签返回结果
   public boolean checkSysRestartState() {
      boolean success = false;
      try {
         Thread.sleep(500);
      } catch (InterruptedException e1) {
         logger.error(e1.toString(), e1);
      }
      int okcount = 0;
      for (int i = 0; i < 55; i++) {
         int value = (int) (readInt64NodeData(FBSDeviceName + "/btgGGIO1.signOpRes.mag.i", Fc.MX));
         System.out.println("signOpRes====="+value);
         if (value == 1) {
            //logger.error(m_FBS_SysParam.dev_id+":"+count+"操作结果:" + value+"==="+MyUtil.power(2, count)+Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms));
            okcount++;
            if (okcount >= 3) {
               // System.out.println("校验成功===="+i);
               success = true;
               break;
            }
         } else {
            okcount = 0;
         }
         try {
            sleep(100);
         } catch (InterruptedException e) {
            logger.error(e.toString(), e);
         }
      }
      return success;
   }
   // int min = Arrays.stream(m_FBS_VCData.vol).min().getAsInt();
   // System.out.println(min);
@@ -2053,6 +2135,7 @@
                  m_RTData[n].al_MonVol.get(index).monRes = (float) vc_data.res[mon_index];
                  m_RTData[n].al_MonVol.get(index).monTmp = (float) vc_data.tmp[mon_index];
                  m_RTData[n].al_MonVol.get(index).mon_JH_curr = (float) vc_data.mon_JH[mon_index];
                  m_RTData[n].al_MonVol.get(index).mon_rest_cap = (float) vc_data.mon_rest_cap[mon_index];
                  mon_index++;
               }
@@ -2113,15 +2196,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();
@@ -2153,7 +2236,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
@@ -2161,17 +2244,49 @@
//      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";
      
      System.out.println(createSignature(btsid, keyid));
   }
   /**
    *    更新电池组数据
    *
    * @param vc_data
    */
   private void getFBS9100MonAlmData(FBS9100_VCData vc_data) {
      {
         int mon_index = 0;
         for (int n = 0; n < FBS9100_ComBase.BattGroupCountMax; n++) {
            if (null != m_RTData[n]) {
               for (int index = 0; index < m_RTData[n].MonCount; index++) {
                  if (mon_index >= FBS9100_ComBase.MonomerCountMax) {
                     break;
                  }
                  m_RTData[n].al_MonVol.get(index).monvol_alm =  vc_data.monvol_alm[mon_index];
                  m_RTData[n].al_MonVol.get(index).monres_alm =  vc_data.monres_alm[mon_index];
                  m_RTData[n].al_MonVol.get(index).montmp_alm =  vc_data.montmp_alm[mon_index];
                  m_RTData[n].al_MonVol.get(index).monrestcap_alm = vc_data.moncap_alm[mon_index];
                  mon_index++;
               }
               m_RTData[n].updata_BattRtAlARM_To_RamDb();
               BTS61850_Task_Thread_SQL.updateBattRtState_Table(m_ConnPool,vc_data,m_RTData);
               // ---------------------------------------------------------------------------//
            }
         }
      }
   }
   /*********************************************************************************************/
}
/*********************************