瀏覽代碼

[WallPadAPI]
1. 일괄소등 BR 등록 해제 추가

jglee 2 年之前
父節點
當前提交
272eaeeb94
共有 2 個文件被更改,包括 186 次插入0 次删除
  1. 二進制
      WallPadAPI/jar/WallPadAPI.jar
  2. 186 0
      WallPadAPI/src/main/java/com/artncore/wallpadapi/WallPadAPI.java

二進制
WallPadAPI/jar/WallPadAPI.jar


+ 186 - 0
WallPadAPI/src/main/java/com/artncore/wallpadapi/WallPadAPI.java

@@ -369,6 +369,192 @@ public class WallPadAPI {
         return ret;
     }
 
+
+    /**
+     * 일괄소등 해제 BR 등록
+     */
+    public void regChangedBR(String actionname) {
+        int ret = -100;
+        try {
+            if (mModelType == Version.MODEL_TYPE.IHN_D101 || mModelType == Version.MODEL_TYPE.IHN_D101_I
+                    || mModelType == Version.MODEL_TYPE.IHN_D101K || mModelType == Version.MODEL_TYPE.IHN_D101K_I
+                    || mModelType == Version.MODEL_TYPE.IHN_D101_I_OCF)
+            {
+                WallpadDeviceSet wds = new WallpadDeviceSet(mContext);
+                int nDPType = wds.Get_DistributionPannelType_Info();
+                wds.closeDB();
+                Log.d(TAG, "[GetBatchSwitchStatus] nDPType [" + nDPType + "]");
+
+                if (nDPType == Version.DISTRIBUTION_MODEL.SMART_DIST) {
+                    // 스마트 분전반
+                    SdbAPI sdbAPI = Get_SdbController();
+                    if(sdbAPI == null) return ;
+                    sdbAPI.regChangedBR(actionname);
+                }
+                else if (nDPType == Version.DISTRIBUTION_MODEL.KNX_DIST) {
+                    // KNX 분전반
+                    KnxAPI knxAPI = Get_KnxController();
+                    if(knxAPI == null) return;
+                    knxAPI.regChangedBR(actionname);
+                }
+                else {
+                    // 그밖의 경우, 스마트분전반을 기본으로 로딩.
+                    SdbAPI sdbAPI = Get_SdbController();
+                    if(sdbAPI == null) return;
+                    sdbAPI.regChangedBR(actionname);
+                }
+            }
+            else if (mModelType == Version.MODEL_TYPE.IHN_1020GL
+                    || mModelType == Version.MODEL_TYPE.IHN_1010GL || mModelType == Version.MODEL_TYPE.IHN_1010GL_I
+                    || mModelType == Version.MODEL_TYPE.IHN_1010GL_I_2443 || mModelType == Version.MODEL_TYPE.IHN_1010GL_I_6410) {
+
+
+                WallpadDeviceSet devSet = new WallpadDeviceSet(mContext);
+                int[] batchinfo = devSet.Get_BatchSW_Info();
+                devSet.closeDB();
+                //DB에 현산향제일전기일괄소등제어기 되어 있으면 2세대 전용 일괄소등임(제일전기)
+                if(batchinfo!=null && batchinfo.length > 2 && batchinfo[1]== WallpadDeviceSet.BATCH_TYPE_HDC_ALLLIGHT)
+                {
+                    AllLightHDCAPI allLightHDCAPI = Get_AllLightHDCController();
+                    if (allLightHDCAPI == null) return;
+                    allLightHDCAPI.regChangedBR(actionname);
+                }
+                else  if (!Get_HDCIntLightType()) {
+                    // 0:일괄소등 릴레이
+                    AllLightHDCAPI allLightHDCAPI = Get_AllLightHDCController();
+                    if (allLightHDCAPI == null) return;
+                    allLightHDCAPI.regChangedBR(actionname);
+                }
+                else {
+                    IntLightAPI intLightAPI = Get_IntLightController();
+                    if (intLightAPI == null) return ;
+                    intLightAPI.regChangedBR(actionname);
+                }
+            }
+            else {
+                WallpadDeviceSet devSet = new WallpadDeviceSet(mContext);
+                int[] batchinfo = devSet.Get_BatchSW_Info();
+                devSet.closeDB();
+                if (batchinfo[0] == 0) return ;
+                if (batchinfo[1] ==  WallpadDeviceSet.BATCH_TYPE_GENERAL) {
+                    AllLightAPI allLightAPI = Get_AllLightController();
+                    if (allLightAPI == null) return;
+
+                    allLightAPI.regChangedBR(actionname);
+                }
+                else if (batchinfo[1] == WallpadDeviceSet.BATCH_TYPE_SMART) {
+                    SmartSwitchPolAPI smartSwitchPolAPI = Get_SmartSwitchPolController();
+                    if (smartSwitchPolAPI == null) return ;
+
+                    smartSwitchPolAPI.regChangedBR(actionname);
+                }
+            }
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return;
+        }
+        catch (Exception e) {
+            Log.e(TAG, "[Exception] GetBatchSwitchStatus()");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return;
+        }
+    }
+
+
+    /**
+     * 일괄소등 해제 BR 해제
+     * @param actionname
+     */
+    public void unregChangedBR(String actionname) {
+        int ret = -100;
+        try {
+            if (mModelType == Version.MODEL_TYPE.IHN_D101 || mModelType == Version.MODEL_TYPE.IHN_D101_I
+                    || mModelType == Version.MODEL_TYPE.IHN_D101K || mModelType == Version.MODEL_TYPE.IHN_D101K_I
+                    || mModelType == Version.MODEL_TYPE.IHN_D101_I_OCF)
+            {
+                WallpadDeviceSet wds = new WallpadDeviceSet(mContext);
+                int nDPType = wds.Get_DistributionPannelType_Info();
+                wds.closeDB();
+                Log.d(TAG, "[GetBatchSwitchStatus] nDPType [" + nDPType + "]");
+
+                if (nDPType == Version.DISTRIBUTION_MODEL.SMART_DIST) {
+                    // 스마트 분전반
+                    SdbAPI sdbAPI = Get_SdbController();
+                    if(sdbAPI == null) return ;
+                    sdbAPI.regChangedBR(actionname);
+                }
+                else if (nDPType == Version.DISTRIBUTION_MODEL.KNX_DIST) {
+                    // KNX 분전반
+                    KnxAPI knxAPI = Get_KnxController();
+                    if(knxAPI == null) return;
+                    knxAPI.regChangedBR(actionname);
+                }
+                else {
+                    // 그밖의 경우, 스마트분전반을 기본으로 로딩.
+                    SdbAPI sdbAPI = Get_SdbController();
+                    if(sdbAPI == null) return;
+                    sdbAPI.regChangedBR(actionname);
+                }
+            }
+            else if (mModelType == Version.MODEL_TYPE.IHN_1020GL
+                    || mModelType == Version.MODEL_TYPE.IHN_1010GL || mModelType == Version.MODEL_TYPE.IHN_1010GL_I
+                    || mModelType == Version.MODEL_TYPE.IHN_1010GL_I_2443 || mModelType == Version.MODEL_TYPE.IHN_1010GL_I_6410) {
+
+
+                WallpadDeviceSet devSet = new WallpadDeviceSet(mContext);
+                int[] batchinfo = devSet.Get_BatchSW_Info();
+                devSet.closeDB();
+                //DB에 현산향제일전기일괄소등제어기 되어 있으면 2세대 전용 일괄소등임(제일전기)
+                if(batchinfo!=null && batchinfo.length > 2 && batchinfo[1]== WallpadDeviceSet.BATCH_TYPE_HDC_ALLLIGHT)
+                {
+                    AllLightHDCAPI allLightHDCAPI = Get_AllLightHDCController();
+                    if (allLightHDCAPI == null) return;
+                    allLightHDCAPI.regChangedBR(actionname);
+                }
+                else  if (!Get_HDCIntLightType()) {
+                    // 0:일괄소등 릴레이
+                    AllLightHDCAPI allLightHDCAPI = Get_AllLightHDCController();
+                    if (allLightHDCAPI == null) return;
+                    allLightHDCAPI.regChangedBR(actionname);
+                }
+                else {
+                    IntLightAPI intLightAPI = Get_IntLightController();
+                    if (intLightAPI == null) return ;
+                    intLightAPI.regChangedBR(actionname);
+                }
+            }
+            else {
+                WallpadDeviceSet devSet = new WallpadDeviceSet(mContext);
+                int[] batchinfo = devSet.Get_BatchSW_Info();
+                devSet.closeDB();
+                if (batchinfo[0] == 0) return ;
+                if (batchinfo[1] ==  WallpadDeviceSet.BATCH_TYPE_GENERAL) {
+                    AllLightAPI allLightAPI = Get_AllLightController();
+                    if (allLightAPI == null) return;
+
+                    allLightAPI.regChangedBR(actionname);
+                }
+                else if (batchinfo[1] == WallpadDeviceSet.BATCH_TYPE_SMART) {
+                    SmartSwitchPolAPI smartSwitchPolAPI = Get_SmartSwitchPolController();
+                    if (smartSwitchPolAPI == null) return ;
+
+                    smartSwitchPolAPI.regChangedBR(actionname);
+                }
+            }
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return;
+        }
+        catch (Exception e) {
+            Log.e(TAG, "[Exception] GetBatchSwitchStatus()");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return;
+        }
+    }
+
+
     /**
      * WallPadDevService 와 바인딩 연결 여부를 확인한다.
      *