Ver código fonte

[WallPadHomeCtrl]
1. 전동커튼
- 설정에 따라 이름 및 이미지 변경
- 설정에 따라 이미지 변경(현재 이미지 받지 않음) -> 이미지 받으면 추가후 테스트 필요

jglee 2 anos atrás
pai
commit
063fe36fc2

BIN
WallPadHomeCtrl/libs/WallPadAPI.jar


+ 19 - 6
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/MainActivity.java

@@ -269,6 +269,8 @@ public class MainActivity extends WpadActivity {
 	public static int nDistributionPanelType = Version.DISTRIBUTION_MODEL.OTHER;
 	public static int nEnergyProductionUse;
 
+	public static int nShadingType;   // 전동커튼 타입
+
 	private VentiAPI mVentilAPI = null;
 	private KnxVentiAPI mKnxVentilAPI = null;
 	DataClasses.Venti VentilStatus;
@@ -508,6 +510,7 @@ public class MainActivity extends WpadActivity {
 		int gateway = wds.GetGatewayModelKindInfo();
 		nDistributionPanelType = wds.Get_DistributionPannelType_Info();
 		nEnergyProductionUse = wds.Get_Energy_Devices_Info(); //에너지 제품군
+		nShadingType = wds.Get_Shading_Use();
 		wds.closeDB();
 
 		if (gateway == Version.GATEWAY_MODEL.IGW_200) {
@@ -1821,8 +1824,10 @@ public class MainActivity extends WpadActivity {
 
 
 				case API_Menu.SubMenuCtrl.Curtain:
-					SetTitleText(API_Menu.SubMenuCtrl.Name_Curtain);
-					curTainV1MainScreen = new CurTainV1MainScreen(this, ScreenLayout, wpapi, OPERATION_MODE);
+					String name = API_Menu.SubMenuCtrl.Name_Curtain;
+					if(nShadingType == WallpadDeviceSet.RollScreen) name = "롤스크린";
+					SetTitleText(name);
+					curTainV1MainScreen = new CurTainV1MainScreen(this, ScreenLayout, wpapi, OPERATION_MODE, nShadingType);
 					super.setCurrentScreen(curTainV1MainScreen);
 					setTopBoilerBtnVisible(false);
 					setAIRBackBtnVisible(false);
@@ -2126,7 +2131,7 @@ public class MainActivity extends WpadActivity {
 			int[] nLightType = mWallpadDeviceSet.Get_Light_info();
 			int[] nDoorlockType = mWallpadDeviceSet.Get_DoorLock_Info();
 			int[] nVentilType = mWallpadDeviceSet.Get_Ventil_Info();
-			boolean bShadingEnable = mWallpadDeviceSet.Get_Shading_Use();
+			int bShadingEnable = mWallpadDeviceSet.Get_Shading_Use();
 			int nHeatingUsage = mWallpadDeviceSet.Get_Temper_Info();
 			int nGasValveUsage = mWallpadDeviceSet.Get_GAS_Info();
 			boolean bElecCooktopUsage = mWallpadDeviceSet.Get_ElectricRange_Use();
@@ -2213,9 +2218,11 @@ public class MainActivity extends WpadActivity {
 					nChildCnt++;
 				}
 
-				if (bShadingEnable) {
+				if (bShadingEnable!=WallpadDeviceSet.DO_NOT_USE) {
 					//전동커튼
-					arrayList.add(API_Menu.SubMenuCtrl.Name_Curtain);
+					String name = API_Menu.SubMenuCtrl.Name_Curtain;
+					if(bShadingEnable == WallpadDeviceSet.RollScreen) name = "롤스크린";
+					arrayList.add(name);
 					nChildCnt++;
 				}
 
@@ -2379,7 +2386,13 @@ public class MainActivity extends WpadActivity {
 				*/
 				else if (arrayList.get(i).equals(API_Menu.SubMenuCtrl.Name_Curtain)) {
 					tempMenuListDataClass.idMappingTable[i].Id = API_Menu.SubMenuCtrl.Curtain;
-					tempMenuListDataClass.idMappingTable[i].Name = API_Menu.SubMenuCtrl.Name_Curtain;
+					String name = API_Menu.SubMenuCtrl.Name_Curtain;
+					tempMenuListDataClass.idMappingTable[i].Name = name;
+				}
+				else if (arrayList.get(i).equals("롤스크린")) {
+					tempMenuListDataClass.idMappingTable[i].Id = API_Menu.SubMenuCtrl.Curtain;
+					String name = "롤스크린";
+					tempMenuListDataClass.idMappingTable[i].Name = name;
 				}
 				else if (arrayList.get(i).equals(API_Menu.SubMenuCtrl.Name_InnerAirQuality)) {
 					tempMenuListDataClass.idMappingTable[i].Id = API_Menu.SubMenuCtrl.Inner_AirQuality;

+ 29 - 5
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/screen/screen_curtain/CurTainV1MainScreen.java

@@ -71,6 +71,8 @@ public class CurTainV1MainScreen extends WpadScreen {
 
     public String Heating_Manual_Str = "";
 
+    int nShadingType = WallpadDeviceSet.Curtain;
+
     // =================================================================================================
     // [[ Create & Close ]] region
     // =================================================================================================
@@ -82,7 +84,7 @@ public class CurTainV1MainScreen extends WpadScreen {
      * @param wpapi   - 상속받은 WallPadAPI
      * @param operationMode - 동작모드
      */
-    public CurTainV1MainScreen(Context context, RelativeLayout layout, WallPadAPI wpapi, int operationMode) {
+    public CurTainV1MainScreen(Context context, RelativeLayout layout, WallPadAPI wpapi, int operationMode, int Type) {
         super(context, layout);
         Log.i(TAG, "[START - Screen] --------------------------------------------");
 
@@ -93,6 +95,8 @@ public class CurTainV1MainScreen extends WpadScreen {
         nDistributionPanelType = wds.Get_DistributionPannelType_Info();
         wds.closeDB();
 
+        nShadingType = Type;
+
        // UX_MODE = ((MainActivity) context).GetEasyModeUXUse() ? Common.UX_EASY_MODE : Common.UX_NORMAL_MODE;
       //  Log.d(TAG, "[HeatingV2MainScreen] UX_MODE [" + UX_MODE + "]");
         /*
@@ -145,7 +149,11 @@ public class CurTainV1MainScreen extends WpadScreen {
         ViewRegistration(layout, BTN_ROOM, Common.ImgPosion.GetX(mROOMPos[0]), Common.ImgPosion.GetY(mROOMPos[1]));
         BTN_ROOM.setTouchDelayMs(Common.BTN_DELAY_DEVCTRL);
 
-        CurrentCurtainImg = new WpadImageView(getContext(), WpadImageView.TOUCH_KIND.NONE, 822, 544, R.drawable.bg_curtain_3, 0, ID.CurtainV1main.image.CURTAIN);
+        //여기서 구문
+        int bg_curtain = R.drawable.bg_curtain_3;
+        if(nShadingType == WallpadDeviceSet.RollScreen)
+            bg_curtain = R.drawable.bg_curtain_3;
+        CurrentCurtainImg = new WpadImageView(getContext(), WpadImageView.TOUCH_KIND.NONE, 822, 544, bg_curtain, 0, ID.CurtainV1main.image.CURTAIN);
         ViewRegistration(getLayout(), CurrentCurtainImg, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(179));
 
         // 4. Button Create
@@ -388,19 +396,35 @@ public class CurTainV1MainScreen extends WpadScreen {
     private void drawModeChange(boolean isLivingRoom, byte mode) {
         try {
             Log.d("","isLivingRoom ==================== :" + isLivingRoom);
+            int curtain_resource;
             if(mode == 0x00)
             {
-                CurrentCurtainImg.setImageResource(R.drawable.bg_curtain_3);
+                curtain_resource = R.drawable.bg_curtain_3;
+                if(nShadingType == WallpadDeviceSet.RollScreen)
+                {
+                    //여기서 이미지
+                }
+                CurrentCurtainImg.setImageResource(curtain_resource);
                 StatusText.setText("닫힘");
             }
             else if(mode == 0x01)
             {
-                CurrentCurtainImg.setImageResource(R.drawable.bg_curtain_1);
+                curtain_resource = R.drawable.bg_curtain_1;
+                if(nShadingType == WallpadDeviceSet.RollScreen)
+                {
+                    //여기서 이미지
+                }
+                CurrentCurtainImg.setImageResource(curtain_resource);
                 StatusText.setText("열림");
             }
             else if(mode == 0x02 || mode == 0x03)
             {
-                CurrentCurtainImg.setImageResource(R.drawable.bg_curtain_2);
+                curtain_resource = R.drawable.bg_curtain_2;
+                if(nShadingType == WallpadDeviceSet.RollScreen)
+                {
+                    //여기서 이미지
+                }
+                CurrentCurtainImg.setImageResource(curtain_resource);
                 StatusText.setText("동작중");
             }
         } catch (RuntimeException re) {