[Title]thread probe add & thread page basic update
authoryeongtaik.byeon <yeongtaik.byeon@samsung.com>
Fri, 6 Jul 2012 11:54:00 +0000 (20:54 +0900)
committeryeongtaik.byeon <yeongtaik.byeon@samsung.com>
Fri, 6 Jul 2012 11:54:00 +0000 (20:54 +0900)
[Type]
[Module]da_probe_osp.so, thread page
[Priority]high
[CQ#]
[Redmine#]5793,5322
[Problem]
[Cause]
[Solution]
[TestCase]

org.tizen.dynamicanalyzer.workbench/DynamicAnalyzer/target/x86/da_probe_osp.so
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ThreadPageLables.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ThreadPageLables.properties [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/ThreadPage/ThreadChartView.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/ThreadPage/ThreadPage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/pageInfo/PageDataManager.java [new file with mode: 0644]

index 97ed1c7..64463bd 100644 (file)
Binary files a/org.tizen.dynamicanalyzer.workbench/DynamicAnalyzer/target/x86/da_probe_osp.so and b/org.tizen.dynamicanalyzer.workbench/DynamicAnalyzer/target/x86/da_probe_osp.so differ
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ThreadPageLables.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ThreadPageLables.java
new file mode 100644 (file)
index 0000000..7324289
--- /dev/null
@@ -0,0 +1,17 @@
+package org.tizen.dynamicanalyzer.nl;
+
+import org.eclipse.osgi.util.NLS;
+
+public class ThreadPageLables extends NLS {
+       private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.ThreadPageLables"; //$NON-NLS-1$
+       public static String THREAD_CHART_THREAD;
+       public static String THREAD_CHART_TITLE;
+       
+       static {
+               // initialize resource bundle
+               NLS.initializeMessages(BUNDLE_NAME, ThreadPageLables.class);
+       }
+
+       private ThreadPageLables() {
+       }
+}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ThreadPageLables.properties b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ThreadPageLables.properties
new file mode 100644 (file)
index 0000000..bf296ff
--- /dev/null
@@ -0,0 +1,2 @@
+THREAD_CHART_THREAD=Thread
+THREAD_CHART_TITLE=Thread Chart
\ No newline at end of file
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/ThreadPage/ThreadChartView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/ThreadPage/ThreadChartView.java
new file mode 100644 (file)
index 0000000..8d45559
--- /dev/null
@@ -0,0 +1,45 @@
+package org.tizen.dynamicanalyzer.ui.views.ThreadPage;
+
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.ColorResources;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.model.LogPackage;
+import org.tizen.dynamicanalyzer.nl.ThreadPageLables;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+
+public class ThreadChartView extends DAView {
+       public static final String ID = ThreadChartView.class.getName();
+
+       public ThreadChartView(Composite parent, int style) {
+               super(parent, style);
+               // TODO Auto-generated constructor stub
+               ViewContainer viewContainer = new ViewContainer(this, false);
+               viewContainer.setTitleText(ThreadPageLables.THREAD_CHART_TITLE);
+
+               Composite contents = viewContainer.getContentArea();
+               contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+               contents.setLayout(new FillLayout());
+       }
+
+       @Override
+       public void updateView() {
+       }
+
+       @Override
+       public void updateLog(LogPackage logPack) {
+               System.out.println("updateLog:"+ logPack);
+       }
+
+       @Override
+       public void clear() {
+
+       }
+
+       @Override
+       public Control getControl() {
+               return null;
+       }
+
+}
index 81096b8..81b52e6 100644 (file)
@@ -34,14 +34,14 @@ public class ThreadPage extends DAPageComposite {
        public ThreadPage(Composite parent, int style) {
                super(parent, style);
                this.setLayout(new FillLayout());
-/*
                baseForm = new SashForm(this, SWT.HORIZONTAL);
                baseForm.setLayout(new FillLayout());
 
                leftForm = new SashForm(baseForm, SWT.VERTICAL);
                // FILECHART_INDEX = 0;
-               FileChartView fileChartView = new FileChartView(leftForm, SWT.NONE);
-               addView(fileChartView);
+               ThreadChartView threadChartView = new ThreadChartView(leftForm, SWT.NONE);
+               addView(threadChartView);
+               /*
 
                // FILE_API_LIST_INDEX = 1;
                FileApiListView fileApiListView = new FileApiListView(leftForm,
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/pageInfo/PageDataManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/pageInfo/PageDataManager.java
new file mode 100644 (file)
index 0000000..b40fe32
--- /dev/null
@@ -0,0 +1,69 @@
+package org.tizen.dynamicanalyzer.ui.views.pageInfo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.tizen.dynamicanalyzer.model.FailedData;
+import org.tizen.dynamicanalyzer.model.FileChartItemData;
+import org.tizen.dynamicanalyzer.model.LogPackage;
+import org.tizen.dynamicanalyzer.model.WarningData;
+import org.tizen.dynamicanalyzer.ui.views.filePage.fileChart.FileChartManager;
+
+public abstract class PageDataManager<E> {
+       private List<E> row = null;
+       private List<String> column = null;
+//     private List<WarningData> warning = null;
+       private List<FailedData> failed = null;
+
+       private void AddErrorData(FailedData data){
+               if(null == failed)
+                       failed = new ArrayList<FailedData>();
+               failed.add(data);
+       }
+       
+//     private void AddWarningData(WarningData data){
+//             if(null == warning)
+//                     warning = new ArrayList<WarningData>();
+//             warning.add(data);
+//     }
+       
+       private void AddPageData(E data){
+               if(null == row)
+                       row = new ArrayList<E>();
+               row.add((E)data);
+       }
+       
+       public void SetColumn(List<String> column){
+               this.column = column;
+       }
+
+       public void ParsePageData(LogPackage logPack){
+               List<List<String>> inputs = GetLogsFromLogPackage(logPack);
+               int size;
+               if(null == inputs || 0 == (size = inputs.size())){
+                       return;
+               }
+               
+               for(int i = 0; i < size; i++){
+                       List<String> input = inputs.get(i);
+                       
+                       //error check
+                       if(true == ErrorCheck(input)){
+                               FailedData ffd = new FailedData(input);
+                               AddErrorData(ffd);
+                               continue;
+                       }
+                       
+                       //add page data
+                       E data = GetPageData(input);
+                       if(null != data)
+                               AddPageData(data);
+               }       
+       }
+       
+       public abstract List<List<String>> GetLogsFromLogPackage(LogPackage logPack);
+       public abstract E GetPageData(List<String> input);
+       public abstract boolean ErrorCheck(List<String> input);
+//     public abstract boolean WarningCheck(List<String> input);
+}