[Title] Profiling save bug fix
authorjy.exe.lee <jy.exe.lee@samsung.com>
Fri, 6 Jul 2012 11:35:42 +0000 (20:35 +0900)
committerjy.exe.lee <jy.exe.lee@samsung.com>
Fri, 6 Jul 2012 11:35:42 +0000 (20:35 +0900)
[Type] bug fix
[Module] DynamicAnalyzer
[Priority] major
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/DAWidgetConstants.java [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/combo/DACustomCombo.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/DACommunicator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/tableInfo/DBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/CoolbarArea.java

diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/DAWidgetConstants.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/DAWidgetConstants.java
new file mode 100644 (file)
index 0000000..b7ea94e
--- /dev/null
@@ -0,0 +1,5 @@
+package org.tizen.dynamicanalyzer.widgets;
+
+public class DAWidgetConstants {
+       public static final String EMPTY_STRING = "";
+}
index d4f95b1..708192c 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.widgets.DAWidgetConstants;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
 
@@ -39,6 +40,7 @@ public class DACustomCombo extends Canvas {
        private DACustomButton upArrowButton = null;
        private DACustomButton downArrowButton = null;
        private int itemIndex = 0;
+       private boolean dirty = false;
 
        private List<String> items;
        private List<Rectangle> rects = null;
@@ -61,6 +63,7 @@ public class DACustomCombo extends Canvas {
                addPaintListener(comboPaintListener);
                setForeground(ColorResources.WHITE);
                addListeners();
+               initCombo();
        }
 
        public void addListeners() {
@@ -524,12 +527,17 @@ public class DACustomCombo extends Canvas {
                popupRenderer = newRenderer;
        }
 
-       public void removeAll() {
-               getItems().clear();
-       }
+//     public void removeAll() {
+//             getItems().clear();
+//     }
 
        public void add(String item) {
-               getItems().add(item);
+               if (dirty) {
+                       getItems().add(item);
+               } else {
+                       getItems().set(0, item);
+                       dirty = true;
+               }
        }
 
        public void select(int index) {
@@ -588,4 +596,15 @@ public class DACustomCombo extends Canvas {
                }
        };
 
+       public boolean isDirty() {
+               return dirty;
+       }
+
+       public void initCombo() {
+               getItems().clear();
+               itemIndex = 0;
+               selection = 0;
+               items.add(DAWidgetConstants.EMPTY_STRING);
+               dirty = false;
+       }
 }
index 7830020..e96ddf1 100644 (file)
@@ -190,6 +190,10 @@ public class DACommunicator {
                        // for (String line : lines) {
                        int size = lines.length;
                        for (int i = 0; i < size;) {
+                               if (i % 2 == 0 && i + 1 >= size) {
+                                       System.out.println(" bug catch!!  " + i);
+                                       break;
+                               }
                                AppDesktopInfo desktopInfo = new AppDesktopInfo();
                                String desktopName = AnalyzerLabels.EMPTY_STRING;
                                for (int ii = 0; ii < 2; ii++) {
@@ -204,11 +208,14 @@ public class DACommunicator {
                                                desktopInfo.setExecPath(new String(splitName[1]));
                                        }
                                }
-                               desktopInfo.setDesktopName(new String(desktopName));
-                               appDesktopList.add(desktopInfo);
-                               if (i == size) {
-                                       break;
+                               if (null != desktopInfo.getExecPath()
+                                               && !desktopInfo.getExecPath().isEmpty()) {
+                                       desktopInfo.setDesktopName(new String(desktopName));
+                                       appDesktopList.add(desktopInfo);
                                }
+                               // if (i == size) {
+                               // break;
+                               // }
                        }
                }
        };
index e425edf..9072124 100644 (file)
@@ -168,7 +168,7 @@ public class OpenTraceHandler extends AbstractHandler {
        }\r
 \r
        private void loadCallStackApis(Project p) {\r
-               ResultSet rs = SqlManager.selectAllFromTable("CallStackAPIs"); //$NON-NLS-1$\r
+               ResultSet rs = SqlManager.selectAllFromTable("CallStackUnits"); //$NON-NLS-1$\r
                if (null == rs) {\r
                        return;\r
                }\r
index cc08772..2a8a639 100644 (file)
@@ -114,10 +114,10 @@ public class DBTableManager {
                // "profiling data" table info block
                {
                        String[] names = { "seq", "name", "exCount", "inCount",
-                                       "callCount", "parent", "key", "exeTime" };
-                       String[] options = { "not null", "", "", "", "", "", "", "" };
+                                       "callCount", "parent", "key", "inclExeTime", "exclExeTime" };
+                       String[] options = { "not null", "", "", "", "", "", "", "", "" };
                        String[] types = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT",
-                                       "TEXT", "TEXT" };
+                                       "TEXT", "TEXT", "TEXT" };
                        DBTableInfo profilingDataTableInfo = new DBTableInfo(
                                        TABLE_NAME_PROFILING_DATA, names, options, types);
                        tableInfos.set(TABLE_INDEX_PROFILING_DATA, profilingDataTableInfo);
index f91f1b1..db6edfd 100755 (executable)
@@ -1425,7 +1425,8 @@ public class CoolbarArea {
                        return;
                }
 
-               appCombo.removeAll();
+//             appCombo.removeAll();
+               appCombo.initCombo();
                int size = apps.size();
                for (int i = 0; i < size; i++) {
                        appCombo.add(apps.get(i).getName());
@@ -1441,9 +1442,11 @@ public class CoolbarArea {
        }
 
        public void initToolbarEnablement() {
-               deviceCombo.removeAll();
-               deviceCombo.add(AnalyzerConstants.EMPTY);
-               appCombo.removeAll();
+//             deviceCombo.removeAll();
+//             deviceCombo.add(AnalyzerConstants.EMPTY);
+               deviceCombo.initCombo();
+//             appCombo.removeAll();
+               appCombo.initCombo();
                startButton.setEnabled(false);
                replayButton.setEnabled(false);
                saveTraceButton.setEnabled(false);
@@ -1470,13 +1473,15 @@ public class CoolbarArea {
        }
 
        public void setDeviceComboItems(List<String> items) {
-               deviceCombo.removeAll();
+//             deviceCombo.removeAll();
+               deviceCombo.initCombo();
                if (items.isEmpty()) {
                        deviceCombo.add(AnalyzerConstants.EMPTY);
                        deviceCombo.select(0);
-                       appCombo.removeAll();
-                       appCombo.add(AnalyzerConstants.EMPTY);
-                       appCombo.select(0);
+//                     appCombo.removeAll();
+//                     appCombo.add(AnalyzerConstants.EMPTY);
+//                     appCombo.select(0);
+                       appCombo.initCombo();
                        appCombo.setEnabled(false);
                        setRepalyButtonEnable(false);
                        return;
@@ -1500,17 +1505,19 @@ public class CoolbarArea {
        }
 
        public void setAppComboItems(List<String> items) {
-               appCombo.removeAll();
+//             appCombo.removeAll();
+               appCombo.initCombo();
 
                if (null == items) {
-                       appCombo.add(AnalyzerConstants.EMPTY);
-                       appCombo.select(0);
+//                     appCombo.add(AnalyzerConstants.EMPTY);
+//                     appCombo.select(0);
                        return;
                }
 
                int itemsSize = items.size();
                if (0 != itemsSize) {
-                       appCombo.removeAll();
+//                     appCombo.removeAll();
+                       appCombo.initCombo();
                        for (int i = 0; i < itemsSize; i++) {
                                appCombo.add(items.get(i));
                        }