ConfigSettingMainScreen.java 105 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650
  1. package kr.co.icontrols.wallpadconfig.screen;
  2. import android.annotation.SuppressLint;
  3. import android.app.Activity;
  4. import android.content.Context;
  5. import android.content.Intent;
  6. import android.database.sqlite.SQLiteDatabase;
  7. import android.graphics.Color;
  8. import android.media.AudioManager;
  9. import android.os.Handler;
  10. import android.os.Message;
  11. import android.os.PowerManager;
  12. import android.provider.Settings;
  13. import android.util.Log;
  14. import android.view.Gravity;
  15. import android.view.MotionEvent;
  16. import android.view.View;
  17. import android.view.WindowManager;
  18. import android.widget.RelativeLayout;
  19. import com.artncore.WallPadDataMgr.WallpadDeviceSet;
  20. import com.artncore.WallPadDataMgr.WallpadStatusData;
  21. import com.artncore.commons.Sdb_DataClasses.BathRoomSensorLightClass;
  22. import com.artncore.commons.Sdb_DataClasses.EnergyControllerClass;
  23. import com.artncore.commons.Sdb_DataClasses.EnergyControllerClass.DataClass.SMARTPHONE_LIGHT_CTRL_STATUS;
  24. import com.artncore.commons.define;
  25. import com.artncore.wallpadapi.InRoomDetectSensor_API;
  26. import com.artncore.wallpadapi.IntLightAPI;
  27. import com.artncore.wallpadapi.KnxAPI;
  28. import com.artncore.wallpadapi.SdbAPI;
  29. import com.artncore.wallpadapi.SmartKeyRfDoorAPI;
  30. import com.artncore.wallpadapi.WallPadAPI;
  31. import com.util.LogUtil;
  32. import java.util.ArrayList;
  33. import java.util.List;
  34. import kr.co.icontrols.v40ioctl.V40IF;
  35. import kr.co.icontrols.wallpadconfig.MainActivity;
  36. import kr.co.icontrols.wallpadconfig.R;
  37. import kr.co.icontrols.wallpadconfig.declare.Common;
  38. import kr.co.icontrols.wallpadconfig.declare.ID;
  39. import kr.co.icontrols.wallpadconfig.declare.ID.ConfingSettingMainID;
  40. import kr.co.icontrols.wallpadconfig.declare.ID.screen;
  41. import kr.co.icontrols.wallpadsupport.Version;
  42. import kr.co.icontrols.wallpadsupport.WpadImageView;
  43. import kr.co.icontrols.wallpadsupport.WpadImageView.TOUCH_KIND;
  44. import kr.co.icontrols.wallpadsupport.WpadScreen;
  45. import kr.co.icontrols.wallpadsupport.WpadSound.SND;
  46. import kr.co.icontrols.wallpadsupport.WpadTextView;
  47. import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT;
  48. import static com.artncore.commons.Sdb_DataClasses.LEDLIGHT_USAGE_CODE.COUPLE_BATHROOM_SENSOR;
  49. import static com.artncore.commons.Sdb_DataClasses.LEDLIGHT_USAGE_CODE.SHARED_BATHROOM_SENSOR;
  50. public class ConfigSettingMainScreen extends WpadScreen {
  51. // [Define]
  52. String TAG = this.getClass().getSimpleName();
  53. private void DebugLogOutput(String s) { if(Common.DEBUG_LOG_ON) Log.d(TAG, s); }
  54. public final int TYPE_L_R_ARROW = 0; //1,2,3,,,,선택
  55. public final int TYPE_CHECKBOX = 1; //사용 사용안함
  56. public final int TYPE_BUTTON = 2; //확인
  57. public final int TYPE_SENSORLIGHT_CHECK_USE = 3; //센서등 체크
  58. public final int TYPE_SENSORLIGHT_CHECK_NON = 4; //센서등 체크
  59. public final int TYPE_SENSORLIGHT_BATCH_ON = 5; //일괄소등 --> 센서등 설정변경 불가
  60. public final int TYPE_BUTTON_WEBPWD = 6; // 웹 제어 비밀번호 설정
  61. public final int TYPE_CHECKBOX_SMARTLIGHT = 7; // 원격제어로 스마트조명 사용 여부
  62. public final String TXT_SYSTEM_VOLUME = "시스템볼륨조절";
  63. public final String TXT_LCD_LEVEL = "화면밝기";
  64. public final String TXT_BTN_LEVEL = "버튼밝기";
  65. public final String TXT_SLEEP_TIME = "절전모드작동시간";
  66. public final String TXT_ALARM_SOUND = "알림음";
  67. public final String TXT_CAR_SOUND = "차량도착알림음";
  68. public final String TXT_CALL_SOUND = "호출알림음";
  69. public final String TXT_ARS_CONTROL = "전화ARS제어";
  70. public final String TXT_RMOTE_CONTROL = "원격제어";
  71. public final String TXT_RMOTE_SMARTLIGHT_CONTROL = "스마트조명";
  72. public final String TXT_AS_CALL = "AS신청";
  73. public final String TXT_ROOM_NAME = "명칭설정";
  74. public final String TXT_REMOCON_REG = "리모콘등록";
  75. public final String TXT_CLOSE_SENSOR = "근접센서조절";
  76. public final String TXT_SENSORLIGHT_SHARE = "공용욕실 센서등";
  77. public final String TXT_SENSORLIGHT_COUPLE = "부부욕실 센서등";
  78. public final String TXT_COUPLEBATH = "부부욕실";
  79. public final String TXT_COUPLEBATH_FULL_NAME = "부부욕실";
  80. public final String TXT_SHAREBATH = "공용욕실";
  81. public final String TXT_SHAREBATH_FULL_NAME = "공용욕실";
  82. public final String TXT_INTERLAYTER_NOISE_POPUP = "층간소음 팝업";
  83. public final String TXT_SMARTPHONE_LIGHTCTR = "스마트조명 App";
  84. public final String TXT_RELIEFCALL_PRESET = "안심통화 변조도설정";
  85. public final String TXT_BAND_LOCATION = "밴드위치알림";
  86. public final String TXT_WEB_CTR_PWD = "웹 제어 비밀번호";
  87. public final String TXT_EASYMODE = "간편모드설정";
  88. public final String TXT_OPEN_DELAY = "문열림대기시간 설정";
  89. ArrayList<Integer> sensorRoomIdxArr = new ArrayList<Integer>();
  90. ArrayList<String> sensorRoomNameArr = new ArrayList<String>();
  91. ArrayList<String> sensorEMnumArr = new ArrayList<String>();
  92. public class SetKind {
  93. public int m_Type;
  94. public int m_EventID_01;
  95. public int m_EventID_02;
  96. public int m_EventID_03;
  97. public String m_TxtTitle;
  98. public String m_TxtDetail;
  99. public int m_ViewIdx;
  100. public String m_EMname;
  101. public SetKind(int type, int nEventID_01, String strTitle) {
  102. m_Type = type;
  103. m_EventID_01 = nEventID_01;
  104. m_TxtTitle = strTitle;
  105. m_TxtDetail = null;
  106. m_EMname = "";
  107. }
  108. public SetKind(int type, int nEventID_01, int nEventID_02, String strTitle) {
  109. m_Type = type;
  110. m_EventID_01 = nEventID_01;
  111. m_EventID_02 = nEventID_02;
  112. m_TxtTitle = strTitle;
  113. m_TxtDetail = null;
  114. m_EMname = "";
  115. }
  116. public SetKind(String emnum, int type, int nEventID_01, int nEventID_02, String strTitle) {
  117. m_Type = type;
  118. m_EventID_01 = nEventID_01;
  119. m_EventID_02 = nEventID_02;
  120. m_TxtTitle = strTitle;
  121. m_TxtDetail = null;
  122. m_EMname = emnum;
  123. }
  124. public SetKind(int type, int nEventID_01, int nEventID_02, String strTitle, String strDetail) {
  125. m_Type = type;
  126. m_EventID_01 = nEventID_01;
  127. m_EventID_02 = nEventID_02;
  128. m_TxtTitle = strTitle;
  129. m_TxtDetail = strDetail;
  130. m_EMname = "";
  131. }
  132. public SetKind(int type, int nEventID_01, int nEventID_02, int nEventID_03, String strTitle) {
  133. m_Type = type;
  134. m_EventID_01 = nEventID_01;
  135. m_EventID_02 = nEventID_02;
  136. m_EventID_03 = nEventID_03;
  137. m_TxtTitle = strTitle;
  138. m_TxtDetail = null;
  139. m_EMname = "";
  140. }
  141. public void SetViewIdx(int ViewIdx)
  142. {
  143. m_ViewIdx = ViewIdx;
  144. }
  145. }
  146. public List<SetKind> SettingData = new ArrayList<SetKind>();
  147. private int getViewIdx(String searchName) {
  148. int retIdx = -1;
  149. if (SettingData != null) {
  150. for (int i = 0; i < SettingData.size(); i++) {
  151. if (SettingData.get(i).m_TxtTitle.equals(searchName)) {
  152. retIdx = SettingData.get(i).m_ViewIdx;
  153. break;
  154. }
  155. }
  156. }
  157. return retIdx;
  158. }
  159. private int getViewIdx_EMname(String searchName) {
  160. int retIdx = -1;
  161. if (SettingData != null) {
  162. for (int i = 0; i < SettingData.size(); i++) {
  163. if (SettingData.get(i).m_EMname.equals(searchName)) {
  164. retIdx = SettingData.get(i).m_ViewIdx;
  165. break;
  166. }
  167. }
  168. }
  169. return retIdx;
  170. }
  171. // [View - ImageView(Background or Image - No touch)]
  172. WpadImageView Background, Background_1;
  173. // [View - ImageView(Button - touch)]
  174. WpadImageView [] lineBg = new WpadImageView [7];
  175. WpadImageView [] Btn_Left = new WpadImageView[6];
  176. WpadImageView [] Text_Box = new WpadImageView[6];
  177. WpadImageView [] Btn_Right = new WpadImageView[6];
  178. WpadImageView [] UseCheckBoxAgrray = new WpadImageView [6];
  179. WpadImageView [] NotUseCheckBoxAgrray = new WpadImageView [6];
  180. WpadTextView [] UseTextAgrray = new WpadTextView [6];
  181. WpadTextView [] NotUseTextAgrray = new WpadTextView [6];
  182. WpadTextView [] SensorEMnumArray = new WpadTextView [2];
  183. WpadImageView [] Btn_Popup = new WpadImageView [6];
  184. WpadImageView Btn_NextPage;
  185. WpadImageView Btn_PrevPage, mPageBg;
  186. WpadTextView mPageText;
  187. // [View - TextView]
  188. private WpadTextView Title;
  189. WpadTextView [] TextLineAgrray = new WpadTextView [6];
  190. WpadTextView [] TextLineArray_detail = new WpadTextView [6];
  191. WpadTextView [] textValue = new WpadTextView[6];
  192. SQLiteDatabase db;
  193. private final int MAX_VOLUME_LEVEL = 15;
  194. private final int MAX_LCD_LEVEL = 4;
  195. private int [] LCD_BrightnessValue = { 50, 150, 200, 250 };
  196. private final int MAX_BTN_LEVEL = 2;
  197. private final int MAX_SLEEP_TIME = 180; // 슬립모드 최대시간 (시간단위 : 초)
  198. private final int MIN_SLEEP_TIME = 30; // 슬립모드 최소시간 (시간단위 : 초)
  199. private final int MAX_CLOSESENSOR_LEVEL = 5;
  200. private final int MAX_OPENDELAY_LEVEL = 2;
  201. private int [] DoorLock_OpenDelayTime = { 3, 5, 10 };
  202. private int mVolumeLevel = 1;
  203. private int mLcdLevel = 4;
  204. private int mButtonLightLevel = 1;
  205. private int mSleepModeTime = 180; // 시간단위 : 초
  206. private int mCloseSensorLevel = 5;
  207. private boolean mAllAlarmSound = true;
  208. //private boolean mSite_DongtanLakeIPARK = false;
  209. private boolean mCarAlarmSound = true;
  210. private boolean mCallAlarmSound = true;
  211. private boolean mARSControl = true;
  212. private boolean mRemoteControl = true;
  213. private boolean mRemoteSmartLightControl = false;
  214. private boolean mSenSorLight_Share[] = {false, false};
  215. private int mSenSorLight_Share_Count = 0;
  216. private boolean mSenSorLight_Couple[] = {false, false};
  217. private int mSenSorLight_Couple_Count = 0;
  218. private boolean mNoisePopupUse = false;
  219. private boolean mPhoneLightCtrUse = false;
  220. private boolean mEnergyControllerComm = false;
  221. private boolean mBandLocAlarm = false;
  222. private boolean mEasyModeUse = false;
  223. private int mOpenDelayTime = 0; // index
  224. private int EmListIndex = 0;
  225. // [API]
  226. private WallPadAPI mWallPadAPI = null;
  227. private IntLightAPI mIntLightAPI = null;
  228. private SdbAPI mSdbAPI = null;
  229. private KnxAPI mKnxAPI = null;
  230. InRoomDetectSensor_API mInRoomDetectSensor_API = null;
  231. //private IntLightAPI intLightAPI = null;
  232. BathRoomSensorLightClass mBathRoomSensorLightClass = null;
  233. EnergyControllerClass mEnergyControllerClass = null;
  234. SmartKeyRfDoorAPI mSmartKeyRfDoorAPI;
  235. private int BatchStatus = -1;
  236. // [Value]
  237. public String setting_manual_str = "";
  238. // [Class]
  239. private PowerManager pm;
  240. private PowerManager.WakeLock wl;
  241. private V40IF mV40IF = new V40IF();
  242. public int m_CurPage = 1;
  243. public int m_ToTalPage = 0;
  244. private int nDistributionPanelType = Version.DISTRIBUTION_MODEL.NON_USE;
  245. private boolean bBathSensorUse = false;
  246. private boolean bRoomNameEditV2Usage = false;
  247. private boolean isSubWallPad = false; //subwallPad 사용 여부 (TRUE : 사용 , FASLE : 사용안함)
  248. boolean internetUse = false;
  249. boolean mNewDanjiServer = false;
  250. int nLightType = WallpadDeviceSet.REMOTECTRL_BASIC_LIGHT;
  251. boolean easyModeUse = false;
  252. private void initInfo() {
  253. try {
  254. int getSleepTime = Settings.System.getInt(this.getContext().getContentResolver(), SCREEN_OFF_TIMEOUT);
  255. Log.d(TAG, "[initInfo] getSleepTime : " + getSleepTime);
  256. mSleepModeTime = (getSleepTime/1000);
  257. if (mSleepModeTime < MIN_SLEEP_TIME) mSleepModeTime = MIN_SLEEP_TIME;
  258. int getBrightness = Settings.System.getInt(this.getContext().getContentResolver(), "screen_brightness");
  259. WallpadDeviceSet wpddevset = new WallpadDeviceSet(this.getContext());
  260. int noiseUse = wpddevset.Get_NoiseSensor_Use();
  261. nDistributionPanelType = wpddevset.Get_DistributionPannelType_Info();
  262. bBathSensorUse = wpddevset.Get_BathSensorUse();
  263. bRoomNameEditV2Usage = wpddevset.Get_RoomNameEditUse();
  264. isSubWallPad = wpddevset.GetSubWpdUse(); // 월패드 종류 (TRUE: Sub / FALSE: Main)
  265. internetUse = wpddevset.Get_NonInternetSupportUse();
  266. mNewDanjiServer = wpddevset.GetNewDanjiServer();
  267. nLightType = wpddevset.Get_RemoteCtrl_LightType();
  268. easyModeUse = wpddevset.Get_EasyModeUX_Support();
  269. //String[] getData = null;
  270. //getData = wpddevset.GetSettingData("site_code");
  271. wpddevset.closeDB();
  272. Log.i(TAG, "[initInfo] bBathSensorUse [" + bBathSensorUse + "], bRoomNameEditV2Usage [" + bRoomNameEditV2Usage + "]");
  273. /*String SiteCode = "";
  274. if(getData.length == 2)
  275. {
  276. SiteCode = getData[1];
  277. }
  278. if(SiteCode.equals("31420008")) // 동탄 호수공원 아이파크 현장 - 욕실 센서등 설정 그리기
  279. {
  280. mSite_DongtanLakeIPARK = true;
  281. }*/
  282. for (int i = 0; i < MAX_LCD_LEVEL; i++) {
  283. if (LCD_BrightnessValue[i] == getBrightness) {
  284. mLcdLevel = i+1;
  285. }
  286. }
  287. // 추가하고 싶은 항목이 있으면 여기서 추가하도록 한다.
  288. SetKind data = new SetKind( TYPE_L_R_ARROW , ConfingSettingMainID.button.SYS_VOLUME_LEFT , ConfingSettingMainID.button.SYS_VOLUME_RIGHT , TXT_SYSTEM_VOLUME );
  289. SettingData.add(data);
  290. setting_manual_str += "SYSTEM_VOL:" + SettingData.size() + "/";
  291. data = new SetKind( TYPE_L_R_ARROW , ConfingSettingMainID.button.LCDLEVEL_LEFT , ConfingSettingMainID.button.LCDLEVEL_RIGHT , TXT_LCD_LEVEL );
  292. SettingData.add(data);
  293. setting_manual_str += "LCD_BRIGHT:" + SettingData.size() + "/";
  294. if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL) {
  295. data = new SetKind( TYPE_L_R_ARROW , ConfingSettingMainID.button.BUTTONLEVEL_LEFT , ConfingSettingMainID.button.BUTTONLEVEL_RIGHT , TXT_BTN_LEVEL );
  296. SettingData.add(data);
  297. }
  298. 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
  299. || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
  300. || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF)
  301. {
  302. //TXT_CLOSE_SENSOR
  303. data = new SetKind( TYPE_L_R_ARROW , ConfingSettingMainID.button.CLOSESENSOR_LEFT , ConfingSettingMainID.button.CLOSESENSOR_RIGHT , TXT_CLOSE_SENSOR );
  304. SettingData.add(data);
  305. setting_manual_str += "CLOSE_SENSOR:" + SettingData.size() + "/";
  306. }
  307. data = new SetKind( TYPE_L_R_ARROW , ConfingSettingMainID.button.SLEEPTIME_LEFT , ConfingSettingMainID.button.SLEEPTIME_RIGHT , TXT_SLEEP_TIME );
  308. SettingData.add(data);
  309. setting_manual_str += "SLEEP_TIME:" + SettingData.size() + "/";
  310. if(!isSubWallPad)
  311. {
  312. data = new SetKind( TYPE_CHECKBOX , ConfingSettingMainID.button.ALARM_SOUND_CHECKBOX_USE , ConfingSettingMainID.button.ALARM_SOUND_CHECKBOX_NOTUSE , TXT_ALARM_SOUND );
  313. SettingData.add(data);
  314. setting_manual_str += "NOTI_SOUND:" + SettingData.size() + "/";
  315. //data = new SetKind(TYPE_CHECKBOX , ConfingSettingMainID.button.CAR_SOUND_CHECKBOX_USE , ConfingSettingMainID.button.CAR_SOUND_CHECKBOX_NOTUSE , TXT_CAR_SOUND);
  316. //SettingData.add(data);
  317. //setting_manual_str += "CAR_ARRIVAL_SND:" + SettingData.size() + "/";
  318. }
  319. if (MainActivity.bRemoteCallUse) {
  320. data = new SetKind(TYPE_CHECKBOX, ConfingSettingMainID.button.CALL_SOUND_CHECKBOX_USE, ConfingSettingMainID.button.CALL_SOUND_CHECKBOX_NOTUSE, TXT_CALL_SOUND);
  321. SettingData.add(data);
  322. setting_manual_str += "CALL_NOTI_SND:" + SettingData.size() + "/";
  323. }
  324. // V40/A40i 플랫폼부터 ARS제어 사용안함
  325. // if (Version.getModelType() != Version.MODEL_TYPE.IHN_750
  326. // && Version.getModelType() != Version.MODEL_TYPE.IHN_1010 && Version.getModelType() != Version.MODEL_TYPE.IHN_1010_I
  327. // && Version.getModelType() != Version.MODEL_TYPE.IHN_1030_I
  328. // && Version.getModelType() != Version.MODEL_TYPE.IHN_1040 && Version.getModelType() != Version.MODEL_TYPE.IHN_1040_I
  329. // && Version.getModelType() != Version.MODEL_TYPE.IHN_1050 && Version.getModelType() != Version.MODEL_TYPE.IHN_1050_I
  330. // && Version.getModelType() != Version.MODEL_TYPE.IHN_T1010 && Version.getModelType() != Version.MODEL_TYPE.IHN_T1010_I
  331. // && Version.getModelType() != Version.MODEL_TYPE.IHN_HS101 && Version.getModelType() != Version.MODEL_TYPE.IHN_HS101_I
  332. // && Version.getModelType() != Version.MODEL_TYPE.IHN_1050DW_I && Version.getModelType() != Version.MODEL_TYPE.IHN_1020B_I)
  333. // {
  334. // if (Version.getModelType() != Version.MODEL_TYPE.IHN_1010 && Version.getModelType() != Version.MODEL_TYPE.IHN_1010_I
  335. // && Version.getModelType() != Version.MODEL_TYPE.IHN_1030_I
  336. // && Version.getModelType() != Version.MODEL_TYPE.IHN_1040 && Version.getModelType() != Version.MODEL_TYPE.IHN_1040_I
  337. // && Version.getModelType() != Version.MODEL_TYPE.IHN_1050 && Version.getModelType() != Version.MODEL_TYPE.IHN_1050_I
  338. // && Version.getModelType() != Version.MODEL_TYPE.IHN_T1010 && Version.getModelType() != Version.MODEL_TYPE.IHN_T1010_I
  339. // && Version.getModelType() != Version.MODEL_TYPE.IHN_HS101 && Version.getModelType() != Version.MODEL_TYPE.IHN_HS101_I
  340. // && Version.getModelType() != Version.MODEL_TYPE.IHN_1050DW_I && Version.getModelType() != Version.MODEL_TYPE.IHN_1020B_I)
  341. // {
  342. // data = new SetKind(TYPE_CHECKBOX , ConfingSettingMainID.button.ARS_CONTROL_CHECKBOX_USE , ConfingSettingMainID.button.ARS_CONTROL_CHECKBOX_NOTUSE , TXT_ARS_CONTROL );
  343. // SettingData.add(data);
  344. // setting_manual_str += "PHONE_ARS:" + SettingData.size() + "/";
  345. // }
  346. // }
  347. if (!Version.getGatewayUsage()) {
  348. // 대외향인 경우
  349. if (noiseUse == 1) {
  350. data = new SetKind(TYPE_CHECKBOX , ConfingSettingMainID.button.NOISE_POPUP_USE , ConfingSettingMainID.button.NOISE_POPUP_NOTUSE , TXT_INTERLAYTER_NOISE_POPUP );
  351. SettingData.add(data);
  352. setting_manual_str += "NOISE_USE:" + SettingData.size() + "/";
  353. }
  354. if(!isSubWallPad)
  355. {
  356. //data = new SetKind( TYPE_BUTTON , ConfingSettingMainID.button.AS_CALL , 0 , TXT_AS_CALL );
  357. //SettingData.add(data);
  358. }
  359. //setting_manual_str += "AS_REGI:" + SettingData.size() + "/";
  360. if (Version.getModelType() != Version.MODEL_TYPE.IHN_750 && !bRoomNameEditV2Usage && !isSubWallPad) {
  361. //data = new SetKind( TYPE_BUTTON , ConfingSettingMainID.button.NAME_SET , 0 , TXT_ROOM_NAME );
  362. //SettingData.add(data);
  363. //setting_manual_str += "ROOMNAME_SET:" + SettingData.size() + "/";
  364. }
  365. if (!internetUse && !isSubWallPad) {
  366. data = new SetKind(TYPE_CHECKBOX , ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_USE , ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_NOTUSE , TXT_RMOTE_CONTROL );
  367. SettingData.add(data);
  368. setting_manual_str += "REMOTE_CTR:" + SettingData.size() + "/";
  369. if (mNewDanjiServer) {
  370. //data = new SetKind( TYPE_BUTTON_WEBPWD , ConfingSettingMainID.button.WEB_CTR_PWD , 0 , TXT_WEB_CTR_PWD );
  371. //SettingData.add(data);
  372. //setting_manual_str += "WEB_CTR_PWD:" + SettingData.size() + "/";
  373. }
  374. }
  375. }
  376. else
  377. {
  378. if(!isSubWallPad)
  379. {
  380. //data = new SetKind( TYPE_BUTTON , ConfingSettingMainID.button.AS_CALL , 0 , TXT_AS_CALL );
  381. //SettingData.add(data);
  382. //setting_manual_str += "AS_REGI:" + SettingData.size() + "/";
  383. }
  384. if (!internetUse && !isSubWallPad) {
  385. data = new SetKind(TYPE_CHECKBOX, ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_USE, ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_NOTUSE, TXT_RMOTE_CONTROL);
  386. SettingData.add(data);
  387. setting_manual_str += "REMOTE_CTR:" + SettingData.size() + "/";
  388. //data = new SetKind(TYPE_BUTTON_WEBPWD, ConfingSettingMainID.button.WEB_CTR_PWD, 0, TXT_WEB_CTR_PWD);
  389. //SettingData.add(data);
  390. //setting_manual_str += "WEB_CTR_PWD:" + SettingData.size() + "/";
  391. }
  392. }
  393. 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
  394. || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
  395. || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF)
  396. && (nDistributionPanelType == Version.DISTRIBUTION_MODEL.SMART_DIST))
  397. {
  398. if (!internetUse) {
  399. // data = new SetKind(TYPE_CHECKBOX , ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_USE , ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_NOTUSE , TXT_RMOTE_CONTROL);
  400. // SettingData.add(data);
  401. // setting_manual_str += "REMOTE_CTR:" + SettingData.size() + "/";
  402. //
  403. // data = new SetKind(TYPE_BUTTON_WEBPWD , ConfingSettingMainID.button.WEB_CTR_PWD , 0 , TXT_WEB_CTR_PWD);
  404. // SettingData.add(data);
  405. // setting_manual_str += "WEB_CTR_PWD:" + SettingData.size() + "/";
  406. if (nLightType == WallpadDeviceSet.REMOTECTRL_USER_SELECT) {
  407. // 스마트조명 지원여부가 사용자선택인 경우
  408. //data = new SetKind(TYPE_CHECKBOX_SMARTLIGHT , ConfingSettingMainID.button.REMOTE_CONTROL_LIGHT_CHECKBOX_SMART, ConfingSettingMainID.button.REMOTE_CONTROL_LIGHT_CHECKBOX_NORMAL, TXT_RMOTE_SMARTLIGHT_CONTROL);
  409. //SettingData.add(data);
  410. //setting_manual_str += "REMOTE_CTR_SMARTLIGHT:" + SettingData.size() + "/";
  411. }
  412. }
  413. //TXT_SMARTPHONE_LIGHTCTR
  414. data = new SetKind( TYPE_CHECKBOX , ConfingSettingMainID.button.SMARTPHONE_LIGHTCTR_USE , ConfingSettingMainID.button.SMARTPHONE_LIGHTCTR_NOTUSE , TXT_SMARTPHONE_LIGHTCTR, "(BLE 전용)" );
  415. SettingData.add(data);
  416. setting_manual_str += "SMARTLIGHT_APP:" + SettingData.size() + "/";
  417. }
  418. if (easyModeUse) {
  419. data = new SetKind(TYPE_CHECKBOX, ConfingSettingMainID.button.EASYMODE_CHECKBOX_USE, ConfingSettingMainID.button.EASYMODE_CHECKBOX_NOTUSE, TXT_EASYMODE);
  420. SettingData.add(data);
  421. setting_manual_str += "EASYMODE_USE:" + SettingData.size() + "/";
  422. }
  423. boolean bRemoconActive = GetRemoconActive();
  424. if (bRemoconActive) {
  425. //data = new SetKind( TYPE_BUTTON , ConfingSettingMainID.button.REMOCON_REG , 0 , TXT_REMOCON_REG );
  426. //SettingData.add(data);
  427. }
  428. boolean bDoorLockOpenDelay = (getDoorLockOpenDelayUse() > 0) ? true : false;
  429. if (bDoorLockOpenDelay) {
  430. data = new SetKind(TYPE_L_R_ARROW , ConfingSettingMainID.button.OPENDELAY_LEFT , ConfingSettingMainID.button.OPENDELAY_RIGHT , TXT_OPEN_DELAY);
  431. SettingData.add(data);
  432. setting_manual_str += "OPEN_DELAY:" + SettingData.size() + "/";
  433. }
  434. m_CurPage = 1;
  435. Log.d(TAG, "List Count = " + SettingData.size());
  436. if (SettingData.size() <= 6) {
  437. m_ToTalPage = 1;
  438. }
  439. else if (SettingData.size() > 6 && SettingData.size() <= 12) {
  440. m_ToTalPage = 2;
  441. }
  442. else if (SettingData.size() > 12 && SettingData.size() <= 18) {
  443. m_ToTalPage = 3;
  444. }
  445. //setting_manual_str += "ToTalPage:" + m_ToTalPage + "/";
  446. } catch (RuntimeException re) {
  447. LogUtil.errorLogInfo("", TAG, re);
  448. } catch (Exception e) {
  449. Log.e(TAG, "[Exception] initInfo()");
  450. //e.printStackTrace();
  451. LogUtil.errorLogInfo("", TAG, e);
  452. }
  453. }
  454. private void DrawContentsPage(int page) {
  455. int[] LeftBtnImg = {R.drawable.but_left, R.drawable.but_left_p};
  456. int[] LeftBtnDisImg = {R.drawable.but_arrow_left_disable, R.drawable.but_arrow_left_disable};
  457. int[] RightBtnImg = {R.drawable.but_right, R.drawable.but_right_p};
  458. int[] RightBtnDisImg = {R.drawable.but_arrow_right_disable, R.drawable.but_arrow_right_disable};
  459. try {
  460. for (int i = 0; i < 6; i++) {
  461. if (TextLineAgrray[i] != null) {
  462. this.getLayout().removeView(TextLineAgrray[i]);
  463. TextLineAgrray[i] = null;
  464. }
  465. if (Btn_Left[i] != null) {
  466. this.getLayout().removeView(Btn_Left[i]);
  467. Btn_Left[i] = null;
  468. }
  469. if (Text_Box[i] != null) {
  470. this.getLayout().removeView(Text_Box[i]);
  471. Text_Box[i] = null;
  472. }
  473. if (Btn_Right[i] != null) {
  474. this.getLayout().removeView(Btn_Right[i]);
  475. Btn_Right[i] = null;
  476. }
  477. if (textValue[i] != null) {
  478. this.getLayout().removeView(textValue[i]);
  479. textValue[i] = null;
  480. }
  481. if (UseCheckBoxAgrray[i] != null) {
  482. this.getLayout().removeView(UseCheckBoxAgrray[i]);
  483. UseCheckBoxAgrray[i] = null;
  484. }
  485. if (UseTextAgrray[i] != null) {
  486. this.getLayout().removeView(UseTextAgrray[i]);
  487. UseTextAgrray[i] = null;
  488. }
  489. if (NotUseCheckBoxAgrray[i] != null) {
  490. this.getLayout().removeView(NotUseCheckBoxAgrray[i]);
  491. NotUseCheckBoxAgrray[i] = null;
  492. }
  493. if (NotUseTextAgrray[i] != null) {
  494. this.getLayout().removeView(NotUseTextAgrray[i]);
  495. NotUseTextAgrray[i] = null;
  496. }
  497. if (Btn_Popup[i] != null) {
  498. this.getLayout().removeView(Btn_Popup[i]);
  499. Btn_Popup[i] = null;
  500. }
  501. }
  502. } catch (RuntimeException re) {
  503. LogUtil.errorLogInfo("", TAG, re);
  504. } catch (Exception e) {
  505. Log.e(TAG, "[Exception] DrawContentsPage(int page) 1");
  506. //e.printStackTrace();
  507. LogUtil.errorLogInfo("", TAG, e);
  508. }
  509. try {
  510. int arrayIdx = 0;
  511. int shareCount = 0;
  512. int coupleCount = 0;
  513. int lineIdx = 0;
  514. for (int a = 0; a < lineBg.length; a++) {
  515. if (lineBg[a].getVisibility() == View.INVISIBLE) {
  516. // 라인 다 보이도록 설정 후, 안보이는 경우에만 제거하도록 함
  517. lineBg[a].setVisibility(View.VISIBLE);
  518. }
  519. }
  520. for (int i = (page - 1) * 6; i < page * 6 && i < SettingData.size(); i++) {
  521. TextLineAgrray[arrayIdx] = new WpadTextView(this.getContext(), false, 346, 54, Gravity.LEFT, 0xff966432, Common.fontsize._36, true, ConfingSettingMainID.text.LINE_TEXT_01);
  522. ViewRegistration(this.getLayout(), TextLineAgrray[arrayIdx], Common.ImgPosion.GetX(252), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  523. TextLineAgrray[arrayIdx].setText(SettingData.get(i).m_TxtTitle);
  524. if (SettingData.get(i).m_TxtDetail != null) {
  525. TextLineArray_detail[arrayIdx] = new WpadTextView(this.getContext(), false, 346, 54, Gravity.LEFT, 0xff966432, Common.fontsize._18, true, ConfingSettingMainID.text.LINE_TEXT_02);
  526. ViewRegistration(this.getLayout(), TextLineArray_detail[arrayIdx], Common.ImgPosion.GetX(252), Common.ImgPosion.GetY(161 + 90 * arrayIdx));
  527. TextLineArray_detail[arrayIdx].setText(SettingData.get(i).m_TxtDetail);
  528. }
  529. else if (SettingData.get(i).m_TxtDetail == null) {
  530. if (TextLineArray_detail[arrayIdx] != null) {
  531. TextLineArray_detail[arrayIdx].setText("");
  532. TextLineArray_detail[arrayIdx] = null;
  533. }
  534. }
  535. if (SettingData.get(i).m_Type == TYPE_L_R_ARROW) {
  536. Btn_Left[arrayIdx] = new WpadImageView(this.getContext(), TOUCH_KIND.BUTTON, 80, 54, LeftBtnImg, LeftBtnDisImg, SettingData.get(i).m_EventID_01);
  537. ViewRegistration(this.getLayout(), Btn_Left[arrayIdx], Common.ImgPosion.GetX(598), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  538. //Text_Box[arrayIdx] = new WpadImageView(this.getContext(), TOUCH_KIND.NONE, 146, 44, R.drawable.box_blank, 0, ConfingSettingMainID.image.TEXT_BG01 + arrayIdx);
  539. //ViewRegistration(this.getLayout(), Text_Box[arrayIdx], ImgPosion.GetX(661), ImgPosion.GetY(116 + 64 * arrayIdx));
  540. Btn_Right[arrayIdx] = new WpadImageView(this.getContext(), TOUCH_KIND.BUTTON, 80, 54, RightBtnImg, RightBtnDisImg, SettingData.get(i).m_EventID_02);
  541. ViewRegistration(this.getLayout(), Btn_Right[arrayIdx], Common.ImgPosion.GetX(932), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  542. textValue[arrayIdx] = new WpadTextView(this.getContext(), false, 254, 54, Gravity.CENTER, Color.WHITE, Common.fontsize._36, true, ConfingSettingMainID.text.VALUE_TEXT_01 + arrayIdx);
  543. ViewRegistration(this.getLayout(), textValue[arrayIdx], Common.ImgPosion.GetX(682), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  544. SettingData.get(i).SetViewIdx(arrayIdx);
  545. }
  546. else if (SettingData.get(i).m_Type == TYPE_CHECKBOX) {
  547. 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);
  548. ViewRegistration(this.getLayout(), UseCheckBoxAgrray[arrayIdx], Common.ImgPosion.GetX(594), Common.ImgPosion.GetY(114 + 90 * arrayIdx));
  549. UseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 138, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, SettingData.get(i).m_EventID_01);
  550. ViewRegistration(this.getLayout(), UseTextAgrray[arrayIdx], Common.ImgPosion.GetX(682), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  551. UseTextAgrray[arrayIdx].setText("사용");
  552. 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);
  553. ViewRegistration(this.getLayout(), NotUseCheckBoxAgrray[arrayIdx], Common.ImgPosion.GetX(820), Common.ImgPosion.GetY(116 + 90 * arrayIdx));
  554. NotUseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 138, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, SettingData.get(i).m_EventID_02);
  555. ViewRegistration(this.getLayout(), NotUseTextAgrray[arrayIdx], Common.ImgPosion.GetX(908), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  556. NotUseTextAgrray[arrayIdx].setText("사용안함");
  557. SettingData.get(i).SetViewIdx(arrayIdx);
  558. }
  559. else if (SettingData.get(i).m_Type == TYPE_BUTTON) {
  560. 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);
  561. ViewRegistration(this.getLayout(), Btn_Popup[arrayIdx], Common.ImgPosion.GetX(598), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  562. SettingData.get(i).SetViewIdx(arrayIdx);
  563. }
  564. else if (SettingData.get(i).m_Type == TYPE_BUTTON_WEBPWD) {
  565. lineBg[lineIdx].setVisibility(View.INVISIBLE);
  566. TextLineAgrray[arrayIdx].setText(""); // 제목 안나오도록 함.
  567. 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);
  568. ViewRegistration(this.getLayout(), Btn_Popup[arrayIdx], Common.ImgPosion.GetX(598), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  569. SettingData.get(i).SetViewIdx(arrayIdx);
  570. }
  571. else if (SettingData.get(i).m_Type == TYPE_CHECKBOX_SMARTLIGHT) {
  572. lineBg[lineIdx].setVisibility(View.INVISIBLE);
  573. TextLineAgrray[arrayIdx].setText(""); // 제목 안나오도록 함.
  574. 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);
  575. ViewRegistration(this.getLayout(), UseCheckBoxAgrray[arrayIdx], Common.ImgPosion.GetX(594), Common.ImgPosion.GetY(114 + 90 * arrayIdx));
  576. UseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 138, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._30, true, SettingData.get(i).m_EventID_01);
  577. ViewRegistration(this.getLayout(), UseTextAgrray[arrayIdx], Common.ImgPosion.GetX(682), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  578. UseTextAgrray[arrayIdx].setText("스마트조명");
  579. 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);
  580. ViewRegistration(this.getLayout(), NotUseCheckBoxAgrray[arrayIdx], Common.ImgPosion.GetX(820), Common.ImgPosion.GetY(116 + 90 * arrayIdx));
  581. NotUseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 138, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._30, true, SettingData.get(i).m_EventID_02);
  582. ViewRegistration(this.getLayout(), NotUseTextAgrray[arrayIdx], Common.ImgPosion.GetX(908), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  583. NotUseTextAgrray[arrayIdx].setText("일반조명");
  584. SettingData.get(i).SetViewIdx(arrayIdx);
  585. }
  586. else if (SettingData.get(i).m_Type == TYPE_SENSORLIGHT_CHECK_USE) {
  587. if (mBathRoomSensorLightClass != null) {
  588. Log.i(TAG, "[DrawContentsPage] - TYPE_SENSORLIGHT_CHECK_USE start @@@@@@@@");
  589. if (mBathRoomSensorLightClass.Status.length == 0) {
  590. Log.i(TAG, "[DrawContentsPage] - Sensor Light NOT INSTALL !!!");
  591. NotUseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 150, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, SettingData.get(i).m_EventID_02);
  592. ViewRegistration(this.getLayout(), NotUseTextAgrray[arrayIdx], Common.ImgPosion.GetX(598), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  593. NotUseTextAgrray[arrayIdx].setText("설치 안됨");
  594. }
  595. 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);
  596. ViewRegistration(this.getLayout(), UseCheckBoxAgrray[arrayIdx], Common.ImgPosion.GetX(594), Common.ImgPosion.GetY(114 + 90 * arrayIdx));
  597. UseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 138, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, SettingData.get(i).m_EventID_01);
  598. ViewRegistration(this.getLayout(), UseTextAgrray[arrayIdx], Common.ImgPosion.GetX(682), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  599. UseTextAgrray[arrayIdx].setText("사용");
  600. 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);
  601. ViewRegistration(this.getLayout(), NotUseCheckBoxAgrray[arrayIdx], Common.ImgPosion.GetX(820), Common.ImgPosion.GetY(116 + 90 * arrayIdx));
  602. NotUseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 138, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, SettingData.get(i).m_EventID_02);
  603. ViewRegistration(this.getLayout(), NotUseTextAgrray[arrayIdx], Common.ImgPosion.GetX(908), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  604. NotUseTextAgrray[arrayIdx].setText("사용안함");
  605. try {
  606. if (page == 2) {
  607. // R2, R4 등의 침실에너지미터 번호 나오는 배열 표기
  608. SensorEMnumArray[EmListIndex] = new WpadTextView(this.getContext(), false, 138, 54, Gravity.LEFT, Color.GRAY, Common.fontsize._20, true, ID.ConfingSettingMainID.text.SENSORLIGHT_EM_R1 + EmListIndex);
  609. ViewRegistration(this.getLayout(), SensorEMnumArray[EmListIndex], Common.ImgPosion.GetX(1100), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  610. SensorEMnumArray[EmListIndex].setText(sensorEMnumArr.get(EmListIndex) );
  611. SensorEMnumArray[EmListIndex].setVisibility(View.VISIBLE);
  612. }
  613. EmListIndex++;
  614. if (EmListIndex == 2) { EmListIndex = 0; }
  615. SettingData.get(i).SetViewIdx(arrayIdx);
  616. } catch (RuntimeException re) {
  617. LogUtil.errorLogInfo("", TAG, re);
  618. } catch (Exception ee) {
  619. //ee.printStackTrace();
  620. LogUtil.errorLogInfo("", TAG, ee);
  621. }
  622. }
  623. else {
  624. Log.w(TAG, "[DrawContentsPage] - Not Using Case");
  625. }
  626. SettingData.get(i).SetViewIdx(arrayIdx);
  627. }
  628. else if (SettingData.get(i).m_Type == TYPE_SENSORLIGHT_CHECK_NON) {
  629. if (mBathRoomSensorLightClass == null) {
  630. Log.i(TAG, "[DrawContentsPage] - Sensor Light NOT INSTALL !!!");
  631. NotUseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), true, 150, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._36, true, SettingData.get(i).m_EventID_02);
  632. ViewRegistration(this.getLayout(), NotUseTextAgrray[arrayIdx], Common.ImgPosion.GetX(598), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  633. NotUseTextAgrray[arrayIdx].setText("설치 안됨");
  634. }
  635. else {
  636. Log.w(TAG, "[DrawContentsPage] - Not Using Case");
  637. }
  638. SettingData.get(i).SetViewIdx(arrayIdx);
  639. }
  640. else if (SettingData.get(i).m_Type == TYPE_SENSORLIGHT_BATCH_ON) {
  641. if (BatchStatus == 0) {
  642. // 일괄소등 중인 경우, 센서등 설정변경 불가
  643. Log.i(TAG, "[DrawContentsPage] - BatchStatus ON --> Can't change SensorLight USING");
  644. NotUseTextAgrray[arrayIdx] = new WpadTextView(this.getContext(), false, 500, 54, Gravity.LEFT, Color.WHITE, Common.fontsize._24, true, SettingData.get(i).m_EventID_02);
  645. ViewRegistration(this.getLayout(), NotUseTextAgrray[arrayIdx], Common.ImgPosion.GetX(598), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  646. NotUseTextAgrray[arrayIdx].setText("일괄소등 중에는 센서등 설정을 변경할 수 없습니다.");
  647. try {
  648. if (page == 2) {
  649. // R2, R4 등의 침실에너지미터 번호 나오는 배열 표기
  650. SensorEMnumArray[EmListIndex] = new WpadTextView(this.getContext(), false, 138, 54, Gravity.LEFT, Color.GRAY, Common.fontsize._20, true, ID.ConfingSettingMainID.text.SENSORLIGHT_EM_R1 + EmListIndex);
  651. ViewRegistration(this.getLayout(), SensorEMnumArray[EmListIndex], Common.ImgPosion.GetX(1100), Common.ImgPosion.GetY(131 + 90 * arrayIdx));
  652. SensorEMnumArray[EmListIndex].setText(sensorEMnumArr.get(EmListIndex) );
  653. SensorEMnumArray[EmListIndex].setVisibility(View.VISIBLE);
  654. }
  655. EmListIndex++;
  656. if(EmListIndex == 2) { EmListIndex = 0; }
  657. SettingData.get(i).SetViewIdx(arrayIdx);
  658. } catch (RuntimeException re) {
  659. LogUtil.errorLogInfo("", TAG, re);
  660. } catch (Exception ee) {
  661. //ee.printStackTrace();
  662. LogUtil.errorLogInfo("", TAG, ee);
  663. }
  664. }
  665. else {
  666. Log.w(TAG, "[DrawContentsPage] - Not Using Case");
  667. }
  668. SettingData.get(i).SetViewIdx(arrayIdx);
  669. }
  670. //////////////////////////////////////////////////////////////////////
  671. if (SettingData.get(i).m_TxtTitle.equals(TXT_SYSTEM_VOLUME)) {
  672. DrawVolumeLevel(mVolumeLevel);
  673. }
  674. if (SettingData.get(i).m_TxtTitle.equals(TXT_LCD_LEVEL)) {
  675. DrawLcdLevel(mLcdLevel);
  676. }
  677. if (SettingData.get(i).m_TxtTitle.equals(TXT_BTN_LEVEL)) {
  678. DrawButtonLightLevel(mButtonLightLevel);
  679. }
  680. if (SettingData.get(i).m_TxtTitle.equals(TXT_SLEEP_TIME)) {
  681. DrawSleepTime(mSleepModeTime);
  682. }
  683. if (SettingData.get(i).m_TxtTitle.equals(TXT_ALARM_SOUND)) {
  684. DrawAlramSound(mAllAlarmSound);
  685. }
  686. if (SettingData.get(i).m_TxtTitle.equals(TXT_CAR_SOUND)) {
  687. DrawCarAlarmSound(mCarAlarmSound);
  688. }
  689. if (SettingData.get(i).m_TxtTitle.equals(TXT_CALL_SOUND)) {
  690. DrawCallAlarmSound(mCallAlarmSound);
  691. }
  692. if (SettingData.get(i).m_TxtTitle.equals(TXT_BAND_LOCATION)) {
  693. DrawBandLocAlarm(mBandLocAlarm);
  694. }
  695. if (SettingData.get(i).m_TxtTitle.equals(TXT_INTERLAYTER_NOISE_POPUP)) {
  696. DrawNoisePopupUse(mNoisePopupUse);
  697. }
  698. if (SettingData.get(i).m_TxtTitle.equals(TXT_ARS_CONTROL)) {
  699. DrawARSControl(mARSControl);
  700. }
  701. if (SettingData.get(i).m_TxtTitle.equals(TXT_RMOTE_CONTROL)) {
  702. DrawRemoteControl(mRemoteControl);
  703. }
  704. if (SettingData.get(i).m_TxtTitle.equals(TXT_RMOTE_SMARTLIGHT_CONTROL)) {
  705. DrawRemoteSmartLightControl(mRemoteSmartLightControl);
  706. }
  707. if (SettingData.get(i).m_TxtTitle.equals(TXT_CLOSE_SENSOR)) {
  708. DrawCloseSensorLevel(mCloseSensorLevel);
  709. }
  710. if (SettingData.get(i).m_TxtTitle.equals(TXT_SMARTPHONE_LIGHTCTR)) {
  711. DrawPhoneLightCtrUse(mPhoneLightCtrUse);
  712. }
  713. if (bBathSensorUse) {
  714. if (SettingData.get(i).m_TxtTitle.contains(TXT_SHAREBATH)) {
  715. DrawSensorLight_Share(mSenSorLight_Share[shareCount], SettingData.get(i).m_TxtTitle, SettingData.get(i).m_EMname); // 몇번째인지도 추가해서 보내기?
  716. shareCount++;
  717. }
  718. if (SettingData.get(i).m_TxtTitle.contains(TXT_COUPLEBATH)) {
  719. DrawSensorLight_Couple(mSenSorLight_Couple[coupleCount], SettingData.get(i).m_TxtTitle, SettingData.get(i).m_EMname);
  720. coupleCount++;
  721. }
  722. }
  723. if (SettingData.get(i).m_TxtTitle.equals(TXT_EASYMODE)) {
  724. DrawEasyMode(mEasyModeUse, false);
  725. }
  726. if (SettingData.get(i).m_TxtTitle.equals(TXT_OPEN_DELAY)) {
  727. DrawDoorLockOpenDelay(mOpenDelayTime);
  728. }
  729. lineIdx++;
  730. arrayIdx++;
  731. }
  732. if (mPageText != null) {
  733. mPageText.setText(page + "/"+m_ToTalPage);
  734. }
  735. if (page != 2) {
  736. if (SensorEMnumArray[0] != null) {
  737. SensorEMnumArray[0].setVisibility(View.INVISIBLE);
  738. SensorEMnumArray[0].setText("");
  739. }
  740. if (SensorEMnumArray[1] != null) {
  741. SensorEMnumArray[1].setVisibility(View.INVISIBLE);
  742. SensorEMnumArray[1].setText("");
  743. }
  744. for (int a = 0; a < TextLineArray_detail.length; a++) {
  745. if (TextLineArray_detail[a] != null) {
  746. TextLineArray_detail[a].setText("");
  747. TextLineArray_detail[a] = null;
  748. }
  749. }
  750. }
  751. //page 버튼 disable
  752. if (SettingData.size() > 6) {
  753. if (page == m_ToTalPage) {
  754. Btn_NextPage.setButtonEventOffEnable(R.drawable.add_notice_btn_down_disable);
  755. Btn_PrevPage.setButtonEventOffDisable();
  756. } else if (page == 1) {
  757. Btn_PrevPage.setButtonEventOffEnable(R.drawable.add_notice_btn_up_disable);
  758. Btn_NextPage.setButtonEventOffDisable();
  759. } else if (page > 1 && page < m_ToTalPage) {
  760. Btn_PrevPage.setButtonEventOffDisable();
  761. Btn_NextPage.setButtonEventOffDisable();
  762. }
  763. }
  764. } catch (RuntimeException re) {
  765. LogUtil.errorLogInfo("", TAG, re);
  766. } catch (Exception e) {
  767. Log.e(TAG, "[Exception] DrawContentsPage(int page) 2");
  768. //e.printStackTrace();
  769. LogUtil.errorLogInfo("", TAG, e);
  770. }
  771. }
  772. public String GetSensorLightName(byte index) {
  773. String retStr = "";
  774. if(index == COUPLE_BATHROOM_SENSOR) {retStr = "부부욕실";}
  775. else if(index == SHARED_BATHROOM_SENSOR) {retStr = "공용욕실";}
  776. return retStr;
  777. }
  778. public ConfigSettingMainScreen(Context context, RelativeLayout layout, WallPadAPI wpapi, int operationMode) {
  779. super(context, layout);
  780. Log.d(TAG, "[START - Screen] --------------------------------------------");
  781. mWallPadAPI = wpapi;
  782. GetDBConfigInitValue();
  783. initInfo();
  784. if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL) {
  785. mIntLightCheckHandler.sendEmptyMessage(0);
  786. }
  787. 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
  788. || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
  789. || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF)
  790. {
  791. mSensorLightCheckHandler.sendEmptyMessage(0);
  792. }
  793. Background = new WpadImageView(context, TOUCH_KIND.NONE, 1280, 690, R.drawable.bg_body, 0, ID.ConfingSettingMainID.image.BACKGROUND);
  794. ViewRegistration(layout, Background, Common.ImgPosion.GetX(0), Common.ImgPosion.GetY(110));
  795. /*Background_1 = new WpadImageView(context, TOUCH_KIND.NONE, 996, 542, R.drawable.add_notice_bgr, 0, ConfingSettingMainID.image.BACKGROUND);
  796. ViewRegistration(layout, Background_1, Common.ImgPosion.GetX(142), Common.ImgPosion.GetY(112));*/
  797. //add_notice_bgr에 line 포함됨.
  798. for (int i = 0; i < 7; i++) {
  799. lineBg[i] = new WpadImageView(context, TOUCH_KIND.NONE, 996, 2, R.drawable.bg_setting_lines, 0, ConfingSettingMainID.image.LINE01);
  800. ViewRegistration(layout, lineBg[i], Common.ImgPosion.GetX(142), Common.ImgPosion.GetY(112 + 90*i));
  801. }
  802. if (SettingData.size() > 6) {
  803. 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);
  804. ViewRegistration(layout, Btn_PrevPage, Common.ImgPosion.GetX(398), Common.ImgPosion.GetY(670));
  805. 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);
  806. ViewRegistration(layout, Btn_NextPage, Common.ImgPosion.GetX(772), Common.ImgPosion.GetY(670));
  807. //mPageBg = new WpadImageView(context, TOUCH_KIND.NONE, 112, 62, R.drawable.add_notice_btn_page_normal, 0, ConfingSettingMainID.image.BACKGROUND);
  808. //ViewRegistration(layout, mPageBg, ImgPosion.GetX(557), ImgPosion.GetY(538));
  809. mPageText = new WpadTextView(context, false, 264, 110, Gravity.CENTER, Color.WHITE, Common.fontsize._36, false, ConfingSettingMainID.text.LINE_TEXT_01);
  810. ViewRegistration(layout, mPageText, Common.ImgPosion.GetX(508), Common.ImgPosion.GetY(670));
  811. }
  812. DrawContentsPage(1);
  813. Log.d(TAG, "[END - Screen] --------------------------------------------");
  814. }
  815. /**
  816. * (임시코드) m_IntLightCtrl 초기생성시 Connect 에 시간이 걸리며, <br>
  817. * m_IntLightCtrl 초기화후 바로 Get_IntLightController 등을 사용하여 API 를 가져올수 없기에, <br>
  818. * 본 딜레이 코드를 임시로 적용한다.
  819. */
  820. @SuppressLint("HandlerLeak")
  821. protected Handler mIntLightCheckHandler = new Handler()
  822. {
  823. @SuppressLint("HandlerLeak")
  824. @Override
  825. public void handleMessage(Message msg)
  826. {
  827. if (msg.what == 0) {
  828. if (mWallPadAPI != null) {
  829. if (mWallPadAPI.Check_Connect()) {
  830. mIntLightAPI = mWallPadAPI.Get_IntLightController();
  831. if (mIntLightAPI != null) {
  832. Log.i(TAG, "[mIntLightCheckHandler] mIntLightAPI is not null!!");
  833. mIntLightCheckHandler.sendEmptyMessageDelayed(1, 10);
  834. }
  835. else {
  836. Log.w(TAG, "[mIntLightCheckHandler] mIntLightAPI is null!!");
  837. mIntLightCheckHandler.sendEmptyMessageDelayed(0, 10);
  838. }
  839. }
  840. else {
  841. Log.w(TAG, "[mIntLightCheckHandler] mWallPadAPI.Check_Connect() fail!!");
  842. mIntLightCheckHandler.sendEmptyMessageDelayed(0, 10);
  843. }
  844. }
  845. }
  846. else if (msg.what == 1) {
  847. // String BR_NAME = ID.IcMainID.BR_LIGHT;
  848. // m_IntLightCtrl.regChangedBR(BR_NAME);
  849. // m_Delegate.addBrActionName(BR_NAME);
  850. }
  851. }
  852. };
  853. @SuppressLint("HandlerLeak")
  854. protected Handler mSensorLightCheckHandler = new Handler() {
  855. @SuppressLint("HandlerLeak")
  856. @Override
  857. public void handleMessage(Message msg) {
  858. if (msg.what == 0) {
  859. try {
  860. if (mWallPadAPI != null) {
  861. if (mWallPadAPI.Check_Connect()) {
  862. mSdbAPI = mWallPadAPI.Get_SdbController();
  863. mSmartKeyRfDoorAPI = mWallPadAPI.Get_SmartKeyRfDoorController();
  864. mInRoomDetectSensor_API = mWallPadAPI.Get_InRoomDetectSensor_API();
  865. mKnxAPI = mWallPadAPI.Get_KnxController();
  866. if (mSdbAPI != null) {
  867. // BLE 조명 제어 앱 사용여부 확인
  868. if (mSdbAPI.Refresh(SdbAPI.DEVICE_INDEX.ENERGY_CONT, (byte)0x00) >= 0) {
  869. mEnergyControllerClass = mSdbAPI.data.EnergyController;
  870. if (mEnergyControllerClass.Data.SmartPhoneLightControl == SMARTPHONE_LIGHT_CTRL_STATUS.NO_INFO) {
  871. Log.w(TAG, "[mSensorLightCheckHandler] EnergyController disconnected -> CommunicatedSmartPhoneLightControl : NO_INFO");
  872. mEnergyControllerComm = false;
  873. }
  874. else if (mEnergyControllerClass.Data.SmartPhoneLightControl == SMARTPHONE_LIGHT_CTRL_STATUS.CLR) {
  875. Log.i(TAG, "[mSensorLightCheckHandler] SmartPhoneLightControl : CLR (NOT USE)");
  876. mEnergyControllerComm = true;
  877. mPhoneLightCtrUse = false;
  878. }
  879. else if (mEnergyControllerClass.Data.SmartPhoneLightControl == SMARTPHONE_LIGHT_CTRL_STATUS.SET) {
  880. Log.i(TAG, "[mSensorLightCheckHandler] SmartPhoneLightControl : SET (USE)");
  881. mEnergyControllerComm = true;
  882. mPhoneLightCtrUse = true;
  883. }
  884. }
  885. else {
  886. Log.w(TAG, "[mSensorLightCheckHandler] mSdbAPI.Refresh(SdbAPI.DEVICE_INDEX.ENERGY_CONT, (byte)0x00) failed!!");
  887. }
  888. BatchStatus = mWallPadAPI.GetBatchSwitchStatus();
  889. Log.i(TAG, "[mSensorLightCheckHandler] BatchStatus : " + BatchStatus);
  890. if (bBathSensorUse) {
  891. try {
  892. mBathRoomSensorLightClass = mSdbAPI.Get_BathRoomSensorLight();
  893. if (mBathRoomSensorLightClass != null) {
  894. Log.i(TAG, "[mSensorLightCheckHandler] mBathRoomSensorLightClass.Count : " + mBathRoomSensorLightClass.Count);
  895. for (int i = 0; i < mBathRoomSensorLightClass.Status.length; i++) {
  896. Log.i(TAG, "[mSensorLightCheckHandler] mBathRoomSensorLightClass.EnergyIndex : " + mBathRoomSensorLightClass.Status[i].EnergyIndex);
  897. Log.i(TAG, "[mSensorLightCheckHandler] mBathRoomSensorLightClass.Usage : " + mBathRoomSensorLightClass.Status[i].Usage);
  898. Log.i(TAG, "[mSensorLightCheckHandler] mBathRoomSensorLightClass.UseOnOff : " + mBathRoomSensorLightClass.Status[i].UseOnOff);
  899. byte type = mBathRoomSensorLightClass.Status[i].Usage;
  900. if (type == COUPLE_BATHROOM_SENSOR) {
  901. mSenSorLight_Couple[mSenSorLight_Couple_Count] = mBathRoomSensorLightClass.Status[i].UseOnOff;
  902. sensorRoomNameArr.add(GetSensorLightName(type) + " 센서등");
  903. sensorRoomIdxArr.add(mBathRoomSensorLightClass.Status[i].EnergyIndex+1);
  904. sensorEMnumArr.add("R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1) + "");
  905. //SensorEMnumArray[i].setText("(R" + (bathRoomSensor.Status[i].EnergyIndex+1) + ")");
  906. if (BatchStatus == 0) {
  907. // 일괄소등 중
  908. SetKind data = new SetKind( "R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1),
  909. TYPE_SENSORLIGHT_BATCH_ON,
  910. ConfingSettingMainID.button.SENSORLIGHT_COUPLE_USE1 + i,
  911. ConfingSettingMainID.button.SENSORLIGHT_COUPLE_NOTUSE1 + i,
  912. GetSensorLightName(type) + " 센서등");
  913. SettingData.add(data);
  914. Log.i(TAG, "부부욕실 센서등 추가 : R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1) + " : " + mSenSorLight_Couple[mSenSorLight_Couple_Count]);
  915. mSenSorLight_Couple_Count++;
  916. setting_manual_str += "COUPLESENSOR"+mSenSorLight_Couple_Count + ":" + SettingData.size() + "/";
  917. }
  918. else {
  919. SetKind data = new SetKind( "R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1),
  920. TYPE_SENSORLIGHT_CHECK_USE,
  921. ConfingSettingMainID.button.SENSORLIGHT_COUPLE_USE1 + i,
  922. ConfingSettingMainID.button.SENSORLIGHT_COUPLE_NOTUSE1 + i,
  923. GetSensorLightName(type) + " 센서등");
  924. SettingData.add(data);
  925. Log.i(TAG, "부부욕실 센서등 추가 : R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1) + " : " + mSenSorLight_Couple[mSenSorLight_Couple_Count]);
  926. mSenSorLight_Couple_Count++;
  927. setting_manual_str += "COUPLESENSOR"+mSenSorLight_Couple_Count + ":" + SettingData.size() + "/";
  928. }
  929. }
  930. else if (type == SHARED_BATHROOM_SENSOR ) {
  931. mSenSorLight_Share[mSenSorLight_Share_Count] = mBathRoomSensorLightClass.Status[i].UseOnOff;
  932. sensorRoomNameArr.add(GetSensorLightName(type) + " 센서등");
  933. sensorRoomIdxArr.add(mBathRoomSensorLightClass.Status[i].EnergyIndex+1);
  934. sensorEMnumArr.add("R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1) + "");
  935. //SensorEMnumArray[i].setText("(R" + (bathRoomSensor.Status[i].EnergyIndex+1) + ")");
  936. if (BatchStatus == 0) {
  937. // 일괄소등 중
  938. SetKind data = new SetKind( "R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1),
  939. TYPE_SENSORLIGHT_BATCH_ON,
  940. ConfingSettingMainID.button.SENSORLIGHT_SHARE_USE1 + i,
  941. ConfingSettingMainID.button.SENSORLIGHT_SHARE_NOTUSE1 + i,
  942. GetSensorLightName(type) + " 센서등");
  943. SettingData.add(data);
  944. Log.i(TAG, "공용욕실 센서등 추가 : R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1) + " : " + mSenSorLight_Share[mSenSorLight_Share_Count]);
  945. mSenSorLight_Share_Count++;
  946. setting_manual_str += "SHARESENSOR"+mSenSorLight_Couple_Count + ":" + SettingData.size() + "/";
  947. }
  948. else {
  949. SetKind data = new SetKind( "R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1),
  950. TYPE_SENSORLIGHT_CHECK_USE,
  951. ConfingSettingMainID.button.SENSORLIGHT_SHARE_USE1 + i,
  952. ConfingSettingMainID.button.SENSORLIGHT_SHARE_NOTUSE1 + i,
  953. GetSensorLightName(type) + " 센서등");
  954. SettingData.add(data);
  955. Log.i(TAG, "공용욕실 센서등 추가 : R" + (mBathRoomSensorLightClass.Status[i].EnergyIndex+1) + " : " + mSenSorLight_Share[mSenSorLight_Share_Count]);
  956. mSenSorLight_Share_Count++;
  957. setting_manual_str += "SHARESENSOR"+mSenSorLight_Couple_Count + ":" + SettingData.size() + "/";
  958. }
  959. }
  960. }
  961. for (int j = 0; j < sensorEMnumArr.size(); j++) {
  962. Log.i(TAG, "EM Room Nums : " + sensorEMnumArr.get(j));
  963. }
  964. }
  965. else {
  966. Log.w(TAG, "[mSensorLightCheckHandler] mBathRoomSensorLightClass is null!!");
  967. if (nDistributionPanelType == Version.DISTRIBUTION_MODEL.SMART_DIST) {
  968. Log.i(TAG, "BATH SENSOR ADD ~~~~~~~");
  969. SetKind data = new SetKind(TYPE_SENSORLIGHT_CHECK_NON , ConfingSettingMainID.button.SENSORLIGHT_SHARE_NOTUSE1, "센서등");
  970. SettingData.add(data);
  971. setting_manual_str += "SENSOR_LIGHT:" + SettingData.size() + "/";
  972. }
  973. else {
  974. Log.i(TAG, "Don't BATH NON ADD ~~~~~~~");
  975. }
  976. }
  977. } catch (RuntimeException re) {
  978. LogUtil.errorLogInfo("", TAG, re);
  979. } catch (Exception e) {
  980. //e.printStackTrace();
  981. LogUtil.errorLogInfo("", TAG, e);
  982. }
  983. }
  984. else {
  985. Log.w(TAG, "[mSensorLightCheckHandler] bBathSensorUse [" + bBathSensorUse + "]");
  986. }
  987. mSensorLightCheckHandler.sendEmptyMessageDelayed(1, 10);
  988. }
  989. else {
  990. Log.w(TAG, "[mSensorLightCheckHandler] mSdbAPI is null!!");
  991. mSensorLightCheckHandler.sendEmptyMessageDelayed(0, 10);
  992. }
  993. }
  994. else {
  995. Log.w(TAG, "[mSensorLightCheckHandler] mWallPadAPI.Check_Connect() is false!!");
  996. mSensorLightCheckHandler.sendEmptyMessageDelayed(0, 10);
  997. }
  998. }
  999. else {
  1000. Log.w(TAG, "[mSensorLightCheckHandler] mWallPadAPI is null!!");
  1001. }
  1002. } catch (RuntimeException re) {
  1003. LogUtil.errorLogInfo("", TAG, re);
  1004. } catch (Exception e) {
  1005. //e.printStackTrace();
  1006. LogUtil.errorLogInfo("", TAG, e);
  1007. }
  1008. }
  1009. else if (msg.what == 1) {
  1010. try {
  1011. if (mSdbAPI.Refresh(SdbAPI.DEVICE_INDEX.ENERGY_CONT, (byte)0x00) >= 0) {
  1012. mEnergyControllerClass = mSdbAPI.data.EnergyController;
  1013. if (mEnergyControllerClass.Data.SmartPhoneLightControl == SMARTPHONE_LIGHT_CTRL_STATUS.NO_INFO) {
  1014. Log.w(TAG, "[D101 Handler]2 - SmartPhoneLightControl : NO_INFO");
  1015. Log.w(TAG, "[D101 Handler]2 - EnergyController Not Communicated");
  1016. mEnergyControllerComm = false;
  1017. }
  1018. else if (mEnergyControllerClass.Data.SmartPhoneLightControl == SMARTPHONE_LIGHT_CTRL_STATUS.CLR) {
  1019. Log.i(TAG, "[D101 Handler]2 - SmartPhoneLightControl : CLR (NOT USE)");
  1020. mEnergyControllerComm = true;
  1021. mPhoneLightCtrUse = false;
  1022. }
  1023. else if (mEnergyControllerClass.Data.SmartPhoneLightControl == SMARTPHONE_LIGHT_CTRL_STATUS.SET) {
  1024. Log.i(TAG, "[D101 Handler]2 - SmartPhoneLightControl : SET (USE ~~~)");
  1025. mEnergyControllerComm = true;
  1026. mPhoneLightCtrUse = true;
  1027. }
  1028. }
  1029. } catch (RuntimeException re) {
  1030. LogUtil.errorLogInfo("", TAG, re);
  1031. } catch (Exception ex) {
  1032. //ex.printStackTrace();
  1033. LogUtil.errorLogInfo("", TAG,ex);
  1034. }
  1035. // SetKind data = new SetKind(TYPE_BUTTON , ConfingSettingMainID.button.AS_CALL , 0 , TXT_AS_CALL );
  1036. // SettingData.add(data);
  1037. // setting_manual_str += "AS_REGI:" + SettingData.size() + "/";
  1038. SetKind data;
  1039. if (Version.getModelType() != Version.MODEL_TYPE.IHN_750 && bRoomNameEditV2Usage && !isSubWallPad) {
  1040. //data = new SetKind( TYPE_BUTTON , ConfingSettingMainID.button.NAME_SET , 0 , TXT_ROOM_NAME );
  1041. //SettingData.add(data);
  1042. //setting_manual_str += "ROOMNAME_SET:" + SettingData.size() + "/";
  1043. }
  1044. /** JEFF, 2020.01.01
  1045. * 스마트현관카메라의 음성품질 저하로 인해 안심통화 단계를 1, 2, 3, 4단계중 1, 2 단계만 사용가능하도록 함
  1046. * 1, 2 단계 고정이므로 preset기능은 비활성화 한다.
  1047. */
  1048. // if (((MainActivity) getContext()).getReliefCallUse()) {
  1049. // data = new SetKind(TYPE_BUTTON, ConfingSettingMainID.button.RELIEFCALL_PRESET, 0, TXT_RELIEFCALL_PRESET);
  1050. // SettingData.add(data);
  1051. // setting_manual_str += "RELIEFCALL_USE:" + SettingData.size() + "/";
  1052. // }
  1053. WallpadDeviceSet wallpadDeviceSet = new WallpadDeviceSet(getContext());
  1054. int bandLocUse = wallpadDeviceSet.GetDeviceSetted("밴드위치확인");
  1055. if (bandLocUse == WallpadDeviceSet.DEV_DATA_ENABLE) {
  1056. data = new SetKind(TYPE_CHECKBOX, ConfingSettingMainID.button.BAND_LOCATION_ALARM_CHECKBOX_USE, ConfingSettingMainID.button.BAND_LOCATION_ALARM_CHECKBOX_NOTUSE, TXT_BAND_LOCATION);
  1057. SettingData.add(data);
  1058. setting_manual_str += "BAND_LOCATION_ALARM:" + SettingData.size() + "/";
  1059. }
  1060. if (SettingData.size() <= 6) {
  1061. m_ToTalPage = 1;
  1062. }
  1063. else if (SettingData.size() > 6 && SettingData.size() <= 12) {
  1064. m_ToTalPage = 2;
  1065. }
  1066. else if (SettingData.size() > 12 && SettingData.size() <= 18) {
  1067. m_ToTalPage = 3;
  1068. }
  1069. if (mPageText != null) {
  1070. mPageText.setText(m_CurPage + "/"+m_ToTalPage);
  1071. }
  1072. DrawContentsPage(m_CurPage);
  1073. }
  1074. else if (msg.what == 2) {
  1075. }
  1076. }
  1077. };
  1078. @Override
  1079. protected void onClose() {
  1080. try {
  1081. mSensorLightCheckHandler.removeMessages(0);
  1082. } catch (RuntimeException re) {
  1083. LogUtil.errorLogInfo("", TAG, re);
  1084. } catch (Exception ee) {
  1085. //ee.printStackTrace();
  1086. LogUtil.errorLogInfo("", TAG, ee);
  1087. }
  1088. super.onClose();
  1089. /*if(intLightAPI != null)
  1090. {
  1091. intLightAPI.unregChangedBR("ConfigSetting");
  1092. }*/
  1093. }
  1094. @Override
  1095. public void Close() {
  1096. super.Close();
  1097. }
  1098. @Override
  1099. protected void onTouchEvent(View v, MotionEvent event) {
  1100. super.onTouchEvent(v, event);
  1101. int TargetId = v.getId();
  1102. int MoveEvent = event.getAction();
  1103. if (MoveEvent == MotionEvent.ACTION_DOWN) {
  1104. }
  1105. else if (MoveEvent == MotionEvent.ACTION_UP) {
  1106. boolean bSaveData = false;
  1107. if (TargetId == ID.ConfingSettingMainID.text.TITLE) {
  1108. DebugLogOutput("onTouchEvent - ID: " + ID.ConfingSettingMainID.text.TITLE);
  1109. Sound().Play(SND.effect.TOUCH_LATCHED);
  1110. //Popup Test
  1111. ((MainActivity)(getContext())).StartPopup(screen.AsCallPopupScreen);
  1112. //((MainActivity)(getContext())).StartPopup(screen.PopupNameSet);
  1113. }
  1114. if (TargetId == ConfingSettingMainID.button.ALARM_SOUND_CHECKBOX_USE) {
  1115. ChangeAlramSound(true);
  1116. bSaveData = true;
  1117. }
  1118. else if (TargetId == ConfingSettingMainID.button.ALARM_SOUND_CHECKBOX_NOTUSE) {
  1119. ChangeAlramSound(false);
  1120. bSaveData = true;
  1121. }
  1122. else if (TargetId == ConfingSettingMainID.button.CAR_SOUND_CHECKBOX_USE) {
  1123. ChangeCarAlramSound(true);
  1124. bSaveData = true;
  1125. }
  1126. else if (TargetId == ConfingSettingMainID.button.CAR_SOUND_CHECKBOX_NOTUSE) {
  1127. ChangeCarAlramSound(false);
  1128. bSaveData = true;
  1129. }
  1130. else if (TargetId == ConfingSettingMainID.button.CALL_SOUND_CHECKBOX_USE) {
  1131. ChangeCallAlarmSound(true);
  1132. bSaveData = true;
  1133. }
  1134. else if (TargetId == ConfingSettingMainID.button.CALL_SOUND_CHECKBOX_NOTUSE) {
  1135. ChangeCallAlarmSound(false);
  1136. bSaveData = true;
  1137. }
  1138. else if (TargetId == ConfingSettingMainID.button.BAND_LOCATION_ALARM_CHECKBOX_USE) {
  1139. ChangeBandLocAlramSound(true);
  1140. bSaveData = true;
  1141. }
  1142. else if (TargetId == ConfingSettingMainID.button.BAND_LOCATION_ALARM_CHECKBOX_NOTUSE) {
  1143. ChangeBandLocAlramSound(false);
  1144. bSaveData = true;
  1145. }
  1146. else if (TargetId == ConfingSettingMainID.button.ARS_CONTROL_CHECKBOX_USE) {
  1147. ChangeARSControl(true);
  1148. bSaveData = true;
  1149. }
  1150. else if (TargetId == ConfingSettingMainID.button.ARS_CONTROL_CHECKBOX_NOTUSE) {
  1151. ChangeARSControl(false);
  1152. bSaveData = true;
  1153. }
  1154. else if (TargetId == ConfingSettingMainID.button.NOISE_POPUP_USE) {
  1155. ChangeNoisePopupUse(true);
  1156. bSaveData = true;
  1157. }
  1158. else if (TargetId == ConfingSettingMainID.button.NOISE_POPUP_NOTUSE) {
  1159. ChangeNoisePopupUse(false);
  1160. bSaveData = true;
  1161. }
  1162. else if (TargetId == ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_USE ) {
  1163. ChangeRemoteControl(true);
  1164. bSaveData = true;
  1165. }
  1166. else if (TargetId == ConfingSettingMainID.button.REMOTE_CONTROL_CHECKBOX_NOTUSE) {
  1167. ChangeRemoteControl(false);
  1168. bSaveData = true;
  1169. }
  1170. else if (TargetId == ConfingSettingMainID.button.REMOTE_CONTROL_LIGHT_CHECKBOX_SMART) {
  1171. ((MainActivity)(getContext())).StartPopup(screen.PopupRemoteCtrlSmartlight);
  1172. }
  1173. else if (TargetId == ConfingSettingMainID.button.REMOTE_CONTROL_LIGHT_CHECKBOX_NORMAL) {
  1174. ChangeRemoteSmartLightControl(false);
  1175. bSaveData = true;
  1176. }
  1177. else if (TargetId == ConfingSettingMainID.button.NEXT_PAGE) {
  1178. if (m_CurPage == 1) {
  1179. Sound().Play(SND.effect.TOUCH_LATCHED);
  1180. m_CurPage = 2;
  1181. DrawContentsPage(m_CurPage);
  1182. }
  1183. else if (m_CurPage == 2) {
  1184. Sound().Play(SND.effect.TOUCH_LATCHED);
  1185. m_CurPage = 3;
  1186. DrawContentsPage(m_CurPage);
  1187. }
  1188. }
  1189. else if (TargetId == ConfingSettingMainID.button.PREV_PAGE) {
  1190. if (m_CurPage == 2) {
  1191. Sound().Play(SND.effect.TOUCH_LATCHED);
  1192. m_CurPage = 1;
  1193. DrawContentsPage(m_CurPage);
  1194. }
  1195. else if (m_CurPage == 3) {
  1196. Sound().Play(SND.effect.TOUCH_LATCHED);
  1197. m_CurPage = 2;
  1198. DrawContentsPage(m_CurPage);
  1199. }
  1200. }
  1201. else if (TargetId == ConfingSettingMainID.button.AS_CALL) {
  1202. Log.d(TAG, "onTouchEvent [AS_CALL] BUTTON !!!");
  1203. Sound().Play(SND.effect.TOUCH_LATCHED);
  1204. ((MainActivity)(getContext())).StartPopup(ID.screen.AsCallPopupScreen);
  1205. }
  1206. else if (TargetId == ConfingSettingMainID.button.RELIEFCALL_PRESET) {
  1207. Log.d(TAG, "onTouchEvent [RELIEFCALL_PRESET] BUTTON !!!");
  1208. Sound().Play(SND.effect.TOUCH_LATCHED);
  1209. ((MainActivity)(getContext())).StartPopup(screen.PopupReliefCallPreset);
  1210. }
  1211. else if (TargetId == ConfingSettingMainID.button.REMOCON_REG) {
  1212. Log.d(TAG, "onTouchEvent [REMOCON_REG] BUTTON !!!");
  1213. Sound().Play(SND.effect.TOUCH_LATCHED);
  1214. ((MainActivity)(getContext())).StartPopup(ID.screen.RegRemoconPopupScreen);
  1215. }
  1216. else if (TargetId == ConfingSettingMainID.button.NAME_SET) {
  1217. Log.d(TAG, "onTouchEvent [NAME_SET] BUTTON !!!");
  1218. Sound().Play(SND.effect.TOUCH_LATCHED);
  1219. ((MainActivity)(getContext())).StartPopup(ID.screen.PopupNameSet);
  1220. }
  1221. else if (TargetId == ConfingSettingMainID.button.WEB_CTR_PWD) {
  1222. Log.d(TAG, "onTouchEvent [WEB_CTR_PWD] BUTTON !!!");
  1223. Sound().Play(SND.effect.TOUCH_LATCHED);
  1224. ((MainActivity)(getContext())).StartPopup(ID.screen.PopupWebCtrPwd);
  1225. }
  1226. else if (TargetId == ConfingSettingMainID.button.EASYMODE_CHECKBOX_USE) {
  1227. if (mEasyModeUse) return;
  1228. Sound().Play(SND.effect.TOUCH_LATCHED);
  1229. Intent data = new Intent();
  1230. data.putExtra("UX_TYPE", !mEasyModeUse);
  1231. // Log.d(TAG, "[onTouchEvent] mEasyModeUse [" + mEasyModeUse + "]");
  1232. ((MainActivity)(getContext())).StartPopup(screen.PopupNoticeReboot, data); // 재부팅 알림 팝업 (확인 선택시에만 DB 저장)
  1233. }
  1234. else if (TargetId == ConfingSettingMainID.button.EASYMODE_CHECKBOX_NOTUSE) {
  1235. if (!mEasyModeUse) return;
  1236. Sound().Play(SND.effect.TOUCH_LATCHED);
  1237. Intent data = new Intent();
  1238. data.putExtra("UX_TYPE", !mEasyModeUse);
  1239. // Log.d(TAG, "[onTouchEvent] mEasyModeUse [" + mEasyModeUse + "]");
  1240. ((MainActivity)(getContext())).StartPopup(screen.PopupNoticeReboot, data); // 재부팅 알림 팝업 (확인 선택시에만 DB 저장)
  1241. }
  1242. else if (TargetId == ConfingSettingMainID.button.SYS_VOLUME_LEFT) {
  1243. ChangeVolumeLevel(false);
  1244. //intLightAPI.LightControl((byte)01, false);
  1245. /*if(inRoomDetectSensor_api.SetEachSensorSetting((byte)0, (byte)3, (byte)1, (byte)1, true) >= 0)
  1246. {
  1247. Log.i(TAG, "SetEachSensorSetting OK - 0/3/10/1/T");
  1248. }
  1249. else
  1250. {
  1251. Log.i(TAG, "SetEachSensorSetting NO - 0/3/10/1/T");
  1252. }*/
  1253. }
  1254. else if (TargetId == ConfingSettingMainID.button.SYS_VOLUME_RIGHT) {
  1255. ChangeVolumeLevel(true);
  1256. //intLightAPI.LightControl((byte)01, true);
  1257. /*if(inRoomDetectSensor_api.SetEachSensorSetting((byte)1, (byte)3, (byte)1, (byte)1, true) >= 0)
  1258. {
  1259. Log.i(TAG, "SetEachSensorSetting OK - 1/3/8/1/T");
  1260. }
  1261. else
  1262. {
  1263. Log.i(TAG, "SetEachSensorSetting NO - 1/3/8/1/T");
  1264. }*/
  1265. }
  1266. else if (TargetId == ConfingSettingMainID.button.LCDLEVEL_LEFT) {
  1267. ChangeLcdLevel(false);
  1268. /*int ret = m_KnxAPI.AllLightOnOff( true );
  1269. if(ret >= 0)
  1270. {
  1271. Sound().Play(SND.setting.SETTING);
  1272. }
  1273. else
  1274. {
  1275. Sound().Play(SND.effect.TOUCH_UNLATCHED);
  1276. }*/
  1277. }
  1278. else if (TargetId == ConfingSettingMainID.button.LCDLEVEL_RIGHT) {
  1279. ChangeLcdLevel(true);
  1280. /*int ret = m_KnxAPI.AllLightOnOff( false );
  1281. if(ret >= 0)
  1282. {
  1283. Sound().Play(SND.setting.SETTING);
  1284. }
  1285. else
  1286. {
  1287. Sound().Play(SND.effect.TOUCH_UNLATCHED);
  1288. }*/
  1289. }
  1290. else if (TargetId == ConfingSettingMainID.button.BUTTONLEVEL_LEFT) {
  1291. ChangeButtonLightLevel(false);
  1292. }
  1293. else if (TargetId == ConfingSettingMainID.button.BUTTONLEVEL_RIGHT) {
  1294. ChangeButtonLightLevel(true);
  1295. }
  1296. else if (TargetId == ConfingSettingMainID.button.SLEEPTIME_LEFT) {
  1297. ChangeSleepTime(false);
  1298. //v40IOInterface.DoControl(v40IOInterface.IOCTL_EMR_TYPE, 0);
  1299. }
  1300. else if (TargetId == ConfingSettingMainID.button.SLEEPTIME_RIGHT) {
  1301. ChangeSleepTime(true);
  1302. //v40IOInterface.DoControl(v40IOInterface.IOCTL_EMR_TYPE, 1);
  1303. }
  1304. else if (TargetId == ConfingSettingMainID.button.CLOSESENSOR_LEFT) {
  1305. ChangeCloseSensorLevel(false);
  1306. //v40IOInterface.DoControl(v40IOInterface.IOCTL_LEDNEMR_ONOFF, 0);
  1307. }
  1308. else if (TargetId == ConfingSettingMainID.button.CLOSESENSOR_RIGHT) {
  1309. ChangeCloseSensorLevel(true);
  1310. //v40IOInterface.DoControl(v40IOInterface.IOCTL_LEDNEMR_ONOFF, 1);
  1311. }
  1312. else if (TargetId == ConfingSettingMainID.button.SMARTPHONE_LIGHTCTR_USE) {
  1313. ChangePhoneAppCtr(true);
  1314. bSaveData = true;
  1315. }
  1316. else if (TargetId == ConfingSettingMainID.button.SMARTPHONE_LIGHTCTR_NOTUSE) {
  1317. ChangePhoneAppCtr(false);
  1318. bSaveData = true;
  1319. }
  1320. else if ((TargetId == ConfingSettingMainID.button.SENSORLIGHT_SHARE_USE1) || (TargetId == ConfingSettingMainID.button.SENSORLIGHT_SHARE_USE2)) {
  1321. int idx = TargetId - ConfingSettingMainID.button.SENSORLIGHT_SHARE_USE1;
  1322. int statusIdx = idx;
  1323. Log.i(TAG, "[onTouch] - SENSORLIGHT_SHARE_USE : " + idx);
  1324. if (mSenSorLight_Share_Count == 1) {
  1325. statusIdx = 0;
  1326. }
  1327. if (mSenSorLight_Share[statusIdx] == true) {
  1328. Log.d(TAG, "[onTouch] - Already Enable mSenSorLight_Share ");
  1329. return;
  1330. }
  1331. int ret = mSdbAPI.Set_BathRoomSensorLight_OnOff( (byte) idx, true );
  1332. if (ret >= 0) {
  1333. Sound().Play(SND.effect.TOUCH_LATCHED);
  1334. ChangeSensorLight_Share(true, idx, statusIdx);
  1335. }
  1336. else {
  1337. Sound().Play(SND.effect.TOUCH_UNLATCHED);
  1338. }
  1339. }
  1340. else if ((TargetId == ConfingSettingMainID.button.SENSORLIGHT_SHARE_NOTUSE1) || (TargetId == ConfingSettingMainID.button.SENSORLIGHT_SHARE_NOTUSE2)) {
  1341. int idx = TargetId - ConfingSettingMainID.button.SENSORLIGHT_SHARE_NOTUSE1;
  1342. int statusIdx = idx;
  1343. Log.i(TAG, "[onTouch] - SENSORLIGHT_SHARE_NOTUSE : " + idx);
  1344. if (mSenSorLight_Share_Count == 1) {
  1345. statusIdx = 0;
  1346. }
  1347. if (mSenSorLight_Share[statusIdx] == false) {
  1348. Log.d(TAG, "[onTouch] - Already Enable mSenSorLight_Share ");
  1349. return;
  1350. }
  1351. int ret = mSdbAPI.Set_BathRoomSensorLight_OnOff( (byte) idx, false );
  1352. if (ret >= 0) {
  1353. Sound().Play(SND.effect.TOUCH_LATCHED);
  1354. ChangeSensorLight_Share(false, idx, statusIdx);
  1355. }
  1356. else {
  1357. Sound().Play(SND.effect.TOUCH_UNLATCHED);
  1358. }
  1359. }
  1360. else if ((TargetId == ConfingSettingMainID.button.SENSORLIGHT_COUPLE_USE1) || (TargetId == ConfingSettingMainID.button.SENSORLIGHT_COUPLE_USE2)) {
  1361. int idx = TargetId - ConfingSettingMainID.button.SENSORLIGHT_COUPLE_USE1;
  1362. int statusIdx = idx;
  1363. Log.i(TAG, "[onTouch] - SENSORLIGHT_COUPLE_USE : " + idx);
  1364. if (mSenSorLight_Couple_Count == 1) {
  1365. statusIdx = 0;
  1366. }
  1367. if (mSenSorLight_Couple[statusIdx] == true) {
  1368. Log.d(TAG, "[onTouch] - Already Enable SENSORLIGHT_COUPLE ");
  1369. return;
  1370. }
  1371. int ret = mSdbAPI.Set_BathRoomSensorLight_OnOff( (byte) idx, true );
  1372. if (ret >= 0) {
  1373. Sound().Play(SND.effect.TOUCH_LATCHED);
  1374. ChangeSensorLight_Couple(true, idx, statusIdx);
  1375. }
  1376. else {
  1377. Sound().Play(SND.effect.TOUCH_UNLATCHED);
  1378. }
  1379. }
  1380. else if((TargetId == ConfingSettingMainID.button.SENSORLIGHT_COUPLE_NOTUSE1) || (TargetId == ConfingSettingMainID.button.SENSORLIGHT_COUPLE_NOTUSE2)) {
  1381. int idx = TargetId - ConfingSettingMainID.button.SENSORLIGHT_COUPLE_NOTUSE1;
  1382. int statusIdx = idx;
  1383. Log.i(TAG, "[onTouch] - SENSORLIGHT_COUPLE_NOTUSE : " + idx);
  1384. if (mSenSorLight_Couple_Count == 1) {
  1385. statusIdx = 0;
  1386. }
  1387. if (mSenSorLight_Couple[statusIdx] == false) {
  1388. Log.d(TAG, "[onTouch] - Already Enable SENSORLIGHT_COUPLE ");
  1389. return;
  1390. }
  1391. int ret = mSdbAPI.Set_BathRoomSensorLight_OnOff( (byte) idx, false );
  1392. if (ret >= 0) {
  1393. Sound().Play(SND.effect.TOUCH_LATCHED);
  1394. ChangeSensorLight_Couple(false, idx, statusIdx);
  1395. }
  1396. else {
  1397. Sound().Play(SND.effect.TOUCH_UNLATCHED);
  1398. }
  1399. }
  1400. else if (TargetId == ConfingSettingMainID.button.OPENDELAY_LEFT) {
  1401. ChangeOpenDelayLevel(false);
  1402. }
  1403. else if (TargetId == ConfingSettingMainID.button.OPENDELAY_RIGHT) {
  1404. ChangeOpenDelayLevel(true);
  1405. }
  1406. /*else
  1407. {
  1408. if(true)
  1409. {
  1410. Sound().Play(SND.effect.TOUCH_LATCHED);
  1411. }
  1412. }*/
  1413. if (bSaveData == true) {
  1414. SaveConfigDB();
  1415. }
  1416. }
  1417. }
  1418. @Override
  1419. protected void onPopupResult(Intent data) {
  1420. try {
  1421. int nScreen = data.getIntExtra("SCREEN", -1);
  1422. boolean bType = data.getBooleanExtra("UX_TYPE", false);
  1423. int nID = data.getIntExtra("POPUP_BTN", -1);
  1424. Log.d(TAG, "[onPopupResult] nScreen [" + nScreen + "], bType [" + bType + "], nID [" + nID + "]");
  1425. if (nScreen == screen.PopupNoticeReboot) {
  1426. if (nID == ID.PoupNoticeRebootID.button.OK) {
  1427. ChangeEasyModeUse(bType);
  1428. SaveConfigDB();
  1429. runWallPadReboot();
  1430. }
  1431. }
  1432. else if (nScreen == screen.PopupRemoteCtrlSmartlight) {
  1433. if (nID == ID.PopupRemoteCtrlSmartlight.button.OK) {
  1434. ChangeRemoteSmartLightControl(true);
  1435. SaveConfigDB();
  1436. }
  1437. }
  1438. } catch (RuntimeException re) {
  1439. LogUtil.errorLogInfo("", TAG, re);
  1440. } catch (Exception e) {
  1441. Log.e(TAG, "[Exception] onPopupResult(Intent data)");
  1442. //e.printStackTrace();
  1443. LogUtil.errorLogInfo("", TAG, e);
  1444. }
  1445. }
  1446. //[Function]
  1447. @Override
  1448. public void ViewRegistration(RelativeLayout ParentsLayout, WpadImageView nImageView, int MarginLeft, int MarginTop) {
  1449. // TODO Auto-generated method stub
  1450. super.ViewRegistration(ParentsLayout, nImageView, MarginLeft, MarginTop);
  1451. }
  1452. @Override
  1453. public void ViewRegistration(RelativeLayout ParentsLayout, WpadTextView nTextView, int MarginLeft, int MarginTop) {
  1454. // TODO Auto-generated method stub
  1455. super.ViewRegistration(ParentsLayout, nTextView, MarginLeft, MarginTop);
  1456. }
  1457. private void GetDBConfigInitValue() {
  1458. final AudioManager audioManager = (AudioManager)this.getContext().getSystemService(this.getContext().AUDIO_SERVICE);
  1459. mVolumeLevel = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
  1460. Log.d(TAG, "STREAM_SYSTEM ---> Volume : " + audioManager.getStreamVolume(AudioManager.STREAM_SYSTEM));
  1461. Log.d(TAG, "STREAM_VOICE_CALL ---> Volume : " + audioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL));
  1462. Log.d(TAG, "STREAM_RING ---> Volume : " + audioManager.getStreamVolume(AudioManager.STREAM_RING));
  1463. Log.d(TAG, "STREAM_DTMF ---> Volume : " + audioManager.getStreamVolume(AudioManager.STREAM_DTMF));
  1464. WallpadStatusData mWallpadStatusData = new WallpadStatusData( this.getContext());
  1465. mWallpadStatusData.SetWallPadMasterVolume(mVolumeLevel);
  1466. // DB에서 값을 읽어와 정보를 넣어주어야 함.
  1467. try {
  1468. // DB 에서 현재 설정된 패스워드를 얻어오도록 한다.
  1469. //WallpadStatusData wdb = new WallpadStatusData(this.getContext());
  1470. if (mWallpadStatusData != null) {
  1471. int nlevel = Settings.System.getInt(this.getContext().getContentResolver(), "screen_brightness");
  1472. Log.d(TAG, "[DB] --------nlevel --" + nlevel);
  1473. mAllAlarmSound = mWallpadStatusData.GetSoundOutputOfEventAlarm();
  1474. mCarAlarmSound = mWallpadStatusData.GetCarSoundOfEventAlarm();
  1475. mCallAlarmSound = mWallpadStatusData.GetCallSoundOfEventAlarm();
  1476. mCloseSensorLevel = mWallpadStatusData.GetCloseSensorValue();
  1477. mNoisePopupUse = mWallpadStatusData.GetNoisePopupUse(); // 기본 false
  1478. mBandLocAlarm = mWallpadStatusData.GetBandLocationEventAlarm();
  1479. mEasyModeUse = mWallpadStatusData.GetEasyModeUxUse();
  1480. mButtonLightLevel = mWallpadStatusData.GetLEDButtonBrightnessLevel();
  1481. mARSControl = mWallpadStatusData.GetArsControl();
  1482. mRemoteControl = mWallpadStatusData.GetRemoteControl();
  1483. mRemoteSmartLightControl = mWallpadStatusData.GetRemoteControlSmartLight();
  1484. for (int i = 0; i <= MAX_OPENDELAY_LEVEL; i++) {
  1485. if (DoorLock_OpenDelayTime[i] == mWallpadStatusData.Get_DoorOpen_WaitTime())
  1486. mOpenDelayTime = i;
  1487. }
  1488. mWallpadStatusData.closeDB();
  1489. Log.i(TAG, "[GetDBConfigInitValue] mAllAlarmSound [" + mAllAlarmSound + "], mCarAlarmSound [" + mCarAlarmSound + "], mCallAlarmSound [" + mCallAlarmSound + "], " +
  1490. "mCloseSensorLevel [" + mCloseSensorLevel + "], mNoisePopupUse [" + mNoisePopupUse + "], mBandLocAlarm [" + mBandLocAlarm + "], mEasyModeUse [" + mEasyModeUse + "]");
  1491. Log.d(TAG, "[GetDBConfigInitValue] mButtonLightLevel [" + mButtonLightLevel + "], mARSControl [" + mARSControl + "], mRemoteControl [" + mRemoteControl + "], " +
  1492. "mOpenDelayTime [" + mOpenDelayTime + "], mRemoteSmartLightControl [" + mRemoteSmartLightControl + "]");
  1493. }
  1494. else {
  1495. Log.w(TAG, "[GetDBConfigInitValue] mWallpadStatusData is null!!");
  1496. }
  1497. } catch (RuntimeException re) {
  1498. if (mWallpadStatusData != null) mWallpadStatusData.closeDB();
  1499. LogUtil.errorLogInfo("", TAG, re);
  1500. } catch (Exception e) {
  1501. if (mWallpadStatusData != null) mWallpadStatusData.closeDB();
  1502. Log.e(TAG, "[Exception] GetDBConfigInitValue()");
  1503. //e.printStackTrace();
  1504. LogUtil.errorLogInfo("", TAG, e);
  1505. }
  1506. }
  1507. private void SaveConfigDB() {
  1508. // DB에서 값을 읽어와 정보를 넣어주어야 함.
  1509. try {
  1510. // DB 에서 현재 설정된 패스워드를 얻어오도록 한다.
  1511. //WallpadStatusData wdb = new WallpadStatusData(this.getContext());
  1512. WallpadStatusData mWallpadStatusData = new WallpadStatusData( this.getContext());
  1513. if (mWallpadStatusData != null) {
  1514. mWallpadStatusData.SetSoundOutputOfEventAlarm(mAllAlarmSound);
  1515. mWallpadStatusData.SetCarSoundOfEventAlarm(mCarAlarmSound);
  1516. mWallpadStatusData.SetCallSoundOfEventAlarm(mCallAlarmSound);
  1517. mWallpadStatusData.SetArsControl(mARSControl);
  1518. mWallpadStatusData.SetRemoteControl(mRemoteControl);
  1519. boolean bRet = mWallpadStatusData.SetRemoteControlSmartLight(mRemoteSmartLightControl);
  1520. Log.e(TAG, "[SaveConfigDB] bRet: " + bRet + ", mRemoteSmartLightControl: " + mRemoteSmartLightControl);
  1521. mWallpadStatusData.SetNoisePopupUse(mNoisePopupUse);
  1522. mWallpadStatusData.SetBandLocationEventAlarm(mBandLocAlarm);
  1523. mWallpadStatusData.SetEasyModeUxUse(mEasyModeUse);
  1524. mWallpadStatusData.closeDB();
  1525. Log.i(TAG, "[SaveConfigDB] mAllAlarmSound [" + mAllAlarmSound + "], mCarAlarmSound [" + mCarAlarmSound + "], mCallAlarmSound [" + mCallAlarmSound + "], " +
  1526. "mCloseSensorLevel [" + mCloseSensorLevel + "], mNoisePopupUse [" + mNoisePopupUse + "], mBandLocAlarm [" + mBandLocAlarm + "], mEasyModeUse [" + mEasyModeUse + "], mRemoteSmartLightControl [" + mRemoteSmartLightControl + "]");
  1527. }
  1528. else {
  1529. Log.w(TAG, "[SaveConfigDB] mWallpadStatusData is null!!");
  1530. }
  1531. } catch (RuntimeException re) {
  1532. LogUtil.errorLogInfo("", TAG, re);
  1533. } catch (Exception e) {
  1534. Log.e(TAG, "[Exception] SaveConfigDB()");
  1535. //e.printStackTrace();
  1536. LogUtil.errorLogInfo("", TAG, e);
  1537. }
  1538. }
  1539. private void ChangeVolumeLevel(boolean Up) {
  1540. try {
  1541. if (Up == true) {
  1542. if (mVolumeLevel != MAX_VOLUME_LEVEL) Sound().Play(SND.effect.TOUCH_LATCHED);
  1543. mVolumeLevel++;
  1544. if (mVolumeLevel >= MAX_VOLUME_LEVEL) mVolumeLevel = MAX_VOLUME_LEVEL;
  1545. }
  1546. else {
  1547. if (mVolumeLevel != 1) Sound().Play(SND.effect.TOUCH_LATCHED);
  1548. mVolumeLevel--;
  1549. if (mVolumeLevel <= 1) mVolumeLevel = 1;
  1550. }
  1551. DrawVolumeLevel(mVolumeLevel);
  1552. // 샘플 코드
  1553. final AudioManager audioManager = (AudioManager)this.getContext().getSystemService(this.getContext().AUDIO_SERVICE);
  1554. int Curlevel = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
  1555. int Maxlevel = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
  1556. Log.d(TAG, "--------- Volume : " + Curlevel + " , MaxVolume : " + Maxlevel);
  1557. audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, mVolumeLevel , 0);
  1558. WallpadStatusData wd = new WallpadStatusData( this.getContext());
  1559. wd.SetWallPadMasterVolume(mVolumeLevel);
  1560. wd.closeDB();
  1561. //Sound().PlayMent(SND.bell.FRONT);
  1562. //Log.i(TAG, "Change : " + smartKeyRfDoorAPI.SetSensorConfig((byte)mVolumeLevel, (byte)(mVolumeLevel*2) ) );
  1563. //Log.i(TAG, "Setting : " + smartKeyRfDoorAPI.SetSensorConfig((byte)0xFF, (byte)0xFF) );
  1564. } catch (RuntimeException re) {
  1565. LogUtil.errorLogInfo("", TAG, re);
  1566. } catch (Exception e) {
  1567. Log.e(TAG, "[Exception] ChangeVolumeLevel(boolean Up)");
  1568. //e.printStackTrace();
  1569. LogUtil.errorLogInfo("", TAG, e);
  1570. }
  1571. // DB Save
  1572. }
  1573. private void DrawVolumeLevel(int level) {
  1574. try {
  1575. int idx = getViewIdx(TXT_SYSTEM_VOLUME);
  1576. textValue[idx].setText(String.valueOf(level));
  1577. if (level == MAX_VOLUME_LEVEL) {
  1578. Btn_Right[idx].setButtonRearImage();
  1579. }
  1580. else if (level == 1) {
  1581. Btn_Left[idx].setButtonRearImage();
  1582. }
  1583. else {
  1584. Btn_Right[idx].setButtonFrontImage();
  1585. Btn_Left[idx].setButtonFrontImage();
  1586. }
  1587. } catch (RuntimeException re) {
  1588. LogUtil.errorLogInfo("", TAG, re);
  1589. } catch (Exception e) {
  1590. Log.e(TAG, "[Exception] DrawVolumeLevel(int level)");
  1591. //e.printStackTrace();
  1592. LogUtil.errorLogInfo("", TAG, e);
  1593. }
  1594. }
  1595. private void ChangeCloseSensorLevel(boolean Up) {
  1596. try {
  1597. boolean soundOn = true;
  1598. if (Up == true) {
  1599. if (mCloseSensorLevel != MAX_CLOSESENSOR_LEVEL) Sound().Play(SND.effect.TOUCH_LATCHED);
  1600. mCloseSensorLevel++;
  1601. if (mCloseSensorLevel > MAX_CLOSESENSOR_LEVEL) {
  1602. mCloseSensorLevel = MAX_CLOSESENSOR_LEVEL;
  1603. soundOn = false;
  1604. }
  1605. }
  1606. else {
  1607. if (mCloseSensorLevel != 0) Sound().Play(SND.effect.TOUCH_LATCHED);
  1608. mCloseSensorLevel--;
  1609. if (mCloseSensorLevel < 0) {
  1610. mCloseSensorLevel = 0;
  1611. soundOn = false;
  1612. }
  1613. }
  1614. if (soundOn) {
  1615. // Sound().Play(SND.effect.TOUCH_LATCHED);
  1616. DrawCloseSensorLevel(mCloseSensorLevel);
  1617. int closeValue = 15;
  1618. if (mCloseSensorLevel == 0) {
  1619. closeValue = 0;
  1620. }
  1621. else if (mCloseSensorLevel == 1) {
  1622. closeValue = 1;
  1623. }
  1624. else if (mCloseSensorLevel == 2) {
  1625. closeValue = 4;
  1626. }
  1627. else if (mCloseSensorLevel == 3) {
  1628. closeValue = 7;
  1629. }
  1630. else if (mCloseSensorLevel == 4) {
  1631. closeValue = 11;
  1632. }
  1633. else if (mCloseSensorLevel == 5) {
  1634. closeValue = 15;
  1635. }
  1636. // JNI로 값 변경
  1637. //v40IOInterface.Ctrl_CloseSensor(mCloseSensorLevel * 3);
  1638. mV40IF.Ctrl_CloseSensor(closeValue);
  1639. // DB에 변경 값 저장
  1640. WallpadStatusData wd = new WallpadStatusData( this.getContext());
  1641. wd.SetCloseSensorValue(mCloseSensorLevel);
  1642. Log.d(TAG, "[ChangeCloseSensorLevel] - db saved : " + wd.GetCloseSensorValue());
  1643. wd.closeDB();
  1644. }
  1645. } catch (RuntimeException re) {
  1646. LogUtil.errorLogInfo("", TAG, re);
  1647. } catch (Exception e) {
  1648. Log.e(TAG, "[Exception] ChangeCloseSensorLevel(boolean Up)");
  1649. //e.printStackTrace();
  1650. LogUtil.errorLogInfo("", TAG, e);
  1651. }
  1652. }
  1653. private void DrawCloseSensorLevel(int level) {
  1654. try {
  1655. int idx = getViewIdx(TXT_CLOSE_SENSOR);
  1656. textValue[idx].setText(String.valueOf(level));
  1657. if (level == MAX_CLOSESENSOR_LEVEL) {
  1658. Btn_Right[idx].setButtonRearImage();
  1659. }
  1660. else if (level == 0) {
  1661. Btn_Left[idx].setButtonRearImage();
  1662. }
  1663. else {
  1664. Btn_Right[idx].setButtonFrontImage();
  1665. Btn_Left[idx].setButtonFrontImage();
  1666. }
  1667. } catch (RuntimeException re) {
  1668. LogUtil.errorLogInfo("", TAG, re);
  1669. } catch (Exception e) {
  1670. Log.e(TAG, "[Exception] DrawCloseSensorLevel(int level)");
  1671. //e.printStackTrace();
  1672. LogUtil.errorLogInfo("", TAG, e);
  1673. }
  1674. }
  1675. private void DrawSensorLightCheck(byte index, boolean onoff) {
  1676. try {
  1677. } catch (RuntimeException re) {
  1678. LogUtil.errorLogInfo("", TAG, re);
  1679. } catch (Exception e) {
  1680. Log.e(TAG,"[Exception] DrawSensorLightCheck(byte index, boolean onoff)");
  1681. //e.printStackTrace();
  1682. LogUtil.errorLogInfo("", TAG, e);
  1683. }
  1684. }
  1685. //////////////////////////////////////////
  1686. private void ChangeLcdLevel( boolean Up ) {
  1687. if (Up == true) {
  1688. if (mLcdLevel != MAX_LCD_LEVEL) Sound().Play(SND.effect.TOUCH_LATCHED);
  1689. mLcdLevel++;
  1690. if (mLcdLevel >= MAX_LCD_LEVEL) mLcdLevel = MAX_LCD_LEVEL;
  1691. }
  1692. else {
  1693. if (mLcdLevel != 1) Sound().Play(SND.effect.TOUCH_LATCHED);
  1694. mLcdLevel--;
  1695. if (mLcdLevel <= 1) mLcdLevel = 1;
  1696. }
  1697. DrawLcdLevel(mLcdLevel);
  1698. // 샘플 코드
  1699. if (mLcdLevel > 0 && mLcdLevel <= MAX_LCD_LEVEL) {
  1700. Settings.System.putInt(this.getContext().getContentResolver(), "screen_brightness", LCD_BrightnessValue[mLcdLevel -1]);
  1701. WindowManager.LayoutParams myLayoutParameter = ((Activity)this.getContext()).getWindow().getAttributes();
  1702. myLayoutParameter.screenBrightness = LCD_BrightnessValue[mLcdLevel -1];
  1703. ((Activity)this.getContext()).getWindow().setAttributes(myLayoutParameter);
  1704. }
  1705. // DB Save
  1706. }
  1707. private void DrawLcdLevel(int level) {
  1708. try {
  1709. int idx = getViewIdx(TXT_LCD_LEVEL);
  1710. textValue[idx].setText(String.valueOf(level));
  1711. if (level == MAX_LCD_LEVEL) {
  1712. Btn_Right[idx].setButtonRearImage();
  1713. }
  1714. else if (level == 1) {
  1715. Btn_Left[idx].setButtonRearImage();
  1716. }
  1717. else {
  1718. Btn_Right[idx].setButtonFrontImage();
  1719. Btn_Left[idx].setButtonFrontImage();
  1720. }
  1721. } catch (RuntimeException re) {
  1722. LogUtil.errorLogInfo("", TAG, re);
  1723. } catch (Exception e) {
  1724. Log.e(TAG,"[Exception] DrawLcdLevel(int level)");
  1725. //e.printStackTrace();
  1726. LogUtil.errorLogInfo("", TAG, e);
  1727. }
  1728. }
  1729. private void ChangeButtonLightLevel(boolean Up) {
  1730. try {
  1731. if (Up == true) {
  1732. if (mButtonLightLevel != MAX_BTN_LEVEL) Sound().Play(SND.effect.TOUCH_LATCHED);
  1733. mButtonLightLevel++;
  1734. if (mButtonLightLevel >= MAX_BTN_LEVEL) mButtonLightLevel = MAX_BTN_LEVEL;
  1735. }
  1736. else {
  1737. if (mButtonLightLevel != 0) Sound().Play(SND.effect.TOUCH_LATCHED);
  1738. mButtonLightLevel--;
  1739. if (mButtonLightLevel <= 0) mButtonLightLevel = 0;
  1740. }
  1741. if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL) {
  1742. if (mIntLightAPI != null) mIntLightAPI.LedBrightCtrl((byte)(mButtonLightLevel));
  1743. WallpadStatusData wd = new WallpadStatusData( this.getContext());
  1744. wd.SetLEDButtonBrightnessLevel(mButtonLightLevel);
  1745. wd.closeDB();
  1746. }
  1747. DrawButtonLightLevel(mButtonLightLevel);
  1748. } catch (RuntimeException re) {
  1749. LogUtil.errorLogInfo("", TAG, re);
  1750. } catch (Exception e) {
  1751. Log.e(TAG,"[Exception] ChangeButtonLightLevel(boolean Up)");
  1752. //e.printStackTrace();
  1753. LogUtil.errorLogInfo("", TAG, e);
  1754. }
  1755. }
  1756. private void DrawButtonLightLevel(int level) {
  1757. try {
  1758. int idx = getViewIdx(TXT_BTN_LEVEL);
  1759. textValue[idx].setText(String.valueOf(level));
  1760. if (level == MAX_BTN_LEVEL) {
  1761. Btn_Right[idx].setButtonRearImage();
  1762. }
  1763. else if (level == 0) {
  1764. Btn_Left[idx].setButtonRearImage();
  1765. }
  1766. else {
  1767. Btn_Right[idx].setButtonFrontImage();
  1768. Btn_Left[idx].setButtonFrontImage();
  1769. }
  1770. } catch (RuntimeException re) {
  1771. LogUtil.errorLogInfo("", TAG, re);
  1772. } catch (Exception e) {
  1773. Log.e(TAG,"[Exception] DrawButtonLightLevel(int level)");
  1774. //e.printStackTrace();
  1775. LogUtil.errorLogInfo("", TAG, e);
  1776. }
  1777. }
  1778. private void ChangeSleepTime(boolean Up) {
  1779. try {
  1780. if (Up) {
  1781. if (mSleepModeTime != MAX_SLEEP_TIME) Sound().Play(SND.effect.TOUCH_LATCHED);
  1782. if (mSleepModeTime < 60) mSleepModeTime += 30;
  1783. else mSleepModeTime += 60;
  1784. if (mSleepModeTime >= MAX_SLEEP_TIME) mSleepModeTime = MAX_SLEEP_TIME;
  1785. }
  1786. else {
  1787. if (mSleepModeTime != MIN_SLEEP_TIME) Sound().Play(SND.effect.TOUCH_LATCHED);
  1788. if (mSleepModeTime > 60) mSleepModeTime -= 60;
  1789. else mSleepModeTime -= 30;
  1790. if (mSleepModeTime <= MIN_SLEEP_TIME) mSleepModeTime = MIN_SLEEP_TIME;
  1791. }
  1792. DrawSleepTime(mSleepModeTime);
  1793. if (mSleepModeTime == 30) Settings.System.putInt( this.getContext().getContentResolver(), SCREEN_OFF_TIMEOUT, 28 * 1000); // 백라이트 off와 앱 종료가 동시에 일어나면 월패드가 비정상 종료되므로 수정 (2021.04.01 메이드인랩 김수진 선임 요청)
  1794. else Settings.System.putInt( this.getContext().getContentResolver(), SCREEN_OFF_TIMEOUT, mSleepModeTime * 1000);
  1795. int getSleepTime = Settings.System.getInt(this.getContext().getContentResolver(), SCREEN_OFF_TIMEOUT);
  1796. Log.d(TAG, "[ChangeSleepTime] getSleepTime : " + getSleepTime);
  1797. } catch (RuntimeException re) {
  1798. LogUtil.errorLogInfo("", TAG, re);
  1799. } catch (Exception e) {
  1800. Log.e(TAG, "[Exception] ChangeSleepTime(boolean Up)");
  1801. //e.printStackTrace();
  1802. LogUtil.errorLogInfo("", TAG, e);
  1803. }
  1804. }
  1805. private void DrawSleepTime(int Time) {
  1806. try {
  1807. int idx = getViewIdx(TXT_SLEEP_TIME);
  1808. if (Time < 60) textValue[idx].setText(Time + "초");
  1809. else textValue[idx].setText((Time / 60) + "분");
  1810. if (Time == MAX_SLEEP_TIME) {
  1811. Btn_Right[idx].setButtonRearImage();
  1812. }
  1813. else if (Time == MIN_SLEEP_TIME) {
  1814. Btn_Left[idx].setButtonRearImage();
  1815. }
  1816. else {
  1817. Btn_Right[idx].setButtonFrontImage();
  1818. Btn_Left[idx].setButtonFrontImage();
  1819. }
  1820. } catch (RuntimeException re) {
  1821. LogUtil.errorLogInfo("", TAG, re);
  1822. } catch (Exception e) {
  1823. Log.e(TAG, "[Exception] DrawSleepTime(int Time)");
  1824. //e.printStackTrace();
  1825. LogUtil.errorLogInfo("", TAG, e);
  1826. }
  1827. }
  1828. private void ChangeAlramSound(boolean Use) {
  1829. if (mAllAlarmSound != Use) {
  1830. Sound().Play(SND.effect.TOUCH_LATCHED);
  1831. }
  1832. else {
  1833. return;
  1834. }
  1835. if (Use == true) mAllAlarmSound = true;
  1836. else mAllAlarmSound = false;
  1837. DrawAlramSound( mAllAlarmSound );
  1838. // DB Save
  1839. }
  1840. private void DrawAlramSound(boolean value) {
  1841. try {
  1842. int idx = getViewIdx(TXT_ALARM_SOUND);
  1843. if (value == true) {
  1844. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID());
  1845. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID());
  1846. }
  1847. else {
  1848. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID());
  1849. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID());
  1850. }
  1851. } catch (RuntimeException re) {
  1852. LogUtil.errorLogInfo("", TAG, re);
  1853. } catch (Exception e) {
  1854. Log.e(TAG, "[Exception] DrawAlramSound(boolean value)");
  1855. //e.printStackTrace();
  1856. LogUtil.errorLogInfo("", TAG, e);
  1857. }
  1858. }
  1859. private void ChangeSensorLight_Share(boolean Use, int idx, int satausIdx) {
  1860. if (Use == true) mSenSorLight_Share[satausIdx] = true;
  1861. else mSenSorLight_Share[satausIdx] = false;
  1862. DrawSensorLight_Share(mSenSorLight_Share[satausIdx], sensorRoomNameArr.get(idx), sensorEMnumArr.get(idx) );
  1863. }
  1864. private void DrawSensorLight_Share(boolean value, String selecName, String EMname) {
  1865. try {
  1866. Log.i(TAG, "[DrawSensorLight_Share] - selecName : " + selecName);
  1867. int idx = getViewIdx_EMname(EMname);
  1868. if (value == true) {
  1869. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID());
  1870. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID());
  1871. }
  1872. else {
  1873. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID());
  1874. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID());
  1875. }
  1876. } catch (RuntimeException re) {
  1877. LogUtil.errorLogInfo("", TAG, re);
  1878. } catch (Exception e) {
  1879. Log.e(TAG, "[Exception] DrawSensorLight_Share(boolean value, String selecName, String EMname)");
  1880. //e.printStackTrace();
  1881. LogUtil.errorLogInfo("", TAG, e);
  1882. }
  1883. }
  1884. private void ChangeSensorLight_Couple(boolean Use, int idx, int satausIdx) {
  1885. /*if(mSenSorLight_Couple[idx] == Use)
  1886. {
  1887. Log.d(TAG, "[ChangeSensorLight_Couple] - Already Setting value");
  1888. return;
  1889. }*/
  1890. if (Use == true) mSenSorLight_Couple[satausIdx] = true;
  1891. else mSenSorLight_Couple[satausIdx] = false;
  1892. DrawSensorLight_Couple( mSenSorLight_Couple[satausIdx], sensorRoomNameArr.get(idx), sensorEMnumArr.get(idx) );
  1893. }
  1894. private void DrawSensorLight_Couple(boolean value, String selecName, String EMname) {
  1895. try {
  1896. Log.i(TAG, "[DrawSensorLight_Couple] - selecName : " + selecName);
  1897. int idx = getViewIdx_EMname(EMname);
  1898. if (value == true) {
  1899. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID());
  1900. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID());
  1901. }
  1902. else {
  1903. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID());
  1904. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID());
  1905. }
  1906. } catch (RuntimeException re) {
  1907. LogUtil.errorLogInfo("", TAG, re);
  1908. } catch (Exception e) {
  1909. Log.e(TAG, "[Exception] DrawSensorLight_Couple(boolean value, String selecName, String EMname)");
  1910. //e.printStackTrace();
  1911. LogUtil.errorLogInfo("", TAG, e);
  1912. }
  1913. }
  1914. private void ChangeCarAlramSound(boolean Use) {
  1915. if (mCarAlarmSound != Use) {
  1916. Sound().Play(SND.effect.TOUCH_LATCHED);
  1917. }
  1918. else {
  1919. return;
  1920. }
  1921. if (Use == true) mCarAlarmSound = true;
  1922. else mCarAlarmSound = false;
  1923. DrawCarAlarmSound( mCarAlarmSound );
  1924. }
  1925. private void DrawCarAlarmSound(boolean value) {
  1926. try {
  1927. int idx = getViewIdx(TXT_CAR_SOUND);
  1928. if (value == true) {
  1929. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID());
  1930. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID());
  1931. }
  1932. else {
  1933. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID());
  1934. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID());
  1935. }
  1936. } catch (RuntimeException re) {
  1937. LogUtil.errorLogInfo("", TAG, re);
  1938. } catch (Exception e) {
  1939. Log.e(TAG, "[Exception] DrawCarAlarmSound(boolean value)");
  1940. //e.printStackTrace();
  1941. LogUtil.errorLogInfo("", TAG, e);
  1942. }
  1943. }
  1944. private void ChangeCallAlarmSound(boolean Use) {
  1945. if (mCallAlarmSound != Use) {
  1946. Sound().Play(SND.effect.TOUCH_LATCHED);
  1947. }
  1948. else {
  1949. return;
  1950. }
  1951. if (Use == true) mCallAlarmSound = true;
  1952. else mCallAlarmSound = false;
  1953. DrawCallAlarmSound(mCallAlarmSound);
  1954. }
  1955. private void DrawCallAlarmSound(boolean value) {
  1956. try {
  1957. int idx = getViewIdx(TXT_CALL_SOUND);
  1958. if (value == true) {
  1959. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID());
  1960. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID());
  1961. }
  1962. else {
  1963. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID());
  1964. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID());
  1965. }
  1966. } catch (RuntimeException re) {
  1967. LogUtil.errorLogInfo("", TAG, re);
  1968. } catch (Exception e) {
  1969. Log.e(TAG, "[Exception] DrawCallAlarmSound(boolean value)");
  1970. //e.printStackTrace();
  1971. LogUtil.errorLogInfo("", TAG, e);
  1972. }
  1973. }
  1974. private void ChangeBandLocAlramSound( boolean Use) {
  1975. if (mBandLocAlarm != Use) {
  1976. Sound().Play(SND.effect.TOUCH_LATCHED);
  1977. }
  1978. else {
  1979. return;
  1980. }
  1981. if (Use == true) mBandLocAlarm = true;
  1982. else mBandLocAlarm = false;
  1983. DrawBandLocAlarm( mBandLocAlarm );
  1984. }
  1985. private void DrawBandLocAlarm(boolean value) {
  1986. try {
  1987. int idx = getViewIdx(TXT_BAND_LOCATION);
  1988. if (value == true) {
  1989. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID());
  1990. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID());
  1991. }
  1992. else {
  1993. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID());
  1994. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID());
  1995. }
  1996. } catch (RuntimeException re) {
  1997. LogUtil.errorLogInfo("", TAG, re);
  1998. } catch (Exception e) {
  1999. Log.e(TAG, "[Exception] DrawBandLocAlarm(boolean value)");
  2000. //e.printStackTrace();
  2001. LogUtil.errorLogInfo("", TAG, e);
  2002. }
  2003. }
  2004. private void ChangeEasyModeUse(boolean Use) {
  2005. if (Use == true) mEasyModeUse = true;
  2006. else mEasyModeUse = false;
  2007. DrawEasyMode(mEasyModeUse, true);
  2008. }
  2009. private void DrawEasyMode(boolean value, boolean bTouch) {
  2010. try {
  2011. int idx = getViewIdx(TXT_EASYMODE);
  2012. if (value == true) {
  2013. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID());
  2014. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID());
  2015. }
  2016. else {
  2017. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID());
  2018. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID());
  2019. }
  2020. // 설정 후 재부팅 대기 중 값 변경을 방지하기 위함(버튼 disable 처리)
  2021. if (bTouch) {
  2022. UseCheckBoxAgrray[idx].setButtonEventOffEnable();
  2023. NotUseCheckBoxAgrray[idx].setButtonEventOffEnable();
  2024. }
  2025. } catch (RuntimeException re) {
  2026. LogUtil.errorLogInfo("", TAG, re);
  2027. } catch (Exception e) {
  2028. Log.e(TAG, "[Exception] DrawEasyMode(boolean value, boolean bTouch)");
  2029. //e.printStackTrace();
  2030. LogUtil.errorLogInfo("", TAG, e);
  2031. }
  2032. }
  2033. private void ChangeNoisePopupUse( boolean Use) {
  2034. if (mNoisePopupUse != Use) {
  2035. Sound().Play(SND.effect.TOUCH_LATCHED);
  2036. }
  2037. else {
  2038. return;
  2039. }
  2040. if (Use == true) mNoisePopupUse = true;
  2041. else mNoisePopupUse = false;
  2042. DrawNoisePopupUse( mNoisePopupUse );
  2043. }
  2044. private void DrawNoisePopupUse(boolean value) {
  2045. try {
  2046. int idx = getViewIdx(TXT_INTERLAYTER_NOISE_POPUP);
  2047. if (value == true) {
  2048. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID());
  2049. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID());
  2050. }
  2051. else {
  2052. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID());
  2053. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID());
  2054. }
  2055. } catch (RuntimeException re) {
  2056. LogUtil.errorLogInfo("", TAG, re);
  2057. } catch (Exception e) {
  2058. Log.e(TAG, "[Exception] DrawNoisePopupUse(boolean value)");
  2059. //e.printStackTrace();
  2060. LogUtil.errorLogInfo("", TAG, e);
  2061. }
  2062. }
  2063. private void ChangePhoneAppCtr(boolean Use) {
  2064. Log.i(TAG, "[ChangePhoneAppCtr] Use: " + Use + ", mEnergyControllerComm: " + mEnergyControllerComm);
  2065. if (!mEnergyControllerComm) {
  2066. // 에너지 컨트롤러 통신이 되었을 때만 버튼 눌림.
  2067. Log.w(TAG, "[ChangePhoneAppCtr] mEnergyControllerComm: " + mEnergyControllerComm);
  2068. return;
  2069. }
  2070. if (Use == mPhoneLightCtrUse) {
  2071. // 같은 버튼을 누른 경우, 동작 안하도록 함.
  2072. return;
  2073. }
  2074. if (Use == true) {
  2075. mPhoneLightCtrUse = true;
  2076. }
  2077. else {
  2078. mPhoneLightCtrUse = false;
  2079. }
  2080. if (mSdbAPI != null) {
  2081. if (mSdbAPI.Set_SmartPhoneLightControl(mPhoneLightCtrUse) >= 0) {
  2082. Sound().Play(SND.effect.TOUCH_LATCHED);
  2083. DrawPhoneLightCtrUse( mPhoneLightCtrUse );
  2084. }
  2085. else {
  2086. Sound().Play(SND.effect.TOUCH_UNLATCHED);
  2087. }
  2088. if (mSdbAPI.Refresh(SdbAPI.DEVICE_INDEX.ENERGY_CONT, (byte)0x00) >= 0) {
  2089. mEnergyControllerClass = mSdbAPI.data.EnergyController;
  2090. if (mEnergyControllerClass.Data.SmartPhoneLightControl == EnergyControllerClass.DataClass.SMARTPHONE_LIGHT_CTRL_STATUS.NO_INFO) {
  2091. Log.w(TAG, "[ChangePhoneAppCtr] - SmartPhoneLightControl : NO_INFO");
  2092. Log.w(TAG, "[ChangePhoneAppCtr] - EnergyController Not Communicated");
  2093. mEnergyControllerComm = false;
  2094. }
  2095. else if (mEnergyControllerClass.Data.SmartPhoneLightControl == EnergyControllerClass.DataClass.SMARTPHONE_LIGHT_CTRL_STATUS.CLR) {
  2096. Log.i(TAG, "[ChangePhoneAppCtr] - SmartPhoneLightControl : CLR (NOT USE)");
  2097. mEnergyControllerComm = true;
  2098. mPhoneLightCtrUse = false;
  2099. }
  2100. else if (mEnergyControllerClass.Data.SmartPhoneLightControl == EnergyControllerClass.DataClass.SMARTPHONE_LIGHT_CTRL_STATUS.SET) {
  2101. Log.i(TAG, "[ChangePhoneAppCtr] - SmartPhoneLightControl : SET (USE ~~~)");
  2102. mEnergyControllerComm = true;
  2103. mPhoneLightCtrUse = true;
  2104. }
  2105. }
  2106. else {
  2107. Log.w(TAG, "[ChangePhoneAppCtr] mSdbAPI.Refresh(SdbAPI.DEVICE_INDEX.ENERGY_CONT, (byte)0x00) fail!!");
  2108. }
  2109. }
  2110. else {
  2111. Log.w(TAG, "[ChangePhoneAppCtr] mSdbAPI is null!!");
  2112. }
  2113. }
  2114. private void DrawPhoneLightCtrUse(boolean value) {
  2115. try {
  2116. if (mEnergyControllerComm) {
  2117. // 에너지 컨트롤러 통신이 되었을 때만 상태체크 그리기
  2118. int idx = getViewIdx(TXT_SMARTPHONE_LIGHTCTR);
  2119. if (value == true) {
  2120. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID());
  2121. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID());
  2122. }
  2123. else {
  2124. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID());
  2125. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID());
  2126. }
  2127. }
  2128. } catch (RuntimeException re) {
  2129. LogUtil.errorLogInfo("", TAG, re);
  2130. } catch (Exception e) {
  2131. Log.e(TAG, "[Exception] DrawPhoneLightCtrUse(boolean value)");
  2132. //e.printStackTrace();
  2133. LogUtil.errorLogInfo("", TAG, e);
  2134. }
  2135. }
  2136. private void ChangeARSControl(boolean Use) {
  2137. if (mARSControl != Use) {
  2138. Sound().Play(SND.effect.TOUCH_LATCHED);
  2139. }
  2140. else {
  2141. return;
  2142. }
  2143. if (Use == true) mARSControl = true;
  2144. else mARSControl = false;
  2145. DrawARSControl(mARSControl);
  2146. // DB Save
  2147. }
  2148. private void DrawARSControl(boolean value) {
  2149. try {
  2150. int idx = getViewIdx(TXT_ARS_CONTROL);
  2151. if (value == true) {
  2152. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID());
  2153. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID());
  2154. }
  2155. else {
  2156. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID());
  2157. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID());
  2158. }
  2159. } catch (RuntimeException re) {
  2160. LogUtil.errorLogInfo("", TAG, re);
  2161. } catch (Exception e) {
  2162. Log.e(TAG, "[Exception] DrawARSControl(boolean value)");
  2163. //e.printStackTrace();
  2164. LogUtil.errorLogInfo("", TAG, e);
  2165. }
  2166. }
  2167. private void ChangeRemoteControl(boolean Use) {
  2168. if (mRemoteControl != Use) {
  2169. Sound().Play(SND.effect.TOUCH_LATCHED);
  2170. }
  2171. else {
  2172. return;
  2173. }
  2174. if (Use == true) mRemoteControl = true;
  2175. else mRemoteControl = false;
  2176. DrawRemoteControl(mRemoteControl );
  2177. }
  2178. private void DrawRemoteControl(boolean value) {
  2179. try {
  2180. int idx = getViewIdx(TXT_RMOTE_CONTROL);
  2181. if (value == true) {
  2182. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID());
  2183. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID());
  2184. }
  2185. else {
  2186. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID());
  2187. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID());
  2188. }
  2189. } catch (RuntimeException re) {
  2190. LogUtil.errorLogInfo("", TAG, re);
  2191. } catch (Exception e) {
  2192. Log.e(TAG, "[Exception] DrawRemoteControl(boolean value)");
  2193. //e.printStackTrace();
  2194. LogUtil.errorLogInfo("", TAG, e);
  2195. }
  2196. }
  2197. private void ChangeRemoteSmartLightControl(boolean Use) {
  2198. if (mRemoteSmartLightControl != Use) {
  2199. if (!Use) Sound().Play(SND.effect.TOUCH_LATCHED);
  2200. }
  2201. else {
  2202. return;
  2203. }
  2204. if (Use == true) mRemoteSmartLightControl = true;
  2205. else mRemoteSmartLightControl = false;
  2206. DrawRemoteSmartLightControl(mRemoteSmartLightControl);
  2207. sendBRRemoteCtrlLightTypeChanged();
  2208. }
  2209. private void DrawRemoteSmartLightControl(boolean value) {
  2210. try {
  2211. int idx = getViewIdx(TXT_RMOTE_SMARTLIGHT_CONTROL);
  2212. Log.i(TAG, "[DrawRemoteSmartLightControl] value = " + value + ", idx = " + idx);
  2213. if (value == true) {
  2214. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getPressedImageID());
  2215. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getDefaultImageID());
  2216. }
  2217. else {
  2218. UseCheckBoxAgrray[idx].setImageResource(UseCheckBoxAgrray[idx].getDefaultImageID());
  2219. NotUseCheckBoxAgrray[idx].setImageResource(NotUseCheckBoxAgrray[idx].getPressedImageID());
  2220. }
  2221. } catch (RuntimeException re) {
  2222. LogUtil.errorLogInfo("", TAG, re);
  2223. } catch (Exception e) {
  2224. Log.e(TAG, "[Exception] DrawRemoteSmartLightControl(boolean value)");
  2225. //e.printStackTrace();
  2226. LogUtil.errorLogInfo("", TAG, e);
  2227. }
  2228. }
  2229. private void sendBRRemoteCtrlLightTypeChanged() {
  2230. Intent intent = new Intent();
  2231. intent.setAction(define.NOTIFY_ACNAME);
  2232. intent.putExtra(define.NOTIBR_KIND, define.NOTIFY_REMOTE_CTRL_LIGHT_TYPE_CHANGED);
  2233. super.getContext().sendBroadcast(intent);
  2234. }
  2235. private void ChangeOpenDelayLevel( boolean Up ) {
  2236. if (Up == true) {
  2237. if (mOpenDelayTime != MAX_OPENDELAY_LEVEL) Sound().Play(SND.effect.TOUCH_LATCHED);
  2238. mOpenDelayTime++;
  2239. if (mOpenDelayTime >= MAX_OPENDELAY_LEVEL) mOpenDelayTime = MAX_OPENDELAY_LEVEL;
  2240. }
  2241. else {
  2242. if (mOpenDelayTime != 0) Sound().Play(SND.effect.TOUCH_LATCHED);
  2243. mOpenDelayTime--;
  2244. if (mOpenDelayTime <= 0) mOpenDelayTime = 0;
  2245. }
  2246. DrawDoorLockOpenDelay(mOpenDelayTime);
  2247. // DB Save
  2248. if (mOpenDelayTime >= 0 && mOpenDelayTime <= MAX_OPENDELAY_LEVEL) {
  2249. WallpadStatusData wd = new WallpadStatusData(this.getContext());
  2250. wd.Set_DoorOpen_WaitTime(DoorLock_OpenDelayTime[mOpenDelayTime]);
  2251. }
  2252. }
  2253. private void DrawDoorLockOpenDelay(int level) {
  2254. try {
  2255. Log.d(TAG, "[DrawDoorLockOpenDelay] level [" + level + "], DelayTime [" + DoorLock_OpenDelayTime[level] + "]");
  2256. int idx = getViewIdx(TXT_OPEN_DELAY);
  2257. textValue[idx].setText(DoorLock_OpenDelayTime[level] + "초");
  2258. if (level == MAX_OPENDELAY_LEVEL) {
  2259. Btn_Right[idx].setButtonRearImage();
  2260. }
  2261. else if (level == 0) {
  2262. Btn_Left[idx].setButtonRearImage();
  2263. }
  2264. else {
  2265. Btn_Right[idx].setButtonFrontImage();
  2266. Btn_Left[idx].setButtonFrontImage();
  2267. }
  2268. } catch (RuntimeException re) {
  2269. LogUtil.errorLogInfo("", TAG, re);
  2270. } catch (Exception e) {
  2271. Log.e(TAG,"[Exception] DrawDoorLockOpenDelay(int level)");
  2272. //e.printStackTrace();
  2273. LogUtil.errorLogInfo("", TAG, e);
  2274. }
  2275. }
  2276. /**
  2277. * 무선리모콘 사용유무 확인
  2278. *
  2279. * @return - (boolean) true : 사용, false : 미사용
  2280. */
  2281. protected boolean GetRemoconActive() {
  2282. WallpadDeviceSet DevSet = new WallpadDeviceSet(super.getContext());
  2283. int ret = DevSet.Get_RemoteCon_Info();
  2284. DevSet.closeDB();
  2285. if (ret == 1) return true;
  2286. return false;
  2287. }
  2288. private void runWallPadReboot() {
  2289. try {
  2290. if (Version.getPlatformType() == Version.PLATFORM_TYPE.A40i) {
  2291. mV40IF.Reboot(5);
  2292. }
  2293. else {
  2294. Log.w(TAG, "[runWallPadReboot] Not Supported PlatformType [" + Version.getPlatformType() + "]");
  2295. }
  2296. } catch (RuntimeException re) {
  2297. LogUtil.errorLogInfo("", TAG, re);
  2298. } catch (Exception e) {
  2299. Log.e(TAG, "[Exception] runWallPadReboot()");
  2300. //e.printStackTrace();
  2301. LogUtil.errorLogInfo("", TAG, e);
  2302. }
  2303. }
  2304. /**
  2305. * 무선 도어락 문열림 대기모드 사용여부
  2306. *
  2307. * @return (int) - >0 : 무선 도어락 문열림 대기모드 사용, <0 : 실패 또는 미사용
  2308. */
  2309. private int getDoorLockOpenDelayUse() {
  2310. // 1. get DB
  2311. WallpadDeviceSet devset = new WallpadDeviceSet(super.getContext());
  2312. int Doorinfo = devset.GetDeviceSetted("무선도어락문열림대기모드");
  2313. devset.closeDB();
  2314. // 2. Check
  2315. if (Doorinfo == WallpadDeviceSet.DEV_DATA_ENABLE) {
  2316. return 1;
  2317. }
  2318. else if (Doorinfo == WallpadDeviceSet.DEV_DATA_DISABLE) {
  2319. return -1;
  2320. }
  2321. else if (Doorinfo == WallpadDeviceSet.DEV_DATA_NONE) {
  2322. return -2;
  2323. }
  2324. else {
  2325. return -3;
  2326. }
  2327. }
  2328. }