import org.tizen.dynamicanalyzer.ui.views.CoolbarArea;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
-
-
class DAMonitor extends Thread {
static int portNumber = 6824;
public int bDARunning = -1;
-
- public void run( ) {
+
+ public void run() {
try {
portNumber += 12345;
bDARunning = 0;
ServerSocket local = new ServerSocket(portNumber);
local.accept();
} catch (SocketException e) {
- bDARunning = 1;
+ bDARunning = 1;
} catch (IOException e) {
e.printStackTrace();
bDARunning = 1;
}
@Override
- public void createWindowContents(Shell shell) {
+ public void createWindowContents(Shell shell) {
CoolbarArea.createInstance(getWindowConfigurer(), shell);
// Check DA Singleton Dlg.
- DAMonitor monitor_1 =new DAMonitor( );
+ DAMonitor monitor_1 = new DAMonitor();
monitor_1.start();
- while( monitor_1.bDARunning < 0 ){
+ while (monitor_1.bDARunning < 0) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
- DAMonitor monitors_2 =new DAMonitor( );
- monitors_2.start();
- while( monitors_2.bDARunning < 0 ){
+
+ DAMonitor monitors_2 = new DAMonitor();
+ monitors_2.start();
+ while (monitors_2.bDARunning < 0) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
- if ( monitor_1.bDARunning == 1 && monitors_2.bDARunning == 1 )
- {
+ if (monitor_1.bDARunning == 1 && monitors_2.bDARunning == 1) {
FocusDAManager.SetFocusDA();
System.exit(-1);
-
- }else{
- FocusDAManager.SetSaveFocusDAPid();
- IDESocketThread.InitIDESocketThreadListener();
- }
+
+ } else {
+ FocusDAManager.SetSaveFocusDAPid();
+ IDESocketThread.InitIDESocketThreadListener();
+ }
}
@Override
public void preWindowOpen() {
- Monitor[] monitors = PlatformUI.getWorkbench().getDisplay().getMonitors();
-
+ Monitor[] monitors = PlatformUI.getWorkbench().getDisplay()
+ .getMonitors();
+
Rectangle rectangle = null;
-
+
rectangle = monitors[0].getBounds();
-
- if (rectangle.width < DEFAULT_WIDTH || rectangle.height < DEFAULT_HEIGHT) {
+
+ if (rectangle.width < DEFAULT_WIDTH
+ || rectangle.height < DEFAULT_HEIGHT) {
width = MIN_WIDTH;
height = MIN_HEIGHT;
}
configurer.setInitialSize(new Point(width, height));
configurer.setShowStatusLine(false);
configurer.setShellStyle(SWT.SHELL_TRIM/* | SWT.NO_BACKGROUND */);
-
+
}
public void postWindowOpen() {
package org.tizen.dynamicanalyzer.ide;
-
import java.io.IOException;
import java.util.StringTokenizer;
public class CommandExecutor {
private Runtime runtime;
- private Process process;
+ private Process process;
public IPath file;
- public CommandExecutor() {
+ public CommandExecutor() {
}
-
+
public int executeCommand(String[] cmds) {
- int retValue = 0;
+ int retValue = 0;
- try{
+ try {
- if(cmds.length == 0){
- retValue = -1;
+ if (cmds.length == 0) {
+ retValue = -1;
} else {
-
+
runtime = Runtime.getRuntime();
- process = runtime.exec(cmds);
+ process = runtime.exec(cmds);
- if(process != null)
- {
- ThreadOutput gboInput = new ThreadOutput(process.getInputStream());
- ThreadOutput gboError = new ThreadOutput(process.getErrorStream());
+ if (process != null) {
+ ThreadOutput gboInput = new ThreadOutput(
+ process.getInputStream());
+ ThreadOutput gboError = new ThreadOutput(
+ process.getErrorStream());
gboInput.start();
gboError.start();
process.waitFor();
- retValue = process.exitValue();
- while(true){
- if(!gboInput.isAlive() && !gboError.isAlive()){
+ retValue = process.exitValue();
+ while (true) {
+ if (!gboInput.isAlive() && !gboError.isAlive()) {
break;
}
}
- }
- }
- }catch(IOException e){
- System.out.println(" " + e.getMessage()+ " " + e + " \n");
- } catch(InterruptedException e){
- System.out.println(" " + e.getMessage()+ " " + e + " \n");
- } finally{
- if(process != null){
- process.destroy();
- }
+ }
+ }
+ } catch (IOException e) {
+ System.out.println(" " + e.getMessage() + " " + e + " \n");
+ } catch (InterruptedException e) {
+ System.out.println(" " + e.getMessage() + " " + e + " \n");
+ } finally {
+ if (process != null) {
+ process.destroy();
+ }
}
return retValue;
- }
-
- public String changeString(String cmd,String finder, String changer)
- {
- String retValue="";
- if(cmd== null)
- {
- retValue="";
+ }
+
+ public String changeString(String cmd, String finder, String changer) {
+ String retValue = "";
+ if (cmd == null) {
+ retValue = "";
} else {
StringTokenizer token = new StringTokenizer(cmd, finder);
while (token.hasMoreTokens()) {
- if(retValue.length() >0){
- retValue = retValue+changer+token.nextToken();
+ if (retValue.length() > 0) {
+ retValue = retValue + changer + token.nextToken();
} else {
- retValue = token.nextToken();
+ retValue = token.nextToken();
}
}
}
- return retValue;
- }
+ return retValue;
+ }
}
package org.tizen.dynamicanalyzer.ide;
-
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
public class FocusDAManager {
- private static String pid = null;
- private static String Processid = null;
- private static int selfPid = 0;
+ private static String pid = null;
+ private static String Processid = null;
+ private static int selfPid = 0;
- private FocusDAManager(){
- selfPid = -1;
+ private FocusDAManager() {
+ selfPid = -1;
}
- private FocusDAManager(int iPid){
- selfPid = iPid;
+ private FocusDAManager(int iPid) {
+ selfPid = iPid;
}
- private static void GetPid(){
-
- if(selfPid > 0){
- pid = String.valueOf(selfPid);
- }
- else{
- //get IDE pid.
+ private static void GetPid() {
+
+ if (selfPid > 0) {
+ pid = String.valueOf(selfPid);
+ } else {
+ // get IDE pid.
ManagementFactory.getRuntimeMXBean();
RuntimeMXBean rt = ManagementFactory.getRuntimeMXBean();
Processid = rt.getName();
- pid = Processid.substring(0, Processid.indexOf("@"));
+ pid = Processid.substring(0, Processid.indexOf("@"));
}
}
-
- public static void SetSaveFocusDAPid(){
+
+ public static void SetSaveFocusDAPid() {
GetPid();
- ConfigureManager.getInstance().setValue(ConfigureManager.SINGLETON_FOCUS_DA_PID, pid);
+ ConfigureManager.getInstance().setValue(
+ ConfigureManager.SINGLETON_FOCUS_DA_PID, pid);
}
- private static String[] GetSaveFocusPath(){
-
+
+ private static String[] GetSaveFocusPath() {
+
String[] returnStr = null;
- String strPid = ConfigureManager.getInstance().getValue(ConfigureManager.SINGLETON_FOCUS_DA_PID);
-
+ String strPid = ConfigureManager.getInstance().getValue(
+ ConfigureManager.SINGLETON_FOCUS_DA_PID);
+
if (AnalyzerUtil.isWin()) {
- returnStr = new String[]{ "wscript", AnalyzerConstants.InstallPathForWindow, strPid };
+ returnStr = new String[] { "wscript",
+ AnalyzerConstants.InstallPathForWindow, strPid };
+ } else {
+ returnStr = new String[] { AnalyzerConstants.InstallPathForLinux,
+ strPid };
}
- else{
- returnStr = new String[]{ AnalyzerConstants.InstallPathForLinux , strPid };
- }
-
- return returnStr;
+
+ return returnStr;
}
-
- public static void SetFocusDA(){
- CommandExecutor prt = new CommandExecutor();
- prt.executeCommand( GetSaveFocusPath() );
+ public static void SetFocusDA() {
+ CommandExecutor prt = new CommandExecutor();
+ prt.executeCommand(GetSaveFocusPath());
}
}
package org.tizen.dynamicanalyzer.ide;
-
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-public class ThreadOutput extends Thread{
- private InputStream _ips;
+public class ThreadOutput extends Thread {
+ private InputStream _ips;
- public ThreadOutput(InputStream is){
- _ips = is;
+ public ThreadOutput(InputStream is) {
+ _ips = is;
}
- public void run(){
+ public void run() {
try {
InputStreamReader isr = new InputStreamReader(_ips);
BufferedReader br = new BufferedReader(isr);
String line;
- while ( (line = br.readLine()) != null){
- System.out.println("log : "+line);
+ while ((line = br.readLine()) != null) {
+ System.out.println("log : " + line);
}
-
- } catch (IOException ioe) {
+
+ } catch (IOException ioe) {
} finally {
}
SCORE_VIEW_WARNING_COUNT=Warning Count
SNAPSHOT_VIEW_TITLE=Snapshot
-SNAPSHOT_VIEW_BLUETOOTH_ELSE=Bluetooth else
+SNAPSHOT_VIEW_BLUETOOTH_ELSE=Bluetooth on
SNAPSHOT_VIEW_BLUETOOTH_OFF=Bluetooth off
SNAPSHOT_VIEW_BLUETOOTH_TRANSFER=Bluetooth transfer
SNAPSHOT_VIEW_BYTE=Byte
import org.tizen.dynamicanalyzer.model.LogPackage;
import org.tizen.dynamicanalyzer.model.Logs;
import org.tizen.dynamicanalyzer.model.SnapshotData;
-import org.tizen.dynamicanalyzer.timeline.chart.DATimelineChart;
import org.tizen.dynamicanalyzer.timeline.chart.TimelineChart;
import org.tizen.dynamicanalyzer.ui.views.CoolbarArea;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.utils.TimelineUtils;
-
public class TimelineComposite extends DAView {
public static final String ID = TimelineComposite.class.getName();
private String activedItemName; // for resizing
TempConstants.chartRunningSec = (int) (runTimeMs / TimelineConstants.TIME_SEC_TO_MS);
TimelineMaster.getInstance().redrawTimeTickCanvas();
-
+
}
public void setActivateItem(String itemID) {
setLayoutDataBaseComp(itemsAreaScrolledComp, true, true, false);
/* RangeSelector -> Scroll bar */
- scaleAndRangeComp = timelineRangeSelector.createScaleAndRangeComp(parent);
+ scaleAndRangeComp = timelineRangeSelector
+ .createScaleAndRangeComp(parent);
setLayoutDataBaseComp(scaleAndRangeComp, true, false, true);
return parent;
}
- private void setLayoutDataBaseComp(Composite comp, boolean h_space, boolean v_space, boolean setHint) {
+ private void setLayoutDataBaseComp(Composite comp, boolean h_space,
+ boolean v_space, boolean setHint) {
GridData gData = new GridData();
if (setHint) {
comp.setLayoutData(gData);
}
- private ScrolledComposite createItemsAreaScrolledComp(Composite baseComposite) {
+ private ScrolledComposite createItemsAreaScrolledComp(
+ Composite baseComposite) {
if (null == baseComposite) {
return null;
}
- ScrolledComposite scrolledComp = new ScrolledComposite(baseComposite, SWT.V_SCROLL);
+ ScrolledComposite scrolledComp = new ScrolledComposite(baseComposite,
+ SWT.V_SCROLL);
/* Item Area */
itemsAreaComp = new Composite(scrolledComp, SWT.NONE);
scrolledComp.setAlwaysShowScrollBars(true);
resetItems(TimelineItemsProvider.getInstance().getSelectedItemsList());
-
+
return scrolledComp;
}
return;
}
- List<Integer> zoomedItemTypeList = TimelineItemSettingProvider.getZoomedItemList();
+ List<Integer> zoomedItemTypeList = TimelineItemSettingProvider
+ .getZoomedItemList();
int zoomedItemNum = 0;
if (null != zoomedItemTypeList) {
zoomedItemNum = zoomedItemTypeList.size();
}
- int defItemNum = TimelineItemsProvider.getInstance().getSelectedItemsList().size() - zoomedItemNum;
+ int defItemNum = TimelineItemsProvider.getInstance()
+ .getSelectedItemsList().size()
+ - zoomedItemNum;
- int defItemsHeight = defItemNum * TimelineItemSettingProvider.getDefaultSizeMode();
- int zoomedItemsHeight = zoomedItemNum * TimelineConstants.ITEM_HEIGHT_MAX;
+ int defItemsHeight = defItemNum
+ * TimelineItemSettingProvider.getDefaultSizeMode();
+ int zoomedItemsHeight = zoomedItemNum
+ * TimelineConstants.ITEM_HEIGHT_MAX;
itemsAreaScrolledComp.setMinHeight(defItemsHeight + zoomedItemsHeight);
timelineItemManager.resizeItems();
long start = selData.getStartTime();
long end = selData.getEndTime();
- double startTime = (double) start / TimelineConstants.TIME_SEC_TO_MS / TimelineConstants.TIME_US_TO_MS;
- double endTime = (double) end / TimelineConstants.TIME_SEC_TO_MS / TimelineConstants.TIME_US_TO_MS;
+ double startTime = (double) start / TimelineConstants.TIME_SEC_TO_MS
+ / TimelineConstants.TIME_US_TO_MS;
+ double endTime = (double) end / TimelineConstants.TIME_SEC_TO_MS
+ / TimelineConstants.TIME_US_TO_MS;
double middleTime = Math.round((startTime + endTime) / 2.0);
if (endTime == startTime) {
middleTime = startTime;
startPx = middlePx - TempConstants.MIN_SELECTION_HALF_WIDTH_PX;
endPx = middlePx + TempConstants.MIN_SELECTION_HALF_WIDTH_PX;
}
- startTime = timelineMaster.getSecByPx(startPx) * TimelineConstants.TIME_SEC_TO_MS;
- endTime = timelineMaster.getSecByPx(endPx) * TimelineConstants.TIME_SEC_TO_MS;
+ startTime = timelineMaster.getSecByPx(startPx)
+ * TimelineConstants.TIME_SEC_TO_MS;
+ endTime = timelineMaster.getSecByPx(endPx)
+ * TimelineConstants.TIME_SEC_TO_MS;
timelineMaster.setSelectionMarkerValues(startTime, endTime);
}
if (null == logPack) {
return;
}
-
+
Logs logList = logPack.getLogs(LogCenterConstants.LOG_LIFECYCLE);
- if (null != logList && null != logList.getLogs() && 0 <= logList.getLogs().size()) {
+ if (null != logList && null != logList.getLogs()
+ && 0 <= logList.getLogs().size()) {
List<List<String>> deviceLogs = logList.getLogs();
for (List<String> deviceLog : deviceLogs) {
if (null == deviceLog || 0 > deviceLog.size()) {
}
}
- List<String> itemList = TimelineItemsProvider.getInstance().getAvailableItemsList();
-
- //FIXME chart manager
+ List<String> itemList = TimelineItemsProvider.getInstance()
+ .getAvailableItemsList();
+
+ // FIXME chart manager
for (int i = 0; i < itemList.size(); i++) {
- updateChartDataSet(logPack, TimelineUtils.getChartType(itemList.get(i)));
+ updateChartDataSet(logPack,
+ TimelineUtils.getChartType(itemList.get(i)));
}
}
-
+
private void updateChartDataSet(LogPackage logPack, int chartType) {
int probeType = TimelineUtils.getProbeID(chartType);
- TimelineChart timelineChart = TimelineChartManager.getInstance().getTimelineChartInstance(chartType);
-// if(chartType == TimelineConstants.CHART_TYPE_CPU && TimelineItemManager.bCustomChart == true) {
-// ((DATimelineChart)timelineChart).parsingLogList(logPack, probeType);
-// } else {
- timelineChart.parsingLogList(logPack, probeType);
-// }
+ TimelineChart timelineChart = TimelineChartManager.getInstance()
+ .getTimelineChartInstance(chartType);
+ // if(chartType == TimelineConstants.CHART_TYPE_CPU &&
+ // TimelineItemManager.bCustomChart == true) {
+ // ((DATimelineChart)timelineChart).parsingLogList(logPack, probeType);
+ // } else {
+ timelineChart.parsingLogList(logPack, probeType);
+ // }
}
@Override
{
SnapshotView currentView = new SnapshotView(
tabView.getContentComposite(), SWT.NONE, false);
- tabView.addView(currentView, SummaryLabels.SUMMARY_PAGE_SNAPSHOT_TITLE);
+ tabView.addView(currentView,
+ SummaryLabels.SUMMARY_PAGE_SNAPSHOT_TITLE);
CallstackView callstack = new CallstackView(
tabView.getContentComposite(), SWT.NONE);
- tabView.addView(callstack, SummaryLabels.SUMMARY_PAGE_CALLSTACK_TITLE);
+ tabView.addView(callstack,
+ SummaryLabels.SUMMARY_PAGE_CALLSTACK_TITLE);
}
upperForm.setWeights(new int[] { 37, 40, 23 });
@Override
public void controlResized(ControlEvent e) {
+
Composite composite = (Composite) e.widget;
Rectangle rect = composite.getBounds();
int pageWidth = rect.width;
int hRate = (int) (DEFAULT_HEIGHT * 100 / pageHeight);
wRate = (wRate >= 100) ? 100 : wRate;
hRate = (hRate >= 100) ? 100 : hRate;
+
+ if ((wRate >= (100 - 37)) || hRate >= 100) {
+ return;
+ }
upperForm.setWeights(new int[] { 37, 100 - 37 - wRate, wRate });
baseForm.setWeights(new int[] { hRate, 100 - hRate });
}