|
|
@@ -12,12 +12,16 @@ import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
|
import android.widget.RelativeLayout;
|
|
|
|
|
|
+import com.artncore.WallPadDataMgr.WallpadDeviceSet;
|
|
|
import com.artncore.WallPadDataMgr.WallpadStatusData;
|
|
|
import com.artncore.commons.define;
|
|
|
import com.artncore.wallpadapi.SmartKeyRfDoorAPI;
|
|
|
import com.artncore.wallpadapi.WallPadAPI;
|
|
|
import com.util.LogUtil;
|
|
|
|
|
|
+import org.json.JSONException;
|
|
|
+import org.json.JSONObject;
|
|
|
+
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -41,7 +45,7 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
WpadImageView OkBtn, CancelBtn, topCancelBtn, ManualBtn;
|
|
|
WpadTextView title;
|
|
|
|
|
|
- static int SET_CNT = 1;
|
|
|
+ static int SET_CNT = 3;
|
|
|
WpadTextView [] textTitle = new WpadTextView[SET_CNT];
|
|
|
WpadTextView [] textValue = new WpadTextView[SET_CNT];
|
|
|
WpadImageView [] btnPrev = new WpadImageView[SET_CNT];
|
|
|
@@ -54,29 +58,50 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
// ******** 스마트현관카메라 설정값 ********
|
|
|
private boolean bCurrentRecordingSet = bDefaultRecordingSet; // 거동수상자 녹화 설정: 사용
|
|
|
private int mCurrentRecordTime = mDefaultRecordTime; // 녹화시간 설정: 10/20/30초 (기본값: 30초)
|
|
|
+ private int mCurrentRecordCheckTime = mDefaultRecordCheckTime; // 거동수상자 감지 시간 설정: 10/20/30/40/50/60/180/360/600초 (기본값: 60초)
|
|
|
+ private int mCurrentRecordCheckCount = mDefaultRecordCheckCount; // 거동수상자 감지 횟수 설정: 3(민감)/5(보통)/10(둔감) (기본값: 5)
|
|
|
|
|
|
// 초기값 (Default)
|
|
|
private final static boolean bDefaultRecordingSet = true;
|
|
|
private final static int mDefaultRecordTime = 30;
|
|
|
+ private final static int mDefaultRecordCheckTime = 60; // jglee - 2023.03.29 거동수상자 감지 대기 시간
|
|
|
+ private final static int mDefaultRecordCheckCount = 5; // jglee - 2023.03.29 거동수상자 감지 횟수 - 보통
|
|
|
// MIN (최소값)
|
|
|
private final int MIN_RECORD_TIME = 10;
|
|
|
// MAX (최대값)
|
|
|
private final int MAX_RECORD_TIME = 30;
|
|
|
|
|
|
+ // MIN 최소값
|
|
|
+ private final int MIN_RECORD_WAITING_TIME = 30; // jglee - 2023.03.29 거동수상자 감지 대기 시간 최소값(초 기준)
|
|
|
+ // MAX 최대값
|
|
|
+ private final int MAX_RECORD_WAITING_TIME = 120; // jglee - 2023.03.29 거동수상자 감지 대기 시간 최대값(초 기준)
|
|
|
+
|
|
|
+ // MIN 최소값
|
|
|
+ private final int MIN_RECORD_CHECK_COUNT = 3; // jglee - 2023.03.29 거동수상자 감지 횟수 최소값
|
|
|
+ // MAX 최대값
|
|
|
+ private final int MAX_RECORD_CHECK_COUNT = 7; // jglee - 2023.03.29 거동수상자 감지 횟수 최대값
|
|
|
+
|
|
|
public final String TXT_MINUTE = "분";
|
|
|
public final String TXT_SECOND = "초";
|
|
|
|
|
|
public final String TXT_RECORDING_SETTING = "거동수상자 녹화 설정";
|
|
|
public final String TXT_RECORDING_TIME = "녹화시간 설정";
|
|
|
|
|
|
+ //jglee - 2023.03.28
|
|
|
+ public final String TXT_RECORDING_WAITING_TIME = "거동수상자 감지 시간";
|
|
|
+ public final String TXT_RECORDING_CEHCK_COUNT = "거동수상자 감지 횟수";
|
|
|
+
|
|
|
// 고정값 (센서감감도, 감지 유지시간)
|
|
|
private final byte DEFINE_SENSOR_SENSITIVITY = (byte) 0x05;
|
|
|
- private final byte DEFINE_SENSOR_DURATION = (byte) 0x05;
|
|
|
+ private byte DEFINE_SENSOR_DURATION = (byte) 0x05;
|
|
|
|
|
|
Context mContext;
|
|
|
WallPadAPI mWallPadAPI;
|
|
|
SmartKeyRfDoorAPI smartKeyRfDoorAPI;
|
|
|
|
|
|
+ //jglee - 2022.09.05 현관 카메라 종류 가져오기(카메라 타입에 따라 감지시간 설정 유무)
|
|
|
+ public int dorType;
|
|
|
+
|
|
|
public PopupSmartIOTCam(Context context, RelativeLayout layout, WallPadAPI wpapi, int operationMode) {
|
|
|
super(context, layout);
|
|
|
try {
|
|
|
@@ -116,13 +141,20 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
|
|
|
title = new WpadTextView(context, false, 990, 90, Gravity.CENTER, Color.WHITE, Common.fontsize._46, true, ID.SmartIOTCamPopup.text.TITLE);
|
|
|
ViewRegistration(layout, title, 0, 0);
|
|
|
+ //jglee - 스마트현관카메라 -> 현관카메라 로 변경
|
|
|
title.setText("현관카메라 설정");
|
|
|
|
|
|
+ dorType = getDoorCamType();
|
|
|
+
|
|
|
+ //jglee - 2023.03.29 DB에 저장된 정보 가져오기
|
|
|
+ getSmartDoorCamWaitTime();
|
|
|
+ getSmartDoorCamCheckCount();
|
|
|
+
|
|
|
DrawContents();
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG,"[Exception] PopupSmartIOTCam(Context context, RelativeLayout layout, WallPadAPI wpapi, int operationMode)");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
@@ -151,13 +183,25 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
Sound().Play(WpadSound.SND.effect.TOUCH_LATCHED);
|
|
|
super.finish();
|
|
|
} else if (TargetId == ID.SmartIOTCamPopup.button.CHECK_USE) {
|
|
|
+ //jglee - 2023.05.23 소리음 추가
|
|
|
+ Sound().Play(WpadSound.SND.effect.TOUCH_LATCHED);
|
|
|
changeRecordingSet(true);
|
|
|
} else if (TargetId == ID.SmartIOTCamPopup.button.CHECK_NOTUSE) {
|
|
|
+ //jglee - 2023.05.23 소리음 추가
|
|
|
+ Sound().Play(WpadSound.SND.effect.TOUCH_LATCHED);
|
|
|
changeRecordingSet(false);
|
|
|
} else if (TargetId == ID.SmartIOTCamPopup.button.PREV4) {
|
|
|
ChangeRecordTime(false);
|
|
|
} else if (TargetId == ID.SmartIOTCamPopup.button.NEXT4) {
|
|
|
ChangeRecordTime(true);
|
|
|
+ } else if (TargetId == ID.SmartIOTCamPopup.button.PREV1) { // check waiting time
|
|
|
+ ChangeRecordWatingTime(false);
|
|
|
+ } else if (TargetId == ID.SmartIOTCamPopup.button.NEXT1) { // check waiting time
|
|
|
+ ChangeRecordWatingTime(true);
|
|
|
+ } else if (TargetId == ID.SmartIOTCamPopup.button.PREV2) { // check count
|
|
|
+ ChangeRecordCheckCount(false);
|
|
|
+ } else if (TargetId == ID.SmartIOTCamPopup.button.NEXT2) { // check count
|
|
|
+ ChangeRecordCheckCount(true);
|
|
|
} else if (TargetId == ID.SmartIOTCamPopup.button.MANUAL) {
|
|
|
Log.d(TAG, "[onTouchEvent] [MANUAL] BUTTON !!!");
|
|
|
Sound().Play(WpadSound.SND.effect.TOUCH_LATCHED);
|
|
|
@@ -176,16 +220,24 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
SetKind data = new SetKind(ID.SmartIOTCamPopup.button.PREV4, ID.SmartIOTCamPopup.button.NEXT4, TXT_RECORDING_TIME);
|
|
|
SettingData.add(data);
|
|
|
|
|
|
+ //jglee - 2023.03.29 거동수상자 감지 시간 정보 설정
|
|
|
+ data = new SetKind(ID.SmartIOTCamPopup.button.PREV1, ID.SmartIOTCamPopup.button.NEXT1, TXT_RECORDING_WAITING_TIME);
|
|
|
+ SettingData.add(data);
|
|
|
+
|
|
|
+ //jglee - 2023.03.29 거동수상자 감지 횟수 설정
|
|
|
+ data = new SetKind(ID.SmartIOTCamPopup.button.PREV2, ID.SmartIOTCamPopup.button.NEXT2, TXT_RECORDING_CEHCK_COUNT);
|
|
|
+ SettingData.add(data);
|
|
|
+
|
|
|
return true;
|
|
|
} else {
|
|
|
Log.w(TAG, "[initInfo] mWallPadAPI.Check_Connect() FAIL!!");
|
|
|
return false;
|
|
|
}
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- return false;
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] initInfo()");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
@@ -220,10 +272,10 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
|
|
|
return true;
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- return false;
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] GetDBConfigValue()");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
@@ -238,12 +290,17 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
DBMGR.SetStrangerRecordingOnOff(bCurrentRecordingSet);
|
|
|
DBMGR.SetSmartDoorCamRecordTime(mCurrentRecordTime);
|
|
|
DBMGR.closeDB();
|
|
|
+
|
|
|
+ //jglee - 변경된 시나리오에 따라 감지 시간 및 횟수 저장
|
|
|
+ SetSmartDoorCamWaitTime();
|
|
|
+ SetSmartDoorCamCheckCount();
|
|
|
+
|
|
|
Log.d(TAG, "[SaveDBConfigValue] RecordingSet [" + bCurrentRecordingSet + "], RecordTime [" + mCurrentRecordTime + "]");
|
|
|
return true;
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] SaveDBConfigValue()");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
@@ -343,6 +400,17 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
if (item.mTitle.equals(TXT_RECORDING_TIME)) {
|
|
|
DrawRecordTime(mCurrentRecordTime);
|
|
|
}
|
|
|
+ //jglee - 2023.03.29 감지 시간 추가
|
|
|
+ else if (item.mTitle.equals(TXT_RECORDING_WAITING_TIME)) {
|
|
|
+ DrawRecordCheckTime(mCurrentRecordCheckTime);
|
|
|
+ //jglee - 2023.03.29 라인 추가
|
|
|
+ Line_Background = new WpadImageView(this.getContext(), WpadImageView.TOUCH_KIND.NONE, 870, 182, R.drawable.bg_line_1, 0, ID.SmartIOTCamPopup.image.BACKGROUND);
|
|
|
+ ViewRegistration(this.getLayout(), Line_Background, Common.PopupNomalMarginLEFT(205), Common.PopupNomalMarginTOP(263 + 90 * arrayIdx));
|
|
|
+ }
|
|
|
+ //jglee - 2023.03.29 횟수 설정 추가
|
|
|
+ else if (item.mTitle.equals(TXT_RECORDING_CEHCK_COUNT)) {
|
|
|
+ DrawRecordCheckCount(mCurrentRecordCheckCount);
|
|
|
+ }
|
|
|
arrayIdx++;
|
|
|
}
|
|
|
|
|
|
@@ -350,9 +418,9 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
|
|
|
DrawRecordingSet(bCurrentRecordingSet);
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] DrawContents()");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
@@ -389,9 +457,9 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
}
|
|
|
}
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] getViewIdx(String searchName)");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
@@ -407,9 +475,9 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
DrawRecordingSet(bCurrentRecordingSet); // 통신 성공시에만 녹화 여부 설정되도록!
|
|
|
Log.d(TAG, "[changeRecordingSet] bCurrentRecordingSet [" + bCurrentRecordingSet + "]");
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] changeRecordingSet(boolean bUse)");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
@@ -450,13 +518,22 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- String[] retData = smartKeyRfDoorAPI.SetSensorConfig((byte)0x05, (byte)0x240).split(define.DEVCTR_CMD_SPLITER);
|
|
|
- if (retData != null) {
|
|
|
- if (retData[0].contains("SUCCESS")) {
|
|
|
- Log.d(TAG, "[changeRecordingSet] SetSensorConfig SUCCESS!!!");
|
|
|
- bRet = true;
|
|
|
+ //jglee - 2022.09.05 현관 카메라 종류 가져오기(카메라 타입에 따라 감지시간 설정 유무)
|
|
|
+ if(dorType != WallpadDeviceSet.DOORTYPE_IOT_SMART)
|
|
|
+ {
|
|
|
+ String[] retData = smartKeyRfDoorAPI.SetSensorConfig((byte)0x05, (byte)0x240).split(define.DEVCTR_CMD_SPLITER);
|
|
|
+ if (retData != null) {
|
|
|
+ if (retData[0].contains("SUCCESS")) {
|
|
|
+ Log.d(TAG, "[changeRecordingSet] SetSensorConfig SUCCESS!!!");
|
|
|
+ bRet = true;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ bRet = true;
|
|
|
+ }
|
|
|
+
|
|
|
cam = ctrlSmartIOTCamStatusMode(Common.SmartRFCamStatusMode.STATUS_AUTO_OFF);
|
|
|
led = ctrlSmartIOTCamLEDMode(Common.SmartRFCamLEDMode.LED_AUTO_OFF);
|
|
|
}
|
|
|
@@ -486,6 +563,135 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private byte getSmartDoorCamDuration() {
|
|
|
+ try {
|
|
|
+ WallpadDeviceSet wallpadDeviceSet = new WallpadDeviceSet(getContext());
|
|
|
+ DEFINE_SENSOR_DURATION = (byte) wallpadDeviceSet.Get_SmartDoorCam_Dutaion();
|
|
|
+ wallpadDeviceSet.closeDB();
|
|
|
+ Log.d(TAG, "[getSmartDoorCamDuration] DEFINE_SENSOR_DURATION [" + DEFINE_SENSOR_DURATION + "]");
|
|
|
+ return DEFINE_SENSOR_DURATION;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] getSmartDoorCamDuration()");
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ return DEFINE_SENSOR_DURATION;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * DB에 저장된 거동수상자 대기 시간
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private int getSmartDoorCamWaitTime() {
|
|
|
+ try {
|
|
|
+ WallpadDeviceSet wallpadDeviceSet = new WallpadDeviceSet(getContext());
|
|
|
+ mCurrentRecordCheckTime = wallpadDeviceSet.Get_SmartDoorCam_Dutaion();
|
|
|
+ wallpadDeviceSet.closeDB();
|
|
|
+ Log.d(TAG, "[getSmartDoorCamWaitTime] Get_SmartDoorCam_WaitTime [" + mCurrentRecordCheckTime + "]");
|
|
|
+ return mCurrentRecordCheckTime;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] getSmartDoorCamDuration()");
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ return DEFINE_SENSOR_DURATION;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 거동수상자 감지 횟수
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private int getSmartDoorCamCheckCount() {
|
|
|
+ try {
|
|
|
+ WallpadDeviceSet wallpadDeviceSet = new WallpadDeviceSet(getContext());
|
|
|
+ mCurrentRecordCheckCount = wallpadDeviceSet.Get_SmartDoorCam_Check_Count();
|
|
|
+ wallpadDeviceSet.closeDB();
|
|
|
+ Log.d(TAG, "[mCurrentRecordCheckCount] Get_SmartDoorCam_CheckCount [" + mCurrentRecordCheckCount + "]");
|
|
|
+ return mCurrentRecordCheckCount;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] getSmartDoorCamCheckCount()");
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ return DEFINE_SENSOR_DURATION;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 거동수상자 감지 대기 시간 현재값 저장
|
|
|
+ */
|
|
|
+ private void SetSmartDoorCamWaitTime() {
|
|
|
+ try {
|
|
|
+ WallpadDeviceSet wallpadDeviceSet = new WallpadDeviceSet(getContext());
|
|
|
+ wallpadDeviceSet.Set_SmartDoorCam_Duration(true, mCurrentRecordCheckTime);
|
|
|
+ wallpadDeviceSet.closeDB();
|
|
|
+ Log.d(TAG, "[SetSmartDoorCamWaitTime] SetSmartDoorCamWaitTime [" + mCurrentRecordCheckTime + "]");
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] SetSmartDoorCamWaitTime()");
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 거동수상자 감지 횟수 저장
|
|
|
+ */
|
|
|
+ private void SetSmartDoorCamCheckCount() {
|
|
|
+ try {
|
|
|
+ WallpadDeviceSet wallpadDeviceSet = new WallpadDeviceSet(getContext());
|
|
|
+ wallpadDeviceSet.Set_SmartDoorCam_CheckCount(true, mCurrentRecordCheckCount);
|
|
|
+ wallpadDeviceSet.closeDB();
|
|
|
+ Log.d(TAG, "[SetSmartDoorCamCheckCount] SetSmartDoorCamCheckCount [" + mCurrentRecordCheckCount + "]");
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] SetSmartDoorCamCheckCount()");
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //jglee - 2022.09.05 현관 카메라 종류 가져오기
|
|
|
+ private int getDoorCamType() {
|
|
|
+ int doorCamType = WallpadDeviceSet.DOORTYPE_NONE;
|
|
|
+ try {
|
|
|
+ WallpadDeviceSet deviceSet = new WallpadDeviceSet(getContext());
|
|
|
+ int[] anFrontCameraType = deviceSet.getFrontCameraSettingInfo(); // 현관카메라 종류
|
|
|
+ deviceSet.closeDB();
|
|
|
+
|
|
|
+ if (anFrontCameraType != null) {
|
|
|
+ doorCamType = anFrontCameraType[1];
|
|
|
+ Log.d(TAG, "[getDoorCamType] doorCamType [" + doorCamType + "]");
|
|
|
+ }
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] getDoorCamType()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ return doorCamType;
|
|
|
+ }
|
|
|
+
|
|
|
public int ctrlSmartIOTCamStatusMode(byte mode) {
|
|
|
try {
|
|
|
if (smartKeyRfDoorAPI != null) {
|
|
|
@@ -494,9 +700,9 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
return result;
|
|
|
} else Log.w(TAG, "[ctrlSmartIOTCamStatusMode] smartKeyRfDoorAPI is null!!");
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] ctrlSmartIOTCamStatusMode(byte mode)");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
@@ -512,9 +718,9 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
return result;
|
|
|
} else Log.w(TAG, "[ctrlSmartIOTCCamLEDMode] smartKeyRfDoorAPI is null!!");
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] ctrlSmartIOTCamLEDMode(byte mode)");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
@@ -548,9 +754,9 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
}
|
|
|
}
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] DrawRecordingSet(boolean bSet)");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
@@ -571,15 +777,132 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
|
|
|
DrawRecordTime(mCurrentRecordTime);
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] ChangeRecordTime(boolean Up)");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 거동수상자 감지 대기 기준 시간
|
|
|
+ * @param Up
|
|
|
+ */
|
|
|
+ private void ChangeRecordWatingTime(boolean Up) {
|
|
|
+ try {
|
|
|
+ // 나눌때 나머지가 있는지 확인
|
|
|
+ boolean isValid = mCurrentRecordCheckTime >= 60 ? ((mCurrentRecordCheckTime % 60) == 0 ? true : false) : ((mCurrentRecordCheckTime % 30) == 0 ? true : false);
|
|
|
+
|
|
|
+ if (Up) {
|
|
|
+ if (mCurrentRecordTime != MAX_RECORD_WAITING_TIME) Sound().Play(WpadSound.SND.effect.TOUCH_LATCHED);
|
|
|
+ // 나머지가 없는 데이터
|
|
|
+ if(isValid)
|
|
|
+ {
|
|
|
+ if(mCurrentRecordCheckTime >= 60) mCurrentRecordCheckTime += 60;
|
|
|
+ else mCurrentRecordCheckTime += 30;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //나머지가 있는 데이터
|
|
|
+ int quotient_value = 30;
|
|
|
+ if(mCurrentRecordCheckTime >= 60) {
|
|
|
+ quotient_value = 60;
|
|
|
+ }
|
|
|
+ int quotient = mCurrentRecordCheckTime / quotient_value;
|
|
|
+ mCurrentRecordCheckTime = quotient_value * (quotient + 1);
|
|
|
+ }
|
|
|
+ if (mCurrentRecordCheckTime >= MAX_RECORD_WAITING_TIME) mCurrentRecordCheckTime = MAX_RECORD_WAITING_TIME;
|
|
|
+ } else {
|
|
|
+ if (mCurrentRecordCheckTime != MIN_RECORD_WAITING_TIME) Sound().Play(WpadSound.SND.effect.TOUCH_LATCHED);
|
|
|
+ if(isValid)
|
|
|
+ {
|
|
|
+ //나머지가 없는 데이터
|
|
|
+ if(mCurrentRecordCheckTime > 60) mCurrentRecordCheckTime -= 60;
|
|
|
+ else mCurrentRecordCheckTime -= 30;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //나머지가 있는 데이터
|
|
|
+ int quotient_value = 30;
|
|
|
+ if(mCurrentRecordCheckTime > 60) {
|
|
|
+ quotient_value = 60;
|
|
|
+ }
|
|
|
+ int quotient = mCurrentRecordCheckTime / quotient_value;
|
|
|
+ mCurrentRecordCheckTime = quotient_value * (quotient);
|
|
|
+ }
|
|
|
+ if (mCurrentRecordCheckTime <= MIN_RECORD_WAITING_TIME) mCurrentRecordCheckTime = MIN_RECORD_WAITING_TIME;
|
|
|
+ }
|
|
|
+
|
|
|
+ DrawRecordCheckTime(mCurrentRecordCheckTime);
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] ChangeRecordTime(boolean Up)");
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 거동수상자 감지 대기 기준 시간
|
|
|
+ * @param Up
|
|
|
+ */
|
|
|
+ private void ChangeRecordCheckCount(boolean Up) {
|
|
|
+ try {
|
|
|
+ // 나눌때 나머지가 있는지 확인
|
|
|
+// boolean isValid = false;//mCurrentRecordCheckCount == 3 ? true : ((mCurrentRecordCheckCount % 5) == 0 ? true : false);
|
|
|
+// if(mCurrentRecordCheckCount == 3 || mCurrentRecordCheckCount == 5 || mCurrentRecordCheckCount == 7) isValid = true;
|
|
|
+
|
|
|
+ if (Up) {
|
|
|
+ if (mCurrentRecordCheckCount != MAX_RECORD_CHECK_COUNT) Sound().Play(WpadSound.SND.effect.TOUCH_LATCHED);
|
|
|
+ // 나머지가 없는 데이터
|
|
|
+// if(isValid)
|
|
|
+// {
|
|
|
+// if(mCurrentRecordCheckCount == 3) mCurrentRecordCheckCount = 5;
|
|
|
+// else if(mCurrentRecordCheckCount == 5) mCurrentRecordCheckCount = 7;
|
|
|
+// }
|
|
|
+// else
|
|
|
+// {
|
|
|
+// //나머지가 있는 데이터
|
|
|
+// int quotient_value = 5;
|
|
|
+// int quotient = mCurrentRecordCheckCount / quotient_value;
|
|
|
+// mCurrentRecordCheckCount = quotient_value * (quotient + 1);
|
|
|
+// }
|
|
|
+ if(mCurrentRecordCheckCount == 3) mCurrentRecordCheckCount = 5;
|
|
|
+ else if(mCurrentRecordCheckCount == 5) mCurrentRecordCheckCount = 7;
|
|
|
+ if (mCurrentRecordCheckCount >= MAX_RECORD_CHECK_COUNT) mCurrentRecordCheckCount = MAX_RECORD_CHECK_COUNT;
|
|
|
+ } else {
|
|
|
+ if (mCurrentRecordCheckCount != MIN_RECORD_CHECK_COUNT) Sound().Play(WpadSound.SND.effect.TOUCH_LATCHED);
|
|
|
+// if(isValid)
|
|
|
+// {
|
|
|
+// //나머지가 없는 데이터
|
|
|
+// mCurrentRecordCheckCount -= 5;
|
|
|
+// }
|
|
|
+// else
|
|
|
+// {
|
|
|
+// //나머지가 있는 데이터
|
|
|
+// int quotient_value = 5;
|
|
|
+// int quotient = mCurrentRecordCheckCount / quotient_value;
|
|
|
+// mCurrentRecordCheckCount = quotient_value * (quotient);
|
|
|
+// }
|
|
|
+ if(mCurrentRecordCheckCount == 7) mCurrentRecordCheckCount = 5;
|
|
|
+ else if(mCurrentRecordCheckCount == 5) mCurrentRecordCheckCount = 3;
|
|
|
+ if (mCurrentRecordCheckCount <= MIN_RECORD_CHECK_COUNT) mCurrentRecordCheckCount = MIN_RECORD_CHECK_COUNT;
|
|
|
+ }
|
|
|
+ DrawRecordCheckCount(mCurrentRecordCheckCount);
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] ChangeRecordTime(boolean Up)");
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
private void DrawRecordTime (int val) {
|
|
|
try {
|
|
|
Log.d(TAG, "[DrawRecordTime] val [" + val + "]");
|
|
|
@@ -602,9 +925,96 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
}
|
|
|
} else Log.w(TAG, "[DrawRecordTime] strTime is NULL!!");
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] DrawRecordTime(int val)");
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 거동수상자 감지 시간 그리기
|
|
|
+ * @param val
|
|
|
+ */
|
|
|
+ private void DrawRecordCheckTime (int val) {
|
|
|
+ try {
|
|
|
+ Log.d(TAG, "[DrawRecordTime] val [" + val + "]");
|
|
|
+ int idx = getViewIdx(TXT_RECORDING_WAITING_TIME);
|
|
|
+ String strTime = changeSecToMin(val); // 초 -> 분 변환
|
|
|
+ if (strTime != null) {
|
|
|
+ if(textValue[idx]!=null)
|
|
|
+ textValue[idx].setText(strTime);
|
|
|
+ if (val == MAX_RECORD_WAITING_TIME) {
|
|
|
+ if(btnNext[idx]!=null)
|
|
|
+ btnNext[idx].setButtonRearImage();
|
|
|
+ } else if (val == MIN_RECORD_WAITING_TIME) {
|
|
|
+ if(btnPrev[idx]!=null)
|
|
|
+ btnPrev[idx].setButtonRearImage();
|
|
|
+ } else {
|
|
|
+ if(btnNext[idx]!=null)
|
|
|
+ btnNext[idx].setButtonFrontImage();
|
|
|
+ if(btnPrev[idx]!=null)
|
|
|
+ btnPrev[idx].setButtonFrontImage();
|
|
|
+ }
|
|
|
+ } else Log.w(TAG, "[DrawRecordTime] strTime is NULL!!");
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] DrawRecordTime(int val)");
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 거동수상자 감지 횟수
|
|
|
+ * @param val
|
|
|
+ */
|
|
|
+ private void DrawRecordCheckCount (int val) {
|
|
|
+ try {
|
|
|
+ Log.d(TAG, "[DrawRecordTime] val [" + val + "]");
|
|
|
+ int idx = getViewIdx(TXT_RECORDING_CEHCK_COUNT);
|
|
|
+ //jglee - 사용자 편의를 위하여 횟수가 아닌 문자로 표시(1 -> 민감, 5 -> 보통, 10 -> 둔감)
|
|
|
+ String strTime = String.valueOf(val);
|
|
|
+ if(strTime.equals("3"))
|
|
|
+ {
|
|
|
+ strTime = "민감";
|
|
|
+ }
|
|
|
+ else if(strTime.equals("5"))
|
|
|
+ {
|
|
|
+ strTime = "보통";
|
|
|
+ }
|
|
|
+ else if(strTime.equals("7"))
|
|
|
+ {
|
|
|
+ strTime = "둔감";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (strTime != null) {
|
|
|
+ if(textValue[idx]!=null)
|
|
|
+ textValue[idx].setText(strTime);
|
|
|
+ if (val == MAX_RECORD_CHECK_COUNT) {
|
|
|
+ if(btnNext[idx]!=null)
|
|
|
+ btnNext[idx].setButtonRearImage();
|
|
|
+ } else if (val == MIN_RECORD_CHECK_COUNT) {
|
|
|
+ if(btnPrev[idx]!=null)
|
|
|
+ btnPrev[idx].setButtonRearImage();
|
|
|
+ } else {
|
|
|
+ if(btnNext[idx]!=null)
|
|
|
+ btnNext[idx].setButtonFrontImage();
|
|
|
+ if(btnPrev[idx]!=null)
|
|
|
+ btnPrev[idx].setButtonFrontImage();
|
|
|
+ }
|
|
|
+ } else Log.w(TAG, "[DrawRecordTime] strTime is NULL!!");
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] DrawRecordTime(int val)");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
@@ -622,10 +1032,10 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
Log.d(TAG, "[changeSecToMin] strTime [" + strTime + "]");
|
|
|
return strTime;
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- return null;
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] changeSecToMin(int val)");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
@@ -651,9 +1061,8 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
case HANDLERMSG.SAVE_SMARTIOT_CONFIG:
|
|
|
//거동 수상자 설정 적용
|
|
|
SetIOTCamConfig();
|
|
|
-
|
|
|
+
|
|
|
if (SaveDBConfigValue()) {
|
|
|
- //DB 설정 저장 후, 초기화 신호 던져야 함
|
|
|
if(bCurrentRecordingSet)
|
|
|
{
|
|
|
Intent Newintent = new Intent();
|
|
|
@@ -662,7 +1071,7 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
}
|
|
|
Sound().Play(WpadSound.SND.effect.TOUCH_LATCHED);
|
|
|
finish();
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
Sound().Play(WpadSound.SND.effect.TOUCH_UNLATCHED);
|
|
|
}
|
|
|
break;
|
|
|
@@ -678,9 +1087,9 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
HandleMsg.arg2 = arg2;
|
|
|
MainHandler.sendMessage(HandleMsg);
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] sendHandlerMsg(msg)");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
@@ -695,13 +1104,12 @@ public class PopupSmartIOTCam extends WpadScreen {
|
|
|
HandleMsg.arg2 = arg2;
|
|
|
MainHandler.sendMessageDelayed(HandleMsg, delay);
|
|
|
} catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] sendHandlerMsgDelayed(msg)");
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|