Forráskód Böngészése

[WallPadAPI]
1. 전동커튼 설정 가져오기
- 변경 (사용함/사용안함 -> 종류(전동커튼) / 종류(롤스크린))
2. 전동커튼 jar 등록

jglee 2 éve
szülő
commit
81f4c8e54e

+ 4 - 0
ManagerSetting/src/main/java/com/artncore/managersetting/domain/Const.java

@@ -184,6 +184,10 @@ public class Const {
     public static final String CONTROLLER_KITCHEN_EM_CTRL_OPTION_BATCH = "일괄제어";
     public static final String CONTROLLER_KITCHEN_EM_CTRL_OPTION_IN_ORDER = "순차제어";
 
+    // 전동 커튼 옵션
+    public static final String CONTROLLER_SHADING_CTRL_OPTION_CURTAIN = "전동커튼";
+    public static final String CONTROLLER_SHADING_CTRL_OPTION_SCREEN = "롤스크린";
+
 
     public static final int CONTROLLER_MAX_COUNT = 8;
     public static final int CONTROLLER_ONOFF_COUNT = 1;

BIN
WallPadAPI/jar/WallPadAPI.jar


+ 49 - 6
WallPadAPI/src/main/java/com/artncore/WallPadDataMgr/WallpadDeviceSet.java

@@ -98,6 +98,9 @@ public class WallpadDeviceSet extends wallpaddbmgr {
 	public static final int DO_NOT_USE = 0;
 	public static final int DO_USE = 1;
 
+	public static final int Curtain = 1;
+	public static final int RollScreen = 2;
+
 
 	public static final int LIGHT_TYPE_LIVING = 11;
 	public static final int LIGHT_TYPE_ROOM   = 12;
@@ -570,17 +573,57 @@ public class WallpadDeviceSet extends wallpaddbmgr {
 	 *
 	 * @return boolean 타입 - true:사용, false:미사용
 	 */
-	public boolean Get_Shading_Use()
+	public int Get_Shading_Use()
 	{
 		Log.d(TAG, "Get_Shading_Use");
-		int result = GetDeviceSetted(define.DEVICE_ID_SHADING);
-		if(result == DEV_DATA_ENABLE)
+//		int result = GetDeviceSetted(define.DEVICE_ID_SHADING);
+//		if(result == DEV_DATA_ENABLE)
+//		{
+//			return true;
+//		}
+//		else
+//		{
+//			return false;
+//		}
+
+		String[] GetData = GetSettingData(define.DEVICE_ID_SHADING);
+		if (GetData == null) return 0; // 사용안함(기본값)
+
+		Log.i(TAG, "-------------------------------[Get_Shading_Use] Lnegth: " + GetData.length);
+
+		for(int i = 0; i< GetData.length; i++)
 		{
-			return true;
+			Log.i(TAG, "-------------------------------[Get_Shading_Use] Data  [" +i +"]" +  GetData[i].toString());
 		}
-		else
+		try
 		{
-			return false;
+			//여기서 우선 종료를 가지고 있느닞 판단이 필요
+			//우선 종류가 있는지 부터 파악
+			//이뉴는 기존것을 대비 하기 위해 필요
+			if(GetData[1].contains("종류"))
+			{
+				//새로운 타입
+				if (GetData[1].indexOf("(전동커튼)") > 0)
+					return define.Curtain;
+				else if (GetData[1].indexOf("롤스크린") > 0)
+					return define.RollScreen;
+				else
+					return 0;
+			}
+			else
+			{
+				//기존것
+				if (GetData[1].indexOf("사용함") > 0)
+					return define.Curtain;
+				else //1.0
+					return 0;
+			}
+		}
+		catch (RuntimeException re) {
+			return 0;
+		}
+		catch (Exception e) {
+			return 0;
 		}
 	}
 

+ 4 - 0
WallPadAPI/src/main/java/com/artncore/commons/define.java

@@ -739,4 +739,8 @@ public class define {
 	public static final int DanjiServer1 = 1;
 	public static final int DanjiServer2 = 2;
 	public static final int DanjiServerBlended = 0;
+
+	//전동커튼
+	public static final int Curtain = 1;
+	public static final int RollScreen = 2;
 }