1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648 |
- package kr.co.icontrols.wallpadmain.declare;
- import com.util.LogUtil;
- import java.util.List;
- import kr.co.icontrols.wallpadmain.util.MainDatabaseManager;
- import kr.co.icontrols.wallpadsupport.Version;
- import kr.co.icontrols.wallpadsupport.WpadScale;
- import com.artncore.WallPadDataMgr.WallpadDeviceSet;
- import com.artncore.WallPadDataMgr.WallpadSalesSampleData;
- import com.artncore.commons.define;
- import android.content.Context;
- import android.content.Intent;
- import android.content.pm.PackageInfo;
- import android.util.Log;
- public final class Common {
- static String TAG = "Common";
- public final static boolean DIAGNOSTIC_MODE = false; // 양산테스트 프로그램 모드
- public final static boolean DEBUG_LOG_ON = true;
- public static boolean bWallPadCallLive = false;
- public static int CurrentBoardType = BOARD_TYPE.V40_IGW300_NOUGAT;
- /**
- * 분전반 관련 변수
- * Version.DISTRIBUTION_MODEL.NON_USE = 0
- * Version.DISTRIBUTION_MODEL.SMART_DIST = 1
- * Version.DISTRIBUTION_MODEL.KNX_DIST = 2
- * Version.DISTRIBUTION_MODEL.OTHER = -1
- */
- public static int CurrentDistributionPanelType = Version.DISTRIBUTION_MODEL.NON_USE;
- public class BOARD_TYPE {
- public static final int TCC8935_IGW200 = 1;
- public static final int TCC8935 = 2;
- public static final int V40_IGW300 = 3;
- public static final int V40 = 4;
- public static final int A20_CMOS = 5;
- public static final int A20_CCD = 6;
- public static final int V40_IGW300_NOUGAT = 7;
- public static final int V40_NOUGAT = 8;
- }
- public static class IGW200CMD {
- public static final int FRONT_PWR_ON = 1001; // 현관카메라 전원 ON
- public static final int FRONT_PWR_OFF = 1002; // 현관카메라 전원 OFF
- public static final int FRONT_BELL_ON = 1003; // 현관카메라 벨
- public static final int FRONT_BELL_OFF = 1004; // 현관카메라 벨
- public static final int FRONT_MUTE_ON = 1005; // 현관카메라 MIC mute ON
- public static final int FRONT_MUTE_OFF = 1006; // 현관카메라 MIC mute OFF
- public static final int VIDEO_FRONT = 2001; // 현관영상 선택
- public static final int VIDEO_MOIP = 2002; // MOIP영상 선택
- public static final int AUDIO_OFF = 3001; // 음성 선택 안함
- public static final int AUDIO_PSTN = 3002; // 국선 음성 선택
- public static final int AUDIO_FRONT_WALLPAD = 3003; // 월패드 현관 음성 선택
- public static final int AUDIO_FRONT_SUBPHONE = 3004; // 서브폰 현관 음성 선택
- public static final int AUDIO_MOIP_SUBPHONE = 3005; // MoIP 서브폰 음성 선택
- }
- public static class IGW300CMD {
- public static final int FRONT_PWR_ON = 4001;
- public static final int FRONT_PWR_OFF = 4002;
- public static final int FRONT_BELL_ON = 4003;
- public static final int FRONT_BELL_OFF = 4004;
- public static final int VIDEO_FRONT = 5001;
- public static final int VIDEO_MOIP = 5002;
- public static final int AUDIO_OFF = 6001;
- public static final int AUDIO_PSTN_WALLPAD = 6002;
- public static final int AUDIO_PSTN_SUBPHONE = 6003;
- public static final int AUDIO_FRONT_WALLPAD = 6004;
- public static final int AUDIO_FRONT_SUBPHONE = 6005;
- public static final int AUDIO_MOIP_SUBPHONE = 6006;
- }
- public final static String SKIN_01 = "SKIN_01";
- public final static String SKIN_02 = "SKIN_02";
- public final static String SKIN_03 = "SKIN_03";
- public final static String SKIN_04 = "SKIN_04";
- // call apk 전달 인자값
- public final static int FRAG_DOOR = 10;
- public final static int FRAG_LOBBY = 20;
- public final static int FRAG_GUARD = 30;
- public final static int FRAG_NEI = 40;
- public final static int FRAG_CALL = 50;
- public final static int FRAG_HISTORY = 60;
- public final static int FRAG_VISITOR = 70;
- // Auto FINISH
- public final static boolean FINISH_TIME_ENABLE = true; // 자동 종료 사용유무
- public final static int FINISH_TIME_SEC = 30; // 메인화면 자동 종료 시간 (초)
- public final static int FINISH_TIME_POPUP_NORMAL_SEC = 30; // 팝업 일반 자동 종료 시간 (초)
- public final static int FINISH_TIME_POPUP_ALARM_SEC = 10; // 팝업 알람 자동 종료 시간 (초)
- public final static int FINISH_TIME_POPUP_ELEVATOR = 30;
- public final static int FINISH_TIME_INFO_SEC = 30; // 매뉴얼 화면 자동 종료 시간 (초)
- // Option
- public final static boolean OPTION_TAB_ANMI_ENABLE = true; // 메인스크린 텝화면 전환 에니메이션 적용여부
- // Operation mode
- public final static int MODE_NOMAL = 0; // 노말
- public final static int MODE_BUSINESS_SAMPLE = 1; // 영업샘플
- public final static int MODE = MODE_NOMAL;
- // Button Delay
- public final static int BTN_DELAY_DEVCTRL = 300; // 디바이스 컨트롤을 하는 버튼의 경우 설정되는 딜레이시간
- public final static int BTN_DELAY_SHOWPOPUP = 500; // 팝업 활성화 버튼 딜레이
- public final static int LIVING_LAMP_COUNT = 5; // 추후에 DB에서 읽어서 처리하도록 한다.
- // Popup Type
- public final static int POPUP_STYLE_NOMAL = 0;
- public final static int POPUP_STYLE_INPUT = 1;
- public final static int POPUP_STYLE_INSERT_WIDGET = 2;
- public final static int POPUP_STYLE_EVENTNOTIFICATION = 3;
- public final static int POPUP_STYLE_LIGHTPRESET = 4;
- public final static int POPUP_STYLE_FUNCGROUP = 5;
- public final static int FULL_SCREEN = 6;
- // Screen Type
- public final static int SCREEN_TYPE_800x480 = 0;
- public final static int SCREEN_TYPE_1024x600 = 1;
- public final static int SCREEN_TYPE_1280x800 = 2;
- public final static int SCREEN_TYPE_1366x768 = 3;
- public static int SCREEN_TYPE = SCREEN_TYPE_1024x600; //0:800x600, 1:1024x600, 2:1280:800
- // Manual Screen Type
- public final static int INFO_STYLE_NORMAL = 0; // 30초 뒤 자동 종료 되는 Type
- // Manual Screen Size
- public final static int SCREEN_SIZE_INFO_W_1024 = 1024; // 1024x600 매뉴얼 화면 해상도 (가로)
- public final static int SCREEN_SIZE_INFO_H_1024 = 600; // 1024x600 매뉴얼 화면 해상도 (세로)
- public final static int SCREEN_SIZE_INFO_W_1280 = 1280; // 1280:800 매뉴얼 화면 해상도 (가로)
- public final static int SCREEN_SIZE_INFO_H_1280 = 800; // 1280:800 매뉴얼 화면 해상도 (세로)
- public final static int SCREEN_SIZE_POPUP_NOMAL_W = 790; // 팝업 해상도 (가로)
- public final static int SCREEN_SIZE_POPUP_NOMAL_H = 434; // 팝업 해상도 (세로)
- public final static int SCREEN_SIZE_POPUP_NOMAL_W_1280 = 990; // 팝업 해상도 (가로)
- public final static int SCREEN_SIZE_POPUP_NOMAL_H_1280 = 576; // 팝업 해상도 (세로)
- public final static int SCREEN_SIZE_POPUP_INPUT_W = 790; // 팝업 해상도 (가로)
- public final static int SCREEN_SIZE_POPUP_INPUT_H = 510; // 팝업 해상도 (세로)
- public final static int SCREEN_SIZE_POPUP_INPUT_W_1280 = 990; // 팝업 해상도 (가로)
- public final static int SCREEN_SIZE_POPUP_INPUT_H_1280 = 680; // 팝업 해상도 (세로)
- public final static int SCREEN_SIZE_POPUP_INSERT_WIDGET_W = 728;
- public final static int SCREEN_SIZE_POPUP_INSERT_WIDGET_H = 402 + 84;
- public final static int SCREEN_SIZE_POPUP_EVENTNOTI_W = 790; // 팝업 해상도 (가로)
- public final static int SCREEN_SIZE_POPUP_EVENTNOTI_H = 460; // 팝업 해상도 (세로)
- public final static int SCREEN_SIZE_POPUP_EVENTNOTI_W_1280 = 990; // 팝업 해상도 (가로)
- public final static int SCREEN_SIZE_POPUP_EVENTNOTI_H_1280 = 576; // 팝업 해상도 (세로)
- public final static int SCREEN_SIZE_POPUP_LIGHTPRESET_W = 790; // 팝업 해상도 (가로)
- public final static int SCREEN_SIZE_POPUP_LIGHTPRESET_H = 540; // 팝업 해상도 (세로)
- public final static int SCREEN_SIZE_POPUP_FUNCGROUP_W = 790; // 팝업 해상도 (가로)
- public final static int SCREEN_SIZE_POPUP_FUNCGROUP_H = 546; // 팝업 해상도 (세로)
- public final static int SCREEN_SIZE_POPUP_FUNCGROUP_W_1280 = 990; // 팝업 해상도 (가로)
- public final static int SCREEN_SIZE_POPUP_FUNCGROUP_H_1280 = 680; // 팝업 해상도 (세로)
- public final static int CTRL_MARGIN_LEFT = 210; // Ctrl Layout 의 좌측 마진
- public final static int CTRL_MARGIN_TOP = 75; // Ctrl Layout 의 상측 마진
- public static final String MAIN_EVENT_TIMER = "MAIN_EVENT_TIMER";
- // public static final String MAIN_EVENT_TIMER_02 = "MAIN_EVENT_TIMER_02";
- public static final String CALL_ACTIVITY_HOME_CTRL = "CALL_ACTIVITY_HOME_CTRL";
- public static final String MAIN_DRAW_TIMER = "MAIN_DRAW_TIMER";
- public static final String MAIN_SCREEN_NOW_UPDATE = "MAIN_SCREEN_NOW_UPDATE";
- public static final String DEVICE_SERVICE_WAIT_TIMEOUT = "DEVICE_SERVICE_WAIT_TIMEOUT";
- public static final String WIDGET_POPUP_BR = "WIDGET_POPUP_BR";
- public static final String WIDGET_SELECTED_ID = "WIDGET_SELECTED_ID";
- public static final String MENU_ID_LIST = "MENU_ID_LIST";
- public static final String MENU_START_ID = "MENU_START_ID";
- public static final String MENU_START_OPTION = "MENU_START_OPTION";
- public static final String MENU_DETAIL_INFO = "MENU_DETAIL_INFO";
- public static final String LIVINGLIGHT_PRESET_ID = "LIVINGLIGHT_PRESET_ID";
- public static final String MAIN_ACTIVITY = ".MainActivity";
- public static final String APP_PACKAGE_ROOT = "kr.co.icontrols.";
- public static final String SECURITY_APK = APP_PACKAGE_ROOT + "wallpadsecurity";
- public static final String HOMECTRL_APK = APP_PACKAGE_ROOT + "wallpadhomectrl";
- public static final String ENERGY_APK = APP_PACKAGE_ROOT + "wallpadenergyctrl";
- public static final String ADDSERVICE_APK = APP_PACKAGE_ROOT + "wallpadaddservice";
- public static final String CONFIG_APK = APP_PACKAGE_ROOT + "wallpadconfig";
- public static final String EMER_ALARM_APK = APP_PACKAGE_ROOT + "wallpademergency";
- //madeinLab++ ocf 관련
- public static final String OCF_APK = APP_PACKAGE_ROOT + "wallpadocf";
- public static final String DONG_HO_SPLIT_TOKEN = "_";
- public static final boolean ENABLED_SUB_DEVICE_DEFAULT_VALUE = true; //true;
- public static final String CONTROLLER_SETTING_DO_USED = "사용함";
- public static final String CONTROLLER_SETTING_DO_NOT_USED = "사용안함";
- public static final String PSTN_CALL_TYPE = "국선";
- public static final int SETTING_ITEM_TYPE_BASE = 101;
- public static final int SETTING_ITEM_SUB_DEVICE_LIST = SETTING_ITEM_TYPE_BASE + 9;
- public static final int SETTING_ITEM_SUB_DEVICE_ELEVATOR = SETTING_ITEM_TYPE_BASE + 125;
- public static final String CALL_SUBMAIN_SCREEN = "CALL_SUBMAIN_SCREEN";
- public static final String BR_SENDER_SCREEN = "BR_SENDER_SCREEN";
- public static final String BR_RECEIVE_SCREEN = "BR_RECEIVE_SCREEN";
- public static final String BR_WIDGET_DELETE = "BR_WIDGET_DELETE";
- public static final String BR_DELETE_WIDGET_ID = "BR_DELETE_WIDGET_ID";
- public static final String BR_WIDGET_INSERT = "BR_WIDGET_INSERT";
- public static final String BR_INSERT_WIDGET_ID = "BR_INSERT_WIDGET_ID";
- public static final String BR_RUN_WIDGET = "BR_RUN_WIDGET";
- public static final String BR_RUN_WIDGET_ID = "BR_RUN_WIDGET_ID";
- public static final String BR_LIVINGLIGHT_PRESET_INFO = "BR_LIVINGLIGHT_PRESET_INFO";
- public static final String BR_BLACKOUT_SCREEN_RUN = "BR_BLACKOUT_SCREEN_RUN";
- public static final String BR_BLOCK_SIP_NEWCALL = "BR_BLOCK_SIP_NEWCALL";
- public static final int DEVICE_BOOTUP_RETRY = 40001;
- // 공통으로 쓰는거라 WallAPI.Jar 파일 쪽으로 옮기자
- public static final String BR_NOTIFY_ACNAME = "NOTIFY_ACNAME"; // ANC BR
- public static final String BR_IGW200FILTER = "kr.co.icontrols.wallpad.BR_IGW200FILTER";
- public static final String BR_PSTN_RING_FINISH = "kr.co.icontrols.wallpad.BR_PSTN_RING_FINISH";
- public static final String BR_EMER_LED_CONTROL = "kr.co.icontrols.wallpad.BR_EMER_LED_CONTROL"; // 비상발생 비상버튼 LED 점멸 Intent 등록
- public static final String BR_DOOR_CALL_RECEIVED = "kr.co.icontrols.wallpad.BR_DOOR_CALL_RECEIVED";
- public static final String BR_PSTN_CALL_RECEIVED = "kr.co.icontrols.wallpad.BR_PSTN_CALL_RECEIVED";
- public static final String BR_CALLED_CID = "kr.co.icontrols.wallpad.BR_CALLED_CID";
- public static final String BR_CALLED_CID_ACK = "kr.co.icontrols.wallpad.BR_CALLED_CID_ACK";
- public static final String BR_REQUEST_APK_RUN = "kr.co.icontrols.wallpad.BR_REQUEST_APK_RUN";
- public static final String BR_LIVINGLIGHT = "kr.co.icontrols.wallpadhomectrl.BR_LIGHT(3000)";
- public static final String BR_KNXLIGHT = "kr.co.icontrols.wallpadmain.BR_KNXLIGHT";
- public static final String VISITOR_REMOTE_CALL = "kr.co.icontrols.wallpad.BR_REMOTE_CALL";
- public static final String BR_CAR_EVENT_GUEST = "kr.co.icontrols.wallpad.BR_CAR_EVENT_GUEST";
- public static final String BR_PLAY_SOUND = "kr.co.icontrols.wallpad.BR_PLAY_SOUND";
- /**
- * Jeff, 2019.12.25
- * WallPadMain에서 WallPadCall의 Live 상태를 파악하기 위한 BR
- * WallPadMain에서 BR_REQUEST_WALLPADCALL_LIVE을 보내면 WallPadCall은 BR_ACK_WALLPADCALL_LIVE로 응답한다.
- */
- public static final String BR_REQUEST_WALLPADCALL_LIVE = "kr.co.icontrols.wallpad.BR_REQUEST_WALLPADCALL_LIVE";
- public static final String BR_ACK_WALLPADCALL_LIVE = "kr.co.icontrols.wallpad.BR_ACK_WALLPADCALL_LIVE";
- public static final String PID_WALLPADCALL = "PID_WALLPADCALL";
- // 거실에너지미터 연동
- public static byte LIVINGEM_CTRL_NORMAL = (byte) 0x00;
- public static byte LIVINGEM_CTRL_DIM = (byte) 0x01;
- public static byte LIVINGEM_CTRL_COLOR = (byte) 0x02;
- public static byte LIVINGEM_LIGHTSTATUS_ON = (byte) 0x01;
- public static byte LIVINGEM_CTRL_TYPE_JOGDIAL = (byte) 0x00;
- public static byte LIVINGEM_CTRL_TYEP_BLE = (byte) 0x01;
- public static final class GLOBALSCREEN_ID {
- public static final int CTRL_LIGHT_LIVINGROOM = 11000;
- public static final int BLACKOUT_EMERGENCY_LIGHT = 12000;
- }
- // 스마트현관카메라 LED 제어 관련 클래스
- public static class SmartRFCamLEDMode {
- public final static byte LED_OFF = (byte) 0x00;
- public final static byte LED_ON = (byte) 0x01;
- public final static byte LED_FLASH1 = (byte) 0x02;
- public final static byte LED_FLASH2 = (byte) 0x03;
- public final static byte LED_FLASH3 = (byte) 0x04;
- public final static byte LED_AUTO_ON = (byte) 0x05;
- public final static byte LED_AUTO_OFF = (byte) 0x06;
- }
- // 스마트현관카메라 상태 제어 관련 클래스
- public static class SmartRFCamStatusMode {
- public final static byte STATUS_OFF = (byte) 0x00;
- public final static byte STATUS_ON = (byte) 0x01;
- public final static byte STATUS_AUTO_ON = (byte) 0x02;
- public final static byte STATUS_AUTO_OFF = (byte) 0x03;
- }
- public static final class BR_MAIN_NOTI {
- public static final String ACNAME_MAIN_NOTI = "kr.co.icontrols.wallpad.BR_MAIN_NOTI";
- public static final String KIND = "KIND";
- // Kind
- public static final int ARRIVED_CAR = 1001;
- public static final int DOOR_SOUND_OUTMODE = 1002;
- public static final int DOOR_SOUND_DEVICECHECK = 1003;
- public static final int CALL_ELEVATOR_DOWN = 1004;
- public static final int CALL_ELEVATOR_UP = 1005;
- public static final int OUTMODE_CTRL_WORKING = 1006;
- public static final int COMBACK_CTRL_WORKING = 1007;
- public static final int APK_EXIT_MAIN_CHECK = 1008;
- public static final int GO_BAD_CTRL_WORKING = 1009;
- public static final int OUT_BAD_CTRL_WORKING = 1010;
- public static final int UI_UPDATE_PARCEL = 1011;
- public static final int REQ_ELEVATOR_CALL_STATE = 1012;
- public static final int RET_ELEVATOR_CALL_STATE = 1013;
- public static final int SOUND_COMBACK_MODE = 1014;
- public static final int LIVE_CHECK_BR = 1015;
- public static final int SMARTKEY_ALARM_BR = 1016;
- public static final int KMS_KEY_SEND_BR = 1017;
- public static final int NOTI_CALLAPP_FINISHING = 1018;
- public static final int REQ_UPLOAD_MISSEDVISITORPIC = 1019;
- public static final int UI_BANDLOCATION_ALARM = 1020;
- public static final int UI_UPDATE_POST = 1021;
- public static final int NOTICE_DETECT_STRANGER = 1022;
- public static final int ACCEPT_RECORDING = 1023;
- public static final int ACCEPT_TAKEPIC = 1024;
- public static final int NOTICE_PSTN_RING_END = 1025;
- public static final int NOTICE_DOORCAM_BTN = 1026;
- public static final int NOTICE_FRONT_MONITOR_BTN = 1027;
- public static final int SOUND_OUTMODE = 1028;
- public static final int SOUND_INMODE = 1029;
- public static final int ONOFF_CAMERA_BTN = 1030;
- public static final String CARD_NUM = "CARD_NUM";
- }
- // public static final class BR_ELEVATOR_NOTI
- // {
- // public static final String ACNAME_NAME = "kr.co.icontrols.wallpad.BR_ELEVATOR_NOTI";
- // public static final String KIND = "KIND";
- // public static final int RET_ELEVATOR_CALL_STATE = 1013;
- // }
- public static final class BR_MAIN_LIVE_CHECKER {
- public static final String ACNAME_MAIN_LIVE_CHECKER = "kr.co.icontrols.wallpad.ACNAME_MAIN_LIVE_CHECKER";
- public static final String KIND = "KIND";
- // Kind
- public static final int IMAP_SERVER = 1001;
- public static final int MAIN_ACTIVITY = 1002;
- public static final int SIP_ACTIVITY = 1003;
- }
- public static final int IGW200_DOOR_MONITERING = 1000;
- public static final int IGW200_DOOR_CONNECT = 1001;
- public static final int IGW200_DOOR_SUBPHONE_CONNECT = 1002;
- public static final int IGW200_DOOR_CLOSE = 1003;
- public static final int IGW200_PSTN_CONNECT = 1004;
- public static final int IGW200_PSTN_CLOSE = 1005;
- public static final int IGW200_MOIP_SUBPHONE_CONNECT = 1006;
- public static final int IGW200_MOIP_CLOSE = 1007;
- public static final int IGW200_VIDEO_FRONT = 1020;
- public static final int IGW200_VIDEO_LOBBY = 1021;
- public static final int IGW200_EMER_ACK = 1030;
- public static final int IGW200_SENSOR_CHECK = 1031;
- public static final int MULTICALL_DOOR_ACCEPT = 1200;
- public static final int MULTICALL_PSTN_ACCEPT = 1201;
- public static final int MULTICALL_HOLD_DOOR_ACCEPT = 1202;
- //동호설정 관련
- public static final String DNS_IP = "10.0.1.1";
- public static final String SUBNET_MASK = "255.255.0.0";
- public static final String DEFAULT_SERVER_IP = "10.0.1.1";
- public static final int DEFAULT_SERVER_PORT = 10000;
- public static final String DEFAULT_MANAGER_PC_IP = "10.0.1.10";
- public static final int DEFAULT_MANAGER_PC_PORT = DEFAULT_SERVER_PORT;
- public static final String CONTENTS_ROOT = "/storage/emulated/0/wallpaddata/";
- public static final int DEFAULT_GATEWAY_IP_THIRD = 0;
- public static final int DEFAULT_GATEWAY_IP_FORTH = 254;
- public static final int DEFAULT_LOBBY_IP_THIRD = 0;
- public static final int DEFAULT_LOBBY_IP_FORTH = 10;
- public static final int DEFAULT_GUARD_IP_SECOND = 0;
- public static final int DEFAULT_GUARD_IP_THIRD = 128;
- public static final int DEFAULT_GUARD_IP_FORTH = 10;
- /**
- * IHN-D101-I(C) 월패드 카메라 설정을 위한 상수
- */
- public static final int WALLPAD_CAM_AHD_FRONT = 0;
- public static final int WALLPAD_CAM_NORMAL_FRONT = 1;
- public static final int WALLPAD_CAM_AHD_FRONT_FLIP = 2; // 펌웨어 개선 버전의 스마트IOT현관카메라
- public static final String DOOR_CAMERA_TYPE_DEFAULT = "기본";
- public static final String DOOR_CAMERA_TYPE_RF_DOOR_CAMERA = "RF현관카메라";
- public static final String DOOR_CAMERA_TYPE_SMART_KEY = "스마트키";
- public static final String DOOR_CAMERA_TYPE_IOT_SMART = "스마트IOT현관카메라";
- public static final String DOOR_CAMERA_TYPE_HYOSUNG_SMART = "스마트현관카메라-효성";
- public static final String DOOR_CAMERA_TYPE_DAEWOO_SMART = "스마트현관카메라-대우";
- //에너지 사용량 알림 서비스 관련
- public static final String ENERGY_INTENT_ENERGY_COUNT = "Energy_Count"; //3종인지 5종인지
- public static final String ENERGY_INTENT_GETDATA_TIME_YEAR = "GetData_Time_year"; //검침 시간 년도
- public static final String ENERGY_INTENT_GETDATA_TIME_MONTH = "GetData_Time_month"; //검침 시간 월
- public static final String ENERGY_INTENT_GETDATA_TIME_DAY = "GetData_Time_day"; //검침 시간 일
- public static final String ENERGY_INTENT_GETDATA_TIME_HOUR = "GetData_Time_hour"; //검침 시간 시간
- public static final String ENERGY_INTENT_GETDATA_TIME_MINUTE = "GetData_Time_minute"; //검침 시간 분
- public static final String ENERGY_INTENT_USE_ELECTRIC = "Use_Electric"; //전기 사용량
- public static final String ENERGY_INTENT_GOAL_ELECTRIC = "Goal_Electric"; //전기 목표량
- public static final String ENERGY_INTENT_SAME_SPACE_ELECTRIC = "Same_Space_Electric";
- public static final String ENERGY_INTENT_USE_WATER = "Use_Water"; //수도 사용량
- public static final String ENERGY_INTENT_GOAL_WATER = "Goal_Water"; //수도 목표량
- public static final String ENERGY_INTENT_SAME_SPACE_WATER = "Same_Space_Water";
- public static final String ENERGY_INTENT_USE_GAS = "Use_Gas"; //가스 사용량
- public static final String ENERGY_INTENT_GOAL_GAS = "Goal_Gas"; //가스 목표량
- public static final String ENERGY_INTENT_SAME_SPACE_GAS = "Same_Space_Gas";
- public static final String ENERGY_INTENT_USE_HOTWATER = "Use_Hotwater"; //온수 사용량
- public static final String ENERGY_INTENT_GOAL_HOTWATER = "Goal_Hotwater"; //온수 목표량
- public static final String ENERGY_INTENT_SAME_SPACE_HOTWATER = "Same_Space_Hotwater";
- public static final String ENERGY_INTENT_USE_HEATING = "Use_Heating"; //난방 사용량
- public static final String ENERGY_INTENT_GOAL_HEATING = "Goal_Heating"; //난방 목표량
- public static final String ENERGY_INTENT_SAME_SPACE_HEATING = "Same_Space_Heating";
- public static final String ENERGY_INTENT_USE_CARBON = "Use_Carbon"; //탄소 사용량
- public static final String ENERGY_INTENT_GOAL_CARBON = "Goal_Carbon"; //탄소 목표량
- public static final int PARKING_SYSTEM_BASIC = 0;
- public static final int PARKING_SYSTEM_ICONTROLS = 1;
- public static final int PARKING_SYSTEM_NEXPA = 2;
- public static final int PARKING_SYSTEM_UPIS = 3;
- public static final int PARKING_SYSTEM_ETC = 4;
- public static final int PARKING_SYSTEM_IES_100 = 5; //비상벨 단말기
- public static final int PARKING_SYSTEM_DARAM = 6; //다람정보
- public static final String AppName_WallPadMain = "kr.co.icontrols.icwallpadmain";
- public static final String AppName_WallPadConfig = "kr.co.icontrols.wallpadconfig";
- public static final String AppName_WallPadAddservice = "kr.co.icontrols.wallpadaddservice";
- public static final String AppName_WallPadEmergency = "kr.co.icontrols.wallpademergency";
- public static final String AppName_WallPadEnergyCtrl = "kr.co.icontrols.wallpadenergyctrl";
- public static final String AppName_WallPadHomeCtrl = "kr.co.icontrols.wallpadhomectrl";
- public static final String AppName_WallPadAutopicture = "kr.co.icontrols.autopicture";
- public static final String AppName_WallPadSecurity = "kr.co.icontrols.wallpadsecurity";
- public static final String AppName_WallPadOutModerun = "kr.co.icontrols.wallpadoutmoderun";
- public static final String AppName_WallPadCall = "com.artncore.apps.ic_wallpad";
- public static final String AppName_WallPadAlert = "com.artncore.wallpadalert";
- public static final String AppName_WallPadDeviceService = "com.artncore.deviceservice";
- public static final String AppName_WallPadManagerSetting = "com.artncore.managersetting";
- public static final String AppName_WallPadUpdater = "com.artncore.updater";
- public static final String AppName_WallPadAppUpdater = "com.artncore.appupdater";
- public static final String AppName_WallPadLogOutput = "com.artncore.apps.ic_wallpad.service.log";
- public static int getInfoScreenSize_W_1024(int Style) {
- if (Style == INFO_STYLE_NORMAL) return SCREEN_SIZE_INFO_W_1024;
- else Log.e("Common", "getInfoScreenSize_W_1024 - Out of range !!! (" + Style +")");
- return 0;
- }
- public static int getInfoScreenSize_H_1024(int Style) {
- if (Style == INFO_STYLE_NORMAL) return SCREEN_SIZE_INFO_H_1024;
- else Log.e("Common", "getInfoScreenSize_H_1024 - Out of range !!! (" + Style +")");
- return 0;
- }
- public static int getInfoScreenSize_W_1280(int Style) {
- if (Style == INFO_STYLE_NORMAL) return SCREEN_SIZE_INFO_W_1280;
- else Log.e("Common", "getInfoScreenSize_W_1280 - Out of range !!! (" + Style +")");
- return 0;
- }
- public static int getInfoScreenSize_H_1280(int Style) {
- if (Style == INFO_STYLE_NORMAL) return SCREEN_SIZE_INFO_H_1280;
- else Log.e("Common", "getInfoScreenSize_H_1280 - Out of range !!! (" + Style +")");
- return 0;
- }
- public static int getPopupScreenSize_W(int Style) {
- Log.d(TAG, "*********** getPopupScreenSize_W : " + Common.SCREEN_TYPE );
- if (Common.SCREEN_TYPE == Common.SCREEN_TYPE_1280x800) {
- if (Style == POPUP_STYLE_NOMAL) return SCREEN_SIZE_POPUP_NOMAL_W_1280;
- else if (Style == POPUP_STYLE_INPUT) return SCREEN_SIZE_POPUP_INPUT_W_1280;
- else if (Style == POPUP_STYLE_INSERT_WIDGET) return 916;
- else if (Style == POPUP_STYLE_EVENTNOTIFICATION) return SCREEN_SIZE_POPUP_EVENTNOTI_W_1280;
- else if (Style == POPUP_STYLE_FUNCGROUP ) return SCREEN_SIZE_POPUP_FUNCGROUP_W_1280;
- else if (Style == FULL_SCREEN ) return 1280;
- else Log.e(TAG, "getPopupScreenSize_W - Out of range !!! (" + Style +")");
- }
- else {
- if (Style == POPUP_STYLE_NOMAL) return SCREEN_SIZE_POPUP_NOMAL_W;
- else if(Style == POPUP_STYLE_INPUT) return SCREEN_SIZE_POPUP_INPUT_W;
- else if(Style == POPUP_STYLE_INSERT_WIDGET) return SCREEN_SIZE_POPUP_INSERT_WIDGET_W;
- else if(Style == POPUP_STYLE_EVENTNOTIFICATION) return SCREEN_SIZE_POPUP_EVENTNOTI_W;
- else if(Style == POPUP_STYLE_LIGHTPRESET) return SCREEN_SIZE_POPUP_LIGHTPRESET_W;
- else if(Style == POPUP_STYLE_FUNCGROUP) return SCREEN_SIZE_POPUP_FUNCGROUP_W;
- else if(Style == FULL_SCREEN ) return WpadScale.DEFAULT_WIDTH_PIXELS;
- else Log.e(TAG, "getPopupScreenSize_W - Out of range !!! (" + Style +")");
- }
- return 0;
- }
- public static int getPopupScreenSize_H(int Style) {
- Log.d(TAG, "*********** getPopupScreenSize_H : " + Common.SCREEN_TYPE );
- if (Common.SCREEN_TYPE == Common.SCREEN_TYPE_1280x800) {
- if (Style == POPUP_STYLE_NOMAL) return SCREEN_SIZE_POPUP_NOMAL_H_1280;
- else if (Style == POPUP_STYLE_INPUT) return SCREEN_SIZE_POPUP_INPUT_H_1280;
- else if (Style == POPUP_STYLE_INSERT_WIDGET) return 492 + 88;
- else if (Style == POPUP_STYLE_EVENTNOTIFICATION) return SCREEN_SIZE_POPUP_EVENTNOTI_H_1280;
- else if (Style == POPUP_STYLE_FUNCGROUP ) return SCREEN_SIZE_POPUP_FUNCGROUP_H_1280;
- else if (Style == FULL_SCREEN ) return 800;
- else Log.e(TAG, "getPopupScreenSize_H - Out of range !!! (" + Style +")");
- }
- else {
- if (Style == POPUP_STYLE_NOMAL) return SCREEN_SIZE_POPUP_NOMAL_H;
- else if (Style == POPUP_STYLE_INPUT) return SCREEN_SIZE_POPUP_INPUT_H;
- else if (Style == POPUP_STYLE_INSERT_WIDGET) return SCREEN_SIZE_POPUP_INSERT_WIDGET_H;
- else if (Style == POPUP_STYLE_EVENTNOTIFICATION) return SCREEN_SIZE_POPUP_EVENTNOTI_H;
- else if(Style == POPUP_STYLE_LIGHTPRESET) return SCREEN_SIZE_POPUP_LIGHTPRESET_H;
- else if(Style == POPUP_STYLE_FUNCGROUP) return SCREEN_SIZE_POPUP_FUNCGROUP_H;
- else if (Style == FULL_SCREEN ) return WpadScale.DEFAULT_HEIGHT_PIXELS;
- else Log.e(TAG, "getPopupScreenSize_H - Out of range !!! (" + Style +")");
- }
- return 0;
- }
- public static int CtrlMarginLEFT(int left)
- {
- int retLeft = left - CTRL_MARGIN_LEFT;
- if(retLeft < 0)
- {
- Log.e("Common", "CtrlMarginLEFT - Out of range !!! (" + left +")");
- return 0;
- }
- return retLeft;
- }
- public static int CtrlMarginTOP(int top)
- {
- int retTop = top - CTRL_MARGIN_TOP;
- if(retTop < 0)
- {
- Log.e("Common", "CtrlMarginTOP - Out of range !!! (" + top +")");
- return 0;
- }
- return retTop;
- }
- public static int PopupNomalMarginLEFT(int left) {
- int mainleft = 216;
- int retLeft = left - mainleft;
- if(retLeft < 0)
- {
- Log.e("Common", "PopupNomalMarginLEFT - Out of range !!! (" + left +")");
- return 0;
- }
- return retLeft;
- }
- public static int PopupNomalMarginTOP(int top)
- {
- int maintop = 21;
- int retTop = top - maintop;
- if(retTop < 0)
- {
- Log.e("Common", "PopupNomalMarginTOP - Out of range !!! (" + top +")");
- return 0;
- }
- return retTop;
- }
- public static int PopupAlarmMarginLEFT(int left)
- {
- int mainleft = 216;
- int retLeft = left - mainleft;
- if(retLeft < 0)
- {
- Log.e("Common", "PopupAlarmMarginLEFT - Out of range !!! (" + left +")");
- return 0;
- }
- return retLeft;
- }
- public static int PopupAlarmMarginTOP(int top)
- {
- int maintop = 87;
- int retTop = top - maintop;
- if(retTop < 0)
- {
- Log.e("Common", "PopupAlarmMarginTOP - Out of range !!! (" + top +")");
- return 0;
- }
- return retTop;
- }
- public static int PopupInsertWidgetLEFT( int left)
- {
- int mainleft = 148;
- int retLeft = left - mainleft;
- if(retLeft < 0)
- {
- Log.e("Common", "PopupInsertWidgetLEFT - Out of range !!! (" + left +")");
- return 0;
- }
- return retLeft;
- }
- public static int PopupInsertWidgetTOP( int top)
- {
- int maintop = 57;
- int retTop = top - maintop;
- if(retTop < 0)
- {
- Log.e("Common", "PopupInsertWidgetLEFT - Out of range !!! (" + top +")");
- return 0;
- }
- return retTop;
- }
- public static void DebugLog(String s) { if(DEBUG_LOG_ON) Log.d("Common", s); }
- /**
- * 제어기기 영업샘플모드 활성화 상태를 가져온다.
- *
- * @return (boolean) true : 활성 , false : 비활성 or 에러
- */
- public static boolean GetDeviceSampleMode(Context context)
- {
- try
- {
- WallpadSalesSampleData wssd = new WallpadSalesSampleData(context);
- int mode = wssd.getSalesSampleData(WallpadSalesSampleData.SALES_SAMPLE_MODE_DEVICE_CONTROLLER);
- wssd.closeDB();
- Log.d("Common", "[GetSampleMode] mode = " + mode);
- if(mode == 1) return true;
- }
- catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- }
- catch (Exception e)
- {
- Log.e("Common", "[ExceptionError] - new GetDeviceSampleMode : " + e);
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- return false;
- }
- //SALES_SAMPLE_MODE_SLEEP
- /**
- * 센서 감지 영업 샘플 모드 사용할 것인지 말것인지.
- *
- * @return (boolean) true : 슬립모드 안들어감(모델하우스버전) , false : 슬립모드 들어감(정상버전)
- */
- public static boolean GetModelHouseSleepModeRelease(Context context)
- {
- try
- {
- WallpadSalesSampleData wssd = new WallpadSalesSampleData(context);
- int mode = wssd.getSalesSampleData(WallpadSalesSampleData.SALES_SAMPLE_MODE_SLEEP);
- wssd.closeDB();
- if(mode == 0) return true;
- }
- catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- }
- catch (Exception e)
- {
- Log.e("Common", "[ExceptionError] - new GetModelHouseSleepModeRelease : " + e);
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- return false;
- }
- /**
- * 센서 감지 영업 샘플 모드 사용할 것인지 말것인지.
- *
- * @return (boolean) true : 활성 , false : 비활성 or 에러
- */
- public static boolean GetSensorSampleMode(Context context)
- {
- try
- {
- WallpadSalesSampleData wssd = new WallpadSalesSampleData(context);
- int mode = wssd.getSalesSampleData(WallpadSalesSampleData.SALES_SAMPLE_MODE_SENSOR_DETECTING);
- wssd.closeDB();
- if(mode == 0) return true;
- }
- catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- }
- catch (Exception e)
- {
- Log.e("Common", "[ExceptionError] - new GetSensorSampleMode : " + e);
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- return false;
- }
- /**
- * 엘리베이터 영업샘플모드 활성화 상태를 가져온다.
- *
- * @return (boolean) true : 활성 , false : 비활성 or 에러
- */
- public static boolean GetElevatorSampleMode(Context context)
- {
- try
- {
- WallpadSalesSampleData wssd = new WallpadSalesSampleData(context);
- int mode = wssd.getSalesSampleData(WallpadSalesSampleData.SALES_SAMPLE_MODE_ELEVATOR);
- wssd.closeDB();
- Log.d("Common", "[GetSampleMode] mode = " + mode);
- if(mode == 1) return true;
- }
- catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- }
- catch (Exception e)
- {
- Log.e("Common", "[ExceptionError] - new GetElevatorSampleMode : " + e);
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- return false;
- }
- public static boolean getUse485_SmartSwitch( Context context )
- {
- try
- {
- if( Version.getModelType() != Version.MODEL_TYPE.IHN_1020GL )
- {
- WallpadDeviceSet devSet = new WallpadDeviceSet(context);
- int[] BatchInfo = devSet.Get_BatchSW_Info();
- devSet.closeDB();
- if (BatchInfo[0] == 1 && BatchInfo[1] == WallpadDeviceSet.BATCH_TYPE_SMART )
- {
- return true;
- }
- }
- }
- catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch( Exception e)
- {
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- return false;
- }
- public static List<String[]> getSubDevListContents( Context context)
- {
- List<String[]> ret = null;
- try
- {
- WallpadDeviceSet devset = new WallpadDeviceSet(context);
- if (devset != null)
- {
- ret = devset.GetSettingGroupData("subdev_list");
- }
- else
- {
- Log.d("getSubDevListContents", "WallpadDeviceSet == null ========> ");
- }
- devset.closeDB();
- if ((ret == null) || (ret.size() <= 0))
- {
- Log.d("getSubDevListContents", "return value null =========> ");
- return null;
- }
- }
- catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch( Exception e)
- {
- Log.e("Exception", e.toString());
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- return ret;
- }
- public static String getSubDevListItem(Context context, int itemType) {
- List<String[]> subDevList = getSubDevListContents(context);
- List<String> result = null;
- String devInfo = null;
- String deviceID = null;
- if ((subDevList != null) && (subDevList.size() > 0)) {
- deviceID = MainDatabaseManager.getSubDevID(itemType);
- if (deviceID != null) {
- for (int i = 0; i < subDevList.size(); i++) {
- // Log.d("Common", "deviceID :" + deviceID + "subDevList() .get(" + i + ")[0] : " + subDevList.get(i)[0]
- // + ", .get(" + i + ")[1] : " + subDevList.get(i)[1]
- // );
- if (deviceID.equals(subDevList.get(i)[0])) {
- devInfo = subDevList.get(i)[1];
- break;
- }
- }
- }
- }
- else {
- Common.DebugLog(" return value null");
- }
- if (ENABLED_SUB_DEVICE_DEFAULT_VALUE == true) {
- if (devInfo == null) {
- switch (itemType) {
- case SETTING_ITEM_SUB_DEVICE_ELEVATOR:
- devInfo = "1(1:엘리베이터(사용함)종류( 층표시 ))";
- break;
- }
- }
- }
- return devInfo;
- }
- /**
- * GLE 모델의 경우 현관 수신과 전화수신을 통화 apk에 전달하기 위해 사용한다.<br>
- * <br>
- * input param :
- *
- */
- public static void received_Call( Context context, String ActionFilter )
- {
- Intent intent = new Intent(ActionFilter, null);
- context.sendBroadcast(intent);
- }
- public static void command_iGW200( Context context, int kind )
- {
- //DebugLog("%%%%%%%%%%%%%% Common.log command_iGW200 : " + kind);
- Intent iGwIntent = new Intent();
- iGwIntent.setAction(Common.BR_IGW200FILTER);
- iGwIntent.putExtra("KIND", kind);
- context.sendBroadcast(iGwIntent);
- }
- public static void SendBRMainNoti(Context context , int kind)
- {
- Intent iIntent = new Intent();
- iIntent.setAction(BR_MAIN_NOTI.ACNAME_MAIN_NOTI);
- iIntent.putExtra(BR_MAIN_NOTI.KIND, kind);
- context.sendBroadcast(iIntent);
- }
- public static void SendAppFinishReqBR( Context context)
- {
- Log.d("Common", "SendAppFinishReqBR =========> ");
- Intent notiIntent = new Intent();
- notiIntent.setAction(define.BR_APP_FINISH);
- context.sendBroadcast(notiIntent);
- }
- public static void SendBRLiveChecker(Context context , int kind)
- {
- Intent iIntent = new Intent();
- iIntent.setAction(BR_MAIN_LIVE_CHECKER.ACNAME_MAIN_LIVE_CHECKER);
- iIntent.putExtra(BR_MAIN_LIVE_CHECKER.KIND, kind);
- context.sendBroadcast(iIntent);
- }
- final static int DEFAULT_METERING_COUNT = 5;
- public static int GetMeteringCount( Context context )
- {
- WallpadDeviceSet devSet = new WallpadDeviceSet(context);
- String[] MetringDB = devSet.GetSettingData("원격검침");
- devSet.closeDB();
- if (MetringDB!=null)
- {
- for( int i = 0 ; i < MetringDB.length ; i++ )
- Log.d("Common", "$$$$$$$$$$ MetringDB[ " + i +" ] : " + MetringDB[i]);
- try
- {
- if( MetringDB[1].indexOf("원격검침(사용안함)") > 0 )
- return 0;
- Log.d("Common", "$$$$$$$$$$ MetringDB count : " + Integer.parseInt(MetringDB[1].split("[(]")[1].split("[:]")[0].trim()));
- return Integer.parseInt(MetringDB[1].split("[(]")[1].split("[:]")[0].trim());
- }
- catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- return DEFAULT_METERING_COUNT;
- }
- catch (Exception e)
- {
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- return DEFAULT_METERING_COUNT;
- }
- }
- else
- return DEFAULT_METERING_COUNT;
- }
- /**
- * 내부동체 사용여부를 DB에서 가져와 리턴한다.
- *
- * @return int[] result[0] - 내부동체 사용여부 (1이면 사용, 0이면 미사용) <br>
- * int[] result[1] - 외부동체 사용여부 (1이면 사용, 0이면 미사용)
- * **/
- public static int[] GetInSensorUseOfNotFromDB( Context context)
- {
- int returnData[] = {1, 1};
- try
- {
- WallpadDeviceSet devSet = new WallpadDeviceSet(context);
- String[] SensorValue = devSet.GetSettingData("동체설정");
- devSet.closeDB();
- if (SensorValue == null)
- {
- Log.e("Common", "GetSettingData(동체설정) is null");
- return returnData;
- }
- String devInfo = SensorValue[1];
- devInfo = devInfo.replace('(', '_');
- devInfo = devInfo.replace(':', '_');
- devInfo = devInfo.replace(')', '_');
- String[] DataInfo = devInfo.split("_");
- //동체설정 사용여부
- if(DataInfo[3].equals("사용안함") == true)
- {
- returnData[0] = 0;
- returnData[1] = 0;
- Log.d("Common", "move sensor is not use");
- return returnData;
- }
- //내부동체
- if(DataInfo[7].equals("사용함") == true)
- {
- returnData[0] = 1;
- Log.d("Common", "IN Move sensor is use");
- }
- else
- {
- returnData[0] = 0;
- Log.d("Common", "IN Move sensor is not use");
- }
- //외부동체
- if(DataInfo[5].equals("사용함") == true)
- {
- returnData[1] = 1;
- Log.d("Common", "OUT Move sensor is use");
- }
- else
- {
- returnData[1] = 0;
- Log.d("Common", "OUT Move sensor is not use");
- }
- return returnData;
- }
- catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- return returnData;
- }
- catch (Exception e)
- {
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- return returnData;
- }
- }
- public static final int Notify_DoorCameraUse_Start = 1;
- public static final int Notify_DoorCameraUse_End= 0;
- public static void SendDoorCallStateForRFCamera( Context context , int state )
- {
- Log.d("Door", "----------------------------------------------------------------");
- // if( state == Notify_DoorCameraUse_Start )
- // Log.d("Common", "Send Intent DoorCamera Use Start !!!");
- // else
- // Log.d("Common", "Send Intent DoorCamera Use End !!!");
- // Log.d("Door", "----------------------------------------------------------------");
- // Intent intent = new Intent( define.NOTIFY_ACNAME, null);
- // if( state == Notify_DoorCameraUse_Start )
- // intent.putExtra(define.NOTIBR_KIND, define.NOTIFY_DOORCAM_USE_START);
- // else
- // intent.putExtra(define.NOTIBR_KIND, define.NOTIFY_DOORCAM_USE_END);
- // context.sendBroadcast(intent);
- }
- public static boolean isWirelessDoorlock(Context context)
- {
- WallpadDeviceSet devSet = new WallpadDeviceSet(context);
- String[] GetValue = devSet.GetSettingData("디지털도어락");
- devSet.closeDB();
- if (GetValue == null)
- {
- Log.e("Common", "GetSettingData(디지털도어락) is null");
- return false;
- }
- Log.d("Common", "GetSettingData(디지털도어락) is value : " + GetValue[1]);
- if( GetValue[1].indexOf("무선") > 0 )
- {
- Log.d("Common", "Wireless Doorlock");
- return true;
- }
- return false;
- }
- public static String ZeroPadding_Head(int nOutLength, String strOriginalString) {
- String strResult = strOriginalString;
- // Log.d(TAG, "[ZeroPadding_Head] (Length) strOriginalString [" + strOriginalString.length() +"], nOutLength [" + nOutLength + "]");
- try {
- if (strOriginalString.length() < nOutLength) {
- for (int i = strOriginalString.length(); i < nOutLength; i++) {
- strResult = "0" + strResult;
- }
- // Log.d(TAG, "[ZeroPadding_Head] strResult : " + strResult);
- }
- else if (strOriginalString.length() == nOutLength) {
- // Log.d(TAG, "[ZeroPadding_Head] same length!");
- }
- else {
- Log.d(TAG, "[ZeroPadding_Head] strOriginalString(" + strOriginalString.length() +") is longer than nOutLength(" + nOutLength + ")");
- }
- return strResult;
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- return strResult;
- }
- catch (Exception e) {
- Log.e(TAG, "[Exception] ZeroPadding_Head(int nOutLength, String strOriginalString)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- return strResult;
- }
- }
- public static String ZeroPadding_Tail(int nOutLength, String strOriginalString) {
- String strResult = strOriginalString;
- Log.d(TAG, "[ZeroPadding_Tail] (Length) strOriginalString [" + strOriginalString.length() +"], nOutLength [" + nOutLength + "]");
- try {
- if (strOriginalString.length() < nOutLength) {
- for (int i = strOriginalString.length(); i < nOutLength; i++) {
- strResult = strResult + "0";
- }
- Log.d(TAG, "[ZeroPadding_Tail] strResult : " + strResult);
- }
- else if (strOriginalString.length() == nOutLength) {
- Log.d(TAG, "[ZeroPadding_Tail] same length!");
- }
- else {
- Log.d(TAG, "[ZeroPadding_Tail] strOriginalString(" + strOriginalString.length() +") is longer than nOutLength(" + nOutLength + ")");
- }
- return strResult;
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- return strResult;
- }
- catch (Exception e) {
- Log.e(TAG, "[Exception] ZeroPadding_Tail(int nOutLength, String strOriginalString)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- return strResult;
- }
- }
- public static ELEV_STATUS eElevCallStatus = ELEV_STATUS.NONE;
- public static enum ELEV_STATUS {
- NONE,
- UP,
- DOWN,
- UP_DOWN;
- public static String getString(ELEV_STATUS eStatus) {
- if (eStatus == NONE) return NONE.toString();
- else if (eStatus == UP) return UP.toString();
- else if (eStatus == DOWN) return DOWN.toString();
- else if (eStatus == UP_DOWN) return UP_DOWN.toString();
- else return NONE.toString();
- }
- public static ELEV_STATUS getEnum(String strStatus) {
- if (strStatus.equalsIgnoreCase(NONE.toString())) return NONE;
- else if (strStatus.equalsIgnoreCase(UP.toString())) return UP;
- else if (strStatus.equalsIgnoreCase(DOWN.toString())) return DOWN;
- else if (strStatus.equalsIgnoreCase(UP_DOWN.toString())) return UP_DOWN;
- else return NONE;
- }
- }
- // SKT 모바일 서비스
- public static final String MOBILE_SERVICE_ENERGY_UPDATE = "MOBILE_SERVICE_ENERGY_UPDATE";
- public static void MobileServiceEnergyDataReqBR(Context context) {
- try {
- Intent iMobileServieIntent = new Intent();
- iMobileServieIntent.setAction(Common.MOBILE_SERVICE_ENERGY_UPDATE);
- context.sendBroadcast(iMobileServieIntent);
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch( Exception e ) {
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- /**
- * 통신사 제어기기 구독 사용 여부
- *
- * @return (int) - >0 : 제어기기 구독 상태, <0 : 제어기기 구독 해제
- */
- public static boolean setDeviceSubcriptionOld(Context context, boolean status) {
- // 1. get DB
- WallpadDeviceSet devset = new WallpadDeviceSet(context);
- boolean retValue = devset.SetSubDevListItem(status , "월패드구독");
- devset.closeDB();
- return retValue;
- }
- /**
- * 통신사 제어기기 구독 사용 여부
- *
- * @return (int) - >0 : 제어기기 구독 상태, <0 : 제어기기 구독 해제
- */
- public static boolean getDeviceSubcriptionOld(Context context) {
- // 1. get DB
- WallpadDeviceSet devset = new WallpadDeviceSet(context);
- int retValue = devset.GetDeviceSetted("월패드구독");
- devset.closeDB();
- // 2. Check
- if (retValue == WallpadDeviceSet.DEV_DATA_ENABLE) return true;
- else return false;
- }
- /**
- * HDC Linker 추가
- *
- * @return () - > true: 성공, false: 실패
- */
- public static String[] setDeviceSubcription(Context context, boolean follow, String company) {
- Log.i(TAG, "[setDeviceSubcription] follow [" + follow + "], company [" + company + "]");
- WallpadDeviceSet devset = new WallpadDeviceSet(context);
- String[] alinkers = devset.getHDCLinker(); // DB에서 기존 Linker를 불러온다.
- String[] retValue = null;
- String linkers = "";
- if (alinkers != null) linkers = convertHDCLinkerArrayToString(alinkers);
- Log.i(TAG, "[setDeviceSubcription] linkers [" + linkers + "]");
- if (follow) {
- // 구독 등록
- if (alinkers == null) {
- linkers = company; // 다른 Linker가 존재하지 않는 경우
- }
- else {
- boolean bExist = false;
- for (int i = 0; i < alinkers.length; i++) {
- if (alinkers[i].equalsIgnoreCase(company.toUpperCase())) bExist = true;
- }
- if (!bExist) {
- if (linkers.equalsIgnoreCase("")) linkers = company; // 다른 Linker가 존재하지 않는 경우
- else linkers += "_" + company; // 다른 Linker가 존재하는 경우
- }
- }
- Log.i(TAG, "[setDeviceSubcription] linkers [" + linkers + "]");
- retValue = convertHDCLinkerStringToArray(linkers);
- }
- else {
- // 구독 삭제
- if (company.equalsIgnoreCase("ALL")) {
- retValue = null;
- }
- else {
- if (alinkers != null) {
- String[] temp = new String[alinkers.length];
- int nCnt = 0;
- for (int i = 0; i < alinkers.length; i++) {
- if (!alinkers[i].equalsIgnoreCase(company.toUpperCase())) {
- temp[nCnt++] = alinkers[i];
- }
- }
- if (nCnt == 0) retValue = null;
- else {
- retValue = new String[nCnt];
- for (int i = 0; i < retValue.length; i++) {
- retValue[i] = temp[i];
- }
- }
- }
- }
- }
- linkers = convertHDCLinkerArrayToString(retValue);
- devset.setHDCLinker(retValue);
- devset.closeDB();
- if (retValue == null) Common.setDeviceSubcriptionOld(context, false);
- Log.i(TAG, "[setDeviceSubcription] linkers [" + linkers + "]");
- return retValue;
- }
- private static String convertHDCLinkerArrayToString(String[] value) {
- String retValue = "";
- if (value != null) {
- for (int i = 0; i < value.length; i++) {
- if (i == 0) retValue = value[i];
- else retValue += "_" + value[i];
- }
- }
- return retValue;
- }
- private static String[] convertHDCLinkerStringToArray(String value) {
- if (!value.equalsIgnoreCase("")) {
- String[] retValue = value.trim().split("_");
- return retValue;
- }
- else return null;
- }
- /**
- * HDC Linker 목록 가져오기
- *
- * @return (String) - > HDC Linker 목록 (예. SKT_KT_KAKAO -> 구독하는 항목만 표기하며, null이면 구독 없음. 연동사별 구분은 "_"한다.)
- */
- public static String[] getDeviceSubcription(Context context) {
- WallpadDeviceSet devset = new WallpadDeviceSet(context);
- String[] retValue = devset.getHDCLinker();
- devset.closeDB();
- return retValue;
- }
- /**
- * HDC Linker 목록 확인하기
- *
- * @return (boolean) - > true: 항목 존재, false: 항목 없음
- */
- public static boolean checkDeviceSubscription(Context context, String company) {
- WallpadDeviceSet devset = new WallpadDeviceSet(context);
- String[] retValue = devset.getHDCLinker();
- devset.closeDB();
- for (int i = 0; i < retValue.length; i++) {
- if (retValue[i].equalsIgnoreCase(company)) return false;
- }
- return false;
- }
- /**
- * HDC Linker 사용여부 및 목록 저장
- *
- * @return (boolean) - true: 성공, false: 실패
- */
- public static boolean setHDCLinkerSubscriptionUsage(Context context, String strLinkers) {
- // 1. get DB
- WallpadDeviceSet devset = new WallpadDeviceSet(context);
- boolean retValue = devset.setHDCLinker(convertHDCLinkerStringToArray(strLinkers));
- devset.closeDB();
- return retValue;
- }
- /**
- * HDC Linker 사용 여부 (외부 연동사의 월패드 구독 여부)
- *
- * @return (boolean) - true: 사용함, false: 사용안함
- */
- public static boolean getHDCLinkerSubscriptionUsage(Context context) {
- // 1. get DB
- boolean retValue = false;
- WallpadDeviceSet devset = new WallpadDeviceSet(context);
- retValue = devset.getHDCLinkerUsage();
- devset.closeDB();
- return retValue;
- }
- /**
- * HDC Linker 목록 확인
- *
- * @return (String) - >HDC Linker 목록 (예. SKT_KT_KAKAO -> 구독하는 항목만 표기하며, null이면 구독 없음. 연동사별 구분은 "_"한다.)
- */
- public static String[] getHDCLinkerSubscription(Context context) {
- // 1. get DB
- WallpadDeviceSet devset = new WallpadDeviceSet(context);
- String[] retValue = devset.getHDCLinker();
- devset.closeDB();
- return retValue;
- }
- public static class VISITORREMOTECALL {
- public static final String INTERNAL_SERVER_IP ="10.2.110.110";
- public static final int INTERNAL_SERVER_PORT = 8000;
- }
- /**
- * 기존 구분되지 않던 구독 방식을 고려해야함. 현장이 운영중에 있으니 월패드 업그레이드가 일어나도 기존 설정값을 그대로 사용 가능해야 함
- * 통신사/포털사 구독 사용 구분
- */
- public enum HDC_LINKER {
- SKT(1, "SKT"),
- KT(2, "KT"),
- LGUPLUS(3, "LGUPLUS"),
- KAKAO(4, "KAKAO"),
- NAVER(5, "NAVER"),
- LGE(6, "LGE"),
- SAMSUNG(7, "SAMSUNG"),
- GOOGLE(8, "GOOGLE"),
- AMAZON(9, "AMAZON"),
- APPLE(10, "APPLE"),
- DAEWOO(11, "DAEWOO"),
- HYOSUNG(12, "HYOSUNG");
- private static int nAvailableLinkerCnt = 12; // 미리 정의된 외부 연동사 항목의 개수에 변화가 생
- private int mIdx;
- private String mContent;
- private String strHomeTag = " HOME";
- private HDC_LINKER(int idx, final String txt) {
- this.mIdx = idx;
- this.mContent = txt;
- }
- public String getContents()
- {
- return this.mContent;
- }
- public String getHomeContents()
- {
- return this.mContent + this.strHomeTag;
- }
- public int getIndex()
- {
- return this.mIdx;
- }
- public static int getAvailableLinkerCnt()
- {
- return nAvailableLinkerCnt;
- }
- }
- public static int getGubun(String inValue) {
- // 1. get DB
- int retValue = 0;
- if (inValue.equalsIgnoreCase(HDC_LINKER.SKT.getContents())) retValue = HDC_LINKER.SKT.getIndex();
- else if (inValue.equalsIgnoreCase(HDC_LINKER.KAKAO.getContents())) retValue = HDC_LINKER.KAKAO.getIndex();
- else if (inValue.equalsIgnoreCase(HDC_LINKER.NAVER.getContents())) retValue = HDC_LINKER.NAVER.getIndex();
- else if (inValue.equalsIgnoreCase(HDC_LINKER.GOOGLE.getContents())) retValue = HDC_LINKER.GOOGLE.getIndex();
- else if (inValue.equalsIgnoreCase(HDC_LINKER.KT.getContents())) retValue = HDC_LINKER.KT.getIndex();
- else if (inValue.equalsIgnoreCase(HDC_LINKER.LGUPLUS.getContents())) retValue = HDC_LINKER.LGUPLUS.getIndex();
- else if (inValue.equalsIgnoreCase(HDC_LINKER.LGE.getContents())) retValue = HDC_LINKER.LGE.getIndex();
- else if (inValue.equalsIgnoreCase(HDC_LINKER.SAMSUNG.getContents())) retValue = HDC_LINKER.SAMSUNG.getIndex();
- else if (inValue.equalsIgnoreCase(HDC_LINKER.AMAZON.getContents())) retValue = HDC_LINKER.AMAZON.getIndex();
- else if (inValue.equalsIgnoreCase(HDC_LINKER.APPLE.getContents())) retValue = HDC_LINKER.APPLE.getIndex();
- else if (inValue.equalsIgnoreCase(HDC_LINKER.DAEWOO.getContents())) retValue = HDC_LINKER.DAEWOO.getIndex();
- else if (inValue.equalsIgnoreCase(HDC_LINKER.HYOSUNG.getContents())) retValue = HDC_LINKER.HYOSUNG.getIndex();
- return retValue;
- }
- public static String getGubunXMLMsg(Context context) {
- String retValue = "";
- boolean[] gubunList = getGubunSubScription(context);
- String inValue = "";
- if (gubunList[HDC_LINKER.SKT.getIndex()]) {
- if (inValue.length() > 0 ) inValue += "_";
- inValue += HDC_LINKER.SKT.getContents();
- }
- if (gubunList[HDC_LINKER.KAKAO.getIndex()]) {
- if (inValue.length() > 0 ) inValue += "_";
- inValue += HDC_LINKER.KAKAO.getContents();
- }
- if (gubunList[HDC_LINKER.NAVER.getIndex()]) {
- if (inValue.length() > 0 ) inValue += "_";
- inValue += HDC_LINKER.NAVER.getContents();
- }
- if (gubunList[HDC_LINKER.GOOGLE.getIndex()]) {
- if (inValue.length() > 0 ) inValue += "_";
- inValue += HDC_LINKER.GOOGLE.getContents();
- }
- if (gubunList[HDC_LINKER.KT.getIndex()]) {
- if (inValue.length() > 0 ) inValue += "_";
- inValue += HDC_LINKER.KT.getContents();
- }
- if (gubunList[HDC_LINKER.LGUPLUS.getIndex()]) {
- if (inValue.length() > 0 ) inValue += "_";
- inValue += HDC_LINKER.LGUPLUS.getContents();
- }
- if (gubunList[HDC_LINKER.LGE.getIndex()]) {
- if (inValue.length() > 0 ) inValue += "_";
- inValue += HDC_LINKER.LGE.getContents();
- }
- if (gubunList[HDC_LINKER.SAMSUNG.getIndex()]) {
- if (inValue.length() > 0 ) inValue += "_";
- inValue += HDC_LINKER.SAMSUNG.getContents();
- }
- if (gubunList[HDC_LINKER.AMAZON.getIndex()]) {
- if (inValue.length() > 0 ) inValue += "_";
- inValue += HDC_LINKER.AMAZON.getContents();
- }
- if (gubunList[HDC_LINKER.APPLE.getIndex()]) {
- if (inValue.length() > 0 ) inValue += "_";
- inValue += HDC_LINKER.APPLE.getContents();
- }
- if (gubunList[HDC_LINKER.DAEWOO.getIndex()]) {
- if (inValue.length() > 0 ) inValue += "_";
- inValue += HDC_LINKER.DAEWOO.getContents();
- }
- if (gubunList[HDC_LINKER.HYOSUNG.getIndex()]) {
- if (inValue.length() > 0 ) inValue += "_";
- inValue += HDC_LINKER.HYOSUNG.getContents();
- }
- retValue = " <req_company>"+ inValue + "</req_company>\r\n";
- return retValue;
- }
- public static boolean [] getGubunSubScription(Context context) {
- // 1. get DB
- WallpadDeviceSet devset = new WallpadDeviceSet(context);
- boolean[] retValue = { false, false, false, false, false, false, false, false, false } ;
- int intValue = devset.GetDeviceSetted("월패드구독");
- if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE ) {
- // 기존 현장에서 구독된 상태
- // SKT와 유플러스 현장 고려해야 함
- if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL) retValue[HDC_LINKER.SKT.getIndex()] = true;
- else retValue[HDC_LINKER.LGUPLUS.getIndex()] = true;
- }
- else {
- // 월패드구독 디비값을 사용하지 않으면 처음 사용하는 현장
- intValue = devset.GetDeviceSetted("구독_SKT");
- if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.SKT.getIndex()] = true;
- intValue = devset.GetDeviceSetted("구독_KT");
- if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.KT.getIndex()] = true;
- intValue = devset.GetDeviceSetted("구독_유플러스");
- if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.LGUPLUS.getIndex()] = true;
- intValue = devset.GetDeviceSetted("구독_카카오");
- if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE ) retValue[HDC_LINKER.KAKAO.getIndex()] = true;
- intValue = devset.GetDeviceSetted("구독_네이버");
- if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.NAVER.getIndex()] = true;
- intValue = devset.GetDeviceSetted("구독_LG전자");
- if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.LGE.getIndex()] = true;
- intValue = devset.GetDeviceSetted("구독_삼성전자");
- if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.SAMSUNG.getIndex()] = true;
- intValue = devset.GetDeviceSetted("구독_구글");
- if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.GOOGLE.getIndex()] = true;
- intValue = devset.GetDeviceSetted("구독_알렉사");
- if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.AMAZON.getIndex()] = true;
- intValue = devset.GetDeviceSetted("구독_애플");
- if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.APPLE.getIndex()] = true;
- intValue = devset.GetDeviceSetted("구독_대우");
- if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.DAEWOO.getIndex()] = true;
- intValue = devset.GetDeviceSetted("구독_효성");
- if (intValue == WallpadDeviceSet.DEV_DATA_ENABLE) retValue[HDC_LINKER.HYOSUNG.getIndex()] = true;
- }
- devset.closeDB();
- return retValue;
- }
- public static void CarInOoutEventBR(Context context, String InOut, String CarNum) {
- try {
- final String BR_ACTION_BASE = "kr.co.icontrols.mobileservice.BR_";
- final int BASE = define.BR_COM_MOBILE_SERVICE;
- final String BR_CAR_INOUT_EVENT = BR_ACTION_BASE + "CARINOUT_EVENT_HDC" + "(" + BASE + ")";
- Intent iMobileServieIntent = new Intent();
- iMobileServieIntent.setAction(BR_CAR_INOUT_EVENT);
- iMobileServieIntent.putExtra("KIND", InOut);
- iMobileServieIntent.putExtra("CarNum", CarNum);
- context.sendBroadcast(iMobileServieIntent);
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- }
- catch (Exception e) {
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- public static void MobileDemolVentilBR( Context context, int kind, String msg) {
- try {
- Intent iMobileServieIntent = new Intent();
- iMobileServieIntent.setAction(define.NOTIFY_ACNAME);
- iMobileServieIntent.putExtra("KIND", kind);
- iMobileServieIntent.putExtra("MSG", msg);
- context.sendBroadcast(iMobileServieIntent);
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- }
- catch (Exception e) {
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private static boolean bDeviceServiceLoaded = false;
- public static void setDeviceServeiceLoadComplite() {
- Log.i(TAG, "[setDeviceServeiceLoadComplite] ========== START ==========");
- bDeviceServiceLoaded = true;
- }
- public static boolean getDeviceServeiceLoadComplite() {
- Log.i(TAG, "[getDeviceServeiceLoadComplite] bDeviceServiceLoaded [" + bDeviceServiceLoaded + "]");
- return bDeviceServiceLoaded;
- }
- /**
- * 신형단지서버 대기모드 사용여부
- *
- * @return (int) - >0 : 신형단지서버 사용, <0 : 실패 또는 미사용
- */
- public static int getServerV2Use(Context context) {
- // 1. get DB
- WallpadDeviceSet devset = new WallpadDeviceSet(context);
- int serverV2info = devset.GetDeviceSetted("신형단지서버");
- devset.closeDB();
- // 2. Check
- if (serverV2info == WallpadDeviceSet.DEV_DATA_ENABLE) {
- return 1;
- }
- else if(serverV2info == WallpadDeviceSet.DEV_DATA_DISABLE) {
- return -1;
- }
- else if(serverV2info == WallpadDeviceSet.DEV_DATA_NONE) {
- return -2;
- }
- else {
- return -3;
- }
- }
- /**
- * GUI Type 설정 확인
- */
- public static GUI_TYPE eGUIType = GUI_TYPE.STANDARD;
- public enum GUI_TYPE {
- STANDARD,
- METRO,
- HYOSUNG,
- HIMCHAN,
- }
- public static final class JSON {
- final static int MENU_BASE = 1000;
- public static final class MENU
- {
- public final static int LIGHT = MENU_BASE + 1;
- public final static int CONCENT = MENU_BASE + 2;
- public final static int HEATING = MENU_BASE + 3;
- public final static int AIRCON = MENU_BASE + 4;
- public final static int PURITY = MENU_BASE + 5;
- public final static int GAS = MENU_BASE + 6;
- public final static int COOKTOP = MENU_BASE + 7;
- public final static int PASSWORD = MENU_BASE + 8;
- public final static int MOBILE = MENU_BASE + 9;
- public final static int DEVICE_INFO = MENU_BASE + 10;
- }
- public static final class REASON
- {
- public final static int Status = 0;
- public final static int Control = 1;
- public final static int PassWordChange = 2;
- public final static int MobileRegister = 3;
- public final static int MobileDelete = 4;
- public final static int DeviceInfo = 5;
- }
- public static final class KIND
- {
- public final static int All = 0;
- public final static int Individual = 1;
- }
- public static final class POSITION
- {
- public final static int All = 0;
- }
- }
- }
|