Bläddra i källkod

멀티 제어에서 팝업 뜬 후 타이머 종료에 의해 팝업이 사라지는 경우, 메인에서 상태 갱시되도록 수정.

jslee(madeinlab) 3 år sedan
förälder
incheckning
955280b5ca

+ 4 - 1
WallPadAddService/src/main/java/kr/co/icontrols/wallpadaddservice/MainActivity.java

@@ -289,6 +289,7 @@ public class MainActivity extends WpadActivity {
         int nNoticeEnable = wallpadDeviceSet.GetDeviceSetted("공지사항");   // 공지사항
         int nEframeEnable = wallpadDeviceSet.GetDeviceSetted("전자액자");   // 전자액자
         int nMemoEnable = wallpadDeviceSet.GetDeviceSetted("메모");   // 전자액자
+        int nScheduleEnable = wallpadDeviceSet.GetDeviceSetted("일정표");   // 전자액자
         int cctvUse = wallpadDeviceSet.GetDeviceSetted("CCTV");
         int parkingUse = wallpadDeviceSet.GetDeviceSetted("주차확인");
         int carGuestUse = wallpadDeviceSet.GetDeviceSetted("방문객차량등록");
@@ -328,7 +329,9 @@ public class MainActivity extends WpadActivity {
             if (nEframeEnable == WallpadDeviceSet.DEV_DATA_ENABLE) {
                 mChildList.add(API_Menu.SubMenuAddService.AutoPicture);
             }
-            mChildList.add(API_Menu.SubMenuAddService.Schedule);
+            if (nScheduleEnable == WallpadDeviceSet.DEV_DATA_ENABLE) {
+                mChildList.add(API_Menu.SubMenuAddService.Schedule);
+            }
 
             if (cctvUse == WallpadDeviceSet.DEV_DATA_ENABLE) {
                 mChildList.add(API_Menu.SubMenuAddService.Cctv);

+ 1 - 1
WallPadHomeCtrl/src/main/AndroidManifest.xml

@@ -1,7 +1,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="kr.co.icontrols.wallpadhomectrl"
     android:versionCode="17"
-    android:versionName="2022.01.19.01">
+    android:versionName="2022.01.25.01">
 
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

+ 9 - 0
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/MainActivity.java

@@ -1335,6 +1335,12 @@ public class MainActivity extends WpadActivity {
 	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
 		super.onActivityResult(requestCode, resultCode, data);
 		try {
+			if(mCurrentMultiScreenId == ID.screen.LightKnxMainTestScreen||mCurrentMultiScreenId == ID.screen.HeatingV2TestScreen
+			||mCurrentMultiScreenId == ID.screen.KnxSystemAirconMainTestScreen||mCurrentMultiScreenId == ID.screen.VentiMainTestScreen){
+				if(resultCode==0&&data==null){
+					super.onActivityResult(requestCode, 10000, data);
+				}
+			}
 			Log.d(TAG, "@@@@@@@@ [onActivityResult] @@@@@@@@");
 			if (resultCode == RESULT_OK) {
 				// PopupActivity 에서 FinishTimer 로 인하여 종료가 되었을 경우
@@ -2020,11 +2026,13 @@ public class MainActivity extends WpadActivity {
 				case ID.screen.KnxSystemAirconMainTestScreen: // 시스템 에어컨
 					KnxSystemAirconMainTestScreen knxSystemAirconMainTestScreen = new KnxSystemAirconMainTestScreen(this, ScreenLayout, wpapi, OPERATION_MODE, mDefaultRoomNameList);
 					super.setCurrentScreen(knxSystemAirconMainTestScreen);
+					mCurrentMultiScreenId = ID.screen.KnxSystemAirconMainTestScreen;
 					result = true;
 					break;
 				case ID.screen.LightKnxMainTestScreen: // 조명
 					LightKnxMainTestScreen lightKnxMainTestScreen = new LightKnxMainTestScreen(this, ScreenLayout, wpapi, OPERATION_MODE, mRoomNameList_Light);
 					super.setCurrentScreen(lightKnxMainTestScreen);
+					mCurrentMultiScreenId = ID.screen.LightKnxMainTestScreen;
 					result = true;
 					break;
 				case ID.screen.HeatingV2TestScreen: // 난방
@@ -2041,6 +2049,7 @@ public class MainActivity extends WpadActivity {
 				case ID.screen.VentiMainTestScreen: // 환기
 					VentilationMainTestScreen ventilationMainTestScreen = new VentilationMainTestScreen(this, ScreenLayout, wpapi, OPERATION_MODE, nScreenId);
 					super.setCurrentScreen(ventilationMainTestScreen);
+					mCurrentMultiScreenId = ID.screen.VentiMainTestScreen;
 					result = true;
 					break;
 

+ 16 - 1
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/screen/screen_aircon/KnxSystemAirconPopupScreen.java

@@ -199,7 +199,7 @@ public class KnxSystemAirconPopupScreen extends WpadScreen {
                     }
                 }
             } else if (OPERATION_MODE == Common.MODE_NOMAL) {
-                byte hRoomCNT = intent.getByteExtra("ROOM_COUNT", (byte) 0);
+                int hRoomCNT = intent.getByteExtra("ROOM_COUNT", (byte) 0);
             }
         } else {
             Log.e(TAG, "[Exception] getScreenIntent - data null !!!");
@@ -782,6 +782,21 @@ public class KnxSystemAirconPopupScreen extends WpadScreen {
         return 0;
     }
 
+    /**
+     * 부모 Activity 에서 BroadcastReceiver 을 수신받을시 호출됨
+     */
+    @Override
+    protected void onBrReceive(Intent intent) {
+        super.onBrReceive(intent);
+        String ActionName = intent.getAction();
+        DebugLogOutput("[[[[ onBrReceive ]]]]  ActionName = " + ActionName);
+        if (ActionName.equals(ID.KNxSystemAirconPopup.BR_AIRCON)) {
+            DebugLogOutput("onBrReceive - BR_AIRCON");
+            if(Device_Update(Common.INDEX_ALL, false) >= 0)
+                Draw_Update(Common.INDEX_ALL);
+        }
+    }
+
     /**
      * 에어컨 모드를 제어한다.
      *

+ 8 - 5
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/screen/screen_multi/HeatingV2PopupTestScreen.java

@@ -688,6 +688,12 @@ public class HeatingV2PopupTestScreen extends WpadScreen {
         HeatPopManual_Str = nowtab + "/" + reserve + "/" + sleep;
     }
 
+    private void setPopupResult() {
+        //팝업 종료 후 메인에서 화면 자동 갱신 되도록 하기 위함.
+        Intent data = new Intent();
+        super.setPopupResult(data);
+    }
+
     /**
      * 본 스크린 종료시 호출됨
      */
@@ -717,9 +723,8 @@ public class HeatingV2PopupTestScreen extends WpadScreen {
      */
     @Override
     protected void onOutSideTouchExit() {
-        Intent data = new Intent();
-        super.setPopupResult(data);
         super.onOutSideTouchExit();
+        setPopupResult();
     }
 
     // =================================================================================================
@@ -744,9 +749,7 @@ public class HeatingV2PopupTestScreen extends WpadScreen {
                 if (TargetId == ID.heatingV2Popup.button.EXIT) {
                     DebugLogOutput("onTouchEvent [EXIT] BUTTON !!!");
                     Sound().Play(SND.effect.TOUCH_LATCHED);
-                    Intent data = new Intent();
-                    super.setPopupResult(data);
-
+                    setPopupResult();
                     super.finish();
                 }
                 else if (TargetId == ID.heatingV2Popup.button.MANUAL) {

+ 1 - 4
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/screen/screen_multi/HeatingV2TestScreen.java

@@ -655,10 +655,7 @@ public class HeatingV2TestScreen extends WpadScreen {
      */
     @Override
     protected void onPopupResult(Intent intent) {
-        if (intent != null) {
-            //updateData();
-            startRefreshTimer(1300);
-        }
+        startRefreshTimer(1300);
     }
 
     // =================================================================================================

+ 8 - 8
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/screen/screen_multi/KnxSystemAirconPopupTestScreen.java

@@ -374,6 +374,12 @@ public class KnxSystemAirconPopupTestScreen extends WpadScreen {
         Draw_Update((byte) mCurrentRoomIndex);
     }
 
+    private void setPopupResult() {
+        //팝업 종료 후 메인에서 화면 자동 갱신 되도록 하기 위함.
+        Intent data = new Intent();
+        super.setPopupResult(data);
+    }
+
     /**
      * 본 스크린 종료시 호출됨
      */
@@ -402,11 +408,7 @@ public class KnxSystemAirconPopupTestScreen extends WpadScreen {
     @Override
     protected void onOutSideTouchExit() {
         super.onOutSideTouchExit();
-
-        // (영업샘플모드) 변경 데이터 전달
-        if (OPERATION_MODE == Common.MODE_BUSINESS_SAMPLE) Sample_setPopupResult();
-        Intent data = new Intent();
-        super.setPopupResult(data);
+        setPopupResult();
     }
 
     // =================================================================================================
@@ -428,9 +430,7 @@ public class KnxSystemAirconPopupTestScreen extends WpadScreen {
                 Sound().Play(SND.effect.TOUCH_LATCHED);
 
                 if (OPERATION_MODE == Common.MODE_BUSINESS_SAMPLE) Sample_setPopupResult();
-
-                Intent data = new Intent();
-                super.setPopupResult(data);
+                setPopupResult();
                 super.finish();
             } else if (nTargetId == ID.KNxSystemAirconPopup.button.ROOM_PREV) {
                 DebugLogOutput("onTouchEvent [ROOM_PREV] BUTTON !!!");

+ 0 - 1
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/screen/screen_multi/LightKnxMainTestScreen.java

@@ -1000,7 +1000,6 @@ public class LightKnxMainTestScreen extends WpadScreen {
      */
     @Override
     protected void onPopupResult(Intent intent) {
-        //updateData();
         startRefreshTimer(500);
     }
 

+ 8 - 3
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/screen/screen_multi/LightKnxPopupTestScreen.java

@@ -496,6 +496,12 @@ public class LightKnxPopupTestScreen extends WpadScreen {
         }catch (Exception e){}
     }
 
+    private void setPopupResult() {
+        //팝업 종료 후 메인에서 화면 자동 갱신 되도록 하기 위함.
+        Intent data = new Intent();
+        super.setPopupResult(data);
+    }
+
     /**
      * 본 스크린 종료시 호출됨
      */
@@ -514,7 +520,7 @@ public class LightKnxPopupTestScreen extends WpadScreen {
     @Override
     protected void onOutSideTouchExit() {
         super.onOutSideTouchExit();
-        // (영업샘플모드) 변경 데이터 전달
+        setPopupResult();
     }
 
     /**
@@ -591,8 +597,7 @@ public class LightKnxPopupTestScreen extends WpadScreen {
             if (TargetId == ID.lightKnxPopupRoom.button.EXIT) {
                 DebugLogOutput("onTouchEvent [EXIT] BUTTON !!!");
                 Sound().Play(SND.effect.TOUCH_LATCHED);
-                Intent data = new Intent();
-                super.setPopupResult(data);
+                setPopupResult();
                 super.finish();
             } else if (TargetId == ID.lightKnxPopupRoom.button.ROOMSEL_LEFT) {
                 DebugLogOutput("onTouchEvent [ROOMSEL_LEFT] BUTTON !!!");

+ 8 - 6
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/screen/screen_multi/VentiPopupReservationTestScreen.java

@@ -356,6 +356,12 @@ public class VentiPopupReservationTestScreen extends WpadScreen {
         return true;
     }
 
+    private void setPopupResult() {
+        //팝업 종료 후 메인에서 화면 자동 갱신 되도록 하기 위함.
+        Intent data = new Intent();
+        super.setPopupResult(data);
+    }
+
     /**
      * 본 스크린 종료시 호출됨
      */
@@ -379,10 +385,7 @@ public class VentiPopupReservationTestScreen extends WpadScreen {
     @Override
     protected void onOutSideTouchExit() {
         super.onOutSideTouchExit();
-        DebugLogOutput("[[[[ onOutSideTouchExit ]]]]");
-        if (OPERATION_MODE == Common.MODE_BUSINESS_SAMPLE) {
-            Sample_ReservationResult();
-        }
+        setPopupResult();
     }
 
 
@@ -403,9 +406,8 @@ public class VentiPopupReservationTestScreen extends WpadScreen {
         if (MoveEvent == MotionEvent.ACTION_UP) {
             if (TargetId == ID.VentiPopup_Reservation.button.EXIT) {
                 DebugLogOutput("onTouchEvent [EXIT] BUTTON !!!");
-
                 Sound().Play(SND.effect.TOUCH_LATCHED);
-
+                setPopupResult();
                 super.finish();
             } else if (TargetId == ID.VentiPopup_Reservation.button.MANUAL) {
                 Log.i(TAG, "onTouchEvent [MANUAL] BUTTON !!!");

+ 1 - 2
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/screen/screen_multi/VentilationMainTestScreen.java

@@ -826,9 +826,8 @@ public class VentilationMainTestScreen extends WpadScreen {
                     Sample_ReservationOnOff(Reservation);
                 }
             }
-
-            startRefreshTimer(1500);
         }
+        startRefreshTimer(1500);
     }
 
     // =================================================================================================