|
@@ -1,1102 +1,1106 @@
|
|
-package kr.co.icontrols.wallpadsecurity.screen;
|
|
|
|
-
|
|
|
|
-import android.content.Context;
|
|
|
|
-import android.content.Intent;
|
|
|
|
-import android.graphics.Color;
|
|
|
|
-import android.util.Log;
|
|
|
|
-import android.view.Gravity;
|
|
|
|
-import android.view.MotionEvent;
|
|
|
|
-import android.view.View;
|
|
|
|
-import android.widget.RelativeLayout;
|
|
|
|
-
|
|
|
|
-import kr.co.icontrols.wallpadsecurity.MainActivity;
|
|
|
|
-import kr.co.icontrols.wallpadsecurity.R;
|
|
|
|
-import kr.co.icontrols.wallpadsecurity.declare.Common;
|
|
|
|
-import kr.co.icontrols.wallpadsecurity.declare.ID;
|
|
|
|
-import kr.co.icontrols.wallpadsupport.Version;
|
|
|
|
-import kr.co.icontrols.wallpadsupport.WpadImageView;
|
|
|
|
-import com.util.LogUtil;
|
|
|
|
-import kr.co.icontrols.wallpadsupport.WpadScreen;
|
|
|
|
-import kr.co.icontrols.wallpadsupport.WpadTextView;
|
|
|
|
-import kr.co.icontrols.wallpadsupport.WpadImageView.TOUCH_KIND;
|
|
|
|
-import kr.co.icontrols.wallpadsupport.WpadSound.SND;
|
|
|
|
-
|
|
|
|
-import com.artncore.WallPadDataMgr.*;
|
|
|
|
-import com.artncore.devicectr.WallPadInterface;
|
|
|
|
-import com.artncore.wallpadapi.DLockAPI;
|
|
|
|
-import com.artncore.wallpadapi.DLockAPI.DOORSTATUS;
|
|
|
|
-import com.artncore.wallpadapi.FP_DlockAPI;
|
|
|
|
-import com.artncore.wallpadapi.IGW200dAPI;
|
|
|
|
-import com.artncore.wallpadapi.WallPadAPI;
|
|
|
|
-import com.artncore.wallpadapi.IGW300API;
|
|
|
|
-
|
|
|
|
-public class SecurityMainScreen extends WpadScreen {
|
|
|
|
-
|
|
|
|
- // [Define]
|
|
|
|
- String TAG = this.getClass().getSimpleName();
|
|
|
|
-
|
|
|
|
- private void DebugLogOutput(String s) {
|
|
|
|
- if (Common.DEBUG_LOG_ON) Log.d(TAG, s);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // [View - ImageView(Background or Image - No touch)]
|
|
|
|
- WpadImageView Background;
|
|
|
|
- WpadImageView StatusWindow;
|
|
|
|
-
|
|
|
|
- // [View - ImageView(Button - touch)]
|
|
|
|
- WpadImageView StopBtn;
|
|
|
|
-
|
|
|
|
- WpadImageView OutSecurityModeBtn = null;
|
|
|
|
- WpadImageView InSecurityModeBtn = null;
|
|
|
|
- WpadImageView BedSecurityModeBtn = null;
|
|
|
|
-
|
|
|
|
- WpadImageView lineO1;
|
|
|
|
- WpadImageView line02;
|
|
|
|
- WpadImageView line03;
|
|
|
|
-
|
|
|
|
- WpadImageView Btn_Left01;
|
|
|
|
- WpadImageView Btn_Left02;
|
|
|
|
- WpadImageView Text_Box01;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- WpadImageView Btn_Right01;
|
|
|
|
- WpadImageView Btn_Right02;
|
|
|
|
- WpadImageView Text_Box02;
|
|
|
|
-
|
|
|
|
- // [View - TextView]
|
|
|
|
- private WpadTextView Title;
|
|
|
|
- WpadTextView LineText01;
|
|
|
|
- WpadTextView LineText02;
|
|
|
|
- WpadTextView LineText03;
|
|
|
|
-
|
|
|
|
- WpadTextView textValue01;
|
|
|
|
- WpadTextView textValue02;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- private int nOutWaitTime = 30;
|
|
|
|
- private int nInWaitTime = 30;
|
|
|
|
- private boolean bSmartSwitch485 = false;
|
|
|
|
- private boolean bUseGuardSensorCheck = true; // 그냥외출모드
|
|
|
|
- private boolean bReleasePwIntput = true;
|
|
|
|
- private WpadImageView UseSenser, NoSensor;
|
|
|
|
- private WpadTextView UseText, NoUseText;
|
|
|
|
-
|
|
|
|
- private WallPadAPI mWallPadAPI = null;
|
|
|
|
- DLockAPI doorLockAPI = null;
|
|
|
|
- FP_DlockAPI FPdoorLockAPI = null;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- private Context mContext;
|
|
|
|
-
|
|
|
|
- // [Value]
|
|
|
|
- private int OPERATION_MODE = Common.MODE;
|
|
|
|
-
|
|
|
|
- // [Class] 2017.09.07
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- public static class ImgPosion {
|
|
|
|
- int x = 0;
|
|
|
|
- int y = 0;
|
|
|
|
-
|
|
|
|
- public static int GetX(int OrgPos) {
|
|
|
|
- return OrgPos - 200;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static int GetY(int OrgPos) {
|
|
|
|
- return OrgPos - 61;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- private void initInfo() {
|
|
|
|
- // DB에 변경된 패스워드를 저장하도록 한다.
|
|
|
|
- try {
|
|
|
|
- // DB 에서 현재 설정된 패스워드를 얻어오도록 한다.
|
|
|
|
- WallpadStatusData wdb = new WallpadStatusData(this.getContext());
|
|
|
|
- if (wdb != null) {
|
|
|
|
- nOutWaitTime = wdb.GetOutModeWaitTime();
|
|
|
|
- nInWaitTime = wdb.GetComeBackWaitTime();
|
|
|
|
- bUseGuardSensorCheck = wdb.GetUseGuardSensorCheck();
|
|
|
|
- bReleasePwIntput = wdb.GetUseGuardReleasePW();
|
|
|
|
- wdb.closeDB();
|
|
|
|
-
|
|
|
|
- // 485 스마트 스위치 연동 모델인지 체크
|
|
|
|
- if (Version.getModelType() != Version.MODEL_TYPE.IHN_1020GL) {
|
|
|
|
- WallpadDeviceSet devSet = new WallpadDeviceSet(this.getContext());
|
|
|
|
- int[] BatchInfo = devSet.Get_BatchSW_Info();
|
|
|
|
- devSet.closeDB();
|
|
|
|
-
|
|
|
|
- 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_1010GL || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I
|
|
|
|
- || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_2443ALT || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_6410ALT)
|
|
|
|
- {
|
|
|
|
- if (BatchInfo[0] == 1 && BatchInfo[1] == WallpadDeviceSet.BATCH_TYPE_HDC_LCD_SMART) {
|
|
|
|
- bSmartSwitch485 = true;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- if (BatchInfo[0] == 1 && BatchInfo[1] == WallpadDeviceSet.BATCH_TYPE_SMART) {
|
|
|
|
- bSmartSwitch485 = true;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- Log.d(TAG, "[initInfo] mOutWaitTime [" + nOutWaitTime + "], mInWaitTime [" + nInWaitTime + "], m_UseGuardSensorCheck [" + bUseGuardSensorCheck + "], m_ReleasePwIntput [" + bReleasePwIntput + "]");
|
|
|
|
- }
|
|
|
|
- } catch (RuntimeException re) {
|
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
- }
|
|
|
|
- catch (Exception e) {
|
|
|
|
- Log.e(TAG, "[Exception] initInfo()");
|
|
|
|
- //e.printStackTrace();
|
|
|
|
- LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private boolean OutModeCheckSensor(boolean bUseOutModeWaiting) {
|
|
|
|
- try {
|
|
|
|
- if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL) {
|
|
|
|
- IGW200dAPI.Data mData = Common.getIGW200UpdateData();
|
|
|
|
-
|
|
|
|
- if(mData!=null)
|
|
|
|
- {
|
|
|
|
- boolean bMotionSensor = mData.senIn.Motion;
|
|
|
|
- boolean bMagneticSensor = mData.senIn.Magnetic;
|
|
|
|
- Log.d(TAG, "[OutModeCheckSensor] bMotionSensor [" + bMotionSensor + "], bMagneticSensor [" + bMagneticSensor + "]");
|
|
|
|
- byte hDoorLockState = DOORSTATUS.Close;
|
|
|
|
-
|
|
|
|
- if (mWallPadAPI != null) {
|
|
|
|
- if (mWallPadAPI.Check_Connect()) {
|
|
|
|
- DLockAPI doorLockAPI = mWallPadAPI.Get_DLockController();
|
|
|
|
- doorLockAPI.Refresh(true);
|
|
|
|
- hDoorLockState = doorLockAPI.data.DoorStatus;
|
|
|
|
- Log.d(TAG, "[OutModeCheckSensor] hDoorLockState: " + hDoorLockState);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Log.w(TAG, "[OutModeCheckSensor] mWallPadAPI.Check_Connect() is false!!!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Log.w(TAG, "[OutModeCheckSensor] mWallPadAPI is null!!");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 현산향이 무선 도어락이 들어가면서 추가되어야 함
|
|
|
|
- if (Common.isWirelessDoorlock(getContext())) hDoorLockState = DOORSTATUS.Close;
|
|
|
|
-
|
|
|
|
- if (bMotionSensor == false && bMagneticSensor == false && hDoorLockState == DOORSTATUS.Close) return true;
|
|
|
|
- else return false;
|
|
|
|
- }
|
|
|
|
- else return false;
|
|
|
|
- }
|
|
|
|
- else 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_1010GL || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I
|
|
|
|
- || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_2443ALT || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_6410ALT)
|
|
|
|
- {
|
|
|
|
- // IGW300(G/W)를 사용하는 경우
|
|
|
|
- IGW300API.Data mData = Common.getIGW300UpdateData();
|
|
|
|
-
|
|
|
|
- boolean bMotionSensor_In = false;
|
|
|
|
- boolean bMotionSensor_Out = false;
|
|
|
|
- if(mData!=null) {
|
|
|
|
- boolean bMagneticSensor = mData.senIn.Magnetic;
|
|
|
|
- byte hDoorLockState = DOORSTATUS.Close;
|
|
|
|
-
|
|
|
|
- WallpadDeviceSet devSet = new WallpadDeviceSet(getContext());
|
|
|
|
- String[] GetValue = devSet.GetSettingData("디지털도어락");
|
|
|
|
- devSet.closeDB();
|
|
|
|
- if (GetValue == null) {
|
|
|
|
- Log.w(TAG, "[OutModeCheckSensor] GetSettingData(디지털도어락) is null");
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Log.d(TAG, "[OutModeCheckSensor] GetSettingData(디지털도어락) is value: " + GetValue[1]);
|
|
|
|
-
|
|
|
|
- if (GetValue[1].indexOf("유선") > 0) {
|
|
|
|
- Log.d(TAG, "[OutModeCheckSensor] WiredDoorlock");
|
|
|
|
- if (mWallPadAPI != null) {
|
|
|
|
- if (mWallPadAPI.Check_Connect()) {
|
|
|
|
- doorLockAPI = mWallPadAPI.Get_DLockController();
|
|
|
|
- doorLockAPI.Refresh(true);
|
|
|
|
- hDoorLockState = doorLockAPI.data.DoorStatus;
|
|
|
|
- Log.d(TAG, "[OutModeCheckSensor] hDoorLockState: " + hDoorLockState);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Log.w(TAG, "[OutModeCheckSensor] mWallPadAPI.Check_Connect() is false!!!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Log.w(TAG, "[OutModeCheckSensor] mWallPadAPI is null!!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if (GetValue[1].indexOf("지문인식") > 0) {
|
|
|
|
- Log.d(TAG, "[OutModeCheckSensor] WiredDoorlock (FingerPrint)");
|
|
|
|
- if (mWallPadAPI != null) {
|
|
|
|
- if (mWallPadAPI.Check_Connect()) {
|
|
|
|
- FPdoorLockAPI = mWallPadAPI.Get_FP_DLockController();
|
|
|
|
- FPdoorLockAPI.Refresh(true);
|
|
|
|
- hDoorLockState = FPdoorLockAPI.data.DoorStatus;
|
|
|
|
- Log.d(TAG, "[OutModeCheckSensor] hDoorLockState: " + hDoorLockState);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Log.w(TAG, "[OutModeCheckSensor] mWallPadAPI.Check_Connect() is false!!!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Log.w(TAG, "[OutModeCheckSensor] mWallPadAPI is null!!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 현산향이 무선 도어락이 들어가면서 추가되어야 함
|
|
|
|
- if (Common.isWirelessDoorlock(getContext()) == true) {
|
|
|
|
- hDoorLockState = DOORSTATUS.Close;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- int[] SensorInfoDB;
|
|
|
|
- SensorInfoDB = Common.GetInSensorUseOfNotFromDB(getContext());
|
|
|
|
-
|
|
|
|
- if (SensorInfoDB[0] == 1) {
|
|
|
|
- // 내부동체가 사용함이면 상태 검사
|
|
|
|
- bMotionSensor_In = mData.senIn.In_Motion;
|
|
|
|
- Log.d(TAG, "[OutModeCheckSensor] In Motion USE !!! : " + bMotionSensor_In);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (SensorInfoDB[1] == 1) {
|
|
|
|
- // 외부동체가 사용함이면 상태 검사
|
|
|
|
- bMotionSensor_Out = mData.senIn.Out_Motion;
|
|
|
|
- Log.d(TAG, "[OutModeCheckSensor] Out Motion USE !!! : " + bMotionSensor_Out );
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (bUseOutModeWaiting) {
|
|
|
|
- // 외출모드 대기화면을 사용하는 경우에는 댁내에 사람이 있는 경우이므로, 내부동체를 무시한다.
|
|
|
|
- bMotionSensor_In = false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Log.d(TAG, "[OutModeCheckSensor] bMotionSensor_In [" + bMotionSensor_In + "], bMotionSensor_Out [" + bMotionSensor_Out + "], bMagneticSensor [" + bMagneticSensor + "]");
|
|
|
|
-
|
|
|
|
- if (bMotionSensor_In == false && bMotionSensor_Out == false && bMagneticSensor == false && hDoorLockState == DOORSTATUS.Close) return true;
|
|
|
|
- else return false;
|
|
|
|
- }
|
|
|
|
- else return false;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- // G/W 사용을 하지 않는 경우
|
|
|
|
- WallPadInterface mWallPadInterface = ((MainActivity) (super.getContext())).getWallPadInterface();
|
|
|
|
- if (mWallPadInterface == null) {
|
|
|
|
- Log.e(TAG, "[OutModeCheckSensor] Wallpadinterface is null!!");
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- int nSensorIn = 0, nSensorOut = 0, nSensorMagnetic = 0;
|
|
|
|
-
|
|
|
|
- nSensorMagnetic = mWallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MAG0_STATE, 0);
|
|
|
|
-
|
|
|
|
- int[] SensorInfoDB;
|
|
|
|
- SensorInfoDB = Common.GetInSensorUseOfNotFromDB(getContext());
|
|
|
|
-
|
|
|
|
- if (SensorInfoDB[0] == 1) {
|
|
|
|
- // 내부동체가 사용함이면 상태 검사
|
|
|
|
- nSensorIn = mWallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MOTIN_STATE, 0);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (SensorInfoDB[1] == 1) {
|
|
|
|
- // 외부동체가 사용함이면 상태 검사
|
|
|
|
- nSensorOut = mWallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MOTOUT_STATE, 0);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (Common.GetUseOutMotionConvertInMotionSetting() == true) {
|
|
|
|
- nSensorOut = 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (bUseOutModeWaiting) {
|
|
|
|
- // 외출모드 대기화면을 사용하는 경우에는 댁내에 사람이 있는 경우이므로, 내부동체를 무시한다.
|
|
|
|
- nSensorIn = 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Log.d(TAG, "[OutModeCheckSensor] nSensorIn [" + nSensorIn + "], nSensorOut [" + nSensorOut + "], nSensorMagnetic [" + nSensorMagnetic + "]");
|
|
|
|
- if ((nSensorMagnetic == 0) && (nSensorIn == 0) && (nSensorOut == 0)) return true;
|
|
|
|
- else return false;
|
|
|
|
- }
|
|
|
|
- } catch (RuntimeException re) {
|
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- catch (Exception e) {
|
|
|
|
- Log.e(TAG, "[Exception] OutModeCheckSensor(boolean bUseOutModeWaiting)");
|
|
|
|
- //e.printStackTrace();
|
|
|
|
- LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private boolean InModeCheckSensor() {
|
|
|
|
- try {
|
|
|
|
- if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL) {
|
|
|
|
- IGW200dAPI.Data mData = Common.getIGW200UpdateData();
|
|
|
|
-
|
|
|
|
- if(mData!=null)
|
|
|
|
- {
|
|
|
|
- boolean bMotionSensor = mData.senIn.Motion;
|
|
|
|
- boolean bMagneticSensor = mData.senIn.Magnetic;
|
|
|
|
- Log.d(TAG, "[InModeCheckSensor] bMotionSensor [" + bMotionSensor + "], bMagneticSensor [" + bMagneticSensor + "]");
|
|
|
|
-
|
|
|
|
- byte hDoorLockState = DOORSTATUS.Close;
|
|
|
|
-
|
|
|
|
- WallpadDeviceSet devSet = new WallpadDeviceSet(getContext());
|
|
|
|
- String[] GetValue = devSet.GetSettingData("디지털도어락");
|
|
|
|
- devSet.closeDB();
|
|
|
|
- if (GetValue == null) {
|
|
|
|
- Log.w(TAG, "[InModeCheckSensor] GetSettingData(디지털도어락) is null");
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Log.d(TAG, "[InModeCheckSensor] GetSettingData(디지털도어락) is value: " + GetValue[1]);
|
|
|
|
-
|
|
|
|
- if (GetValue[1].indexOf("유선") > 0) {
|
|
|
|
- Log.d(TAG, "[InModeCheckSensor] WiredDoorlock");
|
|
|
|
-
|
|
|
|
- if (mWallPadAPI != null) {
|
|
|
|
- if (mWallPadAPI.Check_Connect()) {
|
|
|
|
- doorLockAPI = mWallPadAPI.Get_DLockController();
|
|
|
|
- doorLockAPI.Refresh(true);
|
|
|
|
- hDoorLockState = doorLockAPI.data.DoorStatus;
|
|
|
|
- Log.d(TAG, "[InModeCheckSensor] hDoorLockState: " + hDoorLockState);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Log.w(TAG, "[InModeCheckSensor] mWallPadAPI.Check_Connect() is false!!!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Log.w(TAG, "[InModeCheckSensor] mWallPadAPI is null!!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if (GetValue[1].indexOf("지문인식") > 0) {
|
|
|
|
- Log.d(TAG, "[InModeCheckSensor] WiredDoorlock (FingerPrint)");
|
|
|
|
- if (mWallPadAPI != null) {
|
|
|
|
- if (mWallPadAPI.Check_Connect()) {
|
|
|
|
- FPdoorLockAPI = mWallPadAPI.Get_FP_DLockController();
|
|
|
|
- FPdoorLockAPI.Refresh(true);
|
|
|
|
- hDoorLockState = FPdoorLockAPI.data.DoorStatus;
|
|
|
|
- Log.d(TAG, "[InModeCheckSensor] hDoorLockState: " + hDoorLockState);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Log.w(TAG, "[InModeCheckSensor] mWallPadAPI.Check_Connect() is false!!!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Log.w(TAG, "[InModeCheckSensor] mWallPadAPI is null!!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 인왕산 아이파크 특별 적용
|
|
|
|
- WallpadDeviceSet devset = new WallpadDeviceSet(this.getContext());
|
|
|
|
- if (devset != null) {
|
|
|
|
- int GetDataInt = devset.Get_Security_IndoorMode_Sensor_Use();
|
|
|
|
- if (GetDataInt == 0)
|
|
|
|
- bMotionSensor = false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 현산향이 무선 도어락이 들어가면서 추가되어야 함
|
|
|
|
- if (Common.isWirelessDoorlock(getContext()) == true) {
|
|
|
|
- hDoorLockState = DOORSTATUS.Close;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Log.d(TAG, "[InModeCheckSensor] bMotionSensor [" + bMotionSensor + "], bMagneticSensor [" + bMagneticSensor + "], hDoorLockState [" + hDoorLockState + "]");
|
|
|
|
- if (bMotionSensor == false && bMagneticSensor == false && (hDoorLockState == DOORSTATUS.Close || hDoorLockState == DOORSTATUS.Close_LockingForce)) return true;
|
|
|
|
- else return false;
|
|
|
|
- }
|
|
|
|
- else return false;
|
|
|
|
- }
|
|
|
|
- else 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_1010GL || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I
|
|
|
|
- || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_2443ALT || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_6410ALT)
|
|
|
|
- {
|
|
|
|
- IGW300API.Data mData = Common.getIGW300UpdateData();
|
|
|
|
-
|
|
|
|
- boolean bMotionSensor_Out = false;
|
|
|
|
- int[] SensorInfoDB = Common.GetInSensorUseOfNotFromDB(getContext());
|
|
|
|
- if (SensorInfoDB[1] == 1 && mData!=null) {
|
|
|
|
- // 외부동체가 사용함이면 상태 검사
|
|
|
|
- bMotionSensor_Out = mData.senIn.Out_Motion;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- bMotionSensor_Out = false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(mData!=null)
|
|
|
|
- {
|
|
|
|
- boolean bMagneticSensor = mData.senIn.Magnetic;
|
|
|
|
- Log.d(TAG, "[InModeCheckSensor] bMotionSensor_Out [" + bMotionSensor_Out + "], bMagneticSensor [" + bMagneticSensor + "]");
|
|
|
|
-
|
|
|
|
- byte hDoorLockState = DOORSTATUS.Close;
|
|
|
|
-
|
|
|
|
- WallpadDeviceSet devSet = new WallpadDeviceSet(getContext());
|
|
|
|
- String[] GetValue = devSet.GetSettingData("디지털도어락");
|
|
|
|
- devSet.closeDB();
|
|
|
|
- if (GetValue == null) {
|
|
|
|
- Log.w(TAG, "[InModeCheckSensor] GetSettingData(디지털도어락) is null");
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Log.d(TAG, "[InModeCheckSensor] GetSettingData(디지털도어락) is value: " + GetValue[1]);
|
|
|
|
-
|
|
|
|
- if (GetValue[1].indexOf("유선") > 0) {
|
|
|
|
- Log.d(TAG, "[InModeCheckSensor] WiredDoorlock");
|
|
|
|
-
|
|
|
|
- if (mWallPadAPI != null) {
|
|
|
|
- if (mWallPadAPI.Check_Connect()) {
|
|
|
|
- doorLockAPI = mWallPadAPI.Get_DLockController();
|
|
|
|
- doorLockAPI.Refresh(true);
|
|
|
|
- hDoorLockState = doorLockAPI.data.DoorStatus;
|
|
|
|
- Log.d(TAG, "[InModeCheckSensor] hDoorLockState: " + hDoorLockState);
|
|
|
|
- } else {
|
|
|
|
- Log.w(TAG, "[InModeCheckSensor] mWallPadAPI.Check_Connect() is false!!!");
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- Log.w(TAG, "[InModeCheckSensor] mWallPadAPI is null!!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if (GetValue[1].indexOf("지문인식") > 0) {
|
|
|
|
- Log.d(TAG, "[InModeCheckSensor] WiredDoorlock (FingerPrint)");
|
|
|
|
- if (mWallPadAPI != null) {
|
|
|
|
- if (mWallPadAPI.Check_Connect()) {
|
|
|
|
- FPdoorLockAPI = mWallPadAPI.Get_FP_DLockController();
|
|
|
|
- FPdoorLockAPI.Refresh(true);
|
|
|
|
- hDoorLockState = FPdoorLockAPI.data.DoorStatus;
|
|
|
|
- Log.d(TAG, "[InModeCheckSensor] hDoorLockState: " + hDoorLockState);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Log.w(TAG, "[InModeCheckSensor] mWallPadAPI.Check_Connect() is false!!!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Log.w(TAG, "[InModeCheckSensor] mWallPadAPI is null!!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 현산향이 무선 도어락이 들어가면서 추가되어야 함
|
|
|
|
- if (Common.isWirelessDoorlock(getContext()) == true) {
|
|
|
|
- hDoorLockState = DOORSTATUS.Close;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Log.d(TAG, "[InModeCheckSensor] bMotionSensor_Out [" + bMotionSensor_Out + "], bMagneticSensor [" + bMagneticSensor + "], hDoorLockState [" + hDoorLockState + "]");
|
|
|
|
-
|
|
|
|
- if (bMotionSensor_Out == false && bMagneticSensor == false && (hDoorLockState == DOORSTATUS.Close || hDoorLockState == DOORSTATUS.Close_LockingForce)) return true;
|
|
|
|
- else return false;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- return false;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- WallPadInterface mWallPadInterface = ((MainActivity) (super.getContext())).getWallPadInterface();
|
|
|
|
- int sensorMag = mWallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MAG0_STATE, 0);
|
|
|
|
- int[] SensorInfoDB;
|
|
|
|
- SensorInfoDB = Common.GetInSensorUseOfNotFromDB(getContext());
|
|
|
|
-
|
|
|
|
- int sensorOut = 0;
|
|
|
|
-
|
|
|
|
- if (SensorInfoDB[1] == 1) {
|
|
|
|
- // 외부동체가 사용함이면 상태 검사
|
|
|
|
- sensorOut = mWallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MOTOUT_STATE, 0);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //int sensorOut = wallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MOTOUT_STATE, 0);
|
|
|
|
-
|
|
|
|
- if (Common.GetUseOutMotionConvertInMotionSetting() == true) {
|
|
|
|
- sensorOut = 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (Version.getGatewayUsage()) {
|
|
|
|
- // 현산향인 경우
|
|
|
|
- if (sensorMag == 0) return true;
|
|
|
|
- else return false;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- if (sensorMag == 0 && sensorOut == 0) return true;
|
|
|
|
- else return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } catch (RuntimeException re) {
|
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- catch (Exception e) {
|
|
|
|
- Log.e(TAG, "[Exception] InModeCheckSensor()");
|
|
|
|
- //e.printStackTrace();
|
|
|
|
- LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public SecurityMainScreen(Context context, RelativeLayout layout, WallPadAPI wpapi, int operationMode) {
|
|
|
|
- super(context, layout);
|
|
|
|
- try {
|
|
|
|
- Log.d(TAG, "[START - Screen] --------------------------------------------");
|
|
|
|
- mWallPadAPI = wpapi;
|
|
|
|
- mContext = context;
|
|
|
|
- initInfo();
|
|
|
|
- OPERATION_MODE = operationMode;
|
|
|
|
-
|
|
|
|
- ((MainActivity) mContext).setManualBtnVisible(((MainActivity) mContext).getManualUse(), 1019);
|
|
|
|
-
|
|
|
|
- Background = new WpadImageView(context, TOUCH_KIND.NONE, 1280, 690, R.drawable.bg_body, 0, ID.SecurityMainScreen.image.BACKGROUND);
|
|
|
|
- ViewRegistration(layout, Background, Common.ImgPosion.GetX(0), Common.ImgPosion.GetY(110));
|
|
|
|
-
|
|
|
|
- if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020SA_A) {
|
|
|
|
- // LH 향 방범 화면
|
|
|
|
- int[] GuardImg = {R.drawable.guard_mode_btn_goout_security_normal, R.drawable.guard_mode_btn_goout_security_pressed};
|
|
|
|
- int[] OutImg = {R.drawable.guard_mode_btn_goout_mode_normal, R.drawable.guard_mode_btn_goout_mode_pressed};
|
|
|
|
-
|
|
|
|
- OutSecurityModeBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 245, 292, GuardImg, OutImg, ID.SecurityMainScreen.button.OUT_SECURITY);
|
|
|
|
- ViewRegistration(layout, OutSecurityModeBtn, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(110));
|
|
|
|
-
|
|
|
|
- int[] BedGuardImg = {R.drawable.guard_mode_btn_sleep_security_normal, R.drawable.guard_mode_btn_sleep_security_pressed};
|
|
|
|
- int[] BedImg = {R.drawable.guard_mode_btn_sleep_mode_normal, R.drawable.guard_mode_btn_sleep_mode_pressed};
|
|
|
|
-
|
|
|
|
- BedSecurityModeBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 243, 292, BedGuardImg, BedImg, ID.SecurityMainScreen.button.BED_SECURITY);
|
|
|
|
- ViewRegistration(layout, BedSecurityModeBtn, Common.ImgPosion.GetX(458), Common.ImgPosion.GetY(110));
|
|
|
|
-
|
|
|
|
- InSecurityModeBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 244, 292, R.drawable.guard_mode_btn_home_security_normal, R.drawable.guard_mode_btn_home_security_pressed, ID.SecurityMainScreen.button.IN_SECURITY);
|
|
|
|
- ViewRegistration(layout, InSecurityModeBtn, ImgPosion.GetX(821), ImgPosion.GetY(110));
|
|
|
|
-
|
|
|
|
- lineO1 = new WpadImageView(context, TOUCH_KIND.NONE, 1094, 2, R.drawable.control_venti_line, 0, ID.SecurityMainScreen.image.LINE01);
|
|
|
|
- ViewRegistration(layout, lineO1, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(645));
|
|
|
|
-
|
|
|
|
- // 방범센서 사용안하는 그냥 외출모드 사용시
|
|
|
|
- if (bUseGuardSensorCheck == false) {
|
|
|
|
- OutSecurityModeBtn.setButtonRearImage();
|
|
|
|
- }
|
|
|
|
- if (Common.GetInBedCheckSensor(this.getContext()) == false) {
|
|
|
|
- BedSecurityModeBtn.setButtonRearImage();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- if (bSmartSwitch485) {
|
|
|
|
- // 485 스마트 스위치 연동 현장
|
|
|
|
- int[] GuardImg = {R.drawable.guard_s_btn_goout_normal, R.drawable.guard_s_btn_goout_pressed};
|
|
|
|
- int[] OutImg = {R.drawable.guard_btn_goout_normal, R.drawable.guard_btn_goout_pressed};
|
|
|
|
-
|
|
|
|
- OutSecurityModeBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 547, 381, GuardImg, OutImg, ID.SecurityMainScreen.button.OUT_SECURITY);
|
|
|
|
- ViewRegistration(layout, OutSecurityModeBtn, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(110));
|
|
|
|
- OutSecurityModeBtn.setTouchDelayMs(500);
|
|
|
|
-
|
|
|
|
- InSecurityModeBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 547, 381, R.drawable.guard_s_btn_home_normal, R.drawable.guard_s_btn_home_pressed, ID.SecurityMainScreen.button.IN_SECURITY);
|
|
|
|
- ViewRegistration(layout, InSecurityModeBtn, Common.ImgPosion.GetX(640), Common.ImgPosion.GetY(110));
|
|
|
|
- InSecurityModeBtn.setTouchDelayMs(500);
|
|
|
|
-
|
|
|
|
- lineO1 = new WpadImageView(context, TOUCH_KIND.NONE, 1094, 2, R.drawable.control_venti_line, 0, ID.SecurityMainScreen.image.LINE01);
|
|
|
|
- ViewRegistration(layout, lineO1, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(592));
|
|
|
|
-
|
|
|
|
- line02 = new WpadImageView(context, TOUCH_KIND.NONE, 1094, 2, R.drawable.control_venti_line, 0, ID.SecurityMainScreen.image.LINE02);
|
|
|
|
- ViewRegistration(layout, line02, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(696));
|
|
|
|
-
|
|
|
|
- LineText03 = new WpadTextView(context, false, 525, 101, Gravity.CENTER, Color.parseColor("#966432"), Common.fontsize._36, true, ID.SecurityMainScreen.text.LINE_TEXT_01);
|
|
|
|
- ViewRegistration(layout, LineText03, Common.ImgPosion.GetX(116), Common.ImgPosion.GetY(491));
|
|
|
|
- LineText03.setText("취소시 비밀번호 입력");
|
|
|
|
-
|
|
|
|
- // 체크박스 시작
|
|
|
|
- UseSenser = new WpadImageView(context, TOUCH_KIND.BUTTON_M, 88, 88, R.drawable.but_check_default, R.drawable.but_check_checked, ID.SecurityMainScreen.button.CHECKBOX_USE);
|
|
|
|
- ViewRegistration(layout, UseSenser, Common.ImgPosion.GetX(641), Common.ImgPosion.GetY(495));
|
|
|
|
- UseText = new WpadTextView(context, true, 148, 101, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, ID.SecurityMainScreen.text.CHECKBOX_USE);
|
|
|
|
- ViewRegistration(layout, UseText, Common.ImgPosion.GetX(731), Common.ImgPosion.GetY(491));
|
|
|
|
- UseText.setText("사용");
|
|
|
|
- NoSensor = new WpadImageView(context, TOUCH_KIND.BUTTON_M, 88, 88, R.drawable.but_check_default, R.drawable.but_check_checked, ID.SecurityMainScreen.button.CHECKBOX_NO_USE);
|
|
|
|
- ViewRegistration(layout, NoSensor, Common.ImgPosion.GetX(881), Common.ImgPosion.GetY(495));
|
|
|
|
- NoUseText = new WpadTextView(context, true, 148, 101, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, ID.SecurityMainScreen.text.CHECKBOX_NO_USE);
|
|
|
|
- ViewRegistration(layout, NoUseText, Common.ImgPosion.GetX(972), Common.ImgPosion.GetY(491));
|
|
|
|
- NoUseText.setText("사용안함");
|
|
|
|
- DrawCheckBoxPwRelease(bReleasePwIntput);
|
|
|
|
- // 체크박스 끝
|
|
|
|
-
|
|
|
|
- Btn_Left01 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_left, R.drawable.but_arrow_left_p, ID.SecurityMainScreen.button.LEFT_01);
|
|
|
|
- ViewRegistration(layout, Btn_Left01, Common.ImgPosion.GetX(641), Common.ImgPosion.GetY(618));
|
|
|
|
- Btn_Right01 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_right, R.drawable.but_arrow_right_p, ID.SecurityMainScreen.button.RIGHT_01);
|
|
|
|
- ViewRegistration(layout, Btn_Right01, Common.ImgPosion.GetX(968), Common.ImgPosion.GetY(618));
|
|
|
|
- //Text_Box01 = new WpadImageView(context, TOUCH_KIND.NONE, 146, 44, R.drawable.blank_m,0, ID.SecurityMainScreen.image.TEXT_BG01);
|
|
|
|
- //ViewRegistration(layout, Text_Box01, Common.ImgPosion.GetX(641), Common.ImgPosion.GetY(541));
|
|
|
|
-
|
|
|
|
- Btn_Left02 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_left, R.drawable.but_arrow_left_p, ID.SecurityMainScreen.button.LEFT_02);
|
|
|
|
- ViewRegistration(layout, Btn_Left02, Common.ImgPosion.GetX(641), Common.ImgPosion.GetY(722));
|
|
|
|
- Btn_Right02 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_right, R.drawable.but_arrow_right_p, ID.SecurityMainScreen.button.RIGHT_02);
|
|
|
|
- ViewRegistration(layout, Btn_Right02, Common.ImgPosion.GetX(968), Common.ImgPosion.GetY(722));
|
|
|
|
- //Text_Box02 = new WpadImageView(context, TOUCH_KIND.NONE, 146, 44, R.drawable.blank_m,0,ID.SecurityMainScreen.image.TEXT_BG02);
|
|
|
|
- //ViewRegistration(layout, Text_Box02, ImgPosion.GetX(708), ImgPosion.GetY(540));
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- LineText01 = new WpadTextView(context, false, 525, 102, Gravity.CENTER, Color.parseColor("#966432"), Common.fontsize._36, true, ID.SecurityMainScreen.text.LINE_TEXT_01);
|
|
|
|
- ViewRegistration(layout, LineText01, Common.ImgPosion.GetX(116), Common.ImgPosion.GetY(594));
|
|
|
|
- LineText01.setText("외출설정 대기시간");
|
|
|
|
-
|
|
|
|
- LineText02 = new WpadTextView(context, false, 525, 102, Gravity.CENTER, Color.parseColor("#966432"), Common.fontsize._36, true, ID.SecurityMainScreen.text.LINE_TEXT_02);
|
|
|
|
- ViewRegistration(layout, LineText02, Common.ImgPosion.GetX(116), Common.ImgPosion.GetY(698));
|
|
|
|
- LineText02.setText("외출복귀 대기시간");
|
|
|
|
-
|
|
|
|
- textValue01 = new WpadTextView(context, false, 247, 102, Gravity.CENTER, Color.WHITE, Common.fontsize._36, true, ID.SecurityMainScreen.text.VALUE_TEXT_01);
|
|
|
|
- ViewRegistration(layout, textValue01, Common.ImgPosion.GetX(721), Common.ImgPosion.GetY(594));
|
|
|
|
- OutPrintText(textValue01, nOutWaitTime);
|
|
|
|
-
|
|
|
|
- textValue02 = new WpadTextView(context, false, 247, 102, Gravity.CENTER, Color.WHITE, Common.fontsize._36, true, ID.SecurityMainScreen.text.VALUE_TEXT_02);
|
|
|
|
- ViewRegistration(layout, textValue02, Common.ImgPosion.GetX(721), Common.ImgPosion.GetY(698));
|
|
|
|
- OutPrintText(textValue02, nInWaitTime);
|
|
|
|
-
|
|
|
|
- // 바범센서 사용안하는 그냥 외출모드 사용시
|
|
|
|
- if (!bUseGuardSensorCheck) {
|
|
|
|
- OutSecurityModeBtn.setButtonRearImage();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- // 현산향, 대외향
|
|
|
|
- OutSecurityModeBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 547, 381, R.drawable.guard_btn_goout_normal, R.drawable.guard_btn_goout_pressed, ID.SecurityMainScreen.button.OUT_SECURITY);
|
|
|
|
- ViewRegistration(layout, OutSecurityModeBtn, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(110));
|
|
|
|
- OutSecurityModeBtn.setTouchDelayMs(500);
|
|
|
|
-
|
|
|
|
- InSecurityModeBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 547, 381, R.drawable.guard_btn_home_normal, R.drawable.guard_btn_home_pressed, ID.SecurityMainScreen.button.IN_SECURITY);
|
|
|
|
- ViewRegistration(layout, InSecurityModeBtn, Common.ImgPosion.GetX(640), Common.ImgPosion.GetY(110));
|
|
|
|
- InSecurityModeBtn.setTouchDelayMs(500);
|
|
|
|
-
|
|
|
|
- lineO1 = new WpadImageView(context, TOUCH_KIND.NONE, 1094, 2, R.drawable.control_venti_line, 0, ID.SecurityMainScreen.image.LINE01);
|
|
|
|
- ViewRegistration(layout, lineO1, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(645));
|
|
|
|
-
|
|
|
|
- Btn_Left01 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_left, R.drawable.but_arrow_left_p, ID.SecurityMainScreen.button.LEFT_01);
|
|
|
|
- ViewRegistration(layout, Btn_Left01, Common.ImgPosion.GetX(641), Common.ImgPosion.GetY(541));
|
|
|
|
- Btn_Right01 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_right, R.drawable.but_arrow_right_p, ID.SecurityMainScreen.button.RIGHT_01);
|
|
|
|
- ViewRegistration(layout, Btn_Right01, Common.ImgPosion.GetX(968), Common.ImgPosion.GetY(541));
|
|
|
|
- //Text_Box01 = new WpadImageView(context, TOUCH_KIND.NONE, 146, 44, R.drawable.blank_m,0, ID.SecurityMainScreen.image.TEXT_BG01);
|
|
|
|
- //ViewRegistration(layout, Text_Box01, Common.ImgPosion.GetX(641), Common.ImgPosion.GetY(541));
|
|
|
|
-
|
|
|
|
- Btn_Left02 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_left, R.drawable.but_arrow_left_p, ID.SecurityMainScreen.button.LEFT_02);
|
|
|
|
- ViewRegistration(layout, Btn_Left02, Common.ImgPosion.GetX(641), Common.ImgPosion.GetY(697));
|
|
|
|
- Btn_Right02 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_right, R.drawable.but_arrow_right_p, ID.SecurityMainScreen.button.RIGHT_02);
|
|
|
|
- ViewRegistration(layout, Btn_Right02, Common.ImgPosion.GetX(968), Common.ImgPosion.GetY(697));
|
|
|
|
- //Text_Box02 = new WpadImageView(context, TOUCH_KIND.NONE, 146, 44, R.drawable.blank_m,0,ID.SecurityMainScreen.image.TEXT_BG02);
|
|
|
|
- //ViewRegistration(layout, Text_Box02, ImgPosion.GetX(708), ImgPosion.GetY(540));
|
|
|
|
-
|
|
|
|
- LineText01 = new WpadTextView(context, false, 525, 154, Gravity.CENTER, 0xFF966432, Common.fontsize._36, true, ID.SecurityMainScreen.text.LINE_TEXT_01);
|
|
|
|
- ViewRegistration(layout, LineText01, Common.ImgPosion.GetX(116), Common.ImgPosion.GetY(491));
|
|
|
|
- LineText01.setText("외출설정 대기시간");
|
|
|
|
-
|
|
|
|
- LineText02 = new WpadTextView(context, false, 525, 153, Gravity.CENTER, 0xFF966432, Common.fontsize._36, true, ID.SecurityMainScreen.text.LINE_TEXT_02);
|
|
|
|
- ViewRegistration(layout, LineText02, Common.ImgPosion.GetX(116), Common.ImgPosion.GetY(647));
|
|
|
|
- LineText02.setText("외출복귀 대기시간");
|
|
|
|
-
|
|
|
|
- textValue01 = new WpadTextView(context, false, 247, 154, Gravity.CENTER, Color.WHITE, Common.fontsize._36, true, ID.SecurityMainScreen.text.VALUE_TEXT_01);
|
|
|
|
- ViewRegistration(layout, textValue01, Common.ImgPosion.GetX(721), Common.ImgPosion.GetY(491));
|
|
|
|
- OutPrintText(textValue01, nOutWaitTime);
|
|
|
|
-
|
|
|
|
- textValue02 = new WpadTextView(context, false, 247, 153, Gravity.CENTER, Color.WHITE, Common.fontsize._36, true, ID.SecurityMainScreen.text.VALUE_TEXT_02);
|
|
|
|
- ViewRegistration(layout, textValue02, Common.ImgPosion.GetX(721), Common.ImgPosion.GetY(647));
|
|
|
|
- OutPrintText(textValue02, nInWaitTime);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //disable버튼 추가
|
|
|
|
- if (nOutWaitTime == 180){
|
|
|
|
- Btn_Right01.setButtonEventOffEnable(R.drawable.but_arrow_right_disable);
|
|
|
|
- }
|
|
|
|
- else if (nOutWaitTime == 30){
|
|
|
|
- Btn_Left01.setButtonEventOffEnable(R.drawable.but_arrow_left_disable);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Btn_Right01.setButtonEventOffDisable();
|
|
|
|
- Btn_Left01.setButtonEventOffDisable();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (nInWaitTime == 180) {
|
|
|
|
- Btn_Right02.setButtonEventOffEnable(R.drawable.but_arrow_right_disable);
|
|
|
|
- }
|
|
|
|
- else if (nInWaitTime == 30) {
|
|
|
|
- Btn_Left02.setButtonEventOffEnable(R.drawable.but_arrow_left_disable);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Btn_Right02.setButtonEventOffDisable();
|
|
|
|
- Btn_Left02.setButtonEventOffDisable();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- Log.d(TAG, "[END - Screen] --------------------------------------------");
|
|
|
|
- } catch (RuntimeException re) {
|
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
- }
|
|
|
|
- catch (Exception e) {
|
|
|
|
- Log.e(TAG, "[Exception] SecurityMainScreen(Context context, RelativeLayout layout, WallPadAPI wpapi, int operationMode)");
|
|
|
|
- //e.printStackTrace();
|
|
|
|
- LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- protected void onClose() {
|
|
|
|
- super.onClose();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void Close() {
|
|
|
|
- super.Close();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void DrawCheckBoxPwRelease(boolean bUse) {
|
|
|
|
- try {
|
|
|
|
- if (bUse == true) {
|
|
|
|
- UseSenser.setImageResource(UseSenser.getPressedImageID());
|
|
|
|
- NoSensor.setImageResource(NoSensor.getDefaultImageID());
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- UseSenser.setImageResource(UseSenser.getDefaultImageID());
|
|
|
|
- NoSensor.setImageResource(NoSensor.getPressedImageID());
|
|
|
|
- }
|
|
|
|
- } catch (RuntimeException re) {
|
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
- }
|
|
|
|
- catch (Exception e) {
|
|
|
|
- Log.e(TAG, "[Exception] DrawCheckBoxPwRelease(boolean bUse)");
|
|
|
|
- //e.printStackTrace();
|
|
|
|
- LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- private void SetOutModeWaitTime(boolean bUp) {
|
|
|
|
- nOutWaitTime = ValueChange(nOutWaitTime, bUp);
|
|
|
|
- OutPrintText(textValue01, nOutWaitTime);
|
|
|
|
-
|
|
|
|
- //disable버튼 추가
|
|
|
|
- if (nOutWaitTime == 180){
|
|
|
|
- Btn_Right01.setButtonEventOffEnable(R.drawable.but_arrow_right_disable);
|
|
|
|
- }
|
|
|
|
- else if (nOutWaitTime == 30){
|
|
|
|
- Btn_Left01.setButtonEventOffEnable(R.drawable.but_arrow_left_disable);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Btn_Right01.setButtonEventOffDisable();
|
|
|
|
- Btn_Left01.setButtonEventOffDisable();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // DB에 변경된 패스워드를 저장하도록 한다.
|
|
|
|
- try {
|
|
|
|
- // DB 에서 현재 설정된 패스워드를 얻어오도록 한다.
|
|
|
|
- WallpadStatusData wdb = new WallpadStatusData(this.getContext());
|
|
|
|
- if (wdb != null) {
|
|
|
|
- wdb.SetOutModeWaitTime(nOutWaitTime);
|
|
|
|
- wdb.closeDB();
|
|
|
|
- }
|
|
|
|
- } catch (RuntimeException re) {
|
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
- }
|
|
|
|
- catch (Exception e) {
|
|
|
|
- Log.w(TAG, "[Exception] SetOutModeWaitTime(boolean bUp)");
|
|
|
|
- //e.printStackTrace();
|
|
|
|
- LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void SetInModeWaitTime(boolean bUp) {
|
|
|
|
- try {
|
|
|
|
- nInWaitTime = ValueChange(nInWaitTime, bUp);
|
|
|
|
- OutPrintText(textValue02, nInWaitTime);
|
|
|
|
-
|
|
|
|
- //disable버튼 추가
|
|
|
|
- if(nInWaitTime == 180){
|
|
|
|
- Btn_Right02.setButtonEventOffEnable(R.drawable.but_arrow_right_disable);
|
|
|
|
- }else if(nInWaitTime == 30){
|
|
|
|
- Btn_Left02.setButtonEventOffEnable(R.drawable.but_arrow_left_disable);
|
|
|
|
- }else{
|
|
|
|
- Btn_Right02.setButtonEventOffDisable();
|
|
|
|
- Btn_Left02.setButtonEventOffDisable();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // DB에 변경된 패스워드를 저장하도록 한다.
|
|
|
|
- // DB에서 현재 설정된 패스워드를 얻어오도록 한다.
|
|
|
|
- WallpadStatusData wdb = new WallpadStatusData(this.getContext());
|
|
|
|
- if (wdb != null) {
|
|
|
|
- wdb.SetComeBackWaitTime(nInWaitTime);
|
|
|
|
- wdb.closeDB();
|
|
|
|
- }
|
|
|
|
- } catch (RuntimeException re) {
|
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
- }
|
|
|
|
- catch (Exception e) {
|
|
|
|
- Log.e(TAG, "[Exception] SetInModeWaitTime(boolean bUp)");
|
|
|
|
- //e.printStackTrace();
|
|
|
|
- LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private int ValueChange(int nWaitTime, boolean bUp) {
|
|
|
|
- try {
|
|
|
|
- int retValue = nWaitTime;
|
|
|
|
- if (bUp == true) {
|
|
|
|
- if (nWaitTime == 30)
|
|
|
|
- nWaitTime = 60;
|
|
|
|
- else if (nWaitTime > 30) {
|
|
|
|
- nWaitTime = nWaitTime + 60;
|
|
|
|
- if (nWaitTime > 180)
|
|
|
|
- nWaitTime = 180;
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (nWaitTime == 60)
|
|
|
|
- nWaitTime = 30;
|
|
|
|
- else if (nWaitTime > 60)
|
|
|
|
- nWaitTime = nWaitTime - 60;
|
|
|
|
- }
|
|
|
|
- retValue = nWaitTime;
|
|
|
|
- return retValue;
|
|
|
|
- } catch (RuntimeException re) {
|
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
- return nWaitTime;
|
|
|
|
- }
|
|
|
|
- catch (Exception e) {
|
|
|
|
- Log.e(TAG, "[Exception] ValueChange(int nWaitTime, boolean bUp)");
|
|
|
|
- //e.printStackTrace();
|
|
|
|
- LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
- return nWaitTime;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void OutPrintText(WpadTextView TXTView, int nTime) {
|
|
|
|
- try {
|
|
|
|
- String strTime = "";
|
|
|
|
- if (nTime == 30) strTime = "30초";
|
|
|
|
- else if (nTime == 60) strTime = "1분";
|
|
|
|
- else if (nTime == 120) strTime = "2분";
|
|
|
|
- else if (nTime == 180) strTime = "3분";
|
|
|
|
- else strTime = "30초";
|
|
|
|
-
|
|
|
|
- TXTView.setText(strTime);
|
|
|
|
- } catch (RuntimeException re) {
|
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
- }
|
|
|
|
- catch (Exception e) {
|
|
|
|
- Log.e(TAG, "[Exception] OutPrintText(WpadTextView TXTView, int nTime)");
|
|
|
|
- //e.printStackTrace();
|
|
|
|
- LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- protected void onPopupResult(Intent intent) {
|
|
|
|
- // TODO Auto-generated method stub
|
|
|
|
- super.onPopupResult(intent);
|
|
|
|
- try {
|
|
|
|
- Log.d(TAG, "@@@@@@@@ [onPopupResult] @@@@@@@@");
|
|
|
|
- if (intent != null) {
|
|
|
|
- int nScreen = intent.getIntExtra("SCREEN", -1);
|
|
|
|
- Log.d(TAG, "[onPopupResult] nScreen [" + nScreen + "]");
|
|
|
|
- if (nScreen == ID.screen.InputPwPopupScreen) {
|
|
|
|
- boolean bPW = intent.getBooleanExtra("INPUT_PW", false);
|
|
|
|
- Log.d(TAG, "[onPopupResult] nScreen [" + nScreen + "]");
|
|
|
|
- Log.d(TAG, "[onPopupResult] bPW [" + bPW + "]");
|
|
|
|
- if (bPW == false) {
|
|
|
|
- // 화면을 다시 로딩하여 그리도록 한다.
|
|
|
|
- Log.d(TAG, "[onPopupResult]-------------OutSecurityWaitingPopupScreen : ");
|
|
|
|
- //((MainActivity)(getContext())).StartPopup(ID.screen.OutSecurityWaitingPopupScreen);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if (nScreen == ID.screen.InSecurityPopupScreen) {
|
|
|
|
- boolean bPW = intent.getBooleanExtra("SCREEN_ALL_EXIT", false);
|
|
|
|
- Log.d(TAG, "[onPopupResult] bPW [" + bPW + "]");
|
|
|
|
- if (bPW == true) {
|
|
|
|
- // 화면을 다시 로딩하여 그리도록 한다.
|
|
|
|
- super.finish();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- Log.w(TAG, "[Exception] intent is null!!");
|
|
|
|
- }
|
|
|
|
- } catch (RuntimeException re) {
|
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
- }
|
|
|
|
- catch (Exception e) {
|
|
|
|
- Log.e(TAG, "[Exception] onPopupResult(Intent intent)");
|
|
|
|
- //e.printStackTrace();
|
|
|
|
- LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- protected void onTouchEvent(View v, MotionEvent event) {
|
|
|
|
- super.onTouchEvent(v, event);
|
|
|
|
- try {
|
|
|
|
- int TargetId = v.getId();
|
|
|
|
- int MoveEvent = event.getAction();
|
|
|
|
-
|
|
|
|
- if (MoveEvent == MotionEvent.ACTION_DOWN) {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- else if (MoveEvent == MotionEvent.ACTION_UP) {
|
|
|
|
- if (TargetId == ID.SecurityMainScreen.button.CHECKBOX_USE) {
|
|
|
|
- if (bReleasePwIntput) return;
|
|
|
|
-
|
|
|
|
- if (bReleasePwIntput == false) {
|
|
|
|
- bReleasePwIntput = true;
|
|
|
|
- DrawCheckBoxPwRelease(bReleasePwIntput);
|
|
|
|
- WallpadStatusData wdb = new WallpadStatusData(this.getContext());
|
|
|
|
- wdb.SetUseGuardReleasePw(bReleasePwIntput);
|
|
|
|
- wdb.closeDB();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if (TargetId == ID.SecurityMainScreen.button.CHECKBOX_NO_USE) {
|
|
|
|
- if (!bReleasePwIntput) return;
|
|
|
|
-
|
|
|
|
- if (bReleasePwIntput == true) {
|
|
|
|
- bReleasePwIntput = false;
|
|
|
|
- DrawCheckBoxPwRelease(bReleasePwIntput);
|
|
|
|
- WallpadStatusData wdb = new WallpadStatusData(this.getContext());
|
|
|
|
- wdb.SetUseGuardReleasePw(bReleasePwIntput);
|
|
|
|
- wdb.closeDB();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
-
|
|
|
|
- if (TargetId == ID.SecurityMainScreen.text.TITLE) {
|
|
|
|
- DebugLogOutput("onTouchEvent - ID: " + ID.SecurityMainScreen.text.TITLE);
|
|
|
|
- MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Log.d(TAG, "[onTouchEvent] TargetId -> " + TargetId);
|
|
|
|
- if (TargetId == ID.SecurityMainScreen.button.OUT_SECURITY) {
|
|
|
|
- if (OPERATION_MODE == Common.MODE_BUSINESS_SAMPLE) {
|
|
|
|
- MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
- Log.d(TAG, "[onTouchEvent] - OUT_SECURITY - MODE_BUSINESS_SAMPLE");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- // 방범센서 사용안하는 그냥 외출모드 사용시
|
|
|
|
- if ((Version.getModelType() == Version.MODEL_TYPE.IHN_1020SA_A && bUseGuardSensorCheck == false) || (bSmartSwitch485 == true && bUseGuardSensorCheck == false)) {
|
|
|
|
- // 그냥 외출모드 설정
|
|
|
|
- // 기기제어 실행
|
|
|
|
- WallpadStatusData wdb = new WallpadStatusData(this.getContext());
|
|
|
|
- wdb.SetAlarmStatus(WallpadStatusData.OUT_MODE);
|
|
|
|
- wdb.closeDB();
|
|
|
|
- OutModeDeviceCtrl(false);
|
|
|
|
-
|
|
|
|
- //MainActivity.mSound.Play(SND.mode.OUTMODE_SETTING);
|
|
|
|
- int nPlayMentTime = MainActivity.mSound.PlayMent(SND.mode.OUTMODE_SETTING);
|
|
|
|
- ((MainActivity)getContext()).sendHandlerMsgDelayed(100, 0, 0, nPlayMentTime);
|
|
|
|
- //super.setSoundNoRelease(true);
|
|
|
|
- //super.finish();
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- //띄우기 전에 센서 체크~~~~ 센서가 이상이 없다면 외출모드 진행 팝업을 띄우고 센서 감지 이상이 있으면
|
|
|
|
- //센서를 점검하세요라는 팝업/사운드 띄운다.
|
|
|
|
- boolean bSenSorCheck = OutModeCheckSensor(true);
|
|
|
|
- // 아직 실내에 사람이 있으므로 내부동체는 체크하지 않는다.
|
|
|
|
- if (bSenSorCheck) {
|
|
|
|
- //MainActivity.StartPopup(ID.screen.OutSecurityWaitingPopupScreen, Common.POPUP_STYLE_ALARM);
|
|
|
|
- ((MainActivity) (getContext())).StartPopup(ID.screen.OutSecurityWaitingPopupScreen);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- // 사운드 출력
|
|
|
|
- MainActivity.mSound.PlayMent(SND.mode.HOME_DEVICE_CHECK);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if (TargetId == ID.SecurityMainScreen.button.IN_SECURITY) {
|
|
|
|
- //ChangeReservation();
|
|
|
|
- //띄우기 전에 센서 체크~~~~ 센서가 이상이 없다면 재택설정 확인 팝업을 띄우고 센서 감지 이상이 있으면
|
|
|
|
- //센서를 점검하세요라는 팝업을 띄운다.
|
|
|
|
- if (OPERATION_MODE == Common.MODE_BUSINESS_SAMPLE) {
|
|
|
|
- MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
- Log.d(TAG, "[onTouch] - OUT_SECURITY - MODE_BUSINESS_SAMPLE");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- if (Common.GetSensorSampleMode(this.getContext())) {
|
|
|
|
- ((MainActivity) (getContext())).StartPopup(ID.screen.InSecurityPopupScreen);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- if (InModeCheckSensor() == true) {
|
|
|
|
- //MainActivity.StartPopup(ID.screen.InSecurityPopupScreen, Common.POPUP_STYLE_ALARM);
|
|
|
|
- ((MainActivity) (getContext())).StartPopup(ID.screen.InSecurityPopupScreen);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- // 사운드 출력
|
|
|
|
- MainActivity.mSound.PlayMent(SND.mode.HOME_DEVICE_CHECK);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if (TargetId == ID.SecurityMainScreen.button.BED_SECURITY) {
|
|
|
|
- if (OPERATION_MODE == Common.MODE_BUSINESS_SAMPLE) {
|
|
|
|
- MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (Common.GetInBedCheckSensor(this.getContext())) {
|
|
|
|
- // 센서 체크
|
|
|
|
- if (InModeCheckSensor() == true) {
|
|
|
|
- ((MainActivity) (getContext())).StartPopup(ID.screen.BedSecurityPopupScreen);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- MainActivity.mSound.PlayMent(SND.mode.HOME_DEVICE_CHECK);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- // 기기제어만
|
|
|
|
- Common.BedModeDeviceCtrl(this.getContext(), true);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if (TargetId == ID.SecurityMainScreen.button.LEFT_01) {
|
|
|
|
- SetOutModeWaitTime(false);
|
|
|
|
- //Sound().Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
- }
|
|
|
|
- else if (TargetId == ID.SecurityMainScreen.button.RIGHT_01) {
|
|
|
|
- SetOutModeWaitTime(true);
|
|
|
|
- //Sound().Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
- }
|
|
|
|
- else if (TargetId == ID.SecurityMainScreen.button.LEFT_02) {
|
|
|
|
- SetInModeWaitTime(false);
|
|
|
|
- //Sound().Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
- }
|
|
|
|
- else if (TargetId == ID.SecurityMainScreen.button.RIGHT_02) {
|
|
|
|
- SetInModeWaitTime(true);
|
|
|
|
- //Sound().Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } catch (RuntimeException re) {
|
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
- }
|
|
|
|
- catch (Exception e) {
|
|
|
|
- Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
|
|
|
|
- //e.printStackTrace();
|
|
|
|
- LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void ViewRegistration(RelativeLayout ParentsLayout,
|
|
|
|
- WpadImageView nImageView, int MarginLeft, int MarginTop) {
|
|
|
|
- // TODO Auto-generated method stub
|
|
|
|
- super.ViewRegistration(ParentsLayout, nImageView, MarginLeft, MarginTop);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void ViewRegistration(RelativeLayout ParentsLayout,
|
|
|
|
- WpadTextView nTextView, int MarginLeft, int MarginTop) {
|
|
|
|
- // TODO Auto-generated method stub
|
|
|
|
- super.ViewRegistration(ParentsLayout, nTextView, MarginLeft, MarginTop);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void OutModeDeviceCtrl(boolean notElevatorCall) {
|
|
|
|
- try {
|
|
|
|
- Intent intent = new Intent(Common.BR_MAIN_NOTI.ACNAME_MAIN_NOTI, null);
|
|
|
|
- intent.putExtra(Common.BR_MAIN_NOTI.KIND, Common.BR_MAIN_NOTI.OUTMODE_CTRL_WORKING);
|
|
|
|
- if (notElevatorCall == true)
|
|
|
|
- intent.putExtra("Called", 1);
|
|
|
|
-
|
|
|
|
- getContext().sendBroadcast(intent);
|
|
|
|
- } catch (RuntimeException re) {
|
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
- }
|
|
|
|
- catch (Exception e) {
|
|
|
|
- Log.d(TAG, "[Ctrl Exception]-" + e.toString());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
|
|
+package kr.co.icontrols.wallpadsecurity.screen;
|
|
|
|
+
|
|
|
|
+import android.content.Context;
|
|
|
|
+import android.content.Intent;
|
|
|
|
+import android.graphics.Color;
|
|
|
|
+import android.util.Log;
|
|
|
|
+import android.view.Gravity;
|
|
|
|
+import android.view.MotionEvent;
|
|
|
|
+import android.view.View;
|
|
|
|
+import android.widget.RelativeLayout;
|
|
|
|
+
|
|
|
|
+import kr.co.icontrols.wallpadsecurity.MainActivity;
|
|
|
|
+import kr.co.icontrols.wallpadsecurity.R;
|
|
|
|
+import kr.co.icontrols.wallpadsecurity.declare.Common;
|
|
|
|
+import kr.co.icontrols.wallpadsecurity.declare.ID;
|
|
|
|
+import kr.co.icontrols.wallpadsupport.Version;
|
|
|
|
+import kr.co.icontrols.wallpadsupport.WpadImageView;
|
|
|
|
+import com.util.LogUtil;
|
|
|
|
+import kr.co.icontrols.wallpadsupport.WpadScreen;
|
|
|
|
+import kr.co.icontrols.wallpadsupport.WpadTextView;
|
|
|
|
+import kr.co.icontrols.wallpadsupport.WpadImageView.TOUCH_KIND;
|
|
|
|
+import kr.co.icontrols.wallpadsupport.WpadSound.SND;
|
|
|
|
+
|
|
|
|
+import com.artncore.WallPadDataMgr.*;
|
|
|
|
+import com.artncore.devicectr.WallPadInterface;
|
|
|
|
+import com.artncore.wallpadapi.DLockAPI;
|
|
|
|
+import com.artncore.wallpadapi.DLockAPI.DOORSTATUS;
|
|
|
|
+import com.artncore.wallpadapi.FP_DlockAPI;
|
|
|
|
+import com.artncore.wallpadapi.IGW200dAPI;
|
|
|
|
+import com.artncore.wallpadapi.WallPadAPI;
|
|
|
|
+import com.artncore.wallpadapi.IGW300API;
|
|
|
|
+
|
|
|
|
+public class SecurityMainScreen extends WpadScreen {
|
|
|
|
+
|
|
|
|
+ // [Define]
|
|
|
|
+ String TAG = this.getClass().getSimpleName();
|
|
|
|
+
|
|
|
|
+ private void DebugLogOutput(String s) {
|
|
|
|
+ if (Common.DEBUG_LOG_ON) Log.d(TAG, s);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // [View - ImageView(Background or Image - No touch)]
|
|
|
|
+ WpadImageView Background;
|
|
|
|
+ WpadImageView StatusWindow;
|
|
|
|
+
|
|
|
|
+ // [View - ImageView(Button - touch)]
|
|
|
|
+ WpadImageView StopBtn;
|
|
|
|
+
|
|
|
|
+ WpadImageView OutSecurityModeBtn = null;
|
|
|
|
+ WpadImageView InSecurityModeBtn = null;
|
|
|
|
+ WpadImageView BedSecurityModeBtn = null;
|
|
|
|
+
|
|
|
|
+ WpadImageView lineO1;
|
|
|
|
+ WpadImageView line02;
|
|
|
|
+ WpadImageView line03;
|
|
|
|
+
|
|
|
|
+ WpadImageView Btn_Left01;
|
|
|
|
+ WpadImageView Btn_Left02;
|
|
|
|
+ WpadImageView Text_Box01;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ WpadImageView Btn_Right01;
|
|
|
|
+ WpadImageView Btn_Right02;
|
|
|
|
+ WpadImageView Text_Box02;
|
|
|
|
+
|
|
|
|
+ // [View - TextView]
|
|
|
|
+ private WpadTextView Title;
|
|
|
|
+ WpadTextView LineText01;
|
|
|
|
+ WpadTextView LineText02;
|
|
|
|
+ WpadTextView LineText03;
|
|
|
|
+
|
|
|
|
+ WpadTextView textValue01;
|
|
|
|
+ WpadTextView textValue02;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private int nOutWaitTime = 30;
|
|
|
|
+ private int nInWaitTime = 30;
|
|
|
|
+ private boolean bSmartSwitch485 = false;
|
|
|
|
+ private boolean bUseGuardSensorCheck = true; // 그냥외출모드
|
|
|
|
+ private boolean bReleasePwIntput = true;
|
|
|
|
+ private WpadImageView UseSenser, NoSensor;
|
|
|
|
+ private WpadTextView UseText, NoUseText;
|
|
|
|
+
|
|
|
|
+ private WallPadAPI mWallPadAPI = null;
|
|
|
|
+ DLockAPI doorLockAPI = null;
|
|
|
|
+ FP_DlockAPI FPdoorLockAPI = null;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private Context mContext;
|
|
|
|
+
|
|
|
|
+ // [Value]
|
|
|
|
+ private int OPERATION_MODE = Common.MODE;
|
|
|
|
+
|
|
|
|
+ // [Class] 2017.09.07
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public static class ImgPosion {
|
|
|
|
+ int x = 0;
|
|
|
|
+ int y = 0;
|
|
|
|
+
|
|
|
|
+ public static int GetX(int OrgPos) {
|
|
|
|
+ return OrgPos - 200;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static int GetY(int OrgPos) {
|
|
|
|
+ return OrgPos - 61;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private void initInfo() {
|
|
|
|
+ // DB에 변경된 패스워드를 저장하도록 한다.
|
|
|
|
+ try {
|
|
|
|
+ // DB 에서 현재 설정된 패스워드를 얻어오도록 한다.
|
|
|
|
+ WallpadStatusData wdb = new WallpadStatusData(this.getContext());
|
|
|
|
+ if (wdb != null) {
|
|
|
|
+ nOutWaitTime = wdb.GetOutModeWaitTime();
|
|
|
|
+ nInWaitTime = wdb.GetComeBackWaitTime();
|
|
|
|
+ bUseGuardSensorCheck = wdb.GetUseGuardSensorCheck();
|
|
|
|
+ bReleasePwIntput = wdb.GetUseGuardReleasePW();
|
|
|
|
+ wdb.closeDB();
|
|
|
|
+
|
|
|
|
+ // 485 스마트 스위치 연동 모델인지 체크
|
|
|
|
+ if (Version.getModelType() != Version.MODEL_TYPE.IHN_1020GL) {
|
|
|
|
+ WallpadDeviceSet devSet = new WallpadDeviceSet(this.getContext());
|
|
|
|
+ int[] BatchInfo = devSet.Get_BatchSW_Info();
|
|
|
|
+ devSet.closeDB();
|
|
|
|
+
|
|
|
|
+ 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_1010GL || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I
|
|
|
|
+ || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_2443ALT || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_6410ALT
|
|
|
|
+ || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF)
|
|
|
|
+ {
|
|
|
|
+ if (BatchInfo[0] == 1 && BatchInfo[1] == WallpadDeviceSet.BATCH_TYPE_HDC_LCD_SMART) {
|
|
|
|
+ bSmartSwitch485 = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if (BatchInfo[0] == 1 && BatchInfo[1] == WallpadDeviceSet.BATCH_TYPE_SMART) {
|
|
|
|
+ bSmartSwitch485 = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Log.d(TAG, "[initInfo] mOutWaitTime [" + nOutWaitTime + "], mInWaitTime [" + nInWaitTime + "], m_UseGuardSensorCheck [" + bUseGuardSensorCheck + "], m_ReleasePwIntput [" + bReleasePwIntput + "]");
|
|
|
|
+ }
|
|
|
|
+ } catch (RuntimeException re) {
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e) {
|
|
|
|
+ Log.e(TAG, "[Exception] initInfo()");
|
|
|
|
+ //e.printStackTrace();
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private boolean OutModeCheckSensor(boolean bUseOutModeWaiting) {
|
|
|
|
+ try {
|
|
|
|
+ if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL) {
|
|
|
|
+ IGW200dAPI.Data mData = Common.getIGW200UpdateData();
|
|
|
|
+
|
|
|
|
+ if(mData!=null)
|
|
|
|
+ {
|
|
|
|
+ boolean bMotionSensor = mData.senIn.Motion;
|
|
|
|
+ boolean bMagneticSensor = mData.senIn.Magnetic;
|
|
|
|
+ Log.d(TAG, "[OutModeCheckSensor] bMotionSensor [" + bMotionSensor + "], bMagneticSensor [" + bMagneticSensor + "]");
|
|
|
|
+ byte hDoorLockState = DOORSTATUS.Close;
|
|
|
|
+
|
|
|
|
+ if (mWallPadAPI != null) {
|
|
|
|
+ if (mWallPadAPI.Check_Connect()) {
|
|
|
|
+ DLockAPI doorLockAPI = mWallPadAPI.Get_DLockController();
|
|
|
|
+ doorLockAPI.Refresh(true);
|
|
|
|
+ hDoorLockState = doorLockAPI.data.DoorStatus;
|
|
|
|
+ Log.d(TAG, "[OutModeCheckSensor] hDoorLockState: " + hDoorLockState);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Log.w(TAG, "[OutModeCheckSensor] mWallPadAPI.Check_Connect() is false!!!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Log.w(TAG, "[OutModeCheckSensor] mWallPadAPI is null!!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 현산향이 무선 도어락이 들어가면서 추가되어야 함
|
|
|
|
+ if (Common.isWirelessDoorlock(getContext())) hDoorLockState = DOORSTATUS.Close;
|
|
|
|
+
|
|
|
|
+ if (bMotionSensor == false && bMagneticSensor == false && hDoorLockState == DOORSTATUS.Close) return true;
|
|
|
|
+ else return false;
|
|
|
|
+ }
|
|
|
|
+ else return false;
|
|
|
|
+ }
|
|
|
|
+ else 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_1010GL || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I
|
|
|
|
+ || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_2443ALT || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_6410ALT
|
|
|
|
+ || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF)
|
|
|
|
+ {
|
|
|
|
+ // IGW300(G/W)를 사용하는 경우
|
|
|
|
+ IGW300API.Data mData = Common.getIGW300UpdateData();
|
|
|
|
+
|
|
|
|
+ boolean bMotionSensor_In = false;
|
|
|
|
+ boolean bMotionSensor_Out = false;
|
|
|
|
+ if(mData!=null) {
|
|
|
|
+ boolean bMagneticSensor = mData.senIn.Magnetic;
|
|
|
|
+ Log.d(TAG, "----------------- bMagneticSensor : " + bMagneticSensor);
|
|
|
|
+ byte hDoorLockState = DOORSTATUS.Close;
|
|
|
|
+
|
|
|
|
+ WallpadDeviceSet devSet = new WallpadDeviceSet(getContext());
|
|
|
|
+ String[] GetValue = devSet.GetSettingData("디지털도어락");
|
|
|
|
+ devSet.closeDB();
|
|
|
|
+ if (GetValue == null) {
|
|
|
|
+ Log.w(TAG, "[OutModeCheckSensor] GetSettingData(디지털도어락) is null");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Log.d(TAG, "[OutModeCheckSensor] GetSettingData(디지털도어락) is value: " + GetValue[1]);
|
|
|
|
+
|
|
|
|
+ if (GetValue[1].indexOf("유선") > 0) {
|
|
|
|
+ Log.d(TAG, "[OutModeCheckSensor] WiredDoorlock");
|
|
|
|
+ if (mWallPadAPI != null) {
|
|
|
|
+ if (mWallPadAPI.Check_Connect()) {
|
|
|
|
+ doorLockAPI = mWallPadAPI.Get_DLockController();
|
|
|
|
+ doorLockAPI.Refresh(true);
|
|
|
|
+ hDoorLockState = doorLockAPI.data.DoorStatus;
|
|
|
|
+ Log.d(TAG, "[OutModeCheckSensor] hDoorLockState: " + hDoorLockState);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Log.w(TAG, "[OutModeCheckSensor] mWallPadAPI.Check_Connect() is false!!!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Log.w(TAG, "[OutModeCheckSensor] mWallPadAPI is null!!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else if (GetValue[1].indexOf("지문인식") > 0) {
|
|
|
|
+ Log.d(TAG, "[OutModeCheckSensor] WiredDoorlock (FingerPrint)");
|
|
|
|
+ if (mWallPadAPI != null) {
|
|
|
|
+ if (mWallPadAPI.Check_Connect()) {
|
|
|
|
+ FPdoorLockAPI = mWallPadAPI.Get_FP_DLockController();
|
|
|
|
+ FPdoorLockAPI.Refresh(true);
|
|
|
|
+ hDoorLockState = FPdoorLockAPI.data.DoorStatus;
|
|
|
|
+ Log.d(TAG, "[OutModeCheckSensor] hDoorLockState: " + hDoorLockState);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Log.w(TAG, "[OutModeCheckSensor] mWallPadAPI.Check_Connect() is false!!!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Log.w(TAG, "[OutModeCheckSensor] mWallPadAPI is null!!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 현산향이 무선 도어락이 들어가면서 추가되어야 함
|
|
|
|
+ if (Common.isWirelessDoorlock(getContext()) == true) {
|
|
|
|
+ hDoorLockState = DOORSTATUS.Close;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ int[] SensorInfoDB;
|
|
|
|
+ SensorInfoDB = Common.GetInSensorUseOfNotFromDB(getContext());
|
|
|
|
+
|
|
|
|
+ if (SensorInfoDB[0] == 1) {
|
|
|
|
+ // 내부동체가 사용함이면 상태 검사
|
|
|
|
+ bMotionSensor_In = mData.senIn.In_Motion;
|
|
|
|
+ Log.d(TAG, "[OutModeCheckSensor] In Motion USE !!! : " + bMotionSensor_In);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (SensorInfoDB[1] == 1) {
|
|
|
|
+ // 외부동체가 사용함이면 상태 검사
|
|
|
|
+ bMotionSensor_Out = mData.senIn.Out_Motion;
|
|
|
|
+ Log.d(TAG, "[OutModeCheckSensor] Out Motion USE !!! : " + bMotionSensor_Out );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (bUseOutModeWaiting) {
|
|
|
|
+ // 외출모드 대기화면을 사용하는 경우에는 댁내에 사람이 있는 경우이므로, 내부동체를 무시한다.
|
|
|
|
+ bMotionSensor_In = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Log.d(TAG, "[OutModeCheckSensor] bMotionSensor_In [" + bMotionSensor_In + "], bMotionSensor_Out [" + bMotionSensor_Out + "], bMagneticSensor [" + bMagneticSensor + "]");
|
|
|
|
+
|
|
|
|
+ if (bMotionSensor_In == false && bMotionSensor_Out == false && bMagneticSensor == false && hDoorLockState == DOORSTATUS.Close) return true;
|
|
|
|
+ else return false;
|
|
|
|
+ }
|
|
|
|
+ else return false;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ // G/W 사용을 하지 않는 경우
|
|
|
|
+ WallPadInterface mWallPadInterface = ((MainActivity) (super.getContext())).getWallPadInterface();
|
|
|
|
+ if (mWallPadInterface == null) {
|
|
|
|
+ Log.e(TAG, "[OutModeCheckSensor] Wallpadinterface is null!!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ int nSensorIn = 0, nSensorOut = 0, nSensorMagnetic = 0;
|
|
|
|
+
|
|
|
|
+ nSensorMagnetic = mWallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MAG0_STATE, 0);
|
|
|
|
+
|
|
|
|
+ int[] SensorInfoDB;
|
|
|
|
+ SensorInfoDB = Common.GetInSensorUseOfNotFromDB(getContext());
|
|
|
|
+
|
|
|
|
+ if (SensorInfoDB[0] == 1) {
|
|
|
|
+ // 내부동체가 사용함이면 상태 검사
|
|
|
|
+ nSensorIn = mWallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MOTIN_STATE, 0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (SensorInfoDB[1] == 1) {
|
|
|
|
+ // 외부동체가 사용함이면 상태 검사
|
|
|
|
+ nSensorOut = mWallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MOTOUT_STATE, 0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (Common.GetUseOutMotionConvertInMotionSetting() == true) {
|
|
|
|
+ nSensorOut = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (bUseOutModeWaiting) {
|
|
|
|
+ // 외출모드 대기화면을 사용하는 경우에는 댁내에 사람이 있는 경우이므로, 내부동체를 무시한다.
|
|
|
|
+ nSensorIn = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Log.d(TAG, "[OutModeCheckSensor] nSensorIn [" + nSensorIn + "], nSensorOut [" + nSensorOut + "], nSensorMagnetic [" + nSensorMagnetic + "]");
|
|
|
|
+ if ((nSensorMagnetic == 0) && (nSensorIn == 0) && (nSensorOut == 0)) return true;
|
|
|
|
+ else return false;
|
|
|
|
+ }
|
|
|
|
+ } catch (RuntimeException re) {
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e) {
|
|
|
|
+ Log.e(TAG, "[Exception] OutModeCheckSensor(boolean bUseOutModeWaiting)");
|
|
|
|
+ //e.printStackTrace();
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private boolean InModeCheckSensor() {
|
|
|
|
+ try {
|
|
|
|
+ if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL) {
|
|
|
|
+ IGW200dAPI.Data mData = Common.getIGW200UpdateData();
|
|
|
|
+
|
|
|
|
+ if(mData!=null)
|
|
|
|
+ {
|
|
|
|
+ boolean bMotionSensor = mData.senIn.Motion;
|
|
|
|
+ boolean bMagneticSensor = mData.senIn.Magnetic;
|
|
|
|
+ Log.d(TAG, "[InModeCheckSensor] bMotionSensor [" + bMotionSensor + "], bMagneticSensor [" + bMagneticSensor + "]");
|
|
|
|
+
|
|
|
|
+ byte hDoorLockState = DOORSTATUS.Close;
|
|
|
|
+
|
|
|
|
+ WallpadDeviceSet devSet = new WallpadDeviceSet(getContext());
|
|
|
|
+ String[] GetValue = devSet.GetSettingData("디지털도어락");
|
|
|
|
+ devSet.closeDB();
|
|
|
|
+ if (GetValue == null) {
|
|
|
|
+ Log.w(TAG, "[InModeCheckSensor] GetSettingData(디지털도어락) is null");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Log.d(TAG, "[InModeCheckSensor] GetSettingData(디지털도어락) is value: " + GetValue[1]);
|
|
|
|
+
|
|
|
|
+ if (GetValue[1].indexOf("유선") > 0) {
|
|
|
|
+ Log.d(TAG, "[InModeCheckSensor] WiredDoorlock");
|
|
|
|
+
|
|
|
|
+ if (mWallPadAPI != null) {
|
|
|
|
+ if (mWallPadAPI.Check_Connect()) {
|
|
|
|
+ doorLockAPI = mWallPadAPI.Get_DLockController();
|
|
|
|
+ doorLockAPI.Refresh(true);
|
|
|
|
+ hDoorLockState = doorLockAPI.data.DoorStatus;
|
|
|
|
+ Log.d(TAG, "[InModeCheckSensor] hDoorLockState: " + hDoorLockState);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Log.w(TAG, "[InModeCheckSensor] mWallPadAPI.Check_Connect() is false!!!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Log.w(TAG, "[InModeCheckSensor] mWallPadAPI is null!!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else if (GetValue[1].indexOf("지문인식") > 0) {
|
|
|
|
+ Log.d(TAG, "[InModeCheckSensor] WiredDoorlock (FingerPrint)");
|
|
|
|
+ if (mWallPadAPI != null) {
|
|
|
|
+ if (mWallPadAPI.Check_Connect()) {
|
|
|
|
+ FPdoorLockAPI = mWallPadAPI.Get_FP_DLockController();
|
|
|
|
+ FPdoorLockAPI.Refresh(true);
|
|
|
|
+ hDoorLockState = FPdoorLockAPI.data.DoorStatus;
|
|
|
|
+ Log.d(TAG, "[InModeCheckSensor] hDoorLockState: " + hDoorLockState);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Log.w(TAG, "[InModeCheckSensor] mWallPadAPI.Check_Connect() is false!!!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Log.w(TAG, "[InModeCheckSensor] mWallPadAPI is null!!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 인왕산 아이파크 특별 적용
|
|
|
|
+ WallpadDeviceSet devset = new WallpadDeviceSet(this.getContext());
|
|
|
|
+ if (devset != null) {
|
|
|
|
+ int GetDataInt = devset.Get_Security_IndoorMode_Sensor_Use();
|
|
|
|
+ if (GetDataInt == 0)
|
|
|
|
+ bMotionSensor = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 현산향이 무선 도어락이 들어가면서 추가되어야 함
|
|
|
|
+ if (Common.isWirelessDoorlock(getContext()) == true) {
|
|
|
|
+ hDoorLockState = DOORSTATUS.Close;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Log.d(TAG, "[InModeCheckSensor] bMotionSensor [" + bMotionSensor + "], bMagneticSensor [" + bMagneticSensor + "], hDoorLockState [" + hDoorLockState + "]");
|
|
|
|
+ if (bMotionSensor == false && bMagneticSensor == false && (hDoorLockState == DOORSTATUS.Close || hDoorLockState == DOORSTATUS.Close_LockingForce)) return true;
|
|
|
|
+ else return false;
|
|
|
|
+ }
|
|
|
|
+ else return false;
|
|
|
|
+ }
|
|
|
|
+ else 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_1010GL || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I
|
|
|
|
+ || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_2443ALT || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_6410ALT
|
|
|
|
+ || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF)
|
|
|
|
+ {
|
|
|
|
+ IGW300API.Data mData = Common.getIGW300UpdateData();
|
|
|
|
+
|
|
|
|
+ boolean bMotionSensor_Out = false;
|
|
|
|
+ int[] SensorInfoDB = Common.GetInSensorUseOfNotFromDB(getContext());
|
|
|
|
+ if (SensorInfoDB[1] == 1 && mData!=null) {
|
|
|
|
+ // 외부동체가 사용함이면 상태 검사
|
|
|
|
+ bMotionSensor_Out = mData.senIn.Out_Motion;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ bMotionSensor_Out = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(mData!=null)
|
|
|
|
+ {
|
|
|
|
+ boolean bMagneticSensor = mData.senIn.Magnetic;
|
|
|
|
+ Log.d(TAG, "[InModeCheckSensor] bMotionSensor_Out [" + bMotionSensor_Out + "], bMagneticSensor [" + bMagneticSensor + "]");
|
|
|
|
+
|
|
|
|
+ byte hDoorLockState = DOORSTATUS.Close;
|
|
|
|
+
|
|
|
|
+ WallpadDeviceSet devSet = new WallpadDeviceSet(getContext());
|
|
|
|
+ String[] GetValue = devSet.GetSettingData("디지털도어락");
|
|
|
|
+ devSet.closeDB();
|
|
|
|
+ if (GetValue == null) {
|
|
|
|
+ Log.w(TAG, "[InModeCheckSensor] GetSettingData(디지털도어락) is null");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Log.d(TAG, "[InModeCheckSensor] GetSettingData(디지털도어락) is value: " + GetValue[1]);
|
|
|
|
+
|
|
|
|
+ if (GetValue[1].indexOf("유선") > 0) {
|
|
|
|
+ Log.d(TAG, "[InModeCheckSensor] WiredDoorlock");
|
|
|
|
+
|
|
|
|
+ if (mWallPadAPI != null) {
|
|
|
|
+ if (mWallPadAPI.Check_Connect()) {
|
|
|
|
+ doorLockAPI = mWallPadAPI.Get_DLockController();
|
|
|
|
+ doorLockAPI.Refresh(true);
|
|
|
|
+ hDoorLockState = doorLockAPI.data.DoorStatus;
|
|
|
|
+ Log.d(TAG, "[InModeCheckSensor] hDoorLockState: " + hDoorLockState);
|
|
|
|
+ } else {
|
|
|
|
+ Log.w(TAG, "[InModeCheckSensor] mWallPadAPI.Check_Connect() is false!!!");
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ Log.w(TAG, "[InModeCheckSensor] mWallPadAPI is null!!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else if (GetValue[1].indexOf("지문인식") > 0) {
|
|
|
|
+ Log.d(TAG, "[InModeCheckSensor] WiredDoorlock (FingerPrint)");
|
|
|
|
+ if (mWallPadAPI != null) {
|
|
|
|
+ if (mWallPadAPI.Check_Connect()) {
|
|
|
|
+ FPdoorLockAPI = mWallPadAPI.Get_FP_DLockController();
|
|
|
|
+ FPdoorLockAPI.Refresh(true);
|
|
|
|
+ hDoorLockState = FPdoorLockAPI.data.DoorStatus;
|
|
|
|
+ Log.d(TAG, "[InModeCheckSensor] hDoorLockState: " + hDoorLockState);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Log.w(TAG, "[InModeCheckSensor] mWallPadAPI.Check_Connect() is false!!!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Log.w(TAG, "[InModeCheckSensor] mWallPadAPI is null!!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 현산향이 무선 도어락이 들어가면서 추가되어야 함
|
|
|
|
+ if (Common.isWirelessDoorlock(getContext()) == true) {
|
|
|
|
+ hDoorLockState = DOORSTATUS.Close;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Log.d(TAG, "[InModeCheckSensor] bMotionSensor_Out [" + bMotionSensor_Out + "], bMagneticSensor [" + bMagneticSensor + "], hDoorLockState [" + hDoorLockState + "]");
|
|
|
|
+
|
|
|
|
+ if (bMotionSensor_Out == false && bMagneticSensor == false && (hDoorLockState == DOORSTATUS.Close || hDoorLockState == DOORSTATUS.Close_LockingForce)) return true;
|
|
|
|
+ else return false;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ return false;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ WallPadInterface mWallPadInterface = ((MainActivity) (super.getContext())).getWallPadInterface();
|
|
|
|
+ int sensorMag = mWallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MAG0_STATE, 0);
|
|
|
|
+ int[] SensorInfoDB;
|
|
|
|
+ SensorInfoDB = Common.GetInSensorUseOfNotFromDB(getContext());
|
|
|
|
+
|
|
|
|
+ int sensorOut = 0;
|
|
|
|
+
|
|
|
|
+ if (SensorInfoDB[1] == 1) {
|
|
|
|
+ // 외부동체가 사용함이면 상태 검사
|
|
|
|
+ sensorOut = mWallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MOTOUT_STATE, 0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //int sensorOut = wallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MOTOUT_STATE, 0);
|
|
|
|
+
|
|
|
|
+ if (Common.GetUseOutMotionConvertInMotionSetting() == true) {
|
|
|
|
+ sensorOut = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (Version.getGatewayUsage()) {
|
|
|
|
+ // 현산향인 경우
|
|
|
|
+ if (sensorMag == 0) return true;
|
|
|
|
+ else return false;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if (sensorMag == 0 && sensorOut == 0) return true;
|
|
|
|
+ else return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } catch (RuntimeException re) {
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e) {
|
|
|
|
+ Log.e(TAG, "[Exception] InModeCheckSensor()");
|
|
|
|
+ //e.printStackTrace();
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public SecurityMainScreen(Context context, RelativeLayout layout, WallPadAPI wpapi, int operationMode) {
|
|
|
|
+ super(context, layout);
|
|
|
|
+ try {
|
|
|
|
+ Log.d(TAG, "[START - Screen] --------------------------------------------");
|
|
|
|
+ mWallPadAPI = wpapi;
|
|
|
|
+ mContext = context;
|
|
|
|
+ initInfo();
|
|
|
|
+ OPERATION_MODE = operationMode;
|
|
|
|
+
|
|
|
|
+ ((MainActivity) mContext).setManualBtnVisible(((MainActivity) mContext).getManualUse(), 1019);
|
|
|
|
+
|
|
|
|
+ Background = new WpadImageView(context, TOUCH_KIND.NONE, 1280, 690, R.drawable.bg_body, 0, ID.SecurityMainScreen.image.BACKGROUND);
|
|
|
|
+ ViewRegistration(layout, Background, Common.ImgPosion.GetX(0), Common.ImgPosion.GetY(110));
|
|
|
|
+
|
|
|
|
+ if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020SA_A) {
|
|
|
|
+ // LH 향 방범 화면
|
|
|
|
+ int[] GuardImg = {R.drawable.guard_mode_btn_goout_security_normal, R.drawable.guard_mode_btn_goout_security_pressed};
|
|
|
|
+ int[] OutImg = {R.drawable.guard_mode_btn_goout_mode_normal, R.drawable.guard_mode_btn_goout_mode_pressed};
|
|
|
|
+
|
|
|
|
+ OutSecurityModeBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 245, 292, GuardImg, OutImg, ID.SecurityMainScreen.button.OUT_SECURITY);
|
|
|
|
+ ViewRegistration(layout, OutSecurityModeBtn, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(110));
|
|
|
|
+
|
|
|
|
+ int[] BedGuardImg = {R.drawable.guard_mode_btn_sleep_security_normal, R.drawable.guard_mode_btn_sleep_security_pressed};
|
|
|
|
+ int[] BedImg = {R.drawable.guard_mode_btn_sleep_mode_normal, R.drawable.guard_mode_btn_sleep_mode_pressed};
|
|
|
|
+
|
|
|
|
+ BedSecurityModeBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 243, 292, BedGuardImg, BedImg, ID.SecurityMainScreen.button.BED_SECURITY);
|
|
|
|
+ ViewRegistration(layout, BedSecurityModeBtn, Common.ImgPosion.GetX(458), Common.ImgPosion.GetY(110));
|
|
|
|
+
|
|
|
|
+ InSecurityModeBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 244, 292, R.drawable.guard_mode_btn_home_security_normal, R.drawable.guard_mode_btn_home_security_pressed, ID.SecurityMainScreen.button.IN_SECURITY);
|
|
|
|
+ ViewRegistration(layout, InSecurityModeBtn, ImgPosion.GetX(821), ImgPosion.GetY(110));
|
|
|
|
+
|
|
|
|
+ lineO1 = new WpadImageView(context, TOUCH_KIND.NONE, 1094, 2, R.drawable.control_venti_line, 0, ID.SecurityMainScreen.image.LINE01);
|
|
|
|
+ ViewRegistration(layout, lineO1, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(645));
|
|
|
|
+
|
|
|
|
+ // 방범센서 사용안하는 그냥 외출모드 사용시
|
|
|
|
+ if (bUseGuardSensorCheck == false) {
|
|
|
|
+ OutSecurityModeBtn.setButtonRearImage();
|
|
|
|
+ }
|
|
|
|
+ if (Common.GetInBedCheckSensor(this.getContext()) == false) {
|
|
|
|
+ BedSecurityModeBtn.setButtonRearImage();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if (bSmartSwitch485) {
|
|
|
|
+ // 485 스마트 스위치 연동 현장
|
|
|
|
+ int[] GuardImg = {R.drawable.guard_s_btn_goout_normal, R.drawable.guard_s_btn_goout_pressed};
|
|
|
|
+ int[] OutImg = {R.drawable.guard_btn_goout_normal, R.drawable.guard_btn_goout_pressed};
|
|
|
|
+
|
|
|
|
+ OutSecurityModeBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 547, 381, GuardImg, OutImg, ID.SecurityMainScreen.button.OUT_SECURITY);
|
|
|
|
+ ViewRegistration(layout, OutSecurityModeBtn, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(110));
|
|
|
|
+ OutSecurityModeBtn.setTouchDelayMs(500);
|
|
|
|
+
|
|
|
|
+ InSecurityModeBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 547, 381, R.drawable.guard_s_btn_home_normal, R.drawable.guard_s_btn_home_pressed, ID.SecurityMainScreen.button.IN_SECURITY);
|
|
|
|
+ ViewRegistration(layout, InSecurityModeBtn, Common.ImgPosion.GetX(640), Common.ImgPosion.GetY(110));
|
|
|
|
+ InSecurityModeBtn.setTouchDelayMs(500);
|
|
|
|
+
|
|
|
|
+ lineO1 = new WpadImageView(context, TOUCH_KIND.NONE, 1094, 2, R.drawable.control_venti_line, 0, ID.SecurityMainScreen.image.LINE01);
|
|
|
|
+ ViewRegistration(layout, lineO1, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(592));
|
|
|
|
+
|
|
|
|
+ line02 = new WpadImageView(context, TOUCH_KIND.NONE, 1094, 2, R.drawable.control_venti_line, 0, ID.SecurityMainScreen.image.LINE02);
|
|
|
|
+ ViewRegistration(layout, line02, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(696));
|
|
|
|
+
|
|
|
|
+ LineText03 = new WpadTextView(context, false, 525, 101, Gravity.CENTER, Color.parseColor("#966432"), Common.fontsize._36, true, ID.SecurityMainScreen.text.LINE_TEXT_01);
|
|
|
|
+ ViewRegistration(layout, LineText03, Common.ImgPosion.GetX(116), Common.ImgPosion.GetY(491));
|
|
|
|
+ LineText03.setText("취소시 비밀번호 입력");
|
|
|
|
+
|
|
|
|
+ // 체크박스 시작
|
|
|
|
+ UseSenser = new WpadImageView(context, TOUCH_KIND.BUTTON_M, 88, 88, R.drawable.but_check_default, R.drawable.but_check_checked, ID.SecurityMainScreen.button.CHECKBOX_USE);
|
|
|
|
+ ViewRegistration(layout, UseSenser, Common.ImgPosion.GetX(641), Common.ImgPosion.GetY(495));
|
|
|
|
+ UseText = new WpadTextView(context, true, 148, 101, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, ID.SecurityMainScreen.text.CHECKBOX_USE);
|
|
|
|
+ ViewRegistration(layout, UseText, Common.ImgPosion.GetX(731), Common.ImgPosion.GetY(491));
|
|
|
|
+ UseText.setText("사용");
|
|
|
|
+ NoSensor = new WpadImageView(context, TOUCH_KIND.BUTTON_M, 88, 88, R.drawable.but_check_default, R.drawable.but_check_checked, ID.SecurityMainScreen.button.CHECKBOX_NO_USE);
|
|
|
|
+ ViewRegistration(layout, NoSensor, Common.ImgPosion.GetX(881), Common.ImgPosion.GetY(495));
|
|
|
|
+ NoUseText = new WpadTextView(context, true, 148, 101, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, ID.SecurityMainScreen.text.CHECKBOX_NO_USE);
|
|
|
|
+ ViewRegistration(layout, NoUseText, Common.ImgPosion.GetX(972), Common.ImgPosion.GetY(491));
|
|
|
|
+ NoUseText.setText("사용안함");
|
|
|
|
+ DrawCheckBoxPwRelease(bReleasePwIntput);
|
|
|
|
+ // 체크박스 끝
|
|
|
|
+
|
|
|
|
+ Btn_Left01 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_left, R.drawable.but_arrow_left_p, ID.SecurityMainScreen.button.LEFT_01);
|
|
|
|
+ ViewRegistration(layout, Btn_Left01, Common.ImgPosion.GetX(641), Common.ImgPosion.GetY(618));
|
|
|
|
+ Btn_Right01 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_right, R.drawable.but_arrow_right_p, ID.SecurityMainScreen.button.RIGHT_01);
|
|
|
|
+ ViewRegistration(layout, Btn_Right01, Common.ImgPosion.GetX(968), Common.ImgPosion.GetY(618));
|
|
|
|
+ //Text_Box01 = new WpadImageView(context, TOUCH_KIND.NONE, 146, 44, R.drawable.blank_m,0, ID.SecurityMainScreen.image.TEXT_BG01);
|
|
|
|
+ //ViewRegistration(layout, Text_Box01, Common.ImgPosion.GetX(641), Common.ImgPosion.GetY(541));
|
|
|
|
+
|
|
|
|
+ Btn_Left02 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_left, R.drawable.but_arrow_left_p, ID.SecurityMainScreen.button.LEFT_02);
|
|
|
|
+ ViewRegistration(layout, Btn_Left02, Common.ImgPosion.GetX(641), Common.ImgPosion.GetY(722));
|
|
|
|
+ Btn_Right02 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_right, R.drawable.but_arrow_right_p, ID.SecurityMainScreen.button.RIGHT_02);
|
|
|
|
+ ViewRegistration(layout, Btn_Right02, Common.ImgPosion.GetX(968), Common.ImgPosion.GetY(722));
|
|
|
|
+ //Text_Box02 = new WpadImageView(context, TOUCH_KIND.NONE, 146, 44, R.drawable.blank_m,0,ID.SecurityMainScreen.image.TEXT_BG02);
|
|
|
|
+ //ViewRegistration(layout, Text_Box02, ImgPosion.GetX(708), ImgPosion.GetY(540));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ LineText01 = new WpadTextView(context, false, 525, 102, Gravity.CENTER, Color.parseColor("#966432"), Common.fontsize._36, true, ID.SecurityMainScreen.text.LINE_TEXT_01);
|
|
|
|
+ ViewRegistration(layout, LineText01, Common.ImgPosion.GetX(116), Common.ImgPosion.GetY(594));
|
|
|
|
+ LineText01.setText("외출설정 대기시간");
|
|
|
|
+
|
|
|
|
+ LineText02 = new WpadTextView(context, false, 525, 102, Gravity.CENTER, Color.parseColor("#966432"), Common.fontsize._36, true, ID.SecurityMainScreen.text.LINE_TEXT_02);
|
|
|
|
+ ViewRegistration(layout, LineText02, Common.ImgPosion.GetX(116), Common.ImgPosion.GetY(698));
|
|
|
|
+ LineText02.setText("외출복귀 대기시간");
|
|
|
|
+
|
|
|
|
+ textValue01 = new WpadTextView(context, false, 247, 102, Gravity.CENTER, Color.WHITE, Common.fontsize._36, true, ID.SecurityMainScreen.text.VALUE_TEXT_01);
|
|
|
|
+ ViewRegistration(layout, textValue01, Common.ImgPosion.GetX(721), Common.ImgPosion.GetY(594));
|
|
|
|
+ OutPrintText(textValue01, nOutWaitTime);
|
|
|
|
+
|
|
|
|
+ textValue02 = new WpadTextView(context, false, 247, 102, Gravity.CENTER, Color.WHITE, Common.fontsize._36, true, ID.SecurityMainScreen.text.VALUE_TEXT_02);
|
|
|
|
+ ViewRegistration(layout, textValue02, Common.ImgPosion.GetX(721), Common.ImgPosion.GetY(698));
|
|
|
|
+ OutPrintText(textValue02, nInWaitTime);
|
|
|
|
+
|
|
|
|
+ // 바범센서 사용안하는 그냥 외출모드 사용시
|
|
|
|
+ if (!bUseGuardSensorCheck) {
|
|
|
|
+ OutSecurityModeBtn.setButtonRearImage();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ // 현산향, 대외향
|
|
|
|
+ OutSecurityModeBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 547, 381, R.drawable.guard_btn_goout_normal, R.drawable.guard_btn_goout_pressed, ID.SecurityMainScreen.button.OUT_SECURITY);
|
|
|
|
+ ViewRegistration(layout, OutSecurityModeBtn, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(110));
|
|
|
|
+ OutSecurityModeBtn.setTouchDelayMs(500);
|
|
|
|
+
|
|
|
|
+ InSecurityModeBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 547, 381, R.drawable.guard_btn_home_normal, R.drawable.guard_btn_home_pressed, ID.SecurityMainScreen.button.IN_SECURITY);
|
|
|
|
+ ViewRegistration(layout, InSecurityModeBtn, Common.ImgPosion.GetX(640), Common.ImgPosion.GetY(110));
|
|
|
|
+ InSecurityModeBtn.setTouchDelayMs(500);
|
|
|
|
+
|
|
|
|
+ lineO1 = new WpadImageView(context, TOUCH_KIND.NONE, 1094, 2, R.drawable.control_venti_line, 0, ID.SecurityMainScreen.image.LINE01);
|
|
|
|
+ ViewRegistration(layout, lineO1, Common.ImgPosion.GetX(93), Common.ImgPosion.GetY(645));
|
|
|
|
+
|
|
|
|
+ Btn_Left01 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_left, R.drawable.but_arrow_left_p, ID.SecurityMainScreen.button.LEFT_01);
|
|
|
|
+ ViewRegistration(layout, Btn_Left01, Common.ImgPosion.GetX(641), Common.ImgPosion.GetY(541));
|
|
|
|
+ Btn_Right01 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_right, R.drawable.but_arrow_right_p, ID.SecurityMainScreen.button.RIGHT_01);
|
|
|
|
+ ViewRegistration(layout, Btn_Right01, Common.ImgPosion.GetX(968), Common.ImgPosion.GetY(541));
|
|
|
|
+ //Text_Box01 = new WpadImageView(context, TOUCH_KIND.NONE, 146, 44, R.drawable.blank_m,0, ID.SecurityMainScreen.image.TEXT_BG01);
|
|
|
|
+ //ViewRegistration(layout, Text_Box01, Common.ImgPosion.GetX(641), Common.ImgPosion.GetY(541));
|
|
|
|
+
|
|
|
|
+ Btn_Left02 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_left, R.drawable.but_arrow_left_p, ID.SecurityMainScreen.button.LEFT_02);
|
|
|
|
+ ViewRegistration(layout, Btn_Left02, Common.ImgPosion.GetX(641), Common.ImgPosion.GetY(697));
|
|
|
|
+ Btn_Right02 = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 54, R.drawable.but_arrow_right, R.drawable.but_arrow_right_p, ID.SecurityMainScreen.button.RIGHT_02);
|
|
|
|
+ ViewRegistration(layout, Btn_Right02, Common.ImgPosion.GetX(968), Common.ImgPosion.GetY(697));
|
|
|
|
+ //Text_Box02 = new WpadImageView(context, TOUCH_KIND.NONE, 146, 44, R.drawable.blank_m,0,ID.SecurityMainScreen.image.TEXT_BG02);
|
|
|
|
+ //ViewRegistration(layout, Text_Box02, ImgPosion.GetX(708), ImgPosion.GetY(540));
|
|
|
|
+
|
|
|
|
+ LineText01 = new WpadTextView(context, false, 525, 154, Gravity.CENTER, 0xFF966432, Common.fontsize._36, true, ID.SecurityMainScreen.text.LINE_TEXT_01);
|
|
|
|
+ ViewRegistration(layout, LineText01, Common.ImgPosion.GetX(116), Common.ImgPosion.GetY(491));
|
|
|
|
+ LineText01.setText("외출설정 대기시간");
|
|
|
|
+
|
|
|
|
+ LineText02 = new WpadTextView(context, false, 525, 153, Gravity.CENTER, 0xFF966432, Common.fontsize._36, true, ID.SecurityMainScreen.text.LINE_TEXT_02);
|
|
|
|
+ ViewRegistration(layout, LineText02, Common.ImgPosion.GetX(116), Common.ImgPosion.GetY(647));
|
|
|
|
+ LineText02.setText("외출복귀 대기시간");
|
|
|
|
+
|
|
|
|
+ textValue01 = new WpadTextView(context, false, 247, 154, Gravity.CENTER, Color.WHITE, Common.fontsize._36, true, ID.SecurityMainScreen.text.VALUE_TEXT_01);
|
|
|
|
+ ViewRegistration(layout, textValue01, Common.ImgPosion.GetX(721), Common.ImgPosion.GetY(491));
|
|
|
|
+ OutPrintText(textValue01, nOutWaitTime);
|
|
|
|
+
|
|
|
|
+ textValue02 = new WpadTextView(context, false, 247, 153, Gravity.CENTER, Color.WHITE, Common.fontsize._36, true, ID.SecurityMainScreen.text.VALUE_TEXT_02);
|
|
|
|
+ ViewRegistration(layout, textValue02, Common.ImgPosion.GetX(721), Common.ImgPosion.GetY(647));
|
|
|
|
+ OutPrintText(textValue02, nInWaitTime);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //disable버튼 추가
|
|
|
|
+ if (nOutWaitTime == 180){
|
|
|
|
+ Btn_Right01.setButtonEventOffEnable(R.drawable.but_arrow_right_disable);
|
|
|
|
+ }
|
|
|
|
+ else if (nOutWaitTime == 30){
|
|
|
|
+ Btn_Left01.setButtonEventOffEnable(R.drawable.but_arrow_left_disable);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Btn_Right01.setButtonEventOffDisable();
|
|
|
|
+ Btn_Left01.setButtonEventOffDisable();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (nInWaitTime == 180) {
|
|
|
|
+ Btn_Right02.setButtonEventOffEnable(R.drawable.but_arrow_right_disable);
|
|
|
|
+ }
|
|
|
|
+ else if (nInWaitTime == 30) {
|
|
|
|
+ Btn_Left02.setButtonEventOffEnable(R.drawable.but_arrow_left_disable);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Btn_Right02.setButtonEventOffDisable();
|
|
|
|
+ Btn_Left02.setButtonEventOffDisable();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Log.d(TAG, "[END - Screen] --------------------------------------------");
|
|
|
|
+ } catch (RuntimeException re) {
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e) {
|
|
|
|
+ Log.e(TAG, "[Exception] SecurityMainScreen(Context context, RelativeLayout layout, WallPadAPI wpapi, int operationMode)");
|
|
|
|
+ //e.printStackTrace();
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ protected void onClose() {
|
|
|
|
+ super.onClose();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void Close() {
|
|
|
|
+ super.Close();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void DrawCheckBoxPwRelease(boolean bUse) {
|
|
|
|
+ try {
|
|
|
|
+ if (bUse == true) {
|
|
|
|
+ UseSenser.setImageResource(UseSenser.getPressedImageID());
|
|
|
|
+ NoSensor.setImageResource(NoSensor.getDefaultImageID());
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ UseSenser.setImageResource(UseSenser.getDefaultImageID());
|
|
|
|
+ NoSensor.setImageResource(NoSensor.getPressedImageID());
|
|
|
|
+ }
|
|
|
|
+ } catch (RuntimeException re) {
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e) {
|
|
|
|
+ Log.e(TAG, "[Exception] DrawCheckBoxPwRelease(boolean bUse)");
|
|
|
|
+ //e.printStackTrace();
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private void SetOutModeWaitTime(boolean bUp) {
|
|
|
|
+ nOutWaitTime = ValueChange(nOutWaitTime, bUp);
|
|
|
|
+ OutPrintText(textValue01, nOutWaitTime);
|
|
|
|
+
|
|
|
|
+ //disable버튼 추가
|
|
|
|
+ if (nOutWaitTime == 180){
|
|
|
|
+ Btn_Right01.setButtonEventOffEnable(R.drawable.but_arrow_right_disable);
|
|
|
|
+ }
|
|
|
|
+ else if (nOutWaitTime == 30){
|
|
|
|
+ Btn_Left01.setButtonEventOffEnable(R.drawable.but_arrow_left_disable);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Btn_Right01.setButtonEventOffDisable();
|
|
|
|
+ Btn_Left01.setButtonEventOffDisable();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // DB에 변경된 패스워드를 저장하도록 한다.
|
|
|
|
+ try {
|
|
|
|
+ // DB 에서 현재 설정된 패스워드를 얻어오도록 한다.
|
|
|
|
+ WallpadStatusData wdb = new WallpadStatusData(this.getContext());
|
|
|
|
+ if (wdb != null) {
|
|
|
|
+ wdb.SetOutModeWaitTime(nOutWaitTime);
|
|
|
|
+ wdb.closeDB();
|
|
|
|
+ }
|
|
|
|
+ } catch (RuntimeException re) {
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e) {
|
|
|
|
+ Log.w(TAG, "[Exception] SetOutModeWaitTime(boolean bUp)");
|
|
|
|
+ //e.printStackTrace();
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void SetInModeWaitTime(boolean bUp) {
|
|
|
|
+ try {
|
|
|
|
+ nInWaitTime = ValueChange(nInWaitTime, bUp);
|
|
|
|
+ OutPrintText(textValue02, nInWaitTime);
|
|
|
|
+
|
|
|
|
+ //disable버튼 추가
|
|
|
|
+ if(nInWaitTime == 180){
|
|
|
|
+ Btn_Right02.setButtonEventOffEnable(R.drawable.but_arrow_right_disable);
|
|
|
|
+ }else if(nInWaitTime == 30){
|
|
|
|
+ Btn_Left02.setButtonEventOffEnable(R.drawable.but_arrow_left_disable);
|
|
|
|
+ }else{
|
|
|
|
+ Btn_Right02.setButtonEventOffDisable();
|
|
|
|
+ Btn_Left02.setButtonEventOffDisable();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // DB에 변경된 패스워드를 저장하도록 한다.
|
|
|
|
+ // DB에서 현재 설정된 패스워드를 얻어오도록 한다.
|
|
|
|
+ WallpadStatusData wdb = new WallpadStatusData(this.getContext());
|
|
|
|
+ if (wdb != null) {
|
|
|
|
+ wdb.SetComeBackWaitTime(nInWaitTime);
|
|
|
|
+ wdb.closeDB();
|
|
|
|
+ }
|
|
|
|
+ } catch (RuntimeException re) {
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e) {
|
|
|
|
+ Log.e(TAG, "[Exception] SetInModeWaitTime(boolean bUp)");
|
|
|
|
+ //e.printStackTrace();
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private int ValueChange(int nWaitTime, boolean bUp) {
|
|
|
|
+ try {
|
|
|
|
+ int retValue = nWaitTime;
|
|
|
|
+ if (bUp == true) {
|
|
|
|
+ if (nWaitTime == 30)
|
|
|
|
+ nWaitTime = 60;
|
|
|
|
+ else if (nWaitTime > 30) {
|
|
|
|
+ nWaitTime = nWaitTime + 60;
|
|
|
|
+ if (nWaitTime > 180)
|
|
|
|
+ nWaitTime = 180;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (nWaitTime == 60)
|
|
|
|
+ nWaitTime = 30;
|
|
|
|
+ else if (nWaitTime > 60)
|
|
|
|
+ nWaitTime = nWaitTime - 60;
|
|
|
|
+ }
|
|
|
|
+ retValue = nWaitTime;
|
|
|
|
+ return retValue;
|
|
|
|
+ } catch (RuntimeException re) {
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
+ return nWaitTime;
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e) {
|
|
|
|
+ Log.e(TAG, "[Exception] ValueChange(int nWaitTime, boolean bUp)");
|
|
|
|
+ //e.printStackTrace();
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
+ return nWaitTime;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void OutPrintText(WpadTextView TXTView, int nTime) {
|
|
|
|
+ try {
|
|
|
|
+ String strTime = "";
|
|
|
|
+ if (nTime == 30) strTime = "30초";
|
|
|
|
+ else if (nTime == 60) strTime = "1분";
|
|
|
|
+ else if (nTime == 120) strTime = "2분";
|
|
|
|
+ else if (nTime == 180) strTime = "3분";
|
|
|
|
+ else strTime = "30초";
|
|
|
|
+
|
|
|
|
+ TXTView.setText(strTime);
|
|
|
|
+ } catch (RuntimeException re) {
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e) {
|
|
|
|
+ Log.e(TAG, "[Exception] OutPrintText(WpadTextView TXTView, int nTime)");
|
|
|
|
+ //e.printStackTrace();
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ protected void onPopupResult(Intent intent) {
|
|
|
|
+ // TODO Auto-generated method stub
|
|
|
|
+ super.onPopupResult(intent);
|
|
|
|
+ try {
|
|
|
|
+ Log.d(TAG, "@@@@@@@@ [onPopupResult] @@@@@@@@");
|
|
|
|
+ if (intent != null) {
|
|
|
|
+ int nScreen = intent.getIntExtra("SCREEN", -1);
|
|
|
|
+ Log.d(TAG, "[onPopupResult] nScreen [" + nScreen + "]");
|
|
|
|
+ if (nScreen == ID.screen.InputPwPopupScreen) {
|
|
|
|
+ boolean bPW = intent.getBooleanExtra("INPUT_PW", false);
|
|
|
|
+ Log.d(TAG, "[onPopupResult] nScreen [" + nScreen + "]");
|
|
|
|
+ Log.d(TAG, "[onPopupResult] bPW [" + bPW + "]");
|
|
|
|
+ if (bPW == false) {
|
|
|
|
+ // 화면을 다시 로딩하여 그리도록 한다.
|
|
|
|
+ Log.d(TAG, "[onPopupResult]-------------OutSecurityWaitingPopupScreen : ");
|
|
|
|
+ //((MainActivity)(getContext())).StartPopup(ID.screen.OutSecurityWaitingPopupScreen);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else if (nScreen == ID.screen.InSecurityPopupScreen) {
|
|
|
|
+ boolean bPW = intent.getBooleanExtra("SCREEN_ALL_EXIT", false);
|
|
|
|
+ Log.d(TAG, "[onPopupResult] bPW [" + bPW + "]");
|
|
|
|
+ if (bPW == true) {
|
|
|
|
+ // 화면을 다시 로딩하여 그리도록 한다.
|
|
|
|
+ super.finish();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Log.w(TAG, "[Exception] intent is null!!");
|
|
|
|
+ }
|
|
|
|
+ } catch (RuntimeException re) {
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e) {
|
|
|
|
+ Log.e(TAG, "[Exception] onPopupResult(Intent intent)");
|
|
|
|
+ //e.printStackTrace();
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ protected void onTouchEvent(View v, MotionEvent event) {
|
|
|
|
+ super.onTouchEvent(v, event);
|
|
|
|
+ try {
|
|
|
|
+ int TargetId = v.getId();
|
|
|
|
+ int MoveEvent = event.getAction();
|
|
|
|
+
|
|
|
|
+ if (MoveEvent == MotionEvent.ACTION_DOWN) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else if (MoveEvent == MotionEvent.ACTION_UP) {
|
|
|
|
+ if (TargetId == ID.SecurityMainScreen.button.CHECKBOX_USE) {
|
|
|
|
+ if (bReleasePwIntput) return;
|
|
|
|
+
|
|
|
|
+ if (bReleasePwIntput == false) {
|
|
|
|
+ bReleasePwIntput = true;
|
|
|
|
+ DrawCheckBoxPwRelease(bReleasePwIntput);
|
|
|
|
+ WallpadStatusData wdb = new WallpadStatusData(this.getContext());
|
|
|
|
+ wdb.SetUseGuardReleasePw(bReleasePwIntput);
|
|
|
|
+ wdb.closeDB();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else if (TargetId == ID.SecurityMainScreen.button.CHECKBOX_NO_USE) {
|
|
|
|
+ if (!bReleasePwIntput) return;
|
|
|
|
+
|
|
|
|
+ if (bReleasePwIntput == true) {
|
|
|
|
+ bReleasePwIntput = false;
|
|
|
|
+ DrawCheckBoxPwRelease(bReleasePwIntput);
|
|
|
|
+ WallpadStatusData wdb = new WallpadStatusData(this.getContext());
|
|
|
|
+ wdb.SetUseGuardReleasePw(bReleasePwIntput);
|
|
|
|
+ wdb.closeDB();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
+
|
|
|
|
+ if (TargetId == ID.SecurityMainScreen.text.TITLE) {
|
|
|
|
+ DebugLogOutput("onTouchEvent - ID: " + ID.SecurityMainScreen.text.TITLE);
|
|
|
|
+ MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Log.d(TAG, "[onTouchEvent] TargetId -> " + TargetId);
|
|
|
|
+ if (TargetId == ID.SecurityMainScreen.button.OUT_SECURITY) {
|
|
|
|
+ if (OPERATION_MODE == Common.MODE_BUSINESS_SAMPLE) {
|
|
|
|
+ MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
+ Log.d(TAG, "[onTouchEvent] - OUT_SECURITY - MODE_BUSINESS_SAMPLE");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ // 방범센서 사용안하는 그냥 외출모드 사용시
|
|
|
|
+ if ((Version.getModelType() == Version.MODEL_TYPE.IHN_1020SA_A && bUseGuardSensorCheck == false) || (bSmartSwitch485 == true && bUseGuardSensorCheck == false)) {
|
|
|
|
+ // 그냥 외출모드 설정
|
|
|
|
+ // 기기제어 실행
|
|
|
|
+ WallpadStatusData wdb = new WallpadStatusData(this.getContext());
|
|
|
|
+ wdb.SetAlarmStatus(WallpadStatusData.OUT_MODE);
|
|
|
|
+ wdb.closeDB();
|
|
|
|
+ OutModeDeviceCtrl(false);
|
|
|
|
+
|
|
|
|
+ //MainActivity.mSound.Play(SND.mode.OUTMODE_SETTING);
|
|
|
|
+ int nPlayMentTime = MainActivity.mSound.PlayMent(SND.mode.OUTMODE_SETTING);
|
|
|
|
+ ((MainActivity)getContext()).sendHandlerMsgDelayed(100, 0, 0, nPlayMentTime);
|
|
|
|
+ //super.setSoundNoRelease(true);
|
|
|
|
+ //super.finish();
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ //띄우기 전에 센서 체크~~~~ 센서가 이상이 없다면 외출모드 진행 팝업을 띄우고 센서 감지 이상이 있으면
|
|
|
|
+ //센서를 점검하세요라는 팝업/사운드 띄운다.
|
|
|
|
+ boolean bSenSorCheck = OutModeCheckSensor(true);
|
|
|
|
+ // 아직 실내에 사람이 있으므로 내부동체는 체크하지 않는다.
|
|
|
|
+ if (bSenSorCheck) {
|
|
|
|
+ //MainActivity.StartPopup(ID.screen.OutSecurityWaitingPopupScreen, Common.POPUP_STYLE_ALARM);
|
|
|
|
+ ((MainActivity) (getContext())).StartPopup(ID.screen.OutSecurityWaitingPopupScreen);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ // 사운드 출력
|
|
|
|
+ MainActivity.mSound.PlayMent(SND.mode.HOME_DEVICE_CHECK);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else if (TargetId == ID.SecurityMainScreen.button.IN_SECURITY) {
|
|
|
|
+ //ChangeReservation();
|
|
|
|
+ //띄우기 전에 센서 체크~~~~ 센서가 이상이 없다면 재택설정 확인 팝업을 띄우고 센서 감지 이상이 있으면
|
|
|
|
+ //센서를 점검하세요라는 팝업을 띄운다.
|
|
|
|
+ if (OPERATION_MODE == Common.MODE_BUSINESS_SAMPLE) {
|
|
|
|
+ MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
+ Log.d(TAG, "[onTouch] - OUT_SECURITY - MODE_BUSINESS_SAMPLE");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if (Common.GetSensorSampleMode(this.getContext())) {
|
|
|
|
+ ((MainActivity) (getContext())).StartPopup(ID.screen.InSecurityPopupScreen);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if (InModeCheckSensor() == true) {
|
|
|
|
+ //MainActivity.StartPopup(ID.screen.InSecurityPopupScreen, Common.POPUP_STYLE_ALARM);
|
|
|
|
+ ((MainActivity) (getContext())).StartPopup(ID.screen.InSecurityPopupScreen);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ // 사운드 출력
|
|
|
|
+ MainActivity.mSound.PlayMent(SND.mode.HOME_DEVICE_CHECK);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else if (TargetId == ID.SecurityMainScreen.button.BED_SECURITY) {
|
|
|
|
+ if (OPERATION_MODE == Common.MODE_BUSINESS_SAMPLE) {
|
|
|
|
+ MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (Common.GetInBedCheckSensor(this.getContext())) {
|
|
|
|
+ // 센서 체크
|
|
|
|
+ if (InModeCheckSensor() == true) {
|
|
|
|
+ ((MainActivity) (getContext())).StartPopup(ID.screen.BedSecurityPopupScreen);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ MainActivity.mSound.PlayMent(SND.mode.HOME_DEVICE_CHECK);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ // 기기제어만
|
|
|
|
+ Common.BedModeDeviceCtrl(this.getContext(), true);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else if (TargetId == ID.SecurityMainScreen.button.LEFT_01) {
|
|
|
|
+ SetOutModeWaitTime(false);
|
|
|
|
+ //Sound().Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
+ }
|
|
|
|
+ else if (TargetId == ID.SecurityMainScreen.button.RIGHT_01) {
|
|
|
|
+ SetOutModeWaitTime(true);
|
|
|
|
+ //Sound().Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
+ }
|
|
|
|
+ else if (TargetId == ID.SecurityMainScreen.button.LEFT_02) {
|
|
|
|
+ SetInModeWaitTime(false);
|
|
|
|
+ //Sound().Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
+ }
|
|
|
|
+ else if (TargetId == ID.SecurityMainScreen.button.RIGHT_02) {
|
|
|
|
+ SetInModeWaitTime(true);
|
|
|
|
+ //Sound().Play(SND.effect.TOUCH_LATCHED);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } catch (RuntimeException re) {
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e) {
|
|
|
|
+ Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
|
|
|
|
+ //e.printStackTrace();
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void ViewRegistration(RelativeLayout ParentsLayout,
|
|
|
|
+ WpadImageView nImageView, int MarginLeft, int MarginTop) {
|
|
|
|
+ // TODO Auto-generated method stub
|
|
|
|
+ super.ViewRegistration(ParentsLayout, nImageView, MarginLeft, MarginTop);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void ViewRegistration(RelativeLayout ParentsLayout,
|
|
|
|
+ WpadTextView nTextView, int MarginLeft, int MarginTop) {
|
|
|
|
+ // TODO Auto-generated method stub
|
|
|
|
+ super.ViewRegistration(ParentsLayout, nTextView, MarginLeft, MarginTop);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void OutModeDeviceCtrl(boolean notElevatorCall) {
|
|
|
|
+ try {
|
|
|
|
+ Intent intent = new Intent(Common.BR_MAIN_NOTI.ACNAME_MAIN_NOTI, null);
|
|
|
|
+ intent.putExtra(Common.BR_MAIN_NOTI.KIND, Common.BR_MAIN_NOTI.OUTMODE_CTRL_WORKING);
|
|
|
|
+ if (notElevatorCall == true)
|
|
|
|
+ intent.putExtra("Called", 1);
|
|
|
|
+
|
|
|
|
+ getContext().sendBroadcast(intent);
|
|
|
|
+ } catch (RuntimeException re) {
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e) {
|
|
|
|
+ Log.d(TAG, "[Ctrl Exception]-" + e.toString());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|