فهرست منبع

[WallPadMain]
1. 서브 월패드 제어 처리
- 서브 월패드이면서, 직접 제어(조명)인 경우 조명 처리
(단, 콘센트는 조명 활성화 되도 같이 활성화 되지 않음)

jglee 2 سال پیش
والد
کامیت
91176f2f9b
1فایلهای تغییر یافته به همراه85 افزوده شده و 67 حذف شده
  1. 85 67
      WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/MainActivity.java

+ 85 - 67
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/MainActivity.java

@@ -2133,6 +2133,11 @@ public class MainActivity extends WpadActivity {
 			boolean bCooktopOutletUsage = mWallpadDeviceSet.Get_CookTopConcent_Use();
 			int nSystemAirconUsage = mWallpadDeviceSet.Get_AirCON_Info();
 			int nPurityUsage = mWallpadDeviceSet.Get_Purity_Info();
+
+			// 여기서 서브 월패드
+			boolean isSubWallPadUse = mWallpadDeviceSet.GetSubWpdUse();
+			// 서브 월패드 조명 타입 정보 가져오기
+			int[] naSubWallPadLightType = mWallpadDeviceSet.GetSubWpdDirect_Light();
 			mWallpadDeviceSet.closeDB();
 
 			WallpadStatusData mWallpadStatusData = new WallpadStatusData(getContext());
@@ -2141,96 +2146,109 @@ public class MainActivity extends WpadActivity {
 
 			int nChildCnt = 0;
 
-			//[수정필요]
-			//추가 또는 수정해야할 부분 1. - Menu정보가 DB에 없을 경우 불러올 스크린 종류(시작)
-			if (nLightType[0] == WallpadDeviceSet.DO_USE) {
-				arrayList.add(API_Menu.SubMenuCtrl.Name_Lamp);
-				nChildCnt++;
+			if(isSubWallPadUse)
+			{
+				if(naSubWallPadLightType!=null && naSubWallPadLightType.length == 2 && naSubWallPadLightType[1] == WallpadDeviceSet.SUBWPD_CTR_DIRECT )
+				{
+					if (nLightType[0] == WallpadDeviceSet.DO_USE) {
+						arrayList.add(API_Menu.SubMenuCtrl.Name_Lamp);
+						nChildCnt++;
+					}
+				}
 			}
-
-			if (nLightType[1] == WallpadDeviceSet.LIGHT_TYPE_ROOM) {
-				Log.i(TAG, "bElecOutletUsage = " + bElecOutletUsage + " @@@@@@@@@@@@@@@@");
-				Log.i(TAG, "MultiConcentExist = " + bMultiConcentExist + " @@@@@@@@@@@@@@@@");
-				if ((OPERATION_MODE == Common.MODE_BUSINESS_SAMPLE) || (nLightType[0] == 1 && bElecOutletUsage && bMultiConcentExist)) {
-					arrayList.add(API_Menu.SubMenuCtrl.Name_Concent);
+			else
+			{
+				//[수정필요]
+				//추가 또는 수정해야할 부분 1. - Menu정보가 DB에 없을 경우 불러올 스크린 종류(시작)
+				if (nLightType[0] == WallpadDeviceSet.DO_USE) {
+					arrayList.add(API_Menu.SubMenuCtrl.Name_Lamp);
 					nChildCnt++;
 				}
-			}
 
-			if (nHeatingUsage == WallpadDeviceSet.DO_USE) {
-				arrayList.add(API_Menu.SubMenuCtrl.Name_Heating);
-				nChildCnt++;
-			}
+				if (nLightType[1] == WallpadDeviceSet.LIGHT_TYPE_ROOM) {
+					Log.i(TAG, "bElecOutletUsage = " + bElecOutletUsage + " @@@@@@@@@@@@@@@@");
+					Log.i(TAG, "MultiConcentExist = " + bMultiConcentExist + " @@@@@@@@@@@@@@@@");
+					if ((OPERATION_MODE == Common.MODE_BUSINESS_SAMPLE) || (nLightType[0] == 1 && bElecOutletUsage && bMultiConcentExist)) {
+						arrayList.add(API_Menu.SubMenuCtrl.Name_Concent);
+						nChildCnt++;
+					}
+				}
 
-			if (nGasValveUsage == WallpadDeviceSet.DO_USE) {
-				arrayList.add(API_Menu.SubMenuCtrl.Name_Gas);
-				nChildCnt++;
-			}
+				if (nHeatingUsage == WallpadDeviceSet.DO_USE) {
+					arrayList.add(API_Menu.SubMenuCtrl.Name_Heating);
+					nChildCnt++;
+				}
 
-			if (bCooktopOutletUsage) {
-				// 쿡탑콘센트
-				arrayList.add(API_Menu.SubMenuCtrl.Name_CooktopConcent);
-				nChildCnt++;
-				Log.i(TAG, "cooktopConcentUse = " + bCooktopOutletUsage + " @@@@@@@@@@@@@@@@");
-				Log.i(TAG, "Name_CooktopConcent Added ~~~ " + " @@@@@@@@@@@@@@@@");
-			}
+				if (nGasValveUsage == WallpadDeviceSet.DO_USE) {
+					arrayList.add(API_Menu.SubMenuCtrl.Name_Gas);
+					nChildCnt++;
+				}
 
-			if (bElecCooktopUsage) {
-				arrayList.add(API_Menu.SubMenuCtrl.Name_ElectricRange);
-				nChildCnt++;
-			}
+				if (bCooktopOutletUsage) {
+					// 쿡탑콘센트
+					arrayList.add(API_Menu.SubMenuCtrl.Name_CooktopConcent);
+					nChildCnt++;
+					Log.i(TAG, "cooktopConcentUse = " + bCooktopOutletUsage + " @@@@@@@@@@@@@@@@");
+					Log.i(TAG, "Name_CooktopConcent Added ~~~ " + " @@@@@@@@@@@@@@@@");
+				}
 
-			if (nDoorlockType[0] == WallpadDeviceSet.DO_USE) {
-				arrayList.add(API_Menu.SubMenuCtrl.Name_DoorLock);
-				nChildCnt++;
-			}
+				if (bElecCooktopUsage) {
+					arrayList.add(API_Menu.SubMenuCtrl.Name_ElectricRange);
+					nChildCnt++;
+				}
 
-			if (nVentilType[0] == WallpadDeviceSet.DO_USE) {
-				arrayList.add(API_Menu.SubMenuCtrl.Name_Venti);
-				nChildCnt++;
-			}
+				if (nDoorlockType[0] == WallpadDeviceSet.DO_USE) {
+					arrayList.add(API_Menu.SubMenuCtrl.Name_DoorLock);
+					nChildCnt++;
+				}
 
-			if (bShadingEnable) {
-				//전동커튼
-				arrayList.add(API_Menu.SubMenuCtrl.Name_Curtain);
-				nChildCnt++;
-			}
+				if (nVentilType[0] == WallpadDeviceSet.DO_USE) {
+					arrayList.add(API_Menu.SubMenuCtrl.Name_Venti);
+					nChildCnt++;
+				}
 
+				if (bShadingEnable) {
+					//전동커튼
+					arrayList.add(API_Menu.SubMenuCtrl.Name_Curtain);
+					nChildCnt++;
+				}
 
 
-			if (nSystemAirconUsage != WallpadDeviceSet.SYSTEMAIRCON_NONE) {
-				arrayList.add(API_Menu.SubMenuCtrl.Name_SystemAircon);
-				nChildCnt++;
-			}
 
-			if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I
-					|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
-					|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF)
-			{
-				if (!bKitchenLightonLivingEM &&(nDistributionPanelType != Version.DISTRIBUTION_MODEL.KNX_DIST)) {
-					// knx분전반은 거실조명 그룹설정 메뉴에서 빠짐
-					arrayList.add(API_Menu.SubMenuCtrl.Name_LivingLightConfig);
+				if (nSystemAirconUsage != WallpadDeviceSet.SYSTEMAIRCON_NONE) {
+					arrayList.add(API_Menu.SubMenuCtrl.Name_SystemAircon);
 					nChildCnt++;
 				}
 
-				if (nDistributionPanelType == Version.DISTRIBUTION_MODEL.KNX_DIST) {
-					arrayList.add(API_Menu.SubMenuCtrl.Name_Concent);
-					nChildCnt++;
+				if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I
+						|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
+						|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF)
+				{
+					if (!bKitchenLightonLivingEM &&(nDistributionPanelType != Version.DISTRIBUTION_MODEL.KNX_DIST)) {
+						// knx분전반은 거실조명 그룹설정 메뉴에서 빠짐
+						arrayList.add(API_Menu.SubMenuCtrl.Name_LivingLightConfig);
+						nChildCnt++;
+					}
+
+					if (nDistributionPanelType == Version.DISTRIBUTION_MODEL.KNX_DIST) {
+						arrayList.add(API_Menu.SubMenuCtrl.Name_Concent);
+						nChildCnt++;
+					}
+
+					if (nPurityUsage == WallpadDeviceSet.DO_USE) {
+						arrayList.add(API_Menu.SubMenuCtrl.Name_Purity);
+						nChildCnt++;
+					}
 				}
 
-				if (nPurityUsage == WallpadDeviceSet.DO_USE) {
-					arrayList.add(API_Menu.SubMenuCtrl.Name_Purity);
+				if (nAirQualitySensorUsage == WallpadDeviceSet.DEV_DATA_ENABLE) {
+					arrayList.add(API_Menu.SubMenuCtrl.Name_InnerAirQuality);
+					nChildCnt++;
+					arrayList.add(API_Menu.SubMenuCtrl.Name_InnerAirInfo);
 					nChildCnt++;
 				}
 			}
 
-			if (nAirQualitySensorUsage == WallpadDeviceSet.DEV_DATA_ENABLE) {
-				arrayList.add(API_Menu.SubMenuCtrl.Name_InnerAirQuality);
-				nChildCnt++;
-				arrayList.add(API_Menu.SubMenuCtrl.Name_InnerAirInfo);
-				nChildCnt++;
-			}
-
 			//추가 또는 수정해야할 부분 1. - Menu정보가 DB에 없을 경우 불러올 스크린 종류(끝)
 			Log.i(TAG, "childCount = " + nChildCnt);