public static final String SEND_MESSAGE_THREAD = "Send message thread"; //$NON-NLS-1$\r
public static final String START_STOP_THREAD = "Start stop thread"; //$NON-NLS-1$\r
public static final String FILE_CHART_MANAGER_THREAD = "File Chart Manager thread"; //$NON-NLS-1$\r
+ public static final String USER_INTERFACE_PAGE_MANAGER_THREAD = "User Interface Page Manager thread"; //$NON-NLS-1$\r
\r
/* log parsing token and callstack parsing token, etc... */\r
public static final String CALLSTACK_START = "callstack_start"; //$NON-NLS-1$\r
import org.tizen.dynamicanalyzer.ui.toolbar.OpenTraceInputReader;
import org.tizen.dynamicanalyzer.ui.toolbar.StopLogProcessor;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
import org.tizen.dynamicanalyzer.utils.UpdateViewTimer;
public class ExitHandler extends AbstractHandler {
LogParser.stopLogParser();
StopLogProcessor.stopStopLogProcessThread();
IDECommunicator.stopIDEcommunicatorThread();
+ UIDataManager.getInstance().stopUpdateLogThread();
if (DACommunicator.isDaemonAlive()) {
DACommunicator.killDaemon();
USERINTERFACE_CONTROL_LIST_VIEW_NAME = Controls
USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_0 = Control
USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_1 = Class Name
-USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_2 = Init. Time
-USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_3 = Term. Time
+USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_2 = Initializing Time
+USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_3 = Terminating Time
USERINTERFACE_SCENETRANSFORM_LIST_VIEW_NAME = Scene Transforms
USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_0 = Scene Name
import org.tizen.dynamicanalyzer.ui.summary.SummaryPage;
import org.tizen.dynamicanalyzer.ui.thread.ThreadPage;
import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
-import org.tizen.dynamicanalyzer.ui.userinterface.UserInterfacePage;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIPage;
import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
public class BaseView extends ViewPart {
tabView.getContentComposite(), SWT.NONE);
tabView.addView(threadPage);
- UserInterfacePage uiPage = new UserInterfacePage(
+ UIPage uiPage = new UIPage(
tabView.getContentComposite(), SWT.NONE);
tabView.addView(uiPage);
}
import org.tizen.dynamicanalyzer.ui.file.FilePage;
import org.tizen.dynamicanalyzer.ui.summary.SummaryPage;
import org.tizen.dynamicanalyzer.ui.thread.ThreadPage;
-import org.tizen.dynamicanalyzer.ui.userinterface.UserInterfacePage;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIPage;
import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
SWT.NONE);
comps.add(threadComp);
- DAPageComposite userInterfaceComp = new UserInterfacePage(containerComposite,
+ DAPageComposite userInterfaceComp = new UIPage(containerComposite,
SWT.NONE);
comps.add(userInterfaceComp);
import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
import org.tizen.dynamicanalyzer.ui.thread.ThreadPage;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
-import org.tizen.dynamicanalyzer.ui.userinterface.UserInterfacePage;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIPage;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
} else if (id == LogCenterConstants.LOG_THREAD) {
pageId = ThreadPage.ID;
} else if (id == LogCenterConstants.LOG_CONTROL) {
- pageId = UserInterfacePage.ID;
+ pageId = UIPage.ID;
} else {
return;
}
import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
import org.tizen.dynamicanalyzer.ui.thread.ThreadPage;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
-import org.tizen.dynamicanalyzer.ui.userinterface.UserInterfacePage;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIPage;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
} else if (id == LogCenterConstants.LOG_THREAD) {
pageId = ThreadPage.ID;
} else if (id == LogCenterConstants.LOG_CONTROL) {
- pageId = UserInterfacePage.ID;
+ pageId = UIPage.ID;
} else {
return;
}
import org.tizen.dynamicanalyzer.nl.SummaryLabels;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
-import org.tizen.dynamicanalyzer.ui.userinterface.UserInterfacePageDataManager;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
import org.tizen.dynamicanalyzer.utils.Formatter;
public class FunctionUsageProfiler {
}
child.addExclusiveElapsedTime(current.getInclusiveExeTime());
current = current.getParent();
- UserInterfacePageDataManager.getInstance().getfunctionProfilingDataChecker().addPfofilingData( child );
+ UIDataManager.getInstance().getfunctionProfilingDataChecker().addPfofilingData( child );
}
} else {
if (null == current) {
import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
import org.tizen.dynamicanalyzer.ui.thread.ThreadPage;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
-import org.tizen.dynamicanalyzer.ui.userinterface.UserInterfacePage;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIPage;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
} else if (id == LogCenterConstants.LOG_THREAD) {
pageId = ThreadPage.ID;
} else if (id == LogCenterConstants.LOG_CONTROL) {
- pageId = UserInterfacePage.ID;
+ pageId = UIPage.ID;
} else {
return;
}
import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
import org.tizen.dynamicanalyzer.ui.file.chart.FileChartManager;
import org.tizen.dynamicanalyzer.ui.info.range.StateManager;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.utils.UpdateViewTimer;
ToolbarArea.getInstance().startTimer();
LogParser.startLogParser();
FileChartManager.getInstance().startUpdateLogThread();
+ UIDataManager.getInstance().startUpdateLogThread();
+
/* Timeline */
UpdateViewTimer.start();
});
AnalyzerUtil.executeCommand(StopHandler.ID);
+ UIDataManager.getInstance().stopUpdateLogThread();
}
}
--- /dev/null
+package org.tizen.dynamicanalyzer.ui.userinterface;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogListQueue;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.ui.userinterface.control.UIControlListDataChecker;
+import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UIFunctionProfilingDataChecker;
+import org.tizen.dynamicanalyzer.ui.userinterface.scene.UISceneTransformDataChecker;
+
+
+public class UIDataManager implements Runnable {
+
+ private static UIDataManager instance = null;
+
+ private static UIControlListDataChecker controlListDataChecker = null;
+ private static UISceneTransformDataChecker sceneTransformDataChecker = null;
+ private static UIFunctionProfilingDataChecker functionProfilingDataChecker = null;
+
+
+ private Thread updateLogThread = null;
+ private LogListQueue logControlListQueue = null;
+ private LogListQueue logSceneTransformListQueue = null;
+
+ int testcode = 0;
+
+ public static UIDataManager getInstance() {
+ if (null == instance) {
+ instance = new UIDataManager();
+ }
+ return instance;
+ }
+
+ private UIDataManager() {
+ }
+
+
+ public void startUpdateLogThread( ) {
+ if (null == updateLogThread || !updateLogThread.isAlive()) {
+ updateLogThread = new Thread(null, new UIDataManager(), AnalyzerConstants.USER_INTERFACE_PAGE_MANAGER_THREAD);
+ updateLogThread.start();
+ }
+ }
+
+ public void stopUpdateLogThread() {
+ if (null != updateLogThread && updateLogThread.isAlive()) {
+ updateLogThread.interrupt();
+ }
+ updateLogThread = null;
+ logControlListQueue = null;
+ logSceneTransformListQueue = null;
+ }
+
+ @Override
+ public void run() {
+ LogListQueue controllogListQueue = getInstance().getControlLogListQueue();
+ LogListQueue sceneTransformlogListQueue = getInstance().getSceneTransformLogListQueue();
+ while (true) {
+
+ try {
+ boolean isSleep = true;
+ if (!controllogListQueue.isEmpty()) {
+ List<List<String>> inputs = controllogListQueue.getFirst();
+ int size = inputs.size();
+ for (int i = 0; i < size; i++) {
+ getControlDataChecker().parserLog( inputs.get(i) );
+ }
+ isSleep = false;
+ }
+
+ if (!sceneTransformlogListQueue.isEmpty()) {
+ List<List<String>> inputs = sceneTransformlogListQueue.getFirst();
+ int size = inputs.size();
+ for (int i = 0; i < size; i++) {
+ getSceneTransformDataChecker().parserLog( inputs.get(i) );
+ }
+ isSleep = false;
+ }
+
+ if( isSleep == true ) {
+ Thread.sleep(AnalyzerConstants.LOG_CHECK_INTERVAL);
+ }
+ } catch (InterruptedException e) {
+ /** thread stop by interrupt */
+ break;
+ }
+ }
+
+ /* log for debug */
+ System.out.println("UI manager thread end!!"); //$NON-NLS-1$
+
+ }
+
+ public LogListQueue getControlLogListQueue() {
+ if (null == logControlListQueue) {
+ logControlListQueue = new LogListQueue();
+ }
+ return logControlListQueue;
+ }
+
+ public LogListQueue getSceneTransformLogListQueue() {
+ if (null == logSceneTransformListQueue) {
+ logSceneTransformListQueue = new LogListQueue();
+ }
+ return logSceneTransformListQueue;
+ }
+
+ public void parsePageData(LogPackage logPack) {
+
+ setSceneTransformDataTFromLogPackage( logPack );
+ setControlDataTFromLogPackage( logPack );
+
+
+ // TEST LOG
+ //////////////////////////////////////////////////
+ if (testcode == 0) {
+ testcode++;
+ String[] testLogs = {
+ "8,3601,DABadaAppForm::OnInitializing,1076601,5478,5478,0, 1, 0,17,0,0,DABadaAppForm, DABadaAppForm, 4545, -, -, 12"
+ ,"8,3602,TestThreadForm::OnInitializing,1036602,5479,5479,0, 1, 0,17,0,0,TestThreadForm, TestThreadForm, 4546,-, -, 13"
+ ,"8,3603,TestFilePanel::OnInitializing,1033602,5480,5480,0, 1, 0,17,0,0,TestFilePanel, -, -,TestFilePanel, 4815, 13"
+ ,"8,3604,TestTimePanel::OnInitializing,1003602,5481,5481,0, 1, 0,17,0,0,TestTimePanel, -, -,TestTimePanel, 4344, 13"
+ };
+
+ int size = testLogs.length;
+ for (int i = 0; i < size; i++) {
+ String[] input = testLogs[i].split(",");
+ List<String> dddd = new ArrayList<String>();
+ for (int j = 0; j < input.length; j++) {
+ dddd.add(input[j]);
+ }
+ getSceneTransformDataChecker().parserLog(dddd);
+ }
+ }
+
+
+ if (testcode == 1) {
+ testcode++;
+ String[] testLogs = {
+ "2,344,DABadaAppFrame::OnInitializing,1066601,5278,5278,0, 1, 0,17,0,0, Form, 789, , , , , "
+ ,"2,345,DABadaAppForm::OnInitializing,1076601,5278,5278,0, 1, 0,17,0,0, Panel,790, ,789, , , "
+ ,"2,346,TestDictoryForm::OnInitializing,1126601,5278,5278,0, 1, 0,17,0,0, Panel,791, ,789, , , "
+ ,"2,347,TestTimeForm::OnInitializing,3196601,5279,5279,0, 1, 0,17,0,0,Panel,792, ,791, , , "
+ ,"2,348,TestSocketForm::OnInitializing,3436601,5279,5279,0, 1, 0,17,0,0, Form, 793, ,792, , , "
+ ,"2,349,TestFileForm::OnInitializing,3436601,5279,5279,0, 1, 0,17,0,0, Form, 794, ,791, , , "
+ ,"2,350,TestMallocForm::OnInitializing,3436601,5279,5279,0, 1, 0,17,0,0, Form, 795, ,, , , "
+ ,"2,351,TestThreadForm::OnInitializing,3436601,5279,5279,0, 1, 0,17,0,0, Panel, 796, ,,795 , , "
+ };
+
+ int size = testLogs.length;
+ for (int i = 0; i < size; i++) {
+ String[] input = testLogs[i].split(",");
+ List<String> dddd = new ArrayList<String>();
+ for (int j = 0; j < input.length; j++) {
+ dddd.add(input[j]);
+ }
+ getControlDataChecker().parserLog(dddd);
+ }
+ }
+ // TEST LOG
+ //////////////////////////////////////////////////
+ }
+
+ public void setControlDataTFromLogPackage(LogPackage logPack) {
+
+ Logs logs = logPack.getLogs(LogCenterConstants.LOG_CONTROL);
+ if (null == logs || logs.getLogs().size() == 0) {
+ return;
+ }
+ List<List<String>> inputs = logs.getLogs();
+ getControlLogListQueue().putLog(inputs);
+ }
+
+ public void setSceneTransformDataTFromLogPackage(LogPackage logPack) {
+ Logs logs = logPack.getLogs(LogCenterConstants.LOG_SCENE);
+ if (null == logs || logs.getLogs().size() == 0) {
+ return ;
+ }
+ List<List<String>> inputs = logs.getLogs();
+ getSceneTransformLogListQueue().putLog(inputs);
+ }
+
+ public void clear() {
+ controlListDataChecker = null;
+ sceneTransformDataChecker = null;
+ functionProfilingDataChecker = null;
+ }
+
+ public UIControlListDataChecker getControlDataChecker() {
+ if (null == controlListDataChecker) {
+ controlListDataChecker = new UIControlListDataChecker();
+ }
+ return controlListDataChecker;
+ }
+
+ public UISceneTransformDataChecker getSceneTransformDataChecker() {
+ if (null == sceneTransformDataChecker) {
+ sceneTransformDataChecker = new UISceneTransformDataChecker();
+ }
+ return sceneTransformDataChecker;
+ }
+
+ public UIFunctionProfilingDataChecker getfunctionProfilingDataChecker() {
+ if (null == functionProfilingDataChecker) {
+ functionProfilingDataChecker = new UIFunctionProfilingDataChecker();
+ }
+ return functionProfilingDataChecker;
+ }
+}
\ No newline at end of file
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
-import org.tizen.dynamicanalyzer.ui.userinterface.control.UserInterfaceControlListView;
-import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UserInterfaceFunctionProfilingView;
-import org.tizen.dynamicanalyzer.ui.userinterface.scene.UserInterfaceSceneTransformListView;
+import org.tizen.dynamicanalyzer.ui.userinterface.control.UIControlListView;
+import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UIFunctionProfilingView;
+import org.tizen.dynamicanalyzer.ui.userinterface.scene.UITransformListView;
import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
-public class UserInterfacePage extends DAPageComposite {
+public class UIPage extends DAPageComposite {
SashForm baseForm;
SashForm upperForm;
SashForm bottomForm;
- public static final String ID = UserInterfacePage.class.getName();
+ public static final String ID = UIPage.class.getName();
public static final String TAB_ID = ID + CommonConstants.UNDERBAR + "tab";
- UserInterfacePageDataManager tManager = UserInterfacePageDataManager.getInstance();
+ UIDataManager tManager = UIDataManager.getInstance();
- public UserInterfacePage(Composite parent, int style) {
+ public UIPage(Composite parent, int style) {
super(parent, style);
name = AnalyzerLabels.COOLBAR_AREA_UI;
this.setLayout(new FillLayout());
upperForm = new SashForm(baseForm, SWT.HORIZONTAL);
- UserInterfaceControlListView topLeftFirst = new UserInterfaceControlListView(upperForm,SWT.NONE);
+ UIControlListView topLeftFirst = new UIControlListView(upperForm,SWT.NONE);
addView(topLeftFirst);
- UserInterfaceSceneTransformListView topLeftSencond = new UserInterfaceSceneTransformListView(upperForm,SWT.NONE);
+ UITransformListView topLeftSencond = new UITransformListView(upperForm,SWT.NONE);
addView(topLeftSencond);
upperForm.setWeights(new int[] { 37, 40, 23 });
bottomForm = new SashForm(baseForm, SWT.HORIZONTAL);
- UserInterfaceFunctionProfilingView bottomLeftFirst = new UserInterfaceFunctionProfilingView(bottomForm, SWT.NONE);
+ UIFunctionProfilingView bottomLeftFirst = new UIFunctionProfilingView(bottomForm, SWT.NONE);
addView(bottomLeftFirst);
bottomForm.setWeights(new int[] { 100 });
+++ /dev/null
-package org.tizen.dynamicanalyzer.ui.userinterface;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
-import org.tizen.dynamicanalyzer.logparser.LogPackage;
-import org.tizen.dynamicanalyzer.logparser.Logs;
-import org.tizen.dynamicanalyzer.ui.userinterface.control.UserInterfaceControlListDataChecker;
-import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UserInterfaceFunctionProfilingDataChecker;
-import org.tizen.dynamicanalyzer.ui.userinterface.scene.SceneTransformDataChecker;
-
-
-public class UserInterfacePageDataManager {
-
- private static UserInterfacePageDataManager instance = null;
-
- private static UserInterfaceControlListDataChecker controlListDataChecker = null;
- private static SceneTransformDataChecker sceneTransformDataChecker = null;
- private static UserInterfaceFunctionProfilingDataChecker functionProfilingDataChecker = null;
-
-
- private LogPackage logPack = null;
-
- int testcode = 0;
-
- public class UserInterfaceLogPaserThread implements Runnable {
- public void run() {
- setControlDataTFromLogPackage(logPack);
- setSceneTransformDataTFromLogPackage(logPack);
- logPack = null;
- }
- }
-
-
- public static UserInterfacePageDataManager getInstance() {
- if (null == instance) {
- instance = new UserInterfacePageDataManager();
- }
- return instance;
- }
-
- private UserInterfacePageDataManager() {
- }
-
-
- public void parsePageData(LogPackage logPack) {
-// UserInterfaceLogPaserThread parserThread = new UserInterfaceLogPaserThread();
-// new Thread( parserThread ).start();
-// this.logPack = logPack;
-
- setControlDataTFromLogPackage(logPack);
- setSceneTransformDataTFromLogPackage(logPack);
-
-
- if (testcode == 0) {
- testcode++;
- String[] testLogs = {
- "8,3601,DABadaAppForm::OnInitializing,1076601,5478,5478,0, 1, 0,17,0,0,DABadaAppForm, DABadaAppForm, 4545, -, -, 12"
- ,"8,3602,TestThreadForm::OnInitializing,1036602,5479,5479,0, 1, 0,17,0,0,TestThreadForm, TestThreadForm, 4546,-, -, 13"
- ,"8,3603,TestFilePanel::OnInitializing,1033602,5480,5480,0, 1, 0,17,0,0,TestFilePanel, -, -,TestFilePanel, 4815, 13"
- ,"8,3604,TestTimePanel::OnInitializing,1003602,5481,5481,0, 1, 0,17,0,0,TestTimePanel, -, -,TestTimePanel, 4344, 13"
- };
-
- int size = testLogs.length;
- for (int i = 0; i < size; i++) {
- String[] input = testLogs[i].split(",");
- List<String> dddd = new ArrayList<String>();
- for (int j = 0; j < input.length; j++) {
- dddd.add(input[j]);
- }
- getSceneTransformDataChecker().parserLog(dddd);
- }
- }
-
-
- if (testcode == 1) {
- testcode++;
- String[] testLogs = {
- "3,344,DABadaAppForm::OnInitializing,1066601,5278,5278,0, 1, 0,17,0,0, Form, 789, , , , , "
- ,"3,345,DABadaAppPanel1::OnInitializing,1076601,5278,5278,0, 1, 0,17,0,0, Panel,790, ,789, , , "
- ,"3,346,DABadaAppPanel2::OnInitializing,1126601,5278,5278,0, 1, 0,17,0,0, Panel,791, ,789, , , "
- ,"3,347,DABadaAppPanel21::OnInitializing,3196601,5279,5279,0, 1, 0,17,0,0,Panel,792, ,791, , , "
- ,"3,348,DABadaAppPanel211::OnInitializing,3436601,5279,5279,0, 1, 0,17,0,0, Form, 793, ,792, , , "
- ,"3,349,DABadaAppPanel22::OnInitializing,3436601,5279,5279,0, 1, 0,17,0,0, Form, 794, ,791, , , "
- ,"3,350,DABadaAppFrame::OnInitializing,3436601,5279,5279,0, 1, 0,17,0,0, Form, 795, ,, , , "
- ,"3,351,TestThreadForm::OnInitializing,3436601,5279,5279,0, 1, 0,17,0,0, Panel, 796, ,,795 , , "
-
- };
-
- int size = testLogs.length;
- for (int i = 0; i < size; i++) {
- String[] input = testLogs[i].split(",");
- List<String> dddd = new ArrayList<String>();
- for (int j = 0; j < input.length; j++) {
- dddd.add(input[j]);
- }
- getControlDataChecker().parserLog(dddd);
- }
- }
-
- }
-
- public void setSceneTransformDataTFromLogPackage(LogPackage logPack) {
-
- Logs logs = logPack.getLogs(LogCenterConstants.LOG_SCENE);
- if (null == logs || logs.getLogs().size() == 0) {
- return ;
- }
- List<List<String>> inputs = logs.getLogs();
- List<List<String>> ret = new ArrayList<List<String>>();
- int size = inputs.size();
-
- for (int i = 0; i < size; i++) {
- List<String> input = inputs.get(i);
-
- getSceneTransformDataChecker().parserLog(input);
- ret.add(input);
- }
- }
-
- public void setControlDataTFromLogPackage(LogPackage logPack) {
-
- Logs logs = logPack.getLogs(LogCenterConstants.LOG_CONTROL);
- if (null == logs || logs.getLogs().size() == 0) {
- return ;
- }
- List<List<String>> inputs = logs.getLogs();
- List<List<String>> ret = new ArrayList<List<String>>();
- int size = inputs.size();
-
- for (int i = 0; i < size; i++) {
- List<String> input = inputs.get(i);
-
- getControlDataChecker().parserLog(input);
- ret.add(input);
- }
- }
-
-
-
- public void clear() {
- controlListDataChecker = null;
- sceneTransformDataChecker = null;
- functionProfilingDataChecker = null;
- }
-
- public UserInterfaceControlListDataChecker getControlDataChecker() {
- if (null == controlListDataChecker) {
- controlListDataChecker = new UserInterfaceControlListDataChecker();
- }
- return controlListDataChecker;
- }
-
- public SceneTransformDataChecker getSceneTransformDataChecker() {
- if (null == sceneTransformDataChecker) {
- sceneTransformDataChecker = new SceneTransformDataChecker();
- }
- return sceneTransformDataChecker;
- }
-
- public UserInterfaceFunctionProfilingDataChecker getfunctionProfilingDataChecker() {
- if (null == functionProfilingDataChecker) {
- functionProfilingDataChecker = new UserInterfaceFunctionProfilingDataChecker();
- }
- return functionProfilingDataChecker;
- }
-}
\ No newline at end of file
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
-public class UserInterfaceControlListData {
+public class UIControlListData {
public static final int KEY_INDEX = LogCenterConstants.SEQUENCE_NUMBER_INDEX;
public static final int USER_INTERFACE_CONTROL_LIST_CONTROL = 0;
private List<String> data;
- public UserInterfaceControlListData(String[] input) {
+ public UIControlListData(String[] input) {
List<String> data = getData();
for (int i = 0; i < input.length; i++) {
data.add(input[i]);
}
}
- public UserInterfaceControlListData(List<String> input) {
+ public UIControlListData(List<String> input) {
if (null != input && !input.isEmpty()) {
getData().addAll(input);
}
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
-import org.tizen.dynamicanalyzer.ui.userinterface.UserInterfacePageDataManager;
-import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UserInterfaceFunctionProfilingData;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UIFunctionProfilingData;
-public class UserInterfaceControlListDataChecker {
+public class UIControlListDataChecker {
- List<UserInterfaceControlListData> formLeakList = null;
+ List<UIControlListData> formLeakList = null;
public void parserLog( List<String> input ){
}
private void addData(String[] input) {
- UserInterfaceControlListData fd = new UserInterfaceControlListData(input);
+ UIControlListData fd = new UIControlListData(input);
fd.setSequence( input[ LogCenterConstants.SEQUENCE_NUMBER_INDEX ] );
fd.setParentPointer( input[ LogCenterConstants.USER_INTERFACE_CONTROL_LIST_PARENT_POINTER_INDEX ] );
getDataList().add(fd);
+
}
private String getClassName( String apiName ){
return strApiName;
}
- public void notificationFromUserInterfaceFunctionProfilingDataChecker(){
+ public void notificationFromUserInterfaceFunctionProfilingDataChecker( int nChangedIndex ){
if (formLeakList != null ){
- setTime();
+ setUIControlListTimeData( nChangedIndex );
}
}
- private void setTime(){
- UserInterfacePageDataManager tManager = UserInterfacePageDataManager.getInstance();
- List<UserInterfaceFunctionProfilingData> controlList = tManager.getfunctionProfilingDataChecker().getDataList();
- int size = controlList.size();
- for (int i = 0; i < size; i++ ) {
- String[] splitProfilingList = controlList.get(i).getAPIName().split("::"); //$NON-NLS-1$
- String strProfilingClassName = new String(splitProfilingList[0].trim());
- for ( int j = 0 ; j < formLeakList.size() ; j++ ){
- String[] splitControlList = formLeakList.get(j).getClassName().split("::"); //$NON-NLS-1$
- String strControlClassName = new String(splitControlList[0].trim());
- if ( strProfilingClassName.equals( strControlClassName )){
- if ( splitProfilingList[ splitProfilingList.length-1 ].trim().equals("OnInitializing")){ //$NON-NLS-1$
- formLeakList.get(j).setInitializeTime( controlList.get(i).getExclEsapsedTime() );
- }else if ( splitProfilingList[ splitProfilingList.length-1 ].trim().equals("OnTerminating")){ //$NON-NLS-1${
- formLeakList.get(j).setTerminateTime( controlList.get(i).getExclEsapsedTime() );
- }
+ private void setUIControlListTimeData( int nChangedIndex ){
+ UIDataManager tManager = UIDataManager.getInstance();
+ List<UIFunctionProfilingData> controlList = tManager.getfunctionProfilingDataChecker().getDataList();
+
+ String[] splitProfilingList = controlList.get( nChangedIndex ).getAPIName().split("::"); //$NON-NLS-1$
+ String strProfilingClassName = new String(splitProfilingList[0].trim());
+
+ for ( int j = 0 ; j < formLeakList.size() ; j++ ){
+
+ String[] splitControlList = formLeakList.get(j).getClassName().split("::"); //$NON-NLS-1$
+ String strControlClassName = new String(splitControlList[0].trim());
+
+ if ( strProfilingClassName.equals( strControlClassName )){
+ if ( splitProfilingList[ splitProfilingList.length-1 ].trim().equals("OnInitializing")){ //$NON-NLS-1$
+ formLeakList.get(j).setInitializeTime( controlList.get( nChangedIndex ).getExclEsapsedTime() );
+ }else if ( splitProfilingList[ splitProfilingList.length-1 ].trim().equals("OnTerminating")){ //$NON-NLS-1${
+ formLeakList.get(j).setTerminateTime( controlList.get( nChangedIndex ).getExclEsapsedTime() );
}
}
}
+
}
- public List<UserInterfaceControlListData> getDataList() {
+ public List<UIControlListData> getDataList() {
if (null == formLeakList) {
- formLeakList = new ArrayList<UserInterfaceControlListData>();
+ formLeakList = new ArrayList<UIControlListData>();
}
return formLeakList;
}
import org.tizen.dynamicanalyzer.common.DASelectionData;
import org.tizen.dynamicanalyzer.model.TreeInput;
import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;
-import org.tizen.dynamicanalyzer.ui.userinterface.UserInterfacePageDataManager;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.TreeDataComparator;
-public class UserInterfaceControlListTable extends DATreeComposite {
+public class UIControlListTable extends DATreeComposite {
- public UserInterfaceControlListTable(Composite parent, int compStyle,
+ public UIControlListTable(Composite parent, int compStyle,
int tableStyle) {
super(parent, compStyle, tableStyle);
setComparator(new TreeDataComparator());
@Override
public void widgetSelected(SelectionEvent e) {
GridItem[] items = tree.getSelection();
- DASelectionData selData = new DASelectionData( UserInterfaceControlListView.ID, 0, 0, items, tree);
+ DASelectionData selData = new DASelectionData( UIControlListView.ID, 0, 0, items, tree);
AnalyzerManager.getCurrentPage().updatePage(selData);
AnalyzerManager.getCurrentPage().controlSelection(
- UserInterfaceControlListView.ID);
+ UIControlListView.ID);
}
@Override
if (treeTable && i == 0) {
column.setTree(true);
}
- column.setCellRenderer(new UserInterfaceControlListTableCellRenderer());
+ column.setCellRenderer(new UIControlListTableCellRenderer());
column.setHeaderRenderer(new DATableHeaderRenderer());
column.pack();
return result;
}
- private TreeInput makeInput( UserInterfaceControlListData input ) {
+ private TreeInput makeInput( UIControlListData input ) {
DATableDataFormat tableData = new DATableDataFormat( input.getSequence());
List<String> inputData = new ArrayList<String>();
@Override
public List<TreeInput> makeTreeInput() {
- UserInterfacePageDataManager tManager = UserInterfacePageDataManager.getInstance();
- List<UserInterfaceControlListData> controlList = tManager.getControlDataChecker().getDataList();
+ UIDataManager tManager = UIDataManager.getInstance();
+ List<UIControlListData> controlList = tManager.getControlDataChecker().getDataList();
List<TreeInput> output = new ArrayList<TreeInput>();
int size = controlList.size();
int nNodeDepth = 0;
import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableToggleRenderer;
-public class UserInterfaceControlListTableCellRenderer extends
+public class UIControlListTableCellRenderer extends
DefaultCellRenderer {
int leftMargin = 4;
int rightMargin = 4;
import org.tizen.dynamicanalyzer.model.DAView;
import org.tizen.dynamicanalyzer.nl.UserInterfacePageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.ui.userinterface.UserInterfacePageDataManager;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
-public class UserInterfaceControlListView extends DAView {
+public class UIControlListView extends DAView {
- public static final String ID = UserInterfaceControlListView.class.getName();
+ public static final String ID = UIControlListView.class.getName();
int[] innerMaxWeight = { 100, 0, 0 };
int[] outerMaxWeight = { 100, 0 };
};
private int[] columnSizes = { 150, 150, 80, 80 };
- UserInterfaceControlListTable treeComp = null;
+ UIControlListTable treeComp = null;
private boolean[] columnVisibility = { true, true, true, true, true };
int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NONE
,AnalyzerConstants.SORT_TYPE_NUM
,AnalyzerConstants.SORT_TYPE_NUM
,AnalyzerConstants.SORT_TYPE_NUM };
- int[] sourceColumns = { UserInterfaceControlListData.USER_INTERFACE_CONTROL_LIST_CONTROL
- ,UserInterfaceControlListData.USER_INTERFACE_CONTROL_LIST_CLASS_NAME
- ,UserInterfaceControlListData.USER_INTERFACE_CONTROL_LIST_INITIALIZER_TIME
- ,UserInterfaceControlListData.USER_INTERFACE_CONTROL_LIST_TERMININATE_TIME
+ int[] sourceColumns = { UIControlListData.USER_INTERFACE_CONTROL_LIST_CONTROL
+ ,UIControlListData.USER_INTERFACE_CONTROL_LIST_CLASS_NAME
+ ,UIControlListData.USER_INTERFACE_CONTROL_LIST_INITIALIZER_TIME
+ ,UIControlListData.USER_INTERFACE_CONTROL_LIST_TERMININATE_TIME
};
- public UserInterfaceControlListView(Composite parent, int style) {
+ public UIControlListView(Composite parent, int style) {
super(parent, style);
this.setLayout(new FillLayout());
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.WINDOW_BG_COLOR);
contents.setLayout(new FillLayout());
- treeComp = new UserInterfaceControlListTable(contents, SWT.NONE, SWT.SINGLE
+ treeComp = new UIControlListTable(contents, SWT.NONE, SWT.SINGLE
| SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
/*** setTree set first!!! ***/
treeComp.setTableName(UserInterfacePageLabels.USERINTERFACE_CONTROL_LIST_VIEW_NAME);
@Override
public void clear() {
treeComp.clear();
- UserInterfacePageDataManager.getInstance().clear();
+ UIDataManager.getInstance().clear();
}
@Override
import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;
import org.tizen.dynamicanalyzer.utils.Formatter;
-public class UserInterfaceFunctionProfilingData {
+public class UIFunctionProfilingData {
public static final int KEY_INDEX = LogCenterConstants.SEQUENCE_NUMBER_INDEX;
public static final int USER_INTERFACE_PROFILING_LIST_API_NAME = 0;
private ArrayList<ProfilingData> profilingData = null;
- public UserInterfaceFunctionProfilingData(String[] input) {
+ public UIFunctionProfilingData(String[] input) {
List<String> data = getData();
for (int i = 0; i < input.length; i++) {
data.add(input[i]);
}
}
- public UserInterfaceFunctionProfilingData(List<String> input) {
+ public UIFunctionProfilingData(List<String> input) {
if (null != input && !input.isEmpty()) {
getData().addAll(input);
}
}
- public UserInterfaceFunctionProfilingData( ProfilingData input) {
+ public UIFunctionProfilingData( ProfilingData input) {
if (null != input ) {
profilingData.add(input);
}
}
- public UserInterfaceFunctionProfilingData( ) {
+ public UIFunctionProfilingData( ) {
}
--- /dev/null
+package org.tizen.dynamicanalyzer.ui.userinterface.profiling;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TreeSet;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class UIFunctionProfilingDataChecker {
+
+ List<UIFunctionProfilingData> profilingList;
+ private TreeSet<String> userInterfaceFunctionTree = new TreeSet<String>();
+
+ public void addPfofilingData( ProfilingData input) {
+
+
+ String[] splitApiNameList = input.getName().split("::"); //$NON-NLS-1$
+ String strApiName = new String(splitApiNameList[splitApiNameList.length - 1].trim());
+ String strSearch = userInterfaceFunctionTree.ceiling(strApiName);
+
+ if ( strSearch == null ){
+ //System.out.println("Not Exist UI API List File ");
+ }else{
+ // System.out.println("strApiName : " + strApiName);
+
+ if (strSearch.equals(strApiName)) {
+
+ System.out.println("UI API Name : " + strApiName);
+
+ int nChangedIndex = 0;
+ boolean bUpdateData = false;
+ boolean bExistParentData = false;
+
+ int nListSize = getDataList().size();
+ for( int i = 0 ; i < nListSize ; i++ ){
+ if ( getDataList().get( i ).getSequence().equals( input.getSequence() ) ){
+ getDataList().remove(i);
+ nChangedIndex = i;
+ bUpdateData = true;
+ break;
+ }
+ }
+
+ nListSize = getDataList().size();
+ for( int i = 0 ; i < nListSize ; i++ ){
+ if ( getDataList().get( i ).getAPIName().equals( input.getParent() ) ){ // Check, Exist Parent Node
+ bExistParentData = true;
+ break;
+ }
+ }
+ if ( bExistParentData == false ){
+ makeParentData( input );
+ }
+
+
+ UIFunctionProfilingData fd = new UIFunctionProfilingData();
+ FunctionUsageProfiler profiler = AnalyzerManager.getFunctionUserProfiler();
+ String exTime = "-", inTime = "-", exeTime = "-", inExeTime = "-",exAvgTime = "-", inAvgTime = "-", exeAvgTime = "-", inExeAvgTime = "-"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
+ try {
+ exTime = profiler.getCpuTime(input, true);
+ exAvgTime = getAvgTime(Integer.parseInt(exTime),input.getCallCount(), 2);
+ exTime = Formatter.toTimeFormat2(exTime);
+
+ inTime = profiler.getCpuTime(input, false);
+ inAvgTime = getAvgTime(Integer.parseInt(inTime),input.getCallCount(), 2);
+ inTime = Formatter.toTimeFormat2(inTime);
+
+
+ exeTime = Integer.toString(input.getElapsedTime());
+ exeTime = Formatter.toTimeFormat(exeTime);
+ exeAvgTime = getAvgTime(input.getElapsedTime(),input.getCallCount(), 1);
+
+ inExeTime = Integer.toString(input.getExclusiveElapsedTime());
+ inExeTime = Formatter.toTimeFormat(inExeTime);
+ inExeAvgTime = getAvgTime(input.getExclusiveElapsedTime(),input.getCallCount(), 1);
+
+ } catch (NumberFormatException e) {
+ // FIXME
+ e.printStackTrace();
+ }
+
+ fd.setSequence( input.getSequence() );
+ fd.setKey( input.getKey() );
+ fd.setAPINamee( input.getName() );
+ fd.setExclCPUTime( exTime );
+ fd.setInclCPUTime( inTime );
+ fd.setInclEsapsedTime( exeTime );
+ fd.setExclEsapsedTime( inExeTime );
+ fd.setExclCPUAvgTime( exAvgTime );
+ fd.setInclCPUAvgTime( inAvgTime );
+ fd.setInclEsapsedAvgTime( exeAvgTime );
+ fd.setExclEsapsedAvgTime( inExeAvgTime );
+ fd.setParent( input.getParent() );
+
+ if ( bUpdateData == true ){
+ getDataList().add(nChangedIndex, fd);
+ }else{
+ nChangedIndex = nListSize;
+ getDataList().add(fd);
+ }
+
+ UIDataManager tManager = UIDataManager.getInstance();
+ tManager.getControlDataChecker().notificationFromUserInterfaceFunctionProfilingDataChecker( nChangedIndex );
+ }
+ }
+ }
+
+ public UIFunctionProfilingDataChecker() {
+ getUIApiList();
+ }
+
+ public List<UIFunctionProfilingData> getDataList() {
+ if (null == profilingList) {
+ profilingList = new ArrayList<UIFunctionProfilingData>();
+ }
+ return profilingList;
+ }
+
+ private String getAvgTime(int nTime, int nCount, int nType) {
+ String strRetrun = "00.000";//$NON-NLS-1$
+ if (nTime == 0) {
+ return strRetrun;
+ } else if( nCount == 0){
+ strRetrun = Integer.toString(nTime);
+ }else {
+ int nAvgExeTime = (nTime / nCount);
+ strRetrun = Integer.toString(nAvgExeTime);
+ }
+
+ if (nType == 1) {
+ strRetrun = Formatter.toTimeFormat(strRetrun);
+ } else {
+ strRetrun = Formatter.toTimeFormat2(strRetrun);
+ }
+ return strRetrun;
+ }
+
+ private void makeParentData( ProfilingData input ){
+ UIFunctionProfilingData fd = new UIFunctionProfilingData();
+ String exTime = "-", inTime = "-", exeTime = "-", inExeTime = "-",exAvgTime = "-", inAvgTime = "-", exeAvgTime = "-", inExeAvgTime = "-"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
+
+ Integer nParentSequence = Integer.parseInt( input.getSequence() );
+ String parentSequence = String.format("%s", nParentSequence+1 );
+ fd.setSequence( parentSequence );
+ fd.setKey( input.getKey() );
+ fd.setAPINamee( input.getParent() );
+ fd.setExclCPUTime( exTime );
+ fd.setInclCPUTime( inTime );
+ fd.setInclEsapsedTime( exeTime );
+ fd.setExclEsapsedTime( inExeTime );
+ fd.setExclCPUAvgTime( exAvgTime );
+ fd.setInclCPUAvgTime( inAvgTime );
+ fd.setInclEsapsedAvgTime( exeAvgTime );
+ fd.setExclEsapsedAvgTime( inExeAvgTime );
+ getDataList().add(fd);
+ }
+
+ private boolean getUIApiList() {
+
+ String configFileName = AnalyzerLabels.USER_INTERFACE_API_LIST_FILE_NAME;
+
+ File configFolder = new File(AnalyzerPaths.CONFIG_FOLDER_PATH);
+ if (!configFolder.isDirectory()) {
+ System.out.println("Not Exist UI API List File ");
+ return false;
+ }
+ File apiListFile = new File(configFolder, configFileName);
+ if (!apiListFile.isFile()) {
+ System.out.println("Not Exist UI API List File ");
+ return false;
+ } else {
+ BufferedReader in;
+ String content;
+ try {
+ in = new BufferedReader(new FileReader(apiListFile));
+ String strInputData;
+ while (null != (content = in.readLine())) {
+ if (!content.equals("")) {
+ strInputData = content.trim();
+ userInterfaceFunctionTree.add(strInputData);
+ }
+ }
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return true;
+ }
+}
import org.tizen.dynamicanalyzer.common.DASelectionData;
import org.tizen.dynamicanalyzer.model.TreeInput;
import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;
-import org.tizen.dynamicanalyzer.ui.userinterface.UserInterfacePageDataManager;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.TreeDataComparator;
-public class UserInterfaceFunctionProfilingTable extends DATreeComposite {
+public class UIFunctionProfilingTable extends DATreeComposite {
- public UserInterfaceFunctionProfilingTable(Composite parent, int compStyle,
+ public UIFunctionProfilingTable(Composite parent, int compStyle,
int tableStyle) {
super(parent, compStyle, tableStyle);
setComparator(new TreeDataComparator());
public void widgetSelected(SelectionEvent e) {
GridItem[] items = tree.getSelection();
DASelectionData selData = new DASelectionData(
- UserInterfaceFunctionProfilingView.ID, 0, 0, items, tree);
+ UIFunctionProfilingView.ID, 0, 0, items, tree);
AnalyzerManager.getCurrentPage().updatePage(selData);
AnalyzerManager.getCurrentPage().controlSelection(
- UserInterfaceFunctionProfilingView.ID);
+ UIFunctionProfilingView.ID);
}
@Override
if (treeTable && i == 0) {
column.setTree(true);
}
- column.setCellRenderer(new UserInterfaceFunctionProfilingTableCellRenderer());
+ column.setCellRenderer(new UIFunctionProfilingTableCellRenderer());
column.setHeaderRenderer(new DATableHeaderRenderer());
column.pack();
return result;
}
- private TreeInput makeInput( UserInterfaceFunctionProfilingData input ) {
+ private TreeInput makeInput( UIFunctionProfilingData input ) {
DATableDataFormat tableData = new DATableDataFormat( input.getSequence() );
List<String> inputData = new ArrayList<String>();
// !! recursive!!
public boolean makeChildTree(TreeInput nodeParent, TreeInput currentNode, int nNodeDepth) {
- String strParentName = nodeParent.getText().get( UserInterfaceFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_API_NAME );
+ String strParentName = nodeParent.getText().get( UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_API_NAME );
if (currentNode.getParent().trim().equals(strParentName)) {
nodeParent.getChildren().add(currentNode);
return true;
@Override
public List<TreeInput> makeTreeInput() {
- UserInterfacePageDataManager tManager = UserInterfacePageDataManager.getInstance();
- List<UserInterfaceFunctionProfilingData> controlList = tManager.getfunctionProfilingDataChecker().getDataList();
+ UIDataManager tManager = UIDataManager.getInstance();
+ List<UIFunctionProfilingData> controlList = tManager.getfunctionProfilingDataChecker().getDataList();
List<TreeInput> output = new ArrayList<TreeInput>();
int size = controlList.size();
int nNodeDepth = 0;
for (int i = 0; i < size; i++ ) {
TreeInput currentNode = makeInput( controlList.get(i) );
currentNode.setParent( controlList.get(i).getParent() );
- if ( controlList.get(i).getParent().equals("")){ //$NON-NLS-1$
+ if ( controlList.get(i).getParent().equals("")){ //$NON-NLS-1$ // Current Node is parent node.
output.add( currentNode );
}else{
for (int j = 0; j < output.size(); j++) {
import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableToggleRenderer;
-public class UserInterfaceFunctionProfilingTableCellRenderer extends
+public class UIFunctionProfilingTableCellRenderer extends
DefaultCellRenderer {
int leftMargin = 4;
int rightMargin = 4;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
-public class UserInterfaceFunctionProfilingView extends DAView {
+public class UIFunctionProfilingView extends DAView {
- public static final String ID = UserInterfaceFunctionProfilingView.class
+ public static final String ID = UIFunctionProfilingView.class
.getName();
int[] innerMaxWeight = { 100 };
UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_7,
UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_8 };
private int[] columnSizes = { 280, 85, 85, 85, 85, 85, 85, 85, 85 };
- UserInterfaceFunctionProfilingTable treeComp = null;
+ UIFunctionProfilingTable treeComp = null;
private boolean[] columnVisibility = { true, true, true, true, true, true,
true, true, true };
int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NONE,
AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM };
int[] sourceColumns = {
- UserInterfaceFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_API_NAME,
- UserInterfaceFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_EXCL_CPU_TIME,
- UserInterfaceFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_INCL_CPU_TIME,
- UserInterfaceFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_INCL_ESAPSED_TIME,
- UserInterfaceFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_EXCL_ESAPSED_TIME,
- UserInterfaceFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_EXCL_CPU_AVG_TIME,
- UserInterfaceFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_INCL_CPU_AVG_TIME,
- UserInterfaceFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_INCL_ESAPSED_AVG_TIME,
- UserInterfaceFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_EXCL_ESAPSED_AVG_TIME };
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_API_NAME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_EXCL_CPU_TIME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_INCL_CPU_TIME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_INCL_ESAPSED_TIME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_EXCL_ESAPSED_TIME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_EXCL_CPU_AVG_TIME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_INCL_CPU_AVG_TIME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_INCL_ESAPSED_AVG_TIME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_EXCL_ESAPSED_AVG_TIME };
- public UserInterfaceFunctionProfilingView(Composite parent, int style) {
+ public UIFunctionProfilingView(Composite parent, int style) {
super(parent, style);
this.setLayout(new FillLayout());
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.WINDOW_BG_COLOR);
contents.setLayout(new FillLayout());
- treeComp = new UserInterfaceFunctionProfilingTable(contents, SWT.NONE,
+ treeComp = new UIFunctionProfilingTable(contents, SWT.NONE,
SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL
| SWT.V_SCROLL);
/*** setTree set first!!! ***/
+++ /dev/null
-package org.tizen.dynamicanalyzer.ui.userinterface.profiling;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.TreeSet;
-
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
-import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;
-import org.tizen.dynamicanalyzer.ui.userinterface.UserInterfacePageDataManager;
-import org.tizen.dynamicanalyzer.utils.Formatter;
-
-public class UserInterfaceFunctionProfilingDataChecker {
-
- List<UserInterfaceFunctionProfilingData> profilingList;
- private TreeSet<String> userInterfaceFunctionTree = new TreeSet<String>();
-
- public void addPfofilingData(ProfilingData input) {
-
-
-
- String[] splitApiNameList = input.getName().split("::"); //$NON-NLS-1$
- String strApiName = new String(splitApiNameList[splitApiNameList.length - 1].trim());
- String strSearch = userInterfaceFunctionTree.ceiling(strApiName);
-
- // System.out.println("strApiName : " + strApiName);
-
- if ( getDataList().size() == 0 ){ // Re Factoring
-
- UserInterfaceFunctionProfilingData fd = new UserInterfaceFunctionProfilingData();
- String exTime = "-", inTime = "-", exeTime = "-", inExeTime = "-",exAvgTime = "-", inAvgTime = "-", exeAvgTime = "-", inExeAvgTime = "-"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
-
- fd.setSequence( input.getSequence() );
- fd.setKey( input.getKey() );
-
-
- fd.setAPINamee( input.getParent() );
-
- fd.setExclCPUTime( exTime );
- fd.setInclCPUTime( inTime );
- fd.setInclEsapsedTime( exeTime );
- fd.setExclEsapsedTime( inExeTime );
-
- fd.setExclCPUAvgTime( exAvgTime );
- fd.setInclCPUAvgTime( inAvgTime );
- fd.setInclEsapsedAvgTime( exeAvgTime );
- fd.setExclEsapsedAvgTime( inExeAvgTime );
-
-
- getDataList().add(fd);
- }
-
-
- if (strSearch.equals(strApiName)) {
-
- // System.out.println("UI API Name : " + strApiName);
-
-
- int nListSize = getDataList().size();
- for( int i = 0 ; i < nListSize ; i++ ){
- if ( getDataList().get( i ).getSequence().equals( input.getSequence() ) ){
- getDataList().remove(i);
- break;
- }
- }
-
-
- UserInterfaceFunctionProfilingData fd = new UserInterfaceFunctionProfilingData();
- FunctionUsageProfiler profiler = AnalyzerManager.getFunctionUserProfiler();
- String exTime = "-", inTime = "-", exeTime = "-", inExeTime = "-",exAvgTime = "-", inAvgTime = "-", exeAvgTime = "-", inExeAvgTime = "-"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
- try {
- exTime = profiler.getCpuTime(input, true);
- exAvgTime = getAvgTime(Integer.parseInt(exTime),input.getCallCount(), 2);
- exTime = Formatter.toTimeFormat2(exTime);
-
- inTime = profiler.getCpuTime(input, false);
- inAvgTime = getAvgTime(Integer.parseInt(inTime),input.getCallCount(), 2);
- inTime = Formatter.toTimeFormat2(inTime);
-
-
- exeTime = Integer.toString(input.getElapsedTime());
- exeTime = Formatter.toTimeFormat(exeTime);
- exeAvgTime = getAvgTime(input.getElapsedTime(),input.getCallCount(), 1);
-
- inExeTime = Integer.toString(input.getExclusiveElapsedTime());
- inExeTime = Formatter.toTimeFormat(inExeTime);
- inExeAvgTime = getAvgTime(input.getExclusiveElapsedTime(),input.getCallCount(), 1);
-
- } catch (NumberFormatException e) {
- // FIXME
- e.printStackTrace();
- }
-
- fd.setSequence( input.getSequence() );
- fd.setKey( input.getKey() );
-
-
-
- fd.setAPINamee( input.getName() );
-
- fd.setExclCPUTime( exTime );
- fd.setInclCPUTime( inTime );
- fd.setInclEsapsedTime( exeTime );
- fd.setExclEsapsedTime( inExeTime );
-
- fd.setExclCPUAvgTime( exAvgTime );
- fd.setInclCPUAvgTime( inAvgTime );
- fd.setInclEsapsedAvgTime( exeAvgTime );
- fd.setExclEsapsedAvgTime( inExeAvgTime );
-
- fd.setParent( input.getParent() );
-
-
- getDataList().add(fd);
- }
-
-
- UserInterfacePageDataManager tManager = UserInterfacePageDataManager.getInstance();
- tManager.getControlDataChecker().notificationFromUserInterfaceFunctionProfilingDataChecker();
- }
-
- public UserInterfaceFunctionProfilingDataChecker() {
- getUIApiList();
- }
-
- public List<UserInterfaceFunctionProfilingData> getDataList() {
- if (null == profilingList) {
- profilingList = new ArrayList<UserInterfaceFunctionProfilingData>();
-
- }
- return profilingList;
- }
-
- private String getAvgTime(int nTime, int nCount, int nType) {
- String strRetrun = "00.000";//$NON-NLS-1$
- if (nTime == 0) {
- return strRetrun;
- } else if( nCount == 0){
- strRetrun = Integer.toString(nTime);
- }else {
- int nAvgExeTime = (nTime / nCount);
- strRetrun = Integer.toString(nAvgExeTime);
- }
-
- if (nType == 1) {
- strRetrun = Formatter.toTimeFormat(strRetrun);
- } else {
- strRetrun = Formatter.toTimeFormat2(strRetrun);
- }
-
- return strRetrun;
-
- }
-
- private boolean getUIApiList() {
-
- String configFileName = AnalyzerLabels.USER_INTERFACE_API_LIST_FILE_NAME;
-
- File configFolder = new File(AnalyzerPaths.CONFIG_FOLDER_PATH);
- if (!configFolder.isDirectory()) {
- System.out.println("Not Exist Folder : " + configFolder);
- userInterfaceFunctionTree.add("");//$NON-NLS-1$
- return false;
- }
-
- File apiListFile = new File(configFolder, configFileName);
- if (!apiListFile.isFile()) {
- System.out.println("Not Exist File : " + apiListFile);
- userInterfaceFunctionTree.add("");//$NON-NLS-1$
- return false;
- } else {
- BufferedReader in;
- String content;
- try {
- in = new BufferedReader(new FileReader(apiListFile));
- String strInputData;
- while (null != (content = in.readLine())) {
- if (!content.equals("")) {
- strInputData = content.trim();
- userInterfaceFunctionTree.add(strInputData);
- }
- }
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- return true;
- }
-}
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.utils.Formatter;
-public class SceneTransformData {
+public class UISceneTransformData {
public static final int KEY_INDEX = LogCenterConstants.SEQUENCE_NUMBER_INDEX;
public static final int USER_INTERFACE_SCENE_TRANSFORMS_LISTL_SCENE_NAME = 0;
private List<String> data;
- public SceneTransformData(String[] input) {
+ public UISceneTransformData(String[] input) {
List<String> data = getData();
for (int i = 0; i < input.length; i++) {
data.add(input[i]);
}
}
- public SceneTransformData(List<String> input) {
+ public UISceneTransformData(List<String> input) {
if (null != input && !input.isEmpty()) {
getData().addAll(input);
}
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.common.CommonConstants;
-public class SceneTransformDataChecker {
+public class UISceneTransformDataChecker {
- List<SceneTransformData> transfomSceneList;
+ List<UISceneTransformData> transfomSceneList;
public void parserLog( List<String> input ){
}
private void addData(String[] input) {
- SceneTransformData fd = new SceneTransformData(input);
+ UISceneTransformData fd = new UISceneTransformData(input);
fd.setSequence( input[ LogCenterConstants.SEQUENCE_NUMBER_INDEX ] );
fd.setTime( input[ LogCenterConstants.TIME_INDEX ] );
getDataList().add(fd);
}
- public List<SceneTransformData> getDataList() {
+ public List<UISceneTransformData> getDataList() {
if (null == transfomSceneList) {
- transfomSceneList = new ArrayList<SceneTransformData>();
+ transfomSceneList = new ArrayList<UISceneTransformData>();
}
return transfomSceneList;
}
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.DASelectionData;
import org.tizen.dynamicanalyzer.model.TableInput;
-import org.tizen.dynamicanalyzer.ui.userinterface.UserInterfacePageDataManager;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
-public class UserInterfaceSceneTransformListTable extends DATableComposite {
+public class UITransformListTable extends DATableComposite {
- public UserInterfaceSceneTransformListTable(Composite parent, int style, int tableStyle) {
+ public UITransformListTable(Composite parent, int style, int tableStyle) {
super(parent, style, tableStyle);
table.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
GridItem[] items = table.getSelection();
- DASelectionData selData = new DASelectionData(UserInterfaceSceneTransformListView.ID, 0, 0, items, table);
+ DASelectionData selData = new DASelectionData(UITransformListView.ID, 0, 0, items, table);
AnalyzerManager.getCurrentPage().updatePage(selData);
- AnalyzerManager.getCurrentPage().controlSelection(UserInterfaceSceneTransformListView.ID);
+ AnalyzerManager.getCurrentPage().controlSelection(UITransformListView.ID);
- String test = items[0].getText( SceneTransformData.USER_INTERFACE_SCENE_TRANSFORMS_LIST_TIME);
+ String test = items[0].getText( UISceneTransformData.USER_INTERFACE_SCENE_TRANSFORMS_LIST_TIME);
System.out.println(" test : "+test);
}
protected List<TableInput> makeTableInput() {
- List<SceneTransformData> transfomSceneList = UserInterfacePageDataManager.getInstance().getSceneTransformDataChecker().getDataList();
+ List<UISceneTransformData> transfomSceneList = UIDataManager.getInstance().getSceneTransformDataChecker().getDataList();
List<TableInput> input = new ArrayList<TableInput>();
List<String> text = new ArrayList<String>();
- SceneTransformData sceneTransformsData = transfomSceneList.get(i);
+ UISceneTransformData sceneTransformsData = transfomSceneList.get(i);
List<String> inputData = new ArrayList<String>();
inputData.add(sceneTransformsData.getSequence());
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.TableComparator;
-public class UserInterfaceSceneTransformListView extends DAView {
- public static final String ID = UserInterfaceSceneTransformListView.class.getName();
+public class UITransformListView extends DAView {
+ public static final String ID = UITransformListView.class.getName();
DATableComposite tableComp = null;
int[] innerMaxWeight = { 0, 100, 0 };
AnalyzerConstants.SORT_TYPE_STRING,
AnalyzerConstants.SORT_TYPE_STRING };
- int[] sourceColumns = { SceneTransformData.USER_INTERFACE_SCENE_TRANSFORMS_LISTL_SCENE_NAME
- ,SceneTransformData.USER_INTERFACE_SCENE_TRANSFORMS_LIST_TIME
- ,SceneTransformData.USER_INTERFACE_SCENE_TRANSFORMS_LIST_FORM_NAME
- ,SceneTransformData.USER_INTERFACE_SCENE_TRANSFORMS_LIST_PANEL_NAME
- ,SceneTransformData.USER_INTERFACE_SCENE_TRANSFORMS_LIST_TRANSFORM_TIME
+ int[] sourceColumns = { UISceneTransformData.USER_INTERFACE_SCENE_TRANSFORMS_LISTL_SCENE_NAME
+ ,UISceneTransformData.USER_INTERFACE_SCENE_TRANSFORMS_LIST_TIME
+ ,UISceneTransformData.USER_INTERFACE_SCENE_TRANSFORMS_LIST_FORM_NAME
+ ,UISceneTransformData.USER_INTERFACE_SCENE_TRANSFORMS_LIST_PANEL_NAME
+ ,UISceneTransformData.USER_INTERFACE_SCENE_TRANSFORMS_LIST_TRANSFORM_TIME
} ;
- public UserInterfaceSceneTransformListView(Composite parent, int style) {
+ public UITransformListView(Composite parent, int style) {
super(parent, style);
this.setLayout(new FillLayout());
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.WINDOW_BG_COLOR);
contents.setLayout(new FillLayout());
- tableComp = new UserInterfaceSceneTransformListTable(contents, SWT.NONE, SWT.SINGLE
+ tableComp = new UITransformListTable(contents, SWT.NONE, SWT.SINGLE
| SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
tableComp.setTableName(UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_NAME);
tableComp.setComparator(new TableComparator());