Forráskód Böngészése

[WallPadEnergyCtrl]
1. 최신소스로 업데이트(2021.04.19 기준)

DESKTOP-FBA840V\icontrols 4 éve
szülő
commit
aaae094558
33 módosított fájl, 2084 hozzáadás és 784 törlés
  1. 116 37
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/MainActivity.java
  2. 19 5
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/ManualActivity.java
  3. 13 4
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/PopupActivity.java
  4. 8 3
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/declare/Common.java
  5. 13 4
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/declare/TransactionDisplay.java
  6. 10 6
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/imap/iMAPEnergyCostTable.java
  7. 33 9
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/imap/iMAPEnergyServer_SetGoalInfo.java
  8. 11 7
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/imap/iMAPRemotemeter.java
  9. 13 5
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/imap/iMAPRemotemeterDay.java
  10. 276 198
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/IcEnergyMgrScreen.java
  11. 45 14
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/RealTimeMeterMainScreen.java
  12. 14 5
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/RemoteMeterCostTableScreen.java
  13. 41 19
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/RemoteMeterMainScreen.java
  14. 28 7
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/RemoteMeterPopupGraph.java
  15. 52 10
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/RemoteMeterPopupSetTargetScreen.java
  16. 131 38
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/ienergy/EachRoomEnergyDetailScreen.java
  17. 117 35
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/ienergy/EachRoomEnergyMainScreen.java
  18. 22 6
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/ienergy/IEnergySampleData.java
  19. 13 4
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/manual/HEMS_MANUAL.java
  20. 13 4
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/manual/RemoteMeter_MANUAL.java
  21. 17 7
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/manual/SmartConcentPop_MANUAL.java
  22. 13 4
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/manual/SmartConcent_MANUAL.java
  23. 13 4
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/manual/SmartDist_MANUAL.java
  24. 13 4
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/manual/SmartLightPop_MANUAL.java
  25. 13 4
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/manual/SmartLight_MANUAL.java
  26. 73 24
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/smart_distribution/PopupSmartConcentRoom.java
  27. 99 37
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/smart_distribution/PopupSmartLightRoom.java
  28. 142 44
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/smart_distribution/SmartConcentScreen.java
  29. 192 64
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/smart_distribution/SmartDisPanelScreen.java
  30. 193 64
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/smart_distribution/SmartDisPanelScreen_01.java
  31. 201 68
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/smart_distribution/SmartDisPanelScreen_02.java
  32. 121 39
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/smart_distribution/SmartLightScreen.java
  33. 6 1
      WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/util/StringUtil.java

+ 116 - 37
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/MainActivity.java

@@ -56,7 +56,7 @@ import kr.co.icontrols.wallpadsupport.WpadTextView;
 import kr.co.icontrols.wallpadsupport.WpadUtil;
 import kr.co.icontrols.wallpadsupport.WpadImageView.TOUCH_KIND;
 import kr.co.icontrols.wallpadsupport.WpadSound.SND;
-
+import com.util.LogUtil;
 
 
 /**
@@ -258,16 +258,23 @@ public class MainActivity extends WpadActivity {
             Log.d(TAG, "OperationMode = MODE_NOMAL");
             try {
                 wpapi = new WallPadAPI(this);
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[ExceptionError] - new WallPadAPI : " + e);
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
             }
         }
         else if (OPERATION_MODE == Common.MODE_BUSINESS_SAMPLE) {
             Log.d(TAG, "OperationMode = MODE_BUSINESS_SAMPLE");
         }
         try { wdb = new WallpadStatusData(this); }
-        catch(Exception e) { Log.e(TAG, "[ExceptionError] - onCreate->WallpadStatusData Create : " + e); }
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) { Log.e(TAG, "[ExceptionError] - onCreate->WallpadStatusData Create : " + e); }
 
         getIntegratedPowerCtrllerType();
 
@@ -616,7 +623,7 @@ public class MainActivity extends WpadActivity {
 
                 try
                 {
-                    if(wpapi != null)
+                    if(wpapi != null && wpapi.Get_IGW200dController()!=null)
                     {
                         int ret = wpapi.Get_IGW200dController().EnergyReset();
                         if(ret >= 0)
@@ -625,10 +632,14 @@ public class MainActivity extends WpadActivity {
                         }
                     }
                 }
-                catch(Exception e)
+                catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                }
+                catch (Exception e)
                 {
                     Log.e(TAG, "[ExceptionError] - onTouchEvent->ENERGY_RESET wpapi.Get_IGW200dController().EnergyReset()");
-                    e.printStackTrace();
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
                 }
             }
             else if (TargetId == ID.main.button.MANUAL)
@@ -644,9 +655,13 @@ public class MainActivity extends WpadActivity {
                     else if(mCurrentScreenId == API_Menu.SubMenuEnergy.SmartLight)      { StartManual(ID.MANUAL.MANUAL_SmartLight); }
                     else if(mCurrentScreenId == API_Menu.SubMenuEnergy.SmartOutlet)     { StartManual(ID.MANUAL.MANUAL_SmartConcent); }
                 }
+                catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                }
                 catch (Exception ex)
                 {
-                    ex.printStackTrace();
+                    //ex.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, ex);
                 }
             }
 
@@ -730,13 +745,13 @@ public class MainActivity extends WpadActivity {
             if(TopSetTargetBtn.getVisibility() != View.VISIBLE)
             {
                 WpadUtil.ViewMove(TopSetTargetBtn, 93, 132);
-                TopSetTargetBtn.setVisibility(View.VISIBLE);
+                if(TopSetTargetBtn!=null) TopSetTargetBtn.setVisibility(View.VISIBLE);
             }
-            TopSetTargetBtn.bringToFront();
+            if(TopSetTargetBtn!=null) TopSetTargetBtn.bringToFront();
         }
         else
         {
-            if(TopSetTargetBtn.getVisibility() != View.INVISIBLE) TopSetTargetBtn.setVisibility(View.INVISIBLE);
+            if(TopSetTargetBtn.getVisibility() != View.INVISIBLE && TopSetTargetBtn!=null) TopSetTargetBtn.setVisibility(View.INVISIBLE);
         }
         return true;
     }
@@ -769,10 +784,14 @@ public class MainActivity extends WpadActivity {
             else TopManualBtn.setVisibility(View.INVISIBLE);
             ViewRegistration(TopLayout, TopManualBtn, marginLeft, 0);
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] setManualBtnVisible(boolean bEnable)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -808,10 +827,14 @@ public class MainActivity extends WpadActivity {
                 return false;
             }
         }
-        catch (Exception ex)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception ex)
         {
             Log.e(TAG, "[getManualUse] - Exception !!!");
-            ex.printStackTrace();
+            //ex.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, ex);
         }
 
         return false;
@@ -842,9 +865,14 @@ public class MainActivity extends WpadActivity {
                 Log.d(TAG, "[StartManual] - ret : " + ret);
                 return ret;
             }
+            catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+                return false;
+            }
             catch (Exception ex)
             {
-                ex.printStackTrace();
+                //ex.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, ex);
                 return false;
             }
         }
@@ -874,9 +902,14 @@ public class MainActivity extends WpadActivity {
                 startActivityForResult(intent, 0);
                 return true;
             }
+            catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+                return false;
+            }
             catch (Exception exc)
             {
-                exc.printStackTrace();
+                //exc.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, exc);
                 return false;
             }
 
@@ -888,10 +921,14 @@ public class MainActivity extends WpadActivity {
         try
         {
             mCurrentManualScreenId = -1;
-        } catch (Exception e)
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] resetCurrentManualScreenID()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -906,10 +943,14 @@ public class MainActivity extends WpadActivity {
                 mManualActivity.finish();
             }
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] FinishManualActivity()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -993,6 +1034,9 @@ public class MainActivity extends WpadActivity {
                     finish();
                 }
             }
+            catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
             catch (Exception e)
             {
                 Log.e(TAG, "[Exception Error] [onActivityResult] - data.getExtras().get");
@@ -1122,10 +1166,15 @@ public class MainActivity extends WpadActivity {
                     return false;
             }
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return false;
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[ExceptionError] - setChangeScreen->Screen Create : " + e);
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return false;
         }
 
@@ -1213,9 +1262,13 @@ public class MainActivity extends WpadActivity {
                 }
             }
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
 
         //Log.i(TAG, "[OpenMenuLayout] - ChooseChild = " + ChooseChild);
@@ -1551,9 +1604,13 @@ public class MainActivity extends WpadActivity {
             }
             for (int i = 0; i < retRoomNameList.length; i++) DebugLogOutput("[getRoomNamefromDB] retRoomNameList[" + i + "] = " + retRoomNameList[i]);
             return retRoomNameList;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] getRoomNamefromDB()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
         return null;
     }
@@ -1599,10 +1656,14 @@ public class MainActivity extends WpadActivity {
             }
 
             return RoomNameList;
-        } catch (Exception e)
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[DB_GetRoomName] [ExceptionError] : " + e);
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
 
         return null;
@@ -1648,9 +1709,13 @@ public class MainActivity extends WpadActivity {
             filter.addAction("WALLPAD_DIAL_GLOBALSCREEN_TOUCH");
             registerReceiver(mWallPadJogBR, filter);
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -1752,10 +1817,15 @@ public class MainActivity extends WpadActivity {
             intent.putExtra("keycode",code);
             getContext().sendBroadcast(intent);
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[setSendEventBR] - [Exception Error] code:" + code);
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -100;
         }
         return 0;
@@ -1775,9 +1845,13 @@ public class MainActivity extends WpadActivity {
             data.closeDB();
             Log.d(TAG, "[GetEasyModeUXUse] bSupport [" + bSupport + "], bUse [" + bUse + "]");
             return bSupport & bUse;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] GetEasyModeUXUse()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
         return false;
     }
@@ -1798,9 +1872,14 @@ public class MainActivity extends WpadActivity {
 
             Log.d(TAG, "[getIntegratedPowerCtrllerType] nIntegratedPowerCtrller [" + nIntegratedPowerCtrller + "]");
             return nIntegratedPowerCtrller;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return WallpadDeviceSet.POWERCONTROLLER_TYPE_NONE;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] getIntegratedPowerCtrllerType()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return WallpadDeviceSet.POWERCONTROLLER_TYPE_NONE;
         }
     }

+ 19 - 5
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/ManualActivity.java

@@ -15,6 +15,7 @@ import android.widget.RelativeLayout;
 import com.artncore.WallPadDataMgr.WallpadDeviceSet;
 import com.artncore.WallPadDataMgr.WallpadStatusData;
 import com.artncore.wallpadapi.WallPadAPI;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadenergyctrl.declare.Common;
 import kr.co.icontrols.wallpadenergyctrl.declare.ID;
@@ -116,7 +117,10 @@ public class ManualActivity extends WpadActivity {
         {
             wdb = new WallpadStatusData(this);
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Error] - WallpadStatusData Create : " + e);
         }
@@ -305,10 +309,16 @@ public class ManualActivity extends WpadActivity {
                     break;
             }
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            mCurrentScreenId = -1;
+            return false;
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] - setChangeScreen->Screen Create: " + e.toString());
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             mCurrentScreenId = -1;
             return false;
         }
@@ -370,9 +380,13 @@ public class ManualActivity extends WpadActivity {
             data.closeDB();
             Log.d(TAG, "[GetEasyModeUXUse] bSupport [" + bSupport + "], bUse [" + bUse + "]");
             return bSupport & bUse;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] GetEasyModeUXUse()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
         return false;
     }

+ 13 - 4
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/PopupActivity.java

@@ -33,7 +33,7 @@ import kr.co.icontrols.wallpadenergyctrl.screen.smart_distribution.PopupSmartDis
 import kr.co.icontrols.wallpadenergyctrl.screen.smart_distribution.PopupSmartLightRoom;
 import kr.co.icontrols.wallpadsupport.WpadActivity;
 import kr.co.icontrols.wallpadsupport.WpadScale;
-
+import com.util.LogUtil;
 /**
  * @description
  * 월패드 [설정화면] 팝업화면 관리자 이다.<br>
@@ -224,7 +224,10 @@ public class PopupActivity extends WpadActivity
         }
 
         try { wdb = new WallpadStatusData(this); }
-        catch(Exception e) { Log.e(TAG, "[ExceptionError] - onCreate->WallpadStatusData Create : " + e); }
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) { Log.e(TAG, "[ExceptionError] - onCreate->WallpadStatusData Create : " + e); }
 
         // 4. Layout registration
         DebugLogOutput("[Create] - Step4 : Layout registration");
@@ -461,10 +464,16 @@ public class PopupActivity extends WpadActivity
                     return false;
             }
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            mCurrentScreenId = -1;
+            return false;
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[ExceptionError] - setChangeScreen->Screen Create : " + e);
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             mCurrentScreenId = -1;
             return false;
         }

+ 8 - 3
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/declare/Common.java

@@ -2,7 +2,7 @@ package kr.co.icontrols.wallpadenergyctrl.declare;
 
 import android.util.Log;
 import com.artncore.WallPadDataMgr.WallpadSalesSampleData;
-
+import com.util.LogUtil;
 import android.content.Context;
 import android.util.Log;
 
@@ -119,6 +119,7 @@ public final class Common
         public final static int     _24                     = 24;
         /** 26 기본 사이즈 (OLD:12pt) */
         public final static int     _26_DEFAULT             = 26;
+        public final static int     _28                     = 28;
         /** 30 팝업 알람 설명 (OLD:14pt) */
         public final static int     _30                     = 30;
         /** 32 (OLD:15pt) */
@@ -276,10 +277,14 @@ public final class Common
 
             if(mode == 1) return true;
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", "", re);
+        }
+		catch (Exception e)
         {
             Log.e("Common", "[ExceptionError] - GetDeviceSampleMode");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", "", e);
         }
 
         return false;

+ 13 - 4
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/declare/TransactionDisplay.java

@@ -24,6 +24,7 @@ import android.util.Log;
 import android.view.Gravity;
 import android.widget.RelativeLayout;
 
+import com.util.LogUtil;
 /**
  * @description
  * 제어기기 통신성공률을 화면에 표시할 공통사항이 담긴 클래스 이다<br>
@@ -181,10 +182,14 @@ public class TransactionDisplay
                          mDeviceAPI.TRInfo.totalFail,
                          mDeviceAPI.TRInfo.GetSuccessRate(true));
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Refresh] - [Exception Error] Acc");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
         
         try
@@ -194,10 +199,14 @@ public class TransactionDisplay
                             mDeviceAPI.TRInfo.RecentFail,
                             mDeviceAPI.TRInfo.GetSuccessRate(false));
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Refresh] - [Exception Error] Recent");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
     

+ 10 - 6
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/imap/iMAPEnergyCostTable.java

@@ -82,13 +82,17 @@ public class iMAPEnergyCostTable extends WallPadiMAPClient{
             {
                 if (result.equalsIgnoreCase("ok"))
                 {
-                    if ((GetAttributeVal(0, "name").equalsIgnoreCase("energy_cost_table")) && (GetAttributeVal(0, "type").equalsIgnoreCase("reply")))
+                    String name = GetAttributeVal(0, "name");
+                    String type = GetAttributeVal(0, "type");
+                    if ((name !=null && name.equalsIgnoreCase("energy_cost_table")) && (type!=null && type.equalsIgnoreCase("reply")))
                     {
                         SetItem("source");
-                        
-                        if ((GetAttributeVal(0, "name").equalsIgnoreCase("home") == true) && 
-                                (GetAttributeVal(0, "id_high").equalsIgnoreCase(myDong) == true) &&
-                                (GetAttributeVal(0, "id_low").equalsIgnoreCase(myHo) == true))
+                        String home = GetAttributeVal(0, "name") ;
+                        String id_high = GetAttributeVal(0, "id_high");
+                        String id_low = GetAttributeVal(0, "id_low");
+                        if ((home!=null && home.equalsIgnoreCase("home") == true) &&
+                                (id_high!=null && id_high.equalsIgnoreCase(myDong) == true) &&
+                                (id_low!=null && id_low.equalsIgnoreCase(myHo) == true))
                         {
                             Proc.ProcSuccess();   
                             return;
@@ -100,7 +104,7 @@ public class iMAPEnergyCostTable extends WallPadiMAPClient{
         }     
         else
         {
-            Proc.ProcError();
+            if(Proc!=null) Proc.ProcError();
         }
     }
     protected void ProcError()

+ 33 - 9
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/imap/iMAPEnergyServer_SetGoalInfo.java

@@ -10,6 +10,7 @@ import com.artncore.wallpadapi.EnergyModuleAPI;
 import com.artncore.wallpadapi.WallPadAPI;
 import com.artncore.wallpadimap.RetProci;
 import com.artncore.wallpadimap.WallPadiMAPClient;
+import com.util.LogUtil;
 
 public class iMAPEnergyServer_SetGoalInfo extends WallPadiMAPClient
 {
@@ -84,9 +85,15 @@ public class iMAPEnergyServer_SetGoalInfo extends WallPadiMAPClient
         {
             tempRet = DBMGR.GetRemoteMetering_BaseDateType();
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            tempRet = false;
+            DBMGR.insertWallPADDB(WallpadStatusData.REMOTE_METERING_BASE_DATE_LASTDAY_USE, WallpadStatusData.REMOTE_METERING_BASE_DATE_LASTDAY_USE_DEFAULT);
+        }
+		catch (Exception e)
         {            
-            e.printStackTrace(); 
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             tempRet = false;
             DBMGR.insertWallPADDB(WallpadStatusData.REMOTE_METERING_BASE_DATE_LASTDAY_USE, WallpadStatusData.REMOTE_METERING_BASE_DATE_LASTDAY_USE_DEFAULT);
             //return;
@@ -106,9 +113,15 @@ public class iMAPEnergyServer_SetGoalInfo extends WallPadiMAPClient
         {
             tempRet2 = DBMGR.GetRemoteMetering_Alarm();
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            tempRet2 = false;
+            DBMGR.insertWallPADDB(WallpadStatusData.REMOTE_METERING_ALARM_USE, WallpadStatusData.REMOTE_METERING_ALARM_USE_DEFAULT);
+        }
+		catch (Exception e)
         {            
-            e.printStackTrace(); 
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             tempRet2 = false;
             DBMGR.insertWallPADDB(WallpadStatusData.REMOTE_METERING_ALARM_USE, WallpadStatusData.REMOTE_METERING_ALARM_USE_DEFAULT);
             //return;
@@ -179,7 +192,9 @@ public class iMAPEnergyServer_SetGoalInfo extends WallPadiMAPClient
             {
                 if (result.equalsIgnoreCase("ok"))
                 {
-                    if ((GetAttributeVal(0, "name").equalsIgnoreCase("energy_info_set")) && (GetAttributeVal(0, "type").equalsIgnoreCase("reply")))
+                    String name = GetAttributeVal(0, "name");
+                    String type = GetAttributeVal(0, "type");
+                    if ((name!=null && name.equalsIgnoreCase("energy_info_set")) && (type!=null && type.equalsIgnoreCase("reply")))
                     {
                         Log.d(TAG, "Reply is Ok");
                         Proc.ProcSuccess();
@@ -193,7 +208,7 @@ public class iMAPEnergyServer_SetGoalInfo extends WallPadiMAPClient
         else
         {
             Log.d(TAG, "Reply is Fail");
-            Proc.ProcError();
+            if(Proc!=null) Proc.ProcError();
         }
     }
 
@@ -249,9 +264,13 @@ public class iMAPEnergyServer_SetGoalInfo extends WallPadiMAPClient
 
             }
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
     
@@ -284,9 +303,14 @@ public class iMAPEnergyServer_SetGoalInfo extends WallPadiMAPClient
                     mNumberOfEnergy = 5;
                 }
             }
+            catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+                mNumberOfEnergy = 5;
+            }
             catch (Exception e)
             {
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
                 mNumberOfEnergy = 5;
             }
         }

+ 11 - 7
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/imap/iMAPRemotemeter.java

@@ -220,19 +220,23 @@ public class iMAPRemotemeter extends WallPadiMAPClient{
             String result = GetAttributeVal(0, "result");
             if (result != null) {
                 if (result.equalsIgnoreCase("ok")) {
-                    if ((GetAttributeVal(0, "name").equalsIgnoreCase("get_ems_metering"))
-                            && (GetAttributeVal(0, "type").equalsIgnoreCase("reply"))) {
+                    String name = GetAttributeVal(0, "name");
+                    String type = GetAttributeVal(0, "type");
+                    if ((name!=null && name.equalsIgnoreCase("get_ems_metering"))
+                            && (type!=null && type.equalsIgnoreCase("reply"))) {
                         if (SetItem("guidemap") == 1) {
-                            if (isDistinguishYear_String.equalsIgnoreCase("year")) {
-                                if (GetAttributeVal(0, "distinguish").equalsIgnoreCase(
+                            if (isDistinguishYear_String!=null && isDistinguishYear_String.equalsIgnoreCase("year")) {
+                                String distinguish = GetAttributeVal(0, "distinguish");
+                                if (distinguish!=null && distinguish.equalsIgnoreCase(
                                         "year")) {
                                     if (SetItem("valuelist") > 0) {
                                         Proc.ProcSuccess();
                                         return;
                                     }
                                 }
-                            } else if (isDistinguishYear_String.equalsIgnoreCase("month")) {
-                                if (GetAttributeVal(0, "distinguish").equalsIgnoreCase(
+                            } else if (isDistinguishYear_String!=null && isDistinguishYear_String.equalsIgnoreCase("month")) {
+                                String distinguish = GetAttributeVal(0, "distinguish");
+                                if (distinguish!=null && distinguish.equalsIgnoreCase(
                                         "month")) {
                                     if (SetItem("valuelist") > 0) {
                                         Proc.ProcSuccess();
@@ -245,7 +249,7 @@ public class iMAPRemotemeter extends WallPadiMAPClient{
                 }
             } 
         }
-        Proc.ProcError();
+        if(Proc!=null) Proc.ProcError();
 
     }
     @Override

+ 13 - 5
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/imap/iMAPRemotemeterDay.java

@@ -9,6 +9,7 @@ import com.artncore.WallPadDataMgr.wallpaddbmgr.AddressSet;
 //import com.artncore.wallpadapi.APIErrorCode;
 import com.artncore.wallpadimap.RetProci;
 import com.artncore.wallpadimap.WallPadiMAPClient;
+import com.util.LogUtil;
 
 public class iMAPRemotemeterDay extends WallPadiMAPClient{
     
@@ -133,11 +134,14 @@ public class iMAPRemotemeterDay extends WallPadiMAPClient{
             {
                 if (result.equalsIgnoreCase("ok"))
                 {
-                    if ((GetAttributeVal(0, "name").equalsIgnoreCase("get_energy_remote_usage")) && (GetAttributeVal(0, "type").equalsIgnoreCase("reply")))
+                    String name = GetAttributeVal(0, "name");
+                    String type = GetAttributeVal(0, "type");
+                    if ((name!=null && name.equalsIgnoreCase("get_energy_remote_usage")) && (type!=null && type.equalsIgnoreCase("reply")))
                     {
                         if (SetItem("guidemap") == 1)
                         {
-                            if (GetAttributeVal(0, "distinguish").equalsIgnoreCase("day"))
+                            String day = GetAttributeVal(0, "distinguish");
+                            if (day!=null && day.equalsIgnoreCase("day"))
                             {
                                 if (SetItem("valuelist") > 0)
                                 {
@@ -151,7 +155,7 @@ public class iMAPRemotemeterDay extends WallPadiMAPClient{
                 }
             }
         }
-        Proc.ProcError();
+        if(Proc!=null) Proc.ProcError();
 
     }
     @Override
@@ -204,9 +208,13 @@ public class iMAPRemotemeterDay extends WallPadiMAPClient{
 
             }
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 276 - 198
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/IcEnergyMgrScreen.java


+ 45 - 14
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/RealTimeMeterMainScreen.java

@@ -30,6 +30,7 @@ import kr.co.icontrols.wallpadenergyctrl.R;
 import kr.co.icontrols.wallpadenergyctrl.declare.*;
 import kr.co.icontrols.wallpadsupport.*;
 import kr.co.icontrols.wallpadsupport.WpadImageView.TOUCH_KIND;
+import com.util.LogUtil;
 
 
 /**
@@ -314,8 +315,8 @@ public class RealTimeMeterMainScreen extends WpadScreen
                 CalorieText.setText(str);
                 ViewMove(CalorieText, Common.CtrlMarginLEFT(TextLeft), Common.CtrlMarginTOP(TextTop));
                 
-                CalorieUnit1.setText("MWh");
-                CalorieUnit2.setText("㎥/h");
+                if(CalorieUnit1!=null) CalorieUnit1.setText("MWh");
+                if(CalorieUnit2!=null) CalorieUnit2.setText("㎥/h");
                 
                 ViewMove(CalorieUnit1, Common.CtrlMarginLEFT(UnitLeft), Common.CtrlMarginTOP(UnitTop));
                 ViewMove(CalorieUnit2, Common.CtrlMarginLEFT(UnitLeft), Common.CtrlMarginTOP(UnitTop+25));
@@ -346,11 +347,16 @@ public class RealTimeMeterMainScreen extends WpadScreen
         {
             str = String.format("%.0f", value);
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+            return "0";
+        }
+		catch (Exception  e)
         {
             Log.e(TAG, "[Convter1_DoubleTOStr] - [Exception Error] ");
             Log.e(TAG, "[Convter1_DoubleTOStr] - " + e.toString());
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return "0";
         }
         return str;
@@ -381,11 +387,16 @@ public class RealTimeMeterMainScreen extends WpadScreen
     	        else break;
     	    }
 	    }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+            return "0";
+        }
+		catch (Exception  e)
         {
             Log.e(TAG, "[Convter2_DoubleTOStr] - [Exception Error] ");
             Log.e(TAG, "[Convter2_DoubleTOStr] - " + e.toString());
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return "0";
         }
 	    
@@ -423,11 +434,16 @@ public class RealTimeMeterMainScreen extends WpadScreen
         {
             realTimeMeterAPI = wpapi.Get_RealTimeMeterController();
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+            return -100;
+        }
+		catch (Exception  e)
         {
             Log.e(TAG, "[Device_ApiLoad] - [Exception Error] wpapi.Get_RealTimeMeterController");
             Log.e(TAG, "[Device_ApiLoad] - " + e.toString());
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -100;
         }
         if(realTimeMeterAPI == null)
@@ -467,11 +483,16 @@ public class RealTimeMeterMainScreen extends WpadScreen
                 realTimeMeterAPI.regChangedBR(BR_NAME);
                 //DebugLogOutput("[Device_BrRegistration] - regChangedBR END");
             }
-            catch(Exception e)
+            catch (RuntimeException re) {
+                Log.e(TAG, "exception : " + re );
+                return -101;
+            }
+            catch (Exception  e)
             {
                 Log.e(TAG, "[Device_BrRegistration] - [Exception Error] realTimeMeterAPI.regChangedBR");
                 Log.e(TAG, "[Device_BrRegistration] - " + e.toString());
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
                 return -101;
             }
             super.addBrActionFilter(BR_NAME);
@@ -484,11 +505,16 @@ public class RealTimeMeterMainScreen extends WpadScreen
                 realTimeMeterAPI.unregChangedBR(BR_NAME);
                 //DebugLogOutput("[Device_BrRegistration] - unregChangedBR END");
             }
-            catch(Exception e)
+            catch (RuntimeException re) {
+                Log.e(TAG, "exception : " + re );
+                return -102;
+            }
+            catch (Exception  e)
             {
                 Log.e(TAG, "[Device_BrRegistration] - [Exception Error] realTimeMeterAPI.unregChangedBR");
                 Log.e(TAG, "[Device_BrRegistration] - " + e.toString());
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
                 return -102;
             }
             super.removeBrActionFilter(BR_NAME);            
@@ -524,10 +550,15 @@ public class RealTimeMeterMainScreen extends WpadScreen
                 return -2;
             }
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+            return -100;
+        }
+		catch (Exception  e)
         {
             Log.e(TAG, "[Device_Update] - [Exception Error] remoteMeterApi.Refresh(" + real + ")");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -100;
         }
         

+ 14 - 5
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/RemoteMeterCostTableScreen.java

@@ -6,6 +6,7 @@ import java.util.ArrayList;
 import com.artncore.WallPadDataMgr.WallpadDeviceSet;
 import com.artncore.wallpadapi.WallPadAPI;
 import com.artncore.wallpadimap.RetProci;
+import com.util.LogUtil;
 
 import android.content.Context;
 import android.graphics.Color;
@@ -597,9 +598,13 @@ public class RemoteMeterCostTableScreen extends WpadScreen
 
             });
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re );
+        }
+		catch (Exception  e)
         {
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -827,9 +832,13 @@ public class RemoteMeterCostTableScreen extends WpadScreen
                     mNumberOfEnergy = 5;
                 }
             }
-            catch(Exception e)
-            {
-                e.printStackTrace();
+            catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+                mNumberOfEnergy = 5;
+            }
+            catch (Exception  e) {
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
                 mNumberOfEnergy = 5;
             }
         }

+ 41 - 19
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/RemoteMeterMainScreen.java

@@ -40,7 +40,7 @@ import kr.co.icontrols.wallpadsupport.WpadImageView.TOUCH_KIND;
 import kr.co.icontrols.wallpadsupport.WpadSound.SND;
 
 import static kr.co.icontrols.wallpadenergyctrl.declare.Common.fontsize._20;
-
+import com.util.LogUtil;
 public class RemoteMeterMainScreen extends WpadScreen{
 
     // [Define]
@@ -462,7 +462,7 @@ public class RemoteMeterMainScreen extends WpadScreen{
 						for (int i = 0; i < mNumberOfEnergy; i++)
 						{
 							monthTableClass[i].Goal = DBMGR.GetRemoteMeteringTargetValue(i);
-							Show_MonthTable_Item_Goal_Text[i].setText(monthTableClass[i].Goal);
+							if(Show_MonthTable_Item_Goal_Text[i]!=null) Show_MonthTable_Item_Goal_Text[i].setText(monthTableClass[i].Goal);
 						}
 						DBMGR.closeDB();
 					}
@@ -1430,9 +1430,13 @@ public class RemoteMeterMainScreen extends WpadScreen{
 					{
 						tempInt = Integer.parseInt(monthTableClass[i].Price);
 					}
-					catch (Exception e)
+					catch (RuntimeException re) {
+						Log.e(TAG, "exception : " + re );
+					}
+					catch (Exception  e)
 					{
-						e.printStackTrace();
+						//e.printStackTrace();
+            			LogUtil.errorLogInfo("", TAG, e);
 					}
 
 					tempString = String.format("%,d", tempInt);
@@ -1445,19 +1449,19 @@ public class RemoteMeterMainScreen extends WpadScreen{
 			ViewRegistration(getLayout(), Show_MonthTable_Item_Use_Text[i],
 					Common.ImgPosion.GetX(362),
 					Common.ImgPosion.GetY(293+(i*Margin_y)+TempMargin_y_ForEnergyNum2));
-			Show_MonthTable_Item_Use_Text[i].setText(tempMonthItem);
+			if(Show_MonthTable_Item_Use_Text[i]!=null) Show_MonthTable_Item_Use_Text[i].setText(tempMonthItem);
 
 			Show_MonthTable_Item_Rank_Text[i] = new WpadTextView(getContext(), false, 273, Margin_x, Gravity.CENTER, Color.WHITE, Common.fontsize._26_DEFAULT, false, ID.RemoteMeterMainScreenID.text.TEXT_INFO);
 			ViewRegistration(getLayout(), Show_MonthTable_Item_Rank_Text[i],
 					Common.ImgPosion.GetX(637),
 					Common.ImgPosion.GetY(293+(i*Margin_y)+TempMargin_y_ForEnergyNum2));
-			Show_MonthTable_Item_Rank_Text[i].setText(monthTableClass[i].Rank);
+			if(Show_MonthTable_Item_Rank_Text[i]!=null) Show_MonthTable_Item_Rank_Text[i].setText(monthTableClass[i].Rank);
 
 			Show_MonthTable_Item_Goal_Text[i] = new WpadTextView(getContext(), false, 273, Margin_x, Gravity.CENTER, Color.WHITE, Common.fontsize._26_DEFAULT, false, ID.RemoteMeterMainScreenID.text.TEXT_INFO);
 			ViewRegistration(getLayout(), Show_MonthTable_Item_Goal_Text[i],
 					Common.ImgPosion.GetX(912),
 					Common.ImgPosion.GetY(293+(i*Margin_y)+TempMargin_y_ForEnergyNum2));
-			Show_MonthTable_Item_Goal_Text[i].setText(monthTableClass[i].Goal);
+			if(Show_MonthTable_Item_Goal_Text[i]!=null) Show_MonthTable_Item_Goal_Text[i].setText(monthTableClass[i].Goal);
 		}
 
 	}
@@ -1529,7 +1533,7 @@ public class RemoteMeterMainScreen extends WpadScreen{
 				ViewRegistration(getLayout(), Show_3Month_Legend_Text[i],
 						Common.ImgPosion.GetX(86),
 						Common.ImgPosion.GetY(726 - (i*80)));
-				Show_3Month_Legend_Text[i].setText(Integer.toString(i*MaxValue/5));
+				if(Show_3Month_Legend_Text[i]!=null) Show_3Month_Legend_Text[i].setText(Integer.toString(i*MaxValue/5));
 			}
 
 		//최근 3개월 비교일때 point_x : 274,378,570,674,866,970 (x축 위치)
@@ -1582,7 +1586,7 @@ public class RemoteMeterMainScreen extends WpadScreen{
 			ViewRegistration(getLayout(), mTextDay[i-1],
 					Common.ImgPosion.GetX(arraylist.get(i+mCal.get(Calendar.DAY_OF_WEEK)-1).getStart_X()), //요일(1~7, 1:일요일)
 					Common.ImgPosion.GetY(arraylist.get(i+mCal.get(Calendar.DAY_OF_WEEK)-1).getStart_Y()));
-			mTextDay[i-1].setText(Integer.toString(i));
+			if(mTextDay[i-1]!=null) mTextDay[i-1].setText(Integer.toString(i));
 
 			if(isEnergyServerUse == true)
 			{
@@ -1704,7 +1708,7 @@ public class RemoteMeterMainScreen extends WpadScreen{
 				ViewRegistration(getLayout(), Show_3Month_Legend_Text[i],
 						Common.ImgPosion.GetX(86),
 						Common.ImgPosion.GetY(726 - (i*80)));
-				Show_3Month_Legend_Text[i].setText(Integer.toString(i*MaxValue/5));
+				if(Show_3Month_Legend_Text[i]!=null) Show_3Month_Legend_Text[i].setText(Integer.toString(i*MaxValue/5));
 			}
 
 			//최근 3개월 비교일때 point_x : 274,378,570,674,866,970 (x축 위치)
@@ -2066,9 +2070,15 @@ public class RemoteMeterMainScreen extends WpadScreen{
 					mCostInfo_Enable = false;
 				}
 			}
-			catch(Exception e)
-			{
-				e.printStackTrace();
+			catch (RuntimeException re) {
+				Log.e(TAG, "exception : " + re );
+				mNumberOfEnergy = 5;
+				mEMS_Enable = true;
+			}
+			catch (Exception  e)
+				{
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				mNumberOfEnergy = 5;
 				mEMS_Enable = true;
 			}
@@ -2131,9 +2141,13 @@ public class RemoteMeterMainScreen extends WpadScreen{
 						DebugLogOutput("isEnergyServerUse = true;");
 					}
 				}
-				catch (Exception e)
+				catch (RuntimeException re) {
+					Log.e(TAG, "exception : " + re );
+				}
+				catch (Exception  e)
 				{
-					e.printStackTrace();
+					//e.printStackTrace();
+            		LogUtil.errorLogInfo("", TAG, e);
 				}
 			}
 			else
@@ -3073,9 +3087,17 @@ public class RemoteMeterMainScreen extends WpadScreen{
 				}
 			});
 		}
-		catch (Exception e)
+		catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+			if(DBMGR != null)
+			{
+				DBMGR.closeDB();
+			}
+        }
+		catch (Exception  e)
 		{
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			if(DBMGR != null)
 			{
 				DBMGR.closeDB();
@@ -3116,7 +3138,7 @@ public class RemoteMeterMainScreen extends WpadScreen{
 			ViewRegistration(getLayout(), Show_3Month_Legend_Text[i],
 					Common.ImgPosion.GetX(86),
 					Common.ImgPosion.GetY(726 - (i*80)));
-			Show_3Month_Legend_Text[i].setText(Integer.toString((int) (i*Temp_MaxValue/5)));
+			if(Show_3Month_Legend_Text[i]!=null) Show_3Month_Legend_Text[i].setText(Integer.toString((int) (i*Temp_MaxValue/5)));
 		}
 
 		//전년비 비교 or 최근 6개월 비교일때 375 시작으로 107씩 더하면 됨
@@ -3258,7 +3280,7 @@ public class RemoteMeterMainScreen extends WpadScreen{
 			ViewRegistration(getLayout(), Show_3Month_Legend_Text[i],
 					Common.ImgPosion.GetX(86),
 					Common.ImgPosion.GetY(726 - (i*80)));
-			Show_3Month_Legend_Text[i].setText(Integer.toString(i*Temp_MaxValue/5));
+			if(Show_3Month_Legend_Text[i]!=null) Show_3Month_Legend_Text[i].setText(Integer.toString(i*Temp_MaxValue/5));
 		}
 		if(mEMS_Enable == true)
 		{

+ 28 - 7
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/RemoteMeterPopupGraph.java

@@ -36,6 +36,7 @@ import kr.co.icontrols.wallpadenergyctrl.imap.iMAPRemotemeterDay;
 import kr.co.icontrols.wallpadsupport.*;
 import kr.co.icontrols.wallpadsupport.WpadImageView.TOUCH_KIND;
 import kr.co.icontrols.wallpadsupport.WpadSound.SND;
+import com.util.LogUtil;
 
 /*시간별 사용량 팝업입니다.*/
 @SuppressLint("ViewConstructor")
@@ -416,9 +417,13 @@ public class RemoteMeterPopupGraph extends WpadScreen
 	                        ShowGraph(tempRealCount/3);                     
 	                    }
 	                }
-	                catch(Exception e)
+	                catch (RuntimeException re) {
+                        Log.e(TAG, "exception : " + re );
+                    }
+                    catch (Exception  e)
 	                {
-	                    e.printStackTrace();
+	                    //e.printStackTrace();            
+                        LogUtil.errorLogInfo("", TAG, e);
 	                }	                
 	            }
 
@@ -437,9 +442,13 @@ public class RemoteMeterPopupGraph extends WpadScreen
 	            }
 	        });
 	    }
-	    catch(Exception e)
+	    catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception  e)
 	    {
-	        e.printStackTrace();
+	        //e.printStackTrace();            
+            LogUtil.errorLogInfo("", TAG, e);
 	    }
 	   
 	}
@@ -504,11 +513,16 @@ public class RemoteMeterPopupGraph extends WpadScreen
                 else break;
             }
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+            return "0";
+        }
+		catch (Exception  e)
         {
             Log.e(TAG, "[Convter2_DoubleTOStr] - [Exception Error] ");
             Log.e(TAG, "[Convter2_DoubleTOStr] - " + e.toString());
-            e.printStackTrace();
+            //e.printStackTrace();            
+            LogUtil.errorLogInfo("", TAG, e);
             return "0";
         }
         str.trim();
@@ -649,7 +663,14 @@ public class RemoteMeterPopupGraph extends WpadScreen
         
         public void ReDraw(int[][] LinePoint, int Count, int ColorKind)
         {
-            InputLinePoint = LinePoint;   
+            int[][] temp_LinePort = LinePoint;
+            if(temp_LinePort!=null)
+            {
+                InputLinePoint = new int[temp_LinePort.length][InputLinePoint[0].length];
+                for (int i=0; i<temp_LinePort.length; i++) {
+                    InputLinePoint[i] = temp_LinePort[i].clone();
+                }
+            }
             count = Count;
             colorKind = ColorKind;
             buildPoints();

+ 52 - 10
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/RemoteMeterPopupSetTargetScreen.java

@@ -29,6 +29,7 @@ import kr.co.icontrols.wallpadenergyctrl.declare.ID;
 import kr.co.icontrols.wallpadsupport.*;
 import kr.co.icontrols.wallpadsupport.WpadImageView.TOUCH_KIND;
 import kr.co.icontrols.wallpadsupport.WpadSound.SND;
+import com.util.LogUtil;
 
 /*목표량 설정 팝업입니다.*/
 @SuppressLint("ViewConstructor")
@@ -418,9 +419,21 @@ public class RemoteMeterPopupSetTargetScreen extends WpadScreen
                     boolean ret = DBMGR.SetRemoteMetering_Alarm(isAlarmUse);
                     DebugLogOutput("ret : "+ ret);                        
                 }
-                catch(Exception e)
-                {                    
-                    e.printStackTrace();
+                catch (RuntimeException re) {
+                    Log.e(TAG, "exception : " + re );
+                    if(isAlarmUse == true)
+                    {
+                        DBMGR.insertWallPADDB(WallpadStatusData.REMOTE_METERING_ALARM_USE, "true");
+                    }
+                    else
+                    {
+                        DBMGR.insertWallPADDB(WallpadStatusData.REMOTE_METERING_ALARM_USE, WallpadStatusData.REMOTE_METERING_ALARM_USE_DEFAULT);
+                    }
+                }
+                catch (Exception e)
+                {
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
                     if(isAlarmUse == true)
                     {
                         DBMGR.insertWallPADDB(WallpadStatusData.REMOTE_METERING_ALARM_USE, "true");
@@ -902,9 +915,14 @@ public class RemoteMeterPopupSetTargetScreen extends WpadScreen
         {
             isBaseDate_UseLastDay = DBMGR.GetRemoteMetering_BaseDateType();    
         }
+        catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+            DBMGR.insertWallPADDB(WallpadStatusData.REMOTE_METERING_BASE_DATE_LASTDAY_USE, WallpadStatusData.REMOTE_METERING_BASE_DATE_LASTDAY_USE_DEFAULT);
+        }
         catch(Exception e)
         {
-            e.printStackTrace();            
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             DBMGR.insertWallPADDB(WallpadStatusData.REMOTE_METERING_BASE_DATE_LASTDAY_USE, WallpadStatusData.REMOTE_METERING_BASE_DATE_LASTDAY_USE_DEFAULT);
             //return;
         }
@@ -973,9 +991,14 @@ public class RemoteMeterPopupSetTargetScreen extends WpadScreen
         {
             isBaseDate_UseLastDay = DBMGR.GetRemoteMetering_BaseDateType();    
         }
+        catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+            DBMGR.insertWallPADDB(WallpadStatusData.REMOTE_METERING_BASE_DATE_LASTDAY_USE, WallpadStatusData.REMOTE_METERING_BASE_DATE_LASTDAY_USE_DEFAULT);
+        }
         catch(Exception e)
         {
-            e.printStackTrace();            
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             DBMGR.insertWallPADDB(WallpadStatusData.REMOTE_METERING_BASE_DATE_LASTDAY_USE, WallpadStatusData.REMOTE_METERING_BASE_DATE_LASTDAY_USE_DEFAULT);
             //return;
         }        
@@ -1029,9 +1052,13 @@ public class RemoteMeterPopupSetTargetScreen extends WpadScreen
             tempInt = (getDBInt - 6) / 2;
             DebugLogOutput("tempInt - " + tempInt);
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e)
         {
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
         ShowNowAlarmTimeIndex = tempInt;
         DebugLogOutput("ShowNowAlarmTimeIndex - " + ShowNowAlarmTimeIndex);
@@ -1706,9 +1733,15 @@ public class RemoteMeterPopupSetTargetScreen extends WpadScreen
             {
                 isAlarmUse = DBMGR.GetRemoteMetering_Alarm();    
             }
+            catch (RuntimeException re) {
+                Log.e(TAG, "exception : " + re );
+                isAlarmUse = false;
+                DBMGR.insertWallPADDB(WallpadStatusData.REMOTE_METERING_ALARM_USE, WallpadStatusData.REMOTE_METERING_ALARM_USE_DEFAULT);
+            }
             catch(Exception e)
             {
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
                 isAlarmUse = false;
                 DBMGR.insertWallPADDB(WallpadStatusData.REMOTE_METERING_ALARM_USE, WallpadStatusData.REMOTE_METERING_ALARM_USE_DEFAULT);
             }
@@ -1770,9 +1803,13 @@ public class RemoteMeterPopupSetTargetScreen extends WpadScreen
                 }
                 
             }
+            catch (RuntimeException re) {
+                Log.e(TAG, "exception : " + re );
+            }
             catch (Exception e)
             {
-                e.printStackTrace();                
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
             }
         }
         else
@@ -1810,9 +1847,14 @@ public class RemoteMeterPopupSetTargetScreen extends WpadScreen
                     mNumberOfEnergy = 5;
                 }
             }
+            catch (RuntimeException re) {
+                Log.e(TAG, "exception : " + re );
+                mNumberOfEnergy = 5;
+            }
             catch (Exception e)
             {
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
                 mNumberOfEnergy = 5;
             }
         }

+ 131 - 38
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/ienergy/EachRoomEnergyDetailScreen.java

@@ -24,6 +24,7 @@ import com.artncore.wallpadapi.EnergyModuleAPI;
 import com.artncore.wallpadapi.RealTimeMeterAPI;
 import com.artncore.wallpadapi.WallPadAPI;
 import com.artncore.wallpadapi.WallPadDevAPI;
+import com.util.LogUtil;
 
 import android.annotation.SuppressLint;
 import android.content.Context;
@@ -862,7 +863,7 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 			int i = 0;
 			for(i = 0; i<mEnergyModuleData.length; i++)
 			{
-				if(mEnergyModuleData[i].Index == CH)
+				if(mEnergyModuleData[i]!=null && mEnergyModuleData[i].Index == CH)
 				{
 					if((i >= (CurrentPage - 1) * 5) && (i < (CurrentPage * 5)))
 					{
@@ -1130,10 +1131,15 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 					mRoomView[i].TitleText.setTextSize(0, Common.fontsize._22);
 				}
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				mRoomView[i] = null;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Exception Error] - [Create] roomView new : " + e.toString());
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				mRoomView[i] = null;
 			}
 		}
@@ -1574,10 +1580,14 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 				mEtcView.setETC_ElecData(EtcValue);
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Draw_Update] - [Exception Error] Etc Value Part");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 
 		// 에너지모듈
@@ -1609,8 +1619,12 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 									{
 										for(int circnt=0 ; circnt<mData.energyModule.Device[devidx].circuit.CircuitCount ; circnt++)
 										{
-											EtcValue = mData.energyModule.Device[devidx].circuit.NowPw[circnt];
-											mEtcView.ShowEnergyModuleData((int)((devidx*2) + circnt), EtcValue);
+											if(mData.energyModule.Device!=null && mData.energyModule.Device[devidx]!=null)
+											{
+												EtcValue = mData.energyModule.Device[devidx].circuit.NowPw[circnt];
+												mEtcView.ShowEnergyModuleData((int)((devidx*2) + circnt), EtcValue);
+											}
+
 										}
 									}
 								}
@@ -1619,10 +1633,14 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 					}
 				}
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Draw_Update] - [Exception Error] EnergyModule Draw Part");
-				e.printStackTrace();
+				//e.printStackTrace();
+           	 	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 
@@ -1675,10 +1693,14 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 					}
 				}
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Draw_Update] - [Exception Error] ENERGYMETER Part");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 
@@ -1722,7 +1744,10 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 					}
 				}
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Draw_Update] - [Exception Error] CUTOFFCONCENT Part");
 				e.printStackTrace();
@@ -1750,7 +1775,11 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 		if(mRoomView.length <= index) return;
 
 		mRoomView[index].setLightModeChange(changeMode);
-		if(changeMode == OVER) mRoomView[index].LightElecText.setText("과부하차단");
+		if(changeMode == OVER)
+		{
+			if(mRoomView[index]!=null && mRoomView[index].LightElecText!=null )
+				mRoomView[index].LightElecText.setText("과부하차단");
+		}
 	}
 
 	private void Draw_ConcentModeChange(int index, int changeMode)
@@ -1759,7 +1788,11 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 		if(mRoomView.length <= index) return;
 
 		mRoomView[index].setConcentModeChange(changeMode);
-		if(changeMode == OVER) mRoomView[index].ConcentElecText.setText("과부하차단");
+		if(changeMode == OVER)
+		{
+			if(mRoomView[index].ConcentElecText!=null)
+				mRoomView[index].ConcentElecText.setText("과부하차단");
+		}
 	}
 
 	// =================================================================================================
@@ -1796,10 +1829,15 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 			{
 				energyModuleAPI = wpapi.Get_EnergyModuleController();
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -100;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_ApiLoad] - [Exception Error] wpapi.Get_EnergyModuleController");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -100;
 			}
 			if(energyModuleAPI == null)
@@ -1819,10 +1857,15 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 			{
 				energyMeterAPI = wpapi.Get_EnergyMeterController();
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -100;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_ApiLoad] - [Exception Error] wpapi.Get_EnergyMeterController");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -100;
 			}
 			if(energyMeterAPI == null)
@@ -1842,10 +1885,15 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 			{
 				cutOffConcentAPI = wpapi.Get_CutOffConcentController();
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -100;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_ApiLoad] - [Exception Error] wpapi.Get_CutOffConcentController");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -100;
 			}
 			if(cutOffConcentAPI == null)
@@ -1865,10 +1913,15 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 			{
 				realTimeMeterAPI = wpapi.Get_RealTimeMeterController();
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -100;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_ApiLoad] - [Exception Error] wpapi.Get_RealTimeMeterController");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -100;
 			}
 			if(realTimeMeterAPI == null)
@@ -1950,10 +2003,15 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 		if(OnOff)
 		{
 			try { DevAPI.regChangedBR(BR_NAME); }
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -101;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_BrRegistration] - [Exception Error] DevAPI.regChangedBR (DevKind:" + DevKind + ")");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -101;
 			}
 			super.addBrActionFilter(BR_NAME);
@@ -1961,10 +2019,15 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 		else
 		{
 			try { DevAPI.unregChangedBR(BR_NAME); }
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -102;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_BrRegistration] - [Exception Error] DevAPI.unregChangedBR (DevKind:" + DevKind + ")");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -102;
 			}
 			super.removeBrActionFilter(BR_NAME);
@@ -2046,10 +2109,15 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 				return -2;
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -102;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_Update_EnergyModule] - [Exception Error] energyModuleAPI.Refresh (index:" + index + ", real:" + real + ")");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -102;
 		}
 
@@ -2116,10 +2184,15 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 				return -2;
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -102;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_Update_EnergyMeter] - [Exception Error] energyMeterAPI.Refresh (index:" + index + ", real:" + real + ")");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -102;
 		}
 
@@ -2185,10 +2258,15 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 				return -2;
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -102;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_Update_CutOffConcent] - [Exception Error] cutOffConcentAPI.Refresh (index:" + index + ", real:" + real + ")");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -102;
 		}
 
@@ -2255,10 +2333,15 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 				return -2;
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -102;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_Update_EnergyModule] - [Exception Error] energyModuleAPI.Refresh (real:" + real + ")");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -102;
 		}
 
@@ -2414,10 +2497,15 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 				return -10;
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -100;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_EnenrgyMeter_SetLightOnOff] - [Exception Error] energyMeterAPI.SetLightOnOff(" + String.format("0x%02X", RoomIndex) + ", 0xFF, " + OnOff + ")");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 
@@ -2469,10 +2557,15 @@ public class EachRoomEnergyDetailScreen extends WpadScreen
 				return -10;
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -100;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_EnenrgyMeter_SetConcentOnOff] - [Exception Error] energyMeterAPI.SetConcentOnOff(" + String.format("0x%02X", RoomIndex) + ", 0xFF, " + OnOff + ")");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 

+ 117 - 35
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/ienergy/EachRoomEnergyMainScreen.java

@@ -19,7 +19,7 @@ import com.artncore.wallpadapi.EnergyModuleAPI;
 import com.artncore.wallpadapi.RealTimeMeterAPI;
 import com.artncore.wallpadapi.WallPadAPI;
 import com.artncore.wallpadapi.WallPadDevAPI;
-
+import com.util.LogUtil;
 import android.annotation.SuppressLint;
 import android.content.Context;
 import android.content.Intent;
@@ -388,10 +388,15 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 					mRoomView[i].TitleText.setTextSize(0, Common.fontsize._22);
 				}
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				mRoomView[i] = null;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Exception Error] - [Create] roomView new : " + e.toString());
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				mRoomView[i] = null;
 			}
 		}
@@ -767,10 +772,14 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 				mEtcView.setElecData(EtcValue);
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Draw_Update] - [Exception Error] Etc Value Part");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 
 		// 에너지미터
@@ -796,10 +805,14 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 					}
 				}
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Draw_Update] - [Exception Error] ENERGYMETER Part");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 
@@ -824,10 +837,14 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 					else     { mConcentView.EnergyBtn.setButtonFrontImage(); mData.ConcentEnergyStatus = false; }
 				}
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Draw_Update] - [Exception Error] CUTOFFCONCENT Part");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 	}
@@ -880,10 +897,15 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 			{
 				energyModuleAPI = wpapi.Get_EnergyModuleController();
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -100;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_ApiLoad] - [Exception Error] wpapi.Get_EnergyModuleController");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -100;
 			}
 			if(energyModuleAPI == null)
@@ -903,10 +925,15 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 			{
 				energyMeterAPI = wpapi.Get_EnergyMeterController();
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -100;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_ApiLoad] - [Exception Error] wpapi.Get_EnergyMeterController");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -100;
 			}
 			if(energyMeterAPI == null)
@@ -926,10 +953,15 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 			{
 				cutOffConcentAPI = wpapi.Get_CutOffConcentController();
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -100;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_ApiLoad] - [Exception Error] wpapi.Get_CutOffConcentController");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -100;
 			}
 			if(cutOffConcentAPI == null)
@@ -949,10 +981,15 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 			{
 				realTimeMeterAPI = wpapi.Get_RealTimeMeterController();
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -100;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_ApiLoad] - [Exception Error] wpapi.Get_RealTimeMeterController");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -100;
 			}
 			if(realTimeMeterAPI == null)
@@ -1034,10 +1071,15 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 		if(OnOff)
 		{
 			try { DevAPI.regChangedBR(BR_NAME); }
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -101;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_BrRegistration] - [Exception Error] DevAPI.regChangedBR (DevKind:" + DevKind + ")");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -101;
 			}
 			super.addBrActionFilter(BR_NAME);
@@ -1045,10 +1087,15 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 		else
 		{
 			try { DevAPI.unregChangedBR(BR_NAME); }
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -102;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_BrRegistration] - [Exception Error] DevAPI.unregChangedBR (DevKind:" + DevKind + ")");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -102;
 			}
 			super.removeBrActionFilter(BR_NAME);
@@ -1130,10 +1177,15 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 				return -2;
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -102;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_Update_EnergyModule] - [Exception Error] energyModuleAPI.Refresh (index:" + index + ", real:" + real + ")");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -102;
 		}
 
@@ -1201,10 +1253,15 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 				return -2;
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -102;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_Update_EnergyMeter] - [Exception Error] energyMeterAPI.Refresh (index:" + index + ", real:" + real + ")");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -102;
 		}
 
@@ -1270,10 +1327,15 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 				return -2;
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -102;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_Update_CutOffConcent] - [Exception Error] cutOffConcentAPI.Refresh (index:" + index + ", real:" + real + ")");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -102;
 		}
 
@@ -1340,10 +1402,15 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 				return -2;
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -102;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_Update_EnergyModule] - [Exception Error] energyModuleAPI.Refresh (real:" + real + ")");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -102;
 		}
 
@@ -1408,10 +1475,15 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 				return -10;
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -100;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_CutOffConcent_SetModeChange] - [Exception Error] cutOffConcentAPI.SetModeChange(" + String.format("0x%02X", DeviceIdx) + ", 0, " + ChangeMode + ")");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 
@@ -1463,10 +1535,15 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 				return -10;
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -100;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_EnenrgyMeter_SetConcentCutoffMode] - [Exception Error] energyMeterAPI.SetConcentCutoffMode(" + String.format("0x%02X", RoomIndex) + ", 0, " + ChangeMode + ")");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 
@@ -1743,10 +1820,15 @@ public class EachRoomEnergyMainScreen extends WpadScreen
 			DebugLogOutput("SALES_SAMPLE_MODE_ROOM_NUMBER " + count);
 			return count;
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -10;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Exception Error] DB_GetSampleRoomNumber");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -10;
 		}
 	}

+ 22 - 6
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/ienergy/IEnergySampleData.java

@@ -10,6 +10,7 @@ package kr.co.icontrols.wallpadenergyctrl.screen.ienergy;
  */
 
 
+import com.util.LogUtil;
 import com.artncore.commons.DataClasses.CutOffConcent;
 import com.artncore.commons.DataClasses.EnergyMeter;
 import com.artncore.commons.DataClasses.EnergyModule;
@@ -162,9 +163,14 @@ public final class IEnergySampleData {
 
 			// Put Data
 			intent.putExtra(DATA_NAME, result);
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -100;
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Sample_DataMake] [ExceptionError] : " + e);
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 
@@ -335,9 +341,14 @@ public final class IEnergySampleData {
 			//////////////////////////////////////////////////////////////
 			if (RealTimeNowPw != null)
 				RealTimeNowPw[0] = Double.parseDouble(retData[index++]);
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -100;
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Sample_DataDefaultSetting] [Exception Error]");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 
@@ -482,9 +493,14 @@ public final class IEnergySampleData {
 			}
 
 			return 0;
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -100;
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Sample_DataDefaultSetting] [Exception Error]");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 	}

+ 13 - 4
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/manual/HEMS_MANUAL.java

@@ -9,6 +9,7 @@ import android.view.View;
 import android.widget.RelativeLayout;
 
 import com.artncore.wallpadapi.WallPadAPI;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadenergyctrl.R;
 import kr.co.icontrols.wallpadenergyctrl.declare.Common;
@@ -95,10 +96,14 @@ public class HEMS_MANUAL extends WpadScreen
                             "다를 수 있습니다.");
 
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] SettingMain_MANUAL !!!");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -123,10 +128,14 @@ public class HEMS_MANUAL extends WpadScreen
                 super.finish();
             }
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 }

+ 13 - 4
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/manual/RemoteMeter_MANUAL.java

@@ -8,6 +8,7 @@ import android.view.MotionEvent;
 import android.view.View;
 import android.widget.RelativeLayout;
 
+import com.util.LogUtil;
 import com.artncore.wallpadapi.WallPadAPI;
 
 import kr.co.icontrols.wallpadenergyctrl.MainActivity;
@@ -104,10 +105,14 @@ public class RemoteMeter_MANUAL extends WpadScreen
                     "[원격검침 화면] - 전년비");
 
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] SettingMain_MANUAL !!!");
-            e.printStackTrace();
+            //e.printStackTrace();            
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -132,10 +137,14 @@ public class RemoteMeter_MANUAL extends WpadScreen
                 super.finish();
             }
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
-            e.printStackTrace();
+            //e.printStackTrace();            
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 }

+ 17 - 7
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/manual/SmartConcentPop_MANUAL.java

@@ -12,10 +12,11 @@ import com.artncore.commons.Sdb_DataClasses;
 import com.artncore.commons.define;
 import com.artncore.wallpadapi.SdbAPI;
 import com.artncore.wallpadapi.WallPadAPI;
-
+import com.util.LogUtil;
 import kr.co.icontrols.wallpadenergyctrl.R;
 import kr.co.icontrols.wallpadenergyctrl.declare.Common;
 import kr.co.icontrols.wallpadenergyctrl.declare.ID;
+import kr.co.icontrols.wallpadenergyctrl.screen.smart_distribution.PopupSmartConcentRoom;
 import kr.co.icontrols.wallpadenergyctrl.screen.smart_distribution.SmartConcentScreen;
 import kr.co.icontrols.wallpadsupport.WpadImageView;
 import kr.co.icontrols.wallpadsupport.WpadScreen;
@@ -41,10 +42,11 @@ public class SmartConcentPop_MANUAL extends WpadScreen
         {
             Log.d(TAG, "[SmartConcentPop_MANUAL] =============== START ===============");
             mContext = context;
-            Log.i(TAG, "[SmartConcentPop_MANUAL] concentCount : " + concentCount);
 
+            Log.i(TAG, "[SmartConcentPop_MANUAL] concentCount : " + concentCount);
+            Log.i(TAG, "[SmartConcentPop_MANUAL] NowPage : " + PopupSmartConcentRoom.NowPage + ", TotalPage = " + PopupSmartConcentRoom.TotalPage);
             int change = 0;
-            if(concentCount == 1 ) change = 205;
+            if((PopupSmartConcentRoom.NowPage == PopupSmartConcentRoom.TotalPage) && (concentCount % 2 == 1)) change = 205;
 
             BACKGROUND = new WpadImageView(context, WpadImageView.TOUCH_KIND.BUTTON, 1280, 800, 0, 0, ID.MANUAL.SmartConcentPop_MANUAL.ELEMENT.IMAGE.BACKGROUND);
             ViewRegistration(layout, BACKGROUND, 0, 0);
@@ -97,10 +99,14 @@ public class SmartConcentPop_MANUAL extends WpadScreen
                                 );
             }
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] SettingMain_MANUAL !!!");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -125,10 +131,14 @@ public class SmartConcentPop_MANUAL extends WpadScreen
                 super.finish();
             }
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 }

+ 13 - 4
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/manual/SmartConcent_MANUAL.java

@@ -9,6 +9,7 @@ import android.view.View;
 import android.widget.RelativeLayout;
 
 import com.artncore.wallpadapi.WallPadAPI;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadenergyctrl.R;
 import kr.co.icontrols.wallpadenergyctrl.declare.Common;
@@ -85,10 +86,14 @@ public class SmartConcent_MANUAL extends WpadScreen
                                 "선택할 수 있습니다.");
             }
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] SmartConcent_MANUAL !!!");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -113,10 +118,14 @@ public class SmartConcent_MANUAL extends WpadScreen
                 super.finish();
             }
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 }

+ 13 - 4
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/manual/SmartDist_MANUAL.java

@@ -9,6 +9,7 @@ import android.view.View;
 import android.widget.RelativeLayout;
 
 import com.artncore.wallpadapi.WallPadAPI;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadenergyctrl.ManualActivity;
 import kr.co.icontrols.wallpadenergyctrl.R;
@@ -96,10 +97,14 @@ public class SmartDist_MANUAL extends WpadScreen
                             "선택할 수 있습니다.");
 
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] SettingMain_MANUAL !!!");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -124,10 +129,14 @@ public class SmartDist_MANUAL extends WpadScreen
                 super.finish();
             }
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 }

+ 13 - 4
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/manual/SmartLightPop_MANUAL.java

@@ -9,6 +9,7 @@ import android.view.View;
 import android.widget.RelativeLayout;
 
 import com.artncore.wallpadapi.WallPadAPI;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadenergyctrl.R;
 import kr.co.icontrols.wallpadenergyctrl.declare.Common;
@@ -82,10 +83,14 @@ public class SmartLightPop_MANUAL extends WpadScreen
                             "(ON / OFF)");
 
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] SettingMain_MANUAL !!!");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -110,10 +115,14 @@ public class SmartLightPop_MANUAL extends WpadScreen
                 super.finish();
             }
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 }

+ 13 - 4
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/manual/SmartLight_MANUAL.java

@@ -9,6 +9,7 @@ import android.view.View;
 import android.widget.RelativeLayout;
 
 import com.artncore.wallpadapi.WallPadAPI;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadenergyctrl.R;
 import kr.co.icontrols.wallpadenergyctrl.declare.Common;
@@ -100,10 +101,14 @@ public class SmartLight_MANUAL extends WpadScreen
                             "선택할 수 있습니다.");
 
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] SettingMain_MANUAL !!!");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -128,10 +133,14 @@ public class SmartLight_MANUAL extends WpadScreen
                 super.finish();
             }
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 }

+ 73 - 24
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/smart_distribution/PopupSmartConcentRoom.java

@@ -18,6 +18,7 @@ import com.artncore.commons.define;
 import com.artncore.wallpadapi.SdbAPI;
 import com.artncore.wallpadapi.WallPadAPI;
 import com.artncore.wallpadapi.WallPadDevAPI;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadenergyctrl.PopupActivity;
 import kr.co.icontrols.wallpadenergyctrl.R;
@@ -61,8 +62,8 @@ public class PopupSmartConcentRoom extends WpadScreen
 
 	public int AllConcentCount = 0;
 	private int AllEmCount = 0;
-	private int NowPage = 1;
-	private int TotalPage = 1;
+	public static int NowPage = 1;
+	public static int TotalPage = 1;
 
 	int OPERATION_MODE;
 	int [][][] ConcentPositionArr = new int [][][]
@@ -752,9 +753,13 @@ public class PopupSmartConcentRoom extends WpadScreen
 							}
 						}
 					}
-					catch(Exception e)
+					catch (RuntimeException re) {
+						LogUtil.errorLogInfo("", TAG, re);
+					}
+					catch (Exception e)
 					{
-						e.printStackTrace();
+						//e.printStackTrace();
+            			LogUtil.errorLogInfo("", TAG, e);
 					}
 				}
 
@@ -838,9 +843,13 @@ public class PopupSmartConcentRoom extends WpadScreen
 						}
 					}
 				}
-				catch(Exception e)
+				catch (RuntimeException re) {
+					LogUtil.errorLogInfo("", TAG, re);
+				}
+				catch (Exception e)
 				{
-					e.printStackTrace();
+					//e.printStackTrace();
+            		LogUtil.errorLogInfo("", TAG, e);
 				}
 
 				Draw_Page(NowPage);
@@ -948,9 +957,13 @@ public class PopupSmartConcentRoom extends WpadScreen
 						}
 					}
 				}
-				catch(Exception e)
+				catch (RuntimeException re) {
+					LogUtil.errorLogInfo("", TAG, re);
+				}
+				catch (Exception e)
 				{
-					e.printStackTrace();
+					//e.printStackTrace();
+            		LogUtil.errorLogInfo("", TAG, e);
 				}
 
 				Draw_Page(NowPage);
@@ -1000,10 +1013,15 @@ public class PopupSmartConcentRoom extends WpadScreen
 		if(OnOff)
 		{
 			try { DevAPI.regChangedBR(BR_NAME); }
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -101;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_BrRegistration] - [Exception Error] DevAPI.regChangedBR (DevKind:" + DevKind + ")");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -101;
 			}
 			super.addBrActionFilter(BR_NAME);
@@ -1011,10 +1029,15 @@ public class PopupSmartConcentRoom extends WpadScreen
 		else
 		{
 			try { DevAPI.unregChangedBR(BR_NAME); }
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -102;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_BrRegistration] - [Exception Error] DevAPI.unregChangedBR (DevKind:" + DevKind + ")");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -102;
 			}
 			super.removeBrActionFilter(BR_NAME);
@@ -1048,10 +1071,15 @@ public class PopupSmartConcentRoom extends WpadScreen
 		try
 		{
 			sdbAPI = wpapi.Get_SdbController();
-		} catch (Exception e)
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -100;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_ApiLoad] - [Exception Error] wpapi.Get_SdbController");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 		if (sdbAPI == null)
@@ -1119,10 +1147,15 @@ public class PopupSmartConcentRoom extends WpadScreen
 
 			return 0;
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -102;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_Update] - [Exception Error] sdbAPI.Refresh (index:" + index);
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -102;
 		}
 	}
@@ -1174,10 +1207,14 @@ public class PopupSmartConcentRoom extends WpadScreen
 			}
 			Log.i(TAG, "[Draw_Init] - eachConcents len = " + eachConcents.length);
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Draw_Init] - Exception");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -1261,10 +1298,14 @@ public class PopupSmartConcentRoom extends WpadScreen
 							eachConcents[i].setCutoffConcentMode(Data.CutOffConcent.Mode);
 						}
 					}
-					catch(Exception e)
+					catch (RuntimeException re) {
+						LogUtil.errorLogInfo("", TAG, re);
+					}
+					catch (Exception e)
 					{
 						Log.e(TAG, "[Draw_Update] - Living Exception Error !!!");
-						e.printStackTrace();
+						//e.printStackTrace();
+            			LogUtil.errorLogInfo("", TAG, e);
 					}
 				}
 
@@ -1296,18 +1337,26 @@ public class PopupSmartConcentRoom extends WpadScreen
 							eachConcents[i].setCutoffConcentMode(Data.CutOffConcent.Mode);
 						}
 					}
-					catch(Exception e)
+					catch (RuntimeException re) {
+						LogUtil.errorLogInfo("", TAG, re);
+					}
+					catch (Exception e)
 					{
 						Log.e(TAG, "[Draw_Update] - Bed Exception Error !!!");
-						e.printStackTrace();
+						//e.printStackTrace();
+            			LogUtil.errorLogInfo("", TAG, e);
 					}
 				}
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Draw_Update] - ENERGY_METER Exception !!!");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 

+ 99 - 37
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/smart_distribution/PopupSmartLightRoom.java

@@ -15,6 +15,7 @@ import com.artncore.commons.Sdb_DataClasses.EnergyMeterClass;
 import com.artncore.commons.Sdb_DataClasses.LEDLIGHT_USAGE_CODE;
 import com.artncore.commons.Sdb_DataClasses.LivingEnergyMeterClass;
 import com.artncore.commons.define;
+import com.util.LogUtil;
 import com.artncore.wallpadapi.SdbAPI;
 import com.artncore.wallpadapi.SdbAPI.DEVICE_INDEX;
 import com.artncore.wallpadapi.Sdb_LivingRoomLightAPI;
@@ -82,6 +83,8 @@ public class PopupSmartLightRoom extends WpadScreen
 	String LIGHTNAME_INDIRIECT = "간접등";
 	String LIGHTNAME_HALLWAY = "복도등";
 
+	String DC_ELECTRICAL_ENERGY = "DC ";
+
 
 	private SdbAPI sdbAPI;
 	private Sdb_LivingRoomLightAPI sdbLivingRoomLightAPI;
@@ -359,8 +362,8 @@ public class PopupSmartLightRoom extends WpadScreen
 		WarningImage2 = new WpadImageView(context, WpadImageView.TOUCH_KIND.NONE, 569, 16, R.drawable.smartconcent_warning_ment2, 0, ID.SmartLightRoomPopUp.image.WARN_IMAGE2);
 		ViewRegistration(layout, WarningImage2, Common.PopupAlarmMarginLEFT(172), Common.PopupAlarmMarginTOP(757) );
 
-		ElecText = new WpadTextView(context, false, 170, 56, Gravity.CENTER, Color.WHITE, Common.fontsize._46, false, ID.SmartLightRoomPopUp.text.LIGHT_ELEC);
-		ViewRegistration(layout, ElecText, Common.PopupAlarmMarginLEFT(569), Common.PopupAlarmMarginTOP(568) );
+		ElecText = new WpadTextView(context, false, 190, 56, Gravity.CENTER, Color.WHITE, Common.fontsize._46, false, ID.SmartLightRoomPopUp.text.LIGHT_ELEC);
+		ViewRegistration(layout, ElecText, Common.PopupAlarmMarginLEFT(559), Common.PopupAlarmMarginTOP(568) );
 		ElecText.setText("0W");
 
 		lightNextBtn = new WpadImageView(context, WpadImageView.TOUCH_KIND.BUTTON, 80, 80, R.drawable.popup_smartconcent_title_next, R.drawable.popup_smartconcent_title_next_p, ID.SmartLightRoomPopUp.button.NEXT);
@@ -492,10 +495,14 @@ public class PopupSmartLightRoom extends WpadScreen
 				}
 			}
 		}
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
 		catch (Exception e)
 		{
 			Log.e(TAG, "[onBrReceive] Exception !!!");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -677,10 +684,14 @@ public class PopupSmartLightRoom extends WpadScreen
 					}
 					Log.i(TAG, "[LIGHT] - AllLightCount : " + AllLightCount);
 				}
-				catch(Exception e)
+				catch (RuntimeException re) {
+					LogUtil.errorLogInfo("", TAG, re);
+				}
+				catch (Exception e)
 				{
 					Log.e(TAG, "[LIGHT] - INSTALL ERROR : " + idx);
-					e.printStackTrace();
+					//e.printStackTrace();
+            		LogUtil.errorLogInfo("", TAG, e);
 				}
 
 				try
@@ -836,10 +847,14 @@ public class PopupSmartLightRoom extends WpadScreen
 						}
 					}
 				}
-				catch(Exception e)
+				catch (RuntimeException re) {
+					LogUtil.errorLogInfo("", TAG, re);
+				}
+				catch (Exception e)
 				{
 					Log.e(TAG, "[LIGHT] - Exception !!!");
-					e.printStackTrace();
+					//e.printStackTrace();
+            		LogUtil.errorLogInfo("", TAG, e);
 				}
 			}
 		}
@@ -892,10 +907,15 @@ public class PopupSmartLightRoom extends WpadScreen
 		if(OnOff)
 		{
 			try { DevAPI.regChangedBR(BR_NAME); }
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -101;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_BrRegistration] - [Exception Error] DevAPI.regChangedBR (DevKind:" + DevKind + ")");
-				e.printStackTrace();
+				//e.printStackTrace();
+				LogUtil.errorLogInfo("", TAG, e);
 				return -101;
 			}
 			super.addBrActionFilter(BR_NAME);
@@ -903,10 +923,15 @@ public class PopupSmartLightRoom extends WpadScreen
 		else
 		{
 			try { DevAPI.unregChangedBR(BR_NAME); }
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -102;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_BrRegistration] - [Exception Error] DevAPI.unregChangedBR (DevKind:" + DevKind + ")");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -102;
 			}
 			super.removeBrActionFilter(BR_NAME);
@@ -938,10 +963,15 @@ public class PopupSmartLightRoom extends WpadScreen
 		try
 		{
 			sdbAPI = wpapi.Get_SdbController();
-		} catch (Exception e)
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -100;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_ApiLoad] - [Exception Error] wpapi.Get_SdbController");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 		if (sdbAPI == null)
@@ -977,10 +1007,15 @@ public class PopupSmartLightRoom extends WpadScreen
 		try
 		{
 			sdbLivingRoomLightAPI = wpapi.Get_Sdb_LivingRoomLightAPI();
-		} catch (Exception e)
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -100;
+        }
+		catch (Exception e)
 		{
 			Log.e(TAG, "[Device_ApiLoad_Living] - [Exception Error] wpapi.Get_Sdb_LivingRoomLightAPI");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 		if (sdbAPI == null)
@@ -1015,7 +1050,8 @@ public class PopupSmartLightRoom extends WpadScreen
 		{
 			try
 			{
-				ret = sdbLivingRoomLightAPI.Refresh();
+				if(sdbLivingRoomLightAPI!=null)
+					ret = sdbLivingRoomLightAPI.Refresh();
 				if(ret < 0)
 				{
 					Log.e(TAG, "[Device_Update] - sdbLivingRoomLightAPI.Refresh - ret (" + ret + ")" + sdbLivingRoomLightAPI.ErrorCode.ErrStr());
@@ -1028,10 +1064,15 @@ public class PopupSmartLightRoom extends WpadScreen
 
 				return 0;
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -102;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_Update] - [Exception Error] sdbLivingRoomLightAPI.Refresh (index:" + index);
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -102;
 			}
 		}
@@ -1065,10 +1106,15 @@ public class PopupSmartLightRoom extends WpadScreen
 
 				return 0;
 			}
-			catch(Exception e)
+			catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -103;
+			}
+			catch (Exception e)
 			{
 				Log.e(TAG, "[Device_Update] - [Exception Error] sdbAPI.Refresh (index:" + index);
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -103;
 			}
 		}
@@ -1237,37 +1283,40 @@ public class PopupSmartLightRoom extends WpadScreen
 
 				if(mData.NewLivingEnergyMeter.Info.LightGroup.Exist_Indirect)
 				{
-					LivLightName[1].setText("간접등");
+					if(LivLightName[1]!=null) LivLightName[1].setText("간접등");
 				}
 				else if(mData.NewLivingEnergyMeter.Info.LightGroup.Exist_Hallway)
 				{
-					LivLightName[1].setText("복도등");
+					if(LivLightName[1]!=null) LivLightName[1].setText("복도등");
 				}
-				LivLightName[1].setVisibility(View.VISIBLE);
+				if(LivLightName[1]!=null) LivLightName[1].setVisibility(View.VISIBLE);
 			}
 			else if(groupCount == 3)
 			{
 				// 거실등 + 간접등 + 복도등
 				LivLightName[0] = new WpadTextView(getContext(), false, 100, 42, Gravity.CENTER, Color.WHITE, Common.fontsize._34, true, ID.SmartLightRoomPopUp.text.LIGHT_LIVNAME_LIV);
 				ViewRegistration(getLayout(), LivLightName[0], Common.PopupAlarmMarginLEFT(LightPositionArr[2][0][0] + 20), Common.PopupAlarmMarginTOP( LightPositionArr[2][0][1] - 67) );
-				LivLightName[0].setText("거실등");
-				LivLightName[0].setVisibility(View.VISIBLE);
+				if(LivLightName[0]!=null) LivLightName[0].setText("거실등");
+				if(LivLightName[0]!=null) LivLightName[0].setVisibility(View.VISIBLE);
 
 				LivLightName[1] = new WpadTextView(getContext(), false, 100, 42, Gravity.CENTER, Color.WHITE, Common.fontsize._34, true, ID.SmartLightRoomPopUp.text.LIGHT_LIVNAME_LIV+1);
 				ViewRegistration(getLayout(), LivLightName[1], Common.PopupAlarmMarginLEFT(LightPositionArr[2][1][0] + 20), Common.PopupAlarmMarginTOP( LightPositionArr[2][1][1] - 67) );
-				LivLightName[1].setText("간접등");
-				LivLightName[1].setVisibility(View.VISIBLE);
+				if(LivLightName[1]!=null) LivLightName[1].setText("간접등");
+				if(LivLightName[1]!=null) LivLightName[1].setVisibility(View.VISIBLE);
 
 				LivLightName[2] = new WpadTextView(getContext(), false, 100, 42, Gravity.CENTER, Color.WHITE, Common.fontsize._34, true, ID.SmartLightRoomPopUp.text.LIGHT_LIVNAME_LIV+2);
 				ViewRegistration(getLayout(), LivLightName[2], Common.PopupAlarmMarginLEFT(LightPositionArr[2][2][0] + 20), Common.PopupAlarmMarginTOP( LightPositionArr[2][2][1] - 67) );
-				LivLightName[2].setText("복도등");
-				LivLightName[2].setVisibility(View.VISIBLE);
+				if(LivLightName[2]!=null) LivLightName[2].setText("복도등");
+				if(LivLightName[2]!=null) LivLightName[2].setVisibility(View.VISIBLE);
 			}
 		}
-		catch(Exception e)
+		catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		} catch(Exception e)
 		{
 			Log.e(TAG, "[Draw_LivLight_Name] - Exception !!!");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -1296,10 +1345,14 @@ public class PopupSmartLightRoom extends WpadScreen
 							eachLights[i].setOnOff(mData.NewLivingEnergyMeter.Data.LedLight[i].Data.OnOff);
 						}
 					}
-					catch(Exception e1)
+					catch (RuntimeException re) {
+						LogUtil.errorLogInfo("", TAG, re);
+					}
+					catch (Exception e1)
 					{
 						Log.e(TAG, "[Draw_Update] - Living Exception Error !!!");
-						e1.printStackTrace();
+						//e1.printStackTrace();
+						LogUtil.errorLogInfo("", TAG, e1);
 					}
 				}
 			}
@@ -1317,19 +1370,27 @@ public class PopupSmartLightRoom extends WpadScreen
 							eachLights[i].setOnOff(mData.BadRoom_EnergyMeter[index].Data.LedLight[i].Data.OnOff);
 						}
 					}
-					catch(Exception e2)
+					catch (RuntimeException re) {
+						LogUtil.errorLogInfo("", TAG, re);
+					}
+					catch (Exception e2)
 					{
 						Log.e(TAG, "[Draw_Update] - Bed Exception Error !!!");
-						e2.printStackTrace();
+						//e2.printStackTrace();
+						LogUtil.errorLogInfo("", TAG, e2);
 					}
 
 				}
 			}
 		}
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
 		catch (Exception e)
 		{
 			Log.e(TAG, "[Draw_Update] - Exception !!!");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 
 	}
@@ -1417,7 +1478,8 @@ public class PopupSmartLightRoom extends WpadScreen
 			}
 		}
 
-		ElecText.setText(str);
+		Log.d(TAG, "[Draw_ElecText] str [" + str + "]");
+		ElecText.setText(DC_ELECTRICAL_ENERGY.concat(str)); // 3월 15일 팀회의에서 앞에 접두사로 DC를 붙이기로 함
 	}
 
 

+ 142 - 44
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/smart_distribution/SmartConcentScreen.java

@@ -23,6 +23,7 @@ import com.artncore.commons.define;
 import com.artncore.wallpadapi.SdbAPI;
 import com.artncore.wallpadapi.WallPadAPI;
 import com.artncore.wallpadapi.WallPadDevAPI;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadenergyctrl.MainActivity;
 import kr.co.icontrols.wallpadenergyctrl.R;
@@ -209,9 +210,13 @@ public class SmartConcentScreen extends WpadScreen {
 					concentElecArr[3] = new WpadTextView(getContext(), false, 142, 40, Gravity.RIGHT, Color.WHITE, Common.fontsize._30, false, ID.SmarConcent.text.CONCENT_ELEC1_4);
 					ViewRegistration(getLayout(), concentElecArr[3], Common.ImgPosion.GetX(left + 128), Common.ImgPosion.GetY(top + 202));
 				}
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] ConcentRoom(int index, int left, int top, int ConcentNum, String roomName)");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 
@@ -264,9 +269,14 @@ public class SmartConcentScreen extends WpadScreen {
 				}
 				concentElecArr[index].setText(str);
 				return true;
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return false;
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] setElecData(int index, double value)");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return false;
 			}
 		}
@@ -298,9 +308,13 @@ public class SmartConcentScreen extends WpadScreen {
 						concentElecArr[i].setVisibility(View.VISIBLE);
 					}
 				}
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] Set_Visible(boolean input)");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 	}
@@ -455,9 +469,14 @@ public class SmartConcentScreen extends WpadScreen {
 						// 침실 에너지미터
 						concentRooms[j] = new ConcentRoom(j, left, top, mData.BadRoom_EnergyMeter[j-1].Info.ConcentCount, mDefaultRoomName[j]);
 					}
-				} catch (Exception e) {
+				} catch (RuntimeException re) {
+					LogUtil.errorLogInfo("", TAG, re);
+					concentRooms[j] = null;
+				}
+				catch (Exception e) {
 					Log.e(TAG, "[Exception Error] - [Create] concentRooms new : " + e.toString());
-					e.printStackTrace();
+					//e.printStackTrace();
+            		LogUtil.errorLogInfo("", TAG, e);
 					concentRooms[j] = null;
 				}
 			}
@@ -472,9 +491,13 @@ public class SmartConcentScreen extends WpadScreen {
 			if (OPERATION_MODE == Common.MODE_NOMAL) {
 				Device_BrRegistration(true, DEV_KIND.ENERGY_METER);
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] SmartConcentScreen(Context context, RelativeLayout layout, WallPadAPI wpapi, int operationMode, String[] RoomName, boolean backButton)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -486,9 +509,13 @@ public class SmartConcentScreen extends WpadScreen {
 			else if (AllNum <= 8) {
 				TotalPage = 1;
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] Set_TotalPageNum(int AllNum)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -525,9 +552,13 @@ public class SmartConcentScreen extends WpadScreen {
 				PageNumText.setText(page + "/" + TotalPage);
 			}
 			Draw_Update(DEV_KIND.ENERGY_METER, define.DEVICE_ALL_OR_NOTHING);
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] Draw_Page(int page)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -544,9 +575,13 @@ public class SmartConcentScreen extends WpadScreen {
 				NowButton.setButtonFrontImage();
 				MonthButton.setButtonRearImage();
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] DrawNowMonthSelected()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -581,8 +616,12 @@ public class SmartConcentScreen extends WpadScreen {
 									conElecMonth = 0;
 								}
 							}
-						} catch (Exception e) {
-							e.printStackTrace();
+						} catch (RuntimeException re) {
+							LogUtil.errorLogInfo("", TAG, re);
+						}
+						catch (Exception e) {
+							//e.printStackTrace();
+            				LogUtil.errorLogInfo("", TAG, e);
 						}
 					}
 
@@ -609,18 +648,30 @@ public class SmartConcentScreen extends WpadScreen {
 									}
 								}
 							}
-						} catch(Exception e) {
-							e.printStackTrace();
+						} catch (RuntimeException re) {
+							LogUtil.errorLogInfo("", TAG, re);
+						}
+						catch (Exception e) {
+							//e.printStackTrace();
+            				LogUtil.errorLogInfo("", TAG, e);
 						}
 					}
 				}
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Draw_Update] - ENERGY_METER Exception !!!");
-				e.printStackTrace();
+				//e.printStackTrace();
+				LogUtil.errorLogInfo("", TAG, e);
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] Draw_Update(int DevKind, int index)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -648,9 +699,13 @@ public class SmartConcentScreen extends WpadScreen {
 					Draw_Update(DEV_KIND.ENERGY_METER, define.DEVICE_ALL_OR_NOTHING);
 				}
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] onBrReceive(Intent intent)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -731,9 +786,13 @@ public class SmartConcentScreen extends WpadScreen {
 					((MainActivity)(getContext())).StartPopup(ID.screen.SmartConcentRoomPopUp, data);
 				}
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -762,9 +821,14 @@ public class SmartConcentScreen extends WpadScreen {
 			DebugLogOutput("[Device_ApiLoad] - Step1 : SMART_DISTRIBUTION API Load...");
 			try {
 				sdbAPI = wpapi.Get_SdbController();
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -100;
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Device_ApiLoad] - [Exception Error] wpapi.Get_SdbController");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -100;
 			}
 
@@ -774,9 +838,14 @@ public class SmartConcentScreen extends WpadScreen {
 			}
 
 			return 0;
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -101;
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] Device_ApiLoad(WallPadAPI wpapi)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -101;
 		}
 	}
@@ -818,14 +887,24 @@ public class SmartConcentScreen extends WpadScreen {
 					mData.BadRoom_EnergyMeter = sdbAPI.data.BadRoom_EnergyMeter;
 				}
 				return 0;
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -102;
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Device_Update] - [Exception Error] sdbAPI.Refresh (index:" + index);
-				e.printStackTrace();
+				//e.printStackTrace();
+				LogUtil.errorLogInfo("", TAG, e);
 				return -102;
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -103;
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] Device_Update(byte index)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -103;
 		}
 	}
@@ -865,9 +944,14 @@ public class SmartConcentScreen extends WpadScreen {
 			if (OnOff) {
 				try {
 					DevAPI.regChangedBR(BR_NAME);
-				} catch (Exception e) {
+				} catch (RuntimeException re) {
+					LogUtil.errorLogInfo("", TAG, re);
+					return -101;
+				}
+				catch (Exception e) {
 					Log.e(TAG, "[Device_BrRegistration] - [Exception Error] DevAPI.regChangedBR (DevKind:" + DevKind + ")");
-					e.printStackTrace();
+					//e.printStackTrace();
+            		LogUtil.errorLogInfo("", TAG, e);
 					return -101;
 				}
 				super.addBrActionFilter(BR_NAME);
@@ -875,17 +959,27 @@ public class SmartConcentScreen extends WpadScreen {
 			else {
 				try {
 					DevAPI.unregChangedBR(BR_NAME);
-				} catch (Exception e) {
+				} catch (RuntimeException re) {
+					LogUtil.errorLogInfo("", TAG, re);
+					return -102;
+				}
+				catch (Exception e) {
 					Log.e(TAG, "[Device_BrRegistration] - [Exception Error] DevAPI.unregChangedBR (DevKind:" + DevKind + ")");
-					e.printStackTrace();
+					//e.printStackTrace();
+            		LogUtil.errorLogInfo("", TAG, e);
 					return -102;
 				}
 				super.removeBrActionFilter(BR_NAME);
 			}
 			return 0;
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+			return -103;
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] Device_BrRegistration(boolean OnOff, int DevKind)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -103;
 		}
 	}
@@ -1015,9 +1109,13 @@ public class SmartConcentScreen extends WpadScreen {
 				Log.i(TAG, "[Sample_DataDefaultSetting] circuit acc" + i + " = " + mData.IntPowerController.Data.Circuit[i].AccPw);
 				Log.i(TAG, "[Sample_DataDefaultSetting] circuit now" + i + " = " + mData.IntPowerController.Data.Circuit[i].NowPw);
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] Sample_DataDefaultSetting()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 }

+ 192 - 64
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/smart_distribution/SmartDisPanelScreen.java

@@ -24,6 +24,7 @@ import com.artncore.wallpadapi.RealTimeMeterAPI;
 import com.artncore.wallpadapi.SdbAPI;
 import com.artncore.wallpadapi.WallPadAPI;
 import com.artncore.wallpadapi.WallPadDevAPI;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadenergyctrl.MainActivity;
 import kr.co.icontrols.wallpadenergyctrl.R;
@@ -170,9 +171,13 @@ public class SmartDisPanelScreen extends WpadScreen {
 						ViewRegistration(getLayout(), TXT_MeasuredValue_Elec, Common.ImgPosion.GetX(nX + 2), Common.ImgPosion.GetY(nY + 62));
 					}
 				}
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] SubDeviceView(int nX, int nY, int nIndex, String strSubDeviceName)");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 
@@ -233,9 +238,14 @@ public class SmartDisPanelScreen extends WpadScreen {
 				TXT_MeasuredValue_Elec.setText(strValue);
 
 				return true;
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return false;
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] drawMeasuredValue_Elec(double dValue)");
-				e.printStackTrace();
+				//e.printStackTrace();
+				LogUtil.errorLogInfo("", TAG, e);
 				return false;
 			}
 		}
@@ -252,20 +262,26 @@ public class SmartDisPanelScreen extends WpadScreen {
 						this.bDeviceOnOff = true;
 
 						TXT_TITLE.setTextColor(Color.rgb(0xff, 0x7d, 0x00)); // 주황색
-						TXT_MeasuredValue_Elec.setTextColor(Color.rgb(0xff, 0x7d, 0x00));
+						if(TXT_MeasuredValue_Elec!=null)
+							TXT_MeasuredValue_Elec.setTextColor(Color.rgb(0xff, 0x7d, 0x00));
 						IMG_BACKGROUND.setButtonRearImage(); // 켜짐
 					}
 					else {
 						this.bDeviceOnOff = false;
 
 						TXT_TITLE.setTextColor(Color.rgb(0xff, 0xff, 0xff)); // 흰색
-						TXT_MeasuredValue_Elec.setTextColor(Color.rgb(0xff, 0xff, 0xff));
+						if(TXT_MeasuredValue_Elec!=null)
+							TXT_MeasuredValue_Elec.setTextColor(Color.rgb(0xff, 0xff, 0xff));
 						IMG_BACKGROUND.setButtonFrontImage(); // 꺼짐
 					}
 				}
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] drawSubDeviceStatus(boolean bOnOff)");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 	}
@@ -440,9 +456,13 @@ public class SmartDisPanelScreen extends WpadScreen {
 				registerDeviceBR(true, DEV_KIND.SMART_DISTRIBUTION);
 				registerDeviceBR(true, DEV_KIND.REALTIMEMETER);
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] SmartDistributionScreen(Context context, RelativeLayout layout, WallPadAPI wpapi, int operationMode)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -457,9 +477,13 @@ public class SmartDisPanelScreen extends WpadScreen {
 			dRealtimeMeterElecAcc_Total = mWallpadStatusData.Get_RealTimeMeter_ElecAcc(); // 전월 전력누적사용량 읽기
 			mWallpadStatusData.closeDB(); // DB 닫기
 			Log.i(TAG, "[getRealTimeMeter_ElecAcc] dRealtimeMeterElecAcc_Total [" + dRealtimeMeterElecAcc_Total + "]");
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] getRealTimeMeter_ElecAcc()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -473,9 +497,13 @@ public class SmartDisPanelScreen extends WpadScreen {
 			if (mRealTimeMeterAPI != null) registerDeviceBR(false, DEV_KIND.REALTIMEMETER);
 
 			Log.i(TAG, "[END   - Screen] ********************************************");
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] onClose()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -624,9 +652,13 @@ public class SmartDisPanelScreen extends WpadScreen {
 				BTN_DIAGRAM_CURRENT.setButtonFrontImage();
 				BTN_DIAGRAM_MONTH.setButtonRearImage();
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] drawSelectedDisplayInfoType()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -652,9 +684,13 @@ public class SmartDisPanelScreen extends WpadScreen {
 				else if (nDeviceType == DEV_KIND.REALTIMEMETER) drawDeviceStatus_RealTimeMeter();
 				else Log.w(TAG, "[drawDeviceStatus] nDeviceType is not supported!!! -> " + nDeviceType);
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] drawDeviceStatus(int nDeviceType)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -664,10 +700,12 @@ public class SmartDisPanelScreen extends WpadScreen {
 			// 스마트분전반 화면에서는 사용 안됨
 		} catch (CustomDrawException cde) {
 			Log.e(TAG, "[CustomDrawException] drawDeviceStatus_EnergyController()");
-			cde.printStackTrace();
+			//cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
 		} catch (Exception e) {
 			Log.e(TAG, "[Exception] drawDeviceStatus_EnergyController()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -752,10 +790,12 @@ public class SmartDisPanelScreen extends WpadScreen {
 			}
 		} catch (CustomDrawException cde) {
 			Log.e(TAG, "[CustomDrawException] drawDeviceStatus_EnergyMeter()");
-			cde.printStackTrace();
+			//cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
 		} catch (Exception e) {
 			Log.e(TAG, "[Exception] drawDeviceStatus_EnergyMeter()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -901,10 +941,12 @@ public class SmartDisPanelScreen extends WpadScreen {
 			}
 		} catch (CustomDrawException cde) {
 			Log.e(TAG, "[CustomDrawException] drawDeviceStatus_IntegratedPowerController()");
-			cde.printStackTrace();
+			//cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
 		} catch (Exception e) {
 			Log.e(TAG, "[Exception] drawDeviceStatus_IntegratedPowerController()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -914,10 +956,12 @@ public class SmartDisPanelScreen extends WpadScreen {
 			// 스마트분전반 화면에서는 사용 안됨
 		} catch (CustomDrawException cde) {
 			Log.e(TAG, "[CustomDrawException] drawDeviceStatus_DCAPU()");
-			cde.printStackTrace();
+			//cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
 		} catch (Exception e) {
 			Log.e(TAG, "[Exception] drawDeviceStatus_DCAPU()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -1077,10 +1121,12 @@ public class SmartDisPanelScreen extends WpadScreen {
 			}
 		} catch (CustomDrawException cde) {
 			Log.e(TAG, "[CustomDrawException] drawDeviceStatus_RealTimeMeter()");
-			cde.printStackTrace();
+			//cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
 		} catch (Exception e) {
 			Log.e(TAG, "[Exception] drawDeviceStatus_RealTimeMeter()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -1114,9 +1160,13 @@ public class SmartDisPanelScreen extends WpadScreen {
 				DebugLogOutput("[loadDeviceAPI] - Step1 : SMART_DISTRIBUTION API Load...");
 				try {
 					mSdbAPI = wallpadAPI.Get_SdbController();
-				} catch (Exception e) {
+				} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 					Log.e(TAG, "[Exception] wallpadAPI.Get_SdbController");
-					e.printStackTrace();
+					//e.printStackTrace();
+            		LogUtil.errorLogInfo("", TAG, e);
 					return -100;
 				}
 
@@ -1132,9 +1182,14 @@ public class SmartDisPanelScreen extends WpadScreen {
 				DebugLogOutput("[loadDeviceAPI] - Step1 : REALTIMEMETER API Load...");
 				try {
 					mRealTimeMeterAPI = wallpadAPI.Get_RealTimeMeterController();
-				} catch (Exception e) {
+				} catch (RuntimeException re) {
+					LogUtil.errorLogInfo("", TAG, re);
+					return -100;
+				}
+				catch (Exception e) {
 					Log.e(TAG, "[Exception] wallpadAPI.Get_RealTimeMeterController");
-					e.printStackTrace();
+					//e.printStackTrace();
+            		LogUtil.errorLogInfo("", TAG, e);
 					return -100;
 				}
 
@@ -1145,9 +1200,14 @@ public class SmartDisPanelScreen extends WpadScreen {
 			}
 
 			return 0;
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] loadDeviceAPI(WallPadAPI wallpadAPI, int nDeviceType)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 	}
@@ -1193,9 +1253,14 @@ public class SmartDisPanelScreen extends WpadScreen {
 			if (bOnOff) {
 				try {
 					mWallPadDevAPI.regChangedBR(BR_NAME);
-				} catch (Exception e) {
+				} catch (RuntimeException re) {
+					LogUtil.errorLogInfo("", TAG, re);
+					return -101;
+				}
+				catch (Exception e) {
 					Log.e(TAG, "[Exception] mWallPadDevAPI.regChangedBR (nDeviceType:" + nDeviceType + ")");
-					e.printStackTrace();
+					//e.printStackTrace();
+            		LogUtil.errorLogInfo("", TAG, e);
 					return -101;
 				}
 				super.addBrActionFilter(BR_NAME);
@@ -1203,18 +1268,28 @@ public class SmartDisPanelScreen extends WpadScreen {
 			else {
 				try {
 					mWallPadDevAPI.unregChangedBR(BR_NAME);
-				} catch (Exception e) {
+				} catch (RuntimeException re) {
+					LogUtil.errorLogInfo("", TAG, re);
+					return -102;
+				}
+				catch (Exception e) {
 					Log.e(TAG, "[Exception] mWallPadDevAPI.unregChangedBR (nDeviceType:" + nDeviceType + ")");
-					e.printStackTrace();
+					//e.printStackTrace();
+            		LogUtil.errorLogInfo("", TAG, e);
 					return -102;
 				}
 				super.removeBrActionFilter(BR_NAME);
 			}
 
 			return 0;
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] registerDeviceBR(boolean bOnOff, int nDeviceType)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 	}
@@ -1276,9 +1351,14 @@ public class SmartDisPanelScreen extends WpadScreen {
 			}
 
 			return -1;
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] updateDevice(boolean bReal, int nDeviceType, byte hIndex)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 	}
@@ -1319,9 +1399,14 @@ public class SmartDisPanelScreen extends WpadScreen {
 				else {
 					Log.i(TAG, "[updateDevice_SmartDistribution] mSdbAPI.Refresh SUCCESS !!!");
 				}
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -102;
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] - [Exception Error] mSdbAPI.Refresh (index:" + hIndex );
-				e.printStackTrace();
+				//e.printStackTrace();
+				LogUtil.errorLogInfo("", TAG, e);
 				return -102;
 			}
 
@@ -1345,8 +1430,12 @@ public class SmartDisPanelScreen extends WpadScreen {
 					for (int i = 0; i < mData.hRoomEMCnt; i++) {
 						mData.RoomEM[i] = mSdbAPI.data.BadRoom_EnergyMeter[i];
 					}
-				} catch (Exception e) {
-					e.printStackTrace();
+				} catch (RuntimeException re) {
+					LogUtil.errorLogInfo("", TAG, re);
+				}
+				catch (Exception e) {
+					//e.printStackTrace();
+            		LogUtil.errorLogInfo("", TAG, e);
 				}
 
 				mData.IntPowerController = mSdbAPI.data.IntPowerController;
@@ -1371,8 +1460,12 @@ public class SmartDisPanelScreen extends WpadScreen {
 					else {
 						mData.RoomEM = mSdbAPI.data.BadRoom_EnergyMeter;
 					}
-				} catch (Exception e) {
-					e.printStackTrace();
+				} catch (RuntimeException re) {
+					LogUtil.errorLogInfo("", TAG, re);
+				}
+				catch (Exception e) {
+					//e.printStackTrace();
+            		LogUtil.errorLogInfo("", TAG, e);
 				}
 
 			}
@@ -1396,9 +1489,14 @@ public class SmartDisPanelScreen extends WpadScreen {
 			DebugLogOutput("[updateDevice_SmartDistribution] - OK");
 
 			return 0;
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] updateDevice_SmartDistribution(byte hIndex, byte hDeviceType)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 	}
@@ -1426,9 +1524,14 @@ public class SmartDisPanelScreen extends WpadScreen {
 					Log.e(TAG, "[updateDevice_RealTimeMeter] - mRealTimeMeterAPI.Refresh - ret (" + ret + ")" + mRealTimeMeterAPI.ErrorCode.ErrStr());
 					return -2;
 				}
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -102;
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] mRealTimeMeterAPI.Refresh (bReal:" + bReal + ")");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -102;
 			}
 
@@ -1448,9 +1551,14 @@ public class SmartDisPanelScreen extends WpadScreen {
 			DebugLogOutput("[updateDevice_RealTimeMeter] - OK");
 
 			return 0;
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] updateDevice_RealTimeMeter(boolean bReal)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 	}
@@ -1646,9 +1754,13 @@ public class SmartDisPanelScreen extends WpadScreen {
 				}
 
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -1708,9 +1820,13 @@ public class SmartDisPanelScreen extends WpadScreen {
 			try {
 				Size = 1182;
 				mBranchPaint = new Paint[6];
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] CurrentBar(Context context)");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 
@@ -1765,18 +1881,26 @@ public class SmartDisPanelScreen extends WpadScreen {
 
 					canvas.drawRect(0, 0, (float) WpadScale.getWidth(12), (float) WpadScale.getHeight(25), mBranchPaint[i]);
 				}
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] onDraw(Canvas canvas)");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 
 		public void ReDraw() {
 			try {
 				invalidate();
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] ReDraw()");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 	}
@@ -1847,9 +1971,13 @@ public class SmartDisPanelScreen extends WpadScreen {
 				Log.i(TAG, "[SampleData] circuit acc" + i + " = " + mData.IntPowerController.Data.Circuit[i].AccPw);
 				Log.i(TAG, "[SampleData] circuit now" + i + " = " + mData.IntPowerController.Data.Circuit[i].NowPw);
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] Sample_DataDefaultSetting()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 
 	}

+ 193 - 64
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/smart_distribution/SmartDisPanelScreen_01.java

@@ -24,6 +24,7 @@ import com.artncore.wallpadapi.RealTimeMeterAPI;
 import com.artncore.wallpadapi.SdbAPI;
 import com.artncore.wallpadapi.WallPadAPI;
 import com.artncore.wallpadapi.WallPadDevAPI;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadenergyctrl.MainActivity;
 import kr.co.icontrols.wallpadenergyctrl.R;
@@ -169,9 +170,13 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
                         ViewRegistration(getLayout(), TXT_MeasuredValue_Elec, Common.ImgPosion.GetX(nX + 2), Common.ImgPosion.GetY(nY + 62));
                     }
                 }
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] SubDeviceView(int nX, int nY, int nIndex, String strSubDeviceName)");
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
             }
         }
 
@@ -232,9 +237,14 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
                 TXT_MeasuredValue_Elec.setText(strValue);
 
                 return true;
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+                return false;
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] drawMeasuredValue_Elec(double dValue)");
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
                 return false;
             }
         }
@@ -251,20 +261,26 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
                         this.bDeviceOnOff = true;
 
                         TXT_TITLE.setTextColor(Color.rgb(0xff, 0x7d, 0x00)); // 주황색
-                        TXT_MeasuredValue_Elec.setTextColor(Color.rgb(0xff, 0x7d, 0x00));
+                        if(TXT_MeasuredValue_Elec!=null)
+                            TXT_MeasuredValue_Elec.setTextColor(Color.rgb(0xff, 0x7d, 0x00));
                         IMG_BACKGROUND.setButtonRearImage(); // 켜짐
                     }
                     else {
                         this.bDeviceOnOff = false;
 
                         TXT_TITLE.setTextColor(Color.rgb(0xff, 0xff, 0xff)); // 흰색
-                        TXT_MeasuredValue_Elec.setTextColor(Color.rgb(0xff, 0xff, 0xff));
+                        if(TXT_MeasuredValue_Elec!=null)
+                            TXT_MeasuredValue_Elec.setTextColor(Color.rgb(0xff, 0xff, 0xff));
                         IMG_BACKGROUND.setButtonFrontImage(); // 꺼짐
                     }
                 }
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] drawSubDeviceStatus(boolean bOnOff)");
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
             }
         }
     }
@@ -439,9 +455,13 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
                 registerDeviceBR(true, DEV_KIND.SMART_DISTRIBUTION);
                 registerDeviceBR(true, DEV_KIND.REALTIMEMETER);
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] SmartDistributionScreen(Context context, RelativeLayout layout, WallPadAPI wpapi, int operationMode)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -456,9 +476,13 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
             dRealtimeMeterElecAcc_Total = mWallpadStatusData.Get_RealTimeMeter_ElecAcc(); // 전월 전력누적사용량 읽기
             mWallpadStatusData.closeDB(); // DB 닫기
             Log.i(TAG, "[getRealTimeMeter_ElecAcc] dRealtimeMeterElecAcc_Total [" + dRealtimeMeterElecAcc_Total + "]");
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] getRealTimeMeter_ElecAcc()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -472,9 +496,13 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
             if (mRealTimeMeterAPI != null) registerDeviceBR(false, DEV_KIND.REALTIMEMETER);
 
             Log.i(TAG, "[END   - Screen] ********************************************");
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] onClose()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -623,9 +651,13 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
                 BTN_DIAGRAM_CURRENT.setButtonFrontImage();
                 BTN_DIAGRAM_MONTH.setButtonRearImage();
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] drawSelectedDisplayInfoType()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -651,9 +683,13 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
                 else if (nDeviceType == DEV_KIND.REALTIMEMETER) drawDeviceStatus_RealTimeMeter();
                 else Log.w(TAG, "[drawDeviceStatus] nDeviceType is not supported!!! -> " + nDeviceType);
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] drawDeviceStatus(int nDeviceType)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -663,10 +699,12 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
             // 스마트분전반 화면에서는 사용 안됨
         } catch (CustomDrawException cde) {
             Log.e(TAG, "[CustomDrawException] drawDeviceStatus_EnergyController()");
-            cde.printStackTrace();
+            //cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
         } catch (Exception e) {
             Log.e(TAG, "[Exception] drawDeviceStatus_EnergyController()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -751,10 +789,12 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
             }
         } catch (CustomDrawException cde) {
             Log.e(TAG, "[CustomDrawException] drawDeviceStatus_EnergyMeter()");
-            cde.printStackTrace();
+            //cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
         } catch (Exception e) {
             Log.e(TAG, "[Exception] drawDeviceStatus_EnergyMeter()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -900,10 +940,12 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
             }
         } catch (CustomDrawException cde) {
             Log.e(TAG, "[CustomDrawException] drawDeviceStatus_IntegratedPowerController()");
-            cde.printStackTrace();
+            //cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
         } catch (Exception e) {
             Log.e(TAG, "[Exception] drawDeviceStatus_IntegratedPowerController()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -913,10 +955,12 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
             // 스마트분전반 화면에서는 사용 안됨
         } catch (CustomDrawException cde) {
             Log.e(TAG, "[CustomDrawException] drawDeviceStatus_DCAPU()");
-            cde.printStackTrace();
+            //cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
         } catch (Exception e) {
             Log.e(TAG, "[Exception] drawDeviceStatus_DCAPU()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -1076,10 +1120,12 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
             }
         } catch (CustomDrawException cde) {
             Log.e(TAG, "[CustomDrawException] drawDeviceStatus_RealTimeMeter()");
-            cde.printStackTrace();
+            //cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
         } catch (Exception e) {
             Log.e(TAG, "[Exception] drawDeviceStatus_RealTimeMeter()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -1113,9 +1159,14 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
                 DebugLogOutput("[loadDeviceAPI] - Step1 : SMART_DISTRIBUTION API Load...");
                 try {
                     mSdbAPI = wallpadAPI.Get_SdbController();
-                } catch (Exception e) {
+                } catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                    return -100;
+                }
+                catch (Exception e) {
                     Log.e(TAG, "[Exception] wallpadAPI.Get_SdbController");
-                    e.printStackTrace();
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
                     return -100;
                 }
 
@@ -1131,9 +1182,14 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
                 DebugLogOutput("[loadDeviceAPI] - Step1 : REALTIMEMETER API Load...");
                 try {
                     mRealTimeMeterAPI = wallpadAPI.Get_RealTimeMeterController();
-                } catch (Exception e) {
+                } catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                    return -100;
+                }
+                catch (Exception e) {
                     Log.e(TAG, "[Exception] wallpadAPI.Get_RealTimeMeterController");
-                    e.printStackTrace();
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
                     return -100;
                 }
 
@@ -1144,9 +1200,14 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
             }
 
             return 0;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] loadDeviceAPI(WallPadAPI wallpadAPI, int nDeviceType)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -100;
         }
     }
@@ -1192,9 +1253,14 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
             if (bOnOff) {
                 try {
                     mWallPadDevAPI.regChangedBR(BR_NAME);
-                } catch (Exception e) {
+                } catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                    return -101;
+                }
+                catch (Exception e) {
                     Log.e(TAG, "[Exception] mWallPadDevAPI.regChangedBR (nDeviceType:" + nDeviceType + ")");
-                    e.printStackTrace();
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
                     return -101;
                 }
                 super.addBrActionFilter(BR_NAME);
@@ -1202,18 +1268,28 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
             else {
                 try {
                     mWallPadDevAPI.unregChangedBR(BR_NAME);
-                } catch (Exception e) {
+                } catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                    return -102;
+                }
+                catch (Exception e) {
                     Log.e(TAG, "[Exception] mWallPadDevAPI.unregChangedBR (nDeviceType:" + nDeviceType + ")");
-                    e.printStackTrace();
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
                     return -102;
                 }
                 super.removeBrActionFilter(BR_NAME);
             }
 
             return 0;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] registerDeviceBR(boolean bOnOff, int nDeviceType)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -100;
         }
     }
@@ -1275,9 +1351,14 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
             }
 
             return -1;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] updateDevice(boolean bReal, int nDeviceType, byte hIndex)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -100;
         }
     }
@@ -1318,9 +1399,14 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
                 else {
                     Log.i(TAG, "[updateDevice_SmartDistribution] mSdbAPI.Refresh SUCCESS !!!");
                 }
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+                return -102;
+            }
+		    catch (Exception e) {
                 Log.e(TAG, "[Exception] - [Exception Error] mSdbAPI.Refresh (index:" + hIndex );
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
                 return -102;
             }
 
@@ -1344,8 +1430,12 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
                     for (int i = 0; i < mData.hRoomEMCnt; i++) {
                         mData.RoomEM[i] = mSdbAPI.data.BadRoom_EnergyMeter[i];
                     }
-                } catch (Exception e) {
-                    e.printStackTrace();
+                } catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                }
+                catch (Exception e) {
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
                 }
 
                 mData.IntPowerController = mSdbAPI.data.IntPowerController;
@@ -1370,8 +1460,12 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
                     else {
                         mData.RoomEM = mSdbAPI.data.BadRoom_EnergyMeter;
                     }
-                } catch (Exception e) {
-                    e.printStackTrace();
+                } catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                }
+                catch (Exception e) {
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
                 }
 
             }
@@ -1395,9 +1489,14 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
             DebugLogOutput("[updateDevice_SmartDistribution] - OK");
 
             return 0;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] updateDevice_SmartDistribution(byte hIndex, byte hDeviceType)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -100;
         }
     }
@@ -1425,9 +1524,14 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
                     Log.e(TAG, "[updateDevice_RealTimeMeter] - mRealTimeMeterAPI.Refresh - ret (" + ret + ")" + mRealTimeMeterAPI.ErrorCode.ErrStr());
                     return -2;
                 }
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+                return -102;
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] mRealTimeMeterAPI.Refresh (bReal:" + bReal + ")");
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
                 return -102;
             }
 
@@ -1447,9 +1551,14 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
             DebugLogOutput("[updateDevice_RealTimeMeter] - OK");
 
             return 0;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] updateDevice_RealTimeMeter(boolean bReal)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -100;
         }
     }
@@ -1645,9 +1754,13 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
                 }
 
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -1707,9 +1820,13 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
             try {
                 Size = 1182;
                 mBranchPaint = new Paint[6];
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] CurrentBar(Context context)");
-                e.printStackTrace();
+                //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             }
         }
 
@@ -1764,18 +1881,26 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
 
                     canvas.drawRect(0, 0, (float) WpadScale.getWidth(12), (float) WpadScale.getHeight(25), mBranchPaint[i]);
                 }
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] onDraw(Canvas canvas)");
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
             }
         }
 
         public void ReDraw() {
             try {
                 invalidate();
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] ReDraw()");
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
             }
         }
     }
@@ -1846,9 +1971,13 @@ public class SmartDisPanelScreen_01 extends WpadScreen {
                 Log.i(TAG, "[SampleData] circuit acc" + i + " = " + mData.IntPowerController.Data.Circuit[i].AccPw);
                 Log.i(TAG, "[SampleData] circuit now" + i + " = " + mData.IntPowerController.Data.Circuit[i].NowPw);
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] Sample_DataDefaultSetting()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
 
     }

+ 201 - 68
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/smart_distribution/SmartDisPanelScreen_02.java

@@ -24,6 +24,7 @@ import com.artncore.wallpadapi.RealTimeMeterAPI;
 import com.artncore.wallpadapi.SdbAPI;
 import com.artncore.wallpadapi.WallPadAPI;
 import com.artncore.wallpadapi.WallPadDevAPI;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadenergyctrl.MainActivity;
 import kr.co.icontrols.wallpadenergyctrl.R;
@@ -169,9 +170,13 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                         ViewRegistration(getLayout(), TXT_MeasuredValue_Elec, Common.ImgPosion.GetX(nX + 2), Common.ImgPosion.GetY(nY + 62));
                     }
                 }
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] SubDeviceView(int nX, int nY, int nIndex, String strSubDeviceName)");
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
             }
         }
 
@@ -232,9 +237,14 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                 TXT_MeasuredValue_Elec.setText(strValue);
 
                 return true;
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+                return false;
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] drawMeasuredValue_Elec(double dValue)");
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
                 return false;
             }
         }
@@ -251,20 +261,26 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                         this.bDeviceOnOff = true;
 
                         TXT_TITLE.setTextColor(Color.rgb(0xff, 0x7d, 0x00)); // 주황색
-                        TXT_MeasuredValue_Elec.setTextColor(Color.rgb(0xff, 0x7d, 0x00));
+                        if(TXT_MeasuredValue_Elec!=null)
+                            TXT_MeasuredValue_Elec.setTextColor(Color.rgb(0xff, 0x7d, 0x00));
                         IMG_BACKGROUND.setButtonRearImage(); // 켜짐
                     }
                     else {
                         this.bDeviceOnOff = false;
 
                         TXT_TITLE.setTextColor(Color.rgb(0xff, 0xff, 0xff)); // 흰색
-                        TXT_MeasuredValue_Elec.setTextColor(Color.rgb(0xff, 0xff, 0xff));
+                        if(TXT_MeasuredValue_Elec!=null)
+                            TXT_MeasuredValue_Elec.setTextColor(Color.rgb(0xff, 0xff, 0xff));
                         IMG_BACKGROUND.setButtonFrontImage(); // 꺼짐
                     }
                 }
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] drawSubDeviceStatus(boolean bOnOff)");
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
             }
         }
     }
@@ -439,9 +455,13 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                 registerDeviceBR(true, DEV_KIND.SMART_DISTRIBUTION);
                 registerDeviceBR(true, DEV_KIND.REALTIMEMETER);
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] SmartDistributionScreen(Context context, RelativeLayout layout, WallPadAPI wpapi, int operationMode)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -456,9 +476,13 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             dRealtimeMeterElecAcc_Total = mWallpadStatusData.Get_RealTimeMeter_ElecAcc(); // 전월 전력누적사용량 읽기
             mWallpadStatusData.closeDB(); // DB 닫기
             Log.i(TAG, "[getRealTimeMeter_ElecAcc] dRealtimeMeterElecAcc_Total [" + dRealtimeMeterElecAcc_Total + "]");
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] getRealTimeMeter_ElecAcc()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -472,9 +496,13 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             if (mRealTimeMeterAPI != null) registerDeviceBR(false, DEV_KIND.REALTIMEMETER);
 
             Log.i(TAG, "[END   - Screen] ********************************************");
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] onClose()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -623,9 +651,13 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                 BTN_DIAGRAM_CURRENT.setButtonFrontImage();
                 BTN_DIAGRAM_MONTH.setButtonRearImage();
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] drawSelectedDisplayInfoType()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -651,9 +683,13 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                 else if (nDeviceType == DEV_KIND.REALTIMEMETER) drawDeviceStatus_RealTimeMeter();
                 else Log.w(TAG, "[drawDeviceStatus] nDeviceType is not supported!!! -> " + nDeviceType);
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] drawDeviceStatus(int nDeviceType)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -663,10 +699,12 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             // 스마트분전반 화면에서는 사용 안됨
         } catch (CustomDrawException cde) {
             Log.e(TAG, "[CustomDrawException] drawDeviceStatus_EnergyController()");
-            cde.printStackTrace();
+            //cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
         } catch (Exception e) {
             Log.e(TAG, "[Exception] drawDeviceStatus_EnergyController()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -751,10 +789,12 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             }
         } catch (CustomDrawException cde) {
             Log.e(TAG, "[CustomDrawException] drawDeviceStatus_EnergyMeter()");
-            cde.printStackTrace();
+            //cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
         } catch (Exception e) {
             Log.e(TAG, "[Exception] drawDeviceStatus_EnergyMeter()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -808,10 +848,12 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             }
         } catch (CustomDrawException cde) {
             Log.e(TAG, "[CustomDrawException] drawDeviceStatus_IntegratedPowerController()");
-            cde.printStackTrace();
+            //cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
         } catch (Exception e) {
             Log.e(TAG, "[Exception] drawDeviceStatus_IntegratedPowerController()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -821,10 +863,12 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             // 스마트분전반 화면에서는 사용 안됨
         } catch (CustomDrawException cde) {
             Log.e(TAG, "[CustomDrawException] drawDeviceStatus_DCAPU()");
-            cde.printStackTrace();
+            //cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
         } catch (Exception e) {
             Log.e(TAG, "[Exception] drawDeviceStatus_DCAPU()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -964,10 +1008,12 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             }
         } catch (CustomDrawException cde) {
             Log.e(TAG, "[CustomDrawException] drawDeviceStatus_RealTimeMeter()");
-            cde.printStackTrace();
+            //cde.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, cde);
         } catch (Exception e) {
             Log.e(TAG, "[Exception] drawDeviceStatus_RealTimeMeter()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -1001,9 +1047,14 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                 DebugLogOutput("[loadDeviceAPI] - Step1 : SMART_DISTRIBUTION API Load...");
                 try {
                     mSdbAPI = wallpadAPI.Get_SdbController();
-                } catch (Exception e) {
+                } catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                    return -100;
+                }
+                catch (Exception e) {
                     Log.e(TAG, "[Exception] wallpadAPI.Get_SdbController");
-                    e.printStackTrace();
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
                     return -100;
                 }
 
@@ -1019,9 +1070,14 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                 DebugLogOutput("[loadDeviceAPI] - Step1 : REALTIMEMETER API Load...");
                 try {
                     mRealTimeMeterAPI = wallpadAPI.Get_RealTimeMeterController();
-                } catch (Exception e) {
+                } catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                    return -100;
+                }
+                catch (Exception e) {
                     Log.e(TAG, "[Exception] wallpadAPI.Get_RealTimeMeterController");
-                    e.printStackTrace();
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
                     return -100;
                 }
 
@@ -1032,9 +1088,14 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             }
 
             return 0;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] loadDeviceAPI(WallPadAPI wallpadAPI, int nDeviceType)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -100;
         }
     }
@@ -1080,9 +1141,14 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             if (bOnOff) {
                 try {
                     mWallPadDevAPI.regChangedBR(BR_NAME);
-                } catch (Exception e) {
+                } catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                    return -101;
+                }
+                catch (Exception e) {
                     Log.e(TAG, "[Exception] mWallPadDevAPI.regChangedBR (nDeviceType:" + nDeviceType + ")");
-                    e.printStackTrace();
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
                     return -101;
                 }
                 super.addBrActionFilter(BR_NAME);
@@ -1090,18 +1156,28 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             else {
                 try {
                     mWallPadDevAPI.unregChangedBR(BR_NAME);
-                } catch (Exception e) {
+                } catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                    return -102;
+                }
+                catch (Exception e) {
                     Log.e(TAG, "[Exception] mWallPadDevAPI.unregChangedBR (nDeviceType:" + nDeviceType + ")");
-                    e.printStackTrace();
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
                     return -102;
                 }
                 super.removeBrActionFilter(BR_NAME);
             }
 
             return 0;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] registerDeviceBR(boolean bOnOff, int nDeviceType)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -100;
         }
     }
@@ -1163,9 +1239,14 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             }
 
             return -1;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] updateDevice(boolean bReal, int nDeviceType, byte hIndex)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -100;
         }
     }
@@ -1206,9 +1287,14 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                 else {
                     Log.i(TAG, "[updateDevice_SmartDistribution] mSdbAPI.Refresh SUCCESS !!!");
                 }
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+                return -102;
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] - [Exception Error] mSdbAPI.Refresh (index:" + hIndex );
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
                 return -102;
             }
 
@@ -1232,8 +1318,12 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                     for (int i = 0; i < mData.hRoomEMCnt; i++) {
                         mData.RoomEM[i] = mSdbAPI.data.BadRoom_EnergyMeter[i];
                     }
-                } catch (Exception e) {
-                    e.printStackTrace();
+                } catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                }
+                catch (Exception e) {
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
                 }
 
                 mData.IntPowerController = mSdbAPI.data.IntPowerController;
@@ -1258,8 +1348,12 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                     else {
                         mData.RoomEM = mSdbAPI.data.BadRoom_EnergyMeter;
                     }
-                } catch (Exception e) {
-                    e.printStackTrace();
+                } catch (RuntimeException re) {
+                    LogUtil.errorLogInfo("", TAG, re);
+                }
+                catch (Exception e) {
+                    //e.printStackTrace();
+                    LogUtil.errorLogInfo("", TAG, e);
                 }
 
             }
@@ -1283,9 +1377,14 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             DebugLogOutput("[updateDevice_SmartDistribution] - OK");
 
             return 0;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] updateDevice_SmartDistribution(byte hIndex, byte hDeviceType)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -100;
         }
     }
@@ -1313,9 +1412,14 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                     Log.e(TAG, "[updateDevice_RealTimeMeter] - mRealTimeMeterAPI.Refresh - ret (" + ret + ")" + mRealTimeMeterAPI.ErrorCode.ErrStr());
                     return -2;
                 }
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+                return -102;
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] mRealTimeMeterAPI.Refresh (bReal:" + bReal + ")");
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
                 return -102;
             }
 
@@ -1335,9 +1439,14 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             DebugLogOutput("[updateDevice_RealTimeMeter] - OK");
 
             return 0;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] updateDevice_RealTimeMeter(boolean bReal)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -100;
         }
     }
@@ -1457,7 +1566,8 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                         if (TargetId == ID.SmartDistributionMain.image.PART_BACKGROUND_3) {
                             // 전열
                             if (OPERATION_MODE == Common.MODE_NOMAL) {
-                                ret = mSdbAPI.SetCircuitOnOff(SdbAPI.CIRCUIT_KIND.ELEC_HEAT, true);
+                                if(mSdbAPI!=null)
+                                    ret = mSdbAPI.SetCircuitOnOff(SdbAPI.CIRCUIT_KIND.ELEC_HEAT, true);
                                 if (ret >= 0) {
                                     // 제어 성공
                                     DebugLogOutput("[TOUCH] - ELEC_HEAT ON : SUCCESS");
@@ -1478,10 +1588,12 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                         else if (TargetId == ID.SmartDistributionMain.image.PART_BACKGROUND_4) {
                             // 에어컨
                             if (OPERATION_MODE == Common.MODE_NOMAL) {
-                                ret = mSdbAPI.SetCircuitOnOff(SdbAPI.CIRCUIT_KIND.AIRCON_IN, true); // 에어컨-실내기 제어
+                                if(mSdbAPI!=null)
+                                    ret = mSdbAPI.SetCircuitOnOff(SdbAPI.CIRCUIT_KIND.AIRCON_IN, true); // 에어컨-실내기 제어
                                 if (ret >= 0) {
                                     DebugLogOutput("[TOUCH] - AIRCON_IN ON : SUCCESS");
-                                    ret = mSdbAPI.SetCircuitOnOff(SdbAPI.CIRCUIT_KIND.AIRCON_OUT, true); // 에어컨-실외기 제어
+                                    if(mSdbAPI!=null)
+                                        ret = mSdbAPI.SetCircuitOnOff(SdbAPI.CIRCUIT_KIND.AIRCON_OUT, true); // 에어컨-실외기 제어
                                     if (ret >= 0) {
                                         DebugLogOutput("[TOUCH] - AIRCON_OUT ON : SUCCESS");
                                         Sound().Play(WpadSound.SND.effect.TOUCH_LATCHED);
@@ -1506,7 +1618,8 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                         else if (TargetId == ID.SmartDistributionMain.image.PART_BACKGROUND_5) {
                             // 욕실&세탁기
                             if (OPERATION_MODE == Common.MODE_NOMAL) {
-                                ret = mSdbAPI.SetCircuitOnOff(SdbAPI.CIRCUIT_KIND.BATH_WASHER, true);
+                                if(mSdbAPI!=null)
+                                    ret = mSdbAPI.SetCircuitOnOff(SdbAPI.CIRCUIT_KIND.BATH_WASHER, true);
                                 if (ret >= 0) {
                                     // 제어 성공
                                     DebugLogOutput("[TOUCH] - BATH_WASHER ON : SUCCESS");
@@ -1533,9 +1646,13 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                 }
 
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -1594,9 +1711,13 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             try {
                 Size = 1182;
                 mBranchPaint = new Paint[straSubDeviceList.length];
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] CurrentBar(Context context)");
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
             }
         }
 
@@ -1652,9 +1773,13 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
 
                     canvas.drawRect(0, 0, (float) WpadScale.getWidth(12), (float) WpadScale.getHeight(25), mBranchPaint[i]);
                 }
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] onDraw(Canvas canvas)");
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
             }
         }
 
@@ -1662,9 +1787,13 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
             try {
                 Log.i(TAG, "[ReDraw] start");
                 invalidate();
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception] ReDraw()");
-                e.printStackTrace();
+                //e.printStackTrace();
+                LogUtil.errorLogInfo("", TAG, e);
             }
         }
     }
@@ -1735,9 +1864,13 @@ public class SmartDisPanelScreen_02 extends WpadScreen {
                 Log.i(TAG, "[SampleData] circuit acc" + i + " = " + mData.IntPowerController.Data.Circuit[i].AccPw);
                 Log.i(TAG, "[SampleData] circuit now" + i + " = " + mData.IntPowerController.Data.Circuit[i].NowPw);
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] Sample_DataDefaultSetting()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
 
     }

+ 121 - 39
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/screen/smart_distribution/SmartLightScreen.java

@@ -24,6 +24,7 @@ import com.artncore.wallpadapi.SdbAPI.DEVICE_INDEX;
 import com.artncore.wallpadapi.Sdb_LivingRoomLightAPI;
 import com.artncore.wallpadapi.WallPadAPI;
 import com.artncore.wallpadapi.WallPadDevAPI;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadenergyctrl.MainActivity;
 import kr.co.icontrols.wallpadenergyctrl.R;
@@ -145,9 +146,13 @@ public class SmartLightScreen extends WpadScreen {
 
 				// 생성시, 0 W로 초기화 설정
 				updateElectricityConsumption(0);
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] LightSpaceUnit(int index, int left, int top, int nLightNo, String roomName)");
-				e.printStackTrace();
+				//e.printStackTrace();            
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 
@@ -167,7 +172,9 @@ public class SmartLightScreen extends WpadScreen {
 				if (mNowMonth.equals("NOW")) {
 					if (dValue <= 0) strElecConsumption = "0";
 					else strElecConsumption = String.format("%.0f", dValue);
-					strElecConsumption += " W";
+					//strElecConsumption += " W";
+					//3월 15일 팀회의에서 앞에 접두사로 DC를 붙이기로 함
+					strElecConsumption = "DC " + strElecConsumption + " W";
 				}
 				else if (mNowMonth.equals("MONTH")) {
 					if (dValue >= 1000) {
@@ -175,12 +182,16 @@ public class SmartLightScreen extends WpadScreen {
 						dValue /= 1000;
 						if (dValue < 10) {
 							strElecConsumption = String.format("%.0f", Math.floor(dValue));
-							strElecConsumption += " kWh";
+							//strElecConsumption += " kWh";
+							//3월 15일 팀회의에서 앞에 접두사로 DC를 붙이기로 함
+							strElecConsumption = "DC "+ strElecConsumption + " kWh";
 						}
 						else {
 							if (dValue >= 10000) {dValue = 9999;}
 							strElecConsumption = String.format("%.0f", Math.floor(dValue));
-							strElecConsumption += " kWh";
+							//strElecConsumption += " kWh";
+							//3월 15일 팀회의에서 앞에 접두사로 DC를 붙이기로 함
+							strElecConsumption = "DC "+ strElecConsumption + " kWh";
 						}
 					}
 					else {
@@ -193,14 +204,23 @@ public class SmartLightScreen extends WpadScreen {
 							//value = 1;
 							strElecConsumption = String.format("%.0f", dValue);
 						}
-						strElecConsumption += " Wh";
+						//strElecConsumption += " Wh";
+						//3월 15일 팀회의에서 앞에 접두사로 DC를 붙이기로 함
+						strElecConsumption ="DC " + strElecConsumption +  " Wh";
 					}
 				}
+				if (strElecConsumption.length() > 7) LightElecText.setTextSize(Common.fontsize._28);
+				else LightElecText.setTextSize(Common.fontsize._30);
 				LightElecText.setText(strElecConsumption);
 				return true;
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return false;
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] updateElectricityConsumption(double dValue)");
-				e.printStackTrace();
+				//e.printStackTrace();            
+            	LogUtil.errorLogInfo("", TAG, e);
 				return false;
 			}
 		}
@@ -215,9 +235,13 @@ public class SmartLightScreen extends WpadScreen {
 					LightOnOff = false;
 					LightBtn.setButtonFrontImage();
 				}
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] serLightStatus(boolean bStatus)");
-				e.printStackTrace();
+				//e.printStackTrace();            
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 
@@ -242,9 +266,13 @@ public class SmartLightScreen extends WpadScreen {
 					LightBtn.setVisibility(View.INVISIBLE);
 					LightElecText.setVisibility(View.INVISIBLE);
 				}
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] setVisible(boolean bVisible)");
-				e.printStackTrace();
+				//e.printStackTrace();            
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 	}
@@ -327,9 +355,10 @@ public class SmartLightScreen extends WpadScreen {
 			Sample_DataDefaultSetting();
 		}
 
+		Log.i(TAG, "[SmartLightScreen] RoomEMCnt [" + mData.RoomEMCnt + "]");
 		nAllEMCnt = mData.RoomEMCnt;
 		if (mData.mLivingEMData.Info.Install) nAllEMCnt += 1;
-		Log.i(TAG, "[SmartLightScreen] nAllEMCnt [" + nAllEMCnt + "]");
+		Log.i(TAG, "[SmartLightScreen] mLivingEMData.Install [" + mData.mLivingEMData.Info.Install + "], nAllEMCnt [" + nAllEMCnt + "]");
 		setTotalPageNo(nAllEMCnt);
 
 		Background = new WpadImageView(context, WpadImageView.TOUCH_KIND.NONE, 1280, 690, R.drawable.bg_body, 0, ID.SmartLight.image.BACKGROUND);
@@ -408,9 +437,13 @@ public class SmartLightScreen extends WpadScreen {
 					// 침실 에너지미터
 					mLightSpaceUnit[j] = new LightSpaceUnit(j, left, top, mData.RoomEMData[j-1].Info.LightCount, mDefaultRoomName[j]);
 				}
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception Error] - [SmartLightScreen] mLightSpaceUnit new : " + e.toString());
-				e.printStackTrace();
+				//e.printStackTrace();            
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 
@@ -590,7 +623,7 @@ public class SmartLightScreen extends WpadScreen {
 							if (mData.RoomEMData[Emidx].Info.Install) {
 								// 설치 여부만 판단하여, 선택된 침실 모든 조명 제어
 								Log.i(TAG, "[onTouchEvent] [LIGHT] - BadEM["+Emidx+"] install !!!");
-								if (mLightSpaceUnit[index].LightOnOff == false) {
+								if (mSdbAPI!=null && mLightSpaceUnit[index].LightOnOff == false) {
 									int ret = mSdbAPI.SetLightOnOff(Emidx, define.DEVICE_ALL_OR_NOTHING, true);
 									Log.i(TAG, "[onTouchEvent] [LIGHT] - BadEM["+Emidx+"] ret : " + ret);
 									if (ret >= 0) {
@@ -605,7 +638,7 @@ public class SmartLightScreen extends WpadScreen {
 									}
 								}
 								else {
-									if (mSdbAPI.SetLightOnOff(Emidx, define.DEVICE_ALL_OR_NOTHING, false) >= 0) {
+									if (mSdbAPI!=null && mSdbAPI.SetLightOnOff(Emidx, define.DEVICE_ALL_OR_NOTHING, false) >= 0) {
 										//Draw_Update(DEV_KIND.ENERGY_METER, index);
 										printDebugLog("[onTouchEvent] [LIGHT] Emidx : " + Emidx + " / OnOff : OFF  - SUCCESS");
 										Sound().Play(WpadSound.SND.effect.TOUCH_LATCHED);
@@ -661,9 +694,13 @@ public class SmartLightScreen extends WpadScreen {
 						}
 					}
 					drawPage(nCurrentPageNo);
-				} catch (Exception e) {
+				} catch (RuntimeException re) {
+					LogUtil.errorLogInfo("", TAG, re);
+				}
+				catch (Exception e) {
 					Log.e(TAG, "[LIGHT] - Exception Occur !!!");
-					e.printStackTrace();
+					//e.printStackTrace();            
+            		LogUtil.errorLogInfo("", TAG, e);
 				}
 			}
 			else if (TargetId >= ID.SmartLight.button.Room_TITLE_1 && TargetId <= ID.SmartLight.button.Room_TITLE_10) {
@@ -799,9 +836,13 @@ public class SmartLightScreen extends WpadScreen {
 					LedConverter.setImageResource(R.drawable.smartlight_led_red);
 				}
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[updateScreen] - DC_APU Exception !!!");
-			e.printStackTrace();
+			//e.printStackTrace();            
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 
 		try {
@@ -829,9 +870,13 @@ public class SmartLightScreen extends WpadScreen {
 				}
 				mLightSpaceUnit[0].serLightStatus(state);
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[updateScreen] - LIVING_ENERGY_METER Exception !!!");
-			e.printStackTrace();
+			//e.printStackTrace();            
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 
 		try {
@@ -860,11 +905,13 @@ public class SmartLightScreen extends WpadScreen {
 					// 모든 침실 에너지미터
 					if (mNowMonth.equals("NOW")) {
 						for (int i = 0; i < count; i++) {
+							Log.d(TAG, "[updateScreen] mData.RoomEMData[" + i + "].Data.LightElecNow = " + mData.RoomEMData[i].Data.LightElecNow);
 							mLightSpaceUnit[i+1].updateElectricityConsumption(mData.RoomEMData[i].Data.LightElecNow);
 						}
 					}
 					else if (mNowMonth.equals("MONTH")) {
 						for (int i = 0; i < count; i++) {
+							Log.d(TAG, "[updateScreen] mData.RoomEMData[" + i + "].Data.LightElecAcc = " + mData.RoomEMData[i].Data.LightElecAcc);
 							mLightSpaceUnit[i+1].updateElectricityConsumption(mData.RoomEMData[i].Data.LightElecAcc);
 						}
 					}
@@ -884,9 +931,13 @@ public class SmartLightScreen extends WpadScreen {
 					}
 				}
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[updateScreen] - ENERGY_METER Exception !!!");
-			e.printStackTrace();
+			//e.printStackTrace();            
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -915,9 +966,14 @@ public class SmartLightScreen extends WpadScreen {
 		printDebugLog("[loadDeviceSDBAPI] - Step1 : SMART_DISTRIBUTION API Load...");
 		try {
 			mSdbAPI = wallpadAPI.Get_SdbController();
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] loadDeviceSDBAPI(WallPadAPI wallpadAPI)");
-			e.printStackTrace();
+			//e.printStackTrace();            
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 
@@ -931,7 +987,7 @@ public class SmartLightScreen extends WpadScreen {
 	/**
 	 * 디바이스 드라이버를 로딩한다.
 	 *
-	 * @param wpapi    - (WallPadAPI) wpapi
+	 * @param wallpadAPI    - (WallPadAPI) wpapi
 	 * @return (int) - >=0 : 성공, <0 : 실패
 	 */
 	private int loadDeviceLivingLightAPI(WallPadAPI wallpadAPI) {
@@ -949,9 +1005,14 @@ public class SmartLightScreen extends WpadScreen {
 		printDebugLog("[loadDeviceLivingLightAPI] - Step1 : sdbLivingRoomLightAPI API Load...");
 		try {
 			mSdb_LivingRoomLightAPI = wallpadAPI.Get_Sdb_LivingRoomLightAPI();
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[loadDeviceLivingLightAPI] - [Exception Error] wallpadAPI.Get_Sdb_LivingRoomLightAPI");
-			e.printStackTrace();
+			//e.printStackTrace();            
+            LogUtil.errorLogInfo("", TAG, e);
 			return -100;
 		}
 
@@ -983,16 +1044,22 @@ public class SmartLightScreen extends WpadScreen {
 		if (devKind == DEV_KIND.LIVING_ENERGY_METER) {
 			// 거실 에너지미터 업데이트
 			try {
-				ret = mSdb_LivingRoomLightAPI.Refresh();
+				if(mSdb_LivingRoomLightAPI!=null)
+					ret = mSdb_LivingRoomLightAPI.Refresh();
 				if (ret < 0) {
 					Log.e(TAG, "[updateDeviceData] - mSdb_LivingRoomLightAPI.Refresh - ret (" + ret + ")" + mSdb_LivingRoomLightAPI.ErrorCode.ErrStr());
 					return -2;
 				}
 				mData.mLivingEMData = mSdb_LivingRoomLightAPI.data;
 				return 0;
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -102;
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[updateDeviceData] - [Exception Error] mSdb_LivingRoomLightAPI.Refresh (index:" + index);
-				e.printStackTrace();
+				//e.printStackTrace();            
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -102;
 			}
 		}
@@ -1028,9 +1095,14 @@ public class SmartLightScreen extends WpadScreen {
 				}
 
 				return 0;
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -102;
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[updateDeviceData] - [Exception Error] mSdbAPI.Refresh (index:" + index);
-				e.printStackTrace();
+				//e.printStackTrace();            
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -102;
 			}
 		}
@@ -1074,9 +1146,14 @@ public class SmartLightScreen extends WpadScreen {
 		if (OnOff) {
 			try {
 				DevAPI.regChangedBR(BR_NAME);
-			} catch(Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -101;
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[registerDeviceBR] - [Exception Error] DevAPI.regChangedBR (DevKind:" + DevKind + ")");
-				e.printStackTrace();
+				//e.printStackTrace();            
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -101;
 			}
 			super.addBrActionFilter(BR_NAME);
@@ -1084,9 +1161,14 @@ public class SmartLightScreen extends WpadScreen {
 		else {
 			try {
 				DevAPI.unregChangedBR(BR_NAME);
-			} catch(Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+				return -102;
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[registerDeviceBR] - [Exception Error] DevAPI.unregChangedBR (DevKind:" + DevKind + ")");
-				e.printStackTrace();
+				//e.printStackTrace();            
+            	LogUtil.errorLogInfo("", TAG, e);
 				return -102;
 			}
 			super.removeBrActionFilter(BR_NAME);

+ 6 - 1
WallPadEnergyCtrl/src/main/java/kr/co/icontrols/wallpadenergyctrl/util/StringUtil.java

@@ -14,6 +14,7 @@ import java.util.StringTokenizer;
 
 import com.artncore.WallPadDataMgr.WallpadStatusData;
 import com.artncore.WallPadDataMgr.wallpaddbmgr.AddressSet;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadenergyctrl.declare.Common;
 import android.annotation.SuppressLint;
@@ -70,7 +71,11 @@ public class StringUtil {
         } else {
             try {
                 result = Integer.parseInt(str);
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
+            catch (Exception e) {
+                LogUtil.errorLogInfo("", TAG, e);
             }
         }
         return result;

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott