package kr.co.icontrols.wallpadconfig.screen; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.database.sqlite.SQLiteDatabase; import android.graphics.Color; import android.media.AudioManager; import android.os.Handler; import android.os.Message; import android.os.PowerManager; import android.provider.Settings; import android.util.Log; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; import android.view.WindowManager; import android.widget.RelativeLayout; import com.artncore.WallPadDataMgr.WallpadDeviceSet; import com.artncore.WallPadDataMgr.WallpadStatusData; import com.artncore.commons.Sdb_DataClasses.BathRoomSensorLightClass; import com.artncore.commons.Sdb_DataClasses.EnergyControllerClass; import com.artncore.commons.Sdb_DataClasses.EnergyControllerClass.DataClass.SMARTPHONE_LIGHT_CTRL_STATUS; import com.artncore.commons.define; import com.artncore.wallpadapi.InRoomDetectSensor_API; import com.artncore.wallpadapi.IntLightAPI; import com.artncore.wallpadapi.KnxAPI; import com.artncore.wallpadapi.SdbAPI; import com.artncore.wallpadapi.SmartKeyRfDoorAPI; import com.artncore.wallpadapi.WallPadAPI; import com.util.LogUtil; import java.util.ArrayList; import java.util.List; import kr.co.icontrols.v40ioctl.V40IF; import kr.co.icontrols.wallpadconfig.MainActivity; import kr.co.icontrols.wallpadconfig.R; import kr.co.icontrols.wallpadconfig.declare.Common; import kr.co.icontrols.wallpadconfig.declare.ID; import kr.co.icontrols.wallpadconfig.declare.ID.ConfingSettingMainID; import kr.co.icontrols.wallpadconfig.declare.ID.screen; import kr.co.icontrols.wallpadsupport.Version; import kr.co.icontrols.wallpadsupport.WpadImageView; import kr.co.icontrols.wallpadsupport.WpadImageView.TOUCH_KIND; import kr.co.icontrols.wallpadsupport.WpadScreen; import kr.co.icontrols.wallpadsupport.WpadSound.SND; import kr.co.icontrols.wallpadsupport.WpadTextView; import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT; import static com.artncore.commons.Sdb_DataClasses.LEDLIGHT_USAGE_CODE.COUPLE_BATHROOM_SENSOR; import static com.artncore.commons.Sdb_DataClasses.LEDLIGHT_USAGE_CODE.SHARED_BATHROOM_SENSOR; public class ConfigSettingMainScreen extends WpadScreen { // [Define] String TAG = this.getClass().getSimpleName(); private void DebugLogOutput(String s) { if(Common.DEBUG_LOG_ON) Log.d(TAG, s); } public final int TYPE_L_R_ARROW = 0; //1,2,3,,,,선택 public final int TYPE_CHECKBOX = 1; //사용 사용안함 public final int TYPE_BUTTON = 2; //확인 public final int TYPE_SENSORLIGHT_CHECK_USE = 3; //센서등 체크 public final int TYPE_SENSORLIGHT_CHECK_NON = 4; //센서등 체크 public final int TYPE_SENSORLIGHT_BATCH_ON = 5; //일괄소등 --> 센서등 설정변경 불가 public final int TYPE_BUTTON_WEBPWD = 6; // 웹 제어 비밀번호 설정 public final int TYPE_CHECKBOX_SMARTLIGHT = 7; // 원격제어로 스마트조명 사용 여부 public final String TXT_SYSTEM_VOLUME = "시스템볼륨조절"; public final String TXT_LCD_LEVEL = "화면밝기"; public final String TXT_BTN_LEVEL = "버튼밝기"; public final String TXT_SLEEP_TIME = "절전모드작동시간"; public final String TXT_ALARM_SOUND = "알림음"; public final String TXT_CAR_SOUND = "차량도착알림음"; public final String TXT_CALL_SOUND = "호출알림음"; public final String TXT_ARS_CONTROL = "전화ARS제어"; public final String TXT_RMOTE_CONTROL = "원격제어"; public final String TXT_RMOTE_SMARTLIGHT_CONTROL = "스마트조명"; public final String TXT_AS_CALL = "AS신청"; public final String TXT_ROOM_NAME = "명칭설정"; public final String TXT_REMOCON_REG = "리모콘등록"; public final String TXT_CLOSE_SENSOR = "근접센서조절"; public final String TXT_SENSORLIGHT_SHARE = "공용욕실 센서등"; public final String TXT_SENSORLIGHT_COUPLE = "부부욕실 센서등"; public final String TXT_COUPLEBATH = "부부욕실"; public final String TXT_COUPLEBATH_FULL_NAME = "부부욕실"; public final String TXT_SHAREBATH = "공용욕실"; public final String TXT_SHAREBATH_FULL_NAME = "공용욕실"; public final String TXT_INTERLAYTER_NOISE_POPUP = "층간소음 팝업"; public final String TXT_SMARTPHONE_LIGHTCTR = "스마트조명 App"; public final String TXT_RELIEFCALL_PRESET = "안심통화 변조도설정"; public final String TXT_BAND_LOCATION = "밴드위치알림"; public final String TXT_WEB_CTR_PWD = "웹 제어 비밀번호"; public final String TXT_EASYMODE = "간편모드설정"; public final String TXT_OPEN_DELAY = "문열림대기시간 설정"; ArrayList sensorRoomIdxArr = new ArrayList(); ArrayList sensorRoomNameArr = new ArrayList(); ArrayList sensorEMnumArr = new ArrayList(); public class SetKind { public int m_Type; public int m_EventID_01; public int m_EventID_02; public int m_EventID_03; public String m_TxtTitle; public String m_TxtDetail; public int m_ViewIdx; public String m_EMname; public SetKind(int type, int nEventID_01, String strTitle) { m_Type = type; m_EventID_01 = nEventID_01; m_TxtTitle = strTitle; m_TxtDetail = null; m_EMname = ""; } public SetKind(int type, int nEventID_01, int nEventID_02, String strTitle) { m_Type = type; m_EventID_01 = nEventID_01; m_EventID_02 = nEventID_02; m_TxtTitle = strTitle; m_TxtDetail = null; m_EMname = ""; } public SetKind(String emnum, int type, int nEventID_01, int nEventID_02, String strTitle) { m_Type = type; m_EventID_01 = nEventID_01; m_EventID_02 = nEventID_02; m_TxtTitle = strTitle; m_TxtDetail = null; m_EMname = emnum; } public SetKind(int type, int nEventID_01, int nEventID_02, String strTitle, String strDetail) { m_Type = type; m_EventID_01 = nEventID_01; m_EventID_02 = nEventID_02; m_TxtTitle = strTitle; m_TxtDetail = strDetail; m_EMname = ""; } public SetKind(int type, int nEventID_01, int nEventID_02, int nEventID_03, String strTitle) { m_Type = type; m_EventID_01 = nEventID_01; m_EventID_02 = nEventID_02; m_EventID_03 = nEventID_03; m_TxtTitle = strTitle; m_TxtDetail = null; m_EMname = ""; } public void SetViewIdx(int ViewIdx) { m_ViewIdx = ViewIdx; } } public List SettingData = new ArrayList(); private int getViewIdx(String searchName) { int retIdx = -1; if (SettingData != null) { for (int i = 0; i < SettingData.size(); i++) { if (SettingData.get(i).m_TxtTitle.equals(searchName)) { retIdx = SettingData.get(i).m_ViewIdx; break; } } } return retIdx; } private int getViewIdx_EMname(String searchName) { int retIdx = -1; if (SettingData != null) { for (int i = 0; i < SettingData.size(); i++) { if (SettingData.get(i).m_EMname.equals(searchName)) { retIdx = SettingData.get(i).m_ViewIdx; break; } } } return retIdx; } // [View - ImageView(Background or Image - No touch)] WpadImageView Background, Background_1; // [View - ImageView(Button - touch)] WpadImageView [] lineBg = new WpadImageView [7]; WpadImageView [] Btn_Left = new WpadImageView[6]; WpadImageView [] Text_Box = new WpadImageView[6]; WpadImageView [] Btn_Right = new WpadImageView[6]; WpadImageView [] UseCheckBoxAgrray = new WpadImageView [6]; WpadImageView [] NotUseCheckBoxAgrray = new WpadImageView [6]; WpadTextView [] UseTextAgrray = new WpadTextView [6]; WpadTextView [] NotUseTextAgrray = new WpadTextView [6]; WpadTextView [] SensorEMnumArray = new WpadTextView [2]; WpadImageView [] Btn_Popup = new WpadImageView [6]; WpadImageView Btn_NextPage; WpadImageView Btn_PrevPage, mPageBg; WpadTextView mPageText; // [View - TextView] private WpadTextView Title; WpadTextView [] TextLineAgrray = new WpadTextView [6]; WpadTextView [] TextLineArray_detail = new WpadTextView [6]; WpadTextView [] textValue = new WpadTextView[6]; SQLiteDatabase db; private final int MAX_VOLUME_LEVEL = 15; private final int MAX_LCD_LEVEL = 4; private int [] LCD_BrightnessValue = { 50, 150, 200, 250 }; private final int MAX_BTN_LEVEL = 2; private final int MAX_SLEEP_TIME = 180; // 슬립모드 최대시간 (시간단위 : 초) private final int MIN_SLEEP_TIME = 30; // 슬립모드 최소시간 (시간단위 : 초) private final int MAX_CLOSESENSOR_LEVEL = 5; private final int MAX_OPENDELAY_LEVEL = 2; private int [] DoorLock_OpenDelayTime = { 3, 5, 10 }; private int mVolumeLevel = 1; private int mLcdLevel = 4; private int mButtonLightLevel = 1; private int mSleepModeTime = 180; // 시간단위 : 초 private int mCloseSensorLevel = 5; private boolean mAllAlarmSound = true; //private boolean mSite_DongtanLakeIPARK = false; private boolean mCarAlarmSound = true; private boolean mCallAlarmSound = true; private boolean mARSControl = true; private boolean mRemoteControl = true; private boolean mRemoteSmartLightControl = false; private boolean mSenSorLight_Share[] = {false, false}; private int mSenSorLight_Share_Count = 0; private boolean mSenSorLight_Couple[] = {false, false}; private int mSenSorLight_Couple_Count = 0; private boolean mNoisePopupUse = false; private boolean mPhoneLightCtrUse = false; private boolean mEnergyControllerComm = false; private boolean mBandLocAlarm = false; private boolean mEasyModeUse = false; private int mOpenDelayTime = 0; // index private int EmListIndex = 0; // [API] private WallPadAPI mWallPadAPI = null; private IntLightAPI mIntLightAPI = null; private SdbAPI mSdbAPI = null; private KnxAPI mKnxAPI = null; InRoomDetectSensor_API mInRoomDetectSensor_API = null; //private IntLightAPI intLightAPI = null; BathRoomSensorLightClass mBathRoomSensorLightClass = null; EnergyControllerClass mEnergyControllerClass = null; SmartKeyRfDoorAPI mSmartKeyRfDoorAPI; private int BatchStatus = -1; // [Value] public String setting_manual_str = ""; // [Class] private PowerManager pm; private PowerManager.WakeLock wl; private V40IF mV40IF = new V40IF(); public int m_CurPage = 1; public int m_ToTalPage = 0; private int nDistributionPanelType = Version.DISTRIBUTION_MODEL.NON_USE; private boolean bBathSensorUse = false; private boolean bRoomNameEditV2Usage = false; private boolean isSubWallPad = false; //subwallPad 사용 여부 (TRUE : 사용 , FASLE : 사용안함) boolean internetUse = false; boolean mNewDanjiServer = false; int nLightType = WallpadDeviceSet.REMOTECTRL_BASIC_LIGHT; boolean easyModeUse = false; private void initInfo() { try { int getSleepTime = Settings.System.getInt(this.getContext().getContentResolver(), SCREEN_OFF_TIMEOUT); Log.d(TAG, "[initInfo] getSleepTime : " + getSleepTime); mSleepModeTime = (getSleepTime/1000); if (mSleepModeTime < MIN_SLEEP_TIME) mSleepModeTime = MIN_SLEEP_TIME; int getBrightness = Settings.System.getInt(this.getContext().getContentResolver(), "screen_brightness"); WallpadDeviceSet wpddevset = new WallpadDeviceSet(this.getContext()); int noiseUse = wpddevset.Get_NoiseSensor_Use(); nDistributionPanelType = wpddevset.Get_DistributionPannelType_Info(); bBathSensorUse = wpddevset.Get_BathSensorUse(); bRoomNameEditV2Usage = wpddevset.Get_RoomNameEditUse(); isSubWallPad = wpddevset.GetSubWpdUse(); // 월패드 종류 (TRUE: Sub / FALSE: Main) internetUse = wpddevset.Get_NonInternetSupportUse(); mNewDanjiServer = wpddevset.GetNewDanjiServer(); nLightType = wpddevset.Get_RemoteCtrl_LightType(); easyModeUse = wpddevset.Get_EasyModeUX_Support(); //String[] getData = null; //getData = wpddevset.GetSettingData("site_code"); wpddevset.closeDB(); Log.i(TAG, "[initInfo] bBathSensorUse [" + bBathSensorUse + "], bRoomNameEditV2Usage [" + bRoomNameEditV2Usage + "]"); /*String SiteCode = ""; if(getData.length == 2) { SiteCode = getData[1]; } if(SiteCode.equals("31420008")) // 동탄 호수공원 아이파크 현장 - 욕실 센서등 설정 그리기 { mSite_DongtanLakeIPARK = true; }*/ for (int i = 0; i < MAX_LCD_LEVEL; i++) { if (LCD_BrightnessValue[i] == getBrightness) { mLcdLevel = i+1; } } // 추가하고 싶은 항목이 있으면 여기서 추가하도록 한다. SetKind data = new SetKind( TYPE_L_R_ARROW , ConfingSettingMainID.button.SYS_VOLUME_LEFT , ConfingSettingMainID.button.SYS_VOLUME_RIGHT , TXT_SYSTEM_VOLUME ); SettingData.add(data); setting_manual_str += "SYSTEM_VOL:" + SettingData.size() + "/"; data = new SetKind( TYPE_L_R_ARROW , ConfingSettingMainID.button.LCDLEVEL_LEFT , ConfingSettingMainID.button.LCDLEVEL_RIGHT , TXT_LCD_LEVEL ); SettingData.add(data); setting_manual_str += "LCD_BRIGHT:" + SettingData.size() + "/"; if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL) { data = new SetKind( TYPE_L_R_ARROW , ConfingSettingMainID.button.BUTTONLEVEL_LEFT , ConfingSettingMainID.button.BUTTONLEVEL_RIGHT , TXT_BTN_LEVEL ); SettingData.add(data); } if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_LX2 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF) { //TXT_CLOSE_SENSOR data = new SetKind( TYPE_L_R_ARROW , ConfingSettingMainID.button.CLOSESENSOR_LEFT , ConfingSettingMainID.button.CLOSESENSOR_RIGHT , TXT_CLOSE_SENSOR ); SettingData.add(data); setting_manual_str += "CLOSE_SENSOR:" + SettingData.size() + "/"; } data = new SetKind( TYPE_L_R_ARROW , ConfingSettingMainID.button.SLEEPTIME_LEFT , ConfingSettingMainID.button.SLEEPTIME_RIGHT , TXT_SLEEP_TIME ); SettingData.add(data); setting_manual_str += "SLEEP_TIME:" + SettingData.size() + "/"; if(!isSubWallPad) { data = new SetKind( TYPE_CHECKBOX , ConfingSettingMainID.button.ALARM_SOUND_CHECKBOX_USE , ConfingSettingMainID.button.ALARM_SOUND_CHECKBOX_NOTUSE , TXT_ALARM_SOUND ); SettingData.add(data); setting_manual_str += "NOTI_SOUND:" + SettingData.size() + "/"; //data = new SetKind(TYPE_CHECKBOX , ConfingSettingMainID.button.CAR_SOUND_CHECKBOX_USE , ConfingSettingMainID.button.CAR_SOUND_CHECKBOX_NOTUSE , TXT_CAR_SOUND); //SettingData.add(data); //setting_manual_str += "CAR_ARRIVAL_SND:" + SettingData.size() + "/"; } if (MainActivity.bRemoteCallUse) { data = new SetKind(TYPE_CHECKBOX, ConfingSettingMainID.button.CALL_SOUND_CHECKBOX_USE, ConfingSettingMainID.button.CALL_SOUND_CHECKBOX_NOTUSE, TXT_CALL_SOUND); SettingData.add(data); setting_manual_str += "CALL_NOTI_SND:" + SettingData.size() + "/"; } // V40/A40i 플랫폼부터 ARS제어 사용안함 // if (Version.getModelType() != Version.MODEL_TYPE.IHN_750 // && Version.getModelType() != Version.MODEL_TYPE.IHN_1010 && Version.getModelType() != Version.MODEL_TYPE.IHN_1010_I // && Version.getModelType() != Version.MODEL_TYPE.IHN_1030_I // && Version.getModelType() != Version.MODEL_TYPE.IHN_1040 && Version.getModelType() != Version.MODEL_TYPE.IHN_1040_I // && Version.getModelType() != Version.MODEL_TYPE.IHN_1050 && Version.getModelType() != Version.MODEL_TYPE.IHN_1050_I // && Version.getModelType() != Version.MODEL_TYPE.IHN_T1010 && Version.getModelType() != Version.MODEL_TYPE.IHN_T1010_I // && Version.getModelType() != Version.MODEL_TYPE.IHN_HS101 && Version.getModelType() != Version.MODEL_TYPE.IHN_HS101_I // && Version.getModelType() != Version.MODEL_TYPE.IHN_1050DW_I && Version.getModelType() != Version.MODEL_TYPE.IHN_1020B_I) // { // if (Version.getModelType() != Version.MODEL_TYPE.IHN_1010 && Version.getModelType() != Version.MODEL_TYPE.IHN_1010_I // && Version.getModelType() != Version.MODEL_TYPE.IHN_1030_I // && Version.getModelType() != Version.MODEL_TYPE.IHN_1040 && Version.getModelType() != Version.MODEL_TYPE.IHN_1040_I // && Version.getModelType() != Version.MODEL_TYPE.IHN_1050 && Version.getModelType() != Version.MODEL_TYPE.IHN_1050_I // && Version.getModelType() != Version.MODEL_TYPE.IHN_T1010 && Version.getModelType() != Version.MODEL_TYPE.IHN_T1010_I // && Version.getModelType() != Version.MODEL_TYPE.IHN_HS101 && Version.getModelType() != Version.MODEL_TYPE.IHN_HS101_I // && Version.getModelType() != Version.MODEL_TYPE.IHN_1050DW_I && Version.getModelType() != Version.MODEL_TYPE.IHN_1020B_I) // { // data = new SetKind(TYPE_CHECKBOX , ConfingSettingMainID.button.ARS_CONTROL_CHECKBOX_USE , ConfingSettingMainID.button.ARS_CONTROL_CHECKBOX_NOTUSE , TXT_ARS_CONTROL ); // SettingData.add(data); // setting_manual_str += "PHONE_ARS:" + SettingData.size() + "/"; // } // } if (!Version.getGatewayUsage()) { // 대외향인 경우 if (noiseUse == 1) { data = new SetKind(TYPE_CHECKBOX , ConfingSettingMainID.button.NOISE_POPUP_USE , ConfingSettingMainID.button.NOISE_POPUP_NOTUSE , TXT_INTERLAYTER_NOISE_POPUP ); SettingData.add(data); setting_manual_str += "NOISE_USE:" + SettingData.size() + "/"; } if(!isSubWallPad) { //data = new SetKind( TYPE_BUTTON , ConfingSettingMainID.button.AS_CALL , 0 , TXT_AS_CALL ); //SettingData.add(data); } //setting_manual_str += "AS_REGI:" + SettingData.size() + "/"; if (Version.getModelType() != Version.MODEL_TYPE.IHN_750 && !bRoomNameEditV2Usage && !isSubWallPad) { //data = new SetKind( TYPE_BUTTON , ConfingSettingMainID.button.NAME_SET , 0 , TXT_ROOM_NAME ); //SettingData.add(data); //setting_manual_str += "ROOMNAME_SET:" + SettingData.size() + "/"; } if (!internetUse && !isSubWallPad) { data = new SetKind(TYPE_CHECKBOX , ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_USE , ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_NOTUSE , TXT_RMOTE_CONTROL ); SettingData.add(data); setting_manual_str += "REMOTE_CTR:" + SettingData.size() + "/"; if (mNewDanjiServer) { //data = new SetKind( TYPE_BUTTON_WEBPWD , ConfingSettingMainID.button.WEB_CTR_PWD , 0 , TXT_WEB_CTR_PWD ); //SettingData.add(data); //setting_manual_str += "WEB_CTR_PWD:" + SettingData.size() + "/"; } } } else { if(!isSubWallPad) { //data = new SetKind( TYPE_BUTTON , ConfingSettingMainID.button.AS_CALL , 0 , TXT_AS_CALL ); //SettingData.add(data); //setting_manual_str += "AS_REGI:" + SettingData.size() + "/"; } if (!internetUse && !isSubWallPad) { data = new SetKind(TYPE_CHECKBOX, ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_USE, ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_NOTUSE, TXT_RMOTE_CONTROL); SettingData.add(data); setting_manual_str += "REMOTE_CTR:" + SettingData.size() + "/"; //data = new SetKind(TYPE_BUTTON_WEBPWD, ConfingSettingMainID.button.WEB_CTR_PWD, 0, TXT_WEB_CTR_PWD); //SettingData.add(data); //setting_manual_str += "WEB_CTR_PWD:" + SettingData.size() + "/"; } } if ((Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_LX2 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF) && (nDistributionPanelType == Version.DISTRIBUTION_MODEL.SMART_DIST)) { if (!internetUse) { // data = new SetKind(TYPE_CHECKBOX , ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_USE , ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_NOTUSE , TXT_RMOTE_CONTROL); // SettingData.add(data); // setting_manual_str += "REMOTE_CTR:" + SettingData.size() + "/"; // // data = new SetKind(TYPE_BUTTON_WEBPWD , ConfingSettingMainID.button.WEB_CTR_PWD , 0 , TXT_WEB_CTR_PWD); // SettingData.add(data); // setting_manual_str += "WEB_CTR_PWD:" + SettingData.size() + "/"; if (nLightType == WallpadDeviceSet.REMOTECTRL_USER_SELECT) { // 스마트조명 지원여부가 사용자선택인 경우 //data = new SetKind(TYPE_CHECKBOX_SMARTLIGHT , ConfingSettingMainID.button.REMOTE_CONTROL_LIGHT_CHECKBOX_SMART, ConfingSettingMainID.button.REMOTE_CONTROL_LIGHT_CHECKBOX_NORMAL, TXT_RMOTE_SMARTLIGHT_CONTROL); //SettingData.add(data); //setting_manual_str += "REMOTE_CTR_SMARTLIGHT:" + SettingData.size() + "/"; } } //TXT_SMARTPHONE_LIGHTCTR data = new SetKind( TYPE_CHECKBOX , ConfingSettingMainID.button.SMARTPHONE_LIGHTCTR_USE , ConfingSettingMainID.button.SMARTPHONE_LIGHTCTR_NOTUSE , TXT_SMARTPHONE_LIGHTCTR, "(BLE 전용)" ); SettingData.add(data); setting_manual_str += "SMARTLIGHT_APP:" + SettingData.size() + "/"; } if (easyModeUse) { data = new SetKind(TYPE_CHECKBOX, ConfingSettingMainID.button.EASYMODE_CHECKBOX_USE, ConfingSettingMainID.button.EASYMODE_CHECKBOX_NOTUSE, TXT_EASYMODE); SettingData.add(data); setting_manual_str += "EASYMODE_USE:" + SettingData.size() + "/"; } boolean bRemoconActive = GetRemoconActive(); if (bRemoconActive) { //data = new SetKind( TYPE_BUTTON , ConfingSettingMainID.button.REMOCON_REG , 0 , TXT_REMOCON_REG ); //SettingData.add(data); } boolean bDoorLockOpenDelay = (getDoorLockOpenDelayUse() > 0) ? true : false; if (bDoorLockOpenDelay) { data = new SetKind(TYPE_L_R_ARROW , ConfingSettingMainID.button.OPENDELAY_LEFT , ConfingSettingMainID.button.OPENDELAY_RIGHT , TXT_OPEN_DELAY); SettingData.add(data); setting_manual_str += "OPEN_DELAY:" + SettingData.size() + "/"; } m_CurPage = 1; Log.d(TAG, "List Count = " + SettingData.size()); if (SettingData.size() <= 6) { m_ToTalPage = 1; } else if (SettingData.size() > 6 && SettingData.size() <= 12) { m_ToTalPage = 2; } else if (SettingData.size() > 12 && SettingData.size() <= 18) { m_ToTalPage = 3; } //setting_manual_str += "ToTalPage:" + m_ToTalPage + "/"; } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] initInfo()"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void DrawContentsPage(int page) { int[] LeftBtnImg = {R.drawable.but_left, R.drawable.but_left_p}; int[] LeftBtnDisImg = {R.drawable.but_arrow_left_disable, R.drawable.but_arrow_left_disable}; int[] RightBtnImg = {R.drawable.but_right, R.drawable.but_right_p}; int[] RightBtnDisImg = {R.drawable.but_arrow_right_disable, R.drawable.but_arrow_right_disable}; try { for (int i = 0; i < 6; i++) { if (TextLineAgrray[i] != null) { this.getLayout().removeView(TextLineAgrray[i]); TextLineAgrray[i] = null; } if (Btn_Left[i] != null) { this.getLayout().removeView(Btn_Left[i]); Btn_Left[i] = null; } if (Text_Box[i] != null) { this.getLayout().removeView(Text_Box[i]); Text_Box[i] = null; } if (Btn_Right[i] != null) { this.getLayout().removeView(Btn_Right[i]); Btn_Right[i] = null; } if (textValue[i] != null) { this.getLayout().removeView(textValue[i]); textValue[i] = null; } if (UseCheckBoxAgrray[i] != null) { this.getLayout().removeView(UseCheckBoxAgrray[i]); UseCheckBoxAgrray[i] = null; } if (UseTextAgrray[i] != null) { this.getLayout().removeView(UseTextAgrray[i]); UseTextAgrray[i] = null; } if (NotUseCheckBoxAgrray[i] != null) { this.getLayout().removeView(NotUseCheckBoxAgrray[i]); NotUseCheckBoxAgrray[i] = null; } if (NotUseTextAgrray[i] != null) { this.getLayout().removeView(NotUseTextAgrray[i]); NotUseTextAgrray[i] = null; } if (Btn_Popup[i] != null) { this.getLayout().removeView(Btn_Popup[i]); Btn_Popup[i] = null; } } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawContentsPage(int page) 1"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } try { int arrayIdx = 0; int shareCount = 0; int coupleCount = 0; int lineIdx = 0; for (int a = 0; a < lineBg.length; a++) { if (lineBg[a].getVisibility() == View.INVISIBLE) { // 라인 다 보이도록 설정 후, 안보이는 경우에만 제거하도록 함 lineBg[a].setVisibility(View.VISIBLE); } } for (int i = (page - 1) * 6; i < page * 6 && i < SettingData.size(); i++) { TextLineAgrray[arrayIdx] = new WpadTextView(this.getContext(), false, 346, 54, Gravity.LEFT, 0xff966432, Common.fontsize._36, true, ConfingSettingMainID.text.LINE_TEXT_01); ViewRegistration(this.getLayout(), TextLineAgrray[arrayIdx], Common.ImgPosion.GetX(252), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); TextLineAgrray[arrayIdx].setText(SettingData.get(i).m_TxtTitle); if (SettingData.get(i).m_TxtDetail != null) { TextLineArray_detail[arrayIdx] = new WpadTextView(this.getContext(), false, 346, 54, Gravity.LEFT, 0xff966432, Common.fontsize._18, true, ConfingSettingMainID.text.LINE_TEXT_02); ViewRegistration(this.getLayout(), TextLineArray_detail[arrayIdx], Common.ImgPosion.GetX(252), Common.ImgPosion.GetY(161 + 90 * arrayIdx)); TextLineArray_detail[arrayIdx].setText(SettingData.get(i).m_TxtDetail); } else if (SettingData.get(i).m_TxtDetail == null) { if (TextLineArray_detail[arrayIdx] != null) { TextLineArray_detail[arrayIdx].setText(""); TextLineArray_detail[arrayIdx] = null; } } if (SettingData.get(i).m_Type == TYPE_L_R_ARROW) { Btn_Left[arrayIdx] = new WpadImageView(this.getContext(), TOUCH_KIND.BUTTON, 80, 54, LeftBtnImg, LeftBtnDisImg, SettingData.get(i).m_EventID_01); ViewRegistration(this.getLayout(), Btn_Left[arrayIdx], Common.ImgPosion.GetX(598), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); //Text_Box[arrayIdx] = new WpadImageView(this.getContext(), TOUCH_KIND.NONE, 146, 44, R.drawable.box_blank, 0, ConfingSettingMainID.image.TEXT_BG01 + arrayIdx); //ViewRegistration(this.getLayout(), Text_Box[arrayIdx], ImgPosion.GetX(661), ImgPosion.GetY(116 + 64 * arrayIdx)); Btn_Right[arrayIdx] = new WpadImageView(this.getContext(), TOUCH_KIND.BUTTON, 80, 54, RightBtnImg, RightBtnDisImg, SettingData.get(i).m_EventID_02); ViewRegistration(this.getLayout(), Btn_Right[arrayIdx], Common.ImgPosion.GetX(932), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); textValue[arrayIdx] = new WpadTextView(this.getContext(), false, 254, 54, Gravity.CENTER, Color.WHITE, Common.fontsize._36, true, ConfingSettingMainID.text.VALUE_TEXT_01 + arrayIdx); ViewRegistration(this.getLayout(), textValue[arrayIdx], Common.ImgPosion.GetX(682), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); SettingData.get(i).SetViewIdx(arrayIdx); } else if (SettingData.get(i).m_Type == TYPE_CHECKBOX) { UseCheckBoxAgrray[arrayIdx] = new WpadImageView(this.getContext(), TOUCH_KIND.BUTTON_M, 80, 80, R.drawable.but_check_default, R.drawable.but_check_checked, SettingData.get(i).m_EventID_01); ViewRegistration(this.getLayout(), UseCheckBoxAgrray[arrayIdx], Common.ImgPosion.GetX(594), Common.ImgPosion.GetY(114 + 90 * arrayIdx)); UseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 138, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, SettingData.get(i).m_EventID_01); ViewRegistration(this.getLayout(), UseTextAgrray[arrayIdx], Common.ImgPosion.GetX(682), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); UseTextAgrray[arrayIdx].setText("사용"); NotUseCheckBoxAgrray[arrayIdx] = new WpadImageView(this.getContext(), TOUCH_KIND.BUTTON_M, 80, 80, R.drawable.but_check_default, R.drawable.but_check_checked, SettingData.get(i).m_EventID_02); ViewRegistration(this.getLayout(), NotUseCheckBoxAgrray[arrayIdx], Common.ImgPosion.GetX(820), Common.ImgPosion.GetY(116 + 90 * arrayIdx)); NotUseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 138, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, SettingData.get(i).m_EventID_02); ViewRegistration(this.getLayout(), NotUseTextAgrray[arrayIdx], Common.ImgPosion.GetX(908), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); NotUseTextAgrray[arrayIdx].setText("사용안함"); SettingData.get(i).SetViewIdx(arrayIdx); } else if (SettingData.get(i).m_Type == TYPE_BUTTON) { Btn_Popup[arrayIdx] = new WpadImageView(this.getContext(), TOUCH_KIND.BUTTON, 129, 54, R.drawable.set_set1_btn_ok_normal, R.drawable.set_set1_btn_ok_pressed, SettingData.get(i).m_EventID_01); ViewRegistration(this.getLayout(), Btn_Popup[arrayIdx], Common.ImgPosion.GetX(598), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); SettingData.get(i).SetViewIdx(arrayIdx); } else if (SettingData.get(i).m_Type == TYPE_BUTTON_WEBPWD) { lineBg[lineIdx].setVisibility(View.INVISIBLE); TextLineAgrray[arrayIdx].setText(""); // 제목 안나오도록 함. Btn_Popup[arrayIdx] = new WpadImageView(this.getContext(), TOUCH_KIND.BUTTON, 450, 54, R.drawable.btn_web_pw_normal, R.drawable.btn_web_pw_pressed, SettingData.get(i).m_EventID_01); ViewRegistration(this.getLayout(), Btn_Popup[arrayIdx], Common.ImgPosion.GetX(598), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); SettingData.get(i).SetViewIdx(arrayIdx); } else if (SettingData.get(i).m_Type == TYPE_CHECKBOX_SMARTLIGHT) { lineBg[lineIdx].setVisibility(View.INVISIBLE); TextLineAgrray[arrayIdx].setText(""); // 제목 안나오도록 함. UseCheckBoxAgrray[arrayIdx] = new WpadImageView(this.getContext(), TOUCH_KIND.BUTTON_M, 80, 80, R.drawable.but_check_default, R.drawable.but_check_checked, SettingData.get(i).m_EventID_01); ViewRegistration(this.getLayout(), UseCheckBoxAgrray[arrayIdx], Common.ImgPosion.GetX(594), Common.ImgPosion.GetY(114 + 90 * arrayIdx)); UseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 138, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._30, true, SettingData.get(i).m_EventID_01); ViewRegistration(this.getLayout(), UseTextAgrray[arrayIdx], Common.ImgPosion.GetX(682), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); UseTextAgrray[arrayIdx].setText("스마트조명"); NotUseCheckBoxAgrray[arrayIdx] = new WpadImageView(this.getContext(), TOUCH_KIND.BUTTON_M, 80, 80, R.drawable.but_check_default, R.drawable.but_check_checked, SettingData.get(i).m_EventID_02); ViewRegistration(this.getLayout(), NotUseCheckBoxAgrray[arrayIdx], Common.ImgPosion.GetX(820), Common.ImgPosion.GetY(116 + 90 * arrayIdx)); NotUseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 138, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._30, true, SettingData.get(i).m_EventID_02); ViewRegistration(this.getLayout(), NotUseTextAgrray[arrayIdx], Common.ImgPosion.GetX(908), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); NotUseTextAgrray[arrayIdx].setText("일반조명"); SettingData.get(i).SetViewIdx(arrayIdx); } else if (SettingData.get(i).m_Type == TYPE_SENSORLIGHT_CHECK_USE) { if (mBathRoomSensorLightClass != null) { Log.i(TAG, "[DrawContentsPage] - TYPE_SENSORLIGHT_CHECK_USE start @@@@@@@@"); if (mBathRoomSensorLightClass.Status.length == 0) { Log.i(TAG, "[DrawContentsPage] - Sensor Light NOT INSTALL !!!"); NotUseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 150, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, SettingData.get(i).m_EventID_02); ViewRegistration(this.getLayout(), NotUseTextAgrray[arrayIdx], Common.ImgPosion.GetX(598), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); NotUseTextAgrray[arrayIdx].setText("설치 안됨"); } UseCheckBoxAgrray[arrayIdx] = new WpadImageView(this.getContext(), TOUCH_KIND.BUTTON_M, 80, 80, R.drawable.but_check_default, R.drawable.but_check_checked, SettingData.get(i).m_EventID_01); ViewRegistration(this.getLayout(), UseCheckBoxAgrray[arrayIdx], Common.ImgPosion.GetX(594), Common.ImgPosion.GetY(114 + 90 * arrayIdx)); UseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 138, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, SettingData.get(i).m_EventID_01); ViewRegistration(this.getLayout(), UseTextAgrray[arrayIdx], Common.ImgPosion.GetX(682), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); UseTextAgrray[arrayIdx].setText("사용"); NotUseCheckBoxAgrray[arrayIdx] = new WpadImageView(this.getContext(), TOUCH_KIND.BUTTON_M, 80, 80, R.drawable.but_check_default, R.drawable.but_check_checked, SettingData.get(i).m_EventID_02); ViewRegistration(this.getLayout(), NotUseCheckBoxAgrray[arrayIdx], Common.ImgPosion.GetX(820), Common.ImgPosion.GetY(116 + 90 * arrayIdx)); NotUseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 138, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, SettingData.get(i).m_EventID_02); ViewRegistration(this.getLayout(), NotUseTextAgrray[arrayIdx], Common.ImgPosion.GetX(908), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); NotUseTextAgrray[arrayIdx].setText("사용안함"); try { if (page == 2) { // R2, R4 등의 침실에너지미터 번호 나오는 배열 표기 SensorEMnumArray[EmListIndex] = new WpadTextView(this.getContext(), false, 138, 54, Gravity.LEFT, Color.GRAY, Common.fontsize._20, true, ID.ConfingSettingMainID.text.SENSORLIGHT_EM_R1 + EmListIndex); ViewRegistration(this.getLayout(), SensorEMnumArray[EmListIndex], Common.ImgPosion.GetX(1100), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); SensorEMnumArray[EmListIndex].setText(sensorEMnumArr.get(EmListIndex) ); SensorEMnumArray[EmListIndex].setVisibility(View.VISIBLE); } EmListIndex++; if (EmListIndex == 2) { EmListIndex = 0; } SettingData.get(i).SetViewIdx(arrayIdx); } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception ee) { //ee.printStackTrace(); LogUtil.errorLogInfo("", TAG, ee); } } else { Log.w(TAG, "[DrawContentsPage] - Not Using Case"); } SettingData.get(i).SetViewIdx(arrayIdx); } else if (SettingData.get(i).m_Type == TYPE_SENSORLIGHT_CHECK_NON) { if (mBathRoomSensorLightClass == null) { Log.i(TAG, "[DrawContentsPage] - Sensor Light NOT INSTALL !!!"); NotUseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 150, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, SettingData.get(i).m_EventID_02); ViewRegistration(this.getLayout(), NotUseTextAgrray[arrayIdx], Common.ImgPosion.GetX(598), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); NotUseTextAgrray[arrayIdx].setText("설치 안됨"); } else { Log.w(TAG, "[DrawContentsPage] - Not Using Case"); } SettingData.get(i).SetViewIdx(arrayIdx); } else if (SettingData.get(i).m_Type == TYPE_SENSORLIGHT_BATCH_ON) { if (BatchStatus == 0) { // 일괄소등 중인 경우, 센서등 설정변경 불가 Log.i(TAG, "[DrawContentsPage] - BatchStatus ON --> Can't change SensorLight USING"); NotUseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), false, 500, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._24, true, SettingData.get(i).m_EventID_02); ViewRegistration(this.getLayout(), NotUseTextAgrray[arrayIdx], Common.ImgPosion.GetX(598), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); NotUseTextAgrray[arrayIdx].setText("일괄소등 중에는 센서등 설정을 변경할 수 없습니다."); try { if (page == 2) { // R2, R4 등의 침실에너지미터 번호 나오는 배열 표기 SensorEMnumArray[EmListIndex] = new WpadTextView(this.getContext(), false, 138, 54, Gravity.LEFT, Color.GRAY, Common.fontsize._20, true, ID.ConfingSettingMainID.text.SENSORLIGHT_EM_R1 + EmListIndex); ViewRegistration(this.getLayout(), SensorEMnumArray[EmListIndex], Common.ImgPosion.GetX(1100), Common.ImgPosion.GetY(131 + 90 * arrayIdx)); SensorEMnumArray[EmListIndex].setText(sensorEMnumArr.get(EmListIndex) ); SensorEMnumArray[EmListIndex].setVisibility(View.VISIBLE); } EmListIndex++; if(EmListIndex == 2) { EmListIndex = 0; } SettingData.get(i).SetViewIdx(arrayIdx); } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception ee) { //ee.printStackTrace(); LogUtil.errorLogInfo("", TAG, ee); } } else { Log.w(TAG, "[DrawContentsPage] - Not Using Case"); } SettingData.get(i).SetViewIdx(arrayIdx); } ////////////////////////////////////////////////////////////////////// if (SettingData.get(i).m_TxtTitle.equals(TXT_SYSTEM_VOLUME)) { DrawVolumeLevel(mVolumeLevel); } if (SettingData.get(i).m_TxtTitle.equals(TXT_LCD_LEVEL)) { DrawLcdLevel(mLcdLevel); } if (SettingData.get(i).m_TxtTitle.equals(TXT_BTN_LEVEL)) { DrawButtonLightLevel(mButtonLightLevel); } if (SettingData.get(i).m_TxtTitle.equals(TXT_SLEEP_TIME)) { DrawSleepTime(mSleepModeTime); } if (SettingData.get(i).m_TxtTitle.equals(TXT_ALARM_SOUND)) { DrawAlramSound(mAllAlarmSound); } if (SettingData.get(i).m_TxtTitle.equals(TXT_CAR_SOUND)) { DrawCarAlarmSound(mCarAlarmSound); } if (SettingData.get(i).m_TxtTitle.equals(TXT_CALL_SOUND)) { DrawCallAlarmSound(mCallAlarmSound); } if (SettingData.get(i).m_TxtTitle.equals(TXT_BAND_LOCATION)) { DrawBandLocAlarm(mBandLocAlarm); } if (SettingData.get(i).m_TxtTitle.equals(TXT_INTERLAYTER_NOISE_POPUP)) { DrawNoisePopupUse(mNoisePopupUse); } if (SettingData.get(i).m_TxtTitle.equals(TXT_ARS_CONTROL)) { DrawARSControl(mARSControl); } if (SettingData.get(i).m_TxtTitle.equals(TXT_RMOTE_CONTROL)) { DrawRemoteControl(mRemoteControl); } if (SettingData.get(i).m_TxtTitle.equals(TXT_RMOTE_SMARTLIGHT_CONTROL)) { DrawRemoteSmartLightControl(mRemoteSmartLightControl); } if (SettingData.get(i).m_TxtTitle.equals(TXT_CLOSE_SENSOR)) { DrawCloseSensorLevel(mCloseSensorLevel); } if (SettingData.get(i).m_TxtTitle.equals(TXT_SMARTPHONE_LIGHTCTR)) { DrawPhoneLightCtrUse(mPhoneLightCtrUse); } if (bBathSensorUse) { if (SettingData.get(i).m_TxtTitle.contains(TXT_SHAREBATH)) { DrawSensorLight_Share(mSenSorLight_Share[shareCount], SettingData.get(i).m_TxtTitle, SettingData.get(i).m_EMname); // 몇번째인지도 추가해서 보내기? shareCount++; } if (SettingData.get(i).m_TxtTitle.contains(TXT_COUPLEBATH)) { DrawSensorLight_Couple(mSenSorLight_Couple[coupleCount], SettingData.get(i).m_TxtTitle, SettingData.get(i).m_EMname); coupleCount++; } } if (SettingData.get(i).m_TxtTitle.equals(TXT_EASYMODE)) { DrawEasyMode(mEasyModeUse, false); } if (SettingData.get(i).m_TxtTitle.equals(TXT_OPEN_DELAY)) { DrawDoorLockOpenDelay(mOpenDelayTime); } lineIdx++; arrayIdx++; } if (mPageText != null) { mPageText.setText(page + "/"+m_ToTalPage); } if (page != 2) { if (SensorEMnumArray[0] != null) { SensorEMnumArray[0].setVisibility(View.INVISIBLE); SensorEMnumArray[0].setText(""); } if (SensorEMnumArray[1] != null) { SensorEMnumArray[1].setVisibility(View.INVISIBLE); SensorEMnumArray[1].setText(""); } for (int a = 0; a < TextLineArray_detail.length; a++) { if (TextLineArray_detail[a] != null) { TextLineArray_detail[a].setText(""); TextLineArray_detail[a] = null; } } } //page 버튼 disable if (SettingData.size() > 6) { if (page == m_ToTalPage) { Btn_NextPage.setButtonEventOffEnable(R.drawable.add_notice_btn_down_disable); Btn_PrevPage.setButtonEventOffDisable(); } else if (page == 1) { Btn_PrevPage.setButtonEventOffEnable(R.drawable.add_notice_btn_up_disable); Btn_NextPage.setButtonEventOffDisable(); } else if (page > 1 && page < m_ToTalPage) { Btn_PrevPage.setButtonEventOffDisable(); Btn_NextPage.setButtonEventOffDisable(); } } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawContentsPage(int page) 2"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } public String GetSensorLightName(byte index) { String retStr = ""; if(index == COUPLE_BATHROOM_SENSOR) {retStr = "부부욕실";} else if(index == SHARED_BATHROOM_SENSOR) {retStr = "공용욕실";} return retStr; } public ConfigSettingMainScreen(Context context, RelativeLayout layout, WallPadAPI wpapi, int operationMode) { super(context, layout); Log.d(TAG, "[START - Screen] --------------------------------------------"); mWallPadAPI = wpapi; GetDBConfigInitValue(); initInfo(); if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL) { mIntLightCheckHandler.sendEmptyMessage(0); } else if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_LX2 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF) { mSensorLightCheckHandler.sendEmptyMessage(0); } Background = new WpadImageView(context, TOUCH_KIND.NONE, 1280, 690, R.drawable.bg_body, 0, ID.ConfingSettingMainID.image.BACKGROUND); ViewRegistration(layout, Background, Common.ImgPosion.GetX(0), Common.ImgPosion.GetY(110)); /*Background_1 = new WpadImageView(context, TOUCH_KIND.NONE, 996, 542, R.drawable.add_notice_bgr, 0, ConfingSettingMainID.image.BACKGROUND); ViewRegistration(layout, Background_1, Common.ImgPosion.GetX(142), Common.ImgPosion.GetY(112));*/ //add_notice_bgr에 line 포함됨. for (int i = 0; i < 7; i++) { lineBg[i] = new WpadImageView(context, TOUCH_KIND.NONE, 996, 2, R.drawable.bg_setting_lines, 0, ConfingSettingMainID.image.LINE01); ViewRegistration(layout, lineBg[i], Common.ImgPosion.GetX(142), Common.ImgPosion.GetY(112 + 90*i)); } if (SettingData.size() > 6) { Btn_PrevPage = new WpadImageView(context, TOUCH_KIND.BUTTON, 110, 110, R.drawable.add_notice_btn_up_normal, R.drawable.add_notice_btn_up_pressed, ConfingSettingMainID.button.PREV_PAGE); ViewRegistration(layout, Btn_PrevPage, Common.ImgPosion.GetX(398), Common.ImgPosion.GetY(670)); Btn_NextPage = new WpadImageView(context, TOUCH_KIND.BUTTON, 110, 110, R.drawable.add_notice_btn_down_normal, R.drawable.add_notice_btn_down_pressed, ConfingSettingMainID.button.NEXT_PAGE); ViewRegistration(layout, Btn_NextPage, Common.ImgPosion.GetX(772), Common.ImgPosion.GetY(670)); //mPageBg = new WpadImageView(context, TOUCH_KIND.NONE, 112, 62, R.drawable.add_notice_btn_page_normal, 0, ConfingSettingMainID.image.BACKGROUND); //ViewRegistration(layout, mPageBg, ImgPosion.GetX(557), ImgPosion.GetY(538)); mPageText = new WpadTextView(context, false, 264, 110, Gravity.CENTER, Color.WHITE, Common.fontsize._36, false, ConfingSettingMainID.text.LINE_TEXT_01); ViewRegistration(layout, mPageText, Common.ImgPosion.GetX(508), Common.ImgPosion.GetY(670)); } DrawContentsPage(1); Log.d(TAG, "[END - Screen] --------------------------------------------"); } /** * (임시코드) m_IntLightCtrl 초기생성시 Connect 에 시간이 걸리며,
* m_IntLightCtrl 초기화후 바로 Get_IntLightController 등을 사용하여 API 를 가져올수 없기에,
* 본 딜레이 코드를 임시로 적용한다. */ @SuppressLint("HandlerLeak") protected Handler mIntLightCheckHandler = new Handler() { @SuppressLint("HandlerLeak") @Override public void handleMessage(Message msg) { if (msg.what == 0) { if (mWallPadAPI != null) { if (mWallPadAPI.Check_Connect()) { mIntLightAPI = mWallPadAPI.Get_IntLightController(); if (mIntLightAPI != null) { Log.i(TAG, "[mIntLightCheckHandler] mIntLightAPI is not null!!"); mIntLightCheckHandler.sendEmptyMessageDelayed(1, 10); } else { Log.w(TAG, "[mIntLightCheckHandler] mIntLightAPI is null!!"); mIntLightCheckHandler.sendEmptyMessageDelayed(0, 10); } } else { Log.w(TAG, "[mIntLightCheckHandler] mWallPadAPI.Check_Connect() fail!!"); mIntLightCheckHandler.sendEmptyMessageDelayed(0, 10); } } } else if (msg.what == 1) { // String BR_NAME = ID.IcMainID.BR_LIGHT; // m_IntLightCtrl.regChangedBR(BR_NAME); // m_Delegate.addBrActionName(BR_NAME); } } }; @SuppressLint("HandlerLeak") protected Handler mSensorLightCheckHandler = new Handler() { @SuppressLint("HandlerLeak") @Override public void handleMessage(Message msg) { if (msg.what == 0) { try { if (mWallPadAPI != null) { if (mWallPadAPI.Check_Connect()) { mSdbAPI = mWallPadAPI.Get_SdbController(); mSmartKeyRfDoorAPI = mWallPadAPI.Get_SmartKeyRfDoorController(); mInRoomDetectSensor_API = mWallPadAPI.Get_InRoomDetectSensor_API(); mKnxAPI = mWallPadAPI.Get_KnxController(); if (mSdbAPI != null) { // BLE 조명 제어 앱 사용여부 확인 if (mSdbAPI.Refresh(SdbAPI.DEVICE_INDEX.ENERGY_CONT, (byte)0x00) >= 0) { mEnergyControllerClass = mSdbAPI.data.EnergyController; if (mEnergyControllerClass.Data.SmartPhoneLightControl == SMARTPHONE_LIGHT_CTRL_STATUS.NO_INFO) { Log.w(TAG, "[mSensorLightCheckHandler] EnergyController disconnected -> CommunicatedSmartPhoneLightControl : NO_INFO"); mEnergyControllerComm = false; } else if (mEnergyControllerClass.Data.SmartPhoneLightControl == SMARTPHONE_LIGHT_CTRL_STATUS.CLR) { Log.i(TAG, "[mSensorLightCheckHandler] SmartPhoneLightControl : CLR (NOT USE)"); mEnergyControllerComm = true; mPhoneLightCtrUse = false; } else if (mEnergyControllerClass.Data.SmartPhoneLightControl == SMARTPHONE_LIGHT_CTRL_STATUS.SET) { Log.i(TAG, "[mSensorLightCheckHandler] SmartPhoneLightControl : SET (USE)"); mEnergyControllerComm = true; mPhoneLightCtrUse = true; } } else { Log.w(TAG, "[mSensorLightCheckHandler] mSdbAPI.Refresh(SdbAPI.DEVICE_INDEX.ENERGY_CONT, (byte)0x00) failed!!"); } BatchStatus = mWallPadAPI.GetBatchSwitchStatus(); Log.i(TAG, "[mSensorLightCheckHandler] BatchStatus : " + BatchStatus); if (bBathSensorUse) { try { mBathRoomSensorLightClass = mSdbAPI.Get_BathRoomSensorLight(); if (mBathRoomSensorLightClass != null) { Log.i(TAG, "[mSensorLightCheckHandler] mBathRoomSensorLightClass.Count : " + mBathRoomSensorLightClass.Count); for (int i = 0; i < mBathRoomSensorLightClass.Status.length; i++) { Log.i(TAG, "[mSensorLightCheckHandler] mBathRoomSensorLightClass.EnergyIndex : " + mBathRoomSensorLightClass.Status[i].EnergyIndex); Log.i(TAG, "[mSensorLightCheckHandler] mBathRoomSensorLightClass.Usage : " + mBathRoomSensorLightClass.Status[i].Usage); Log.i(TAG, "[mSensorLightCheckHandler] mBathRoomSensorLightClass.UseOnOff : " + mBathRoomSensorLightClass.Status[i].UseOnOff); byte type = mBathRoomSensorLightClass.Status[i].Usage; if (type == COUPLE_BATHROOM_SENSOR) { mSenSorLight_Couple[mSenSorLight_Couple_Count] = mBathRoomSensorLightClass.Status[i].UseOnOff; sensorRoomNameArr.add(GetSensorLightName(type) + " 센서등"); sensorRoomIdxArr.add(mBathRoomSensorLightClass.Status[i].EnergyIndex+1); sensorEMnumArr.add("R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1) + ""); //SensorEMnumArray[i].setText("(R" + (bathRoomSensor.Status[i].EnergyIndex+1) + ")"); if (BatchStatus == 0) { // 일괄소등 중 SetKind data = new SetKind( "R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1), TYPE_SENSORLIGHT_BATCH_ON, ConfingSettingMainID.button.SENSORLIGHT_COUPLE_USE1 + i, ConfingSettingMainID.button.SENSORLIGHT_COUPLE_NOTUSE1 + i, GetSensorLightName(type) + " 센서등"); SettingData.add(data); Log.i(TAG, "부부욕실 센서등 추가 : R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1) + " : " + mSenSorLight_Couple[mSenSorLight_Couple_Count]); mSenSorLight_Couple_Count++; setting_manual_str += "COUPLESENSOR"+mSenSorLight_Couple_Count + ":" + SettingData.size() + "/"; } else { SetKind data = new SetKind( "R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1), TYPE_SENSORLIGHT_CHECK_USE, ConfingSettingMainID.button.SENSORLIGHT_COUPLE_USE1 + i, ConfingSettingMainID.button.SENSORLIGHT_COUPLE_NOTUSE1 + i, GetSensorLightName(type) + " 센서등"); SettingData.add(data); Log.i(TAG, "부부욕실 센서등 추가 : R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1) + " : " + mSenSorLight_Couple[mSenSorLight_Couple_Count]); mSenSorLight_Couple_Count++; setting_manual_str += "COUPLESENSOR"+mSenSorLight_Couple_Count + ":" + SettingData.size() + "/"; } } else if (type == SHARED_BATHROOM_SENSOR ) { mSenSorLight_Share[mSenSorLight_Share_Count] = mBathRoomSensorLightClass.Status[i].UseOnOff; sensorRoomNameArr.add(GetSensorLightName(type) + " 센서등"); sensorRoomIdxArr.add(mBathRoomSensorLightClass.Status[i].EnergyIndex+1); sensorEMnumArr.add("R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1) + ""); //SensorEMnumArray[i].setText("(R" + (bathRoomSensor.Status[i].EnergyIndex+1) + ")"); if (BatchStatus == 0) { // 일괄소등 중 SetKind data = new SetKind( "R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1), TYPE_SENSORLIGHT_BATCH_ON, ConfingSettingMainID.button.SENSORLIGHT_SHARE_USE1 + i, ConfingSettingMainID.button.SENSORLIGHT_SHARE_NOTUSE1 + i, GetSensorLightName(type) + " 센서등"); SettingData.add(data); Log.i(TAG, "공용욕실 센서등 추가 : R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1) + " : " + mSenSorLight_Share[mSenSorLight_Share_Count]); mSenSorLight_Share_Count++; setting_manual_str += "SHARESENSOR"+mSenSorLight_Couple_Count + ":" + SettingData.size() + "/"; } else { SetKind data = new SetKind( "R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1), TYPE_SENSORLIGHT_CHECK_USE, ConfingSettingMainID.button.SENSORLIGHT_SHARE_USE1 + i, ConfingSettingMainID.button.SENSORLIGHT_SHARE_NOTUSE1 + i, GetSensorLightName(type) + " 센서등"); SettingData.add(data); Log.i(TAG, "공용욕실 센서등 추가 : R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1) + " : " + mSenSorLight_Share[mSenSorLight_Share_Count]); mSenSorLight_Share_Count++; setting_manual_str += "SHARESENSOR"+mSenSorLight_Couple_Count + ":" + SettingData.size() + "/"; } } } for (int j = 0; j < sensorEMnumArr.size(); j++) { Log.i(TAG, "EM Room Nums : " + sensorEMnumArr.get(j)); } } else { Log.w(TAG, "[mSensorLightCheckHandler] mBathRoomSensorLightClass is null!!"); if (nDistributionPanelType == Version.DISTRIBUTION_MODEL.SMART_DIST) { Log.i(TAG, "BATH SENSOR ADD ~~~~~~~"); SetKind data = new SetKind(TYPE_SENSORLIGHT_CHECK_NON , ConfingSettingMainID.button.SENSORLIGHT_SHARE_NOTUSE1, "센서등"); SettingData.add(data); setting_manual_str += "SENSOR_LIGHT:" + SettingData.size() + "/"; } else { Log.i(TAG, "Don't BATH NON ADD ~~~~~~~"); } } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } else { Log.w(TAG, "[mSensorLightCheckHandler] bBathSensorUse [" + bBathSensorUse + "]"); } mSensorLightCheckHandler.sendEmptyMessageDelayed(1, 10); } else { Log.w(TAG, "[mSensorLightCheckHandler] mSdbAPI is null!!"); mSensorLightCheckHandler.sendEmptyMessageDelayed(0, 10); } } else { Log.w(TAG, "[mSensorLightCheckHandler] mWallPadAPI.Check_Connect() is false!!"); mSensorLightCheckHandler.sendEmptyMessageDelayed(0, 10); } } else { Log.w(TAG, "[mSensorLightCheckHandler] mWallPadAPI is null!!"); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } else if (msg.what == 1) { try { if (mSdbAPI.Refresh(SdbAPI.DEVICE_INDEX.ENERGY_CONT, (byte)0x00) >= 0) { mEnergyControllerClass = mSdbAPI.data.EnergyController; if (mEnergyControllerClass.Data.SmartPhoneLightControl == SMARTPHONE_LIGHT_CTRL_STATUS.NO_INFO) { Log.w(TAG, "[D101 Handler]2 - SmartPhoneLightControl : NO_INFO"); Log.w(TAG, "[D101 Handler]2 - EnergyController Not Communicated"); mEnergyControllerComm = false; } else if (mEnergyControllerClass.Data.SmartPhoneLightControl == SMARTPHONE_LIGHT_CTRL_STATUS.CLR) { Log.i(TAG, "[D101 Handler]2 - SmartPhoneLightControl : CLR (NOT USE)"); mEnergyControllerComm = true; mPhoneLightCtrUse = false; } else if (mEnergyControllerClass.Data.SmartPhoneLightControl == SMARTPHONE_LIGHT_CTRL_STATUS.SET) { Log.i(TAG, "[D101 Handler]2 - SmartPhoneLightControl : SET (USE ~~~)"); mEnergyControllerComm = true; mPhoneLightCtrUse = true; } } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception ex) { //ex.printStackTrace(); LogUtil.errorLogInfo("", TAG,ex); } // SetKind data = new SetKind(TYPE_BUTTON , ConfingSettingMainID.button.AS_CALL , 0 , TXT_AS_CALL ); // SettingData.add(data); // setting_manual_str += "AS_REGI:" + SettingData.size() + "/"; SetKind data; if (Version.getModelType() != Version.MODEL_TYPE.IHN_750 && bRoomNameEditV2Usage && !isSubWallPad) { //data = new SetKind( TYPE_BUTTON , ConfingSettingMainID.button.NAME_SET , 0 , TXT_ROOM_NAME ); //SettingData.add(data); //setting_manual_str += "ROOMNAME_SET:" + SettingData.size() + "/"; } /** JEFF, 2020.01.01 * 스마트현관카메라의 음성품질 저하로 인해 안심통화 단계를 1, 2, 3, 4단계중 1, 2 단계만 사용가능하도록 함 * 1, 2 단계 고정이므로 preset기능은 비활성화 한다. */ // if (((MainActivity) getContext()).getReliefCallUse()) { // data = new SetKind(TYPE_BUTTON, ConfingSettingMainID.button.RELIEFCALL_PRESET, 0, TXT_RELIEFCALL_PRESET); // SettingData.add(data); // setting_manual_str += "RELIEFCALL_USE:" + SettingData.size() + "/"; // } WallpadDeviceSet wallpadDeviceSet = new WallpadDeviceSet(getContext()); int bandLocUse = wallpadDeviceSet.GetDeviceSetted("밴드위치확인"); if (bandLocUse == WallpadDeviceSet.DEV_DATA_ENABLE) { data = new SetKind(TYPE_CHECKBOX, ConfingSettingMainID.button.BAND_LOCATION_ALARM_CHECKBOX_USE, ConfingSettingMainID.button.BAND_LOCATION_ALARM_CHECKBOX_NOTUSE, TXT_BAND_LOCATION); SettingData.add(data); setting_manual_str += "BAND_LOCATION_ALARM:" + SettingData.size() + "/"; } if (SettingData.size() <= 6) { m_ToTalPage = 1; } else if (SettingData.size() > 6 && SettingData.size() <= 12) { m_ToTalPage = 2; } else if (SettingData.size() > 12 && SettingData.size() <= 18) { m_ToTalPage = 3; } if (mPageText != null) { mPageText.setText(m_CurPage + "/"+m_ToTalPage); } DrawContentsPage(m_CurPage); } else if (msg.what == 2) { } } }; @Override protected void onClose() { try { mSensorLightCheckHandler.removeMessages(0); } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception ee) { //ee.printStackTrace(); LogUtil.errorLogInfo("", TAG, ee); } super.onClose(); /*if(intLightAPI != null) { intLightAPI.unregChangedBR("ConfigSetting"); }*/ } @Override public void Close() { super.Close(); } @Override protected void onTouchEvent(View v, MotionEvent event) { super.onTouchEvent(v, event); int TargetId = v.getId(); int MoveEvent = event.getAction(); if (MoveEvent == MotionEvent.ACTION_DOWN) { } else if (MoveEvent == MotionEvent.ACTION_UP) { boolean bSaveData = false; if (TargetId == ID.ConfingSettingMainID.text.TITLE) { DebugLogOutput("onTouchEvent - ID: " + ID.ConfingSettingMainID.text.TITLE); Sound().Play(SND.effect.TOUCH_LATCHED); //Popup Test ((MainActivity)(getContext())).StartPopup(screen.AsCallPopupScreen); //((MainActivity)(getContext())).StartPopup(screen.PopupNameSet); } if (TargetId == ConfingSettingMainID.button.ALARM_SOUND_CHECKBOX_USE) { ChangeAlramSound(true); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.ALARM_SOUND_CHECKBOX_NOTUSE) { ChangeAlramSound(false); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.CAR_SOUND_CHECKBOX_USE) { ChangeCarAlramSound(true); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.CAR_SOUND_CHECKBOX_NOTUSE) { ChangeCarAlramSound(false); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.CALL_SOUND_CHECKBOX_USE) { ChangeCallAlarmSound(true); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.CALL_SOUND_CHECKBOX_NOTUSE) { ChangeCallAlarmSound(false); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.BAND_LOCATION_ALARM_CHECKBOX_USE) { ChangeBandLocAlramSound(true); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.BAND_LOCATION_ALARM_CHECKBOX_NOTUSE) { ChangeBandLocAlramSound(false); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.ARS_CONTROL_CHECKBOX_USE) { ChangeARSControl(true); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.ARS_CONTROL_CHECKBOX_NOTUSE) { ChangeARSControl(false); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.NOISE_POPUP_USE) { ChangeNoisePopupUse(true); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.NOISE_POPUP_NOTUSE) { ChangeNoisePopupUse(false); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_USE ) { ChangeRemoteControl(true); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_NOTUSE) { ChangeRemoteControl(false); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.REMOTE_CONTROL_LIGHT_CHECKBOX_SMART) { ((MainActivity)(getContext())).StartPopup(screen.PopupRemoteCtrlSmartlight); } else if (TargetId == ConfingSettingMainID.button.REMOTE_CONTROL_LIGHT_CHECKBOX_NORMAL) { ChangeRemoteSmartLightControl(false); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.NEXT_PAGE) { if (m_CurPage == 1) { Sound().Play(SND.effect.TOUCH_LATCHED); m_CurPage = 2; DrawContentsPage(m_CurPage); } else if (m_CurPage == 2) { Sound().Play(SND.effect.TOUCH_LATCHED); m_CurPage = 3; DrawContentsPage(m_CurPage); } } else if (TargetId == ConfingSettingMainID.button.PREV_PAGE) { if (m_CurPage == 2) { Sound().Play(SND.effect.TOUCH_LATCHED); m_CurPage = 1; DrawContentsPage(m_CurPage); } else if (m_CurPage == 3) { Sound().Play(SND.effect.TOUCH_LATCHED); m_CurPage = 2; DrawContentsPage(m_CurPage); } } else if (TargetId == ConfingSettingMainID.button.AS_CALL) { Log.d(TAG, "onTouchEvent [AS_CALL] BUTTON !!!"); Sound().Play(SND.effect.TOUCH_LATCHED); ((MainActivity)(getContext())).StartPopup(ID.screen.AsCallPopupScreen); } else if (TargetId == ConfingSettingMainID.button.RELIEFCALL_PRESET) { Log.d(TAG, "onTouchEvent [RELIEFCALL_PRESET] BUTTON !!!"); Sound().Play(SND.effect.TOUCH_LATCHED); ((MainActivity)(getContext())).StartPopup(screen.PopupReliefCallPreset); } else if (TargetId == ConfingSettingMainID.button.REMOCON_REG) { Log.d(TAG, "onTouchEvent [REMOCON_REG] BUTTON !!!"); Sound().Play(SND.effect.TOUCH_LATCHED); ((MainActivity)(getContext())).StartPopup(ID.screen.RegRemoconPopupScreen); } else if (TargetId == ConfingSettingMainID.button.NAME_SET) { Log.d(TAG, "onTouchEvent [NAME_SET] BUTTON !!!"); Sound().Play(SND.effect.TOUCH_LATCHED); ((MainActivity)(getContext())).StartPopup(ID.screen.PopupNameSet); } else if (TargetId == ConfingSettingMainID.button.WEB_CTR_PWD) { Log.d(TAG, "onTouchEvent [WEB_CTR_PWD] BUTTON !!!"); Sound().Play(SND.effect.TOUCH_LATCHED); ((MainActivity)(getContext())).StartPopup(ID.screen.PopupWebCtrPwd); } else if (TargetId == ConfingSettingMainID.button.EASYMODE_CHECKBOX_USE) { if (mEasyModeUse) return; Sound().Play(SND.effect.TOUCH_LATCHED); Intent data = new Intent(); data.putExtra("UX_TYPE", !mEasyModeUse); // Log.d(TAG, "[onTouchEvent] mEasyModeUse [" + mEasyModeUse + "]"); ((MainActivity)(getContext())).StartPopup(screen.PopupNoticeReboot, data); // 재부팅 알림 팝업 (확인 선택시에만 DB 저장) } else if (TargetId == ConfingSettingMainID.button.EASYMODE_CHECKBOX_NOTUSE) { if (!mEasyModeUse) return; Sound().Play(SND.effect.TOUCH_LATCHED); Intent data = new Intent(); data.putExtra("UX_TYPE", !mEasyModeUse); // Log.d(TAG, "[onTouchEvent] mEasyModeUse [" + mEasyModeUse + "]"); ((MainActivity)(getContext())).StartPopup(screen.PopupNoticeReboot, data); // 재부팅 알림 팝업 (확인 선택시에만 DB 저장) } else if (TargetId == ConfingSettingMainID.button.SYS_VOLUME_LEFT) { ChangeVolumeLevel(false); //intLightAPI.LightControl((byte)01, false); /*if(inRoomDetectSensor_api.SetEachSensorSetting((byte)0, (byte)3, (byte)1, (byte)1, true) >= 0) { Log.i(TAG, "SetEachSensorSetting OK - 0/3/10/1/T"); } else { Log.i(TAG, "SetEachSensorSetting NO - 0/3/10/1/T"); }*/ } else if (TargetId == ConfingSettingMainID.button.SYS_VOLUME_RIGHT) { ChangeVolumeLevel(true); //intLightAPI.LightControl((byte)01, true); /*if(inRoomDetectSensor_api.SetEachSensorSetting((byte)1, (byte)3, (byte)1, (byte)1, true) >= 0) { Log.i(TAG, "SetEachSensorSetting OK - 1/3/8/1/T"); } else { Log.i(TAG, "SetEachSensorSetting NO - 1/3/8/1/T"); }*/ } else if (TargetId == ConfingSettingMainID.button.LCDLEVEL_LEFT) { ChangeLcdLevel(false); /*int ret = m_KnxAPI.AllLightOnOff( true ); if(ret >= 0) { Sound().Play(SND.setting.SETTING); } else { Sound().Play(SND.effect.TOUCH_UNLATCHED); }*/ } else if (TargetId == ConfingSettingMainID.button.LCDLEVEL_RIGHT) { ChangeLcdLevel(true); /*int ret = m_KnxAPI.AllLightOnOff( false ); if(ret >= 0) { Sound().Play(SND.setting.SETTING); } else { Sound().Play(SND.effect.TOUCH_UNLATCHED); }*/ } else if (TargetId == ConfingSettingMainID.button.BUTTONLEVEL_LEFT) { ChangeButtonLightLevel(false); } else if (TargetId == ConfingSettingMainID.button.BUTTONLEVEL_RIGHT) { ChangeButtonLightLevel(true); } else if (TargetId == ConfingSettingMainID.button.SLEEPTIME_LEFT) { ChangeSleepTime(false); //v40IOInterface.DoControl(v40IOInterface.IOCTL_EMR_TYPE, 0); } else if (TargetId == ConfingSettingMainID.button.SLEEPTIME_RIGHT) { ChangeSleepTime(true); //v40IOInterface.DoControl(v40IOInterface.IOCTL_EMR_TYPE, 1); } else if (TargetId == ConfingSettingMainID.button.CLOSESENSOR_LEFT) { ChangeCloseSensorLevel(false); //v40IOInterface.DoControl(v40IOInterface.IOCTL_LEDNEMR_ONOFF, 0); } else if (TargetId == ConfingSettingMainID.button.CLOSESENSOR_RIGHT) { ChangeCloseSensorLevel(true); //v40IOInterface.DoControl(v40IOInterface.IOCTL_LEDNEMR_ONOFF, 1); } else if (TargetId == ConfingSettingMainID.button.SMARTPHONE_LIGHTCTR_USE) { ChangePhoneAppCtr(true); bSaveData = true; } else if (TargetId == ConfingSettingMainID.button.SMARTPHONE_LIGHTCTR_NOTUSE) { ChangePhoneAppCtr(false); bSaveData = true; } else if ((TargetId == ConfingSettingMainID.button.SENSORLIGHT_SHARE_USE1) || (TargetId == ConfingSettingMainID.button.SENSORLIGHT_SHARE_USE2)) { int idx = TargetId - ConfingSettingMainID.button.SENSORLIGHT_SHARE_USE1; int statusIdx = idx; Log.i(TAG, "[onTouch] - SENSORLIGHT_SHARE_USE : " + idx); if (mSenSorLight_Share_Count == 1) { statusIdx = 0; } if (mSenSorLight_Share[statusIdx] == true) { Log.d(TAG, "[onTouch] - Already Enable mSenSorLight_Share "); return; } int ret = mSdbAPI.Set_BathRoomSensorLight_OnOff( (byte) idx, true ); if (ret >= 0) { Sound().Play(SND.effect.TOUCH_LATCHED); ChangeSensorLight_Share(true, idx, statusIdx); } else { Sound().Play(SND.effect.TOUCH_UNLATCHED); } } else if ((TargetId == ConfingSettingMainID.button.SENSORLIGHT_SHARE_NOTUSE1) || (TargetId == ConfingSettingMainID.button.SENSORLIGHT_SHARE_NOTUSE2)) { int idx = TargetId - ConfingSettingMainID.button.SENSORLIGHT_SHARE_NOTUSE1; int statusIdx = idx; Log.i(TAG, "[onTouch] - SENSORLIGHT_SHARE_NOTUSE : " + idx); if (mSenSorLight_Share_Count == 1) { statusIdx = 0; } if (mSenSorLight_Share[statusIdx] == false) { Log.d(TAG, "[onTouch] - Already Enable mSenSorLight_Share "); return; } int ret = mSdbAPI.Set_BathRoomSensorLight_OnOff( (byte) idx, false ); if (ret >= 0) { Sound().Play(SND.effect.TOUCH_LATCHED); ChangeSensorLight_Share(false, idx, statusIdx); } else { Sound().Play(SND.effect.TOUCH_UNLATCHED); } } else if ((TargetId == ConfingSettingMainID.button.SENSORLIGHT_COUPLE_USE1) || (TargetId == ConfingSettingMainID.button.SENSORLIGHT_COUPLE_USE2)) { int idx = TargetId - ConfingSettingMainID.button.SENSORLIGHT_COUPLE_USE1; int statusIdx = idx; Log.i(TAG, "[onTouch] - SENSORLIGHT_COUPLE_USE : " + idx); if (mSenSorLight_Couple_Count == 1) { statusIdx = 0; } if (mSenSorLight_Couple[statusIdx] == true) { Log.d(TAG, "[onTouch] - Already Enable SENSORLIGHT_COUPLE "); return; } int ret = mSdbAPI.Set_BathRoomSensorLight_OnOff( (byte) idx, true ); if (ret >= 0) { Sound().Play(SND.effect.TOUCH_LATCHED); ChangeSensorLight_Couple(true, idx, statusIdx); } else { Sound().Play(SND.effect.TOUCH_UNLATCHED); } } else if((TargetId == ConfingSettingMainID.button.SENSORLIGHT_COUPLE_NOTUSE1) || (TargetId == ConfingSettingMainID.button.SENSORLIGHT_COUPLE_NOTUSE2)) { int idx = TargetId - ConfingSettingMainID.button.SENSORLIGHT_COUPLE_NOTUSE1; int statusIdx = idx; Log.i(TAG, "[onTouch] - SENSORLIGHT_COUPLE_NOTUSE : " + idx); if (mSenSorLight_Couple_Count == 1) { statusIdx = 0; } if (mSenSorLight_Couple[statusIdx] == false) { Log.d(TAG, "[onTouch] - Already Enable SENSORLIGHT_COUPLE "); return; } int ret = mSdbAPI.Set_BathRoomSensorLight_OnOff( (byte) idx, false ); if (ret >= 0) { Sound().Play(SND.effect.TOUCH_LATCHED); ChangeSensorLight_Couple(false, idx, statusIdx); } else { Sound().Play(SND.effect.TOUCH_UNLATCHED); } } else if (TargetId == ConfingSettingMainID.button.OPENDELAY_LEFT) { ChangeOpenDelayLevel(false); } else if (TargetId == ConfingSettingMainID.button.OPENDELAY_RIGHT) { ChangeOpenDelayLevel(true); } /*else { if(true) { Sound().Play(SND.effect.TOUCH_LATCHED); } }*/ if (bSaveData == true) { SaveConfigDB(); } } } @Override protected void onPopupResult(Intent data) { try { int nScreen = data.getIntExtra("SCREEN", -1); boolean bType = data.getBooleanExtra("UX_TYPE", false); int nID = data.getIntExtra("POPUP_BTN", -1); Log.d(TAG, "[onPopupResult] nScreen [" + nScreen + "], bType [" + bType + "], nID [" + nID + "]"); if (nScreen == screen.PopupNoticeReboot) { if (nID == ID.PoupNoticeRebootID.button.OK) { ChangeEasyModeUse(bType); SaveConfigDB(); runWallPadReboot(); } } else if (nScreen == screen.PopupRemoteCtrlSmartlight) { if (nID == ID.PopupRemoteCtrlSmartlight.button.OK) { ChangeRemoteSmartLightControl(true); SaveConfigDB(); } } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] onPopupResult(Intent data)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } //[Function] @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 GetDBConfigInitValue() { final AudioManager audioManager = (AudioManager)this.getContext().getSystemService(this.getContext().AUDIO_SERVICE); mVolumeLevel = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC); Log.d(TAG, "STREAM_SYSTEM ---> Volume : " + audioManager.getStreamVolume(AudioManager.STREAM_SYSTEM)); Log.d(TAG, "STREAM_VOICE_CALL ---> Volume : " + audioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL)); Log.d(TAG, "STREAM_RING ---> Volume : " + audioManager.getStreamVolume(AudioManager.STREAM_RING)); Log.d(TAG, "STREAM_DTMF ---> Volume : " + audioManager.getStreamVolume(AudioManager.STREAM_DTMF)); WallpadStatusData mWallpadStatusData = new WallpadStatusData( this.getContext()); mWallpadStatusData.SetWallPadMasterVolume(mVolumeLevel); // DB에서 값을 읽어와 정보를 넣어주어야 함. try { // DB 에서 현재 설정된 패스워드를 얻어오도록 한다. //WallpadStatusData wdb = new WallpadStatusData(this.getContext()); if (mWallpadStatusData != null) { int nlevel = Settings.System.getInt(this.getContext().getContentResolver(), "screen_brightness"); Log.d(TAG, "[DB] --------nlevel --" + nlevel); mAllAlarmSound = mWallpadStatusData.GetSoundOutputOfEventAlarm(); mCarAlarmSound = mWallpadStatusData.GetCarSoundOfEventAlarm(); mCallAlarmSound = mWallpadStatusData.GetCallSoundOfEventAlarm(); mCloseSensorLevel = mWallpadStatusData.GetCloseSensorValue(); mNoisePopupUse = mWallpadStatusData.GetNoisePopupUse(); // 기본 false mBandLocAlarm = mWallpadStatusData.GetBandLocationEventAlarm(); mEasyModeUse = mWallpadStatusData.GetEasyModeUxUse(); mButtonLightLevel = mWallpadStatusData.GetLEDButtonBrightnessLevel(); mARSControl = mWallpadStatusData.GetArsControl(); mRemoteControl = mWallpadStatusData.GetRemoteControl(); mRemoteSmartLightControl = mWallpadStatusData.GetRemoteControlSmartLight(); for (int i = 0; i <= MAX_OPENDELAY_LEVEL; i++) { if (DoorLock_OpenDelayTime[i] == mWallpadStatusData.Get_DoorOpen_WaitTime()) mOpenDelayTime = i; } mWallpadStatusData.closeDB(); Log.i(TAG, "[GetDBConfigInitValue] mAllAlarmSound [" + mAllAlarmSound + "], mCarAlarmSound [" + mCarAlarmSound + "], mCallAlarmSound [" + mCallAlarmSound + "], " + "mCloseSensorLevel [" + mCloseSensorLevel + "], mNoisePopupUse [" + mNoisePopupUse + "], mBandLocAlarm [" + mBandLocAlarm + "], mEasyModeUse [" + mEasyModeUse + "]"); Log.d(TAG, "[GetDBConfigInitValue] mButtonLightLevel [" + mButtonLightLevel + "], mARSControl [" + mARSControl + "], mRemoteControl [" + mRemoteControl + "], " + "mOpenDelayTime [" + mOpenDelayTime + "], mRemoteSmartLightControl [" + mRemoteSmartLightControl + "]"); } else { Log.w(TAG, "[GetDBConfigInitValue] mWallpadStatusData is null!!"); } } catch (RuntimeException re) { if (mWallpadStatusData != null) mWallpadStatusData.closeDB(); LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { if (mWallpadStatusData != null) mWallpadStatusData.closeDB(); Log.e(TAG, "[Exception] GetDBConfigInitValue()"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void SaveConfigDB() { // DB에서 값을 읽어와 정보를 넣어주어야 함. try { // DB 에서 현재 설정된 패스워드를 얻어오도록 한다. //WallpadStatusData wdb = new WallpadStatusData(this.getContext()); WallpadStatusData mWallpadStatusData = new WallpadStatusData( this.getContext()); if (mWallpadStatusData != null) { mWallpadStatusData.SetSoundOutputOfEventAlarm(mAllAlarmSound); mWallpadStatusData.SetCarSoundOfEventAlarm(mCarAlarmSound); mWallpadStatusData.SetCallSoundOfEventAlarm(mCallAlarmSound); mWallpadStatusData.SetArsControl(mARSControl); mWallpadStatusData.SetRemoteControl(mRemoteControl); boolean bRet = mWallpadStatusData.SetRemoteControlSmartLight(mRemoteSmartLightControl); Log.e(TAG, "[SaveConfigDB] bRet: " + bRet + ", mRemoteSmartLightControl: " + mRemoteSmartLightControl); mWallpadStatusData.SetNoisePopupUse(mNoisePopupUse); mWallpadStatusData.SetBandLocationEventAlarm(mBandLocAlarm); mWallpadStatusData.SetEasyModeUxUse(mEasyModeUse); mWallpadStatusData.closeDB(); Log.i(TAG, "[SaveConfigDB] mAllAlarmSound [" + mAllAlarmSound + "], mCarAlarmSound [" + mCarAlarmSound + "], mCallAlarmSound [" + mCallAlarmSound + "], " + "mCloseSensorLevel [" + mCloseSensorLevel + "], mNoisePopupUse [" + mNoisePopupUse + "], mBandLocAlarm [" + mBandLocAlarm + "], mEasyModeUse [" + mEasyModeUse + "], mRemoteSmartLightControl [" + mRemoteSmartLightControl + "]"); } else { Log.w(TAG, "[SaveConfigDB] mWallpadStatusData is null!!"); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] SaveConfigDB()"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeVolumeLevel(boolean Up) { try { if (Up == true) { if (mVolumeLevel != MAX_VOLUME_LEVEL) Sound().Play(SND.effect.TOUCH_LATCHED); mVolumeLevel++; if (mVolumeLevel >= MAX_VOLUME_LEVEL) mVolumeLevel = MAX_VOLUME_LEVEL; } else { if (mVolumeLevel != 1) Sound().Play(SND.effect.TOUCH_LATCHED); mVolumeLevel--; if (mVolumeLevel <= 1) mVolumeLevel = 1; } DrawVolumeLevel(mVolumeLevel); // 샘플 코드 final AudioManager audioManager = (AudioManager)this.getContext().getSystemService(this.getContext().AUDIO_SERVICE); int Curlevel = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC); int Maxlevel = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC); Log.d(TAG, "--------- Volume : " + Curlevel + " , MaxVolume : " + Maxlevel); audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, mVolumeLevel , 0); WallpadStatusData wd = new WallpadStatusData( this.getContext()); wd.SetWallPadMasterVolume(mVolumeLevel); wd.closeDB(); //Sound().PlayMent(SND.bell.FRONT); //Log.i(TAG, "Change : " + smartKeyRfDoorAPI.SetSensorConfig((byte)mVolumeLevel, (byte)(mVolumeLevel*2) ) ); //Log.i(TAG, "Setting : " + smartKeyRfDoorAPI.SetSensorConfig((byte)0xFF, (byte)0xFF) ); } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] ChangeVolumeLevel(boolean Up)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } // DB Save } private void DrawVolumeLevel(int level) { try { int idx = getViewIdx(TXT_SYSTEM_VOLUME); textValue[idx].setText(String.valueOf(level)); if (level == MAX_VOLUME_LEVEL) { Btn_Right[idx].setButtonRearImage(); } else if (level == 1) { Btn_Left[idx].setButtonRearImage(); } else { Btn_Right[idx].setButtonFrontImage(); Btn_Left[idx].setButtonFrontImage(); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawVolumeLevel(int level)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeCloseSensorLevel(boolean Up) { try { boolean soundOn = true; if (Up == true) { if (mCloseSensorLevel != MAX_CLOSESENSOR_LEVEL) Sound().Play(SND.effect.TOUCH_LATCHED); mCloseSensorLevel++; if (mCloseSensorLevel > MAX_CLOSESENSOR_LEVEL) { mCloseSensorLevel = MAX_CLOSESENSOR_LEVEL; soundOn = false; } } else { if (mCloseSensorLevel != 0) Sound().Play(SND.effect.TOUCH_LATCHED); mCloseSensorLevel--; if (mCloseSensorLevel < 0) { mCloseSensorLevel = 0; soundOn = false; } } if (soundOn) { // Sound().Play(SND.effect.TOUCH_LATCHED); DrawCloseSensorLevel(mCloseSensorLevel); int closeValue = 15; if (mCloseSensorLevel == 0) { closeValue = 0; } else if (mCloseSensorLevel == 1) { closeValue = 1; } else if (mCloseSensorLevel == 2) { closeValue = 4; } else if (mCloseSensorLevel == 3) { closeValue = 7; } else if (mCloseSensorLevel == 4) { closeValue = 11; } else if (mCloseSensorLevel == 5) { closeValue = 15; } // JNI로 값 변경 //v40IOInterface.Ctrl_CloseSensor(mCloseSensorLevel * 3); mV40IF.Ctrl_CloseSensor(closeValue); // DB에 변경 값 저장 WallpadStatusData wd = new WallpadStatusData( this.getContext()); wd.SetCloseSensorValue(mCloseSensorLevel); Log.d(TAG, "[ChangeCloseSensorLevel] - db saved : " + wd.GetCloseSensorValue()); wd.closeDB(); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] ChangeCloseSensorLevel(boolean Up)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void DrawCloseSensorLevel(int level) { try { int idx = getViewIdx(TXT_CLOSE_SENSOR); textValue[idx].setText(String.valueOf(level)); if (level == MAX_CLOSESENSOR_LEVEL) { Btn_Right[idx].setButtonRearImage(); } else if (level == 0) { Btn_Left[idx].setButtonRearImage(); } else { Btn_Right[idx].setButtonFrontImage(); Btn_Left[idx].setButtonFrontImage(); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawCloseSensorLevel(int level)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void DrawSensorLightCheck(byte index, boolean onoff) { try { } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG,"[Exception] DrawSensorLightCheck(byte index, boolean onoff)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } ////////////////////////////////////////// private void ChangeLcdLevel( boolean Up ) { if (Up == true) { if (mLcdLevel != MAX_LCD_LEVEL) Sound().Play(SND.effect.TOUCH_LATCHED); mLcdLevel++; if (mLcdLevel >= MAX_LCD_LEVEL) mLcdLevel = MAX_LCD_LEVEL; } else { if (mLcdLevel != 1) Sound().Play(SND.effect.TOUCH_LATCHED); mLcdLevel--; if (mLcdLevel <= 1) mLcdLevel = 1; } DrawLcdLevel(mLcdLevel); // 샘플 코드 if (mLcdLevel > 0 && mLcdLevel <= MAX_LCD_LEVEL) { Settings.System.putInt(this.getContext().getContentResolver(), "screen_brightness", LCD_BrightnessValue[mLcdLevel -1]); WindowManager.LayoutParams myLayoutParameter = ((Activity)this.getContext()).getWindow().getAttributes(); myLayoutParameter.screenBrightness = LCD_BrightnessValue[mLcdLevel -1]; ((Activity)this.getContext()).getWindow().setAttributes(myLayoutParameter); } // DB Save } private void DrawLcdLevel(int level) { try { int idx = getViewIdx(TXT_LCD_LEVEL); textValue[idx].setText(String.valueOf(level)); if (level == MAX_LCD_LEVEL) { Btn_Right[idx].setButtonRearImage(); } else if (level == 1) { Btn_Left[idx].setButtonRearImage(); } else { Btn_Right[idx].setButtonFrontImage(); Btn_Left[idx].setButtonFrontImage(); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG,"[Exception] DrawLcdLevel(int level)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeButtonLightLevel(boolean Up) { try { if (Up == true) { if (mButtonLightLevel != MAX_BTN_LEVEL) Sound().Play(SND.effect.TOUCH_LATCHED); mButtonLightLevel++; if (mButtonLightLevel >= MAX_BTN_LEVEL) mButtonLightLevel = MAX_BTN_LEVEL; } else { if (mButtonLightLevel != 0) Sound().Play(SND.effect.TOUCH_LATCHED); mButtonLightLevel--; if (mButtonLightLevel <= 0) mButtonLightLevel = 0; } if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL) { if (mIntLightAPI != null) mIntLightAPI.LedBrightCtrl((byte)(mButtonLightLevel)); WallpadStatusData wd = new WallpadStatusData( this.getContext()); wd.SetLEDButtonBrightnessLevel(mButtonLightLevel); wd.closeDB(); } DrawButtonLightLevel(mButtonLightLevel); } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG,"[Exception] ChangeButtonLightLevel(boolean Up)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void DrawButtonLightLevel(int level) { try { int idx = getViewIdx(TXT_BTN_LEVEL); textValue[idx].setText(String.valueOf(level)); if (level == MAX_BTN_LEVEL) { Btn_Right[idx].setButtonRearImage(); } else if (level == 0) { Btn_Left[idx].setButtonRearImage(); } else { Btn_Right[idx].setButtonFrontImage(); Btn_Left[idx].setButtonFrontImage(); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG,"[Exception] DrawButtonLightLevel(int level)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeSleepTime(boolean Up) { try { if (Up) { if (mSleepModeTime != MAX_SLEEP_TIME) Sound().Play(SND.effect.TOUCH_LATCHED); if (mSleepModeTime < 60) mSleepModeTime += 30; else mSleepModeTime += 60; if (mSleepModeTime >= MAX_SLEEP_TIME) mSleepModeTime = MAX_SLEEP_TIME; } else { if (mSleepModeTime != MIN_SLEEP_TIME) Sound().Play(SND.effect.TOUCH_LATCHED); if (mSleepModeTime > 60) mSleepModeTime -= 60; else mSleepModeTime -= 30; if (mSleepModeTime <= MIN_SLEEP_TIME) mSleepModeTime = MIN_SLEEP_TIME; } DrawSleepTime(mSleepModeTime); if (mSleepModeTime == 30) Settings.System.putInt( this.getContext().getContentResolver(), SCREEN_OFF_TIMEOUT, 28 * 1000); // 백라이트 off와 앱 종료가 동시에 일어나면 월패드가 비정상 종료되므로 수정 (2021.04.01 메이드인랩 김수진 선임 요청) else Settings.System.putInt( this.getContext().getContentResolver(), SCREEN_OFF_TIMEOUT, mSleepModeTime * 1000); int getSleepTime = Settings.System.getInt(this.getContext().getContentResolver(), SCREEN_OFF_TIMEOUT); Log.d(TAG, "[ChangeSleepTime] getSleepTime : " + getSleepTime); } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] ChangeSleepTime(boolean Up)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void DrawSleepTime(int Time) { try { int idx = getViewIdx(TXT_SLEEP_TIME); if (Time < 60) textValue[idx].setText(Time + "초"); else textValue[idx].setText((Time / 60) + "분"); if (Time == MAX_SLEEP_TIME) { Btn_Right[idx].setButtonRearImage(); } else if (Time == MIN_SLEEP_TIME) { Btn_Left[idx].setButtonRearImage(); } else { Btn_Right[idx].setButtonFrontImage(); Btn_Left[idx].setButtonFrontImage(); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawSleepTime(int Time)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeAlramSound(boolean Use) { if (mAllAlarmSound != Use) { Sound().Play(SND.effect.TOUCH_LATCHED); } else { return; } if (Use == true) mAllAlarmSound = true; else mAllAlarmSound = false; DrawAlramSound( mAllAlarmSound ); // DB Save } private void DrawAlramSound(boolean value) { try { int idx = getViewIdx(TXT_ALARM_SOUND); if (value == true) { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID()); } else { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID()); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawAlramSound(boolean value)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeSensorLight_Share(boolean Use, int idx, int satausIdx) { if (Use == true) mSenSorLight_Share[satausIdx] = true; else mSenSorLight_Share[satausIdx] = false; DrawSensorLight_Share(mSenSorLight_Share[satausIdx], sensorRoomNameArr.get(idx), sensorEMnumArr.get(idx) ); } private void DrawSensorLight_Share(boolean value, String selecName, String EMname) { try { Log.i(TAG, "[DrawSensorLight_Share] - selecName : " + selecName); int idx = getViewIdx_EMname(EMname); if (value == true) { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID()); } else { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID()); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawSensorLight_Share(boolean value, String selecName, String EMname)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeSensorLight_Couple(boolean Use, int idx, int satausIdx) { /*if(mSenSorLight_Couple[idx] == Use) { Log.d(TAG, "[ChangeSensorLight_Couple] - Already Setting value"); return; }*/ if (Use == true) mSenSorLight_Couple[satausIdx] = true; else mSenSorLight_Couple[satausIdx] = false; DrawSensorLight_Couple( mSenSorLight_Couple[satausIdx], sensorRoomNameArr.get(idx), sensorEMnumArr.get(idx) ); } private void DrawSensorLight_Couple(boolean value, String selecName, String EMname) { try { Log.i(TAG, "[DrawSensorLight_Couple] - selecName : " + selecName); int idx = getViewIdx_EMname(EMname); if (value == true) { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID()); } else { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID()); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawSensorLight_Couple(boolean value, String selecName, String EMname)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeCarAlramSound(boolean Use) { if (mCarAlarmSound != Use) { Sound().Play(SND.effect.TOUCH_LATCHED); } else { return; } if (Use == true) mCarAlarmSound = true; else mCarAlarmSound = false; DrawCarAlarmSound( mCarAlarmSound ); } private void DrawCarAlarmSound(boolean value) { try { int idx = getViewIdx(TXT_CAR_SOUND); if (value == true) { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID()); } else { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID()); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawCarAlarmSound(boolean value)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeCallAlarmSound(boolean Use) { if (mCallAlarmSound != Use) { Sound().Play(SND.effect.TOUCH_LATCHED); } else { return; } if (Use == true) mCallAlarmSound = true; else mCallAlarmSound = false; DrawCallAlarmSound(mCallAlarmSound); } private void DrawCallAlarmSound(boolean value) { try { int idx = getViewIdx(TXT_CALL_SOUND); if (value == true) { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID()); } else { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID()); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawCallAlarmSound(boolean value)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeBandLocAlramSound( boolean Use) { if (mBandLocAlarm != Use) { Sound().Play(SND.effect.TOUCH_LATCHED); } else { return; } if (Use == true) mBandLocAlarm = true; else mBandLocAlarm = false; DrawBandLocAlarm( mBandLocAlarm ); } private void DrawBandLocAlarm(boolean value) { try { int idx = getViewIdx(TXT_BAND_LOCATION); if (value == true) { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID()); } else { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID()); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawBandLocAlarm(boolean value)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeEasyModeUse(boolean Use) { if (Use == true) mEasyModeUse = true; else mEasyModeUse = false; DrawEasyMode(mEasyModeUse, true); } private void DrawEasyMode(boolean value, boolean bTouch) { try { int idx = getViewIdx(TXT_EASYMODE); if (value == true) { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID()); } else { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID()); } // 설정 후 재부팅 대기 중 값 변경을 방지하기 위함(버튼 disable 처리) if (bTouch) { UseCheckBoxAgrray[idx].setButtonEventOffEnable(); NotUseCheckBoxAgrray[idx].setButtonEventOffEnable(); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawEasyMode(boolean value, boolean bTouch)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeNoisePopupUse( boolean Use) { if (mNoisePopupUse != Use) { Sound().Play(SND.effect.TOUCH_LATCHED); } else { return; } if (Use == true) mNoisePopupUse = true; else mNoisePopupUse = false; DrawNoisePopupUse( mNoisePopupUse ); } private void DrawNoisePopupUse(boolean value) { try { int idx = getViewIdx(TXT_INTERLAYTER_NOISE_POPUP); if (value == true) { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID()); } else { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID()); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawNoisePopupUse(boolean value)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangePhoneAppCtr(boolean Use) { Log.i(TAG, "[ChangePhoneAppCtr] Use: " + Use + ", mEnergyControllerComm: " + mEnergyControllerComm); if (!mEnergyControllerComm) { // 에너지 컨트롤러 통신이 되었을 때만 버튼 눌림. Log.w(TAG, "[ChangePhoneAppCtr] mEnergyControllerComm: " + mEnergyControllerComm); return; } if (Use == mPhoneLightCtrUse) { // 같은 버튼을 누른 경우, 동작 안하도록 함. return; } if (Use == true) { mPhoneLightCtrUse = true; } else { mPhoneLightCtrUse = false; } if (mSdbAPI != null) { if (mSdbAPI.Set_SmartPhoneLightControl(mPhoneLightCtrUse) >= 0) { Sound().Play(SND.effect.TOUCH_LATCHED); DrawPhoneLightCtrUse( mPhoneLightCtrUse ); } else { Sound().Play(SND.effect.TOUCH_UNLATCHED); } if (mSdbAPI.Refresh(SdbAPI.DEVICE_INDEX.ENERGY_CONT, (byte)0x00) >= 0) { mEnergyControllerClass = mSdbAPI.data.EnergyController; if (mEnergyControllerClass.Data.SmartPhoneLightControl == EnergyControllerClass.DataClass.SMARTPHONE_LIGHT_CTRL_STATUS.NO_INFO) { Log.w(TAG, "[ChangePhoneAppCtr] - SmartPhoneLightControl : NO_INFO"); Log.w(TAG, "[ChangePhoneAppCtr] - EnergyController Not Communicated"); mEnergyControllerComm = false; } else if (mEnergyControllerClass.Data.SmartPhoneLightControl == EnergyControllerClass.DataClass.SMARTPHONE_LIGHT_CTRL_STATUS.CLR) { Log.i(TAG, "[ChangePhoneAppCtr] - SmartPhoneLightControl : CLR (NOT USE)"); mEnergyControllerComm = true; mPhoneLightCtrUse = false; } else if (mEnergyControllerClass.Data.SmartPhoneLightControl == EnergyControllerClass.DataClass.SMARTPHONE_LIGHT_CTRL_STATUS.SET) { Log.i(TAG, "[ChangePhoneAppCtr] - SmartPhoneLightControl : SET (USE ~~~)"); mEnergyControllerComm = true; mPhoneLightCtrUse = true; } } else { Log.w(TAG, "[ChangePhoneAppCtr] mSdbAPI.Refresh(SdbAPI.DEVICE_INDEX.ENERGY_CONT, (byte)0x00) fail!!"); } } else { Log.w(TAG, "[ChangePhoneAppCtr] mSdbAPI is null!!"); } } private void DrawPhoneLightCtrUse(boolean value) { try { if (mEnergyControllerComm) { // 에너지 컨트롤러 통신이 되었을 때만 상태체크 그리기 int idx = getViewIdx(TXT_SMARTPHONE_LIGHTCTR); if (value == true) { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID()); } else { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID()); } } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawPhoneLightCtrUse(boolean value)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeARSControl(boolean Use) { if (mARSControl != Use) { Sound().Play(SND.effect.TOUCH_LATCHED); } else { return; } if (Use == true) mARSControl = true; else mARSControl = false; DrawARSControl(mARSControl); // DB Save } private void DrawARSControl(boolean value) { try { int idx = getViewIdx(TXT_ARS_CONTROL); if (value == true) { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID()); } else { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID()); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawARSControl(boolean value)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeRemoteControl(boolean Use) { if (mRemoteControl != Use) { Sound().Play(SND.effect.TOUCH_LATCHED); } else { return; } if (Use == true) mRemoteControl = true; else mRemoteControl = false; DrawRemoteControl(mRemoteControl ); } private void DrawRemoteControl(boolean value) { try { int idx = getViewIdx(TXT_RMOTE_CONTROL); if (value == true) { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID()); } else { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID()); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawRemoteControl(boolean value)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void ChangeRemoteSmartLightControl(boolean Use) { if (mRemoteSmartLightControl != Use) { if (!Use) Sound().Play(SND.effect.TOUCH_LATCHED); } else { return; } if (Use == true) mRemoteSmartLightControl = true; else mRemoteSmartLightControl = false; DrawRemoteSmartLightControl(mRemoteSmartLightControl); sendBRRemoteCtrlLightTypeChanged(); } private void DrawRemoteSmartLightControl(boolean value) { try { int idx = getViewIdx(TXT_RMOTE_SMARTLIGHT_CONTROL); Log.i(TAG, "[DrawRemoteSmartLightControl] value = " + value + ", idx = " + idx); if (value == true) { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID()); } else { UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID()); NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID()); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] DrawRemoteSmartLightControl(boolean value)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } private void sendBRRemoteCtrlLightTypeChanged() { Intent intent = new Intent(); intent.setAction(define.NOTIFY_ACNAME); intent.putExtra(define.NOTIBR_KIND, define.NOTIFY_REMOTE_CTRL_LIGHT_TYPE_CHANGED); super.getContext().sendBroadcast(intent); } private void ChangeOpenDelayLevel( boolean Up ) { if (Up == true) { if (mOpenDelayTime != MAX_OPENDELAY_LEVEL) Sound().Play(SND.effect.TOUCH_LATCHED); mOpenDelayTime++; if (mOpenDelayTime >= MAX_OPENDELAY_LEVEL) mOpenDelayTime = MAX_OPENDELAY_LEVEL; } else { if (mOpenDelayTime != 0) Sound().Play(SND.effect.TOUCH_LATCHED); mOpenDelayTime--; if (mOpenDelayTime <= 0) mOpenDelayTime = 0; } DrawDoorLockOpenDelay(mOpenDelayTime); // DB Save if (mOpenDelayTime >= 0 && mOpenDelayTime <= MAX_OPENDELAY_LEVEL) { WallpadStatusData wd = new WallpadStatusData(this.getContext()); wd.Set_DoorOpen_WaitTime(DoorLock_OpenDelayTime[mOpenDelayTime]); } } private void DrawDoorLockOpenDelay(int level) { try { Log.d(TAG, "[DrawDoorLockOpenDelay] level [" + level + "], DelayTime [" + DoorLock_OpenDelayTime[level] + "]"); int idx = getViewIdx(TXT_OPEN_DELAY); textValue[idx].setText(DoorLock_OpenDelayTime[level] + "초"); if (level == MAX_OPENDELAY_LEVEL) { Btn_Right[idx].setButtonRearImage(); } else if (level == 0) { Btn_Left[idx].setButtonRearImage(); } else { Btn_Right[idx].setButtonFrontImage(); Btn_Left[idx].setButtonFrontImage(); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG,"[Exception] DrawDoorLockOpenDelay(int level)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } /** * 무선리모콘 사용유무 확인 * * @return - (boolean) true : 사용, false : 미사용 */ protected boolean GetRemoconActive() { WallpadDeviceSet DevSet = new WallpadDeviceSet(super.getContext()); int ret = DevSet.Get_RemoteCon_Info(); DevSet.closeDB(); if (ret == 1) return true; return false; } private void runWallPadReboot() { try { if (Version.getPlatformType() == Version.PLATFORM_TYPE.A40i) { mV40IF.Reboot(5); } else { Log.w(TAG, "[runWallPadReboot] Not Supported PlatformType [" + Version.getPlatformType() + "]"); } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] runWallPadReboot()"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } /** * 무선 도어락 문열림 대기모드 사용여부 * * @return (int) - >0 : 무선 도어락 문열림 대기모드 사용, <0 : 실패 또는 미사용 */ private int getDoorLockOpenDelayUse() { // 1. get DB WallpadDeviceSet devset = new WallpadDeviceSet(super.getContext()); int Doorinfo = devset.GetDeviceSetted("무선도어락문열림대기모드"); devset.closeDB(); // 2. Check if (Doorinfo == WallpadDeviceSet.DEV_DATA_ENABLE) { return 1; } else if (Doorinfo == WallpadDeviceSet.DEV_DATA_DISABLE) { return -1; } else if (Doorinfo == WallpadDeviceSet.DEV_DATA_NONE) { return -2; } else { return -3; } } }