|
@@ -3,6 +3,7 @@ package kr.co.icontrols.wallpadhomectrl.screen.screen_doorlock;
|
|
|
|
|
|
import com.artncore.WallPadDataMgr.WallpadAccessData;
|
|
|
import com.artncore.WallPadDataMgr.WallpadDeviceSet;
|
|
|
+import com.artncore.WallPadDataMgr.WallpadStatusData;
|
|
|
import com.artncore.commons.API_Menu;
|
|
|
import com.artncore.wallpadapi.DLockAPI;
|
|
|
//import com.artncore.wallpadapi.UksAPI;
|
|
@@ -15,6 +16,9 @@ import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
import android.graphics.Color;
|
|
|
import android.os.CountDownTimer;
|
|
|
+import android.os.Handler;
|
|
|
+import android.os.Looper;
|
|
|
+import android.os.Message;
|
|
|
import android.util.Log;
|
|
|
import android.view.Gravity;
|
|
|
import android.view.MotionEvent;
|
|
@@ -278,6 +282,7 @@ public class DoorLockMainScreen extends WpadScreen
|
|
|
if (ret >= 0) {
|
|
|
Sound().PlayMent(SND.mode.OPENDOOR);
|
|
|
Sample_DoorLockOpen();
|
|
|
+ releaseOccupiedMode(Sound().getPlayMentRemainingTime());
|
|
|
|
|
|
if (Version.getGatewayUsage()) {
|
|
|
// 출입 데이터 기록 (우리집제어에서 문열림)
|
|
@@ -355,6 +360,45 @@ public class DoorLockMainScreen extends WpadScreen
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ String MAIN_SCREEN_NOW_UPDATE = "MAIN_SCREEN_NOW_UPDATE";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 현관과 동일하게 재택모드 일시, 재택모드 해제
|
|
|
+ * @param nDelayTime
|
|
|
+ */
|
|
|
+ private void releaseOccupiedMode(int nDelayTime) {
|
|
|
+ DebugLogOutput("[releaseOccupiedMode] nDelayTime [" + nDelayTime + "]");
|
|
|
+ WallpadStatusData DBMGR = new WallpadStatusData(getContext());
|
|
|
+ try {
|
|
|
+ // 재택방범중에 현관문을 열면 마그네틱 센서로 인해 비상이 울린다.
|
|
|
+ // 이때문에 현관문을 열면 재택방범을 자동으로 해제한다.
|
|
|
+ int nAlarmStatus = DBMGR.GetAlarmStatus();
|
|
|
+ if (nAlarmStatus == WallpadStatusData.GUARD_IN) {
|
|
|
+ try {
|
|
|
+ Thread.sleep(nDelayTime);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ DBMGR.SetAlarmStatus(WallpadStatusData.ALARM_NONE);
|
|
|
+ Message HandleMsg = TalkFrontHandler.obtainMessage();
|
|
|
+ TalkFrontHandler.sendMessageDelayed(HandleMsg, 100);
|
|
|
+ Intent intent = new Intent(MAIN_SCREEN_NOW_UPDATE, null);
|
|
|
+ getContext().sendBroadcast(intent);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] releaseOccupiedMode(int nDelayTime)");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ DBMGR.closeDB();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public Handler TalkFrontHandler = new Handler(Looper.getMainLooper()) {
|
|
|
+ public void handleMessage(Message msg) {
|
|
|
+ Sound().PlayMent(SND.mode.NORMALMODE_COMEBACK);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
// =================================================================================================
|
|
|
// [[ Draw ]] region
|
|
|
// =================================================================================================
|