Prechádzať zdrojové kódy

支持app,增加info_replace和ConfigRelation
0.1.8

menglu 3 rokov pred
rodič
commit
4b1a72ff2a

BIN
ibms-data-sdk/img/bad/Cry1.bmp


BIN
ibms-data-sdk/img/bad/Cry2.bmp


BIN
ibms-data-sdk/img/good/Laugh1.bmp


BIN
ibms-data-sdk/img/good/Laugh2.bmp


+ 1 - 1
ibms-data-sdk/pom.xml

@@ -2,7 +2,7 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>com.persagy</groupId>
 	<artifactId>ibms-data-sdk</artifactId>
-	<version>0.1.7</version>
+	<version>0.1.8</version>
 
 	<repositories>
 		<repository>

+ 12 - 6
ibms-data-sdk/src/main/java/a/A.java

@@ -25,7 +25,7 @@ import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
 public class A {
-	private static boolean printOne(File file, boolean index_rand, int index) {
+	private static boolean printImage(File file, boolean index_rand, int index, long millisecond, int cycle_count) {
 		try {
 			if (!file.exists()) {
 				return false;
@@ -56,9 +56,15 @@ public class A {
 			BufferedImage bi = ImageIO.read(is);
 			is.close();
 			List<String> strList = ImageUtil.toStringList(bi, false);
-			for (String str : strList) {
-				System.out.println(str);
-				// log.error(str);
+			for (int i = 0; i < cycle_count; i++) {
+				for (String str : strList) {
+					System.out.println(str);
+					// log.error(str);
+				}
+				if (i < cycle_count - 1) {
+					System.out.print("\n\n\n");
+					Thread.sleep(millisecond);
+				}
 			}
 			return true;
 		} catch (Exception e) {
@@ -67,10 +73,10 @@ public class A {
 		}
 	}
 
-	public static void print(String status) {
+	public static void print_status(String status, long millisecond, int cycle_count) {
 		File file = new File("img" + Constant.getSeperator() + status);
 		if (file.exists() && file.isDirectory()) {
-			printOne(file, true, -1);
+			printImage(file, true, -1, millisecond, cycle_count);
 		}
 		log.warn("compute result: " + status);
 	}

+ 6 - 6
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/DaemonThread.java

@@ -183,9 +183,9 @@ public class DaemonThread extends Thread {
 			if (LogOfRun.status.equals("success")) {
 				// 打印字符画
 				if (LogOfRun.errorList.size() == 0) {
-					A.print("perfect");
+					A.print_status("perfect", 1000L, 1);
 				} else {
-					A.print("good");
+					A.print_status("good", 1000L, 1);
 				}
 
 				try {
@@ -222,18 +222,18 @@ public class DaemonThread extends Thread {
 
 				// 循环打印字符画
 				if (LogOfRun.errorList.size() == 0) {
-					A.print_text("compute result: perfect", "joke.txt", false, 1500);
+					A.print_status("perfect", 1000L, 10);
 				} else {
-					A.print_text("compute result: good", "joke.txt", false, 1500);
+					A.print_status("good", 1000L, 10);
 				}
 
 				break;
 			} else {
 				// 打印字符画
-				A.print("bad");
+				A.print_status("bad", 1000L, 1);
 
 				// 循环打印字符画
-				A.print_text("compute result: bad", "joke.txt", false, 1500);
+				A.print_status("bad", 1000L, 10);
 			}
 		}
 

+ 3 - 6
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/RefreshThread.java

@@ -133,11 +133,9 @@ public class RefreshThread extends Thread {
 					RepositoryContainer.RepositoryProject.AddSuccessLogOfRun(LogOfRun);
 
 					if (LogOfRun.errorList.size() == 0) {
-						A.print("perfect");
-						A.print_text("compute result: perfect", "joke.txt", false, 1500);
+						A.print_status("perfect", 1000L, 10);
 					} else {
-						A.print("good");
-						A.print_text("compute result: good", "joke.txt", false, 1500);
+						A.print_status("good", 1000L, 10);
 					}
 				} catch (Exception e) {
 					String message = LogUtil.GetExceptionStackTrace(e);
@@ -145,8 +143,7 @@ public class RefreshThread extends Thread {
 					LogOfRun.error(null, message);
 					LogOfRun.status = "failure";
 
-					A.print("bad");
-					A.print_text("compute result: bad", "joke.txt", false, 1500);
+					A.print_status("bad", 1000L, 10);
 				}
 				for (String resource : LogOfRun.resourceTime_new.keySet()) {
 					RepositoryContainer.RepositoryProject.resourceMap_try.put(resource, LogOfRun.resourceTime_new.get(resource));

+ 6 - 6
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/ImageUtil.java

@@ -259,7 +259,7 @@ public class ImageUtil {
 		}
 		{
 			ByteArrayOutputStream os = new ByteArrayOutputStream();
-			drawLaugh(72, isTextBlack, os);
+			drawLaugh(120, isTextBlack, os);
 			os.close();
 			InputStream is = new ByteArrayInputStream(os.toByteArray());
 			BufferedImage bi = ImageIO.read(is);
@@ -271,7 +271,7 @@ public class ImageUtil {
 		}
 		{
 			ByteArrayOutputStream os = new ByteArrayOutputStream();
-			drawCry(72, isTextBlack, os);
+			drawCry(120, isTextBlack, os);
 			os.close();
 			InputStream is = new ByteArrayInputStream(os.toByteArray());
 			BufferedImage bi = ImageIO.read(is);
@@ -294,22 +294,22 @@ public class ImageUtil {
 		}
 		{
 			OutputStream os = new FileOutputStream("Laugh1.bmp");
-			drawLaugh(72, false, os);
+			drawLaugh(120, false, os);
 			os.close();
 		}
 		{
 			OutputStream os = new FileOutputStream("Laugh2.bmp");
-			drawLaugh(72, true, os);
+			drawLaugh(120, true, os);
 			os.close();
 		}
 		{
 			OutputStream os = new FileOutputStream("Cry1.bmp");
-			drawCry(72, false, os);
+			drawCry(120, false, os);
 			os.close();
 		}
 		{
 			OutputStream os = new FileOutputStream("Cry2.bmp");
-			drawCry(72, true, os);
+			drawCry(120, true, os);
 			os.close();
 		}
 

+ 14 - 14
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/RWDLoadUtil.java

@@ -694,20 +694,20 @@ public class RWDLoadUtil {
 							svInner.value_prim.value = ibmsClassCode;
 							sdo.put("ibmsClassCode", svInner);
 						}
-						{
-							SceneDataValue svInner = new SceneDataValue(null, null, null, null);
-							svInner.finish = true;
-							svInner.value_prim = new SceneDataPrimitive();
-							svInner.value_prim.value = arrayItem.get("ibmsxianshimingcheng");
-							sdo.put("ibmsxianshimingcheng", svInner);
-						}
-						{
-							SceneDataValue svInner = new SceneDataValue(null, null, null, null);
-							svInner.finish = true;
-							svInner.value_prim = new SceneDataPrimitive();
-							svInner.value_prim.value = arrayItem.get("ibmsxianshibianma");
-							sdo.put("ibmsxianshibianma", svInner);
-						}
+//						{
+//							SceneDataValue svInner = new SceneDataValue(null, null, null, null);
+//							svInner.finish = true;
+//							svInner.value_prim = new SceneDataPrimitive();
+//							svInner.value_prim.value = arrayItem.get("ibmsxianshimingcheng");
+//							sdo.put("ibmsxianshimingcheng", svInner);
+//						}
+//						{
+//							SceneDataValue svInner = new SceneDataValue(null, null, null, null);
+//							svInner.finish = true;
+//							svInner.value_prim = new SceneDataPrimitive();
+//							svInner.value_prim.value = arrayItem.get("ibmsxianshibianma");
+//							sdo.put("ibmsxianshibianma", svInner);
+//						}
 						SceneDataObject sodChild = new SceneDataObject(Repository, null, null, SceneDataValue, null, null, sdo);
 						SceneDataSet.set.add(sodChild);
 					}

+ 5 - 2
ibms-data-sdk/src/main/resources/config.xml

@@ -47,6 +47,8 @@
     <info_replace objType="building" from="localName" to="ibmsxianshimingcheng"/>
     <info_replace objType="floor" from="localId" to="ibmsxianshibianma"/>
     <info_replace objType="floor" from="localName" to="ibmsxianshimingcheng"/>
+    <info_replace objType="system" from="localId" to="ibmsxianshibianma"/>
+    <info_replace objType="system" from="localName" to="ibmsxianshimingcheng"/>
     <!-- 非万达用下面四行 -->
     <info_replace objType="space" from="localId" to="ibmsxianshibianma" />
     <info_replace objType="space" from="localName" to="ibmsxianshimingcheng" />
@@ -87,9 +89,10 @@
 	<ConfigRelation graphCode="ArchSubset" relCode="Fl2Sp" objFrom="floor" objTo="space" multiplicityFrom="n" nameInTo="所属楼层" multiplicityTo="1" />
 	<ConfigRelation graphCode="MechInArch" relCode="Eq2Bd" objFrom="equipment" objTo="building" nameInFrom="所在建筑" multiplicityFrom="1" />
 	<ConfigRelation graphCode="MechInArch" relCode="Eq2Fl" objFrom="equipment" objTo="floor" nameInFrom="所在楼层" multiplicityFrom="1" />
-	<ConfigRelation graphCode="MechInArch" relCode="Eq2Sp" relValue="GeneralZone" objFrom="equipment" objTo="space" nameInFrom="所在物业空间" multiplicityFrom="n" nameInTo="包含设备" multiplicityTo="n" />
-	<ConfigRelation graphCode="MechInArch" relCode="Eq2Sp" relValue="EnvironmentZone" objFrom="equipment" objTo="space" nameInFrom="所在环境空间" multiplicityFrom="n" nameInTo="包含设备" multiplicityTo="n" />
+	<ConfigRelation graphCode="MechInArch" relCode="Eq2Sp" relValue="GeneralZone" objFrom="equipment" objTo="space" nameInFrom="所在物业空间" multiplicityFrom="1" nameInTo="包含设备" multiplicityTo="n" />
+	<ConfigRelation graphCode="MechInArch" relCode="Eq2Sp" relValue="EnvironmentZone" objFrom="equipment" objTo="space" nameInFrom="所在环境空间" multiplicityFrom="1" nameInTo="包含设备" multiplicityTo="n" />
 	<ConfigRelation graphCode="MechForArch" relCode="Eq2Sp" objFrom="equipment" objTo="space" nameInFrom="服务于空间" multiplicityFrom="n" nameInTo="被设备服务" multiplicityTo="n" />
+	<ConfigRelation graphCode="MechSubset" relCode="Sy2Eq" objFrom="system" objTo="equipment" nameInTo="所属系统" multiplicityTo="1" />
 	<ConfigRelation graphCode="MechPower" relCode="EqNormal" objFrom="equipment" objTo="equipment" nameInFrom="给设备供电" multiplicityFrom="n" nameInTo="被设备供电" multiplicityTo="n" />
 	<ConfigRelation graphCode="MechCtrl" relCode="EqCtrl" objFrom="equipment" objTo="equipment" nameInFrom="控制设备" multiplicityFrom="n" nameInTo="被设备控制" multiplicityTo="n" />
 	<ConfigRelation graphCode="ValveRelationship" relCode="Vv2Eq" objFrom="equipment" objTo="equipment" nameInFrom="限制设备" multiplicityFrom="n" nameInTo="被设备限制" multiplicityTo="n" />