INTERNAL: fix for save / open 25/23025/1
authorgreatim <jaewon81.lim@samsung.com>
Mon, 16 Jun 2014 09:31:30 +0000 (18:31 +0900)
committergreatim <jaewon81.lim@samsung.com>
Mon, 16 Jun 2014 09:31:30 +0000 (18:31 +0900)
Fix for 'save / open' feature with new database implementation.
Apply new 'open' implementation to kernel analysis page.
Apply new 'open' implementation to timeline page.
Rename ComponentInfo to DeviceStatusInfo, and now api name list is managed by DeviceStatusInfo instead of DeviceInfo.

Change-Id: I6584b18545d074870a43ac7deff4b25cb19cf73f
Signed-off-by: greatim <jaewon81.lim@samsung.com>
30 files changed:
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerConstants.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogParser.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/DeviceInfo.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/channel/control/DeviceStatusInfo.java [moved from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/channel/control/ComponentInfo.java with 90% similarity]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/channel/data/ApiNameManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/channel/data/LibraryObject.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/DataManagerRegistry.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/MessageParser.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/SystemData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/screenshot/ScreenshotView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/kernel/data/KernelDataMaker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/kernel/data/KernelDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/kernel/data/KernelDataPerThread.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/warning/WarningDataMaker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/CPUChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/CPUCoreChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/CPUFrequencyChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/EnergyChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/SystemMemoryChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineChartManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceProgressManager.java

index 7550bfc..4cba295 100644 (file)
@@ -107,18 +107,15 @@ public class AnalyzerConstants {
 
        /* project save index */
        public static final int PROJECT_VERSION_INDEX = 0;
-       public static final int PROJECT_DEVICE_INDEX = 1;
-       public static final int PROJECT_PACKAGE_ID_INDEX = 2;
-       public static final int PROJECT_APP_NAME_INDEX = 3;
-       public static final int PROJECT_CREATE_TIME_INDEX = 4;
-       public static final int PROJECT_LAST_TIME_INDEX = 5;
-       public static final int PROJECT_STOP_TIME_INDEX = 6;
-       public static final int PROJECT_PROF_START_TIME_INDEX = 7;
-       public static final int PROJECT_LOG_COUNT_INDEX = 8;
-       public static final int PROJECT_SYSTEM_COUNT_INDEX = 9;
-       public static final int PROJECT_PROFILE_COUNT_INDEX = 10;
-       public static final int PROJECT_SAVE_PATH_INDEX = 11;
-       public static final int PROJECT_MAIN_PID_INDEX = 12;
+       public static final int PROJECT_PROTOCOL_VERSION_INDEX = 1;
+       public static final int PROJECT_DEVICE_INDEX = 2;
+       public static final int PROJECT_PACKAGE_ID_INDEX = 3;
+       public static final int PROJECT_APP_NAME_INDEX = 4;
+       public static final int PROJECT_CREATE_TIME_INDEX = 5;
+       public static final int PROJECT_LAST_TIME_INDEX = 6;
+       public static final int PROJECT_STOP_TIME_INDEX = 7;
+       public static final int PROJECT_PROF_START_TIME_INDEX = 8;
+       public static final int PROJECT_SAVE_PATH_INDEX = 9;
        
 
        /* save return values */
index 7c7fac2..0df427a 100755 (executable)
@@ -64,7 +64,7 @@ import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
 
 public class AnalyzerManager {
        private static final DALogger DA_LOG = DALogger.getInstance();
-       
+
        private static Project project = null;
        private static boolean isRunning = false;
        private static boolean isLogParsingComplete = false;
@@ -76,12 +76,13 @@ public class AnalyzerManager {
        private static HashMap<Integer, HashMap<Long, String>> funcNameMapByPid = null;
 
        private static LeakDetector leakDetector = new LeakDetector();
-       private static NewLeakDetector newLeakDetector = new NewLeakDetector(); 
+       private static NewLeakDetector newLeakDetector = new NewLeakDetector();
        private static FailedChecker failedChecker = new FailedChecker();
        private static FailedChecker calledChecker = new FailedChecker();
        private static WarningChecker warningChecker = new WarningChecker();
        private static CallStackManager callstackManager = new CallStackManager();
-       private static SWAPCallStackManager swapCallstackManager = new SWAPCallStackManager(false);
+       private static SWAPCallStackManager swapCallstackManager = new SWAPCallStackManager(
+                       false);
 
        private static Timer screenshotTimer = null;
 
@@ -146,9 +147,9 @@ public class AnalyzerManager {
                                                        sourcePath));
                                        if (success) {
                                                // logs for debug
-                                               DA_LOG.debug("invalid project deleted!");       //$NON-NLS-1$
+                                               DA_LOG.debug("invalid project deleted!"); //$NON-NLS-1$
                                        } else {
-                                               DA_LOG.debug("invalid project delete fail..."); //$NON-NLS-1$
+                                               DA_LOG.debug("invalid project delete fail..."); //$NON-NLS-1$
                                        }
                                }
                        }
@@ -160,7 +161,7 @@ public class AnalyzerManager {
                imageListSize = 0;
 
                leakDetector.clear();
-               newLeakDetector.clear();        
+               newLeakDetector.clear();
                failedChecker.clear();
                warningChecker.clear();
                calledChecker.clear();
@@ -269,7 +270,7 @@ public class AnalyzerManager {
        public static LeakDetector getLeakDetector() {
                return leakDetector;
        }
-       
+
        public static NewLeakDetector getNewLeakDetector() {
                return newLeakDetector;
        }
@@ -283,6 +284,16 @@ public class AnalyzerManager {
        }
 
        public static BaseCallstackManager getCallstackManager() {
+               Project curProject = getProject();
+               if (curProject != null) {
+                       double pver = curProject.getProtocolVersion();
+                       if (pver >= 3.0) {
+                               return swapCallstackManager;
+                       } else if (pver > 0) {
+                               return callstackManager;
+                       }
+               }
+
                if (DACommunicator.isSWAPVersion()) {
                        return swapCallstackManager;
                } else {
@@ -299,12 +310,14 @@ public class AnalyzerManager {
                if (!AnalyzerManager.isExit()) {
                        Project project = new Project();
                        project.init();
-                       DA_LOG.performance("TEST", "Start Trace", "Create and Initialize Project data");
+                       DA_LOG.performance("TEST", "Start Trace",
+                                       "Create and Initialize Project data");
                }
 
                if (!AnalyzerManager.isExit()) {
                        AnalyzerUtil.executeCommand(StartHandler.ID);
-                       DA_LOG.performance("TEST", "Start Trace", "Execute command - StartHandler");
+                       DA_LOG.performance("TEST", "Start Trace",
+                                       "Execute command - StartHandler");
                }
 
        }
index 79df49f..4d9bcf9 100644 (file)
@@ -26,8 +26,8 @@
 
 package org.tizen.dynamicanalyzer.handlers;
 
+import java.io.File;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -37,10 +37,11 @@ import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-import org.tizen.dynamicanalyzer.common.GlobalInformation;
 import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.model.ImageInfo;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
@@ -48,12 +49,12 @@ import org.tizen.dynamicanalyzer.project.Project;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.sql.SqlManager;
 import org.tizen.dynamicanalyzer.swap.callstack.BaseCallstackManager;
-import org.tizen.dynamicanalyzer.swap.channel.control.ComponentInfo;
-import org.tizen.dynamicanalyzer.swap.channel.data.ApiNameManager;
+import org.tizen.dynamicanalyzer.swap.channel.control.DeviceStatusInfo;
 import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
 import org.tizen.dynamicanalyzer.swap.channel.data.LibraryObject;
 import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfo;
 import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage;
+import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
 import org.tizen.dynamicanalyzer.ui.network.data.NetworkDataManager;
@@ -90,7 +91,12 @@ public class OpenTraceHandler extends AbstractHandler {
 
                project = AnalyzerManager.getProject();
 
-               List<String> pInfo = SqlManager.getInstance().getDetailsInfo(
+               // establish db connection with new path
+               SqlConnectionManager.closeConnection();
+               SqlConnectionManager.establishConnection(project.getSavePath()
+                               + File.separator + AnalyzerConstants.DATABASE_NAME);
+
+               List<String> pInfo = SqlManager.getInstance().getProjectInfo(
                                project.getSavePath());
 
                if (null == pInfo || pInfo.isEmpty()) {
@@ -122,8 +128,8 @@ public class OpenTraceHandler extends AbstractHandler {
                }
 
                int percent = OpenTraceProgressManager.getInstance().getPercent();
-               if (loadInfos() && loadCallStackApis()
-                               && loadProfilingData() && loadProfilingChildData() &&
+               if (loadInfos() && loadCallStackApis() && loadProfilingData()
+                               && loadProfilingChildData() &&
                                // loadCallStackData() &&
                                // loadLeakData() &&
                                // loadFailedData() &&
@@ -158,16 +164,6 @@ public class OpenTraceHandler extends AbstractHandler {
                                AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING, percent += 3);
                /* add each part action.. close... open...etc... */
 
-               /* resource log view action start */
-               // List<LogCenter> logCenters = AnalyzerManager.getLogCenters();
-               // List<Integer> ids = LogDataFactory.getLogList();
-               // size = ids.size();
-               // for (int i = 0; i < size; i++) {
-               // LogCenter center = logCenters.get(i);
-               // int dataSize = SqlManager.getInstance().selectCount(center);
-               // center.setDataSize(dataSize);
-               // }
-
                if (RangeDataManager.getInstance().isBeingAnalyzed()) {
                        DAPageComposite page = AnalyzerManager.getCurrentPage();
                        if (page instanceof RangePage) {
@@ -175,9 +171,12 @@ public class OpenTraceHandler extends AbstractHandler {
                        }
                }
 
-               OpenTraceProgressManager.getInstance().runThreads();
+               // open for each PageDataManager
+               DataManagerRegistry.openData();
+
+               // OpenTraceProgressManager.getInstance().runThreads();
                OpenTraceProgressManager.getInstance().openTraceComplete();
-               SqlManager.getInstance().closeConnection();
+               // SqlManager.getInstance().closeConnection();
 
                NetworkDataManager.getInstance().openProcess();
                GLDataManager.getInstance().openProcess();
@@ -240,25 +239,38 @@ public class OpenTraceHandler extends AbstractHandler {
                                CallStackUnit csa = new CallStackUnit(addr, api, pid, time);
                                callstackManager.getCallStackApiAddrByPidMap(pid)
                                                .put(addr, csa);
-
                        }
                }
                return isSuccess;
        }
 
        private boolean loadInfos() {
-               boolean isSuccess = true;
-               List<List<String>> dbInfo = SqlManager.getInstance().loadTargetInfo();
+               List<String> apiList = new ArrayList<String>();
+               
+               // load api name list
+               List<List<String>> dbInfo = SqlManager.getInstance().loadApiNames();
                if (null == dbInfo) {
-                       DA_LOG.debug("failed - loadTargetInfo");
-                       isSuccess = false;
+                       DA_LOG.error("failed - load Api names");
+                       return false;
+               } else {
+                       for (List<String> info : dbInfo) {
+                               apiList.add(info.get(0));
+                       }
+               }
+
+               // load device status info
+               dbInfo = SqlManager.getInstance().loadTargetInfo();
+               if (null == dbInfo) {
+                       DA_LOG.error("failed - loadTargetInfo");
+                       return false;
                } else {
                        List<String> info = dbInfo.get(0);
-                       ComponentInfo targetInfo = new ComponentInfo();
+                       DeviceStatusInfo targetInfo = new DeviceStatusInfo(apiList);
                        targetInfo.loadSaveFormat(info);
-                       GlobalInformation.getCurrentDeviceInfo().setComponentInfo(targetInfo);
+                       AnalyzerManager.getProject().setDeviceStatusInfo(targetInfo);
                }
 
+               // load process ppakcage info
                List<String> pids = SqlManager.getInstance().getPids();
                int pidCount = pids.size();
 
@@ -269,9 +281,8 @@ public class OpenTraceHandler extends AbstractHandler {
                        String option = " where pid = " + pids.get(h);
                        dbInfo = SqlManager.getInstance().loadProcessInfo(option);
                        if (null == dbInfo) {
-                               DA_LOG.debug("failed - load Process Info");
-                               isSuccess = false;
-                               continue;
+                               DA_LOG.error("failed - load Process Info");
+                               return false;
                        } else {
                                List<ProcessInfo> pInfos = pip.getProcessSnapshots();
                                for (int i = 0; i < dbInfo.size(); i++) {
@@ -291,19 +302,15 @@ public class OpenTraceHandler extends AbstractHandler {
                                        List<List<String>> objInfo = SqlManager.getInstance()
                                                        .loadLibObj(subOption);
                                        if (null == objInfo) {
-                                               DA_LOG.debug("failed - load Lib Object");
-                                               isSuccess = false;
-                                               continue;
+                                               DA_LOG.error("failed - load Lib Object");
+                                               return false;
                                        } else {
                                                for (List<String> libInfo : objInfo) {
-                                                       LibraryObject libObj = new LibraryObject();
-                                                       libObj.setPid(Integer.parseInt(libInfo.get(0)));
+                                                       LibraryObject libObj = new LibraryObject(
+                                                                       libInfo.get(4), Long.parseLong(libInfo
+                                                                                       .get(2)), Long.parseLong(libInfo
+                                                                                       .get(3)));
                                                        // 1 : time
-                                                       libObj.setLowestAddress(Long.parseLong(libInfo
-                                                                       .get(2)));
-                                                       libObj.setHighestAddress(Long.parseLong(libInfo
-                                                                       .get(3)));
-                                                       libObj.setLibPath(libInfo.get(4));
                                                        process.getLibObjs().add(libObj);
                                                        process.getLibObjHash().put(libObj.getLibPath(),
                                                                        libObj);
@@ -313,17 +320,8 @@ public class OpenTraceHandler extends AbstractHandler {
                        }
                        processPkgMap.put(pip.getPid(), pip);
                }
-               dbInfo = SqlManager.getInstance().loadApiNames();
-               if (null == dbInfo) {
-                       DA_LOG.debug("failed - load Api names");
-                       isSuccess = false;
-               } else {
-                       List<String> apiList = ApiNameManager.getApiList();
-                       for (List<String> info : dbInfo) {
-                               apiList.add(info.get(0));
-                       }
-               }
-               return isSuccess;
+
+               return true;
        }
 
        private boolean loadImageSet() {
index db35c91..c23809d 100644 (file)
@@ -451,8 +451,8 @@ public class LogParser implements Runnable {
                        String childClassName = input[LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_CLASS_NAME_INDEX];
                        long childPointer = AnalyzerUtil
                                        .addrToLong(input[LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_POINTER_INDEX]);
-                       rear = ByteUtil.getByte(parentName, parentClassName,
-                                       parentPointer, childName, childClassName, childPointer);
+                       rear = ByteUtil.getByte(parentName, parentClassName, parentPointer,
+                                       childName, childClassName, childPointer);
                        result = ByteUtil.concatByteArray(front, rear);
                        break;
                case DataChannelConstants.MSG_PROBE_UIEVENT:
@@ -577,8 +577,7 @@ public class LogParser implements Runnable {
                                        .parseLong(input[LogCenterConstants.USER_FUNCTION_ELAPSED_TIME_INDEX]);
                        long pcAddr = Long
                                        .parseLong(input[LogCenterConstants.PCADDR_INDEX]);
-                       rear = ByteUtil
-                                       .getByte(lowPc, highPc, ufType, elapsedTime, pcAddr);
+                       rear = ByteUtil.getByte(lowPc, highPc, ufType, elapsedTime, pcAddr);
                        result = ByteUtil.concatByteArray(front, rear);
                        break;
                }
@@ -653,7 +652,7 @@ public class LogParser implements Runnable {
                        coreCount = i + 1;
                }
                if (coreCount != 0) {
-                       GlobalInformation.getCurrentDeviceInfo().getComponentInfo()
+                       AnalyzerManager.getProject().getDeviceStatusInfo()
                                        .setCpuCount(coreCount);
                }
                byte[] cpuFrequency = new byte[temp.length];
index f647f69..f4be048 100644 (file)
@@ -38,15 +38,15 @@ import org.tizen.dynamicanalyzer.communicator.CommunicatorUtils;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.project.AppInfo;
 import org.tizen.dynamicanalyzer.project.PackageInfo;
-import org.tizen.dynamicanalyzer.swap.channel.control.ComponentInfo;
+import org.tizen.dynamicanalyzer.swap.channel.control.DeviceStatusInfo;
 import org.tizen.dynamicanalyzer.swap.communicator.Communicator30;
 import org.tizen.dynamicanalyzer.ui.info.screenshot.EmulatorScreenshot;
 import org.tizen.dynamicanalyzer.util.CommonUtil;
 import org.tizen.sdblib.IDevice;
 
 public class DeviceInfo {
-       private IDevice device;
-       private String selectedApplication;
+       private IDevice device = null;
+       private String selectedApplication = null;
        private String targetVersion = null;
        private BaseCommunicator communicator = null;
        private boolean configSuccess = false;
@@ -54,9 +54,8 @@ public class DeviceInfo {
        private List<AppInfo> appInfoList = null;
        private HashMap<String, AppInfo> appInfoHash = null;
        private HashMap<String, PackageInfo> pkgInfoHash = null;
-       private List<String> apiList = null;
 
-       private ComponentInfo componentInfo = null;
+       private DeviceStatusInfo statusInfo = null;
 
        /*** for version 3.0 */
        private int remotePort = -1;
@@ -70,8 +69,7 @@ public class DeviceInfo {
                appInfoList = new ArrayList<AppInfo>();
                appInfoHash = new HashMap<String, AppInfo>();
                pkgInfoHash = new HashMap<String, PackageInfo>();
-               componentInfo = new ComponentInfo();
-               apiList = CommunicatorUtils.getApiMap(device);
+               statusInfo = new DeviceStatusInfo(CommunicatorUtils.getApiMap(device));
        }
 
        public void setSelectedAppName(String name) {
@@ -140,12 +138,8 @@ public class DeviceInfo {
                return false;
        }
 
-       public void setComponentInfo(ComponentInfo info) {
-               componentInfo = info;
-       }
-
-       public ComponentInfo getComponentInfo() {
-               return componentInfo;
+       public DeviceStatusInfo getDeviceStatusInfo() {
+               return statusInfo;
        }
 
        public void closeAllSocket() {
@@ -157,17 +151,6 @@ public class DeviceInfo {
                CommonUtil.tryClose(dataSock);
        }
 
-       public List<String> getApiList() {
-               if (null == apiList) {
-                       apiList = new ArrayList<String>();
-               }
-               return apiList;
-       }
-
-       public void setApiList(List<String> apiList) {
-               this.apiList = apiList;
-       }
-
        public HostResult initCommunicator() {
                return communicator.init(this);
        }
index 0ee5e60..15ccca6 100755 (executable)
@@ -52,7 +52,7 @@ import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
 import org.tizen.dynamicanalyzer.model.DeviceInfo;
 import org.tizen.dynamicanalyzer.sql.SqlManager;
-import org.tizen.dynamicanalyzer.swap.channel.control.ComponentInfo;
+import org.tizen.dynamicanalyzer.swap.channel.control.DeviceStatusInfo;
 import org.tizen.dynamicanalyzer.swap.channel.control.RunTimeConfiguration;
 import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfo;
 import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage;
@@ -86,7 +86,7 @@ public class Project {
 
        private List<RunTimeConfiguration> configHistory = new ArrayList<RunTimeConfiguration>();
 
-       private ComponentInfo targetDeviceComponentInfo = null;
+       private DeviceStatusInfo targetDeviceStatusInfo = null;
        private AppInfo targetApplicationInfo = null;
 
        // for performance
@@ -209,12 +209,12 @@ public class Project {
                }
        }
 
-       public ComponentInfo getDeviceComponentInfo() {
-               return targetDeviceComponentInfo;
+       public DeviceStatusInfo getDeviceStatusInfo() {
+               return targetDeviceStatusInfo;
        }
 
-       public void setDeviceComponentInfo(ComponentInfo comInfo) {
-               targetDeviceComponentInfo = comInfo;
+       public void setDeviceStatusInfo(DeviceStatusInfo statusInfo) {
+               targetDeviceStatusInfo = statusInfo;
        }
 
        public AppInfo getApplicationInfo() {
@@ -236,8 +236,11 @@ public class Project {
                                        .onAppSelected(appInfo);
                }
 
-               setDeviceComponentInfo(GlobalInformation.getCurrentDeviceInfo()
-                               .getComponentInfo());
+               setProtocolVersion(Double.parseDouble(GlobalInformation
+                               .getCurrentDeviceInfo().getTargetVersion()));
+
+               setDeviceStatusInfo(GlobalInformation.getCurrentDeviceInfo()
+                               .getDeviceStatusInfo());
                setApplicationInfo(GlobalInformation.getCurrentApplication());
                RunTimeConfiguration currentConfig = GlobalInformation
                                .getCurrentConfiguration();
@@ -294,9 +297,8 @@ public class Project {
                SqlConnectionManager.closeConnection();
 
                // establish database connection
-               boolean conn_res = SqlConnectionManager
-                               .establishConnection(getSavePath() + File.separator
-                                               + AnalyzerConstants.DATABASE_NAME);
+               SqlConnectionManager.establishConnection(getSavePath() + File.separator
+                               + AnalyzerConstants.DATABASE_NAME);
 
                // create table
                DataManagerRegistry.createDBTables();
@@ -330,6 +332,8 @@ public class Project {
 
        public void loadSaveFormat(List<String> data) {
                setVersion(data.get(AnalyzerConstants.PROJECT_VERSION_INDEX));
+               setProtocolVersion(Double.parseDouble(data
+                               .get(AnalyzerConstants.PROJECT_PROTOCOL_VERSION_INDEX)));
                setDevice(data.get(AnalyzerConstants.PROJECT_DEVICE_INDEX));
                setPkgId(data.get(AnalyzerConstants.PROJECT_PACKAGE_ID_INDEX));
                setAppName(data.get(AnalyzerConstants.PROJECT_APP_NAME_INDEX));
@@ -347,6 +351,7 @@ public class Project {
        public List<String> makeSaveProjectInfo() {
                List<String> projectInfoDBList = new ArrayList<String>();
                projectInfoDBList.add(getVersion());
+               projectInfoDBList.add(Double.toString(getProtocolVersion()));
                projectInfoDBList.add(getDevice());
                projectInfoDBList.add(getPkgId());
                projectInfoDBList.add(getAppName());
@@ -354,7 +359,6 @@ public class Project {
                projectInfoDBList.add(Long.toString(getTotalStopTime()));
                projectInfoDBList.add(Long.toString(getReplayStopTime()));
                projectInfoDBList.add(getProfileStartTime().toString());
-               projectInfoDBList.add(getSavePath());
 
                return projectInfoDBList;
        }
index 5465080..c79e498 100755 (executable)
@@ -172,14 +172,13 @@ public class DBTableManager {
 
                // "project" table info block
                {
-                       String[] names = { "SaveVersion", "Device", "PackageId", "AppName",
-                                       "CreateTime", "LastTime", "StopTime", "ProfileStartTime",
-                                       "LogCount", "DeviceLogCount", "ProfileLogCount",
-                                       "SavePath", "MainPid" };
+                       String[] names = { "SaveVersion", "ProtocalVersion", "Device",
+                                       "PackageId", "AppName", "CreateTime", "LastTime",
+                                       "StopTime", "ProfileStartTime" };
                        String[] options = { EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY,
-                                       EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY };
+                                       EMPTY, EMPTY, EMPTY };
                        String[] types = { TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT,
-                                       TEXT, TEXT, TEXT, TEXT, TEXT };
+                                       TEXT };
                        DBTableInfo projectInfo = new DBTableInfo(TABLE_NAME_PROJECT,
                                        names, options, types);
                        tableInfos.add(projectInfo);
index 6175734..11b9064 100755 (executable)
@@ -48,7 +48,7 @@ import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.project.Project;
 import org.tizen.dynamicanalyzer.swap.callstack.BaseCallstackManager;
-import org.tizen.dynamicanalyzer.swap.channel.control.ComponentInfo;
+import org.tizen.dynamicanalyzer.swap.channel.control.DeviceStatusInfo;
 import org.tizen.dynamicanalyzer.swap.channel.data.ApiNameManager;
 import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
 import org.tizen.dynamicanalyzer.swap.channel.data.LibraryObject;
@@ -375,8 +375,8 @@ public class SqlManager {
 
                String insertQuery = info.insertQuery();
                if (insertQuery != null) {
-                       ComponentInfo targetInfo = GlobalInformation.getCurrentDeviceInfo()
-                                       .getComponentInfo();
+                       DeviceStatusInfo targetInfo = AnalyzerManager.getProject()
+                                       .getDeviceStatusInfo();
                        List<String> insetRowData = new ArrayList<String>();
 
                        insetRowData.add(Long.toString(targetInfo.getSystemMemorySize()));
@@ -1342,7 +1342,7 @@ public class SqlManager {
                return dbInfo.get(0);
        }
 
-       public List<String> getDetailsInfo(String path) {
+       public List<String> getProjectInfo(String path) {
                DBTableInfo projectInfo = DBTableManager.getInstance().getTableInfo(
                                DBTableManager.TABLE_INDEX_PROJECT);
                String[] columnNames = projectInfo.getColumnNames();
  */
 package org.tizen.dynamicanalyzer.swap.channel.control;
 
+import java.util.ArrayList;
 import java.util.List;
 
-public class ComponentInfo {
+public class DeviceStatusInfo {
        private long systemMemorySize = 0;
        private long storageSize = 0;
        private int bluetoothSupport = -1;
@@ -39,6 +40,11 @@ public class ComponentInfo {
        private int cpuCount = 0;
        private int deviceCount = 0;
        private String devices = null;
+       private List<String> apiList = null;
+       
+       public DeviceStatusInfo(List<String> apiList) {
+               this.apiList = apiList;
+       }
 
        public long getSystemMemorySize() {
                return systemMemorySize;
@@ -141,4 +147,16 @@ public class ComponentInfo {
                deviceCount = Integer.parseInt(info.get(9));
                devices = info.get(10);
        }
+
+       public List<String> getApiList() {
+               if (apiList == null) {
+                       synchronized (this) {
+                               if (apiList == null) {
+                                       apiList = new ArrayList<String>();
+                               }
+                       }
+               }
+
+               return apiList;
+       }
 }
index 275e2eb..365f273 100644 (file)
@@ -28,7 +28,7 @@ package org.tizen.dynamicanalyzer.swap.channel.data;
 
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.common.GlobalInformation;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 
 public class ApiNameManager {
@@ -51,8 +51,7 @@ public class ApiNameManager {
        }
 
        public static List<String> getApiList() {
-               return GlobalInformation.getCurrentDeviceInfo().getApiList();
-
+               return AnalyzerManager.getProject().getDeviceStatusInfo().getApiList();
        }
 
        public static void clear() {
index b1f4dbe..f73e307 100644 (file)
 package org.tizen.dynamicanalyzer.swap.channel.data;
 
 public class LibraryObject {
-       private long lowestAddress = -1;
-       private long highestAddress = -1;
        private String libPath = null;
-       private int pid;
+       public long lowestAddress;
+       public long highestAddress;
 
+       public LibraryObject(String path, long low, long high) {
+               this.libPath = path;
+               this.lowestAddress = low;
+               this.highestAddress = high;
+       }
+       
        public long getLowestAddress() {
                return lowestAddress;
        }
 
-       public void setLowestAddress(long lowestAddress) {
-               this.lowestAddress = lowestAddress;
-       }
-
        public long getHighestAddress() {
                return highestAddress;
        }
 
-       public void setHighestAddress(long highestAddress) {
-               this.highestAddress = highestAddress;
-       }
-
        public String getLibPath() {
                return libPath;
        }
-
-       public void setLibPath(String libPath) {
-               this.libPath = libPath;
-       }
-
-       public int getPid() {
-               return pid;
-       }
-
-       public void setPid(int pid) {
-               this.pid = pid;
-       }
-       
-       
 }
index 4fa3c86..09d3693 100755 (executable)
@@ -75,7 +75,7 @@ import org.tizen.dynamicanalyzer.swap.channel.control.ApplicationInst;
 import org.tizen.dynamicanalyzer.swap.channel.control.BinaryInfo;
 import org.tizen.dynamicanalyzer.swap.channel.control.FunctionInst;
 import org.tizen.dynamicanalyzer.swap.channel.control.RunTimeConfiguration;
-import org.tizen.dynamicanalyzer.swap.channel.control.ComponentInfo;
+import org.tizen.dynamicanalyzer.swap.channel.control.DeviceStatusInfo;
 import org.tizen.dynamicanalyzer.swap.channel.control.UserSpaceInst;
 import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
 import org.tizen.dynamicanalyzer.swap.logparser.SWAPLogParser;
@@ -748,8 +748,7 @@ public class Communicator30 extends BaseCommunicator {
                        int index = INT_SIZE * 3;
 
                        if (isCorrectAck(MSG_TARGET_INFO_ACK, result)) {
-                               ComponentInfo info = processTargetInfo(data, index);
-                               device.setComponentInfo(info);
+                               processTargetInfo(data, index, device.getDeviceStatusInfo());
                                return result;
                        }
                }
@@ -795,9 +794,7 @@ public class Communicator30 extends BaseCommunicator {
                return GlobalInformation.getCurrentDeviceInfo().getDataSock();
        }
 
-       private ComponentInfo processTargetInfo(byte[] payload, int index) {
-               ComponentInfo tInfo = new ComponentInfo();
-
+       private void processTargetInfo(byte[] payload, int index, DeviceStatusInfo tInfo) {
                long systemMemorySize = 0;
                long storageSize = 0;
                int bluetoothSupport = 0;
@@ -850,8 +847,6 @@ public class Communicator30 extends BaseCommunicator {
                tInfo.setCpuCount(numberOfCPU);
                tInfo.setDeviceCount(numberOfDevice);
                tInfo.setDevices(deviceList);
-
-               return tInfo;
        }
 
        @Override
index 910e24c..684abf5 100644 (file)
@@ -64,4 +64,10 @@ public class DataManagerRegistry {
                        }
                }
        }
+       
+       public static void openData() {
+               for (Map.Entry<String, PageDataManager> entry : dataManagers.entrySet()) {
+                       entry.getValue().openData(null);
+               }
+       }
 }
index 622aaee..7950072 100755 (executable)
@@ -77,7 +77,7 @@ import org.tizen.dynamicanalyzer.widgets.da.base.DADialog;
 
 public class MessageParser {
        private static final DALogger DA_LOG = DALogger.getInstance();
-       
+
        static final boolean PRINT_DATA_LOG_TOFILE = true;
 
        static final int MSG_ID_INDEX = 0;
@@ -208,34 +208,28 @@ public class MessageParser {
 
                List<LibraryObject> libObjs = pInfo.getLibObjs();
                HashMap<String, LibraryObject> libHash = pInfo.getLibObjHash();
-//             System.out.println("LIBCOUNT :: " + dependantLibCount);
+               // System.out.println("LIBCOUNT :: " + dependantLibCount);
                for (int i = 0; i < dependantLibCount; i++) {
-                       LibraryObject libObj = new LibraryObject();
-                       libObj.setPid(pid);
                        long lowestAddr = ByteUtil.toLong(data, index);
                        index += LONG_SIZE;
                        long highestAddr = ByteUtil.toLong(data, index);
                        index += LONG_SIZE;
                        String libPath = ByteUtil.getString(data, index);
+                       LibraryObject libObj = new LibraryObject(libPath, lowestAddr,
+                                       highestAddr);
                        // remove \0 char
                        // libPath = libPath.substring(0, libPath.length() - 1);
                        index += ByteUtil.getStringLength(data, index);
-                       libObj.setLowestAddress(lowestAddr);
-                       libObj.setHighestAddress(highestAddr);
-                       libObj.setLibPath(libPath);
                        libObjs.add(libObj);
                        libHash.put(libPath, libObj);
-//                     System.out.println("LIBPATH :: (" + i + ") " + libPath + "low : "
-//                                     + AnalyzerUtil.toHexdecimal(lowestAddr) + " high : "
-//                                     + AnalyzerUtil.toHexdecimal(highestAddr));
                }
-               
+
                DATime startTime = new DATime(sec, nano);
 
                pInfo.setPid(pid);
                pInfo.setPpid(ppid);
-               DA_LOG.debug("process info start time : " + startTime.getSec()
-                               + "  " + startTime.getNano() + "    startTime : "
+               DA_LOG.debug("process info start time : " + startTime.getSec() + "  "
+                               + startTime.getNano() + "    startTime : "
                                + pInfo.getStartTime().getSec() + "  "
                                + pInfo.getStartTime().getNano());
                pInfo.setStartTime(startTime);
@@ -247,15 +241,15 @@ public class MessageParser {
                pInfo.setDepLibCount(dependantLibCount);
 
                // User Call Trace : App is Tizen C++ or Tizen native
-               String applicationType = GlobalInformation.getCurrentApplication().getInfo(
-                               AppInfo.APPTYPE_INDEX);
+               String applicationType = GlobalInformation.getCurrentApplication()
+                               .getInfo(AppInfo.APPTYPE_INDEX);
                if (applicationType.contains(AppInfo.APPTYPE_CPP)) {
                        pInfoPack.setDropLog(true);
                }
                AnalyzerManager.setProcessInfoArrived(true);
-               
+
                ThreadChartManager.getInstance().getThreadDataManager()
-                       .createMainThreadItem(pid);
+                               .createMainThreadItem(pid);
        }
 
        private void memoryMapChanged(byte[] data) {
@@ -321,30 +315,11 @@ public class MessageParser {
                List<LibraryObject> libObjs = pInfo.getLibObjs();
 
                if (id == DataChannelConstants.MSG_PROCESS_MAP) {
-                       LibraryObject libObj = new LibraryObject();
-                       libObj.setHighestAddress(highAddr);
-                       libObj.setLowestAddress(lowAddr);
-                       libObj.setPid(pid);
-                       libObj.setLibPath(libPath);
+                       LibraryObject libObj = new LibraryObject(libPath, lowAddr, highAddr);
                        pInfo.getLibObjs().add(libObj);
                        pInfo.setDepLibCount(pInfo.getLibObjs().size());
                        pInfo.getLibObjHash().put(libPath, libObj);
-
-                       // log
-//                     System.out.println("MAP CHANGED    ADD  "
-//                                     + AnalyzerUtil.toHexdecimal(id) + "  libPath : " + libPath
-//                                     + "    low : " + AnalyzerUtil.toHexdecimal(lowAddr)
-//                                     + "    high: " + AnalyzerUtil.toHexdecimal(highAddr)
-//                                     + "  chage time : " + changeTime.toString()
-//                                     + "  total count : " + pInfo.getLibObjs().size());
                } else {
-//                     System.out.println("MAP CHANGED REMOVE  "
-//                                     + AnalyzerUtil.toHexdecimal(id) + "  libPath : " + libPath
-//                                     + "  low : " + AnalyzerUtil.toHexdecimal(lowAddr)
-//                                     + "    high: " + AnalyzerUtil.toHexdecimal(highAddr)
-//                                     + "  chage time : " + changeTime.toString()
-//                                     + "  total count : " + pInfo.getDepLibCount());
-
                        int size = libObjs.size();
                        for (int i = 0; i < size; i++) {
                                LibraryObject libObj = libObjs.get(i);
@@ -354,14 +329,6 @@ public class MessageParser {
                                        libObjs.remove(libObj);
                                        pInfo.getLibObjHash().remove(libObj.getLibPath());
 
-//                                     System.out.println("LIB UNMAP : "
-//                                                     + libObj.getLibPath()
-//                                                     + "  low : "
-//                                                     + AnalyzerUtil.toHexdecimal(libObj
-//                                                                     .getLowestAddress())
-//                                                     + " high: "
-//                                                     + AnalyzerUtil.toHexdecimal(libObj
-//                                                                     .getHighestAddress()));
                                        break;
                                }
                        }
@@ -370,15 +337,6 @@ public class MessageParser {
        }
 
        private void processTerminate() {
-               // if (!AnalyzerManager.isExit()) {
-               // Display.getDefault().syncExec(new Runnable() {
-               // @Override
-               // public void run() {
-               // StopProcessManager.getInstance().stopProcessStart(
-               // AnalyzerLabels.STOP_PROCESS_DLG_SUMMARIZING_DATA); // socket
-               // }
-               // });
-               // }
                AnalyzerManager.decreaseProcessCount();
                if (AnalyzerManager.getProcessCount() == 0) {
                        DACommunicator.setRunning(false);
@@ -394,16 +352,16 @@ public class MessageParser {
                } catch (IOException e1) {
                        e1.printStackTrace();
                }
-               
-               if(PRINT_DATA_LOG_TOFILE) {
-                       File logPath = new File(
-                                       PathManager.DA_DEBUG_DATA_CHANNEL_LOG_FILE);
+
+               if (PRINT_DATA_LOG_TOFILE) {
+                       File logPath = new File(PathManager.DA_DEBUG_DATA_CHANNEL_LOG_FILE);
                        if (logPath.exists()) {
                                logPath.delete();
                        }
 
                        try {
-                               printWriter = new PrintWriter(new BufferedWriter(new FileWriter(logPath)), true);
+                               printWriter = new PrintWriter(new BufferedWriter(
+                                               new FileWriter(logPath)), true);
                        } catch (IOException e) {
                                e.printStackTrace();
                        }
@@ -444,8 +402,8 @@ public class MessageParser {
                                // AnalyzerUtil.printHexdecimal(id);
                                // System.out.println();
 
-                               int payloadSize = ByteUtil.toInt(header,
-                                               MSG_PAYLOAD_SIZE_INDEX);
+                               int payloadSize = ByteUtil
+                                               .toInt(header, MSG_PAYLOAD_SIZE_INDEX);
                                byte[] payload = null;
 
                                try {
@@ -474,10 +432,13 @@ public class MessageParser {
                                System.arraycopy(header, 0, buffer, 0, MSG_HEADER_SIZE);
                                System.arraycopy(payload, 0, buffer, MSG_HEADER_SIZE,
                                                payloadSize);
-                               
-                               if(PRINT_DATA_LOG_TOFILE && printWriter != null) {
-                                       printWriter.printf("%d %d %d %d %d :", id, ByteUtil.toInt(header, 4), ByteUtil.toInt(header, 8), ByteUtil.toInt(header, 12), payloadSize);
-                                       for(int k = 0; k < payloadSize; k++)
+
+                               if (PRINT_DATA_LOG_TOFILE && printWriter != null) {
+                                       printWriter.printf("%d %d %d %d %d :", id,
+                                                       ByteUtil.toInt(header, 4),
+                                                       ByteUtil.toInt(header, 8),
+                                                       ByteUtil.toInt(header, 12), payloadSize);
+                                       for (int k = 0; k < payloadSize; k++)
                                                printWriter.printf("%02x ", payload[k]);
                                        printWriter.printf("\n");
                                }
@@ -485,7 +446,8 @@ public class MessageParser {
                                processMessage(buffer);
                                if (id == DataChannelConstants.MSG_DATA_TERMINATE) {
                                        DA_LOG.debug("message data terminate arrived!!!");
-                                       DA_LOG.performance("TEST", "While tracing", "Terminate Application");
+                                       DA_LOG.performance("TEST", "While tracing",
+                                                       "Terminate Application");
                                        if (AnalyzerManager.getProcessCount() == 0) {
                                                break;
                                        }
@@ -493,12 +455,14 @@ public class MessageParser {
                        } // end while()
                        DA_LOG.debug("Receive thread end!!");
                        DA_LOG.performance("TEST", "DA end", "End receive thread");
-                       if (!StartProcessManager.getInstance().isCancelled()){  
+                       if (!StartProcessManager.getInstance().isCancelled()) {
                                Display.getDefault().asyncExec(new Runnable() {
                                        @Override
                                        public void run() {
-                                               StopProcessManager.getInstance().stopProcessStart(
-                                                               AnalyzerLabels.STOP_PROCESS_DLG_SUMMARIZING_DATA); // socket
+                                               StopProcessManager
+                                                               .getInstance()
+                                                               .stopProcessStart(
+                                                                               AnalyzerLabels.STOP_PROCESS_DLG_SUMMARIZING_DATA); // socket
                                                // timeout
                                        }
                                });
@@ -570,10 +534,6 @@ public class MessageParser {
 
                case DataChannelConstants.MSG_DATA_SYSTEM:
                        Runtime runtime = Runtime.getRuntime();
-                       // System.out.println("used : "
-                       // + (runtime.totalMemory() - runtime.freeMemory())
-                       // + "   commit : " + runtime.totalMemory() + "   max : "
-                       // + runtime.maxMemory());
                        if ((runtime.totalMemory() - runtime.freeMemory()) >= runtime
                                        .maxMemory() * 0.8) {
                                ToolbarArea.getInstance().stopTrace();
@@ -608,8 +568,7 @@ public class MessageParser {
                                }
                        }
                        break;
-               case DataChannelConstants.MSG_PROCESS_COMM:
-               {
+               case DataChannelConstants.MSG_PROCESS_COMM: {
                        // process command line name is changed (/proc/<pid>/cmdline)
                        int index = MSG_HEADER_SIZE;
                        int pid = ByteUtil.toInt(data, index);
index c38cad3..fac1653 100644 (file)
@@ -34,7 +34,7 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
-import org.tizen.dynamicanalyzer.common.GlobalInformation;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.util.ByteUtil;
 
@@ -43,7 +43,7 @@ public class SystemData extends LogData {
        String cpuFrequency = null;
        String cpuLoad = null;
        long systemMemoryUsed = 0;
-       int targetProcessCount = 0; 
+       int targetProcessCount = 0;
        ProcessProfileData[] processProfileDataList = null;
        int otherProcessCount = 0;
        String otherProcessLoad = null;
@@ -71,8 +71,8 @@ public class SystemData extends LogData {
        String deviceEnergyUsage = null;
        String applicationEnergyUsage = null;
 
-//     int callAlpha = 0;
-//     int rssiAlpha = 0;
+       // int callAlpha = 0;
+       // int rssiAlpha = 0;
 
        public SystemData() {
        }
@@ -80,9 +80,9 @@ public class SystemData extends LogData {
        public void makeData(byte[] data) {
                super.makeData(data);
                // index = MessageParser.MSG_HEADER_SIZE;
-               int coreCount = GlobalInformation.getCurrentDeviceInfo().getComponentInfo()
+               int coreCount = AnalyzerManager.getProject().getDeviceStatusInfo()
                                .getCpuCount();
-               int deviceCount = GlobalInformation.getCurrentDeviceInfo().getComponentInfo()
+               int deviceCount = AnalyzerManager.getProject().getDeviceStatusInfo()
                                .getDeviceCount();
 
                cpuFrequency = parseCpu(index, data);
@@ -93,18 +93,18 @@ public class SystemData extends LogData {
 
                systemMemoryUsed = ByteUtil.toLong(data, index);
                index += LONG_SIZE;
-               
+
                targetProcessCount = ByteUtil.toInt(data, index);
                index += INT_SIZE;
-               
+
                if (targetProcessCount == 0) {
                        System.err.println("targetProcessCount is 0");
                } else if (targetProcessCount > 1) {
                        System.err.println("targetProcessCount : " + targetProcessCount);
                }
-               
+
                parseTargetProcessInfo(data, targetProcessCount);
-               
+
                otherProcessCount = ByteUtil.toInt(data, index);
                index += INT_SIZE;
 
@@ -208,7 +208,7 @@ public class SystemData extends LogData {
        }
 
        private static String parseCpu(int start, byte[] payload) {
-               int coreCount = GlobalInformation.getCurrentDeviceInfo().getComponentInfo()
+               int coreCount = AnalyzerManager.getProject().getDeviceStatusInfo()
                                .getCpuCount();
                StringBuffer buffer = new StringBuffer();
                for (int i = 0; i < coreCount; i++) {
@@ -223,7 +223,7 @@ public class SystemData extends LogData {
        }
 
        private static String parseUsage(int start, byte[] payload) {
-               int count = GlobalInformation.getCurrentDeviceInfo().getComponentInfo()
+               int count = AnalyzerManager.getProject().getDeviceStatusInfo()
                                .getDeviceCount();
                StringBuffer buffer = new StringBuffer();
                for (int i = 0; i < count; i++) {
@@ -236,7 +236,7 @@ public class SystemData extends LogData {
                }
                return buffer.toString();
        }
-       
+
        private void parseTargetProcessInfo(byte[] payload, int targetProcessCount) {
                processProfileDataList = new ProcessProfileData[targetProcessCount];
                for (int i = 0; i < targetProcessCount; i++) {
@@ -262,7 +262,7 @@ public class SystemData extends LogData {
                        processProfileDataList[i] = processData;
                }
        }
-       
+
        public int getEnergy() {
                return energyUsage;
        }
@@ -455,22 +455,6 @@ public class SystemData extends LogData {
                this.diskWrittenSectorCount = diskWrittenSectorCount;
        }
 
-//     public int getCallAlpha() {
-//             return callAlpha;
-//     }
-//
-//     public void setCallAlpha(int callAlpha) {
-//             this.callAlpha = callAlpha;
-//     }
-//
-//     public int getRssiAlpha() {
-//             return rssiAlpha;
-//     }
-//
-//     public void setRssiAlpha(int rssiAlpha) {
-//             this.rssiAlpha = rssiAlpha;
-//     }
-
        public int getEnergyUsage() {
                return energyUsage;
        }
@@ -529,7 +513,7 @@ public class SystemData extends LogData {
        }
 
        /*
-        * TODO Insert dummy data for compile. this method will be removed. 
+        * TODO Insert dummy data for compile. this method will be removed.
         */
        @Override
        public void makePreparedStatement(PreparedStatement prep)
@@ -574,31 +558,18 @@ public class SystemData extends LogData {
                prep.setInt(index++, energyUsage);
                prep.setString(index++, deviceEnergyUsage);
                prep.setString(index++, applicationEnergyUsage);
-//             prep.setInt(index++, callAlpha);
-//             prep.setInt(index++, rssiAlpha);
        }
 
        /*
-        * TODO this method will be removed. 
+        * TODO this method will be removed.
         */
        @Override
        public void loadData(ResultSet rs) throws SQLException {
                super.loadData(rs);
                int index = LogData.STATE_COUNT + 1;
 
-//             appCpuUsage = rs.getFloat(index++);
                cpuFrequency = rs.getString(index++);
                cpuLoad = rs.getString(index++);
-//             threadCount = rs.getInt(index++);
-//             threadLoad = rs.getString(index++);
-//             processCount = rs.getInt(index++);
-//             processLoad = rs.getString(index++);
-//             virtualMemory = rs.getInt(index++);
-//             residentMemory = rs.getInt(index++);
-//             sharedMemory = rs.getInt(index++);
-//             pssMemory = rs.getInt(index++);
-//             totalAllocSize = rs.getInt(index++);
-//             systemMemoryTotal = rs.getLong(index++);
                systemMemoryUsed = rs.getLong(index++);
                totalUsedDrive = rs.getInt(index++);
                diskReadSize = rs.getInt(index++);
@@ -622,8 +593,6 @@ public class SystemData extends LogData {
                energyUsage = rs.getInt(index++);
                deviceEnergyUsage = rs.getString(index++);
                applicationEnergyUsage = rs.getString(index++);
-//             callAlpha = rs.getInt(index++);
-//             rssiAlpha = rs.getInt(index++);
        }
 
        @Override
index 789047f..cb20388 100644 (file)
@@ -30,20 +30,13 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.eclipse.swt.graphics.Color;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.nl.FilePageLabels;
-import org.tizen.dynamicanalyzer.nl.NetworkPageLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.swap.channel.data.ApiNameManager;
-import org.tizen.dynamicanalyzer.ui.file.FileChartData;
 import org.tizen.dynamicanalyzer.ui.file.model.FileAccess;
 import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
 import org.tizen.dynamicanalyzer.ui.file.model.FileStatus;
-import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkAPIType;
-import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkSeriesType;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
-import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
index 3fddcab..1f9f9a3 100644 (file)
@@ -302,7 +302,7 @@ public class ScreenshotView extends DAViewComposite {
                        cpuUsage.add(value);
                }
 
-               long totalMem = AnalyzerManager.getProject().getDeviceComponentInfo()
+               long totalMem = AnalyzerManager.getProject().getDeviceStatusInfo()
                                .getSystemMemorySize();
                maxMem = totalMem;
 
@@ -438,7 +438,7 @@ public class ScreenshotView extends DAViewComposite {
 
                        Project project = AnalyzerManager.getProject();
                        if (project != null)
-                               maxMem = project.getDeviceComponentInfo().getSystemMemorySize();
+                               maxMem = project.getDeviceStatusInfo().getSystemMemorySize();
                        processMem = dataManager.getLastProcessMemory();
                        lastStartTime = dataManager.getLastStartTime();
                        setStartTime(lastStartTime);
index b16e622..a2e5a49 100755 (executable)
@@ -358,4 +358,8 @@ public class KernelDataMaker {
        public List<KernelDataPerThread> getThreadData() {
                return threads;
        }
+       
+       public void addThreadData(KernelDataPerThread data) {
+               threads.add(data);
+       }
 }
index 38332e4..6b673a3 100644 (file)
 package org.tizen.dynamicanalyzer.ui.kernel.data;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.PriorityQueue;
+
+import org.tizen.dynamicanalyzer.database.DBConstants;
 import org.tizen.dynamicanalyzer.database.DBTable;
+import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
 import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
 import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
 import org.tizen.dynamicanalyzer.swap.logparser.Logs;
@@ -39,9 +44,16 @@ import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.swap.model.data.LogDataTimeComparator;
 
 public class KernelDataManager extends PageDataManager {
+       private static final String PIDTID_QUERY = "select distinct "
+                       + DBConstants.COMMON_COLUMN_PID + ", "
+                       + DBConstants.COMMON_COLUMN_TID + " from %s";
+
+       private static final String COUNT_QUERY = "select count(*) from %s where "
+                       + DBConstants.COMMON_COLUMN_TID + "=%s";
+
        private static KernelDataManager instance = null;
        private KernelDataMaker kdataMaker = null;
-       
+
        private ContextDataDBTable contextDataTable = null;
        private FunctionDataDBTable functionDataTable = null;
 
@@ -52,7 +64,7 @@ public class KernelDataManager extends PageDataManager {
                functionDataTable = new FunctionDataDBTable();
                addDBTable(functionDataTable);
        }
-       
+
        public DBTable getContextDataTable() {
                return contextDataTable;
        }
@@ -60,7 +72,7 @@ public class KernelDataManager extends PageDataManager {
        public DBTable getFunctionDataTable() {
                return functionDataTable;
        }
-       
+
        public KernelDataMaker getDataMaker() {
                return kdataMaker;
        }
@@ -71,7 +83,7 @@ public class KernelDataManager extends PageDataManager {
                }
                return instance;
        }
-       
+
        public void clear() {
                kdataMaker.clear();
        }
@@ -155,4 +167,68 @@ public class KernelDataManager extends PageDataManager {
                if (!logs.isEmpty())
                        kdataMaker.makeData(logs);
        }
+
+       @Override
+       public void openData(Map<String, String> dataMap) {
+               kdataMaker.clear();
+
+               Map<Integer, KernelDataPerThread> threadMap = new HashMap<Integer, KernelDataPerThread>();
+
+               String query = String.format(PIDTID_QUERY,
+                               contextDataTable.getTableName());
+               List<List<Object>> contextPidTid = SqlConnectionManager
+                               .executeQuery(query);
+               query = String.format(PIDTID_QUERY, functionDataTable.getTableName());
+               List<List<Object>> functionPidTid = SqlConnectionManager
+                               .executeQuery(query);
+
+               int threadsize = contextPidTid.size();
+               for (int i = 0; i < threadsize; i++) {
+                       List<Object> row = contextPidTid.get(i);
+                       int pid = ((Integer) row.get(0)).intValue();
+                       int tid = ((Integer) row.get(1)).intValue();
+
+                       KernelDataPerThread kdata = new KernelDataPerThread(pid, tid);
+                       threadMap.put(Integer.valueOf(tid), kdata);
+
+                       query = String.format(COUNT_QUERY, contextDataTable.getTableName(),
+                                       Integer.toString(tid));
+                       List<List<Object>> coreCount = SqlConnectionManager
+                                       .executeQuery(query);
+                       Object count = coreCount.get(0).get(0);
+                       if (count instanceof Integer) {
+                               kdata.setCoreFragmentCount(((Integer) count).intValue());
+                       } else if (count instanceof Long) {
+                               kdata.setCoreFragmentCount(((Long) count).intValue());
+                       }
+
+                       query = String.format(COUNT_QUERY,
+                                       functionDataTable.getTableName(), Integer.toString(tid));
+                       List<List<Object>> functionCount = SqlConnectionManager
+                                       .executeQuery(query);
+                       count = functionCount.get(0).get(0);
+                       if (count instanceof Integer) {
+                               kdata.setFunctionFragmentCount(((Integer) count).intValue());
+                       } else if (count instanceof Long) {
+                               kdata.setFunctionFragmentCount(((Long) count).intValue());
+                       }
+               }
+
+               threadsize = functionPidTid.size();
+               for (int i = 0; i < threadsize; i++) {
+                       List<Object> row = functionPidTid.get(i);
+                       int tid = ((Integer) row.get(1)).intValue();
+
+                       KernelDataPerThread kdata = threadMap.get(Integer.valueOf(tid));
+                       if (kdata != null) {
+                               kdata.createFunctionStack();
+                       }
+               }
+
+               for (Map.Entry<Integer, KernelDataPerThread> entry : threadMap
+                               .entrySet()) {
+                       KernelDataPerThread kdata = entry.getValue();
+                       kdataMaker.addThreadData(kdata);
+               }
+       }
 }
index e9b3dc9..e453482 100644 (file)
@@ -38,50 +38,50 @@ public class KernelDataPerThread {
        private ContextSwitchData core_log;
        private Stack<ProfileData> func_log = null;
        private Stack<Integer> func_log_type = null;
-       
+
        private DAChartBoardItem contextChart = null;
        private DAChartBoardItem functionChart = null;
-       
+
        private int coreFragmentCount = 0;
        private int functionFragmentCount = 0;
-       
+
        public KernelDataPerThread(int pid, int tid) {
                this.pid = pid;
                this.tid = tid;
                core_log = null;
        }
-       
+
        public KernelDataPerThread(int pid, int tid, ContextSwitchData corelog) {
                this.pid = pid;
                this.tid = tid;
                core_log = corelog;
        }
-       
+
        public void createFunctionStack() {
                func_log = new Stack<ProfileData>();
                func_log_type = new Stack<Integer>();
        }
-       
+
        public int getPid() {
                return pid;
        }
-       
+
        public int getTid() {
                return tid;
        }
-       
+
        public ContextSwitchData getCorelog() {
                return core_log;
        }
-       
+
        public Stack<ProfileData> getFunclog() {
                return func_log;
        }
-       
+
        public Stack<Integer> getFunclogType() {
                return func_log_type;
        }
-       
+
        public void setCorelog(ContextSwitchData corelog) {
                core_log = corelog;
        }
@@ -101,20 +101,28 @@ public class KernelDataPerThread {
        public void setFunctionChart(DAChartBoardItem functionChart) {
                this.functionChart = functionChart;
        }
-       
+
        public void incCoreFragmentCount() {
                coreFragmentCount++;
        }
-       
+
        public void incFuncFragmentCount() {
                functionFragmentCount++;
        }
-       
+
        public int getCoreFragmentCount() {
                return coreFragmentCount;
        }
-       
+
        public int getFuncFragmentCount() {
                return functionFragmentCount;
        }
+       
+       public void setCoreFragmentCount(int count) {
+               this.coreFragmentCount = count;
+       }
+       
+       public void setFunctionFragmentCount(int count) {
+               this.functionFragmentCount = count;
+       }
 }
index e8ad623..3e94f91 100644 (file)
@@ -42,14 +42,12 @@ import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.DASelectionData;
 import org.tizen.dynamicanalyzer.listeners.SummaryMouseDoubleClickListener;
 import org.tizen.dynamicanalyzer.model.TreeInput;
-import org.tizen.dynamicanalyzer.swap.channel.data.ApiNameManager;
 import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory;
 import org.tizen.dynamicanalyzer.swap.model.data.ProbeCommonData;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
 import org.tizen.dynamicanalyzer.ui.range.RangePage;
 import org.tizen.dynamicanalyzer.ui.summary.SummaryDataManager;
 import org.tizen.dynamicanalyzer.ui.summary.SummaryPage;
-import org.tizen.dynamicanalyzer.ui.summary.warning.WarningDataDBTable;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
index 07e071e..2d73c07 100644 (file)
@@ -3,9 +3,7 @@ package org.tizen.dynamicanalyzer.ui.summary.warning;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.database.DBTable;
-import org.tizen.dynamicanalyzer.swap.channel.data.ApiNameManager;
 import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.swap.model.data.ProbeCommonData;
 import org.tizen.dynamicanalyzer.ui.summary.SummaryDataManager;
index 0c7a563..9cf6483 100644 (file)
@@ -36,7 +36,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.eclipse.swt.widgets.Display;
-import org.tizen.dynamicanalyzer.common.GlobalInformation;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
@@ -94,7 +94,7 @@ public class CPUChart extends TimelineChart {
                                TimelineChartLabels.CPU_CHART_SERIES_NAME_APP_LOAD,
                                DAChartSeries.SERIES_STYLE_AREA,
                                ColorResources.SERIES_COLOR_CPU_APP);
-               
+
                childSeriesMap = new HashMap<Integer, DAChartSeries>();
        }
 
@@ -117,86 +117,95 @@ public class CPUChart extends TimelineChart {
 
        @Override
        public void inputChartSeries(List<Object> dataList) {
-               appLoadSeries.clear();
-               totalLoadSeries.clear();
-               
-                       if (GlobalInformation.getCurrentDeviceInfo() == null) {
-                               return;
-                       }
-                       int coreSize = GlobalInformation.getCurrentDeviceInfo().getComponentInfo()
-                                       .getCpuCount();
-                       
-               Collection<DAChartSeries> processSeries = childSeriesMap.values();
-               if (processSeries != null) {
-                   Iterator<DAChartSeries> iter = processSeries.iterator();
-                   while (iter.hasNext()) {
-                       iter.next().clear();
-                   }
-               }
-               
-               @SuppressWarnings("unchecked")
-               List<List<Object>> systemData = (List<List<Object>>)dataList.get(TimelineConstants.SYSTEM_DB_DATA);
-               @SuppressWarnings("unchecked")
-               Map<Integer, List<List<Object>>> processDataMap = (Map<Integer, List<List<Object>>>)dataList.get(TimelineConstants.PROCESS_DB_DATA);
-               @SuppressWarnings("unchecked")
-               Map<Integer, List<List<Object>>> targetProcessDataMap = 
-                                                       (Map<Integer, List<List<Object>>>)dataList.get(TimelineConstants.TARGET_PROCESS_DB_DATA);
-               
-               /*
-                * Make Total CPU Load Series
-                */
-               for (int i = 0; i < systemData.size(); i++) {
-                       List<Object> row = systemData.get(i);
-                       double time = (Long)row.get(SystemDataDBTable.COLUMN.TIME.ordinal())
-                               / TimelineConstants.MEGA_DOUBLE;
-                       
-                       try {
-                           double systemAvgLoad = (Float)row.get(SystemDataDBTable.COLUMN.CPU_LOAD_TOTAL.ordinal());
-                           totalLoadSeries.addSeriesItem(new DAChartSeriesItem(time, systemAvgLoad,
-                                                                               Formatter.toPercentageFormat(systemAvgLoad)));
-                       } catch (NumberFormatException ne) {
-                           ne.printStackTrace();
-                       }
-               }
-               
-               /*
-                * Make Target Process CPU Load Series
-                * MultiProcess's cpu load sum / CPU Core
-                */
-               Iterator<Integer> iter = targetProcessDataMap.keySet().iterator(); 
-               Map<Long, Float> processLoadSumMap = new HashMap<Long, Float>();
+               appLoadSeries.clear();
+               totalLoadSeries.clear();
+
+               if (AnalyzerManager.getProject() == null) {
+                       return;
+               }
+
+               int coreSize = AnalyzerManager.getProject().getDeviceStatusInfo()
+                               .getCpuCount();
+
+               Collection<DAChartSeries> processSeries = childSeriesMap.values();
+               if (processSeries != null) {
+                       Iterator<DAChartSeries> iter = processSeries.iterator();
                        while (iter.hasNext()) {
-                       Integer pid = iter.next();
-                       List<List<Object>> data = targetProcessDataMap.get(pid);
-                       for (int i = 0; i < data.size(); i++) {
-                               List<Object> oneTime = data.get(i);
-                               Long time = (Long)oneTime.get(TargetProcessDBTable.COLUMN.TIME.ordinal());
-                               Float cpuLoad = (Float)oneTime.get(TargetProcessDBTable.COLUMN.CPU_LOAD.ordinal());
-                               Float processLoadSum = processLoadSumMap.get(time);
-                               if (processLoadSum == null) {
-                                       processLoadSumMap.put(time, cpuLoad);
-                               } else {
-                                       processLoadSumMap.put(time, processLoadSum + cpuLoad);
-                               }
-                       }
+                               iter.next().clear();
                        }
-                       
-                       List<Long> timeSortedLoadList = new ArrayList<Long>(processLoadSumMap.keySet());
-                       Collections.sort(timeSortedLoadList);
-                       
-                       Iterator<Long> iterProcessLoadSum = timeSortedLoadList.iterator();
-                       while (iterProcessLoadSum.hasNext()) {
-                               Long time = iterProcessLoadSum.next();
-                               Float cpuLoadSum = processLoadSumMap.get(time);
-                               double cpuAvgLoad = cpuLoadSum / coreSize;
-                               appLoadSeries.addSeriesItem(new DAChartSeriesItem(time / TimelineConstants.MEGA_DOUBLE, cpuAvgLoad,
-                        Formatter.toPercentageFormat(cpuAvgLoad)));
+               }
+
+               @SuppressWarnings("unchecked")
+               List<List<Object>> systemData = (List<List<Object>>) dataList
+                               .get(TimelineConstants.SYSTEM_DB_DATA);
+               @SuppressWarnings("unchecked")
+               Map<Integer, List<List<Object>>> processDataMap = (Map<Integer, List<List<Object>>>) dataList
+                               .get(TimelineConstants.PROCESS_DB_DATA);
+               @SuppressWarnings("unchecked")
+               Map<Integer, List<List<Object>>> targetProcessDataMap = (Map<Integer, List<List<Object>>>) dataList
+                               .get(TimelineConstants.TARGET_PROCESS_DB_DATA);
+
+               /*
+                * Make Total CPU Load Series
+                */
+               for (int i = 0; i < systemData.size(); i++) {
+                       List<Object> row = systemData.get(i);
+                       double time = (Long) row.get(SystemDataDBTable.COLUMN.TIME
+                                       .ordinal()) / TimelineConstants.MEGA_DOUBLE;
+
+                       try {
+                               double systemAvgLoad = (Float) row
+                                               .get(SystemDataDBTable.COLUMN.CPU_LOAD_TOTAL.ordinal());
+                               totalLoadSeries.addSeriesItem(new DAChartSeriesItem(time,
+                                               systemAvgLoad, Formatter
+                                                               .toPercentageFormat(systemAvgLoad)));
+                       } catch (NumberFormatException ne) {
+                               ne.printStackTrace();
+                       }
+               }
+
+               /*
+                * Make Target Process CPU Load Series MultiProcess's cpu load sum / CPU
+                * Core
+                */
+               Iterator<Integer> iter = targetProcessDataMap.keySet().iterator();
+               Map<Long, Float> processLoadSumMap = new HashMap<Long, Float>();
+               while (iter.hasNext()) {
+                       Integer pid = iter.next();
+                       List<List<Object>> data = targetProcessDataMap.get(pid);
+                       for (int i = 0; i < data.size(); i++) {
+                               List<Object> oneTime = data.get(i);
+                               Long time = (Long) oneTime.get(TargetProcessDBTable.COLUMN.TIME
+                                               .ordinal());
+                               Float cpuLoad = (Float) oneTime
+                                               .get(TargetProcessDBTable.COLUMN.CPU_LOAD.ordinal());
+                               Float processLoadSum = processLoadSumMap.get(time);
+                               if (processLoadSum == null) {
+                                       processLoadSumMap.put(time, cpuLoad);
+                               } else {
+                                       processLoadSumMap.put(time, processLoadSum + cpuLoad);
+                               }
                        }
-                       
-               /*
-                * Construct Process Chart
-                */
-               if (processItem == null) {
+               }
+
+               List<Long> timeSortedLoadList = new ArrayList<Long>(
+                               processLoadSumMap.keySet());
+               Collections.sort(timeSortedLoadList);
+
+               Iterator<Long> iterProcessLoadSum = timeSortedLoadList.iterator();
+               while (iterProcessLoadSum.hasNext()) {
+                       Long time = iterProcessLoadSum.next();
+                       Float cpuLoadSum = processLoadSumMap.get(time);
+                       double cpuAvgLoad = cpuLoadSum / coreSize;
+                       appLoadSeries.addSeriesItem(new DAChartSeriesItem(time
+                                       / TimelineConstants.MEGA_DOUBLE, cpuAvgLoad, Formatter
+                                       .toPercentageFormat(cpuAvgLoad)));
+               }
+
+               /*
+                * Construct Process Chart
+                */
+               if (processItem == null) {
                        Display.getDefault().syncExec(new Runnable() {
                                @Override
                                public void run() {
@@ -239,23 +248,25 @@ public class CPUChart extends TimelineChart {
                iter = processDataMap.keySet().iterator();
                int prevChildSize = childSeriesMap.size();
                while (iter.hasNext()) {
-                       Integer pid = iter.next();
-                       List<List<Object>> data = processDataMap.get(pid);
-                       for (int i = 0; i < data.size(); i++) {
-                               List<Object> oneTime = data.get(i);
-                               double time = (Long)oneTime.get(ProcessLoadDBTable.COLUMN.TIME.ordinal())
-                                               / TimelineConstants.MEGA_DOUBLE;
-                               double load = (Float)oneTime.get(ProcessLoadDBTable.COLUMN.CPU_LOAD.ordinal() / coreSize);
-                               
-                               DAChartSeries series = childSeriesMap.get(pid);
+                       Integer pid = iter.next();
+                       List<List<Object>> data = processDataMap.get(pid);
+                       for (int i = 0; i < data.size(); i++) {
+                               List<Object> oneTime = data.get(i);
+                               double time = (Long) oneTime.get(ProcessLoadDBTable.COLUMN.TIME
+                                               .ordinal()) / TimelineConstants.MEGA_DOUBLE;
+                               double load = (Float) oneTime
+                                               .get(ProcessLoadDBTable.COLUMN.CPU_LOAD.ordinal()
+                                                               / coreSize);
+
+                               DAChartSeries series = childSeriesMap.get(pid);
                                if (series == null) {
                                        if (load != 0) {
                                                DAChartSeries newSeries = new DAChartSeries(
                                                                Integer.toString(pid),
                                                                DAChartSeries.SERIES_STYLE_NONE,
                                                                ColorResources.SERIES_COLOR_CPU_SYSTEM);
-                                               newSeries.addSeriesItem(new DAChartSeriesItem(time, load,
-                                                               Formatter.toPercentageFormat(load)));
+                                               newSeries.addSeriesItem(new DAChartSeriesItem(time,
+                                                               load, Formatter.toPercentageFormat(load)));
                                                try {
                                                        processItem.getChart().addSeries(newSeries);
                                                } catch (NullPointerException e) {
@@ -268,8 +279,8 @@ public class CPUChart extends TimelineChart {
                                        series.addSeriesItem(new DAChartSeriesItem(time, load,
                                                        Formatter.toPercentageFormat(load)));
                                }
-                       }
-                       
+                       }
+
                }
 
                if (prevChildSize != childSeriesMap.size()) {
index cf0aaab..777cb27 100644 (file)
@@ -31,7 +31,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.eclipse.swt.graphics.Color;
-import org.tizen.dynamicanalyzer.common.GlobalInformation;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
@@ -86,10 +86,10 @@ public class CPUCoreChart extends TimelineChart {
        @Override
        public void inputChartSeries(List<Object> dataList) {
                if (coreSize == TimelineConstants.NOT_INITED) {
-                       if (GlobalInformation.getCurrentDeviceInfo() == null) {
+                       if (AnalyzerManager.getProject() == null) {
                                return;
                        }
-                       coreSize = GlobalInformation.getCurrentDeviceInfo().getComponentInfo()
+                       coreSize = AnalyzerManager.getProject().getDeviceStatusInfo()
                                        .getCpuCount();
                        for (int i = 0; i < coreSize; i++) {
                                DAChartSeries chartSeries = new DAChartSeries(
@@ -106,7 +106,8 @@ public class CPUCoreChart extends TimelineChart {
                }
 
                @SuppressWarnings("unchecked")
-               List<List<Object>> data = (List<List<Object>>) dataList.get(TimelineConstants.CPU_DB_DATA);
+               List<List<Object>> data = (List<List<Object>>) dataList
+                               .get(TimelineConstants.CPU_DB_DATA);
 
                // data.size() == coreSize
                for (int i = 0; i < data.size(); i++) {
index 5bb70fc..2e51432 100644 (file)
@@ -31,7 +31,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.eclipse.swt.graphics.Color;
-import org.tizen.dynamicanalyzer.common.GlobalInformation;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
@@ -44,90 +44,93 @@ import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
 
-
 public class CPUFrequencyChart extends TimelineChart {
-    private static CPUFrequencyChart instance = null;
-
-    private int coreSize = TimelineConstants.NOT_INITED;
-    private List<DAChartSeries> coreFrequencyChartSeriesList = new ArrayList<DAChartSeries>();
-    private Color[] coreChartSeriesColors = new Color[] {
-            ColorResources.SERIES_COLOR_CPUCORE_CORE0, ColorResources.SERIES_COLOR_CPUCORE_CORE1,
-            ColorResources.SERIES_COLOR_CPUCORE_CORE2, ColorResources.SERIES_COLOR_CPUCORE_CORE3 };
-
-    public static CPUFrequencyChart getInstance() {
-        if (instance == null) {
-            instance = new CPUFrequencyChart();
-        }
-
-        return instance;
-    }
-
-    private CPUFrequencyChart() {
-        chartType = TimelineConstants.CHART_TYPE_CPU_FREQUENCY;
-        probeType = DataChannelConstants.MSG_DATA_SYSTEM;
-        chartName = TimelineChartLabels.CPU_FREQUENCY_CHART_TITLE;
-        chartIcon = ImageResources.CHART_CPU_FREQUENCY;
-        addIcon = ImageResources.ADD_CHART_CPU_FREQUENCY;
-    }
-
-    @Override
-    public DAChartBoardItem createBoardItem(DAChartBoard board) {
-        DAChartBoardItem item = super.createBoardItem(board);
-
-        chart.getPlot().setAxisUnit("Hz");
-        chart.getPlot().setShowAxis(true);
-        return item;
-    }
-
-    @Override
-    public void inputChartSeries(List<Object> dataList) {
-        if (coreSize == TimelineConstants.NOT_INITED) {
-            if (GlobalInformation.getCurrentDeviceInfo() == null) {
-                return;
-            }
-            coreSize = GlobalInformation.getCurrentDeviceInfo().getComponentInfo().getCpuCount();
-            for (int i = 0; i < coreSize; i++) {
-                DAChartSeries chartSeries =
-                        new DAChartSeries(TimelineChartLabels.CPU_CORE_CHART_SERIES_NAME_CORE + i,
-                                          DAChartSeries.SERIES_STYLE_LINE,
-                                          coreChartSeriesColors[i % coreSize]);
-                chart.addSeries(chartSeries);
-                coreFrequencyChartSeriesList.add(chartSeries);
-            }
-        }
-
-        for (int i = 0; i < coreFrequencyChartSeriesList.size(); i++) {
-            coreFrequencyChartSeriesList.get(i).clear();
-        }
-        
-        @SuppressWarnings("unchecked")
-        List<List<Object>> data = (List<List<Object>>) dataList.get(TimelineConstants.CPU_DB_DATA);
-
-        // data.size() == coreSize
-        for (int i = 0; i < data.size(); i++) {
-            List<Object> row = data.get(i);
-            for (int ii = 0; ii < row.size(); ii++) {
-                @SuppressWarnings("unchecked")
-                List<Object> oneTime = (List<Object>) row.get(ii);
-                double time =
-                        (Long) oneTime.get(CPUDBTable.COLUMN.TIME.ordinal())
-                                / TimelineConstants.MEGA_DOUBLE;
-                double freq = getCPUFrequencyHz((Float) oneTime.get(CPUDBTable.COLUMN.CPU_FREQUENCY.ordinal()));
-                coreFrequencyChartSeriesList
-                        .get(i)
-                        .addSeriesItem(new DAChartSeriesItem(time, freq, Formatter.toHzFormat(freq)));
-            }
-        }
-    }
-
-    @Override
-    public void clear() {
-        super.clear();
-        coreSize = TimelineConstants.NOT_INITED;
-        coreFrequencyChartSeriesList.clear();
-    }
-    
-    private double getCPUFrequencyHz(double kHz) {
-       return kHz * 1000.0;
-    }
+       private static CPUFrequencyChart instance = null;
+
+       private int coreSize = TimelineConstants.NOT_INITED;
+       private List<DAChartSeries> coreFrequencyChartSeriesList = new ArrayList<DAChartSeries>();
+       private Color[] coreChartSeriesColors = new Color[] {
+                       ColorResources.SERIES_COLOR_CPUCORE_CORE0,
+                       ColorResources.SERIES_COLOR_CPUCORE_CORE1,
+                       ColorResources.SERIES_COLOR_CPUCORE_CORE2,
+                       ColorResources.SERIES_COLOR_CPUCORE_CORE3 };
+
+       public static CPUFrequencyChart getInstance() {
+               if (instance == null) {
+                       instance = new CPUFrequencyChart();
+               }
+
+               return instance;
+       }
+
+       private CPUFrequencyChart() {
+               chartType = TimelineConstants.CHART_TYPE_CPU_FREQUENCY;
+               probeType = DataChannelConstants.MSG_DATA_SYSTEM;
+               chartName = TimelineChartLabels.CPU_FREQUENCY_CHART_TITLE;
+               chartIcon = ImageResources.CHART_CPU_FREQUENCY;
+               addIcon = ImageResources.ADD_CHART_CPU_FREQUENCY;
+       }
+
+       @Override
+       public DAChartBoardItem createBoardItem(DAChartBoard board) {
+               DAChartBoardItem item = super.createBoardItem(board);
+
+               chart.getPlot().setAxisUnit("Hz");
+               chart.getPlot().setShowAxis(true);
+               return item;
+       }
+
+       @Override
+       public void inputChartSeries(List<Object> dataList) {
+               if (coreSize == TimelineConstants.NOT_INITED) {
+                       if (AnalyzerManager.getProject() == null) {
+                               return;
+                       }
+                       coreSize = AnalyzerManager.getProject().getDeviceStatusInfo()
+                                       .getCpuCount();
+                       for (int i = 0; i < coreSize; i++) {
+                               DAChartSeries chartSeries = new DAChartSeries(
+                                               TimelineChartLabels.CPU_CORE_CHART_SERIES_NAME_CORE + i,
+                                               DAChartSeries.SERIES_STYLE_LINE,
+                                               coreChartSeriesColors[i % coreSize]);
+                               chart.addSeries(chartSeries);
+                               coreFrequencyChartSeriesList.add(chartSeries);
+                       }
+               }
+
+               for (int i = 0; i < coreFrequencyChartSeriesList.size(); i++) {
+                       coreFrequencyChartSeriesList.get(i).clear();
+               }
+
+               @SuppressWarnings("unchecked")
+               List<List<Object>> data = (List<List<Object>>) dataList
+                               .get(TimelineConstants.CPU_DB_DATA);
+
+               // data.size() == coreSize
+               for (int i = 0; i < data.size(); i++) {
+                       List<Object> row = data.get(i);
+                       for (int ii = 0; ii < row.size(); ii++) {
+                               @SuppressWarnings("unchecked")
+                               List<Object> oneTime = (List<Object>) row.get(ii);
+                               double time = (Long) oneTime.get(CPUDBTable.COLUMN.TIME
+                                               .ordinal()) / TimelineConstants.MEGA_DOUBLE;
+                               double freq = getCPUFrequencyHz((Float) oneTime
+                                               .get(CPUDBTable.COLUMN.CPU_FREQUENCY.ordinal()));
+                               coreFrequencyChartSeriesList.get(i).addSeriesItem(
+                                               new DAChartSeriesItem(time, freq, Formatter
+                                                               .toHzFormat(freq)));
+                       }
+               }
+       }
+
+       @Override
+       public void clear() {
+               super.clear();
+               coreSize = TimelineConstants.NOT_INITED;
+               coreFrequencyChartSeriesList.clear();
+       }
+
+       private double getCPUFrequencyHz(double kHz) {
+               return kHz * 1000.0;
+       }
 }
index 1a5f331..5b01869 100644 (file)
@@ -30,7 +30,7 @@ package org.tizen.dynamicanalyzer.ui.timeline.chart;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.common.GlobalInformation;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
@@ -54,169 +54,176 @@ import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
 import org.tizen.dynamicanalyzer.widgets.helper.Formatter;
 import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu;
 
-
 public class EnergyChart extends TimelineChart {
-    private static EnergyChart instance = null;
-    private static final String UNIT = "A";
-
-    private DAChartSeries energyUsageSeries;
-    private List<DAChartSeries> deviceUsageSeriesList;
-    private List<DAChartSeries> deviceUsagePerAppSeriesList;
-
-    private DAChartBoardItem appUsageItem;
-
-    public static EnergyChart getInstance() {
-        if (instance == null) {
-            instance = new EnergyChart();
-        }
-
-        return instance;
-    }
-
-    private EnergyChart() {
-        chartType = TimelineConstants.CHART_TYPE_ENERGY;
-        probeType = DataChannelConstants.MSG_DATA_SYSTEM;
-        chartName = TimelineChartLabels.ENERGY_CHART_TITLE;
-        chartIcon = ImageResources.CHART_ENERGY;
-        addIcon = ImageResources.ADD_CHART_ENERGY;
-
-        DALogger.getInstance().check("This line was comment.(//FIXME)");
-        energyUsageSeries =
-                new DAChartSeries(TimelineChartLabels.ENERGY_CHART_SERIES, DAChartSeries.SERIES_STYLE_LINE,
-                                  ColorResources.RED);
-        deviceUsageSeriesList = new ArrayList<DAChartSeries>();
-        deviceUsagePerAppSeriesList = new ArrayList<DAChartSeries>();
-    }
-
-    @Override
-    public DAChartBoardItem createBoardItem(DAChartBoard board) {
-        DAChartBoardItem item = super.createBoardItem(board);
-
-        chart.getPlot().setAxisUnit(UNIT);
-        chart.getPlot().setAxisUnitType(DAChartPlot.UnitType.MICRO_DECIMAL);
-        chart.getPlot().setShowAxis(true);
-
-        appUsageItem = new DAChartBoardItem(item, "App usage");
-        DAChart appUsageChart = appUsageItem.getChart();
-        DAChartPlot appUsageChartPlot = appUsageChart.getPlot();
-        DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
-
-        appUsageChartPlot.setBackgroundImage(ImageResources.BG_GRADIENT);
-        appUsageChartPlot.setAutoHeightRange(AutoRangeType.SEMI_AUTO);
-        tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
-        appUsageChartPlot.setTooltip(tooltip);
-        appUsageChartPlot.setAxisUnit(UNIT);
-        appUsageChartPlot.setAxisUnitType(DAChartPlot.UnitType.MICRO_DECIMAL);
-        appUsageChartPlot.setShowAxis(true);
-        appUsageChartPlot.setMarkers(board.getMarkers());
-
-        initPopupMenu(board, new DAPopupMenu(appUsageChart));
-
-        TimelineChartMouseEventListener timelineChartMouseEventListener =
-                new TimelineChartMouseEventListener(popupMenu, board.getTimeline());
-        appUsageChart.addMouseListener(timelineChartMouseEventListener);
-        appUsageChart.addMouseMoveListener(timelineChartMouseEventListener);
-        appUsageChart
-                .addMouseTrackListener(new TimelineChartMouseTrackAdapter(board.getTimeline()));
-
-        return item;
-    }
-
-    @Override
-    public void inputChartSeries(List<Object> dataList) {
-        energyUsageSeries.clear();
-        for (int i = 0; i < deviceUsageSeriesList.size(); i++) {
-            deviceUsageSeriesList.get(i).clear();
-        }
-        for (int i = 0; i < deviceUsagePerAppSeriesList.size(); i++) {
-            deviceUsagePerAppSeriesList.get(i).clear();
-        }
-
-        try {
-            if (chart.getSeriesList().isEmpty()) {
-                if (GlobalInformation.getCurrentDeviceInfo() == null) {
-                    return;
-                }
-                chart.addSeries(energyUsageSeries);
-                
-                String[] deviceList =
-                        GlobalInformation.getCurrentDeviceInfo().getComponentInfo().getDevices()
-                                .split(CommonConstants.COMMA);
-                for (String device : deviceList) {
-                    deviceUsageSeriesList.add(new DAChartSeries(device,
-                                                                DAChartSeries.SERIES_STYLE_LINE));
-                    deviceUsagePerAppSeriesList
-                            .add(new DAChartSeries(device, DAChartSeries.SERIES_STYLE_LINE));
-                }
-
-                for (DAChartSeries series : deviceUsageSeriesList) {
-                    chart.addSeries(series);
-                }
-                for (DAChartSeries series : deviceUsagePerAppSeriesList) {
-                    appUsageItem.getChart().addSeries(series);
-                }
-            }
-            
-            @SuppressWarnings("unchecked")
-            List<List<Object>> systemData = (List<List<Object>>) dataList.get(TimelineConstants.SYSTEM_DB_DATA);
-            @SuppressWarnings("unchecked")
-            List<List<Object>> energyData = (List<List<Object>>) dataList.get(TimelineConstants.ENERGY_DB_DATA);
-
-            if (energyData.size() != deviceUsageSeriesList.size()) {
-               return;
-            }
-            
-            for (int i = 0; i < systemData.size(); i++) {
-                List<Object> row = systemData.get(i);
-                double time =
-                        (Long) row.get(SystemDataDBTable.COLUMN.TIME.ordinal())
-                                / TimelineConstants.MEGA_DOUBLE;
-
-                try {
-                    int energyUsage =
-                            (Integer) row.get(SystemDataDBTable.COLUMN.ENERGY_USAGE.ordinal());
-
-                    energyUsageSeries
-                            .addSeriesItem(new DAChartSeriesItem(time, energyUsage, Formatter
-                                    .convertMicroDecimalPrefix(energyUsage) + UNIT));
-                } catch (NumberFormatException ne) {
-                    ne.printStackTrace();
-                }
-            }
-
-            for (int i = 0; i < energyData.size(); i++) {
-                List<Object> row = energyData.get(i);
-                DAChartSeries deviceUsageSeries = deviceUsageSeriesList.get(i);
-                DAChartSeries deviceAppUsageSeries = deviceUsagePerAppSeriesList.get(i);
-                for (int ii = 0; ii < row.size(); ii++) {
-                    @SuppressWarnings("unchecked")
-                    List<Object> oneTime = (List<Object>) row.get(ii);
-                    double time =
-                            (Long) oneTime.get(EnergyDBTable.COLUMN.TIME.ordinal())
-                                    / TimelineConstants.MEGA_DOUBLE;
-                    double usage =
-                            (Integer) oneTime.get(EnergyDBTable.COLUMN.ENERGY_USAGE_DEVICE
-                                    .ordinal());
-                    double usageApp =
-                            (Integer) oneTime.get(EnergyDBTable.COLUMN.ENERGY_USAGE_APP.ordinal());
-
-                    deviceUsageSeries
-                            .addSeriesItem(new DAChartSeriesItem(time, usage, Formatter
-                                                   .convertMicroDecimalPrefix(usage) + UNIT));
-                    deviceAppUsageSeries
-                            .addSeriesItem(new DAChartSeriesItem(time, usageApp, Formatter
-                                                   .convertMicroDecimalPrefix(usageApp) + UNIT));
-                }
-            }
-        } catch (NumberFormatException ne) {
-            ne.printStackTrace();
-        }
-    }
-    
-    @Override
-    public void clear() {
-       super.clear();
-       deviceUsageSeriesList.clear();
-       deviceUsagePerAppSeriesList.clear();
-    }
+       private static EnergyChart instance = null;
+       private static final String UNIT = "A";
+
+       private DAChartSeries energyUsageSeries;
+       private List<DAChartSeries> deviceUsageSeriesList;
+       private List<DAChartSeries> deviceUsagePerAppSeriesList;
+
+       private DAChartBoardItem appUsageItem;
+
+       public static EnergyChart getInstance() {
+               if (instance == null) {
+                       instance = new EnergyChart();
+               }
+
+               return instance;
+       }
+
+       private EnergyChart() {
+               chartType = TimelineConstants.CHART_TYPE_ENERGY;
+               probeType = DataChannelConstants.MSG_DATA_SYSTEM;
+               chartName = TimelineChartLabels.ENERGY_CHART_TITLE;
+               chartIcon = ImageResources.CHART_ENERGY;
+               addIcon = ImageResources.ADD_CHART_ENERGY;
+
+               DALogger.getInstance().check("This line was comment.(//FIXME)");
+               energyUsageSeries = new DAChartSeries(
+                               TimelineChartLabels.ENERGY_CHART_SERIES,
+                               DAChartSeries.SERIES_STYLE_LINE, ColorResources.RED);
+               deviceUsageSeriesList = new ArrayList<DAChartSeries>();
+               deviceUsagePerAppSeriesList = new ArrayList<DAChartSeries>();
+       }
+
+       @Override
+       public DAChartBoardItem createBoardItem(DAChartBoard board) {
+               DAChartBoardItem item = super.createBoardItem(board);
+
+               chart.getPlot().setAxisUnit(UNIT);
+               chart.getPlot().setAxisUnitType(DAChartPlot.UnitType.MICRO_DECIMAL);
+               chart.getPlot().setShowAxis(true);
+
+               appUsageItem = new DAChartBoardItem(item, "App usage");
+               DAChart appUsageChart = appUsageItem.getChart();
+               DAChartPlot appUsageChartPlot = appUsageChart.getPlot();
+               DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
+
+               appUsageChartPlot.setBackgroundImage(ImageResources.BG_GRADIENT);
+               appUsageChartPlot.setAutoHeightRange(AutoRangeType.SEMI_AUTO);
+               tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
+               appUsageChartPlot.setTooltip(tooltip);
+               appUsageChartPlot.setAxisUnit(UNIT);
+               appUsageChartPlot.setAxisUnitType(DAChartPlot.UnitType.MICRO_DECIMAL);
+               appUsageChartPlot.setShowAxis(true);
+               appUsageChartPlot.setMarkers(board.getMarkers());
+
+               initPopupMenu(board, new DAPopupMenu(appUsageChart));
+
+               TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
+                               popupMenu, board.getTimeline());
+               appUsageChart.addMouseListener(timelineChartMouseEventListener);
+               appUsageChart.addMouseMoveListener(timelineChartMouseEventListener);
+               appUsageChart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(
+                               board.getTimeline()));
+
+               return item;
+       }
+
+       @Override
+       public void inputChartSeries(List<Object> dataList) {
+               energyUsageSeries.clear();
+               for (int i = 0; i < deviceUsageSeriesList.size(); i++) {
+                       deviceUsageSeriesList.get(i).clear();
+               }
+               for (int i = 0; i < deviceUsagePerAppSeriesList.size(); i++) {
+                       deviceUsagePerAppSeriesList.get(i).clear();
+               }
+
+               try {
+                       if (chart.getSeriesList().isEmpty()) {
+                               if (AnalyzerManager.getProject() == null) {
+                                       return;
+                               }
+                               chart.addSeries(energyUsageSeries);
+
+                               String[] deviceList = AnalyzerManager.getProject()
+                                               .getDeviceStatusInfo().getDevices()
+                                               .split(CommonConstants.COMMA);
+                               for (String device : deviceList) {
+                                       deviceUsageSeriesList.add(new DAChartSeries(device,
+                                                       DAChartSeries.SERIES_STYLE_LINE));
+                                       deviceUsagePerAppSeriesList.add(new DAChartSeries(device,
+                                                       DAChartSeries.SERIES_STYLE_LINE));
+                               }
+
+                               for (DAChartSeries series : deviceUsageSeriesList) {
+                                       chart.addSeries(series);
+                               }
+                               for (DAChartSeries series : deviceUsagePerAppSeriesList) {
+                                       appUsageItem.getChart().addSeries(series);
+                               }
+                       }
+
+                       @SuppressWarnings("unchecked")
+                       List<List<Object>> systemData = (List<List<Object>>) dataList
+                                       .get(TimelineConstants.SYSTEM_DB_DATA);
+                       @SuppressWarnings("unchecked")
+                       List<List<Object>> energyData = (List<List<Object>>) dataList
+                                       .get(TimelineConstants.ENERGY_DB_DATA);
+
+                       if (energyData.size() != deviceUsageSeriesList.size()) {
+                               return;
+                       }
+
+                       for (int i = 0; i < systemData.size(); i++) {
+                               List<Object> row = systemData.get(i);
+                               double time = (Long) row.get(SystemDataDBTable.COLUMN.TIME
+                                               .ordinal()) / TimelineConstants.MEGA_DOUBLE;
+
+                               try {
+                                       int energyUsage = (Integer) row
+                                                       .get(SystemDataDBTable.COLUMN.ENERGY_USAGE
+                                                                       .ordinal());
+
+                                       energyUsageSeries.addSeriesItem(new DAChartSeriesItem(time,
+                                                       energyUsage, Formatter
+                                                                       .convertMicroDecimalPrefix(energyUsage)
+                                                                       + UNIT));
+                               } catch (NumberFormatException ne) {
+                                       ne.printStackTrace();
+                               }
+                       }
+
+                       for (int i = 0; i < energyData.size(); i++) {
+                               List<Object> row = energyData.get(i);
+                               DAChartSeries deviceUsageSeries = deviceUsageSeriesList.get(i);
+                               DAChartSeries deviceAppUsageSeries = deviceUsagePerAppSeriesList
+                                               .get(i);
+                               for (int ii = 0; ii < row.size(); ii++) {
+                                       @SuppressWarnings("unchecked")
+                                       List<Object> oneTime = (List<Object>) row.get(ii);
+                                       double time = (Long) oneTime.get(EnergyDBTable.COLUMN.TIME
+                                                       .ordinal()) / TimelineConstants.MEGA_DOUBLE;
+                                       double usage = (Integer) oneTime
+                                                       .get(EnergyDBTable.COLUMN.ENERGY_USAGE_DEVICE
+                                                                       .ordinal());
+                                       double usageApp = (Integer) oneTime
+                                                       .get(EnergyDBTable.COLUMN.ENERGY_USAGE_APP
+                                                                       .ordinal());
+
+                                       deviceUsageSeries.addSeriesItem(new DAChartSeriesItem(time,
+                                                       usage, Formatter.convertMicroDecimalPrefix(usage)
+                                                                       + UNIT));
+                                       deviceAppUsageSeries
+                                                       .addSeriesItem(new DAChartSeriesItem(
+                                                                       time,
+                                                                       usageApp,
+                                                                       Formatter
+                                                                                       .convertMicroDecimalPrefix(usageApp)
+                                                                                       + UNIT));
+                               }
+                       }
+               } catch (NumberFormatException ne) {
+                       ne.printStackTrace();
+               }
+       }
+
+       @Override
+       public void clear() {
+               super.clear();
+               deviceUsageSeriesList.clear();
+               deviceUsagePerAppSeriesList.clear();
+       }
 }
\ No newline at end of file
index 05682fe..5264aec 100644 (file)
@@ -34,7 +34,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import org.tizen.dynamicanalyzer.common.GlobalInformation;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
@@ -92,7 +92,7 @@ public class SystemMemoryChart extends TimelineChart {
                chart.addSeries(totalSeries);
                chart.addSeries(systemSeries);
                chart.addSeries(processSeries);
-               
+
                chart.getPlot().setAxisUnit("B");
                chart.getPlot().setAxisUnitType(DAChartPlot.UnitType.BINARY);
                chart.getPlot().setShowAxis(true);
@@ -105,69 +105,81 @@ public class SystemMemoryChart extends TimelineChart {
                processSeries.clear();
                systemSeries.clear();
                totalSeries.clear();
-       
-               if (GlobalInformation.getCurrentDeviceInfo() == null) {
+
+               if (AnalyzerManager.getProject() == null) {
                        return;
                }
-               
-               long systemMemorySize = GlobalInformation.getCurrentDeviceInfo().getComponentInfo().getSystemMemorySize();
-               
+
+               long systemMemorySize = AnalyzerManager.getProject()
+                               .getDeviceStatusInfo().getSystemMemorySize();
+
+               @SuppressWarnings("unchecked")
+               List<List<Object>> systemData = (List<List<Object>>) dataList
+                               .get(TimelineConstants.SYSTEM_DB_DATA);
                @SuppressWarnings("unchecked")
-       List<List<Object>> systemData = (List<List<Object>>)dataList.get(TimelineConstants.SYSTEM_DB_DATA);
-       @SuppressWarnings("unchecked")
-       Map<Integer, List<List<Object>>> targetProcessDataMap = 
-                                               (Map<Integer, List<List<Object>>>)dataList.get(TimelineConstants.TARGET_PROCESS_DB_DATA);
-               
-       /*
-        * Make Total memory, System usage memory series
-        */
-       double maxTime = 0.0;
-       for (int i = 0; i < systemData.size(); i++) {
-               List<Object> row = systemData.get(i);
-               double time = (Long)row.get(SystemDataDBTable.COLUMN.TIME.ordinal())
-                       / TimelineConstants.MEGA_DOUBLE;
-               
-               try {
-                   long systemMemoryUsage = (Long)row.get(SystemDataDBTable.COLUMN.MEMORY_USAGE_SYSTEM.ordinal());
-                   totalSeries.addSeriesItem(new DAChartSeriesItem(time, systemMemorySize,
-                               Formatter.toByteFormat(systemMemorySize)));
-                   systemSeries.addSeriesItem(new DAChartSeriesItem(time, systemMemoryUsage,
-                               Formatter.toByteFormat(systemMemoryUsage)));
-               } catch (NumberFormatException ne) {
-                   ne.printStackTrace();
-               }
-               maxTime = time;
-       }
-       
-       /*
-        * Make Process memory series
-        */
-       Iterator<Integer> iter = targetProcessDataMap.keySet().iterator(); 
-       Map<Long, Long> processLoadSumMap = new HashMap<Long, Long>();
+               Map<Integer, List<List<Object>>> targetProcessDataMap = (Map<Integer, List<List<Object>>>) dataList
+                               .get(TimelineConstants.TARGET_PROCESS_DB_DATA);
+
+               /*
+                * Make Total memory, System usage memory series
+                */
+               double maxTime = 0.0;
+               for (int i = 0; i < systemData.size(); i++) {
+                       List<Object> row = systemData.get(i);
+                       double time = (Long) row.get(SystemDataDBTable.COLUMN.TIME
+                                       .ordinal()) / TimelineConstants.MEGA_DOUBLE;
+
+                       try {
+                               long systemMemoryUsage = (Long) row
+                                               .get(SystemDataDBTable.COLUMN.MEMORY_USAGE_SYSTEM
+                                                               .ordinal());
+                               totalSeries.addSeriesItem(new DAChartSeriesItem(time,
+                                               systemMemorySize, Formatter
+                                                               .toByteFormat(systemMemorySize)));
+                               systemSeries.addSeriesItem(new DAChartSeriesItem(time,
+                                               systemMemoryUsage, Formatter
+                                                               .toByteFormat(systemMemoryUsage)));
+                       } catch (NumberFormatException ne) {
+                               ne.printStackTrace();
+                       }
+                       maxTime = time;
+               }
+
+               /*
+                * Make Process memory series
+                */
+               Iterator<Integer> iter = targetProcessDataMap.keySet().iterator();
+               Map<Long, Long> processLoadSumMap = new HashMap<Long, Long>();
                while (iter.hasNext()) {
-               Integer pid = iter.next();
-               List<List<Object>> data = targetProcessDataMap.get(pid);
-               for (int i = 0; i < data.size(); i++) {
-                       List<Object> oneTime = data.get(i);
-                       Long time = (Long)oneTime.get(TargetProcessDBTable.COLUMN.TIME.ordinal());
-                       Long processMemorySize = (Long)oneTime.get(TargetProcessDBTable.COLUMN.MEMORY_RESIDENT.ordinal());
-                       Long processMemorySizeSum = processLoadSumMap.get(time);
-                       if (processMemorySizeSum == null) {
-                               processLoadSumMap.put(time, processMemorySize);
-                       } else {
-                               processLoadSumMap.put(time, processMemorySizeSum + processMemorySize);
-                       }
-               }
+                       Integer pid = iter.next();
+                       List<List<Object>> data = targetProcessDataMap.get(pid);
+                       for (int i = 0; i < data.size(); i++) {
+                               List<Object> oneTime = data.get(i);
+                               Long time = (Long) oneTime.get(TargetProcessDBTable.COLUMN.TIME
+                                               .ordinal());
+                               Long processMemorySize = (Long) oneTime
+                                               .get(TargetProcessDBTable.COLUMN.MEMORY_RESIDENT
+                                                               .ordinal());
+                               Long processMemorySizeSum = processLoadSumMap.get(time);
+                               if (processMemorySizeSum == null) {
+                                       processLoadSumMap.put(time, processMemorySize);
+                               } else {
+                                       processLoadSumMap.put(time, processMemorySizeSum
+                                                       + processMemorySize);
+                               }
+                       }
                }
-               List<Long> timeSortedLoadList = new ArrayList<Long>(processLoadSumMap.keySet());
+               List<Long> timeSortedLoadList = new ArrayList<Long>(
+                               processLoadSumMap.keySet());
                Collections.sort(timeSortedLoadList);
                Iterator<Long> iterProcessLoadSum = timeSortedLoadList.iterator();
                while (iterProcessLoadSum.hasNext()) {
                        Long time = iterProcessLoadSum.next();
                        Long processMemorySizeSum = processLoadSumMap.get(time);
                        if (maxTime >= time / TimelineConstants.MEGA_DOUBLE) {
-                               processSeries.addSeriesItem(new DAChartSeriesItem(time / TimelineConstants.MEGA_DOUBLE, processMemorySizeSum,
-                               Formatter.toByteFormat(processMemorySizeSum)));
+                               processSeries.addSeriesItem(new DAChartSeriesItem(time
+                                               / TimelineConstants.MEGA_DOUBLE, processMemorySizeSum,
+                                               Formatter.toByteFormat(processMemorySizeSum)));
                        }
                }
        }
index c2c1f0b..713b936 100644 (file)
@@ -25,7 +25,6 @@
  * 
  */
 
-
 package org.tizen.dynamicanalyzer.ui.timeline.common;
 
 import java.io.File;
@@ -34,6 +33,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.GlobalInformation;
 import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
@@ -90,761 +90,800 @@ import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.IDAChartSeriesMaker;
 
-
-public class TimelineChartManager extends PageDataManager implements IDAChartSeriesMaker {
+public class TimelineChartManager extends PageDataManager implements
+               IDAChartSeriesMaker {
        private static TimelineChartManager instance = null;
 
-    private boolean newCustomChart = false;
-    private List<TimelineChart> chartList;
-    private ArrayList<TimelineChart> newChartList;
-    private List<TimelineChart> selectedChartList;
-    private HashMap<String, TimelineChart> chartInstanceMapNameKey;
-    private HashMap<Integer, TimelineChart> chartInstanceMapTypeKey;
-
-    private HashMap<Long, UserCustomChart> customChartMap;
-    private DAChartBoard chartBoard = null;
-
-    private CustomLogParser customLogParser = null;
-    private final LifecycleLogParser lifecycleLogParser = LifecycleLogParser.getInstance();
-
-    private SystemDataDBTable systemDataTable = null;
-    private CPUDBTable cpuDBTable = null;
-    private ProcessLoadDBTable processLoadDBTable = null;
-    private EnergyDBTable energyDBTable = null;
-    private ScreenShotDBTable screenShotDBTable = null;
-    private UIEventDBTable uiEventDBTable = null;
-    private CustomDataDBTable customDataDBTable = null;
-    private TargetProcessDBTable targetProcessDBTable = null;
-
-    private static final int MEM_API_TYPE_ALLOC = 0;
-    private static final int MEM_API_TYPE_FREE = 1;
-    private static final int MEM_API_TYPE_MANAGE = 2;
-    private static final int MEM_USER = 2;
-    
-    private Map<Integer, Long> allocByteMap = new HashMap<Integer, Long>();    // Map<PID, allocByte>
-    private HashMap<Long, Long> allocationSeriesDataSetMap = new HashMap<Long, Long>();
-
-    public static TimelineChartManager getInstance() {
-        if (instance == null) {
-            instance = new TimelineChartManager();
-        }
-        return instance;
-    }
-
-    private TimelineChartManager() {
-        chartList = new ArrayList<TimelineChart>();
-        newChartList = new ArrayList<TimelineChart>();
-        selectedChartList = new ArrayList<TimelineChart>();
-        chartInstanceMapNameKey = new HashMap<String, TimelineChart>();
-        chartInstanceMapTypeKey = new HashMap<Integer, TimelineChart>();
-        customChartMap = new HashMap<Long, UserCustomChart>();
-
-        customLogParser = new CustomLogParser(this);
-
-        systemDataTable = new SystemDataDBTable();
-        cpuDBTable = new CPUDBTable();
-        processLoadDBTable = new ProcessLoadDBTable();
-        energyDBTable = new EnergyDBTable();
-        uiEventDBTable = new UIEventDBTable();
-        screenShotDBTable = new ScreenShotDBTable();
-        customDataDBTable = new CustomDataDBTable();
-        targetProcessDBTable = new TargetProcessDBTable();
-        addDBTable(systemDataTable);
-        addDBTable(cpuDBTable);
-        addDBTable(processLoadDBTable);
-        addDBTable(energyDBTable);
-        addDBTable(uiEventDBTable);
-        addDBTable(screenShotDBTable);
-        addDBTable(customDataDBTable);
-        addDBTable(targetProcessDBTable);
-        
-        initChartMap(CPUChart.getInstance());
-        initChartMap(CPUCoreChart.getInstance());
-        initChartMap(CPUFrequencyChart.getInstance());
-        initChartMap(HeapChart.getInstance());
-        initChartMap(ProcessMemoryChart.getInstance());
-        initChartMap(SystemMemoryChart.getInstance());
-        initChartMap(ScreenshotChart.getInstance());
-        initChartMap(UIEventChart.getInstance());
-        initChartMap(DiskIOChart.getInstance());
-        initChartMap(NetworkIOChart.getInstance());
-        initChartMap(DeviceChart.getInstance());
-        initChartMap(EnergyChart.getInstance());
-
-        loadSavedChartList();
-        loadSelectedChartList();
-    }
-
-    public void setChartTimelineChartBoard(DAChartBoard board) {
-        chartBoard = board;
-    }
-
-    private void loadSavedChartList() {
-        String savedChartNameList =
-                ConfigureManager.getInstance()
-                        .getValue(ConfigureLabels.CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LIST);
-        String[] chartNameList = savedChartNameList.split(","); //$NON-NLS-1$
-        int size = chartNameList.length;
-
-        if (size > 1) {
-            for (int i = 0; i < size; i++) {
-                TimelineChart chart = getChartInstance(chartNameList[i]);
-                if (chart != null) {
-                    chartList.add(chart);
-                }
-            }
-        } else {
-            for (TimelineChart chart : chartInstanceMapNameKey.values()) {
-                chartList.add(chart);
-            }
-        }
-    }
-
-    private void loadSelectedChartList() {
-        String strSaveSelectedItems =
-                ConfigureManager.getInstance()
-                        .getValue(ConfigureLabels.CONFIGUREMANAGER_CHART_SELECTED_ITEM_LIST);
-        if (strSaveSelectedItems.equalsIgnoreCase("")) {//$NON-NLS-1$
-            selectedChartList.addAll(chartList);
-        } else {
-            String[] savedSelectedChartNameList = strSaveSelectedItems.split(","); //$NON-NLS-1$
-            int size = savedSelectedChartNameList.length;
-            if (size != 0) {
-                for (int i = 0; i < size; i++) {
-                    TimelineChart chart = getChartInstance(savedSelectedChartNameList[i]);
-                    if (chart != null) {
-                        selectedChartList.add(chart);
-                    }
-                }
-            }
-        }
-    }
-
-    public void setChartList(List<TimelineChart> chartList) {
-        this.chartList.clear();
-        this.chartList.addAll(chartList);
-    }
-
-    public void setSelectedChartList(List<TimelineChart> chartList) {
-        this.selectedChartList.clear();
-        this.selectedChartList.addAll(chartList);
-    }
-
-    public List<TimelineChart> getChartList() {
-        return chartList;
-    }
-
-    public List<TimelineChart> getSelectedChartList() {
-        return selectedChartList;
-    }
-
-    private TimelineChart getChartInstance(String chartName) {
-        return chartInstanceMapNameKey.get(chartName);
-    }
-
-    public TimelineChart getChartInstance(int chartType) {
-        TimelineChart chart = chartInstanceMapTypeKey.get(chartType);
-
-        if (chart == null) {
-            chart = customChartMap.get(chartType);
-        }
-
-        return chart;
-    }
-
-    private void initChartMap(TimelineChart chart) {
-        chartInstanceMapNameKey.put(chart.getChartName(), chart);
-        chartInstanceMapTypeKey.put(chart.getChartType(), chart);
-    }
-
-    public void addCustomChart(UserCustomChart customChart) {
-        long chartType = customChart.getChartType();
-        if (!customChartMap.containsKey(chartType)) {
-            customChartMap.put(chartType, customChart);
-            chartList.add(customChart);
-            if (!newCustomChart) {
-                newChartList.clear();
-            }
-            newChartList.add(customChart);
-            newCustomChart = true;
-
-            StringBuffer strSaveChartNameList = new StringBuffer(""); //$NON-NLS-1$
-
-            for (int i = 0; i < chartList.size(); i++) {
-                strSaveChartNameList.append(chartList.get(i).getChartName());
-                strSaveChartNameList.append(","); //$NON-NLS-1$
-            }
-
-            ConfigureManager.getInstance()
-                    .setValue(ConfigureLabels.CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LIST,
-                              strSaveChartNameList.toString());
-        }
-    }
-
-    public List<DAChartSeries> getDAChartSeriesList(int chartType) {
-        return getChartInstance(chartType).getBaseDASeriesList();
-    }
-
-    @SuppressWarnings("unchecked")
-    public void addNewCustomChart() {
-        if (newCustomChart) {
-            List<TimelineChart> newChartList = (List<TimelineChart>) this.newChartList.clone();
-            this.newChartList.clear();
-            newCustomChart = false;
-            for (TimelineChart chart : newChartList) {
-                selectedChartList.add(chart);
-                DAChartBoardItem item = chart.createBoardItem(chartBoard);
-
-                DAChart chartWidget = item.getChart();
-                chartWidget.getPlot().setAxisRangeX(chartBoard.getVisibleStartTime(),
-                                                    chartBoard.getVisibleEndTime());
-
-                chartWidget.getPlot().setMarkers(chartBoard.getMarkers());
-                TimelineChartMouseEventListener timelineChartMouseEventListener =
-                        new TimelineChartMouseEventListener(chart.getPopupMenu(),
-                                                            chartBoard.getTimeline());
-                chartWidget.addMouseListener(timelineChartMouseEventListener);
-                chartWidget.addMouseMoveListener(timelineChartMouseEventListener);
-                chartWidget.addMouseTrackListener(new TimelineChartMouseTrackAdapter(chartBoard
-                        .getTimeline()));
-            }
-
-            StringBuffer selectedChartNameList = new StringBuffer(""); //$NON-NLS-1$
-            for (TimelineChart selectedChart : selectedChartList) {
-                selectedChartNameList.append(selectedChart.getChartName());
-                selectedChartNameList.append(","); //$NON-NLS-1$
-            }
-            ConfigureManager.getInstance()
-                    .setValue(ConfigureLabels.CONFIGUREMANAGER_CHART_SELECTED_ITEM_LIST,
-                              selectedChartNameList.toString());
-
-            // AnalyzerUtil.getTimelineComposite().resetItems();
-        }
-
-        for (TimelineChart timelineChart : chartList) {
-            if (timelineChart instanceof UserCustomChart) {
-                UserCustomChart customChart = (UserCustomChart) timelineChart;
-                ArrayList<DAChartSeries> tempSeriesList =
-                        (ArrayList<DAChartSeries>) customChart.getTempSeries().clone();
-                ((UserCustomChart) timelineChart).getTempSeries().clear();
-                for (DAChartSeries series : tempSeriesList) {
-                    customChart.addSeries(series);
-                }
-            }
-
-            timelineChart.update();
-        }
-    }
-
-    public void clear() {
-        if (null == chartList || 0 == chartList.size()) {
-            return;
-        }
-
-        for (TimelineChart timelineChart : chartList) {
-            timelineChart.clear();
-        }
-
-        chartList.clear();
-        selectedChartList.clear();
-        loadSavedChartList();
-        loadSelectedChartList();
-        customChartMap.clear();
-        customLogParser.clear();
-
-        allocByteMap.clear();
-        allocationSeriesDataSetMap.clear();
-    }
-
-    private void makeSystemDataTableData(Logs systemLogs, Logs memoryLogs) {
-        int coreSize = GlobalInformation.getCurrentDeviceInfo().getComponentInfo().getCpuCount();
-
-        List<LogData> memoryLogList = memoryLogs == null ? null : memoryLogs.getRawLogs();
-        List<LogData> systemLogList = systemLogs == null ? null : systemLogs.getRawLogs();
-
-        if (memoryLogList != null) {
-            int size = memoryLogList.size();
-            for (int i = 0; i < size; i++) {
-                MemoryData logData = (MemoryData) memoryLogList.get(i);
-                if (allocByteMap.get(logData.getPid()) == null) {
-                       allocByteMap.put(Integer.valueOf(logData.getPid()), new Long(0));
-                }
-                       
-                int memApiType = logData.getMemoryApiType();
-                int internalFlag = logData.getInternalCall();
-                long errorNo = logData.getErrno();
-
-                if (errorNo == 0 && MEM_USER == internalFlag) {
-                    if (MEM_API_TYPE_ALLOC == memApiType || MEM_API_TYPE_FREE == memApiType
-                            || MEM_API_TYPE_MANAGE == memApiType) {
-
-                        addNewSeriesUserAllocData(memApiType, logData);
-                    }
-                }
-            }
-        }
-        
-        if (systemLogList != null) {
-            ArrayList<List<Object>> systemDataList = new ArrayList<List<Object>>();
-            ArrayList<List<Object>> cpuDataList = new ArrayList<List<Object>>();
-            ArrayList<List<Object>> otherProcessDataList = new ArrayList<List<Object>>();
-            ArrayList<List<Object>> energyDataList = new ArrayList<List<Object>>();
-            ArrayList<List<Object>> targetProcessDataList = new ArrayList<List<Object>>();
-            int size = systemLogList.size();
-            for (int i = 0; i < size; i++) {
-                SystemData log = (SystemData) systemLogList.get(i);
-
-                /*
-                 * Make CPU Table data
-                 */
-                String[] cpuLoads = log.getCpuLoad().split(CommonConstants.COMMA);
-                double cpuLoadSum = 0.0;
-                
-                // logic
-                String[] cpuFrequencies = log.getCpuFrequency().split(CommonConstants.COMMA);
-                for (int ii = 0; ii < coreSize; ii++) {
-                    double cpuLoad = Double.parseDouble(cpuLoads[ii]);
-                    cpuLoadSum += cpuLoad;
-                    double cpuFrequency = Double.parseDouble(cpuFrequencies[ii]);
-                    ArrayList<Object> dbCPUData = new ArrayList<Object>();
-                    dbCPUData.add(new Long(log.getTime()));
-                    dbCPUData.add(new Integer(ii));
-                    dbCPUData.add(new Float(cpuLoad));
-                    dbCPUData.add(new Float(cpuFrequency));
-                    cpuDataList.add(dbCPUData);
-                }
-                
-                double systemAvgCPULoad = cpuLoadSum / coreSize;
-                ArrayList<Object> dbSystemData = new ArrayList<Object>();
-                dbSystemData.add(new Long(log.getTime()));
-                dbSystemData.add(new Float(systemAvgCPULoad));
-                dbSystemData.add(new Integer(log.getOtherProcessCount()));
-                dbSystemData.add(new Integer(log.getTargetProcessCount()));
-                dbSystemData.add(new Long(log.getSystemMemoryUsed()));
-                dbSystemData.add(new Integer(log.getNetworkSendSize()));
-                dbSystemData.add(new Integer(log.getNetworkReceiveSize()));
-                dbSystemData.add(new Integer(log.getWifi()));
-                dbSystemData.add(new Integer(log.getBtStatus()));
-                dbSystemData.add(new Integer(log.getGpsStatus()));
-                dbSystemData.add(new Integer(log.getBrightness()));
-                dbSystemData.add(new Integer(log.getDnet()));
-                dbSystemData.add(new Integer(log.getCamera()));
-                dbSystemData.add(new Integer(log.getSound()));
-                dbSystemData.add(new Integer(log.getAudio()));
-                dbSystemData.add(new Integer(log.getVibration()));
-                dbSystemData.add(new Integer(log.getVoltage()));
-                dbSystemData.add(new Integer(log.getRssi()));
-                dbSystemData.add(new Integer(log.getVideo()));
-                dbSystemData.add(new Integer(log.getCall()));
-                dbSystemData.add(new Integer(log.getTotalUsedDrive()));
-                dbSystemData.add(new Integer(log.getDiskReadSize()));
-                dbSystemData.add(new Integer(log.getDiskReadSectorCount()));
-                dbSystemData.add(new Integer(log.getDiskWriteSize()));
-                dbSystemData.add(new Integer(log.getDiskWrittenSectorCount()));
-                dbSystemData.add(new Integer(log.getEnergyUsage()));
-                systemDataList.add(dbSystemData);
-
-                /*
-                 * Make other Process Table data
-                 */
-                String[] processLoadDatas = log.getOtherProcessLoad().split(CommonConstants.COMMA);
-                for (int ii = 0; ii < processLoadDatas.length; ii++) {
-                    String processLoad = processLoadDatas[ii];
-                    if (processLoad == null || processLoad.isEmpty()) {
-                        continue;
-                    }
-                    int pid = Integer.parseInt(processLoad);
-                    double load = Double.parseDouble(processLoadDatas[++ii]);
-                    ArrayList<Object> dbProcessData = new ArrayList<Object>();
-                    dbProcessData.add(new Long(log.getTime()));
-                    dbProcessData.add(new Integer(pid));
-                    dbProcessData.add(new Float(load));
-                    otherProcessDataList.add(dbProcessData);
-                }
-                
-                /*
-                 * Make target Process Table data
-                 */
-                ProcessProfileData[] targetProcessList = log.getProcessProfileDataList();
-                if (targetProcessList != null) {
-                               for (int ii = 0; ii < targetProcessList.length; ii++) {
-                                       ProcessProfileData process = targetProcessList[ii];
-                                       ArrayList<Object> dbTargetProcessData = new ArrayList<Object>();
-                                       dbTargetProcessData.add(new Long(log.getTime()));
-                                       dbTargetProcessData.add(new Integer(process.getPid()));
-                                       dbTargetProcessData.add(new Float(process.getProcessLoad()));
-                                       dbTargetProcessData.add(new Long(process.getVirtualMemory()));
-                                       dbTargetProcessData.add(new Long(process.getResidentMemory()));
-                                       dbTargetProcessData.add(new Long(process.getSharedMemory()));
-                                       dbTargetProcessData.add(new Long(process.getPssMemory()));
-                                       dbTargetProcessData.add(new Long(process.getTotalAllocSize()));
-                                       
-                                       
-                                       if (allocByteMap.get(process.getPid()) == null) {
-                                               dbTargetProcessData.add(new Long(0));
-                                       } else {
-                                               dbTargetProcessData.add(allocByteMap.get(process.getPid()));
-                                       }
-                                       
-                                       targetProcessDataList.add(dbTargetProcessData);
-                               }
-                }
-
-                /*
-                 * Make Energy Table data
-                 */
-                String[] deviceEnergyUsages =
-                        log.getDeviceEnergyUsage().split(CommonConstants.COMMA);
-                String[] deviceEnergyUsagesPerApp =
-                        log.getApplicationEnergyUsage().split(CommonConstants.COMMA);
-                for (int ii = 0; ii < deviceEnergyUsages.length; ii++) {
-                    double usage = Double.parseDouble(deviceEnergyUsages[ii]);
-                    double usagePerApp = Double.parseDouble(deviceEnergyUsagesPerApp[ii]);
-                    ArrayList<Object> dbEnergyData = new ArrayList<Object>();
-                    dbEnergyData.add(new Long(log.getTime()));
-                    dbEnergyData.add(new Integer(ii));
-                    dbEnergyData.add(new Integer((int)usage)); // TODO change float
-                    dbEnergyData.add(new Integer((int)usagePerApp)); // TODO change float
-                    energyDataList.add(dbEnergyData);
-                }
-            }
-            SystemDataDBInserter.pushContextData(systemDataList);
-            SystemDataDBInserter.startThread();
-            CPUDBInserter.pushContextData(cpuDataList);
-            CPUDBInserter.startThread();
-            ProcessDataDBInserter.pushContextData(otherProcessDataList);
-            ProcessDataDBInserter.startThread();
-            EnergyDataDBInserter.pushContextData(energyDataList);
-            EnergyDataDBInserter.startThread();
-            TargetProcessDBInserter.pushContextData(targetProcessDataList);
-            TargetProcessDBInserter.startThread();
-        }
-    }
-
-    private void makeUIEventDBTableData(Logs uiEventLogs) {
-        List<LogData> uiEventLogList = uiEventLogs == null ? null : uiEventLogs.getRawLogs();
-        if (uiEventLogList != null) {
-               ArrayList<List<Object>> uiEventDataList = new ArrayList<List<Object>>();
-            int size = uiEventLogList.size();
-            for (int i = 0; i < size; i++) {
-                UIEventData log = (UIEventData) uiEventLogList.get(i);
-                ArrayList<Object> dbUIEventData = new ArrayList<Object>();
-
-                dbUIEventData.add(new Long(log.getTime()));
-                dbUIEventData.add(new Integer(log.getEventType()));
-                dbUIEventData.add(new Integer(log.getDetailType()));
-                dbUIEventData.add(new Integer(log.getX()));
-                dbUIEventData.add(new Integer(log.getY()));
-                dbUIEventData.add(log.getInfo1());
-                dbUIEventData.add(new Integer(log.getInfo2()));
-
-                uiEventDataList.add(dbUIEventData);
-              }
-            
-            UIEventDBInserter.pushContextData(uiEventDataList);
-            UIEventDBInserter.startThread();
-        }
-    }
-
-    private void makeScreenShotDBTableData(Logs screenShotLogs) {
-        List<LogData> screenShotLogList =
-                screenShotLogs == null ? null : screenShotLogs.getRawLogs();
-        if (screenShotLogList != null) {
-               ArrayList<List<Object>> screenShotDataList = new ArrayList<List<Object>>();
-            int size = screenShotLogList.size();
-            for (int i = 0; i < size; i++) {
-                ScreenShotData log = (ScreenShotData) screenShotLogList.get(i);
-                ArrayList<Object> dbScreenShotData = new ArrayList<Object>();
-                String imagePathLog = null;
-                if (DACommunicator.isTargetEmulator() && SocketClient.getInstance().isConnected()) {
-                    imagePathLog =
-                               GlobalInformation.getCurrentDeviceInfo().emulatorScreenshot.getFilePath();
-                } else {
-                    imagePathLog = log.getImageFilePath();
-                }
-                String[] splitedImagePathLog = imagePathLog.split(File.separator); //$NON-NLS-1$
-                String fileName = splitedImagePathLog[splitedImagePathLog.length - 1];
-
-                dbScreenShotData.add(new Long(log.getTime()));
-                dbScreenShotData.add(fileName);
-                dbScreenShotData.add(new Integer(log.getOrientation()));
-
-                screenShotDataList.add(dbScreenShotData);
-            }
-
-            ScreenShotDBInserter.pushContextData(screenShotDataList);
-            ScreenShotDBInserter.startThread();
-        }
-    }
-    
-    private void addNewSeriesUserAllocData(int fdApiType, MemoryData log) {
-        long size = 0;
-        Long allocByte = allocByteMap.get(log.getPid());
-        
-        long address = log.getAddress();
-        if (address == 0) {
-            return;
-        }
-
-        if (MEM_API_TYPE_ALLOC == fdApiType) {
-            try {
-                size = log.getSize();
-                allocByteMap.put(log.getPid(), allocByte + size);
-                allocationSeriesDataSetMap.put(address, size);
-            } catch (NumberFormatException ne) {
-                ne.printStackTrace();
-            }
-        } else if (MEM_API_TYPE_FREE == fdApiType) {
-            if (!allocationSeriesDataSetMap.containsKey(address)) {
-                return;
-            }
-            size = allocationSeriesDataSetMap.get(address);
-            allocByteMap.put(log.getPid(), allocByte - size);
-        }
-    }
-
-    public DBTable getSystemDataTable() {
-        return systemDataTable;
-    }
-
-    public DBTable getCPUTable() {
-        return cpuDBTable;
-    }
-
-    public DBTable getUIEventTable() {
-        return uiEventDBTable;
-    }
-
-    public DBTable getProcessTable() {
-        return processLoadDBTable;
-    }
-
-    public DBTable getEnergyTable() {
-        return energyDBTable;
-    }
-
-    public DBTable getScreenShotTable() {
-        return screenShotDBTable;
-    }
-
-    public DBTable getCustomDataTable() {
-        return customDataDBTable;
-    }
-    
-    public DBTable getTargetProcessTable() {
-       return targetProcessDBTable;
-    }
-    
-    public List<List<Object>> getSystemDataFromDB(long start, long end) {
-        String where =
-                "where TIME BETWEEN " + start + " AND " + end + " ORDER BY "
-                        + SystemDataDBTable.TIME;
-        List<List<Object>> result = systemDataTable.selectData(null, where);
-
-        if (result != null) {
-            return result;
-        } else {
-            return new ArrayList<List<Object>>();
-        }
-    }
-
-    public List<List<Object>> getCPUDataFromDB(long start, long end) {
-        List<List<Object>> processedResult = new ArrayList<List<Object>>();
-        String where =
-                "where TIME BETWEEN " + start + " AND " + end + " ORDER BY " + CPUDBTable.TIME;
-        List<List<Object>> queryResult = cpuDBTable.selectData(null, where);
-        if (queryResult == null) {
-            return processedResult;
-        }
-
-        int cpuCount = GlobalInformation.getCurrentDeviceInfo().getComponentInfo().getCpuCount();
-        for (int i = 0; i < cpuCount; i++) {
-            List<Object> cpuLoads = new ArrayList<Object>();
-            processedResult.add(cpuLoads);
-        }
-        for (int i = 0; i < queryResult.size(); i++) {
-            List<Object> row = queryResult.get(i);
-            int coreNum = (Integer) row.get(CPUDBTable.COLUMN.CORE_NUM.ordinal());
-            processedResult.get(coreNum).add(row);
-        }
-        return processedResult;
-    }
-
-    public Map<Integer, List<List<Object>>> getProcessDataFromDB(long start, long end) {
-        Map<Integer, List<List<Object>>> processedResult =
-                new HashMap<Integer, List<List<Object>>>();
-
-        String where =
-                "where TIME BETWEEN " + start + " AND " + end + " ORDER BY "
-                        + ProcessLoadDBTable.TIME;
-        List<List<Object>> queryResult = processLoadDBTable.selectData(null, where);
-        if (queryResult == null) {
-            return processedResult;
-        }
-
-        for (int i = 0; i < queryResult.size(); i++) {
-            List<Object> row = queryResult.get(i);
-            Integer pid = (Integer) row.get(ProcessLoadDBTable.COLUMN.PID.ordinal());
-            List<List<Object>> processData = processedResult.get(pid);
-            if (processData == null) {
-                processData = new ArrayList<List<Object>>();
-                processedResult.put(pid, processData);
-            }
-            processData.add(row);
-        }
-        return processedResult;
-    }
-
-    public List<List<Object>> getEnergyDataFromDB(long start, long end) {
-        List<List<Object>> processedResult = new ArrayList<List<Object>>();
-
-        String where =
-                "where TIME BETWEEN " + start + " AND " + end + " ORDER BY " + EnergyDBTable.TIME;
-        List<List<Object>> queryResult = energyDBTable.selectData(null, where);
-        if (queryResult == null) {
-            return processedResult;
-        }
-
-        int deviceCount = GlobalInformation.getCurrentDeviceInfo().getComponentInfo().getDeviceCount();
-        for (int i = 0; i < deviceCount; i++) {
-            List<Object> energyPerDevice = new ArrayList<Object>();
-            processedResult.add(energyPerDevice);
-        }
-        for (int i = 0; i < queryResult.size(); i++) {
-            List<Object> row = queryResult.get(i);
-            int deviceNum = (Integer) row.get(EnergyDBTable.COLUMN.DEVICE_NUM.ordinal());
-            processedResult.get(deviceNum).add(row);
-        }
-        return processedResult;
-    }
-
-    public List<List<Object>> getUIEventDataFromDB(long start, long end) {
-        String where =
-                "where TIME BETWEEN " + start + " AND " + end + " ORDER BY " + UIEventDBTable.TIME;
-        List<List<Object>> result = uiEventDBTable.selectData(null, where);
-
-        if (result != null) {
-            return result;
-        } else {
-            return new ArrayList<List<Object>>();
-        }
-    }
-
-    public List<List<Object>> getScreenShotDataFromDB(long start, long end) {
-        String where =
-                "where TIME BETWEEN " + start + " AND " + end + " ORDER BY "
-                        + ScreenShotDBTable.TIME;
-        List<List<Object>> result = screenShotDBTable.selectData(null, where);
-
-        if (result != null) {
-            return result;
-        } else {
-            return new ArrayList<List<Object>>();
-        }
-    }
-
-    public List<List<Object>> getCustomDataFromDB(long start, long end) {
-        String where =
-                "where TIME BETWEEN " + start + " AND " + end + " ORDER BY "
-                        + CustomDataDBTable.TIME;
-        List<List<Object>> result = customDataDBTable.selectData(null, where);
-
-        if (result != null) {
-            return result;
-        } else {
-            return new ArrayList<List<Object>>();
-        }
-    }
-    
-    public Map<Integer, List<List<Object>>> getTargetProcessDataFromDB(long start, long end) {
-        Map<Integer, List<List<Object>>> processedResult =
-                new HashMap<Integer, List<List<Object>>>();
-
-        String where =
-                "where TIME BETWEEN " + start + " AND " + end + " ORDER BY "
-                        + TargetProcessDBTable.TIME;
-        List<List<Object>> queryResult = targetProcessDBTable.selectData(null, where);
-        if (queryResult == null) {
-            return processedResult;
-        }
-
-        for (int i = 0; i < queryResult.size(); i++) {
-            List<Object> row = queryResult.get(i);
-            Integer pid = (Integer) row.get(TargetProcessDBTable.COLUMN.PID.ordinal());
-            List<List<Object>> processData = processedResult.get(pid);
-            if (processData == null) {
-                processData = new ArrayList<List<Object>>();
-                processedResult.put(pid, processData);
-            }
-            processData.add(row);
-        }
-        return processedResult;
-    }
-
-    @Override
-    public void makeChartSeries(long startTime, long endTime) {
-        /*
-         * 1. Get DB data
-         */
-        List<List<Object>> systemDBData = getSystemDataFromDB(startTime, endTime);
-        List<List<Object>> cpuDBData = getCPUDataFromDB(startTime, endTime);
-        Map<Integer, List<List<Object>>> processDBData = getProcessDataFromDB(startTime, endTime);
-        List<List<Object>> energyDBData = getEnergyDataFromDB(startTime, endTime);
-        List<List<Object>> uiEventDBData = getUIEventDataFromDB(startTime, endTime);
-        List<List<Object>> screenShotDBData = getScreenShotDataFromDB(startTime, endTime);
-        List<List<Object>> customDBData = getCustomDataFromDB(startTime, endTime);
-        Map<Integer, List<List<Object>>> targetProcessDBData = getTargetProcessDataFromDB(startTime, endTime);
-
-        /*
-         * 2. Make series of chart
-         */
-        for (TimelineChart chart : chartList) {
-            if (chart.getProbeType() == DataChannelConstants.MSG_DATA_SYSTEM) {
-                List<Object> dataList = new ArrayList<Object>();
-                dataList.add(systemDBData);
-                dataList.add(cpuDBData);
-                dataList.add(processDBData);
-                dataList.add(energyDBData);
-                dataList.add(targetProcessDBData);
-                chart.inputChartSeries(dataList);
-            } else if (chart.getProbeType() == DataChannelConstants.MSG_PROBE_UIEVENT) {
-                List<Object> dataList = new ArrayList<Object>();
-                dataList.add(uiEventDBData);
-                chart.inputChartSeries(dataList);
-            } else if (chart.getProbeType() == DataChannelConstants.MSG_PROBE_SCREENSHOT) {
-                List<Object> dataList = new ArrayList<Object>();
-                dataList.add(screenShotDBData);
-                chart.inputChartSeries(dataList);
-            }
-        }
-
-        /*
-         * 3. Make series of custom chart
-         */
-        customLogParser.inputChartSeries(customDBData);
-    }
+       private boolean newCustomChart = false;
+       private List<TimelineChart> chartList;
+       private ArrayList<TimelineChart> newChartList;
+       private List<TimelineChart> selectedChartList;
+       private HashMap<String, TimelineChart> chartInstanceMapNameKey;
+       private HashMap<Integer, TimelineChart> chartInstanceMapTypeKey;
+
+       private HashMap<Long, UserCustomChart> customChartMap;
+       private DAChartBoard chartBoard = null;
+
+       private CustomLogParser customLogParser = null;
+       private final LifecycleLogParser lifecycleLogParser = LifecycleLogParser
+                       .getInstance();
+
+       private SystemDataDBTable systemDataTable = null;
+       private CPUDBTable cpuDBTable = null;
+       private ProcessLoadDBTable processLoadDBTable = null;
+       private EnergyDBTable energyDBTable = null;
+       private ScreenShotDBTable screenShotDBTable = null;
+       private UIEventDBTable uiEventDBTable = null;
+       private CustomDataDBTable customDataDBTable = null;
+       private TargetProcessDBTable targetProcessDBTable = null;
+
+       private static final int MEM_API_TYPE_ALLOC = 0;
+       private static final int MEM_API_TYPE_FREE = 1;
+       private static final int MEM_API_TYPE_MANAGE = 2;
+       private static final int MEM_USER = 2;
+
+       private Map<Integer, Long> allocByteMap = new HashMap<Integer, Long>(); // Map<PID,
+                                                                                                                                                       // allocByte>
+       private HashMap<Long, Long> allocationSeriesDataSetMap = new HashMap<Long, Long>();
+
+       public static TimelineChartManager getInstance() {
+               if (instance == null) {
+                       instance = new TimelineChartManager();
+               }
+               return instance;
+       }
+
+       private TimelineChartManager() {
+               chartList = new ArrayList<TimelineChart>();
+               newChartList = new ArrayList<TimelineChart>();
+               selectedChartList = new ArrayList<TimelineChart>();
+               chartInstanceMapNameKey = new HashMap<String, TimelineChart>();
+               chartInstanceMapTypeKey = new HashMap<Integer, TimelineChart>();
+               customChartMap = new HashMap<Long, UserCustomChart>();
+
+               customLogParser = new CustomLogParser(this);
+
+               systemDataTable = new SystemDataDBTable();
+               cpuDBTable = new CPUDBTable();
+               processLoadDBTable = new ProcessLoadDBTable();
+               energyDBTable = new EnergyDBTable();
+               uiEventDBTable = new UIEventDBTable();
+               screenShotDBTable = new ScreenShotDBTable();
+               customDataDBTable = new CustomDataDBTable();
+               targetProcessDBTable = new TargetProcessDBTable();
+               addDBTable(systemDataTable);
+               addDBTable(cpuDBTable);
+               addDBTable(processLoadDBTable);
+               addDBTable(energyDBTable);
+               addDBTable(uiEventDBTable);
+               addDBTable(screenShotDBTable);
+               addDBTable(customDataDBTable);
+               addDBTable(targetProcessDBTable);
+
+               initChartMap(CPUChart.getInstance());
+               initChartMap(CPUCoreChart.getInstance());
+               initChartMap(CPUFrequencyChart.getInstance());
+               initChartMap(HeapChart.getInstance());
+               initChartMap(ProcessMemoryChart.getInstance());
+               initChartMap(SystemMemoryChart.getInstance());
+               initChartMap(ScreenshotChart.getInstance());
+               initChartMap(UIEventChart.getInstance());
+               initChartMap(DiskIOChart.getInstance());
+               initChartMap(NetworkIOChart.getInstance());
+               initChartMap(DeviceChart.getInstance());
+               initChartMap(EnergyChart.getInstance());
+
+               loadSavedChartList();
+               loadSelectedChartList();
+       }
+
+       public void setChartTimelineChartBoard(DAChartBoard board) {
+               chartBoard = board;
+       }
+
+       private void loadSavedChartList() {
+               String savedChartNameList = ConfigureManager.getInstance().getValue(
+                               ConfigureLabels.CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LIST);
+               String[] chartNameList = savedChartNameList.split(","); //$NON-NLS-1$
+               int size = chartNameList.length;
+
+               if (size > 1) {
+                       for (int i = 0; i < size; i++) {
+                               TimelineChart chart = getChartInstance(chartNameList[i]);
+                               if (chart != null) {
+                                       chartList.add(chart);
+                               }
+                       }
+               } else {
+                       for (TimelineChart chart : chartInstanceMapNameKey.values()) {
+                               chartList.add(chart);
+                       }
+               }
+       }
+
+       private void loadSelectedChartList() {
+               String strSaveSelectedItems = ConfigureManager.getInstance().getValue(
+                               ConfigureLabels.CONFIGUREMANAGER_CHART_SELECTED_ITEM_LIST);
+               if (strSaveSelectedItems.equalsIgnoreCase("")) {//$NON-NLS-1$
+                       selectedChartList.addAll(chartList);
+               } else {
+                       String[] savedSelectedChartNameList = strSaveSelectedItems
+                                       .split(","); //$NON-NLS-1$
+                       int size = savedSelectedChartNameList.length;
+                       if (size != 0) {
+                               for (int i = 0; i < size; i++) {
+                                       TimelineChart chart = getChartInstance(savedSelectedChartNameList[i]);
+                                       if (chart != null) {
+                                               selectedChartList.add(chart);
+                                       }
+                               }
+                       }
+               }
+       }
+
+       public void setChartList(List<TimelineChart> chartList) {
+               this.chartList.clear();
+               this.chartList.addAll(chartList);
+       }
+
+       public void setSelectedChartList(List<TimelineChart> chartList) {
+               this.selectedChartList.clear();
+               this.selectedChartList.addAll(chartList);
+       }
+
+       public List<TimelineChart> getChartList() {
+               return chartList;
+       }
+
+       public List<TimelineChart> getSelectedChartList() {
+               return selectedChartList;
+       }
+
+       private TimelineChart getChartInstance(String chartName) {
+               return chartInstanceMapNameKey.get(chartName);
+       }
+
+       public TimelineChart getChartInstance(int chartType) {
+               TimelineChart chart = chartInstanceMapTypeKey.get(chartType);
+
+               if (chart == null) {
+                       chart = customChartMap.get(chartType);
+               }
+
+               return chart;
+       }
+
+       private void initChartMap(TimelineChart chart) {
+               chartInstanceMapNameKey.put(chart.getChartName(), chart);
+               chartInstanceMapTypeKey.put(chart.getChartType(), chart);
+       }
+
+       public void addCustomChart(UserCustomChart customChart) {
+               long chartType = customChart.getChartType();
+               if (!customChartMap.containsKey(chartType)) {
+                       customChartMap.put(chartType, customChart);
+                       chartList.add(customChart);
+                       if (!newCustomChart) {
+                               newChartList.clear();
+                       }
+                       newChartList.add(customChart);
+                       newCustomChart = true;
+
+                       StringBuffer strSaveChartNameList = new StringBuffer(""); //$NON-NLS-1$
+
+                       for (int i = 0; i < chartList.size(); i++) {
+                               strSaveChartNameList.append(chartList.get(i).getChartName());
+                               strSaveChartNameList.append(","); //$NON-NLS-1$
+                       }
+
+                       ConfigureManager.getInstance().setValue(
+                                       ConfigureLabels.CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LIST,
+                                       strSaveChartNameList.toString());
+               }
+       }
+
+       public List<DAChartSeries> getDAChartSeriesList(int chartType) {
+               return getChartInstance(chartType).getBaseDASeriesList();
+       }
+
+       @SuppressWarnings("unchecked")
+       public void addNewCustomChart() {
+               if (newCustomChart) {
+                       List<TimelineChart> newChartList = (List<TimelineChart>) this.newChartList
+                                       .clone();
+                       this.newChartList.clear();
+                       newCustomChart = false;
+                       for (TimelineChart chart : newChartList) {
+                               selectedChartList.add(chart);
+                               DAChartBoardItem item = chart.createBoardItem(chartBoard);
+
+                               DAChart chartWidget = item.getChart();
+                               chartWidget.getPlot().setAxisRangeX(
+                                               chartBoard.getVisibleStartTime(),
+                                               chartBoard.getVisibleEndTime());
+
+                               chartWidget.getPlot().setMarkers(chartBoard.getMarkers());
+                               TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
+                                               chart.getPopupMenu(), chartBoard.getTimeline());
+                               chartWidget.addMouseListener(timelineChartMouseEventListener);
+                               chartWidget
+                                               .addMouseMoveListener(timelineChartMouseEventListener);
+                               chartWidget
+                                               .addMouseTrackListener(new TimelineChartMouseTrackAdapter(
+                                                               chartBoard.getTimeline()));
+                       }
+
+                       StringBuffer selectedChartNameList = new StringBuffer(""); //$NON-NLS-1$
+                       for (TimelineChart selectedChart : selectedChartList) {
+                               selectedChartNameList.append(selectedChart.getChartName());
+                               selectedChartNameList.append(","); //$NON-NLS-1$
+                       }
+                       ConfigureManager.getInstance().setValue(
+                                       ConfigureLabels.CONFIGUREMANAGER_CHART_SELECTED_ITEM_LIST,
+                                       selectedChartNameList.toString());
+
+                       // AnalyzerUtil.getTimelineComposite().resetItems();
+               }
+
+               for (TimelineChart timelineChart : chartList) {
+                       if (timelineChart instanceof UserCustomChart) {
+                               UserCustomChart customChart = (UserCustomChart) timelineChart;
+                               ArrayList<DAChartSeries> tempSeriesList = (ArrayList<DAChartSeries>) customChart
+                                               .getTempSeries().clone();
+                               ((UserCustomChart) timelineChart).getTempSeries().clear();
+                               for (DAChartSeries series : tempSeriesList) {
+                                       customChart.addSeries(series);
+                               }
+                       }
+
+                       timelineChart.update();
+               }
+       }
+
+       public void clear() {
+               if (null == chartList || 0 == chartList.size()) {
+                       return;
+               }
+
+               for (TimelineChart timelineChart : chartList) {
+                       timelineChart.clear();
+               }
+
+               chartList.clear();
+               selectedChartList.clear();
+               loadSavedChartList();
+               loadSelectedChartList();
+               customChartMap.clear();
+               customLogParser.clear();
+
+               allocByteMap.clear();
+               allocationSeriesDataSetMap.clear();
+       }
+
+       private void makeSystemDataTableData(Logs systemLogs, Logs memoryLogs) {
+               int coreSize = AnalyzerManager.getProject().getDeviceStatusInfo()
+                               .getCpuCount();
+
+               List<LogData> memoryLogList = memoryLogs == null ? null : memoryLogs
+                               .getRawLogs();
+               List<LogData> systemLogList = systemLogs == null ? null : systemLogs
+                               .getRawLogs();
+
+               if (memoryLogList != null) {
+                       int size = memoryLogList.size();
+                       for (int i = 0; i < size; i++) {
+                               MemoryData logData = (MemoryData) memoryLogList.get(i);
+                               if (allocByteMap.get(logData.getPid()) == null) {
+                                       allocByteMap.put(Integer.valueOf(logData.getPid()),
+                                                       new Long(0));
+                               }
+
+                               int memApiType = logData.getMemoryApiType();
+                               int internalFlag = logData.getInternalCall();
+                               long errorNo = logData.getErrno();
+
+                               if (errorNo == 0 && MEM_USER == internalFlag) {
+                                       if (MEM_API_TYPE_ALLOC == memApiType
+                                                       || MEM_API_TYPE_FREE == memApiType
+                                                       || MEM_API_TYPE_MANAGE == memApiType) {
+
+                                               addNewSeriesUserAllocData(memApiType, logData);
+                                       }
+                               }
+                       }
+               }
+
+               if (systemLogList != null) {
+                       ArrayList<List<Object>> systemDataList = new ArrayList<List<Object>>();
+                       ArrayList<List<Object>> cpuDataList = new ArrayList<List<Object>>();
+                       ArrayList<List<Object>> otherProcessDataList = new ArrayList<List<Object>>();
+                       ArrayList<List<Object>> energyDataList = new ArrayList<List<Object>>();
+                       ArrayList<List<Object>> targetProcessDataList = new ArrayList<List<Object>>();
+                       int size = systemLogList.size();
+                       for (int i = 0; i < size; i++) {
+                               SystemData log = (SystemData) systemLogList.get(i);
+
+                               /*
+                                * Make CPU Table data
+                                */
+                               String[] cpuLoads = log.getCpuLoad().split(
+                                               CommonConstants.COMMA);
+                               double cpuLoadSum = 0.0;
+
+                               // logic
+                               String[] cpuFrequencies = log.getCpuFrequency().split(
+                                               CommonConstants.COMMA);
+                               for (int ii = 0; ii < coreSize; ii++) {
+                                       double cpuLoad = Double.parseDouble(cpuLoads[ii]);
+                                       cpuLoadSum += cpuLoad;
+                                       double cpuFrequency = Double
+                                                       .parseDouble(cpuFrequencies[ii]);
+                                       ArrayList<Object> dbCPUData = new ArrayList<Object>();
+                                       dbCPUData.add(new Long(log.getTime()));
+                                       dbCPUData.add(new Integer(ii));
+                                       dbCPUData.add(new Float(cpuLoad));
+                                       dbCPUData.add(new Float(cpuFrequency));
+                                       cpuDataList.add(dbCPUData);
+                               }
+
+                               double systemAvgCPULoad = cpuLoadSum / coreSize;
+                               ArrayList<Object> dbSystemData = new ArrayList<Object>();
+                               dbSystemData.add(new Long(log.getTime()));
+                               dbSystemData.add(new Float(systemAvgCPULoad));
+                               dbSystemData.add(new Integer(log.getOtherProcessCount()));
+                               dbSystemData.add(new Integer(log.getTargetProcessCount()));
+                               dbSystemData.add(new Long(log.getSystemMemoryUsed()));
+                               dbSystemData.add(new Integer(log.getNetworkSendSize()));
+                               dbSystemData.add(new Integer(log.getNetworkReceiveSize()));
+                               dbSystemData.add(new Integer(log.getWifi()));
+                               dbSystemData.add(new Integer(log.getBtStatus()));
+                               dbSystemData.add(new Integer(log.getGpsStatus()));
+                               dbSystemData.add(new Integer(log.getBrightness()));
+                               dbSystemData.add(new Integer(log.getDnet()));
+                               dbSystemData.add(new Integer(log.getCamera()));
+                               dbSystemData.add(new Integer(log.getSound()));
+                               dbSystemData.add(new Integer(log.getAudio()));
+                               dbSystemData.add(new Integer(log.getVibration()));
+                               dbSystemData.add(new Integer(log.getVoltage()));
+                               dbSystemData.add(new Integer(log.getRssi()));
+                               dbSystemData.add(new Integer(log.getVideo()));
+                               dbSystemData.add(new Integer(log.getCall()));
+                               dbSystemData.add(new Integer(log.getTotalUsedDrive()));
+                               dbSystemData.add(new Integer(log.getDiskReadSize()));
+                               dbSystemData.add(new Integer(log.getDiskReadSectorCount()));
+                               dbSystemData.add(new Integer(log.getDiskWriteSize()));
+                               dbSystemData.add(new Integer(log.getDiskWrittenSectorCount()));
+                               dbSystemData.add(new Integer(log.getEnergyUsage()));
+                               systemDataList.add(dbSystemData);
+
+                               /*
+                                * Make other Process Table data
+                                */
+                               String[] processLoadDatas = log.getOtherProcessLoad().split(
+                                               CommonConstants.COMMA);
+                               for (int ii = 0; ii < processLoadDatas.length; ii++) {
+                                       String processLoad = processLoadDatas[ii];
+                                       if (processLoad == null || processLoad.isEmpty()) {
+                                               continue;
+                                       }
+                                       int pid = Integer.parseInt(processLoad);
+                                       double load = Double.parseDouble(processLoadDatas[++ii]);
+                                       ArrayList<Object> dbProcessData = new ArrayList<Object>();
+                                       dbProcessData.add(new Long(log.getTime()));
+                                       dbProcessData.add(new Integer(pid));
+                                       dbProcessData.add(new Float(load));
+                                       otherProcessDataList.add(dbProcessData);
+                               }
+
+                               /*
+                                * Make target Process Table data
+                                */
+                               ProcessProfileData[] targetProcessList = log
+                                               .getProcessProfileDataList();
+                               if (targetProcessList != null) {
+                                       for (int ii = 0; ii < targetProcessList.length; ii++) {
+                                               ProcessProfileData process = targetProcessList[ii];
+                                               ArrayList<Object> dbTargetProcessData = new ArrayList<Object>();
+                                               dbTargetProcessData.add(new Long(log.getTime()));
+                                               dbTargetProcessData.add(new Integer(process.getPid()));
+                                               dbTargetProcessData.add(new Float(process
+                                                               .getProcessLoad()));
+                                               dbTargetProcessData.add(new Long(process
+                                                               .getVirtualMemory()));
+                                               dbTargetProcessData.add(new Long(process
+                                                               .getResidentMemory()));
+                                               dbTargetProcessData.add(new Long(process
+                                                               .getSharedMemory()));
+                                               dbTargetProcessData
+                                                               .add(new Long(process.getPssMemory()));
+                                               dbTargetProcessData.add(new Long(process
+                                                               .getTotalAllocSize()));
+
+                                               if (allocByteMap.get(process.getPid()) == null) {
+                                                       dbTargetProcessData.add(new Long(0));
+                                               } else {
+                                                       dbTargetProcessData.add(allocByteMap.get(process
+                                                                       .getPid()));
+                                               }
+
+                                               targetProcessDataList.add(dbTargetProcessData);
+                                       }
+                               }
+
+                               /*
+                                * Make Energy Table data
+                                */
+                               String[] deviceEnergyUsages = log.getDeviceEnergyUsage().split(
+                                               CommonConstants.COMMA);
+                               String[] deviceEnergyUsagesPerApp = log
+                                               .getApplicationEnergyUsage().split(
+                                                               CommonConstants.COMMA);
+                               for (int ii = 0; ii < deviceEnergyUsages.length; ii++) {
+                                       double usage = Double.parseDouble(deviceEnergyUsages[ii]);
+                                       double usagePerApp = Double
+                                                       .parseDouble(deviceEnergyUsagesPerApp[ii]);
+                                       ArrayList<Object> dbEnergyData = new ArrayList<Object>();
+                                       dbEnergyData.add(new Long(log.getTime()));
+                                       dbEnergyData.add(new Integer(ii));
+                                       dbEnergyData.add(new Integer((int) usage)); // TODO change
+                                                                                                                               // float
+                                       dbEnergyData.add(new Integer((int) usagePerApp)); // TODO
+                                                                                                                                               // change
+                                                                                                                                               // float
+                                       energyDataList.add(dbEnergyData);
+                               }
+                       }
+                       SystemDataDBInserter.pushContextData(systemDataList);
+                       SystemDataDBInserter.startThread();
+                       CPUDBInserter.pushContextData(cpuDataList);
+                       CPUDBInserter.startThread();
+                       ProcessDataDBInserter.pushContextData(otherProcessDataList);
+                       ProcessDataDBInserter.startThread();
+                       EnergyDataDBInserter.pushContextData(energyDataList);
+                       EnergyDataDBInserter.startThread();
+                       TargetProcessDBInserter.pushContextData(targetProcessDataList);
+                       TargetProcessDBInserter.startThread();
+               }
+       }
+
+       private void makeUIEventDBTableData(Logs uiEventLogs) {
+               List<LogData> uiEventLogList = uiEventLogs == null ? null : uiEventLogs
+                               .getRawLogs();
+               if (uiEventLogList != null) {
+                       ArrayList<List<Object>> uiEventDataList = new ArrayList<List<Object>>();
+                       int size = uiEventLogList.size();
+                       for (int i = 0; i < size; i++) {
+                               UIEventData log = (UIEventData) uiEventLogList.get(i);
+                               ArrayList<Object> dbUIEventData = new ArrayList<Object>();
+
+                               dbUIEventData.add(new Long(log.getTime()));
+                               dbUIEventData.add(new Integer(log.getEventType()));
+                               dbUIEventData.add(new Integer(log.getDetailType()));
+                               dbUIEventData.add(new Integer(log.getX()));
+                               dbUIEventData.add(new Integer(log.getY()));
+                               dbUIEventData.add(log.getInfo1());
+                               dbUIEventData.add(new Integer(log.getInfo2()));
+
+                               uiEventDataList.add(dbUIEventData);
+                       }
+
+                       UIEventDBInserter.pushContextData(uiEventDataList);
+                       UIEventDBInserter.startThread();
+               }
+       }
+
+       private void makeScreenShotDBTableData(Logs screenShotLogs) {
+               List<LogData> screenShotLogList = screenShotLogs == null ? null
+                               : screenShotLogs.getRawLogs();
+               if (screenShotLogList != null) {
+                       ArrayList<List<Object>> screenShotDataList = new ArrayList<List<Object>>();
+                       int size = screenShotLogList.size();
+                       for (int i = 0; i < size; i++) {
+                               ScreenShotData log = (ScreenShotData) screenShotLogList.get(i);
+                               ArrayList<Object> dbScreenShotData = new ArrayList<Object>();
+                               String imagePathLog = null;
+                               if (DACommunicator.isTargetEmulator()
+                                               && SocketClient.getInstance().isConnected()) {
+                                       imagePathLog = GlobalInformation.getCurrentDeviceInfo().emulatorScreenshot
+                                                       .getFilePath();
+                               } else {
+                                       imagePathLog = log.getImageFilePath();
+                               }
+                               String[] splitedImagePathLog = imagePathLog
+                                               .split(File.separator); //$NON-NLS-1$
+                               String fileName = splitedImagePathLog[splitedImagePathLog.length - 1];
+
+                               dbScreenShotData.add(new Long(log.getTime()));
+                               dbScreenShotData.add(fileName);
+                               dbScreenShotData.add(new Integer(log.getOrientation()));
+
+                               screenShotDataList.add(dbScreenShotData);
+                       }
+
+                       ScreenShotDBInserter.pushContextData(screenShotDataList);
+                       ScreenShotDBInserter.startThread();
+               }
+       }
+
+       private void addNewSeriesUserAllocData(int fdApiType, MemoryData log) {
+               long size = 0;
+               Long allocByte = allocByteMap.get(log.getPid());
+
+               long address = log.getAddress();
+               if (address == 0) {
+                       return;
+               }
+
+               if (MEM_API_TYPE_ALLOC == fdApiType) {
+                       try {
+                               size = log.getSize();
+                               allocByteMap.put(log.getPid(), allocByte + size);
+                               allocationSeriesDataSetMap.put(address, size);
+                       } catch (NumberFormatException ne) {
+                               ne.printStackTrace();
+                       }
+               } else if (MEM_API_TYPE_FREE == fdApiType) {
+                       if (!allocationSeriesDataSetMap.containsKey(address)) {
+                               return;
+                       }
+                       size = allocationSeriesDataSetMap.get(address);
+                       allocByteMap.put(log.getPid(), allocByte - size);
+               }
+       }
+
+       public DBTable getSystemDataTable() {
+               return systemDataTable;
+       }
+
+       public DBTable getCPUTable() {
+               return cpuDBTable;
+       }
+
+       public DBTable getUIEventTable() {
+               return uiEventDBTable;
+       }
+
+       public DBTable getProcessTable() {
+               return processLoadDBTable;
+       }
+
+       public DBTable getEnergyTable() {
+               return energyDBTable;
+       }
+
+       public DBTable getScreenShotTable() {
+               return screenShotDBTable;
+       }
+
+       public DBTable getCustomDataTable() {
+               return customDataDBTable;
+       }
+
+       public DBTable getTargetProcessTable() {
+               return targetProcessDBTable;
+       }
+
+       public List<List<Object>> getSystemDataFromDB(long start, long end) {
+               String where = "where TIME BETWEEN " + start + " AND " + end
+                               + " ORDER BY " + SystemDataDBTable.TIME;
+               List<List<Object>> result = systemDataTable.selectData(null, where);
+
+               if (result != null) {
+                       return result;
+               } else {
+                       return new ArrayList<List<Object>>();
+               }
+       }
+
+       public List<List<Object>> getCPUDataFromDB(long start, long end) {
+               List<List<Object>> processedResult = new ArrayList<List<Object>>();
+               String where = "where TIME BETWEEN " + start + " AND " + end
+                               + " ORDER BY " + CPUDBTable.TIME;
+               List<List<Object>> queryResult = cpuDBTable.selectData(null, where);
+               if (queryResult == null) {
+                       return processedResult;
+               }
+
+               int cpuCount = AnalyzerManager.getProject().getDeviceStatusInfo()
+                               .getCpuCount();
+               for (int i = 0; i < cpuCount; i++) {
+                       List<Object> cpuLoads = new ArrayList<Object>();
+                       processedResult.add(cpuLoads);
+               }
+               for (int i = 0; i < queryResult.size(); i++) {
+                       List<Object> row = queryResult.get(i);
+                       int coreNum = (Integer) row.get(CPUDBTable.COLUMN.CORE_NUM
+                                       .ordinal());
+                       processedResult.get(coreNum).add(row);
+               }
+               return processedResult;
+       }
+
+       public Map<Integer, List<List<Object>>> getProcessDataFromDB(long start,
+                       long end) {
+               Map<Integer, List<List<Object>>> processedResult = new HashMap<Integer, List<List<Object>>>();
+
+               String where = "where TIME BETWEEN " + start + " AND " + end
+                               + " ORDER BY " + ProcessLoadDBTable.TIME;
+               List<List<Object>> queryResult = processLoadDBTable.selectData(null,
+                               where);
+               if (queryResult == null) {
+                       return processedResult;
+               }
+
+               for (int i = 0; i < queryResult.size(); i++) {
+                       List<Object> row = queryResult.get(i);
+                       Integer pid = (Integer) row.get(ProcessLoadDBTable.COLUMN.PID
+                                       .ordinal());
+                       List<List<Object>> processData = processedResult.get(pid);
+                       if (processData == null) {
+                               processData = new ArrayList<List<Object>>();
+                               processedResult.put(pid, processData);
+                       }
+                       processData.add(row);
+               }
+               return processedResult;
+       }
+
+       public List<List<Object>> getEnergyDataFromDB(long start, long end) {
+               List<List<Object>> processedResult = new ArrayList<List<Object>>();
+
+               String where = "where TIME BETWEEN " + start + " AND " + end
+                               + " ORDER BY " + EnergyDBTable.TIME;
+               List<List<Object>> queryResult = energyDBTable.selectData(null, where);
+               if (queryResult == null) {
+                       return processedResult;
+               }
+
+               int deviceCount = AnalyzerManager.getProject().getDeviceStatusInfo()
+                               .getDeviceCount();
+               for (int i = 0; i < deviceCount; i++) {
+                       List<Object> energyPerDevice = new ArrayList<Object>();
+                       processedResult.add(energyPerDevice);
+               }
+               for (int i = 0; i < queryResult.size(); i++) {
+                       List<Object> row = queryResult.get(i);
+                       int deviceNum = (Integer) row.get(EnergyDBTable.COLUMN.DEVICE_NUM
+                                       .ordinal());
+                       processedResult.get(deviceNum).add(row);
+               }
+               return processedResult;
+       }
+
+       public List<List<Object>> getUIEventDataFromDB(long start, long end) {
+               String where = "where TIME BETWEEN " + start + " AND " + end
+                               + " ORDER BY " + UIEventDBTable.TIME;
+               List<List<Object>> result = uiEventDBTable.selectData(null, where);
+
+               if (result != null) {
+                       return result;
+               } else {
+                       return new ArrayList<List<Object>>();
+               }
+       }
+
+       public List<List<Object>> getScreenShotDataFromDB(long start, long end) {
+               String where = "where TIME BETWEEN " + start + " AND " + end
+                               + " ORDER BY " + ScreenShotDBTable.TIME;
+               List<List<Object>> result = screenShotDBTable.selectData(null, where);
+
+               if (result != null) {
+                       return result;
+               } else {
+                       return new ArrayList<List<Object>>();
+               }
+       }
+
+       public List<List<Object>> getCustomDataFromDB(long start, long end) {
+               String where = "where TIME BETWEEN " + start + " AND " + end
+                               + " ORDER BY " + CustomDataDBTable.TIME;
+               List<List<Object>> result = customDataDBTable.selectData(null, where);
+
+               if (result != null) {
+                       return result;
+               } else {
+                       return new ArrayList<List<Object>>();
+               }
+       }
+
+       public Map<Integer, List<List<Object>>> getTargetProcessDataFromDB(
+                       long start, long end) {
+               Map<Integer, List<List<Object>>> processedResult = new HashMap<Integer, List<List<Object>>>();
+
+               String where = "where TIME BETWEEN " + start + " AND " + end
+                               + " ORDER BY " + TargetProcessDBTable.TIME;
+               List<List<Object>> queryResult = targetProcessDBTable.selectData(null,
+                               where);
+               if (queryResult == null) {
+                       return processedResult;
+               }
+
+               for (int i = 0; i < queryResult.size(); i++) {
+                       List<Object> row = queryResult.get(i);
+                       Integer pid = (Integer) row.get(TargetProcessDBTable.COLUMN.PID
+                                       .ordinal());
+                       List<List<Object>> processData = processedResult.get(pid);
+                       if (processData == null) {
+                               processData = new ArrayList<List<Object>>();
+                               processedResult.put(pid, processData);
+                       }
+                       processData.add(row);
+               }
+               return processedResult;
+       }
+
+       @Override
+       public void makeChartSeries(long startTime, long endTime) {
+               /*
+                * 1. Get DB data
+                */
+               List<List<Object>> systemDBData = getSystemDataFromDB(startTime,
+                               endTime);
+               List<List<Object>> cpuDBData = getCPUDataFromDB(startTime, endTime);
+               Map<Integer, List<List<Object>>> processDBData = getProcessDataFromDB(
+                               startTime, endTime);
+               List<List<Object>> energyDBData = getEnergyDataFromDB(startTime,
+                               endTime);
+               List<List<Object>> uiEventDBData = getUIEventDataFromDB(startTime,
+                               endTime);
+               List<List<Object>> screenShotDBData = getScreenShotDataFromDB(
+                               startTime, endTime);
+               List<List<Object>> customDBData = getCustomDataFromDB(startTime,
+                               endTime);
+               Map<Integer, List<List<Object>>> targetProcessDBData = getTargetProcessDataFromDB(
+                               startTime, endTime);
+
+               /*
+                * 2. Make series of chart
+                */
+               for (TimelineChart chart : chartList) {
+                       if (chart.getProbeType() == DataChannelConstants.MSG_DATA_SYSTEM) {
+                               List<Object> dataList = new ArrayList<Object>();
+                               dataList.add(systemDBData);
+                               dataList.add(cpuDBData);
+                               dataList.add(processDBData);
+                               dataList.add(energyDBData);
+                               dataList.add(targetProcessDBData);
+                               chart.inputChartSeries(dataList);
+                       } else if (chart.getProbeType() == DataChannelConstants.MSG_PROBE_UIEVENT) {
+                               List<Object> dataList = new ArrayList<Object>();
+                               dataList.add(uiEventDBData);
+                               chart.inputChartSeries(dataList);
+                       } else if (chart.getProbeType() == DataChannelConstants.MSG_PROBE_SCREENSHOT) {
+                               List<Object> dataList = new ArrayList<Object>();
+                               dataList.add(screenShotDBData);
+                               chart.inputChartSeries(dataList);
+                       }
+               }
+
+               /*
+                * 3. Make series of custom chart
+                */
+               customLogParser.inputChartSeries(customDBData);
+       }
 
        @Override
        protected void makeData(LogPackage pack) {
-        /*
-         * 1. Make SystemDataTable column
-         */
-        Logs systemLogs = pack.getLogs(DataChannelConstants.MSG_DATA_SYSTEM);
-        Logs memoryLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_MEMORY);
-        Logs uiEventLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_UIEVENT);
-        Logs screenShotLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_SCREENSHOT);
-        makeSystemDataTableData(systemLogs, memoryLogs);
-        makeUIEventDBTableData(uiEventLogs);
-        makeScreenShotDBTableData(screenShotLogs);
-
-
-        Logs customLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_CUSTOM);
-        if (customLogs != null && !customLogs.getRawLogs().isEmpty()) {
-            customLogParser.parseLogPackage(pack);
-          }
-        Logs lifecycleLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_LIFECYCLE);
-        if (lifecycleLogs != null && !lifecycleLogs.getRawLogs().isEmpty()) {
-            lifecycleLogParser.parseLogPackage(pack);
-        }
+               /*
+                * 1. Make SystemDataTable column
+                */
+               Logs systemLogs = pack.getLogs(DataChannelConstants.MSG_DATA_SYSTEM);
+               Logs memoryLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_MEMORY);
+               Logs uiEventLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_UIEVENT);
+               Logs screenShotLogs = pack
+                               .getLogs(DataChannelConstants.MSG_PROBE_SCREENSHOT);
+               makeSystemDataTableData(systemLogs, memoryLogs);
+               makeUIEventDBTableData(uiEventLogs);
+               makeScreenShotDBTableData(screenShotLogs);
+
+               Logs customLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_CUSTOM);
+               if (customLogs != null && !customLogs.getRawLogs().isEmpty()) {
+                       customLogParser.parseLogPackage(pack);
+               }
+               Logs lifecycleLogs = pack
+                               .getLogs(DataChannelConstants.MSG_PROBE_LIFECYCLE);
+               if (lifecycleLogs != null && !lifecycleLogs.getRawLogs().isEmpty()) {
+                       lifecycleLogParser.parseLogPackage(pack);
+               }
        }
 }
index d3a4ff6..52fb3ff 100755 (executable)
@@ -1015,9 +1015,11 @@ public class ToolbarArea {
                        @Override
                        public void run() {
                                String text = deviceCombo.getText();
-                               String device = GlobalInformation.getCurrentDeviceInfo()
-                                               .getIDevice().getSerialNumber();
-                               if (!device.equals(text)) {
+                               String device = null;
+                               DeviceInfo curDev = GlobalInformation.getCurrentDeviceInfo();
+                               if (curDev != null)
+                                       device = curDev.getIDevice().getSerialNumber();
+                               if (device == null || !device.equals(text)) {
                                        // startButton.setButtonEnabled(false);
                                        setStartButtonState(false);
                                        appCombo.setEnabled(false);
index 2d1f190..63c76d8 100644 (file)
@@ -128,7 +128,7 @@ public class OpenTraceProgressManager implements Runnable {
 
        public void openTraceComplete() {
                if (null != dialog) {
-                       waitingThreads();
+//                     waitingThreads();
                        Display.getDefault().syncExec(new Runnable() {
                                @Override
                                public void run() {