Selaa lähdekoodia

防止property2SDV无限增大

menglu 3 vuotta sitten
vanhempi
commit
5223678fc1

+ 3 - 1
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/data/SceneDataValue.java

@@ -25,7 +25,9 @@ public class SceneDataValue {
 		if (this.rel_property != null) {
 			if (this.rel_property.propertyValueType.equals("query") || this.rel_property.propertyValueType.equals("static")
 					|| this.rel_property.propertyValueType.equals("deamon")) {
-				Repository.property2SDV.get(this.rel_property).add(this);
+				if (Repository.property2SDV_enable) {
+					Repository.property2SDV.get(this.rel_property).add(this);
+				}
 			}
 		}
 

+ 3 - 0
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/ComputeUtil.java

@@ -57,6 +57,7 @@ public class ComputeUtil {
 		FastJsonUtil.Set_JavaObject(sceneJSON, sceneObject);
 		Repository.sceneObject = sceneObject;
 
+		Repository.property2SDV_enable = true;
 		Repository.property2SDV.clear();
 		ComputeUtil.RefreshRepository(Repository);
 		List<List<SceneProperty>> spListList = ComputeUtil.computePrepare(Repository);
@@ -67,6 +68,8 @@ public class ComputeUtil {
 		} catch (Exception e) {
 			log.error(e.getMessage(), e);
 		}
+		Repository.property2SDV_enable = false;
+		Repository.property2SDV.clear();
 	}
 
 	public static void RefreshRepository(Repository Repository) {

+ 1 - 0
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/Repository.java

@@ -60,6 +60,7 @@ public class Repository {
 	public SceneDataObject objectData;
 
 	// 属性到sdv清单
+	public boolean property2SDV_enable = true;
 	public Map<SceneProperty, List<SceneDataValue>> property2SDV = new HashMap<SceneProperty, List<SceneDataValue>>();
 	// 属性到锁
 	public Map<SceneProperty, ReentrantLock> property2lock = new HashMap<SceneProperty, ReentrantLock>();