春风项目四线(合箱线、总装线)
yyt
2024-01-22 4c41b4b3d7a61c105afd2942f7608c6308ef2e27
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/client/ClientHandler.java
@@ -227,12 +227,30 @@
    * @return {@link List<DataValue>}
    * @throws
    */
   public static List<DataValue> readValues(Set<String> keys){
      List<NodeId> nodeIdList=new ArrayList<>(500);
      keys.forEach(e->{
         NodeId nodeId = new NodeId(2, e);
         nodeIdList.add(nodeId);
      });
//   public static List<DataValue> readValues2(Set<String> keys){
//      List<NodeId> nodeIdList=new ArrayList<>(500);
//      keys.forEach(e->{
//         NodeId nodeId = new NodeId(2, e);
//         nodeIdList.add(nodeId);
//      });
//      try {
//         List<DataValue> dataValues=client.readValues(0.0, TimestampsToReturn.Both,nodeIdList).get();
//         return dataValues;
//      } catch (InterruptedException | ExecutionException e) {
//         e.printStackTrace();
//      }
//      return null;
//   }
   /**
    * 方法描述: 读取多个点位的值
    *
    * @param nodeIdList 点位集合
    * @return {@link List<DataValue>}
    * @throws
    */
   public static List<DataValue> readValues(List<NodeId> nodeIdList){
      try {
         List<DataValue> dataValues=client.readValues(0.0, TimestampsToReturn.Both,nodeIdList).get();
         return dataValues;