瀏覽代碼

[WallPadCall]
1. 볼륨바 수정
- 볼륨 및 밝기 조절값 '5'가 중앙 위치에 놓여 있지 않음
2. 현관 문열림 시, 설정에 따라 문열림 API 따로 사용
- 관리자설정-도어락-'유선' 설정상태에서 월패드앱 '현관' 통화에서 문열림 동작시 도어락 통신모듈을 통해 무선도어락 문열림이 동작함 (기본 설정값 '유선')
3. 버전업
- 2024.09.30.01 -> 2025.02.03.01

jglee 2 月之前
父節點
當前提交
eda2041746

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

@@ -1,7 +1,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="kr.co.icontrols.wallpadcall"
     android:versionCode="17"
-    android:versionName="2024.09.30.01">
+    android:versionName="2025.02.03.01">
 
     <!--android:sharedUserId="android.uid.system"-->
     <!--<uses-sdk-->

+ 103 - 2
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/declare/Global.java

@@ -14,7 +14,10 @@ import com.artncore.WallPadDataMgr.WallpadSalesSampleData;
 import com.artncore.WallPadDataMgr.WallpadStatusData;
 import com.artncore.WallPadDataMgr.wallpaddbmgr;
 import com.artncore.WallPadDataMgr.wallpaddbmgr.AddressSet;
+import com.artncore.commons.API_Menu;
 import com.artncore.commons.define;
+import com.artncore.wallpadapi.DLockAPI;
+import com.artncore.wallpadapi.FP_DlockAPI;
 import com.util.LogUtil;
 
 import java.io.BufferedReader;
@@ -2023,6 +2026,7 @@ public final class Global {
         public static boolean bEasyModeUse = false; // 간편모드 UX
         public static boolean bPlayBellUse = false; // 방문객원격통화 사용시 호출음 설정
         public static boolean bSmartIOTCamFlip = false; // 스마트현관카메라좌우반전 사용 유무
+        public static int[] doorType = null;// 도어락 타입 정보 가져오기
 
         //** 서브기기 통화 볼륨 테이블
         public static int BATHPHONE_CNT = 0; // 욕실폰 개수
@@ -2292,6 +2296,7 @@ public final class Global {
                 List<String[]> GuardList = mWallpadDeviceSet.GetGuardList();   // 경비실기 항목
                 boolean bEasyModeSupport = mWallpadDeviceSet.Get_EasyModeUX_Support();
                 ConfigValues.bSmartIOTCamFlip = mWallpadDeviceSet.Get_SmartIOTCamFlipUse(); // 스마트현관카메라좌우반전 사용 여부
+                ConfigValues.doorType = mWallpadDeviceSet.Get_DoorLock_Info();
                 mWallpadDeviceSet.closeDB();
 
                 WallpadStatusData mWallpadStatusData = new WallpadStatusData(mContext);
@@ -2372,8 +2377,9 @@ public final class Global {
                                 ConfigValues.eDoorLockType = DOORLOCKTYPE.WIRELESS;
                             else if (astrDigitalDoorLock[1].contains(ConfigValueKeys.FINGERPRINT))
                                 ConfigValues.eDoorLockType = DOORLOCKTYPE.FINGERPRINT;
-                            else if (astrDigitalDoorLock[1].contains(ConfigValueKeys.WIRED))
+                            else if (astrDigitalDoorLock[1].contains(ConfigValueKeys.WIRED)) {
                                 ConfigValues.eDoorLockType = DOORLOCKTYPE.WIRED;
+                            }
                         } else {
                             ConfigValues.eDoorLockType = DOORLOCKTYPE.NOT_USE;
                         }
@@ -2780,7 +2786,7 @@ public final class Global {
         try {
             Log.i(TAG, "[ctrlFrontDoorOpen] eDoorLockType [" + ConfigValues.eDoorLockType + "]");
             if (((MainActivity) mContext).mWallPadAPI != null && ((MainActivity) mContext).mWallPadAPI.Check_Connect()) {
-                if (ConfigValues.eDoorLockType == DOORLOCKTYPE.WIRED || ConfigValues.eDoorLockType == DOORLOCKTYPE.WIRELESS) {
+                if (ConfigValues.eDoorLockType == DOORLOCKTYPE.WIRELESS) {
                     int nResult = ((MainActivity) mContext).mWallPadAPI.SetDoorLock_Open();
                     Log.i(TAG, "[ctrlFrontDoorOpen] nResult [" + nResult + "]");
                     if (0 <= nResult) {
@@ -2790,6 +2796,17 @@ public final class Global {
                         Log.w(TAG, "[ctrlFrontDoorOpen] Door open fail!!");
                         return false;
                     }
+                }
+                else if (ConfigValues.eDoorLockType == DOORLOCKTYPE.WIRED) {
+                    int nResult = Device_DoorOpen();
+                    Log.i(TAG, "[ctrlFrontDoorOpen] nResult [" + nResult + "]");
+                    if (0 <= nResult) {
+                        Log.i(TAG, "[ctrlFrontDoorOpen] Door open success!!");
+                        return true;
+                    } else {
+                        Log.w(TAG, "[ctrlFrontDoorOpen] Door open fail!!");
+                        return false;
+                    }
                 } else if (ConfigValues.eDoorLockType == DOORLOCKTYPE.FINGERPRINT) {
                     if (((MainActivity) mContext).fpDlockAPI != null) {
                         int nResult = (((MainActivity) mContext).fpDlockAPI).SetDoorOpen();
@@ -2827,6 +2844,90 @@ public final class Global {
         }
     }
 
+
+    /**
+     *  유선 도어락 명령
+     *
+     * @return (int) - >=0 : 성공, <0 : 실패
+     */
+    private static int Device_DoorOpen() // dLockAPI는 현관카메라가 UKS가 아닌 경우에 사용.
+    {
+        //jglee - 2025.02.03 도어락 타입이 유선일 경우 처리 추가
+        if(ConfigValues.doorType == null) return -1;
+        try
+        {
+            DLockAPI dLockAPI = null;          // 도어락 API
+            FP_DlockAPI fp_dlockAPI = null;    // 지문인식 도어락 API
+
+            if(ConfigValues.doorType[1] == WallpadDeviceSet.DOORLOCK_TYPE_NORMAL)
+            {
+                if(dLockAPI == null)
+                {
+                    Log.e(TAG, "[Device_DoorOpen] - dLockAPI unload !!!");
+                    return -1;
+                }
+
+                try
+                {
+                    int ret = dLockAPI.SetDoorOpen();
+                    if(ret < 0)
+                    {
+                        Log.e(TAG, "[Device_DoorOpen] - SetDoorOpen (" + ret + ")   ErrorCode = " + dLockAPI.ErrorCode.ErrStr());
+                        return -2;
+                    }
+                }
+                catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                    return -102;
+                }
+                catch (Exception e)
+                {
+                    Log.e(TAG, "[Device_DoorOpen] - [Exception Error] doorLockAPI.Open()");
+                    Log.e(TAG, "[Device_DoorOpen] - " + e.toString());
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
+                    return -102;
+                }
+            }
+            else if(ConfigValues.doorType[1] == WallpadDeviceSet.DOORLOCK_TYPE_FINGERPRINT)
+            {
+                if(fp_dlockAPI == null)
+                {
+                    Log.e(TAG, "[Device_DoorOpen] - fp_dlockAPI unload !!!");
+                    return -1;
+                }
+
+                try
+                {
+                    int ret = fp_dlockAPI.SetDoorOpen();
+                    if(ret < 0)
+                    {
+                        Log.e(TAG, "[Device_DoorOpen] - SetDoorOpen (" + ret + ")   ErrorCode = " + fp_dlockAPI.ErrorCode.ErrStr());
+                        return -2;
+                    }
+                }
+                catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                    return -102;
+                }
+                catch (Exception e)
+                {
+                    Log.e(TAG, "[Device_DoorOpen] - [Exception Error] fp_dlockAPI.Open()");
+                    Log.e(TAG, "[Device_DoorOpen] - " + e.toString());
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
+                    return -102;
+                }
+            }
+
+        }catch (Exception e)
+        {
+            return -1;
+        }
+
+        return 0;
+    }
+
     /**
      * 무선 도어락 문열림<br>
      * JNI 호출을 실행하는 함수<br>

+ 25 - 7
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/screen/TalkFront.java

@@ -2196,6 +2196,8 @@ public class TalkFront extends WpadScreen implements CallEventListener, MainEven
         public void onStopTrackingTouch(SeekBar seekBar) {
 //            Log.d(TAG, "[onStopTrackingTouch] nCurrentVolume:" + nCurrentVolume);
             nCurrentVolume = getCtrlLevel(seekBar.getProgress());
+            //jglee - 202412.13 통화 볼륨 애매재하게 찍히는것 수정
+            drawVolume();
             ctrlVolume(true);
         }
     };
@@ -2245,6 +2247,8 @@ public class TalkFront extends WpadScreen implements CallEventListener, MainEven
 
     private void showVolume(int nValue) {
         try {
+            //jglee - 202412.13 통화 볼륨 애매재하게 찍히는것 수정
+            if (nValue == 0) nValue = 1;
 //            Log.d(TAG, "[showVolume] nValue [" + nValue + "]");
             if (TXT_VOLUME_LEVEL != null) TXT_VOLUME_LEVEL.setText(Integer.toString(nValue));
             else Log.w(TAG, "[showVolume] TXT_VOLUME_LEVEL is null!!");
@@ -2258,7 +2262,8 @@ public class TalkFront extends WpadScreen implements CallEventListener, MainEven
     private void drawVolume() {
         try {
             if (SEEKBAR_VOLUME != null) {
-                SEEKBAR_VOLUME.setProgress(ctrlSeekBarThumb(nCurrentVolume));
+                //jglee - 202412.13 통화 볼륨 애매재하게 찍히는것 수정
+                SEEKBAR_VOLUME.setProgress(ctrlSeekBarThumb(nCurrentVolume, true));
                 showVolume(nCurrentVolume);
             }
             else Log.w(TAG, "[drawVolume] SEEKBAR_VOLUME is null!!");
@@ -2355,7 +2360,8 @@ public class TalkFront extends WpadScreen implements CallEventListener, MainEven
     private void drawBright() {
         try {
             if (SEEKBAR_BRIGHT != null) {
-                SEEKBAR_BRIGHT.setProgress(ctrlSeekBarThumb(nCurrentBrightness));
+                //jglee - 202412.13 통화 볼륨 애매재하게 찍히는것 수정
+                SEEKBAR_BRIGHT.setProgress(ctrlSeekBarThumb(nCurrentBrightness, false));
                 showBright(nCurrentBrightness);
             }
             else Log.w(TAG, "[drawVolume] SEEKBAR_BRIGHT is null!!");
@@ -2373,7 +2379,8 @@ public class TalkFront extends WpadScreen implements CallEventListener, MainEven
             Log.d(TAG, "[getCtrlLevel] nValue: " + nValue);
             if (nValue == 0) return 1;
             int result = nValue / 10;
-            if ((nValue % 10) != 0) result++;
+            //jglee - 202412.13 통화 볼륨 애매재하게 찍히는것 수정
+            if ((nValue % 10) >= 5) result++;
             Log.d(TAG, "[getCtrlLevel] result: " + result);
             return result;
         } catch (RuntimeException re) {
@@ -2387,13 +2394,24 @@ public class TalkFront extends WpadScreen implements CallEventListener, MainEven
         }
     }
 
-    private int ctrlSeekBarThumb(int nValue) {
+    //jglee - 202412.13 통화 볼륨 애매재하게 찍히는것 수정
+    private int ctrlSeekBarThumb(int nValue, boolean bVol) {
         try {
             int progress;
-            if (nValue == 1) progress = 1;
-            else if (nValue == 10) progress = 100;
-            else progress = (nValue - 1) * 11;
+            if (bVol) {
+                progress = nValue * 10;
+            }
+            else {
+                if (nValue == 1) progress = 1;
+                else if (nValue == 10) progress = 100;
+                else progress = (nValue - 1) * 11;
 
+                //여기서 다시 확인이 필요함
+                if(progress/10 != nValue)
+                {
+                    progress = nValue * 10;
+                }
+            }
             return progress;
         } catch (RuntimeException re) {
             LogUtil.errorLogInfo("", TAG, re);

+ 8 - 6
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/screen/TalkGuard.java

@@ -2141,6 +2141,7 @@ public class TalkGuard extends WpadScreen implements CallEventListener, MainEven
         public void onStopTrackingTouch(SeekBar seekBar) {
 //            Log.d(TAG, "[onStopTrackingTouch] nCurrentVolume:" + nCurrentVolume);
             nCurrentVolume = getCtrlLevel(seekBar.getProgress());
+            drawVolume(); // 가까운 정수(반올림)에 thumb 재정렬
             ctrlVolume(true);
         }
     };
@@ -2192,6 +2193,7 @@ public class TalkGuard extends WpadScreen implements CallEventListener, MainEven
     private void showVolume(int nValue) {
         try {
 //            Log.d(TAG, "[showVolume] nValue [" + nValue + "]");
+            if (nValue == 0) nValue = 1;
             if (TXT_VOLUME_LEVEL != null) TXT_VOLUME_LEVEL.setText(Integer.toString(nValue));
             else Log.w(TAG, "[showVolume] TXT_VOLUME_LEVEL is null!!");
         } catch (RuntimeException re) {
@@ -2224,7 +2226,7 @@ public class TalkGuard extends WpadScreen implements CallEventListener, MainEven
 //            Log.d(TAG, "[getCtrlLevel] nValue: " + nValue);
             if (nValue == 0) return 1;
             int result = nValue / 10;
-            if ((nValue % 10) != 0) result++;
+            if ((nValue % 10) >= 5) result++;
             Log.d(TAG, "[getCtrlLevel] result: " + result);
             return result;
         } catch (RuntimeException re) {
@@ -2240,11 +2242,11 @@ public class TalkGuard extends WpadScreen implements CallEventListener, MainEven
 
     private int ctrlSeekBarThumb(int nValue) {
         try {
-            int progress;
-            if (nValue == 1) progress = 1;
-            else if (nValue == 10) progress = 100;
-            else progress = (nValue - 1) * 11;
-
+//            int progress;
+//            if (nValue == 1) progress = 1;
+//            else if (nValue == 10) progress = 100;
+//            else progress = (nValue - 1) * 11;
+            int progress = nValue * 10;
             return progress;
         } catch (RuntimeException re) {
             LogUtil.errorLogInfo("", TAG, re);

+ 8 - 6
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/screen/TalkLobby.java

@@ -2129,6 +2129,7 @@ public class TalkLobby extends WpadScreen implements CallEventListener, MainEven
         public void onStopTrackingTouch(SeekBar seekBar) {
 //            Log.d(TAG, "[onStopTrackingTouch] nCurrentVolume:" + nCurrentVolume);
             nCurrentVolume = getCtrlLevel(seekBar.getProgress());
+            drawVolume();
             ctrlVolume(true);
         }
     };
@@ -2179,6 +2180,7 @@ public class TalkLobby extends WpadScreen implements CallEventListener, MainEven
     private void showVolume(int nValue) {
         try {
 //            Log.d(TAG, "[showVolume] nValue [" + nValue + "]");
+            if (nValue == 0) nValue = 1;
             if (TXT_VOLUME_LEVEL != null) TXT_VOLUME_LEVEL.setText(Integer.toString(nValue));
             else Log.w(TAG, "[showVolume] TXT_VOLUME_LEVEL is null!!");
         } catch (RuntimeException re) {
@@ -2209,7 +2211,7 @@ public class TalkLobby extends WpadScreen implements CallEventListener, MainEven
 //            Log.d(TAG, "[getCtrlLevel] nValue: " + nValue);
             if (nValue == 0) return 1;
             int result = nValue / 10;
-            if ((nValue % 10) != 0) result++;
+            if ((nValue % 10) >= 5) result++;
 //            Log.d(TAG, "[getCtrlLevel] result: " + result);
             return result;
         } catch (RuntimeException re) {
@@ -2225,11 +2227,11 @@ public class TalkLobby extends WpadScreen implements CallEventListener, MainEven
 
     private int ctrlSeekBarThumb(int nValue) {
         try {
-            int progress;
-            if (nValue == 1) progress = 1;
-            else if (nValue == 10) progress = 100;
-            else progress = (nValue - 1) * 11;
-
+//            int progress;
+//            if (nValue == 1) progress = 1;
+//            else if (nValue == 10) progress = 100;
+//            else progress = (nValue - 1) * 11;
+            int progress = nValue * 10;
             return progress;
         } catch (RuntimeException re) {
             LogUtil.errorLogInfo("", TAG, re);

+ 8 - 6
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/screen/TalkPSTN.java

@@ -2334,6 +2334,7 @@ public class TalkPSTN extends WpadScreen implements CallEventListener, DTMFEvent
         public void onStopTrackingTouch(SeekBar seekBar) {
 //            Log.d(TAG, "[onStopTrackingTouch] nCurrentVolume:" + nCurrentVolume);
             nCurrentVolume = getCtrlLevel(seekBar.getProgress());
+            drawVolume();
             ctrlVolume(true);
         }
     };
@@ -2389,6 +2390,7 @@ public class TalkPSTN extends WpadScreen implements CallEventListener, DTMFEvent
     private void showVolume(int nValue) {
         try {
 //            Log.d(TAG, "[showVolume] nValue [" + nValue + "]");
+            if (nValue == 0) nValue = 1;
             if (TXT_VOLUME_LEVEL != null) TXT_VOLUME_LEVEL.setText(Integer.toString(nValue));
             else Log.w(TAG, "[showVolume] TXT_VOLUME_LEVEL is null!!");
         } catch (RuntimeException re) {
@@ -2421,7 +2423,7 @@ public class TalkPSTN extends WpadScreen implements CallEventListener, DTMFEvent
 //            Log.d(TAG, "[getCtrlLevel] nValue: " + nValue);
             if (nValue == 0) return 1;
             int result = nValue / 10;
-            if ((nValue % 10) != 0) result++;
+            if ((nValue % 10) >= 5) result++;
 //            Log.d(TAG, "[getCtrlLevel] result: " + result);
             return result;
         } catch (RuntimeException re) {
@@ -2437,11 +2439,11 @@ public class TalkPSTN extends WpadScreen implements CallEventListener, DTMFEvent
 
     private int ctrlSeekBarThumb(int nValue) {
         try {
-            int progress;
-            if (nValue == 1) progress = 1;
-            else if (nValue == 10) progress = 100;
-            else progress = (nValue - 1) * 11;
-
+//            int progress;
+//            if (nValue == 1) progress = 1;
+//            else if (nValue == 10) progress = 100;
+//            else progress = (nValue - 1) * 11;
+            int progress = nValue * 10;
             return progress;
         } catch (RuntimeException re) {
             LogUtil.errorLogInfo("", TAG, re);

+ 8 - 6
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/screen/TalkResidence.java

@@ -2477,6 +2477,7 @@ public class TalkResidence extends WpadScreen implements CallEventListener, Main
         public void onStopTrackingTouch(SeekBar seekBar) {
 //            Log.d(TAG, "[onStopTrackingTouch] nCurrentVolume:" + nCurrentVolume);
             nCurrentVolume = getCtrlLevel(seekBar.getProgress());
+            drawVolume();
             ctrlVolume(true);
         }
     };
@@ -2527,6 +2528,7 @@ public class TalkResidence extends WpadScreen implements CallEventListener, Main
     private void showVolume(int nValue) {
         try {
 //            Log.d(TAG, "[showVolume] nValue [" + nValue + "]");
+            if (nValue == 0) nValue = 1;
             if (TXT_VOLUME_LEVEL != null) TXT_VOLUME_LEVEL.setText(Integer.toString(nValue));
             else Log.w(TAG, "[showVolume] TXT_VOLUME_LEVEL is null!!");
         } catch (RuntimeException re) {
@@ -2557,7 +2559,7 @@ public class TalkResidence extends WpadScreen implements CallEventListener, Main
 //            Log.d(TAG, "[getCtrlLevel] nValue: " + nValue);
             if (nValue == 0) return 1;
             int result = nValue / 10;
-            if ((nValue % 10) != 0) result++;
+            if ((nValue % 10) >= 5) result++;
             Log.d(TAG, "[getCtrlLevel] result: " + result);
             return result;
         } catch (RuntimeException re) {
@@ -2573,11 +2575,11 @@ public class TalkResidence extends WpadScreen implements CallEventListener, Main
 
     private int ctrlSeekBarThumb(int nValue) {
         try {
-            int progress;
-            if (nValue == 1) progress = 1;
-            else if (nValue == 10) progress = 100;
-            else progress = (nValue - 1) * 11;
-
+//            int progress;
+//            if (nValue == 1) progress = 1;
+//            else if (nValue == 10) progress = 100;
+//            else progress = (nValue - 1) * 11;
+            int progress = nValue * 10;
             return progress;
         } catch (RuntimeException re) {
             LogUtil.errorLogInfo("", TAG, re);