Common.java 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648
  1. package kr.co.icontrols.wallpadmain.declare;
  2. import com.util.LogUtil;
  3. import java.util.List;
  4. import kr.co.icontrols.wallpadmain.util.MainDatabaseManager;
  5. import kr.co.icontrols.wallpadsupport.Version;
  6. import kr.co.icontrols.wallpadsupport.WpadScale;
  7. import com.artncore.WallPadDataMgr.WallpadDeviceSet;
  8. import com.artncore.WallPadDataMgr.WallpadSalesSampleData;
  9. import com.artncore.commons.define;
  10. import android.content.Context;
  11. import android.content.Intent;
  12. import android.content.pm.PackageInfo;
  13. import android.util.Log;
  14. public final class Common {
  15. static String TAG = "Common";
  16. public final static boolean DIAGNOSTIC_MODE = false; // 양산테스트 프로그램 모드
  17. public final static boolean DEBUG_LOG_ON = true;
  18. public static boolean bWallPadCallLive = false;
  19. public static int CurrentBoardType = BOARD_TYPE.V40_IGW300_NOUGAT;
  20. /**
  21. * 분전반 관련 변수
  22. * Version.DISTRIBUTION_MODEL.NON_USE = 0
  23. * Version.DISTRIBUTION_MODEL.SMART_DIST = 1
  24. * Version.DISTRIBUTION_MODEL.KNX_DIST = 2
  25. * Version.DISTRIBUTION_MODEL.OTHER = -1
  26. */
  27. public static int CurrentDistributionPanelType = Version.DISTRIBUTION_MODEL.NON_USE;
  28. public class BOARD_TYPE {
  29. public static final int TCC8935_IGW200 = 1;
  30. public static final int TCC8935 = 2;
  31. public static final int V40_IGW300 = 3;
  32. public static final int V40 = 4;
  33. public static final int A20_CMOS = 5;
  34. public static final int A20_CCD = 6;
  35. public static final int V40_IGW300_NOUGAT = 7;
  36. public static final int V40_NOUGAT = 8;
  37. }
  38. public static class IGW200CMD {
  39. public static final int FRONT_PWR_ON = 1001; // 현관카메라 전원 ON
  40. public static final int FRONT_PWR_OFF = 1002; // 현관카메라 전원 OFF
  41. public static final int FRONT_BELL_ON = 1003; // 현관카메라 벨
  42. public static final int FRONT_BELL_OFF = 1004; // 현관카메라 벨
  43. public static final int FRONT_MUTE_ON = 1005; // 현관카메라 MIC mute ON
  44. public static final int FRONT_MUTE_OFF = 1006; // 현관카메라 MIC mute OFF
  45. public static final int VIDEO_FRONT = 2001; // 현관영상 선택
  46. public static final int VIDEO_MOIP = 2002; // MOIP영상 선택
  47. public static final int AUDIO_OFF = 3001; // 음성 선택 안함
  48. public static final int AUDIO_PSTN = 3002; // 국선 음성 선택
  49. public static final int AUDIO_FRONT_WALLPAD = 3003; // 월패드 현관 음성 선택
  50. public static final int AUDIO_FRONT_SUBPHONE = 3004; // 서브폰 현관 음성 선택
  51. public static final int AUDIO_MOIP_SUBPHONE = 3005; // MoIP 서브폰 음성 선택
  52. }
  53. public static class IGW300CMD {
  54. public static final int FRONT_PWR_ON = 4001;
  55. public static final int FRONT_PWR_OFF = 4002;
  56. public static final int FRONT_BELL_ON = 4003;
  57. public static final int FRONT_BELL_OFF = 4004;
  58. public static final int VIDEO_FRONT = 5001;
  59. public static final int VIDEO_MOIP = 5002;
  60. public static final int AUDIO_OFF = 6001;
  61. public static final int AUDIO_PSTN_WALLPAD = 6002;
  62. public static final int AUDIO_PSTN_SUBPHONE = 6003;
  63. public static final int AUDIO_FRONT_WALLPAD = 6004;
  64. public static final int AUDIO_FRONT_SUBPHONE = 6005;
  65. public static final int AUDIO_MOIP_SUBPHONE = 6006;
  66. }
  67. public final static String SKIN_01 = "SKIN_01";
  68. public final static String SKIN_02 = "SKIN_02";
  69. public final static String SKIN_03 = "SKIN_03";
  70. public final static String SKIN_04 = "SKIN_04";
  71. // call apk 전달 인자값
  72. public final static int FRAG_DOOR = 10;
  73. public final static int FRAG_LOBBY = 20;
  74. public final static int FRAG_GUARD = 30;
  75. public final static int FRAG_NEI = 40;
  76. public final static int FRAG_CALL = 50;
  77. public final static int FRAG_HISTORY = 60;
  78. public final static int FRAG_VISITOR = 70;
  79. // Auto FINISH
  80. public final static boolean FINISH_TIME_ENABLE = true; // 자동 종료 사용유무
  81. public final static int FINISH_TIME_SEC = 30; // 메인화면 자동 종료 시간 (초)
  82. public final static int FINISH_TIME_POPUP_NORMAL_SEC = 30; // 팝업 일반 자동 종료 시간 (초)
  83. public final static int FINISH_TIME_POPUP_ALARM_SEC = 10; // 팝업 알람 자동 종료 시간 (초)
  84. public final static int FINISH_TIME_POPUP_ELEVATOR = 30;
  85. public final static int FINISH_TIME_INFO_SEC = 30; // 매뉴얼 화면 자동 종료 시간 (초)
  86. // Option
  87. public final static boolean OPTION_TAB_ANMI_ENABLE = true; // 메인스크린 텝화면 전환 에니메이션 적용여부
  88. // Operation mode
  89. public final static int MODE_NOMAL = 0; // 노말
  90. public final static int MODE_BUSINESS_SAMPLE = 1; // 영업샘플
  91. public final static int MODE = MODE_NOMAL;
  92. // Button Delay
  93. public final static int BTN_DELAY_DEVCTRL = 300; // 디바이스 컨트롤을 하는 버튼의 경우 설정되는 딜레이시간
  94. public final static int BTN_DELAY_SHOWPOPUP = 500; // 팝업 활성화 버튼 딜레이
  95. public final static int LIVING_LAMP_COUNT = 5; // 추후에 DB에서 읽어서 처리하도록 한다.
  96. // Popup Type
  97. public final static int POPUP_STYLE_NOMAL = 0;
  98. public final static int POPUP_STYLE_INPUT = 1;
  99. public final static int POPUP_STYLE_INSERT_WIDGET = 2;
  100. public final static int POPUP_STYLE_EVENTNOTIFICATION = 3;
  101. public final static int POPUP_STYLE_LIGHTPRESET = 4;
  102. public final static int POPUP_STYLE_FUNCGROUP = 5;
  103. public final static int FULL_SCREEN = 6;
  104. // Screen Type
  105. public final static int SCREEN_TYPE_800x480 = 0;
  106. public final static int SCREEN_TYPE_1024x600 = 1;
  107. public final static int SCREEN_TYPE_1280x800 = 2;
  108. public final static int SCREEN_TYPE_1366x768 = 3;
  109. public static int SCREEN_TYPE = SCREEN_TYPE_1024x600; //0:800x600, 1:1024x600, 2:1280:800
  110. // Manual Screen Type
  111. public final static int INFO_STYLE_NORMAL = 0; // 30초 뒤 자동 종료 되는 Type
  112. // Manual Screen Size
  113. public final static int SCREEN_SIZE_INFO_W_1024 = 1024; // 1024x600 매뉴얼 화면 해상도 (가로)
  114. public final static int SCREEN_SIZE_INFO_H_1024 = 600; // 1024x600 매뉴얼 화면 해상도 (세로)
  115. public final static int SCREEN_SIZE_INFO_W_1280 = 1280; // 1280:800 매뉴얼 화면 해상도 (가로)
  116. public final static int SCREEN_SIZE_INFO_H_1280 = 800; // 1280:800 매뉴얼 화면 해상도 (세로)
  117. public final static int SCREEN_SIZE_POPUP_NOMAL_W = 790; // 팝업 해상도 (가로)
  118. public final static int SCREEN_SIZE_POPUP_NOMAL_H = 434; // 팝업 해상도 (세로)
  119. public final static int SCREEN_SIZE_POPUP_NOMAL_W_1280 = 990; // 팝업 해상도 (가로)
  120. public final static int SCREEN_SIZE_POPUP_NOMAL_H_1280 = 576; // 팝업 해상도 (세로)
  121. public final static int SCREEN_SIZE_POPUP_INPUT_W = 790; // 팝업 해상도 (가로)
  122. public final static int SCREEN_SIZE_POPUP_INPUT_H = 510; // 팝업 해상도 (세로)
  123. public final static int SCREEN_SIZE_POPUP_INPUT_W_1280 = 990; // 팝업 해상도 (가로)
  124. public final static int SCREEN_SIZE_POPUP_INPUT_H_1280 = 680; // 팝업 해상도 (세로)
  125. public final static int SCREEN_SIZE_POPUP_INSERT_WIDGET_W = 728;
  126. public final static int SCREEN_SIZE_POPUP_INSERT_WIDGET_H = 402 + 84;
  127. public final static int SCREEN_SIZE_POPUP_EVENTNOTI_W = 790; // 팝업 해상도 (가로)
  128. public final static int SCREEN_SIZE_POPUP_EVENTNOTI_H = 460; // 팝업 해상도 (세로)
  129. public final static int SCREEN_SIZE_POPUP_EVENTNOTI_W_1280 = 990; // 팝업 해상도 (가로)
  130. public final static int SCREEN_SIZE_POPUP_EVENTNOTI_H_1280 = 576; // 팝업 해상도 (세로)
  131. public final static int SCREEN_SIZE_POPUP_LIGHTPRESET_W = 790; // 팝업 해상도 (가로)
  132. public final static int SCREEN_SIZE_POPUP_LIGHTPRESET_H = 540; // 팝업 해상도 (세로)
  133. public final static int SCREEN_SIZE_POPUP_FUNCGROUP_W = 790; // 팝업 해상도 (가로)
  134. public final static int SCREEN_SIZE_POPUP_FUNCGROUP_H = 546; // 팝업 해상도 (세로)
  135. public final static int SCREEN_SIZE_POPUP_FUNCGROUP_W_1280 = 990; // 팝업 해상도 (가로)
  136. public final static int SCREEN_SIZE_POPUP_FUNCGROUP_H_1280 = 680; // 팝업 해상도 (세로)
  137. public final static int CTRL_MARGIN_LEFT = 210; // Ctrl Layout 의 좌측 마진
  138. public final static int CTRL_MARGIN_TOP = 75; // Ctrl Layout 의 상측 마진
  139. public static final String MAIN_EVENT_TIMER = "MAIN_EVENT_TIMER";
  140. // public static final String MAIN_EVENT_TIMER_02 = "MAIN_EVENT_TIMER_02";
  141. public static final String CALL_ACTIVITY_HOME_CTRL = "CALL_ACTIVITY_HOME_CTRL";
  142. public static final String MAIN_DRAW_TIMER = "MAIN_DRAW_TIMER";
  143. public static final String MAIN_SCREEN_NOW_UPDATE = "MAIN_SCREEN_NOW_UPDATE";
  144. public static final String DEVICE_SERVICE_WAIT_TIMEOUT = "DEVICE_SERVICE_WAIT_TIMEOUT";
  145. public static final String WIDGET_POPUP_BR = "WIDGET_POPUP_BR";
  146. public static final String WIDGET_SELECTED_ID = "WIDGET_SELECTED_ID";
  147. public static final String MENU_ID_LIST = "MENU_ID_LIST";
  148. public static final String MENU_START_ID = "MENU_START_ID";
  149. public static final String MENU_START_OPTION = "MENU_START_OPTION";
  150. public static final String MENU_DETAIL_INFO = "MENU_DETAIL_INFO";
  151. public static final String LIVINGLIGHT_PRESET_ID = "LIVINGLIGHT_PRESET_ID";
  152. public static final String MAIN_ACTIVITY = ".MainActivity";
  153. public static final String APP_PACKAGE_ROOT = "kr.co.icontrols.";
  154. public static final String SECURITY_APK = APP_PACKAGE_ROOT + "wallpadsecurity";
  155. public static final String HOMECTRL_APK = APP_PACKAGE_ROOT + "wallpadhomectrl";
  156. public static final String ENERGY_APK = APP_PACKAGE_ROOT + "wallpadenergyctrl";
  157. public static final String ADDSERVICE_APK = APP_PACKAGE_ROOT + "wallpadaddservice";
  158. public static final String CONFIG_APK = APP_PACKAGE_ROOT + "wallpadconfig";
  159. public static final String EMER_ALARM_APK = APP_PACKAGE_ROOT + "wallpademergency";
  160. //madeinLab++ ocf 관련
  161. public static final String OCF_APK = APP_PACKAGE_ROOT + "wallpadocf";
  162. public static final String DONG_HO_SPLIT_TOKEN = "_";
  163. public static final boolean ENABLED_SUB_DEVICE_DEFAULT_VALUE = true; //true;
  164. public static final String CONTROLLER_SETTING_DO_USED = "사용함";
  165. public static final String CONTROLLER_SETTING_DO_NOT_USED = "사용안함";
  166. public static final String PSTN_CALL_TYPE = "국선";
  167. public static final int SETTING_ITEM_TYPE_BASE = 101;
  168. public static final int SETTING_ITEM_SUB_DEVICE_LIST = SETTING_ITEM_TYPE_BASE + 9;
  169. public static final int SETTING_ITEM_SUB_DEVICE_ELEVATOR = SETTING_ITEM_TYPE_BASE + 125;
  170. public static final String CALL_SUBMAIN_SCREEN = "CALL_SUBMAIN_SCREEN";
  171. public static final String BR_SENDER_SCREEN = "BR_SENDER_SCREEN";
  172. public static final String BR_RECEIVE_SCREEN = "BR_RECEIVE_SCREEN";
  173. public static final String BR_WIDGET_DELETE = "BR_WIDGET_DELETE";
  174. public static final String BR_DELETE_WIDGET_ID = "BR_DELETE_WIDGET_ID";
  175. public static final String BR_WIDGET_INSERT = "BR_WIDGET_INSERT";
  176. public static final String BR_INSERT_WIDGET_ID = "BR_INSERT_WIDGET_ID";
  177. public static final String BR_RUN_WIDGET = "BR_RUN_WIDGET";
  178. public static final String BR_RUN_WIDGET_ID = "BR_RUN_WIDGET_ID";
  179. public static final String BR_LIVINGLIGHT_PRESET_INFO = "BR_LIVINGLIGHT_PRESET_INFO";
  180. public static final String BR_BLACKOUT_SCREEN_RUN = "BR_BLACKOUT_SCREEN_RUN";
  181. public static final String BR_BLOCK_SIP_NEWCALL = "BR_BLOCK_SIP_NEWCALL";
  182. public static final int DEVICE_BOOTUP_RETRY = 40001;
  183. // 공통으로 쓰는거라 WallAPI.Jar 파일 쪽으로 옮기자
  184. public static final String BR_NOTIFY_ACNAME = "NOTIFY_ACNAME"; // ANC BR
  185. public static final String BR_IGW200FILTER = "kr.co.icontrols.wallpad.BR_IGW200FILTER";
  186. public static final String BR_PSTN_RING_FINISH = "kr.co.icontrols.wallpad.BR_PSTN_RING_FINISH";
  187. public static final String BR_EMER_LED_CONTROL = "kr.co.icontrols.wallpad.BR_EMER_LED_CONTROL"; // 비상발생 비상버튼 LED 점멸 Intent 등록
  188. public static final String BR_DOOR_CALL_RECEIVED = "kr.co.icontrols.wallpad.BR_DOOR_CALL_RECEIVED";
  189. public static final String BR_PSTN_CALL_RECEIVED = "kr.co.icontrols.wallpad.BR_PSTN_CALL_RECEIVED";
  190. public static final String BR_CALLED_CID = "kr.co.icontrols.wallpad.BR_CALLED_CID";
  191. public static final String BR_CALLED_CID_ACK = "kr.co.icontrols.wallpad.BR_CALLED_CID_ACK";
  192. public static final String BR_REQUEST_APK_RUN = "kr.co.icontrols.wallpad.BR_REQUEST_APK_RUN";
  193. public static final String BR_LIVINGLIGHT = "kr.co.icontrols.wallpadhomectrl.BR_LIGHT(3000)";
  194. public static final String BR_KNXLIGHT = "kr.co.icontrols.wallpadmain.BR_KNXLIGHT";
  195. public static final String VISITOR_REMOTE_CALL = "kr.co.icontrols.wallpad.BR_REMOTE_CALL";
  196. public static final String BR_CAR_EVENT_GUEST = "kr.co.icontrols.wallpad.BR_CAR_EVENT_GUEST";
  197. public static final String BR_PLAY_SOUND = "kr.co.icontrols.wallpad.BR_PLAY_SOUND";
  198. /**
  199. * Jeff, 2019.12.25
  200. * WallPadMain에서 WallPadCall의 Live 상태를 파악하기 위한 BR
  201. * WallPadMain에서 BR_REQUEST_WALLPADCALL_LIVE을 보내면 WallPadCall은 BR_ACK_WALLPADCALL_LIVE로 응답한다.
  202. */
  203. public static final String BR_REQUEST_WALLPADCALL_LIVE = "kr.co.icontrols.wallpad.BR_REQUEST_WALLPADCALL_LIVE";
  204. public static final String BR_ACK_WALLPADCALL_LIVE = "kr.co.icontrols.wallpad.BR_ACK_WALLPADCALL_LIVE";
  205. public static final String PID_WALLPADCALL = "PID_WALLPADCALL";
  206. // 거실에너지미터 연동
  207. public static byte LIVINGEM_CTRL_NORMAL = (byte) 0x00;
  208. public static byte LIVINGEM_CTRL_DIM = (byte) 0x01;
  209. public static byte LIVINGEM_CTRL_COLOR = (byte) 0x02;
  210. public static byte LIVINGEM_LIGHTSTATUS_ON = (byte) 0x01;
  211. public static byte LIVINGEM_CTRL_TYPE_JOGDIAL = (byte) 0x00;
  212. public static byte LIVINGEM_CTRL_TYEP_BLE = (byte) 0x01;
  213. public static final class GLOBALSCREEN_ID {
  214. public static final int CTRL_LIGHT_LIVINGROOM = 11000;
  215. public static final int BLACKOUT_EMERGENCY_LIGHT = 12000;
  216. }
  217. // 스마트현관카메라 LED 제어 관련 클래스
  218. public static class SmartRFCamLEDMode {
  219. public final static byte LED_OFF = (byte) 0x00;
  220. public final static byte LED_ON = (byte) 0x01;
  221. public final static byte LED_FLASH1 = (byte) 0x02;
  222. public final static byte LED_FLASH2 = (byte) 0x03;
  223. public final static byte LED_FLASH3 = (byte) 0x04;
  224. public final static byte LED_AUTO_ON = (byte) 0x05;
  225. public final static byte LED_AUTO_OFF = (byte) 0x06;
  226. }
  227. // 스마트현관카메라 상태 제어 관련 클래스
  228. public static class SmartRFCamStatusMode {
  229. public final static byte STATUS_OFF = (byte) 0x00;
  230. public final static byte STATUS_ON = (byte) 0x01;
  231. public final static byte STATUS_AUTO_ON = (byte) 0x02;
  232. public final static byte STATUS_AUTO_OFF = (byte) 0x03;
  233. }
  234. public static final class BR_MAIN_NOTI {
  235. public static final String ACNAME_MAIN_NOTI = "kr.co.icontrols.wallpad.BR_MAIN_NOTI";
  236. public static final String KIND = "KIND";
  237. // Kind
  238. public static final int ARRIVED_CAR = 1001;
  239. public static final int DOOR_SOUND_OUTMODE = 1002;
  240. public static final int DOOR_SOUND_DEVICECHECK = 1003;
  241. public static final int CALL_ELEVATOR_DOWN = 1004;
  242. public static final int CALL_ELEVATOR_UP = 1005;
  243. public static final int OUTMODE_CTRL_WORKING = 1006;
  244. public static final int COMBACK_CTRL_WORKING = 1007;
  245. public static final int APK_EXIT_MAIN_CHECK = 1008;
  246. public static final int GO_BAD_CTRL_WORKING = 1009;
  247. public static final int OUT_BAD_CTRL_WORKING = 1010;
  248. public static final int UI_UPDATE_PARCEL = 1011;
  249. public static final int REQ_ELEVATOR_CALL_STATE = 1012;
  250. public static final int RET_ELEVATOR_CALL_STATE = 1013;
  251. public static final int SOUND_COMBACK_MODE = 1014;
  252. public static final int LIVE_CHECK_BR = 1015;
  253. public static final int SMARTKEY_ALARM_BR = 1016;
  254. public static final int KMS_KEY_SEND_BR = 1017;
  255. public static final int NOTI_CALLAPP_FINISHING = 1018;
  256. public static final int REQ_UPLOAD_MISSEDVISITORPIC = 1019;
  257. public static final int UI_BANDLOCATION_ALARM = 1020;
  258. public static final int UI_UPDATE_POST = 1021;
  259. public static final int NOTICE_DETECT_STRANGER = 1022;
  260. public static final int ACCEPT_RECORDING = 1023;
  261. public static final int ACCEPT_TAKEPIC = 1024;
  262. public static final int NOTICE_PSTN_RING_END = 1025;
  263. public static final int NOTICE_DOORCAM_BTN = 1026;
  264. public static final int NOTICE_FRONT_MONITOR_BTN = 1027;
  265. public static final int SOUND_OUTMODE = 1028;
  266. public static final int SOUND_INMODE = 1029;
  267. public static final int ONOFF_CAMERA_BTN = 1030;
  268. public static final String CARD_NUM = "CARD_NUM";
  269. }
  270. // public static final class BR_ELEVATOR_NOTI
  271. // {
  272. // public static final String ACNAME_NAME = "kr.co.icontrols.wallpad.BR_ELEVATOR_NOTI";
  273. // public static final String KIND = "KIND";
  274. // public static final int RET_ELEVATOR_CALL_STATE = 1013;
  275. // }
  276. public static final class BR_MAIN_LIVE_CHECKER {
  277. public static final String ACNAME_MAIN_LIVE_CHECKER = "kr.co.icontrols.wallpad.ACNAME_MAIN_LIVE_CHECKER";
  278. public static final String KIND = "KIND";
  279. // Kind
  280. public static final int IMAP_SERVER = 1001;
  281. public static final int MAIN_ACTIVITY = 1002;
  282. public static final int SIP_ACTIVITY = 1003;
  283. }
  284. public static final int IGW200_DOOR_MONITERING = 1000;
  285. public static final int IGW200_DOOR_CONNECT = 1001;
  286. public static final int IGW200_DOOR_SUBPHONE_CONNECT = 1002;
  287. public static final int IGW200_DOOR_CLOSE = 1003;
  288. public static final int IGW200_PSTN_CONNECT = 1004;
  289. public static final int IGW200_PSTN_CLOSE = 1005;
  290. public static final int IGW200_MOIP_SUBPHONE_CONNECT = 1006;
  291. public static final int IGW200_MOIP_CLOSE = 1007;
  292. public static final int IGW200_VIDEO_FRONT = 1020;
  293. public static final int IGW200_VIDEO_LOBBY = 1021;
  294. public static final int IGW200_EMER_ACK = 1030;
  295. public static final int IGW200_SENSOR_CHECK = 1031;
  296. public static final int MULTICALL_DOOR_ACCEPT = 1200;
  297. public static final int MULTICALL_PSTN_ACCEPT = 1201;
  298. public static final int MULTICALL_HOLD_DOOR_ACCEPT = 1202;
  299. //동호설정 관련
  300. public static final String DNS_IP = "10.0.1.1";
  301. public static final String SUBNET_MASK = "255.255.0.0";
  302. public static final String DEFAULT_SERVER_IP = "10.0.1.1";
  303. public static final int DEFAULT_SERVER_PORT = 10000;
  304. public static final String DEFAULT_MANAGER_PC_IP = "10.0.1.10";
  305. public static final int DEFAULT_MANAGER_PC_PORT = DEFAULT_SERVER_PORT;
  306. public static final String CONTENTS_ROOT = "/storage/emulated/0/wallpaddata/";
  307. public static final int DEFAULT_GATEWAY_IP_THIRD = 0;
  308. public static final int DEFAULT_GATEWAY_IP_FORTH = 254;
  309. public static final int DEFAULT_LOBBY_IP_THIRD = 0;
  310. public static final int DEFAULT_LOBBY_IP_FORTH = 10;
  311. public static final int DEFAULT_GUARD_IP_SECOND = 0;
  312. public static final int DEFAULT_GUARD_IP_THIRD = 128;
  313. public static final int DEFAULT_GUARD_IP_FORTH = 10;
  314. /**
  315. * IHN-D101-I(C) 월패드 카메라 설정을 위한 상수
  316. */
  317. public static final int WALLPAD_CAM_AHD_FRONT = 0;
  318. public static final int WALLPAD_CAM_NORMAL_FRONT = 1;
  319. public static final int WALLPAD_CAM_AHD_FRONT_FLIP = 2; // 펌웨어 개선 버전의 스마트IOT현관카메라
  320. public static final String DOOR_CAMERA_TYPE_DEFAULT = "기본";
  321. public static final String DOOR_CAMERA_TYPE_RF_DOOR_CAMERA = "RF현관카메라";
  322. public static final String DOOR_CAMERA_TYPE_SMART_KEY = "스마트키";
  323. public static final String DOOR_CAMERA_TYPE_IOT_SMART = "스마트IOT현관카메라";
  324. public static final String DOOR_CAMERA_TYPE_HYOSUNG_SMART = "스마트현관카메라-효성";
  325. public static final String DOOR_CAMERA_TYPE_DAEWOO_SMART = "스마트현관카메라-대우";
  326. //에너지 사용량 알림 서비스 관련
  327. public static final String ENERGY_INTENT_ENERGY_COUNT = "Energy_Count"; //3종인지 5종인지
  328. public static final String ENERGY_INTENT_GETDATA_TIME_YEAR = "GetData_Time_year"; //검침 시간 년도
  329. public static final String ENERGY_INTENT_GETDATA_TIME_MONTH = "GetData_Time_month"; //검침 시간 월
  330. public static final String ENERGY_INTENT_GETDATA_TIME_DAY = "GetData_Time_day"; //검침 시간 일
  331. public static final String ENERGY_INTENT_GETDATA_TIME_HOUR = "GetData_Time_hour"; //검침 시간 시간
  332. public static final String ENERGY_INTENT_GETDATA_TIME_MINUTE = "GetData_Time_minute"; //검침 시간 분
  333. public static final String ENERGY_INTENT_USE_ELECTRIC = "Use_Electric"; //전기 사용량
  334. public static final String ENERGY_INTENT_GOAL_ELECTRIC = "Goal_Electric"; //전기 목표량
  335. public static final String ENERGY_INTENT_SAME_SPACE_ELECTRIC = "Same_Space_Electric";
  336. public static final String ENERGY_INTENT_USE_WATER = "Use_Water"; //수도 사용량
  337. public static final String ENERGY_INTENT_GOAL_WATER = "Goal_Water"; //수도 목표량
  338. public static final String ENERGY_INTENT_SAME_SPACE_WATER = "Same_Space_Water";
  339. public static final String ENERGY_INTENT_USE_GAS = "Use_Gas"; //가스 사용량
  340. public static final String ENERGY_INTENT_GOAL_GAS = "Goal_Gas"; //가스 목표량
  341. public static final String ENERGY_INTENT_SAME_SPACE_GAS = "Same_Space_Gas";
  342. public static final String ENERGY_INTENT_USE_HOTWATER = "Use_Hotwater"; //온수 사용량
  343. public static final String ENERGY_INTENT_GOAL_HOTWATER = "Goal_Hotwater"; //온수 목표량
  344. public static final String ENERGY_INTENT_SAME_SPACE_HOTWATER = "Same_Space_Hotwater";
  345. public static final String ENERGY_INTENT_USE_HEATING = "Use_Heating"; //난방 사용량
  346. public static final String ENERGY_INTENT_GOAL_HEATING = "Goal_Heating"; //난방 목표량
  347. public static final String ENERGY_INTENT_SAME_SPACE_HEATING = "Same_Space_Heating";
  348. public static final String ENERGY_INTENT_USE_CARBON = "Use_Carbon"; //탄소 사용량
  349. public static final String ENERGY_INTENT_GOAL_CARBON = "Goal_Carbon"; //탄소 목표량
  350. public static final int PARKING_SYSTEM_BASIC = 0;
  351. public static final int PARKING_SYSTEM_ICONTROLS = 1;
  352. public static final int PARKING_SYSTEM_NEXPA = 2;
  353. public static final int PARKING_SYSTEM_UPIS = 3;
  354. public static final int PARKING_SYSTEM_ETC = 4;
  355. public static final int PARKING_SYSTEM_IES_100 = 5; //비상벨 단말기
  356. public static final int PARKING_SYSTEM_DARAM = 6; //다람정보
  357. public static final String AppName_WallPadMain = "kr.co.icontrols.icwallpadmain";
  358. public static final String AppName_WallPadConfig = "kr.co.icontrols.wallpadconfig";
  359. public static final String AppName_WallPadAddservice = "kr.co.icontrols.wallpadaddservice";
  360. public static final String AppName_WallPadEmergency = "kr.co.icontrols.wallpademergency";
  361. public static final String AppName_WallPadEnergyCtrl = "kr.co.icontrols.wallpadenergyctrl";
  362. public static final String AppName_WallPadHomeCtrl = "kr.co.icontrols.wallpadhomectrl";
  363. public static final String AppName_WallPadAutopicture = "kr.co.icontrols.autopicture";
  364. public static final String AppName_WallPadSecurity = "kr.co.icontrols.wallpadsecurity";
  365. public static final String AppName_WallPadOutModerun = "kr.co.icontrols.wallpadoutmoderun";
  366. public static final String AppName_WallPadCall = "com.artncore.apps.ic_wallpad";
  367. public static final String AppName_WallPadAlert = "com.artncore.wallpadalert";
  368. public static final String AppName_WallPadDeviceService = "com.artncore.deviceservice";
  369. public static final String AppName_WallPadManagerSetting = "com.artncore.managersetting";
  370. public static final String AppName_WallPadUpdater = "com.artncore.updater";
  371. public static final String AppName_WallPadAppUpdater = "com.artncore.appupdater";
  372. public static final String AppName_WallPadLogOutput = "com.artncore.apps.ic_wallpad.service.log";
  373. public static int getInfoScreenSize_W_1024(int Style) {
  374. if (Style == INFO_STYLE_NORMAL) return SCREEN_SIZE_INFO_W_1024;
  375. else Log.e("Common", "getInfoScreenSize_W_1024 - Out of range !!! (" + Style +")");
  376. return 0;
  377. }
  378. public static int getInfoScreenSize_H_1024(int Style) {
  379. if (Style == INFO_STYLE_NORMAL) return SCREEN_SIZE_INFO_H_1024;
  380. else Log.e("Common", "getInfoScreenSize_H_1024 - Out of range !!! (" + Style +")");
  381. return 0;
  382. }
  383. public static int getInfoScreenSize_W_1280(int Style) {
  384. if (Style == INFO_STYLE_NORMAL) return SCREEN_SIZE_INFO_W_1280;
  385. else Log.e("Common", "getInfoScreenSize_W_1280 - Out of range !!! (" + Style +")");
  386. return 0;
  387. }
  388. public static int getInfoScreenSize_H_1280(int Style) {
  389. if (Style == INFO_STYLE_NORMAL) return SCREEN_SIZE_INFO_H_1280;
  390. else Log.e("Common", "getInfoScreenSize_H_1280 - Out of range !!! (" + Style +")");
  391. return 0;
  392. }
  393. public static int getPopupScreenSize_W(int Style) {
  394. Log.d(TAG, "*********** getPopupScreenSize_W : " + Common.SCREEN_TYPE );
  395. if (Common.SCREEN_TYPE == Common.SCREEN_TYPE_1280x800) {
  396. if (Style == POPUP_STYLE_NOMAL) return SCREEN_SIZE_POPUP_NOMAL_W_1280;
  397. else if (Style == POPUP_STYLE_INPUT) return SCREEN_SIZE_POPUP_INPUT_W_1280;
  398. else if (Style == POPUP_STYLE_INSERT_WIDGET) return 916;
  399. else if (Style == POPUP_STYLE_EVENTNOTIFICATION) return SCREEN_SIZE_POPUP_EVENTNOTI_W_1280;
  400. else if (Style == POPUP_STYLE_FUNCGROUP ) return SCREEN_SIZE_POPUP_FUNCGROUP_W_1280;
  401. else if (Style == FULL_SCREEN ) return 1280;
  402. else Log.e(TAG, "getPopupScreenSize_W - Out of range !!! (" + Style +")");
  403. }
  404. else {
  405. if (Style == POPUP_STYLE_NOMAL) return SCREEN_SIZE_POPUP_NOMAL_W;
  406. else if(Style == POPUP_STYLE_INPUT) return SCREEN_SIZE_POPUP_INPUT_W;
  407. else if(Style == POPUP_STYLE_INSERT_WIDGET) return SCREEN_SIZE_POPUP_INSERT_WIDGET_W;
  408. else if(Style == POPUP_STYLE_EVENTNOTIFICATION) return SCREEN_SIZE_POPUP_EVENTNOTI_W;
  409. else if(Style == POPUP_STYLE_LIGHTPRESET) return SCREEN_SIZE_POPUP_LIGHTPRESET_W;
  410. else if(Style == POPUP_STYLE_FUNCGROUP) return SCREEN_SIZE_POPUP_FUNCGROUP_W;
  411. else if(Style == FULL_SCREEN ) return WpadScale.DEFAULT_WIDTH_PIXELS;
  412. else Log.e(TAG, "getPopupScreenSize_W - Out of range !!! (" + Style +")");
  413. }
  414. return 0;
  415. }
  416. public static int getPopupScreenSize_H(int Style) {
  417. Log.d(TAG, "*********** getPopupScreenSize_H : " + Common.SCREEN_TYPE );
  418. if (Common.SCREEN_TYPE == Common.SCREEN_TYPE_1280x800) {
  419. if (Style == POPUP_STYLE_NOMAL) return SCREEN_SIZE_POPUP_NOMAL_H_1280;
  420. else if (Style == POPUP_STYLE_INPUT) return SCREEN_SIZE_POPUP_INPUT_H_1280;
  421. else if (Style == POPUP_STYLE_INSERT_WIDGET) return 492 + 88;
  422. else if (Style == POPUP_STYLE_EVENTNOTIFICATION) return SCREEN_SIZE_POPUP_EVENTNOTI_H_1280;
  423. else if (Style == POPUP_STYLE_FUNCGROUP ) return SCREEN_SIZE_POPUP_FUNCGROUP_H_1280;
  424. else if (Style == FULL_SCREEN ) return 800;
  425. else Log.e(TAG, "getPopupScreenSize_H - Out of range !!! (" + Style +")");
  426. }
  427. else {
  428. if (Style == POPUP_STYLE_NOMAL) return SCREEN_SIZE_POPUP_NOMAL_H;
  429. else if (Style == POPUP_STYLE_INPUT) return SCREEN_SIZE_POPUP_INPUT_H;
  430. else if (Style == POPUP_STYLE_INSERT_WIDGET) return SCREEN_SIZE_POPUP_INSERT_WIDGET_H;
  431. else if (Style == POPUP_STYLE_EVENTNOTIFICATION) return SCREEN_SIZE_POPUP_EVENTNOTI_H;
  432. else if(Style == POPUP_STYLE_LIGHTPRESET) return SCREEN_SIZE_POPUP_LIGHTPRESET_H;
  433. else if(Style == POPUP_STYLE_FUNCGROUP) return SCREEN_SIZE_POPUP_FUNCGROUP_H;
  434. else if (Style == FULL_SCREEN ) return WpadScale.DEFAULT_HEIGHT_PIXELS;
  435. else Log.e(TAG, "getPopupScreenSize_H - Out of range !!! (" + Style +")");
  436. }
  437. return 0;
  438. }
  439. public static int CtrlMarginLEFT(int left)
  440. {
  441. int retLeft = left - CTRL_MARGIN_LEFT;
  442. if(retLeft < 0)
  443. {
  444. Log.e("Common", "CtrlMarginLEFT - Out of range !!! (" + left +")");
  445. return 0;
  446. }
  447. return retLeft;
  448. }
  449. public static int CtrlMarginTOP(int top)
  450. {
  451. int retTop = top - CTRL_MARGIN_TOP;
  452. if(retTop < 0)
  453. {
  454. Log.e("Common", "CtrlMarginTOP - Out of range !!! (" + top +")");
  455. return 0;
  456. }
  457. return retTop;
  458. }
  459. public static int PopupNomalMarginLEFT(int left) {
  460. int mainleft = 216;
  461. int retLeft = left - mainleft;
  462. if(retLeft < 0)
  463. {
  464. Log.e("Common", "PopupNomalMarginLEFT - Out of range !!! (" + left +")");
  465. return 0;
  466. }
  467. return retLeft;
  468. }
  469. public static int PopupNomalMarginTOP(int top)
  470. {
  471. int maintop = 21;
  472. int retTop = top - maintop;
  473. if(retTop < 0)
  474. {
  475. Log.e("Common", "PopupNomalMarginTOP - Out of range !!! (" + top +")");
  476. return 0;
  477. }
  478. return retTop;
  479. }
  480. public static int PopupAlarmMarginLEFT(int left)
  481. {
  482. int mainleft = 216;
  483. int retLeft = left - mainleft;
  484. if(retLeft < 0)
  485. {
  486. Log.e("Common", "PopupAlarmMarginLEFT - Out of range !!! (" + left +")");
  487. return 0;
  488. }
  489. return retLeft;
  490. }
  491. public static int PopupAlarmMarginTOP(int top)
  492. {
  493. int maintop = 87;
  494. int retTop = top - maintop;
  495. if(retTop < 0)
  496. {
  497. Log.e("Common", "PopupAlarmMarginTOP - Out of range !!! (" + top +")");
  498. return 0;
  499. }
  500. return retTop;
  501. }
  502. public static int PopupInsertWidgetLEFT( int left)
  503. {
  504. int mainleft = 148;
  505. int retLeft = left - mainleft;
  506. if(retLeft < 0)
  507. {
  508. Log.e("Common", "PopupInsertWidgetLEFT - Out of range !!! (" + left +")");
  509. return 0;
  510. }
  511. return retLeft;
  512. }
  513. public static int PopupInsertWidgetTOP( int top)
  514. {
  515. int maintop = 57;
  516. int retTop = top - maintop;
  517. if(retTop < 0)
  518. {
  519. Log.e("Common", "PopupInsertWidgetLEFT - Out of range !!! (" + top +")");
  520. return 0;
  521. }
  522. return retTop;
  523. }
  524. public static void DebugLog(String s) { if(DEBUG_LOG_ON) Log.d("Common", s); }
  525. /**
  526. * 제어기기 영업샘플모드 활성화 상태를 가져온다.
  527. *
  528. * @return (boolean) true : 활성 , false : 비활성 or 에러
  529. */
  530. public static boolean GetDeviceSampleMode(Context context)
  531. {
  532. try
  533. {
  534. WallpadSalesSampleData wssd = new WallpadSalesSampleData(context);
  535. int mode = wssd.getSalesSampleData(WallpadSalesSampleData.SALES_SAMPLE_MODE_DEVICE_CONTROLLER);
  536. wssd.closeDB();
  537. Log.d("Common", "[GetSampleMode] mode = " + mode);
  538. if(mode == 1) return true;
  539. }
  540. catch (RuntimeException re) {
  541. LogUtil.errorLogInfo("", TAG, re);
  542. }
  543. catch (Exception e)
  544. {
  545. Log.e("Common", "[ExceptionError] - new GetDeviceSampleMode : " + e);
  546. //e.printStackTrace();
  547. LogUtil.errorLogInfo("", TAG, e);
  548. }
  549. return false;
  550. }
  551. //SALES_SAMPLE_MODE_SLEEP
  552. /**
  553. * 센서 감지 영업 샘플 모드 사용할 것인지 말것인지.
  554. *
  555. * @return (boolean) true : 슬립모드 안들어감(모델하우스버전) , false : 슬립모드 들어감(정상버전)
  556. */
  557. public static boolean GetModelHouseSleepModeRelease(Context context)
  558. {
  559. try
  560. {
  561. WallpadSalesSampleData wssd = new WallpadSalesSampleData(context);
  562. int mode = wssd.getSalesSampleData(WallpadSalesSampleData.SALES_SAMPLE_MODE_SLEEP);
  563. wssd.closeDB();
  564. if(mode == 0) return true;
  565. }
  566. catch (RuntimeException re) {
  567. LogUtil.errorLogInfo("", TAG, re);
  568. }
  569. catch (Exception e)
  570. {
  571. Log.e("Common", "[ExceptionError] - new GetModelHouseSleepModeRelease : " + e);
  572. //e.printStackTrace();
  573. LogUtil.errorLogInfo("", TAG, e);
  574. }
  575. return false;
  576. }
  577. /**
  578. * 센서 감지 영업 샘플 모드 사용할 것인지 말것인지.
  579. *
  580. * @return (boolean) true : 활성 , false : 비활성 or 에러
  581. */
  582. public static boolean GetSensorSampleMode(Context context)
  583. {
  584. try
  585. {
  586. WallpadSalesSampleData wssd = new WallpadSalesSampleData(context);
  587. int mode = wssd.getSalesSampleData(WallpadSalesSampleData.SALES_SAMPLE_MODE_SENSOR_DETECTING);
  588. wssd.closeDB();
  589. if(mode == 0) return true;
  590. }
  591. catch (RuntimeException re) {
  592. LogUtil.errorLogInfo("", TAG, re);
  593. }
  594. catch (Exception e)
  595. {
  596. Log.e("Common", "[ExceptionError] - new GetSensorSampleMode : " + e);
  597. //e.printStackTrace();
  598. LogUtil.errorLogInfo("", TAG, e);
  599. }
  600. return false;
  601. }
  602. /**
  603. * 엘리베이터 영업샘플모드 활성화 상태를 가져온다.
  604. *
  605. * @return (boolean) true : 활성 , false : 비활성 or 에러
  606. */
  607. public static boolean GetElevatorSampleMode(Context context)
  608. {
  609. try
  610. {
  611. WallpadSalesSampleData wssd = new WallpadSalesSampleData(context);
  612. int mode = wssd.getSalesSampleData(WallpadSalesSampleData.SALES_SAMPLE_MODE_ELEVATOR);
  613. wssd.closeDB();
  614. Log.d("Common", "[GetSampleMode] mode = " + mode);
  615. if(mode == 1) return true;
  616. }
  617. catch (RuntimeException re) {
  618. LogUtil.errorLogInfo("", TAG, re);
  619. }
  620. catch (Exception e)
  621. {
  622. Log.e("Common", "[ExceptionError] - new GetElevatorSampleMode : " + e);
  623. //e.printStackTrace();
  624. LogUtil.errorLogInfo("", TAG, e);
  625. }
  626. return false;
  627. }
  628. public static boolean getUse485_SmartSwitch( Context context )
  629. {
  630. try
  631. {
  632. if( Version.getModelType() != Version.MODEL_TYPE.IHN_1020GL )
  633. {
  634. WallpadDeviceSet devSet = new WallpadDeviceSet(context);
  635. int[] BatchInfo = devSet.Get_BatchSW_Info();
  636. devSet.closeDB();
  637. if (BatchInfo[0] == 1 && BatchInfo[1] == WallpadDeviceSet.BATCH_TYPE_SMART )
  638. {
  639. return true;
  640. }
  641. }
  642. }
  643. catch (RuntimeException re) {
  644. LogUtil.errorLogInfo("", TAG, re);
  645. } catch( Exception e)
  646. {
  647. //e.printStackTrace();
  648. LogUtil.errorLogInfo("", TAG, e);
  649. }
  650. return false;
  651. }
  652. public static List<String[]> getSubDevListContents( Context context)
  653. {
  654. List<String[]> ret = null;
  655. try
  656. {
  657. WallpadDeviceSet devset = new WallpadDeviceSet(context);
  658. if (devset != null)
  659. {
  660. ret = devset.GetSettingGroupData("subdev_list");
  661. }
  662. else
  663. {
  664. Log.d("getSubDevListContents", "WallpadDeviceSet == null ========> ");
  665. }
  666. devset.closeDB();
  667. if ((ret == null) || (ret.size() <= 0))
  668. {
  669. Log.d("getSubDevListContents", "return value null =========> ");
  670. return null;
  671. }
  672. }
  673. catch (RuntimeException re) {
  674. LogUtil.errorLogInfo("", TAG, re);
  675. } catch( Exception e)
  676. {
  677. Log.e("Exception", e.toString());
  678. //e.printStackTrace();
  679. LogUtil.errorLogInfo("", TAG, e);
  680. }
  681. return ret;
  682. }
  683. public static String getSubDevListItem(Context context, int itemType) {
  684. List<String[]> subDevList = getSubDevListContents(context);
  685. List<String> result = null;
  686. String devInfo = null;
  687. String deviceID = null;
  688. if ((subDevList != null) && (subDevList.size() > 0)) {
  689. deviceID = MainDatabaseManager.getSubDevID(itemType);
  690. if (deviceID != null) {
  691. for (int i = 0; i < subDevList.size(); i++) {
  692. // Log.d("Common", "deviceID :" + deviceID + "subDevList() .get(" + i + ")[0] : " + subDevList.get(i)[0]
  693. // + ", .get(" + i + ")[1] : " + subDevList.get(i)[1]
  694. // );
  695. if (deviceID.equals(subDevList.get(i)[0])) {
  696. devInfo = subDevList.get(i)[1];
  697. break;
  698. }
  699. }
  700. }
  701. }
  702. else {
  703. Common.DebugLog(" return value null");
  704. }
  705. if (ENABLED_SUB_DEVICE_DEFAULT_VALUE == true) {
  706. if (devInfo == null) {
  707. switch (itemType) {
  708. case SETTING_ITEM_SUB_DEVICE_ELEVATOR:
  709. devInfo = "1(1:엘리베이터(사용함)종류( 층표시 ))";
  710. break;
  711. }
  712. }
  713. }
  714. return devInfo;
  715. }
  716. /**
  717. * GLE 모델의 경우 현관 수신과 전화수신을 통화 apk에 전달하기 위해 사용한다.<br>
  718. * <br>
  719. * input param :
  720. *
  721. */
  722. public static void received_Call( Context context, String ActionFilter )
  723. {
  724. Intent intent = new Intent(ActionFilter, null);
  725. context.sendBroadcast(intent);
  726. }
  727. public static void command_iGW200( Context context, int kind )
  728. {
  729. //DebugLog("%%%%%%%%%%%%%% Common.log command_iGW200 : " + kind);
  730. Intent iGwIntent = new Intent();
  731. iGwIntent.setAction(Common.BR_IGW200FILTER);
  732. iGwIntent.putExtra("KIND", kind);
  733. context.sendBroadcast(iGwIntent);
  734. }
  735. public static void SendBRMainNoti(Context context , int kind)
  736. {
  737. Intent iIntent = new Intent();
  738. iIntent.setAction(BR_MAIN_NOTI.ACNAME_MAIN_NOTI);
  739. iIntent.putExtra(BR_MAIN_NOTI.KIND, kind);
  740. context.sendBroadcast(iIntent);
  741. }
  742. public static void SendAppFinishReqBR( Context context)
  743. {
  744. Log.d("Common", "SendAppFinishReqBR =========> ");
  745. Intent notiIntent = new Intent();
  746. notiIntent.setAction(define.BR_APP_FINISH);
  747. context.sendBroadcast(notiIntent);
  748. }
  749. public static void SendBRLiveChecker(Context context , int kind)
  750. {
  751. Intent iIntent = new Intent();
  752. iIntent.setAction(BR_MAIN_LIVE_CHECKER.ACNAME_MAIN_LIVE_CHECKER);
  753. iIntent.putExtra(BR_MAIN_LIVE_CHECKER.KIND, kind);
  754. context.sendBroadcast(iIntent);
  755. }
  756. final static int DEFAULT_METERING_COUNT = 5;
  757. public static int GetMeteringCount( Context context )
  758. {
  759. WallpadDeviceSet devSet = new WallpadDeviceSet(context);
  760. String[] MetringDB = devSet.GetSettingData("원격검침");
  761. devSet.closeDB();
  762. if (MetringDB!=null)
  763. {
  764. for( int i = 0 ; i < MetringDB.length ; i++ )
  765. Log.d("Common", "$$$$$$$$$$ MetringDB[ " + i +" ] : " + MetringDB[i]);
  766. try
  767. {
  768. if( MetringDB[1].indexOf("원격검침(사용안함)") > 0 )
  769. return 0;
  770. Log.d("Common", "$$$$$$$$$$ MetringDB count : " + Integer.parseInt(MetringDB[1].split("[(]")[1].split("[:]")[0].trim()));
  771. return Integer.parseInt(MetringDB[1].split("[(]")[1].split("[:]")[0].trim());
  772. }
  773. catch (RuntimeException re) {
  774. LogUtil.errorLogInfo("", TAG, re);
  775. return DEFAULT_METERING_COUNT;
  776. }
  777. catch (Exception e)
  778. {
  779. //e.printStackTrace();
  780. LogUtil.errorLogInfo("", TAG, e);
  781. return DEFAULT_METERING_COUNT;
  782. }
  783. }
  784. else
  785. return DEFAULT_METERING_COUNT;
  786. }
  787. /**
  788. * 내부동체 사용여부를 DB에서 가져와 리턴한다.
  789. *
  790. * @return int[] result[0] - 내부동체 사용여부 (1이면 사용, 0이면 미사용) <br>
  791. * int[] result[1] - 외부동체 사용여부 (1이면 사용, 0이면 미사용)
  792. * **/
  793. public static int[] GetInSensorUseOfNotFromDB( Context context)
  794. {
  795. int returnData[] = {1, 1};
  796. try
  797. {
  798. WallpadDeviceSet devSet = new WallpadDeviceSet(context);
  799. String[] SensorValue = devSet.GetSettingData("동체설정");
  800. devSet.closeDB();
  801. if (SensorValue == null)
  802. {
  803. Log.e("Common", "GetSettingData(동체설정) is null");
  804. return returnData;
  805. }
  806. String devInfo = SensorValue[1];
  807. devInfo = devInfo.replace('(', '_');
  808. devInfo = devInfo.replace(':', '_');
  809. devInfo = devInfo.replace(')', '_');
  810. String[] DataInfo = devInfo.split("_");
  811. //동체설정 사용여부
  812. if(DataInfo[3].equals("사용안함") == true)
  813. {
  814. returnData[0] = 0;
  815. returnData[1] = 0;
  816. Log.d("Common", "move sensor is not use");
  817. return returnData;
  818. }
  819. //내부동체
  820. if(DataInfo[7].equals("사용함") == true)
  821. {
  822. returnData[0] = 1;
  823. Log.d("Common", "IN Move sensor is use");
  824. }
  825. else
  826. {
  827. returnData[0] = 0;
  828. Log.d("Common", "IN Move sensor is not use");
  829. }
  830. //외부동체
  831. if(DataInfo[5].equals("사용함") == true)
  832. {
  833. returnData[1] = 1;
  834. Log.d("Common", "OUT Move sensor is use");
  835. }
  836. else
  837. {
  838. returnData[1] = 0;
  839. Log.d("Common", "OUT Move sensor is not use");
  840. }
  841. return returnData;
  842. }
  843. catch (RuntimeException re) {
  844. LogUtil.errorLogInfo("", TAG, re);
  845. return returnData;
  846. }
  847. catch (Exception e)
  848. {
  849. //e.printStackTrace();
  850. LogUtil.errorLogInfo("", TAG, e);
  851. return returnData;
  852. }
  853. }
  854. public static final int Notify_DoorCameraUse_Start = 1;
  855. public static final int Notify_DoorCameraUse_End= 0;
  856. public static void SendDoorCallStateForRFCamera( Context context , int state )
  857. {
  858. Log.d("Door", "----------------------------------------------------------------");
  859. // if( state == Notify_DoorCameraUse_Start )
  860. // Log.d("Common", "Send Intent DoorCamera Use Start !!!");
  861. // else
  862. // Log.d("Common", "Send Intent DoorCamera Use End !!!");
  863. // Log.d("Door", "----------------------------------------------------------------");
  864. // Intent intent = new Intent( define.NOTIFY_ACNAME, null);
  865. // if( state == Notify_DoorCameraUse_Start )
  866. // intent.putExtra(define.NOTIBR_KIND, define.NOTIFY_DOORCAM_USE_START);
  867. // else
  868. // intent.putExtra(define.NOTIBR_KIND, define.NOTIFY_DOORCAM_USE_END);
  869. // context.sendBroadcast(intent);
  870. }
  871. public static boolean isWirelessDoorlock(Context context)
  872. {
  873. WallpadDeviceSet devSet = new WallpadDeviceSet(context);
  874. String[] GetValue = devSet.GetSettingData("디지털도어락");
  875. devSet.closeDB();
  876. if (GetValue == null)
  877. {
  878. Log.e("Common", "GetSettingData(디지털도어락) is null");
  879. return false;
  880. }
  881. Log.d("Common", "GetSettingData(디지털도어락) is value : " + GetValue[1]);
  882. if( GetValue[1].indexOf("무선") > 0 )
  883. {
  884. Log.d("Common", "Wireless Doorlock");
  885. return true;
  886. }
  887. return false;
  888. }
  889. public static String ZeroPadding_Head(int nOutLength, String strOriginalString) {
  890. String strResult = strOriginalString;
  891. // Log.d(TAG, "[ZeroPadding_Head] (Length) strOriginalString [" + strOriginalString.length() +"], nOutLength [" + nOutLength + "]");
  892. try {
  893. if (strOriginalString.length() < nOutLength) {
  894. for (int i = strOriginalString.length(); i < nOutLength; i++) {
  895. strResult = "0" + strResult;
  896. }
  897. // Log.d(TAG, "[ZeroPadding_Head] strResult : " + strResult);
  898. }
  899. else if (strOriginalString.length() == nOutLength) {
  900. // Log.d(TAG, "[ZeroPadding_Head] same length!");
  901. }
  902. else {
  903. Log.d(TAG, "[ZeroPadding_Head] strOriginalString(" + strOriginalString.length() +") is longer than nOutLength(" + nOutLength + ")");
  904. }
  905. return strResult;
  906. } catch (RuntimeException re) {
  907. LogUtil.errorLogInfo("", TAG, re);
  908. return strResult;
  909. }
  910. catch (Exception e) {
  911. Log.e(TAG, "[Exception] ZeroPadding_Head(int nOutLength, String strOriginalString)");
  912. //e.printStackTrace();
  913. LogUtil.errorLogInfo("", TAG, e);
  914. return strResult;
  915. }
  916. }
  917. public static String ZeroPadding_Tail(int nOutLength, String strOriginalString) {
  918. String strResult = strOriginalString;
  919. Log.d(TAG, "[ZeroPadding_Tail] (Length) strOriginalString [" + strOriginalString.length() +"], nOutLength [" + nOutLength + "]");
  920. try {
  921. if (strOriginalString.length() < nOutLength) {
  922. for (int i = strOriginalString.length(); i < nOutLength; i++) {
  923. strResult = strResult + "0";
  924. }
  925. Log.d(TAG, "[ZeroPadding_Tail] strResult : " + strResult);
  926. }
  927. else if (strOriginalString.length() == nOutLength) {
  928. Log.d(TAG, "[ZeroPadding_Tail] same length!");
  929. }
  930. else {
  931. Log.d(TAG, "[ZeroPadding_Tail] strOriginalString(" + strOriginalString.length() +") is longer than nOutLength(" + nOutLength + ")");
  932. }
  933. return strResult;
  934. } catch (RuntimeException re) {
  935. LogUtil.errorLogInfo("", TAG, re);
  936. return strResult;
  937. }
  938. catch (Exception e) {
  939. Log.e(TAG, "[Exception] ZeroPadding_Tail(int nOutLength, String strOriginalString)");
  940. //e.printStackTrace();
  941. LogUtil.errorLogInfo("", TAG, e);
  942. return strResult;
  943. }
  944. }
  945. public static ELEV_STATUS eElevCallStatus = ELEV_STATUS.NONE;
  946. public static enum ELEV_STATUS {
  947. NONE,
  948. UP,
  949. DOWN,
  950. UP_DOWN;
  951. public static String getString(ELEV_STATUS eStatus) {
  952. if (eStatus == NONE) return NONE.toString();
  953. else if (eStatus == UP) return UP.toString();
  954. else if (eStatus == DOWN) return DOWN.toString();
  955. else if (eStatus == UP_DOWN) return UP_DOWN.toString();
  956. else return NONE.toString();
  957. }
  958. public static ELEV_STATUS getEnum(String strStatus) {
  959. if (strStatus.equalsIgnoreCase(NONE.toString())) return NONE;
  960. else if (strStatus.equalsIgnoreCase(UP.toString())) return UP;
  961. else if (strStatus.equalsIgnoreCase(DOWN.toString())) return DOWN;
  962. else if (strStatus.equalsIgnoreCase(UP_DOWN.toString())) return UP_DOWN;
  963. else return NONE;
  964. }
  965. }
  966. // SKT 모바일 서비스
  967. public static final String MOBILE_SERVICE_ENERGY_UPDATE = "MOBILE_SERVICE_ENERGY_UPDATE";
  968. public static void MobileServiceEnergyDataReqBR(Context context) {
  969. try {
  970. Intent iMobileServieIntent = new Intent();
  971. iMobileServieIntent.setAction(Common.MOBILE_SERVICE_ENERGY_UPDATE);
  972. context.sendBroadcast(iMobileServieIntent);
  973. } catch (RuntimeException re) {
  974. LogUtil.errorLogInfo("", TAG, re);
  975. } catch( Exception e ) {
  976. //e.printStackTrace();
  977. LogUtil.errorLogInfo("", TAG, e);
  978. }
  979. }
  980. /**
  981. * 통신사 제어기기 구독 사용 여부
  982. *
  983. * @return (int) - >0 : 제어기기 구독 상태, <0 : 제어기기 구독 해제
  984. */
  985. public static boolean setDeviceSubcriptionOld(Context context, boolean status) {
  986. // 1. get DB
  987. WallpadDeviceSet devset = new WallpadDeviceSet(context);
  988. boolean retValue = devset.SetSubDevListItem(status , "월패드구독");
  989. devset.closeDB();
  990. return retValue;
  991. }
  992. /**
  993. * 통신사 제어기기 구독 사용 여부
  994. *
  995. * @return (int) - >0 : 제어기기 구독 상태, <0 : 제어기기 구독 해제
  996. */
  997. public static boolean getDeviceSubcriptionOld(Context context) {
  998. // 1. get DB
  999. WallpadDeviceSet devset = new WallpadDeviceSet(context);
  1000. int retValue = devset.GetDeviceSetted("월패드구독");
  1001. devset.closeDB();
  1002. // 2. Check
  1003. if (retValue == WallpadDeviceSet.DEV_DATA_ENABLE) return true;
  1004. else return false;
  1005. }
  1006. /**
  1007. * HDC Linker 추가
  1008. *
  1009. * @return () - > true: 성공, false: 실패
  1010. */
  1011. public static String[] setDeviceSubcription(Context context, boolean follow, String company) {
  1012. Log.i(TAG, "[setDeviceSubcription] follow [" + follow + "], company [" + company + "]");
  1013. WallpadDeviceSet devset = new WallpadDeviceSet(context);
  1014. String[] alinkers = devset.getHDCLinker(); // DB에서 기존 Linker를 불러온다.
  1015. String[] retValue = null;
  1016. String linkers = "";
  1017. if (alinkers != null) linkers = convertHDCLinkerArrayToString(alinkers);
  1018. Log.i(TAG, "[setDeviceSubcription] linkers [" + linkers + "]");
  1019. if (follow) {
  1020. // 구독 등록
  1021. if (alinkers == null) {
  1022. linkers = company; // 다른 Linker가 존재하지 않는 경우
  1023. }
  1024. else {
  1025. boolean bExist = false;
  1026. for (int i = 0; i < alinkers.length; i++) {
  1027. if (alinkers[i].equalsIgnoreCase(company.toUpperCase())) bExist = true;
  1028. }
  1029. if (!bExist) {
  1030. if (linkers.equalsIgnoreCase("")) linkers = company; // 다른 Linker가 존재하지 않는 경우
  1031. else linkers += "_" + company; // 다른 Linker가 존재하는 경우
  1032. }
  1033. }
  1034. Log.i(TAG, "[setDeviceSubcription] linkers [" + linkers + "]");
  1035. retValue = convertHDCLinkerStringToArray(linkers);
  1036. }
  1037. else {
  1038. // 구독 삭제
  1039. if (company.equalsIgnoreCase("ALL")) {
  1040. retValue = null;
  1041. }
  1042. else {
  1043. if (alinkers != null) {
  1044. String[] temp = new String[alinkers.length];
  1045. int nCnt = 0;
  1046. for (int i = 0; i < alinkers.length; i++) {
  1047. if (!alinkers[i].equalsIgnoreCase(company.toUpperCase())) {
  1048. temp[nCnt++] = alinkers[i];
  1049. }
  1050. }
  1051. if (nCnt == 0) retValue = null;
  1052. else {
  1053. retValue = new String[nCnt];
  1054. for (int i = 0; i < retValue.length; i++) {
  1055. retValue[i] = temp[i];
  1056. }
  1057. }
  1058. }
  1059. }
  1060. }
  1061. linkers = convertHDCLinkerArrayToString(retValue);
  1062. devset.setHDCLinker(retValue);
  1063. devset.closeDB();
  1064. if (retValue == null) Common.setDeviceSubcriptionOld(context, false);
  1065. Log.i(TAG, "[setDeviceSubcription] linkers [" + linkers + "]");
  1066. return retValue;
  1067. }
  1068. private static String convertHDCLinkerArrayToString(String[] value) {
  1069. String retValue = "";
  1070. if (value != null) {
  1071. for (int i = 0; i < value.length; i++) {
  1072. if (i == 0) retValue = value[i];
  1073. else retValue += "_" + value[i];
  1074. }
  1075. }
  1076. return retValue;
  1077. }
  1078. private static String[] convertHDCLinkerStringToArray(String value) {
  1079. if (!value.equalsIgnoreCase("")) {
  1080. String[] retValue = value.trim().split("_");
  1081. return retValue;
  1082. }
  1083. else return null;
  1084. }
  1085. /**
  1086. * HDC Linker 목록 가져오기
  1087. *
  1088. * @return (String) - > HDC Linker 목록 (예. SKT_KT_KAKAO -> 구독하는 항목만 표기하며, null이면 구독 없음. 연동사별 구분은 "_"한다.)
  1089. */
  1090. public static String[] getDeviceSubcription(Context context) {
  1091. WallpadDeviceSet devset = new WallpadDeviceSet(context);
  1092. String[] retValue = devset.getHDCLinker();
  1093. devset.closeDB();
  1094. return retValue;
  1095. }
  1096. /**
  1097. * HDC Linker 목록 확인하기
  1098. *
  1099. * @return (boolean) - > true: 항목 존재, false: 항목 없음
  1100. */
  1101. public static boolean checkDeviceSubscription(Context context, String company) {
  1102. WallpadDeviceSet devset = new WallpadDeviceSet(context);
  1103. String[] retValue = devset.getHDCLinker();
  1104. devset.closeDB();
  1105. for (int i = 0; i < retValue.length; i++) {
  1106. if (retValue[i].equalsIgnoreCase(company)) return false;
  1107. }
  1108. return false;
  1109. }
  1110. /**
  1111. * HDC Linker 사용여부 및 목록 저장
  1112. *
  1113. * @return (boolean) - true: 성공, false: 실패
  1114. */
  1115. public static boolean setHDCLinkerSubscriptionUsage(Context context, String strLinkers) {
  1116. // 1. get DB
  1117. WallpadDeviceSet devset = new WallpadDeviceSet(context);
  1118. boolean retValue = devset.setHDCLinker(convertHDCLinkerStringToArray(strLinkers));
  1119. devset.closeDB();
  1120. return retValue;
  1121. }
  1122. /**
  1123. * HDC Linker 사용 여부 (외부 연동사의 월패드 구독 여부)
  1124. *
  1125. * @return (boolean) - true: 사용함, false: 사용안함
  1126. */
  1127. public static boolean getHDCLinkerSubscriptionUsage(Context context) {
  1128. // 1. get DB
  1129. boolean retValue = false;
  1130. WallpadDeviceSet devset = new WallpadDeviceSet(context);
  1131. retValue = devset.getHDCLinkerUsage();
  1132. devset.closeDB();
  1133. return retValue;
  1134. }
  1135. /**
  1136. * HDC Linker 목록 확인
  1137. *
  1138. * @return (String) - >HDC Linker 목록 (예. SKT_KT_KAKAO -> 구독하는 항목만 표기하며, null이면 구독 없음. 연동사별 구분은 "_"한다.)
  1139. */
  1140. public static String[] getHDCLinkerSubscription(Context context) {
  1141. // 1. get DB
  1142. WallpadDeviceSet devset = new WallpadDeviceSet(context);
  1143. String[] retValue = devset.getHDCLinker();
  1144. devset.closeDB();
  1145. return retValue;
  1146. }
  1147. public static class VISITORREMOTECALL {
  1148. public static final String INTERNAL_SERVER_IP ="10.2.110.110";
  1149. public static final int INTERNAL_SERVER_PORT = 8000;
  1150. }
  1151. /**
  1152. * 기존 구분되지 않던 구독 방식을 고려해야함. 현장이 운영중에 있으니 월패드 업그레이드가 일어나도 기존 설정값을 그대로 사용 가능해야 함
  1153. * 통신사/포털사 구독 사용 구분
  1154. */
  1155. public enum HDC_LINKER {
  1156. SKT(1, "SKT"),
  1157. KT(2, "KT"),
  1158. LGUPLUS(3, "LGUPLUS"),
  1159. KAKAO(4, "KAKAO"),
  1160. NAVER(5, "NAVER"),
  1161. LGE(6, "LGE"),
  1162. SAMSUNG(7, "SAMSUNG"),
  1163. GOOGLE(8, "GOOGLE"),
  1164. AMAZON(9, "AMAZON"),
  1165. APPLE(10, "APPLE"),
  1166. DAEWOO(11, "DAEWOO"),
  1167. HYOSUNG(12, "HYOSUNG");
  1168. private static int nAvailableLinkerCnt = 12; // 미리 정의된 외부 연동사 항목의 개수에 변화가 생
  1169. private int mIdx;
  1170. private String mContent;
  1171. private String strHomeTag = " HOME";
  1172. private HDC_LINKER(int idx, final String txt) {
  1173. this.mIdx = idx;
  1174. this.mContent = txt;
  1175. }
  1176. public String getContents()
  1177. {
  1178. return this.mContent;
  1179. }
  1180. public String getHomeContents()
  1181. {
  1182. return this.mContent + this.strHomeTag;
  1183. }
  1184. public int getIndex()
  1185. {
  1186. return this.mIdx;
  1187. }
  1188. public static int getAvailableLinkerCnt()
  1189. {
  1190. return nAvailableLinkerCnt;
  1191. }
  1192. }
  1193. public static int getGubun(String inValue) {
  1194. // 1. get DB
  1195. int retValue = 0;
  1196. if (inValue.equalsIgnoreCase(HDC_LINKER.SKT.getContents())) retValue = HDC_LINKER.SKT.getIndex();
  1197. else if (inValue.equalsIgnoreCase(HDC_LINKER.KAKAO.getContents())) retValue = HDC_LINKER.KAKAO.getIndex();
  1198. else if (inValue.equalsIgnoreCase(HDC_LINKER.NAVER.getContents())) retValue = HDC_LINKER.NAVER.getIndex();
  1199. else if (inValue.equalsIgnoreCase(HDC_LINKER.GOOGLE.getContents())) retValue = HDC_LINKER.GOOGLE.getIndex();
  1200. else if (inValue.equalsIgnoreCase(HDC_LINKER.KT.getContents())) retValue = HDC_LINKER.KT.getIndex();
  1201. else if (inValue.equalsIgnoreCase(HDC_LINKER.LGUPLUS.getContents())) retValue = HDC_LINKER.LGUPLUS.getIndex();
  1202. else if (inValue.equalsIgnoreCase(HDC_LINKER.LGE.getContents())) retValue = HDC_LINKER.LGE.getIndex();
  1203. else if (inValue.equalsIgnoreCase(HDC_LINKER.SAMSUNG.getContents())) retValue = HDC_LINKER.SAMSUNG.getIndex();
  1204. else if (inValue.equalsIgnoreCase(HDC_LINKER.AMAZON.getContents())) retValue = HDC_LINKER.AMAZON.getIndex();
  1205. else if (inValue.equalsIgnoreCase(HDC_LINKER.APPLE.getContents())) retValue = HDC_LINKER.APPLE.getIndex();
  1206. else if (inValue.equalsIgnoreCase(HDC_LINKER.DAEWOO.getContents())) retValue = HDC_LINKER.DAEWOO.getIndex();
  1207. else if (inValue.equalsIgnoreCase(HDC_LINKER.HYOSUNG.getContents())) retValue = HDC_LINKER.HYOSUNG.getIndex();
  1208. return retValue;
  1209. }
  1210. public static String getGubunXMLMsg(Context context) {
  1211. String retValue = "";
  1212. boolean[] gubunList = getGubunSubScription(context);
  1213. String inValue = "";
  1214. if (gubunList[HDC_LINKER.SKT.getIndex()]) {
  1215. if (inValue.length() > 0 ) inValue += "_";
  1216. inValue += HDC_LINKER.SKT.getContents();
  1217. }
  1218. if (gubunList[HDC_LINKER.KAKAO.getIndex()]) {
  1219. if (inValue.length() > 0 ) inValue += "_";
  1220. inValue += HDC_LINKER.KAKAO.getContents();
  1221. }
  1222. if (gubunList[HDC_LINKER.NAVER.getIndex()]) {
  1223. if (inValue.length() > 0 ) inValue += "_";
  1224. inValue += HDC_LINKER.NAVER.getContents();
  1225. }
  1226. if (gubunList[HDC_LINKER.GOOGLE.getIndex()]) {
  1227. if (inValue.length() > 0 ) inValue += "_";
  1228. inValue += HDC_LINKER.GOOGLE.getContents();
  1229. }
  1230. if (gubunList[HDC_LINKER.KT.getIndex()]) {
  1231. if (inValue.length() > 0 ) inValue += "_";
  1232. inValue += HDC_LINKER.KT.getContents();
  1233. }
  1234. if (gubunList[HDC_LINKER.LGUPLUS.getIndex()]) {
  1235. if (inValue.length() > 0 ) inValue += "_";
  1236. inValue += HDC_LINKER.LGUPLUS.getContents();
  1237. }
  1238. if (gubunList[HDC_LINKER.LGE.getIndex()]) {
  1239. if (inValue.length() > 0 ) inValue += "_";
  1240. inValue += HDC_LINKER.LGE.getContents();
  1241. }
  1242. if (gubunList[HDC_LINKER.SAMSUNG.getIndex()]) {
  1243. if (inValue.length() > 0 ) inValue += "_";
  1244. inValue += HDC_LINKER.SAMSUNG.getContents();
  1245. }
  1246. if (gubunList[HDC_LINKER.AMAZON.getIndex()]) {
  1247. if (inValue.length() > 0 ) inValue += "_";
  1248. inValue += HDC_LINKER.AMAZON.getContents();
  1249. }
  1250. if (gubunList[HDC_LINKER.APPLE.getIndex()]) {
  1251. if (inValue.length() > 0 ) inValue += "_";
  1252. inValue += HDC_LINKER.APPLE.getContents();
  1253. }
  1254. if (gubunList[HDC_LINKER.DAEWOO.getIndex()]) {
  1255. if (inValue.length() > 0 ) inValue += "_";
  1256. inValue += HDC_LINKER.DAEWOO.getContents();
  1257. }
  1258. if (gubunList[HDC_LINKER.HYOSUNG.getIndex()]) {
  1259. if (inValue.length() > 0 ) inValue += "_";
  1260. inValue += HDC_LINKER.HYOSUNG.getContents();
  1261. }
  1262. retValue = " <req_company>"+ inValue + "</req_company>\r\n";
  1263. return retValue;
  1264. }
  1265. public static boolean [] getGubunSubScription(Context context) {
  1266. // 1. get DB
  1267. WallpadDeviceSet devset = new WallpadDeviceSet(context);
  1268. boolean[] retValue = { false, false, false, false, false, false, false, false, false } ;
  1269. int intValue = devset.GetDeviceSetted("월패드구독");
  1270. if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE ) {
  1271. // 기존 현장에서 구독된 상태
  1272. // SKT와 유플러스 현장 고려해야 함
  1273. if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL) retValue[HDC_LINKER.SKT.getIndex()] = true;
  1274. else retValue[HDC_LINKER.LGUPLUS.getIndex()] = true;
  1275. }
  1276. else {
  1277. // 월패드구독 디비값을 사용하지 않으면 처음 사용하는 현장
  1278. intValue = devset.GetDeviceSetted("구독_SKT");
  1279. if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.SKT.getIndex()] = true;
  1280. intValue = devset.GetDeviceSetted("구독_KT");
  1281. if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.KT.getIndex()] = true;
  1282. intValue = devset.GetDeviceSetted("구독_유플러스");
  1283. if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.LGUPLUS.getIndex()] = true;
  1284. intValue = devset.GetDeviceSetted("구독_카카오");
  1285. if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE ) retValue[HDC_LINKER.KAKAO.getIndex()] = true;
  1286. intValue = devset.GetDeviceSetted("구독_네이버");
  1287. if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.NAVER.getIndex()] = true;
  1288. intValue = devset.GetDeviceSetted("구독_LG전자");
  1289. if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.LGE.getIndex()] = true;
  1290. intValue = devset.GetDeviceSetted("구독_삼성전자");
  1291. if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.SAMSUNG.getIndex()] = true;
  1292. intValue = devset.GetDeviceSetted("구독_구글");
  1293. if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.GOOGLE.getIndex()] = true;
  1294. intValue = devset.GetDeviceSetted("구독_알렉사");
  1295. if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.AMAZON.getIndex()] = true;
  1296. intValue = devset.GetDeviceSetted("구독_애플");
  1297. if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.APPLE.getIndex()] = true;
  1298. intValue = devset.GetDeviceSetted("구독_대우");
  1299. if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.DAEWOO.getIndex()] = true;
  1300. intValue = devset.GetDeviceSetted("구독_효성");
  1301. if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.HYOSUNG.getIndex()] = true;
  1302. }
  1303. devset.closeDB();
  1304. return retValue;
  1305. }
  1306. public static void CarInOoutEventBR(Context context, String InOut, String CarNum) {
  1307. try {
  1308. final String BR_ACTION_BASE = "kr.co.icontrols.mobileservice.BR_";
  1309. final int BASE = define.BR_COM_MOBILE_SERVICE;
  1310. final String BR_CAR_INOUT_EVENT = BR_ACTION_BASE + "CARINOUT_EVENT_HDC" + "(" + BASE + ")";
  1311. Intent iMobileServieIntent = new Intent();
  1312. iMobileServieIntent.setAction(BR_CAR_INOUT_EVENT);
  1313. iMobileServieIntent.putExtra("KIND", InOut);
  1314. iMobileServieIntent.putExtra("CarNum", CarNum);
  1315. context.sendBroadcast(iMobileServieIntent);
  1316. } catch (RuntimeException re) {
  1317. LogUtil.errorLogInfo("", TAG, re);
  1318. }
  1319. catch (Exception e) {
  1320. //e.printStackTrace();
  1321. LogUtil.errorLogInfo("", TAG, e);
  1322. }
  1323. }
  1324. public static void MobileDemolVentilBR( Context context, int kind, String msg) {
  1325. try {
  1326. Intent iMobileServieIntent = new Intent();
  1327. iMobileServieIntent.setAction(define.NOTIFY_ACNAME);
  1328. iMobileServieIntent.putExtra("KIND", kind);
  1329. iMobileServieIntent.putExtra("MSG", msg);
  1330. context.sendBroadcast(iMobileServieIntent);
  1331. } catch (RuntimeException re) {
  1332. LogUtil.errorLogInfo("", TAG, re);
  1333. }
  1334. catch (Exception e) {
  1335. //e.printStackTrace();
  1336. LogUtil.errorLogInfo("", TAG, e);
  1337. }
  1338. }
  1339. private static boolean bDeviceServiceLoaded = false;
  1340. public static void setDeviceServeiceLoadComplite() {
  1341. Log.i(TAG, "[setDeviceServeiceLoadComplite] ========== START ==========");
  1342. bDeviceServiceLoaded = true;
  1343. }
  1344. public static boolean getDeviceServeiceLoadComplite() {
  1345. Log.i(TAG, "[getDeviceServeiceLoadComplite] bDeviceServiceLoaded [" + bDeviceServiceLoaded + "]");
  1346. return bDeviceServiceLoaded;
  1347. }
  1348. /**
  1349. * 신형단지서버 대기모드 사용여부
  1350. *
  1351. * @return (int) - >0 : 신형단지서버 사용, <0 : 실패 또는 미사용
  1352. */
  1353. public static int getServerV2Use(Context context) {
  1354. // 1. get DB
  1355. WallpadDeviceSet devset = new WallpadDeviceSet(context);
  1356. int serverV2info = devset.GetDeviceSetted("신형단지서버");
  1357. devset.closeDB();
  1358. // 2. Check
  1359. if (serverV2info == WallpadDeviceSet.DEV_DATA_ENABLE) {
  1360. return 1;
  1361. }
  1362. else if(serverV2info == WallpadDeviceSet.DEV_DATA_DISABLE) {
  1363. return -1;
  1364. }
  1365. else if(serverV2info == WallpadDeviceSet.DEV_DATA_NONE) {
  1366. return -2;
  1367. }
  1368. else {
  1369. return -3;
  1370. }
  1371. }
  1372. /**
  1373. * GUI Type 설정 확인
  1374. */
  1375. public static GUI_TYPE eGUIType = GUI_TYPE.STANDARD;
  1376. public enum GUI_TYPE {
  1377. STANDARD,
  1378. METRO,
  1379. HYOSUNG,
  1380. HIMCHAN,
  1381. }
  1382. public static final class JSON {
  1383. final static int MENU_BASE = 1000;
  1384. public static final class MENU
  1385. {
  1386. public final static int LIGHT = MENU_BASE + 1;
  1387. public final static int CONCENT = MENU_BASE + 2;
  1388. public final static int HEATING = MENU_BASE + 3;
  1389. public final static int AIRCON = MENU_BASE + 4;
  1390. public final static int PURITY = MENU_BASE + 5;
  1391. public final static int GAS = MENU_BASE + 6;
  1392. public final static int COOKTOP = MENU_BASE + 7;
  1393. public final static int PASSWORD = MENU_BASE + 8;
  1394. public final static int MOBILE = MENU_BASE + 9;
  1395. public final static int DEVICE_INFO = MENU_BASE + 10;
  1396. }
  1397. public static final class REASON
  1398. {
  1399. public final static int Status = 0;
  1400. public final static int Control = 1;
  1401. public final static int PassWordChange = 2;
  1402. public final static int MobileRegister = 3;
  1403. public final static int MobileDelete = 4;
  1404. public final static int DeviceInfo = 5;
  1405. }
  1406. public static final class KIND
  1407. {
  1408. public final static int All = 0;
  1409. public final static int Individual = 1;
  1410. }
  1411. public static final class POSITION
  1412. {
  1413. public final static int All = 0;
  1414. }
  1415. }
  1416. }