소스 검색

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

DESKTOP-FBA840V\icontrols 4 년 전
부모
커밋
6b323cbd0b

+ 187 - 63
WallPadEmergency/src/main/java/kr/co/icontrols/v40ioctl/V40IF.java

@@ -3,6 +3,7 @@ package kr.co.icontrols.v40ioctl;
 import android.os.Build;
 import android.util.Log;
 
+import com.util.LogUtil;
 import kr.co.icontrols.wallpadsupport.Version;
 
 public class V40IF {
@@ -45,9 +46,13 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT = new V40IOInterface2();
             else mV40IOIF = new V40IOInterface();
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] V40IF()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -55,20 +60,42 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) return mV40IOIF_NOUGAT.WpdInterfaceOpen();
             else return mV40IOIF.WpdInterfaceOpen();
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+            return -99;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] WpdInterfaceOpen()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -99;
         }
     }
 
     public int WpdInterfaceClose() {
         try {
-            if (Build.VERSION.SDK_INT > 23) return mV40IOIF_NOUGAT.WpdInterfaceClose();
-            else return mV40IOIF.WpdInterfaceClose();
-        } catch (Exception e) {
+            if (Build.VERSION.SDK_INT > 23)
+            {
+                if(mV40IOIF_NOUGAT!=null) {
+                    return mV40IOIF_NOUGAT.WpdInterfaceClose();
+                }
+                else
+                    return -99;
+            }
+            else{
+                if(mV40IOIF!=null)
+                    return mV40IOIF.WpdInterfaceClose();
+                else
+                    return -99;
+            }
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+            return -99;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] WpdInterfaceClose()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -99;
         }
     }
@@ -77,9 +104,14 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) return mV40IOIF_NOUGAT.WpdInterfaceControl(cmd, arg);
             else return mV40IOIF.WpdInterfaceControl(cmd, arg);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+            return -99;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] WpdInterfaceControl(int cmd, int arg)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -99;
         }
     }
@@ -88,9 +120,13 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.SetMacAddr(mac);
             else mV40IOIF.SetMacAddr(mac);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] SetMacAddr(String mac)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -98,9 +134,13 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.IpAddr(ip);
             else mV40IOIF.IpAddr(ip);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] IpAddr(String ip)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -108,9 +148,13 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.GatewayIp(gw);
             else mV40IOIF.GatewayIp(gw);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] GatewayIp(String gw)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -118,9 +162,13 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.NetMask(mask);
             else mV40IOIF.NetMask(mask);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] NetMask(String mask)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -128,9 +176,13 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.NetAll(ip, mask, gw, mac);
             else mV40IOIF.NetAll(ip, mask, gw, mac);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] NetAll(String ip, String mask, String gw, String mac)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -138,9 +190,13 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.LiveUpdate();
             else mV40IOIF.LiveUpdate();
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] LiveUpdate()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -148,9 +204,13 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.UsbUpdate();
             else mV40IOIF.UsbUpdate();
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] UsbUpdate()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -158,9 +218,14 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) return mV40IOIF_NOUGAT.LcdWakeUp();
             else return mV40IOIF.LcdWakeUp();
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+            return -99;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] LcdWakeUp()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -99;
         }
     }
@@ -169,9 +234,13 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.Reboot(sec);
             else mV40IOIF.Reboot(sec);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] Reboot(int sec)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -179,9 +248,13 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.NetDns1(dns);
             else mV40IOIF.NetDns1(dns);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] NetDns1(String dns)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -189,9 +262,13 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.NetDns2(dns);
             else mV40IOIF.NetDns2(dns);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] NetDns2(String dns)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -199,9 +276,14 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) return mV40IOIF_NOUGAT.sensorread();
             else return mV40IOIF.sensorread();
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+            return -99;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] sensorread()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -99;
         }
     }
@@ -210,9 +292,14 @@ public class V40IF {
         try {
             if (Build.VERSION.SDK_INT > 23) return mV40IOIF_NOUGAT.LcdWakeUp();
             else return mV40IOIF.LcdWakeUp();
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+            return -99;
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] setLcdWakeUp()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -99;
         }
     }
@@ -222,9 +309,13 @@ public class V40IF {
             Log.i(TAG, "[setDns] DNS1 : " + dns1 + " / DNS2 : " + dns2);
             NetDns1(dns1);
             NetDns2(dns2);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] setDns(String dns1, String dns2)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -232,9 +323,13 @@ public class V40IF {
         try {
             Log.i(TAG, "[setV40Reboot] V40 Device will reboot : " +sec + " second !!!");
             Reboot(sec);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] setV40Reboot(int sec)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -242,9 +337,13 @@ public class V40IF {
         try {
             Log.i(TAG, "[setMACAddress] strMAC [" + strMAC+ "]");
             SetMacAddr(strMAC);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] setMACAddress(String strMAC)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -252,9 +351,13 @@ public class V40IF {
         try {
             Log.i(TAG, "[setIPAddress] strIP [" + strIP + "]");
             IpAddr(strIP);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] setIPAddress(String strIP)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -262,9 +365,13 @@ public class V40IF {
         try {
             Log.i(TAG, "[setNetmaskAddress] strNetmask [" + strNetmask + "]");
             NetMask(strNetmask);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] setNetmaskAddress(String strNetmask)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -272,9 +379,13 @@ public class V40IF {
         try {
             Log.i(TAG, "[setGatewayAddress] strGateway [" + strGateway+ "]");
             GatewayIp(strGateway);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] setGatewayAddress(String strGateway)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -283,9 +394,13 @@ public class V40IF {
             Log.i(TAG, "[setNetworkInterface] strIP [" + strIP+ "], strNetmask [" + strNetmask+ "], strGateway [" + strGateway+ "], strMAC [" + strMAC+ "]");
 
             NetAll(strIP, strNetmask, strGateway, strMAC);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] setNetworkInterface(String strIP, String strNetmask, String strGateway, String strDNS, String strMAC)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -298,9 +413,13 @@ public class V40IF {
             GatewayIp(strGateway);
             // DNS 설정 JNI method는 아직 없음(2018.02.26)
             SetMacAddr(strMAC);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] setNetworkInterface(String strIP, String strNetmask, String strGateway, String strDNS, String strMAC)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -310,8 +429,12 @@ public class V40IF {
                 WpdInterfaceControl(0xFF09, (ctr)?1:0);
                 WpdInterfaceClose();
             }
-        } catch (Exception e) {
-            e.printStackTrace();
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -322,15 +445,12 @@ public class V40IF {
         WpdInterfaceClose();
     }
 
-    public void setEmergencyType() {
+    public void setEmergencyType(boolean bSet) {
+        int value = bSet ? 1: 0;
         WpdInterfaceOpen();
         if (Version.getPlatformType() == Version.PLATFORM_TYPE.A40i) {
-            Log.d(TAG, "[setEmergencyType] V40 - D101 mode");
-            WpdInterfaceControl(IOCTL_EMR_TYPE, 0);
-        }
-        else {
-            Log.d(TAG, "[setEmergencyType] A20 - Previous mode");
-            WpdInterfaceControl(IOCTL_EMR_TYPE, 1);
+            Log.d(TAG, "[setEmergencyType] value [" + value + "]");
+            WpdInterfaceControl(IOCTL_EMR_TYPE, value);
         }
         WpdInterfaceClose();
     }
@@ -382,9 +502,13 @@ public class V40IF {
             else {
                 Log.w(TAG, "[IOInterface] Not supported PLATFORM_TYPE!!");
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] ctrlPopupGUI(boolean bUP");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 

+ 7 - 2
WallPadEmergency/src/main/java/kr/co/icontrols/v40ioctl/V40IOInterface.java

@@ -1,6 +1,7 @@
 package kr.co.icontrols.v40ioctl;
 
 import android.util.Log;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadsupport.Version;
 
@@ -109,9 +110,13 @@ public class V40IOInterface
 			else {
 				Log.w(TAG, "[IOInterface] Not supported PLATFORM_TYPE!!");
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] ctrlPopupGUI(boolean bUP");
-			e.printStackTrace();
+			//e.printStackTrace();            
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 

+ 7 - 2
WallPadEmergency/src/main/java/kr/co/icontrols/v40ioctl/V40IOInterface2.java

@@ -1,6 +1,7 @@
 package kr.co.icontrols.v40ioctl;
 
 import android.util.Log;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadsupport.Version;
 
@@ -119,8 +120,12 @@ public class V40IOInterface2 {
                 WpdInterfaceControl(0xFF09, (ctr)?1:0);
                 WpdInterfaceClose();
             }
-        } catch (Exception e) {
-            e.printStackTrace();
+        } catch (RuntimeException re) {
+            Log.e(TAG, "exception : " + re );
+        }
+		catch (Exception e) {
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 

+ 132 - 45
WallPadEmergency/src/main/java/kr/co/icontrols/wallpademergency/MainActivity.java

@@ -20,6 +20,7 @@ import android.view.View;
 import android.view.WindowManager;
 import android.widget.RelativeLayout;
 
+import com.util.LogUtil;
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
 import java.text.SimpleDateFormat;
@@ -108,9 +109,13 @@ public class MainActivity extends WpadActivity
             nCurrentVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
             audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, nEmergencyVolume, 0);
             Log.i(TAG, "[setEmegencySystemVolume] #Before# nCurrentVolume = " + nCurrentVolume + ", #After# nEmergencyVolume = " + nEmergencyVolume);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] setEmegencySystemVolume()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
 	}
 
@@ -125,9 +130,13 @@ public class MainActivity extends WpadActivity
 			audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, nSavedVolume, 0);
             Log.i(TAG, "[restoreSystemVolume] #Before# nCurrentVolume = " + nCurrentVolume + ", #After# nSavedVolume = " + nSavedVolume);
 			
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] restoreSystemVolume()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
     // =================================================================================================
@@ -162,7 +171,7 @@ public class MainActivity extends WpadActivity
 		mSound = new WpadSound(this);
 
 		mV40IF = new V40IF();
-		mV40IF.setEmergencyType();
+		mV40IF.setEmergencyType(false);
 
 		/**
 		 * 비상앱이 실행될 때, 비상 LED 점멸 시작
@@ -227,9 +236,13 @@ public class MainActivity extends WpadActivity
 		Log.d(TAG, "MENU_DETAIL_INFO = " + m_DetailInfo);
 		
 		
-		if (m_DetailInfo == null || m_DetailInfo.compareTo("모름") == 0) {
+		if (m_DetailInfo == null || m_DetailInfo.compareTo("모름") == 0 || m_DetailInfo.equals("재로딩")) {
 			m_DetailInfo = Common.get_AlarmDatailInfo(this.getContext());
-			Log.d(TAG, "MENU_DETAIL_INFO = " + m_DetailInfo);// detailInfo 시험
+			if(m_DetailInfo.equals("모름"))
+			{
+				m_DetailInfo = Common.get_AlarmDatailInfoatSharedPreferences(this.getContext());
+			}
+			Log.d(TAG, "-------------------MENU_DETAIL_INFO = " + m_DetailInfo);// detailInfo 시험
 		}
 		else if (m_DetailInfo.equals("restart")) {
 			setDetailInfo_restart(m_DetailInfo);
@@ -241,6 +254,7 @@ public class MainActivity extends WpadActivity
 				StartDeviceID = 7011;
 			}
 			Common.set_AlarmDatailInfo( this.getContext() , m_DetailInfo);
+			Common.set_AlarmDatailInfoatSharedPreferences(this.getContext() , m_DetailInfo);
 		}
 		
 		if (StartDeviceID == 7011) {
@@ -315,7 +329,10 @@ public class MainActivity extends WpadActivity
 //            				}
 //            				Log.d(TAG, "[wdb.GetAlarmStatus() ]-" + wdb.GetAlarmStatus());
 //            			}
-//            		}catch( Exception e )
+//            		} catch (RuntimeException re) {
+						//LogUtil.errorLogInfo("", TAG, re);
+					//}
+					//catch (Exception e )
 //            		{
 //            			Log.d(TAG, "[Exception]-" + e.toString());
 //            		}
@@ -323,7 +340,10 @@ public class MainActivity extends WpadActivity
 				Log.d(TAG, " Intent m_StartOptionID value fail " + m_StartOptionID);
 			}
 
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.d(TAG, "[Exception]-" + e.toString());
 		}
 
@@ -371,6 +391,9 @@ public class MainActivity extends WpadActivity
 
 		mV40IF.ctrlEmergencyLEDOff(); // 비상앱이 종료될 때, 비상 LED 점멸 종료
 
+		if (Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I)
+			mV40IF.setEmergencyType(true);
+
 		mSound.Release();
 
 		Log.i(TAG, "*************************************************************");
@@ -428,9 +451,13 @@ public class MainActivity extends WpadActivity
 						if (kind == define.NOTIFY_ALARM_RELEASE) finishActivity();
 					}
 				}
-			} catch (Exception e) {
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
 				Log.e(TAG, "[Exception] onReceive(Context context, Intent intent)");
-				e.printStackTrace();
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 		}
 	}
@@ -441,9 +468,13 @@ public class MainActivity extends WpadActivity
 			IntentFilter filter = new IntentFilter();
 			filter.addAction(define.NOTIFY_ACNAME);
 			registerReceiver(mEventReceiver, filter, null, null);
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] registerBRReceiver()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -452,9 +483,13 @@ public class MainActivity extends WpadActivity
 			if (mEventReceiver != null) {
 				unregisterReceiver(mEventReceiver);
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] unregisterBRReceiver()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
     
@@ -601,7 +636,11 @@ public class MainActivity extends WpadActivity
                     mCurrentScreenId = -1;
                     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);
             mCurrentScreenId = -1;
             return false;
@@ -636,9 +675,13 @@ public class MainActivity extends WpadActivity
 				if (DBinfo[1].indexOf("사용함") > 0) bResult = true;
 				else bResult = false;
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e("Common", "[Exception] getAsSubWallPad()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 		Log.i(TAG, "[GetWallPadType] bResult [" + bResult + "]");
 		return bResult;
@@ -648,9 +691,13 @@ public class MainActivity extends WpadActivity
 		try {
 			Log.d(TAG, "[finishActivity] ========== START ==========");
 			super.finish();
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] finishActivity()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -667,9 +714,14 @@ public class MainActivity extends WpadActivity
 			intent.putExtra(Intent.EXTRA_KEY_EVENT, event);
 			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;
@@ -684,9 +736,13 @@ public class MainActivity extends WpadActivity
 			if (bEnable) TopManualBtn.setVisibility(View.VISIBLE);
 			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);
 		}
 	}
 
@@ -715,9 +771,13 @@ public class MainActivity extends WpadActivity
 				Log.d(TAG, "[getManualUse] Not Use Manual [2]");
 				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;
@@ -757,9 +817,13 @@ public class MainActivity extends WpadActivity
 	public static void resetCurrentManualScreenID() {
 		try {
 			mCurrentManualScreenId = -1;
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", "", re);
+        }
+		catch (Exception e) {
 			Log.e("MainActivity", "[Exception] resetCurrentManualScreenID()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", "", e);
 		}
 	}
 
@@ -772,10 +836,14 @@ public class MainActivity extends WpadActivity
 				mManualActivity.finish();
 			}
 		}
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", "", re);
+        }
 		catch (Exception e)
 		{
 			Log.e("MainActivity", "[Exception] FinishManualActivity()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", "", e);
 		}
 	}
 
@@ -790,9 +858,13 @@ public class MainActivity extends WpadActivity
 			data.closeDB();
 			Log.d(TAG, "[GetEasyModeUXUse] EasymodeSupport" + EasymodeSupport + "], bUse [" + EasyModeUse + "]");
 			return EasymodeSupport & EasyModeUse;
-		} 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;
 	}
@@ -818,21 +890,32 @@ public class MainActivity extends WpadActivity
 				strResult = line;
 			}
 
-			if (strResult.equals("0")) {
-				Log.e(TAG, "[checkLCDOnByCMD] LCD On");
-				return true;
-			}
-			else if (strResult.equals("1")) {
-				Log.e(TAG, "[checkLCDOnByCMD] LCD Off");
-				return false;
+			if(strResult!=null)
+			{
+				if (strResult.equals("0")) {
+					Log.e(TAG, "[checkLCDOnByCMD] LCD On");
+					return true;
+				}
+				else if (strResult.equals("1")) {
+					Log.e(TAG, "[checkLCDOnByCMD] LCD Off");
+					return false;
+				}
+				else {
+					Log.e(TAG, "[checkLCDOnByCMD] Unknown value [" + strResult + "], return false!!!");
+					return false;
+				}
 			}
-			else {
-				Log.e(TAG, "[checkLCDOnByCMD] Unknown value [" + strResult + "], return false!!!");
+			else
 				return false;
-			}
-		} catch (Exception e) {
+
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return false;
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] checkLCDOnByCMD()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 			return false;
 		}
 	}
@@ -859,9 +942,13 @@ public class MainActivity extends WpadActivity
 				Log.d(TAG, "[getCompareBSPVersion] BSP VERSION OVER!");
 				return true;
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] getCompareBSPVersion()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 		return false;
 	}

+ 19 - 5
WallPadEmergency/src/main/java/kr/co/icontrols/wallpademergency/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.wallpademergency.declare.Common;
 import kr.co.icontrols.wallpademergency.declare.ID;
@@ -96,7 +97,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);
         }
@@ -249,10 +253,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;
         }
@@ -315,9 +325,13 @@ public class ManualActivity extends WpadActivity {
             data.closeDB();
             Log.d(TAG, "[GetEasyModeUXUse] EasymodeSupport" + EasymodeSupport + "], bUse [" + EasyModeUse + "]");
             return EasymodeSupport & EasyModeUse;
-        } 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;
     }

+ 23 - 6
WallPadEmergency/src/main/java/kr/co/icontrols/wallpademergency/PopupActivity.java

@@ -13,6 +13,7 @@ import android.view.KeyEvent;
 import android.view.MotionEvent;
 import android.view.View;
 import android.widget.RelativeLayout;
+import com.util.LogUtil;
 import kr.co.icontrols.wallpademergency.declare.Common;
 import kr.co.icontrols.wallpademergency.declare.ID;
 import kr.co.icontrols.wallpademergency.screen.PopupInputPw;
@@ -110,7 +111,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); }
         
         
         // 5. Start ScreenId Data Get
@@ -282,7 +286,12 @@ 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);
             mCurrentScreenId = -1;
@@ -416,18 +425,26 @@ public class PopupActivity extends WpadActivity
 			HandleMsg.arg1 = arg1;
 			HandleMsg.arg2 = arg2;
 			PopupScreenHandler.sendMessageDelayed(HandleMsg, delay);
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] sendHandlerMsgDelayed(msg)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
 	private void finishPopup() {
 		try {
 			super.finish();
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] finishPopup()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 }

+ 58 - 8
WallPadEmergency/src/main/java/kr/co/icontrols/wallpademergency/declare/Common.java

@@ -1,11 +1,13 @@
 package kr.co.icontrols.wallpademergency.declare;
 
+import com.util.LogUtil;
 import com.artncore.WallPadDataMgr.WallpadDeviceSet;
 import com.artncore.WallPadDataMgr.wallpaddbmgr;
 import com.artncore.commons.define;
 
 import android.content.Context;
 import android.content.Intent;
+import android.content.SharedPreferences;
 import android.util.Log;
 
 public final class Common
@@ -217,7 +219,7 @@ public final class Common
 		{
 			Thread.sleep(time);
 		}
-		catch( InterruptedException e)
+		catch (InterruptedException e)
 		{
 			Log.d("Common", "Thread Exception : " + e);
 		}
@@ -266,11 +268,52 @@ public final class Common
 			}
 			mgr.closeDB();
 		}
-		catch( Exception e)
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+		}
+	}
+
+	public static void set_AlarmDatailInfoatSharedPreferences(Context context, String info)
+	{
+		try
 		{
-			e.printStackTrace();
+			//DB에 기록되지 않는 경우를 대비 하기 위해 이전에 올라온 정보를 한번 더 저장
+			SharedPreferences sharedPreferences = context.getSharedPreferences("Emergency",context.MODE_PRIVATE);
+			SharedPreferences.Editor editor = sharedPreferences.edit();
+			editor.putString(DB_WALLPAD_ALARM_DETAIL_INFO, info);
+			editor.commit();
+		}
+		catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e) {
+			//e.printStackTrace();
+			LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
+
+	public static String get_AlarmDatailInfoatSharedPreferences(Context context)
+	{
+		String ret = "모름";
+		try
+		{
+			SharedPreferences sharedPreferences = context.getSharedPreferences("Emergency",context.MODE_PRIVATE);
+			ret = sharedPreferences.getString(DB_WALLPAD_ALARM_DETAIL_INFO, "모름");
+		}
+		catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e) {
+			//e.printStackTrace();
+			LogUtil.errorLogInfo("", TAG, e);
+		}
+
+		return ret;
+	}
 	
 	public static String get_AlarmDatailInfo(Context context)
 	{
@@ -289,9 +332,12 @@ public final class Common
 			ret = strRet;
 			mgr.closeDB();
 		}
-		catch( Exception e)
-		{
-			e.printStackTrace();
+		catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 		
 		return ret;	
@@ -336,9 +382,13 @@ public final class Common
 			iMobileServieIntent.setAction(BR_ARARM_EVENT);
 			iMobileServieIntent.putExtra("KIND", kind);
 			context.sendBroadcast(iMobileServieIntent);
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] MobileServiceAlamBR(Context context, String kind)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 

+ 8 - 3
WallPadEmergency/src/main/java/kr/co/icontrols/wallpademergency/imap/iMAPAlarmOperation.java

@@ -86,7 +86,10 @@ public class iMAPAlarmOperation extends WallPadiMAPClient{
 			{
 				EMER_DETAIL_INFO [] test = EMER_DETAIL_INFO.values();
 				return test[idx];
-			}catch( Exception e )
+			} catch (RuntimeException re) {
+				Log.d("yskim", "[GetDetailInfo] --------- e: " + re.toString() );
+			}
+			catch (Exception e )
 			{
 				Log.d("yskim", "[GetDetailInfo] --------- e: " + e.toString() );
 			}
@@ -160,9 +163,11 @@ public class iMAPAlarmOperation extends WallPadiMAPClient{
             String result = GetAttributeVal(0, "result");
             if (result != null) {
                 if (result.equalsIgnoreCase("ok")) {
-                    if ((GetAttributeVal(0, "name")
+                	String name = GetAttributeVal(0, "name");
+                	String type = GetAttributeVal(0, "type");
+                    if ((name!=null && name
                             .equalsIgnoreCase("alarm_operation"))
-                            && (GetAttributeVal(0, "type")
+                            && (type!=null && type
                                     .equalsIgnoreCase("reply"))) {
                         Proc.ProcSuccess();
                     }

+ 30 - 13
WallPadEmergency/src/main/java/kr/co/icontrols/wallpademergency/imap/iMAP_Evacuation_ladder_open.java

@@ -6,8 +6,10 @@ import java.util.Calendar;
 import android.content.Context;
 import android.util.Log;
 
+import com.artncore.WallPadDataMgr.WallpadDeviceSet;
 import com.artncore.WallPadDataMgr.WallpadStatusData;
 import com.artncore.WallPadDataMgr.wallpaddbmgr.AddressSet;
+import com.util.LogUtil;
 import com.artncore.wallpadimap.RetProci;
 import com.artncore.wallpadimap.WallPadiMAPClient;
 
@@ -68,24 +70,37 @@ public class iMAP_Evacuation_ladder_open extends WallPadiMAPClient{
         myDong = addc.Dong;
         myHo = addc.Ho;
 
-        //윗집 주소 구하기
+        //윗집 or 아랫집 주소 구하기
         try
         {
-            String[] SplitedString = myIP.split("\\.");
-            if(SplitedString != null)
+            if(myIP!=null)
             {
-                if(SplitedString.length == 4)
+                String[] SplitedString = myIP.split("\\.");
+                if(SplitedString != null)
                 {
-                    int temp = Integer.parseInt(SplitedString[2]);
-                    temp = temp + 1;
-                    ServerIP = SplitedString[0] + "." + SplitedString[1] + "." + temp + "." + SplitedString[3];
-                    Log.d(TAG, "Upstair IP address : " + ServerIP);
+                    if(SplitedString.length == 4)
+                    {
+                        int temp = Integer.parseInt(SplitedString[2]);
+                        WallpadDeviceSet wds = new WallpadDeviceSet(ctx);
+                        int ladderDownSend = wds.getEscapeLadderDownSend();
+                        wds.closeDB();
+                        Log.i(TAG, "[iMAP_Evacuation_ladder_open] ladderDownSend [" + ladderDownSend + "]");
+                        if (ladderDownSend == WallpadDeviceSet.ESCAPELADDER_DOWN_SEND_UPPER) temp = temp + 1; // 윗집 전송
+                        else if (ladderDownSend == WallpadDeviceSet.ESCAPELADDER_DOWN_SEND_BELOW) temp = temp - 1; // 아랫집 전송
+                        ServerIP = SplitedString[0] + "." + SplitedString[1] + "." + temp + "." + SplitedString[3];
+                        Log.d(TAG, "[iMAP_Evacuation_ladder_open] IP address : " + ServerIP);
+                    }
                 }
             }
+
+        }
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
         }
-        catch (Exception e)
+		catch (Exception e)
         {
-            e.printStackTrace();            
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
         
         //타임아웃 설정
@@ -128,7 +143,9 @@ public class iMAP_Evacuation_ladder_open extends WallPadiMAPClient{
             {
                 if (result.equalsIgnoreCase("ok"))
                 {
-                    if ((GetAttributeVal(0, "name").equalsIgnoreCase("evacuation_ladder_open")) && (GetAttributeVal(0, "type").equalsIgnoreCase("reply")))
+                    String name = GetAttributeVal(0, "name");
+                    String type = GetAttributeVal(0, "type");
+                    if ((name!=null && name.equalsIgnoreCase("evacuation_ladder_open")) && (type!=null && type.equalsIgnoreCase("reply")))
                     {                       
                         Proc.ProcSuccess();   
                         return;                    
@@ -139,7 +156,7 @@ public class iMAP_Evacuation_ladder_open extends WallPadiMAPClient{
         }     
         else
         {
-            Proc.ProcError();
+            if(Proc!=null) Proc.ProcError();
         }
     }
     protected void ProcError()
@@ -148,7 +165,7 @@ public class iMAP_Evacuation_ladder_open extends WallPadiMAPClient{
     }
     
     /**
-     * 피난사다리 열림에 대한 윗집 알림
+     * 피난사다리 열림에 대한 윗집 또는 아랫집 알림
      *
      */
     public void DoWork()

+ 97 - 39
WallPadEmergency/src/main/java/kr/co/icontrols/wallpademergency/screen/EmergencyMainScreen.java

@@ -7,7 +7,6 @@ import com.artncore.WallPadDataMgr.WallpadDeviceSet;
 import com.artncore.WallPadDataMgr.WallpadStatusData;
 import com.artncore.WallPadDataMgr.wallpaddbmgr.AddressSet;
 import com.artncore.commons.APIErrorCode;
-import com.artncore.devicectr.WallPadInterface;
 import com.artncore.wallpadimap.RetProci;
 
 import android.annotation.SuppressLint;
@@ -24,6 +23,7 @@ import android.view.View;
 import android.view.WindowManager;
 import android.widget.RelativeLayout;
 
+import com.util.LogUtil;
 import kr.co.icontrols.v40ioctl.V40IF;
 import kr.co.icontrols.wallpademergency.MainActivity;
 import kr.co.icontrols.wallpademergency.PopupActivity;
@@ -32,7 +32,6 @@ import kr.co.icontrols.wallpademergency.R.drawable;
 import kr.co.icontrols.wallpademergency.declare.Common;
 import kr.co.icontrols.wallpademergency.declare.ID;
 import kr.co.icontrols.wallpademergency.imap.iMAPAlarmOperation;
-import kr.co.icontrols.wallpadsupport.Version;
 import kr.co.icontrols.wallpadsupport.WpadImageView;
 import kr.co.icontrols.wallpadsupport.WpadScale;
 import kr.co.icontrols.wallpadsupport.WpadScreen;
@@ -182,9 +181,13 @@ public class EmergencyMainScreen extends WpadScreen{
 //			Log.d(TAG, "strOfficeGuardIPAddr : " + strOfficeGuardIPAddr);
 			PingTestThread thPingTest = new PingTestThread();
 			thPingTest.start();
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 		    Log.e(TAG, "[Exception] initInfo()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 	
@@ -264,7 +267,7 @@ public class EmergencyMainScreen extends WpadScreen{
 				setManualBtnVisible(PopupActivity.getManualUse());
 
 				setTextEmergencyStatus(EmergencyType.GetContentsText(type));
-				mHandler.sendEmptyMessage(0);
+				if(mHandler!=null) mHandler.sendEmptyMessage(0);
 
 			} else {
 
@@ -319,11 +322,16 @@ public class EmergencyMainScreen extends WpadScreen{
 				setManualBtnVisible( PopupActivity.getManualUse() );
 
 				setTextEmergencyStatus(EmergencyType.GetContentsText(type));
-				mHandler.sendEmptyMessage(0);
+				if(mHandler!=null)
+					mHandler.sendEmptyMessage(0);
 			}
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] EmergencyMainScreen(Context context, RelativeLayout layout , EmergencyType type , int state , String detailInfo)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
 	}
 
@@ -377,9 +385,13 @@ public class EmergencyMainScreen extends WpadScreen{
 					return EMER_DETAIL_INFO.GetDetailInfo(i);
 				}
 			}
-		} catch (Exception e) {
+		} catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
 			Log.e(TAG, "[Exception] GetAlarmDetailInfo(String info)");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 		return EMER_DETAIL_INFO.OTHER;
 	}
@@ -412,7 +424,7 @@ public class EmergencyMainScreen extends WpadScreen{
 						MainActivity.mSound.PlayRepeat(SND.emergency.DEFAULT, -1, VOLUME_KIND.fixed.MAX);
                     }
 
-					mSoundStopHandler.sendEmptyMessageDelayed(0, 1000);
+					if(mSoundStopHandler!=null) mSoundStopHandler.sendEmptyMessageDelayed(0, 1000);
 				}
 				
 				if (m_EmergencyState == 1) {
@@ -421,14 +433,18 @@ public class EmergencyMainScreen extends WpadScreen{
 					Log.d(TAG, "[EmergencyChangeStopState] --------------------------------------------" + EMER_DETAIL_INFO.getStrName(detailInfo));
 					try {
 						WallpadDeviceSet wds = new WallpadDeviceSet(this.getContext());
-						boolean isDownLadder = wds.GetEscapeLadderDownRecv();
+						int ladderDownSend = wds.getEscapeLadderDownSend();
 						wds.closeDB();
-						Log.i(TAG, "isDownLadder = " + isDownLadder + " %%%%%%%%%%%%%%%%%%%%%");
+						Log.i(TAG, "[EmergencyChangeStopState] ladderDownSend = " + ladderDownSend + " %%%%%%%%%%%%%%%%%%%%%");
 
-						if( isDownLadder == true )
-						{
+						if( ladderDownSend == WallpadDeviceSet.ESCAPELADDER_DOWN_SEND_UPPER ) {
 							if (m_ReceiveAlarmInfo.equals("upladder_Open")) {
-								Log.d(TAG, "[EmergencyChangeStopState] SendNetworkLadderAlarm");
+								Log.d(TAG, "[EmergencyChangeStopState] SendNetworkLadderAlarm === upladder_Open");
+								SendNetworkLadderAlarm();
+							}
+						} else if( ladderDownSend == WallpadDeviceSet.ESCAPELADDER_DOWN_SEND_BELOW ) {
+							if (m_ReceiveAlarmInfo.equals("ladder_Open")) {
+								Log.d(TAG, "[EmergencyChangeStopState] SendNetworkLadderAlarm === ladder_Open");
 								SendNetworkLadderAlarm();
 							}
 						}
@@ -454,8 +470,12 @@ public class EmergencyMainScreen extends WpadScreen{
 							    SendAlarmOperationToServer3(strOfficeGuardIPAddr, ServerPort, EMER_STATE.FIRE , detailInfo );
                             }
 						}
-					} catch (Exception e) {
-						e.printStackTrace();
+					} catch (RuntimeException re) {
+						LogUtil.errorLogInfo("", TAG, re);
+					}
+					catch (Exception e) {
+						//e.printStackTrace();
+            			LogUtil.errorLogInfo("", TAG, e);
 					}
 				}
 			}
@@ -484,13 +504,21 @@ public class EmergencyMainScreen extends WpadScreen{
                             SendAlarmOperationToServer3(strOfficeGuardIPAddr, ServerPort, EMER_STATE.STOP, detailInfo);
                         }
                     }
-                } 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, "[Exception] EmergencyChangeStopState()");
-			e.printStackTrace();
+			//e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
 		}
 	}
 
@@ -584,9 +612,13 @@ public class EmergencyMainScreen extends WpadScreen{
             				wdb.SetAlarmStatus (WallpadStatusData.ALARM_NONE);
             				wdb.closeDB();
             			}
-            		} 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);
             		}
             		// 서버에 알람 발생 내역을 전송한다.
     				EMER_DETAIL_INFO detailInfo = GetAlarmDetailInfo(m_ReceiveAlarmInfo);
@@ -608,8 +640,12 @@ public class EmergencyMainScreen extends WpadScreen{
 	    				if (bOfficeGuardNetwork) {
 	    				    SendAlarmOperationToServer3(strOfficeGuardIPAddr, ServerPort, EMER_STATE.RETURN , detailInfo );
                         }
-    				} catch (Exception e) {
-    					e.printStackTrace();
+    				} catch (RuntimeException re) {
+						LogUtil.errorLogInfo("", TAG, re);
+					}
+					catch (Exception e) {
+    					//e.printStackTrace();
+            			LogUtil.errorLogInfo("", TAG, e);
     				}
     				
 					//Sound().Play(SND.mode.NORMALMODE_COMEBACK);
@@ -629,7 +665,13 @@ public class EmergencyMainScreen extends WpadScreen{
 
 					command_sound(Common.BR_MAIN_NOTI.SOUND_COMBACK_MODE);
 					
-					try {Thread.sleep(200);}catch (Exception e){e.printStackTrace();}
+					try {Thread.sleep(200);}
+					catch (RuntimeException re) {
+						LogUtil.errorLogInfo("", TAG, re);
+					}
+					catch (Exception e){
+						LogUtil.errorLogInfo("",TAG, e);//e.printStackTrace();
+					}
 					((MainActivity)this.getContext()).finish();
 				}
 			}
@@ -849,10 +891,10 @@ public class EmergencyMainScreen extends WpadScreen{
             	DebugLogOutput("3---------------------------------ProcDoing");
             }            
         });     
-    } 
-    
+    }
+
     private void SendNetworkLadderAlarm() {
-        iMAP_Evacuation_ladder_open imap_Evacuation_ladder_open = new iMAP_Evacuation_ladder_open(mCtx);
+    	iMAP_Evacuation_ladder_open imap_Evacuation_ladder_open = new iMAP_Evacuation_ladder_open(mCtx);
         imap_Evacuation_ladder_open.DoWork();
 
         imap_Evacuation_ladder_open.SetRetCtr(new RetProci() {
@@ -873,7 +915,7 @@ public class EmergencyMainScreen extends WpadScreen{
             }
         });
     }
-    
+
 	class PingTestThread extends Thread {
 		@Override
 		public void run() {
@@ -885,8 +927,12 @@ public class EmergencyMainScreen extends WpadScreen{
 				bOfficeGuardNetwork = PingTest(strOfficeGuardIPAddr);
 				Log.d(TAG, "[PingTestThread.run()] strControlGuardIPAddr [" + strControlGuardIPAddr + "], strOfficeGuardIPAddr [" + strOfficeGuardIPAddr + "]");
 				Log.d(TAG, "[PingTestThread.run()] bControlGuardNetwork [" + bControlGuardNetwork + "], bOfficeGuardNetwork [" + bOfficeGuardNetwork + "]");
-			} catch (Exception e) {
-				e.printStackTrace();
+			} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
+				//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
 			}
 	    }
 	}
@@ -903,8 +949,12 @@ public class EmergencyMainScreen extends WpadScreen{
     			   DebugLogOutput(ip + " ping test---------------------------------fail");
     			   return false;
     		   }
-        } catch (Exception e) {
-    		   e.printStackTrace();
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
+    		   //e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
     	}
     	return false;
     }
@@ -948,12 +998,20 @@ public class EmergencyMainScreen extends WpadScreen{
 		            	else {
 		            		if (mSoundStopHandler != null) mSoundStopHandler.sendEmptyMessageDelayed(2, 1000);
 		            	}
-	            	} catch (Exception e) {
-	            		e.printStackTrace();
+	            	} catch (RuntimeException re) {
+						LogUtil.errorLogInfo("", TAG, re);
+					}
+					catch (Exception e) {
+	            		//e.printStackTrace();
+            			LogUtil.errorLogInfo("", TAG, e);
 	            	}
 	            }
-        	} catch (Exception e) {
-        		e.printStackTrace();
+        	} catch (RuntimeException re) {
+				LogUtil.errorLogInfo("", TAG, re);
+			}
+			catch (Exception e) {
+        		//e.printStackTrace();
+            	LogUtil.errorLogInfo("", TAG, e);
         	}
         }
     };

+ 12 - 3
WallPadEmergency/src/main/java/kr/co/icontrols/wallpademergency/screen/PopupInputPw.java

@@ -123,7 +123,10 @@ public class PopupInputPw extends WpadScreen
 				SamplePassWord = GetDB().GetUserPW();
 				Log.d(TAG, "[DB] ------****************--SamplePassWord : " + SamplePassWord);
 			}
-		}catch( Exception e )
+		} catch (RuntimeException re) {
+			Log.d(TAG, "[Exception]-" + re.toString());
+        }
+		catch (Exception e )
 		{
 			Log.d(TAG, "[Exception]-" + e.toString());
 		}
@@ -227,7 +230,10 @@ public class PopupInputPw extends WpadScreen
     				
     				return true;
     			}
-    		}catch( Exception e )
+    		} catch (RuntimeException re) {
+				Log.d(TAG, "[Exception]-" + re.toString());
+			}
+			catch (Exception e )
     		{
     			Log.d(TAG, "[Exception]-" + e.toString());
     		}
@@ -301,7 +307,10 @@ public class PopupInputPw extends WpadScreen
             				GetDB().SetAlarmStatus (WallpadStatusData.ALARM_STOP);
             				
             			}
-            		}catch( Exception e )
+            		} catch (RuntimeException re) {
+						Log.d(TAG, "[Exception]-" + re.toString());
+					}
+					catch (Exception e )
             		{
             			Log.d(TAG, "[Exception]-" + e.toString());
             		}

+ 13 - 5
WallPadEmergency/src/main/java/kr/co/icontrols/wallpademergency/screen/manual/Emergency_Manual.java

@@ -7,7 +7,7 @@ import android.view.Gravity;
 import android.view.MotionEvent;
 import android.view.View;
 import android.widget.RelativeLayout;
-
+import com.util.LogUtil;
 import kr.co.icontrols.wallpademergency.MainActivity;
 import kr.co.icontrols.wallpademergency.ManualActivity;
 import kr.co.icontrols.wallpademergency.PopupActivity;
@@ -84,10 +84,14 @@ public class Emergency_Manual extends WpadScreen {
             }
 
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] Emergency_Manual");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -107,9 +111,13 @@ public class Emergency_Manual extends WpadScreen {
             if (nEvent == MotionEvent.ACTION_UP) {
                 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
WallPadEmergency/src/main/java/kr/co/icontrols/wallpademergency/screen/manual/InputPwd_Manual.java

@@ -8,6 +8,7 @@ import android.view.MotionEvent;
 import android.view.View;
 import android.widget.RelativeLayout;
 
+import com.util.LogUtil;
 import kr.co.icontrols.wallpademergency.declare.ID;
 import kr.co.icontrols.wallpadsupport.WpadImageView;
 import kr.co.icontrols.wallpadsupport.WpadScreen;
@@ -42,10 +43,14 @@ public class InputPwd_Manual extends WpadScreen {
                             "※ 초기 비밀번호는 \'0000\'입니다.");
 
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] InputPwd_Manual");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -65,9 +70,13 @@ public class InputPwd_Manual extends WpadScreen {
             if (nEvent == MotionEvent.ACTION_UP) {
                 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
WallPadEmergency/src/main/java/kr/co/icontrols/wallpademergency/subwallpadscreen/EmergencyScreen_SubWallPad.java

@@ -10,6 +10,7 @@ import android.view.Gravity;
 import android.view.WindowManager;
 import android.widget.RelativeLayout;
 
+import com.util.LogUtil;
 import kr.co.icontrols.wallpademergency.R;
 import kr.co.icontrols.wallpademergency.declare.Common;
 import kr.co.icontrols.wallpademergency.declare.ID;
@@ -80,18 +81,26 @@ public class EmergencyScreen_SubWallPad extends WpadScreen {
 
             setTextEmergencyStatus(EmergencyType.GetContentsText(type));
             mHandler.sendEmptyMessageDelayed(0,  500);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] EmergencyScreen_SubWallPad(Context context, RelativeLayout layout)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
     private void initInfo() {
         try {
 
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        }
+		catch (Exception e) {
             Log.e(TAG, "[Exception] initInfo()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }