import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.nl.MenuBarLabels;
import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.setting.FlatFeature;
import org.tizen.dynamicanalyzer.setting.FlatPreferences;
import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.setting.UILayoutDataManager;
// start screenshot timer
FlatPreferences feature = FlatPreferences.SCREENSHOT_PERIODICALLY;
int value = SettingDataManager.INSTANCE.getOptionsPreferencesValue(feature);
- if (value > 0) {
+ if (SettingDataManager.INSTANCE.getSelectedFlatFeatureSet().contains(FlatFeature.SCREENSHOT)
+ && value > 0) {
ScreenshotTimer.start(value);
}
setStageComplete(STAGE.CREATE_SCREENSHOT_TIMER);
public static String ON_SCENE_TRANSITION;
public static String PERIODICALLY;
- public static String SET_AS_DEFAULT;
+ public static String RESET_TO_DEFAULT;
public static String TIME_UNIT_MS;
public static String TIME_UNIT_S;
#
TITLE=Preferences
-SET_AS_DEFAULT=Set as default
+RESET_TO_DEFAULT=Reset to default
TIME_UNIT_MS=ms
TIME_UNIT_S=s
tempMap.put(FlatFeature.NETWORK_IO, new ProtocolConfig30[] { SYSTEM_NETWORK });
tempMap.put(FlatFeature.NETWORK_ANALYSIS, new ProtocolConfig30[] { NETWORK_API_PROBE });
tempMap.put(FlatFeature.UI_EVENT, new ProtocolConfig30[] { USER_EVENT });
- tempMap.put(FlatFeature.SCREENSHOT, new ProtocolConfig30[] { SCREENSHOT });
//tempMap.put(FlatFeature.UI_HIERARCHY_ANALYSIS, new ProtocolConfig30[] { UIHV });
tempMap.put(FlatFeature.THREAD_ANALYSIS, new ProtocolConfig30[] { THREAD_API_PROBE, SYSTEM_THREAD_LOAD });
tempMap.put(FlatFeature.PERIPHERAL_STATUS, new ProtocolConfig30[] { SYSTEM_DEVICE });
tempMap.put(FlatPreferences.FUNCTION_PROFILING, new ProtocolConfig30[] { FUNCTION_PROFILING });
tempMap.put(FlatPreferences.SYSTEM_ALL_PROCESSES, new ProtocolConfig30[] { SYSTEM_PROCESSES_LOAD });
tempMap.put(FlatPreferences.PROCESS_MEMORY, new ProtocolConfig30[] { SYSTEM_PROCESS });
+ tempMap.put(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION, new ProtocolConfig30[] { SCREENSHOT });
preferencesProtocolMap = Collections.unmodifiableMap(tempMap);
}
tempMap.put(FlatFeature.NETWORK_IO, new ProtocolConfig30_UIHV[] { SYSTEM_NETWORK });
tempMap.put(FlatFeature.NETWORK_ANALYSIS, new ProtocolConfig30_UIHV[] { NETWORK_API_PROBE });
tempMap.put(FlatFeature.UI_EVENT, new ProtocolConfig30_UIHV[] { USER_EVENT });
- tempMap.put(FlatFeature.SCREENSHOT, new ProtocolConfig30_UIHV[] { SCREENSHOT });
tempMap.put(FlatFeature.UI_HIERARCHY_ANALYSIS, new ProtocolConfig30_UIHV[] { UI_HIERARCHY });
tempMap.put(FlatFeature.THREAD_ANALYSIS, new ProtocolConfig30_UIHV[] { THREAD_API_PROBE, SYSTEM_THREAD_LOAD });
tempMap.put(FlatFeature.PERIPHERAL_STATUS, new ProtocolConfig30_UIHV[] { SYSTEM_DEVICE });
tempMap.put(FlatPreferences.FUNCTION_PROFILING, new ProtocolConfig30_UIHV[] { FUNCTION_PROFILING });
tempMap.put(FlatPreferences.SYSTEM_ALL_PROCESSES, new ProtocolConfig30_UIHV[] { SYSTEM_PROCESSES_LOAD });
tempMap.put(FlatPreferences.PROCESS_MEMORY, new ProtocolConfig30_UIHV[] { SYSTEM_PROCESS });
+ tempMap.put(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION, new ProtocolConfig30_UIHV[] { SCREENSHOT });
preferencesProtocolMap = Collections.unmodifiableMap(tempMap);
}
WEBAPP_STARTUP});
tempMap.put(FlatPreferences.SYSTEM_ALL_PROCESSES, new ProtocolConfig40[] { SYSTEM_PROCESSES_LOAD });
tempMap.put(FlatPreferences.PROCESS_MEMORY, new ProtocolConfig40[] { SYSTEM_PROCESS });
+ tempMap.put(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION, new ProtocolConfig40[] { SCREENSHOT });
preferencesProtocolMap = Collections.unmodifiableMap(tempMap);
}
tempMap.put(FlatFeature.NETWORK_IO, new ProtocolConfig40[] { SYSTEM_NETWORK });
tempMap.put(FlatFeature.NETWORK_ANALYSIS, new ProtocolConfig40[] { NETWORK_API_PROBE });
tempMap.put(FlatFeature.UI_EVENT, new ProtocolConfig40[] { USER_EVENT });
- tempMap.put(FlatFeature.SCREENSHOT, new ProtocolConfig40[] { SCREENSHOT });
//tempMap.put(FlatFeature.UI_HIERARCHY_ANALYSIS, new ProtocolConfig40[] { UIHV });
tempMap.put(FlatFeature.THREAD_ANALYSIS, new ProtocolConfig40[] { THREAD_API_PROBE, SYSTEM_THREAD_LOAD });
tempMap.put(FlatFeature.PERIPHERAL_STATUS, new ProtocolConfig40[] { SYSTEM_DEVICE });
WEBAPP_STARTUP});
tempMap.put(FlatPreferences.SYSTEM_ALL_PROCESSES, new ProtocolConfig41[] { SYSTEM_PROCESSES_LOAD });
tempMap.put(FlatPreferences.PROCESS_MEMORY, new ProtocolConfig41[] { SYSTEM_PROCESS });
+ tempMap.put(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION, new ProtocolConfig41[] { SCREENSHOT });
preferencesProtocolMap = Collections.unmodifiableMap(tempMap);
}
tempMap.put(FlatFeature.NETWORK_IO, new ProtocolConfig41[] { SYSTEM_NETWORK });
tempMap.put(FlatFeature.NETWORK_ANALYSIS, new ProtocolConfig41[] { NETWORK_API_PROBE });
tempMap.put(FlatFeature.UI_EVENT, new ProtocolConfig41[] { USER_EVENT });
- tempMap.put(FlatFeature.SCREENSHOT, new ProtocolConfig41[] { SCREENSHOT });
tempMap.put(FlatFeature.UI_HIERARCHY_ANALYSIS, new ProtocolConfig41[] { UI_HIERARCHY });
tempMap.put(FlatFeature.THREAD_ANALYSIS, new ProtocolConfig41[] { THREAD_API_PROBE, SYSTEM_THREAD_LOAD });
tempMap.put(FlatFeature.PERIPHERAL_STATUS, new ProtocolConfig41[] { SYSTEM_DEVICE });
RECORDING(2004, 1, PreferencesDialogLabels.RECORDING),
AUTO_STOP(2005, 0, PreferencesDialogLabels.AUTOSTOP_WHILE_REPLAYING),
SCREENSHOT_PERIODICALLY(2006, 0, PreferencesDialogLabels.PERIODICALLY),
+ SCREENSHOT_ON_SCENE_TRANSITION(2007, 1, PreferencesDialogLabels.ON_SCENE_TRANSITION),
FUNCTION_PROFILING(3001, 1, PreferencesDialogLabels.FUNCTION_PROFILING),
APP_STARTUP(3002, 1, PreferencesDialogLabels.APP_STARTUP),
WEB_FUNCTION_PROFILING(3003, 1, PreferencesDialogLabels.WEB_FUNCTION_PROFILING),
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.communicator.DeviceInfo;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
import org.tizen.dynamicanalyzer.protocol.DebugLog;
import org.tizen.dynamicanalyzer.protocol.IProtocolConfig;
import org.tizen.dynamicanalyzer.protocol.Protocol;
import org.tizen.dynamicanalyzer.protocol.UnknownProtocolException;
+import org.tizen.dynamicanalyzer.ui.page.BaseView;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.util.Logger;
+import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
public enum SettingDataManager {
INSTANCE;
this.isNewSetting = isNewSetting;
}
+ /**
+ * Enables Screenshot feature and adds corresponding chart on Timeline page.
+ *
+ * @param enable whether Screenshot feature should be enabled
+ */
+ public void enableScreenshotFeature(boolean enable) {
+ TargetData target = getConnectedTarget();
+ Set<String> targetChartList = getSelectedChartSet(target.getTargetName());
+ if (!targetChartList.contains(TimelineChartLabels.SCREENSHOT_CHART_TITLE)) {
+ BaseView baseView = (BaseView) WorkbenchUtil.getViewPart(BaseView.ID);
+ if (baseView.getTopComposite() instanceof TimelinePage) {
+ TimelinePage timelinePage = (TimelinePage) baseView.getTopComposite();
+ timelinePage.getTimelineChartView().showScreenshotChart(enable);
+
+ if (enable)
+ target.addSelectedFlatFeature(FlatFeature.SCREENSHOT.getName());
+ else
+ target.removeSelectedFeature(FlatFeature.SCREENSHOT.getName());
+ }
+ }
+ }
}
FlatFeature feature = FlatFeature.getFlatFeature(featureName);
if (!this.selectedFlatFeatureList.contains(feature)) {
this.selectedFlatFeatureList.add(feature);
+ if (feature == FlatFeature.SCREENSHOT)
+ SettingDataManager.INSTANCE.addOptionsSelectedPreference(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION, 1);
}
}
import org.tizen.dynamicanalyzer.annotation.UIMethod;
import org.tizen.dynamicanalyzer.callback.ExecutionCallbackManager;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.DAResult;
import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.common.DAState;
import org.tizen.dynamicanalyzer.common.PreWindowShellCloseCallback;
import org.tizen.dynamicanalyzer.common.path.PathManager;
-import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.communicator.DeviceManager;
import org.tizen.dynamicanalyzer.communicator.IDECommunicator;
-import org.tizen.dynamicanalyzer.communicator.UnsupportedProtocolException;
import org.tizen.dynamicanalyzer.control.SideWorker;
import org.tizen.dynamicanalyzer.handlers.CommandAction;
-import org.tizen.dynamicanalyzer.handlers.CommonAction;
-import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
-import org.tizen.dynamicanalyzer.setting.FlatFeature;
-import org.tizen.dynamicanalyzer.setting.SettingConstants;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-import org.tizen.dynamicanalyzer.setting.TargetData;
import org.tizen.dynamicanalyzer.swap.platform.BinarySettingManager;
-import org.tizen.dynamicanalyzer.ui.file.FilePage;
-import org.tizen.dynamicanalyzer.ui.hierarchy.HierarchyPage;
-import org.tizen.dynamicanalyzer.ui.interactive.InteractivePage;
-import org.tizen.dynamicanalyzer.ui.interactive.data.InteractiveDataManager;
-import org.tizen.dynamicanalyzer.ui.kernel.KernelPage;
-import org.tizen.dynamicanalyzer.ui.memory.MemoryPage;
-import org.tizen.dynamicanalyzer.ui.network.NetworkPage;
-import org.tizen.dynamicanalyzer.ui.opengl.GLPage;
import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
-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.toolbar.Toolbar;
-import org.tizen.dynamicanalyzer.swap.platform.BinarySettingManager;
import org.tizen.dynamicanalyzer.ui.toolbar.setting.FlatFeatureDialog;
import org.tizen.dynamicanalyzer.ui.toolbar.setting.PreferencesDialog;
import org.tizen.dynamicanalyzer.ui.toolbar.setting.TargetDialog;
-import org.tizen.dynamicanalyzer.ui.userinterface.UIPage;
-import org.tizen.dynamicanalyzer.ui.widgets.SearchDialog;
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
-import org.tizen.dynamicanalyzer.widgets.scale.DAScale;
import org.tizen.dynamicanalyzer.workbench.LayoutManager;
public class BaseView extends ViewPart {
}
MenuBar.getInstance().getViewDetail().notifyListeners(SWT.Selection, new Event());
} else if(e.keyCode == SWT.F9) {
- if(DAState.isRunning()) {
- TargetData target = SettingDataManager.INSTANCE.getConnectedTarget();
- Set<String> targetChartList = SettingDataManager.INSTANCE.getSelectedChartSet(target
- .getTargetName());
- if(!targetChartList.contains(TimelineChartLabels.SCREENSHOT_CHART_TITLE)) {
- BaseView baseView = (BaseView) WorkbenchUtil.getViewPart(BaseView.ID);
- if(baseView.getTopComposite() instanceof TimelinePage) {
- TimelinePage timelinePage = (TimelinePage)baseView.getTopComposite();
- timelinePage.getTimelineChartView().addScreenshotChart();
- target.addSelectedFlatFeature(FlatFeature.SCREENSHOT.getName());
- }
- }
- }
-
- try {
- if (!DACommunicator.captureScreenshot().isSuccess()) {
- Logger.error("Failed to capture screenshot");
- }
- } catch (InterruptedException ex) {
- Logger.warning("Interrupted during send screenshot message");
- } catch (UnsupportedProtocolException ex) {
- Logger.warning("Message to capture screenshot is not supported by communicator");
- }
+ AnalyzerUtil.captureScreenshot();
} else if(e.keyCode == SWT.F5) {
if(DAState.isStartable() && Toolbar.INSTANCE.getStartButton().getState() == DACustomButton.STATE_NORMAL) { //start trace
Toolbar.INSTANCE.clearMarkerTimeList();
import org.tizen.dynamicanalyzer.common.DAState;
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.common.path.PathManager;
-import org.tizen.dynamicanalyzer.communicator.DACommunicator;
-import org.tizen.dynamicanalyzer.communicator.UnsupportedProtocolException;
import org.tizen.dynamicanalyzer.handlers.CommandAction;
import org.tizen.dynamicanalyzer.handlers.CommonAction;
import org.tizen.dynamicanalyzer.handlers.UIActionHolder;
MenuItem analyzeTarget = new MenuItem(analyzeMenu, SWT.PUSH);
analyzeTarget.setText(MenuBarLabels.ANALYZE_TARGET);
- analyzeTarget.addSelectionListener(anlysisMenuListener);
-
- MenuItem analyzeScreenshot = new MenuItem(analyzeMenu, SWT.PUSH);
- analyzeScreenshot.setText(MenuBarLabels.ANALYZE_SCREENSHOT);
- analyzeScreenshot.addSelectionListener(anlysisMenuListener);
- analyzeScreenshot.setEnabled(false);
+ analyzeTarget.addSelectionListener(anlysisMenuListener);
MenuItem analyzePreferences = new MenuItem(analyzeMenu, SWT.PUSH);
analyzePreferences.setText(MenuBarLabels.ANALYZE_PREFENCES);
} else if (menuName.equals(MenuBarLabels.ANALYZE_TARGET)) {
TargetDialog targetDialog = new TargetDialog(currentShell);
targetDialog.open();
- } else if (menuName.equals(MenuBarLabels.ANALYZE_SCREENSHOT)) {
- try {
- if (!DACommunicator.captureScreenshot().isSuccess()) {
- Logger.error("Failed to capture screenshot");
- }
- } catch (InterruptedException e) {
- Logger.warning("Interrupted during send screenshot message");
- } catch (UnsupportedProtocolException e) {
- Logger.warning("Message to capture screenshot is not supported by communicator");
- }
} else if (menuName.equals(MenuBarLabels.ANALYZE_PREFENCES)) {
PreferencesDialog preferencesDialog = new PreferencesDialog(currentShell);
preferencesDialog.open();
ArrayList<DAChartBoard> chartboards = new ArrayList<DAChartBoard>();
ArrayList<DAChartBoardManager> boardMannagers = new ArrayList<DAChartBoardManager>();
ArrayList<DAScale> scales = new ArrayList<DAScale>();
- int[] zoom_vals = { 0, 0, 0, 0, 0 };
int index = 0;
double chartDiv = 3;
}
}
}
-
- public void addScreenshotChart() {
+
+ /**
+ * Shows or hides Screenshot chart depending on {@code show} argument.
+ *
+ * @param show whether Screenshot should be shown
+ */
+ public void showScreenshotChart(boolean show) {
List<TimelineChart> chartList = timelineChartManager.getChartList();
for(int i = 0; i < chartList.size(); i++){
TimelineChart timelineChart = chartList.get(i);
if(timelineChart.getChartName().equals(TimelineChartLabels.SCREENSHOT_CHART_TITLE)) {
- chartBoard.showItem(i);
+ if (show)
+ chartBoard.showItem(i);
+ else
+ chartBoard.hideItem(i);
break;
}
}
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.communicator.DeviceInfo;
import org.tizen.dynamicanalyzer.communicator.DeviceManager;
-import org.tizen.dynamicanalyzer.communicator.UnsupportedProtocolException;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.control.ApplistManager;
import org.tizen.dynamicanalyzer.handlers.CommandAction;
import org.tizen.dynamicanalyzer.handlers.ReplayManager;
import org.tizen.dynamicanalyzer.handlers.UIActionHolder;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
import org.tizen.dynamicanalyzer.nl.UserErrorWarningLabels;
import org.tizen.dynamicanalyzer.project.AppInfo;
import org.tizen.dynamicanalyzer.project.PackageInfo;
import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.setting.Feature;
-import org.tizen.dynamicanalyzer.setting.FlatFeature;
import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-import org.tizen.dynamicanalyzer.setting.TargetData;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
import org.tizen.dynamicanalyzer.ui.common.explorer.DeviceExplorerDialog;
import org.tizen.dynamicanalyzer.ui.file.FileChartView;
@Override
public void handleClickEvent(DACustomButton button) {
- if(DAState.isRunning()) {
- TargetData target = SettingDataManager.INSTANCE.getConnectedTarget();
- Set<String> targetChartList = SettingDataManager.INSTANCE.getSelectedChartSet(target
- .getTargetName());
- if(!targetChartList.contains(TimelineChartLabels.SCREENSHOT_CHART_TITLE)) {
- BaseView baseView = (BaseView) WorkbenchUtil.getViewPart(BaseView.ID);
- if(baseView.getTopComposite() instanceof TimelinePage) {
- TimelinePage timelinePage = (TimelinePage)baseView.getTopComposite();
- timelinePage.getTimelineChartView().addScreenshotChart();
- target.addSelectedFlatFeature(FlatFeature.SCREENSHOT.getName());
- }
- }
- }
-
- try {
- if (!DACommunicator.captureScreenshot().isSuccess()) {
- Logger.error("Failed to capture screenshot");
- }
- } catch (InterruptedException e) {
- Logger.warning("Interrupted during send screenshot message");
- } catch (UnsupportedProtocolException e) {
- Logger.warning("Message to capture screenshot is not supported by communicator");
- }
+ AnalyzerUtil.captureScreenshot();
}
});
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.setting.FlatFeature;
import org.tizen.dynamicanalyzer.setting.FlatPreferences;
import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
public class PreferencesDialog extends DAMessageBox {
private static boolean opened = false;
+ private static boolean screenshotFeatureEnabled = false;
private ScrolledComposite scrolledComp = null;
private Composite buttonContentsComp = null;
final private int DIALOG_HEIGT = 500;
private DACustomCombo systemRateCombo = null;
private DACustomCombo functionRateCombo = null;
private DACustomCombo screenshotRateCombo = null;
+ private Button okButton;
public PreferencesDialog(Shell parentShell) {
super(parentShell);
buttonContentsComp.setLayoutData(compData);
buttonContentsComp.setBackground(ColorResources.WHITE);
+ screenshotFeatureEnabled = SettingDataManager.INSTANCE.getSelectedFlatFeatureSet().contains(FlatFeature.SCREENSHOT);
+
drawPreferenceCom();
initComboBoxes();
setSelectedOptions();
+ // Disable configuration preferences if DAState is RUNNING
+ if (DAState.isRunning())
+ disableConfiguration();
+
opened = true;
ShortCutManager.getInstance().setEnabled(!opened);
shell.open();
// Source view
createLabel(generalView, PreferencesDialogLabels.SOURCE_VIEW, 2);
sourceviewtoggle = createToggleButton(generalView);
- sourceviewtoggle.addClickListener(new DACustomButtonClickEventListener() {
- @Override
- public void handleClickEvent(DACustomButton button) {
- MenuBar.getInstance().setSourceView(sourceviewtoggle.isToggled());
- }
- });
// System sampling rate
createLabel(generalView, PreferencesDialogLabels.SYSTEM_SAMPLIING_RATE, 2);
periodicallyToggle.addClickListener(new DACustomButtonClickEventListener() {
@Override
public void handleClickEvent(DACustomButton button) {
- screenshotRateCombo.setEnabled(periodicallyToggle.isToggled());
+ boolean toggled = periodicallyToggle.isToggled();
+ screenshotRateCombo.setEnabled(toggled);
+ if (!toggled && !onSceneTransitionToggle.isToggled())
+ onSceneTransitionToggle.setToggled(true);
}
});
// On scene transition
createLabel(screenshotView, PreferencesDialogLabels.ON_SCENE_TRANSITION, 2);
onSceneTransitionToggle = createToggleButton(screenshotView);
+ onSceneTransitionToggle.addClickListener(new DACustomButtonClickEventListener() {
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ if (!periodicallyToggle.isToggled() && !onSceneTransitionToggle.isToggled()) {
+ periodicallyToggle.setToggled(true);
+ screenshotRateCombo.setEnabled(true);
+ }
+ }
+ });
}
scrolledComp.setContent(baseCom);
}
private void drawButtonCom() {
- Button okButton = new Button(buttonContentsComp, SWT.NONE);
+ okButton = new Button(buttonContentsComp, SWT.NONE);
FormData buttonData = new FormData();
buttonData.top = new FormAttachment(0, 15);
buttonData.right = new FormAttachment(100, -15);
}
});
- Button setAsDefaultButton = new Button(buttonContentsComp, SWT.NONE);
+ Button resetToDefaultButton = new Button(buttonContentsComp, SWT.NONE);
buttonData = new FormData();
buttonData.top = new FormAttachment(0, 15);
buttonData.right = new FormAttachment(cancelButton, -8);
- buttonData.width = 100;
+ buttonData.width = 115;
buttonData.height = 30;
- setAsDefaultButton.setLayoutData(buttonData);
- setAsDefaultButton.setFont(FontResources.DIALOG_BUTTON_FONT);
- setAsDefaultButton.setText(PreferencesDialogLabels.SET_AS_DEFAULT);
- setAsDefaultButton.addSelectionListener(new SelectionListener() {
+ resetToDefaultButton.setLayoutData(buttonData);
+ resetToDefaultButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+ resetToDefaultButton.setText(PreferencesDialogLabels.RESET_TO_DEFAULT);
+ resetToDefaultButton.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent arg0) {
@Override
public void widgetSelected(SelectionEvent arg0) {
- setToDefault();
+ resetToDefault();
scrolledComp.setFocus();
}
});
value = SettingDataManager.INSTANCE.getOptionsPreferencesValue(FlatPreferences.FUNCTION_SAMPLING_RATE);
functionRateCombo.setText(String.valueOf(value));
- value = SettingDataManager.INSTANCE.getOptionsPreferencesValue(FlatPreferences.SCREENSHOT_PERIODICALLY);
- if (value != 0) {
- periodicallyToggle.setToggled(true);
- screenshotRateCombo.setEnabled(true);
- screenshotRateCombo.setText(String.valueOf(value));
+ if (screenshotFeatureEnabled) {
+ value = SettingDataManager.INSTANCE.getOptionsPreferencesValue(FlatPreferences.SCREENSHOT_PERIODICALLY);
+ boolean enabled = (value != 0);
+
+ periodicallyToggle.setToggled(enabled);
+ periodicallyToggle.setButtonEnabled(true);
+ screenshotRateCombo.setEnabled(enabled);
+ if (enabled)
+ screenshotRateCombo.setText(String.valueOf(value));
+
+ enabled = SettingDataManager.INSTANCE.isOptionsSelectedPrefereces(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION);
+ onSceneTransitionToggle.setToggled(enabled);
+ onSceneTransitionToggle.setButtonEnabled(true);
} else {
periodicallyToggle.setToggled(false);
+ periodicallyToggle.setButtonEnabled(false);
screenshotRateCombo.setEnabled(false);
- }
- // TODO handle 'On scene transition' toggle
+ onSceneTransitionToggle.setToggled(false);
+ onSceneTransitionToggle.setButtonEnabled(false);
+ }
}
- private void setToDefault() {
+ private void resetToDefault() {
int value = FlatPreferences.SOURCE_VIEW.getDefaultValue();
if (value == 1) {
sourceviewtoggle.setToggled(true);
value = FlatPreferences.FUNCTION_SAMPLING_RATE.getDefaultValue();
functionRateCombo.setText(String.valueOf(value));
- value = FlatPreferences.SCREENSHOT_PERIODICALLY.getDefaultValue();
- if (value != 0) {
- periodicallyToggle.setToggled(true);
- screenshotRateCombo.setEnabled(true);
+ if (screenshotFeatureEnabled) {
+ value = FlatPreferences.SCREENSHOT_PERIODICALLY.getDefaultValue();
- screenshotRateCombo.setText(String.valueOf(value));
- } else {
- periodicallyToggle.setToggled(false);
- screenshotRateCombo.select(0);
- screenshotRateCombo.setEnabled(false);
- }
+ boolean periodically = (value != 0);
+
+ periodicallyToggle.setToggled(periodically);
+ screenshotRateCombo.setEnabled(periodically);
+ if (periodically)
+ screenshotRateCombo.setText(String.valueOf(value));
- // TODO handle 'On scene transition' toggle
+ value = FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION.getDefaultValue();
+ onSceneTransitionToggle.setToggled(value != 0);
+ }
}
private DACustomExtendButton createFoldingButton(Composite parent, String text) {
foldingbutton.setBackground(ColorResources.DIALOG_CONTENT_BACKGROUND);
foldingbutton.setButtonFont(FontResources.DIALOG_CONTENTS_BOLD_FONT);
- RowData rowData = new RowData(100, CONTROL_HEIGHT);
+ RowData rowData = new RowData(200, CONTROL_HEIGHT);
foldingbutton.setLayoutData(rowData);
return foldingbutton;
}
private void applyPreferenceData() {
- if (sourceviewtoggle.isToggled()) {
- SettingDataManager.INSTANCE.addOptionsSelectedPreference(FlatPreferences.SOURCE_VIEW, 1);
- } else {
- SettingDataManager.INSTANCE.addOptionsSelectedPreference(FlatPreferences.SOURCE_VIEW, 0);
- }
+ boolean sourceViewEnabled = sourceviewtoggle.isToggled();
+ MenuBar.getInstance().setSourceView(sourceViewEnabled);
+ SettingDataManager.INSTANCE.addOptionsSelectedPreference(FlatPreferences.SOURCE_VIEW, sourceViewEnabled ? 1 : 0);
String ratestring = systemRateCombo.getText();
try {
return;
}
+ int rate = 0;
if (periodicallyToggle.isToggled()) {
- int rate = 1;
ratestring = screenshotRateCombo.getText();
try {
rate = Integer.parseInt(ratestring);
} catch (Exception ex) {
return;
}
- SettingDataManager.INSTANCE.addOptionsSelectedPreference(FlatPreferences.SCREENSHOT_PERIODICALLY, rate);
- } else {
- SettingDataManager.INSTANCE.addOptionsSelectedPreference(FlatPreferences.SCREENSHOT_PERIODICALLY, 0);
}
+ SettingDataManager.INSTANCE.addOptionsSelectedPreference(FlatPreferences.SCREENSHOT_PERIODICALLY, rate);
- // TODO handle 'On scene transition' toggle
+ if (onSceneTransitionToggle.isToggled())
+ SettingDataManager.INSTANCE.addOptionsSelectedPreference(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION, 1);
+ else
+ SettingDataManager.INSTANCE.deleteOptionsSelectedPreference(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION);
}
private DACustomCombo makeDACustomCombo(Composite parent, String unit) {
});
}
}
+
+ /**
+ * Disables configuration controls that have no effect during tracing.
+ */
+ private void disableConfiguration() {
+ systemRateCombo.setEnabled(false);
+ functionRateCombo.setEnabled(false);
+ periodicallyToggle.setButtonEnabled(false);
+ screenshotRateCombo.setEnabled(false);
+ onSceneTransitionToggle.setButtonEnabled(false);
+ }
}
import org.eclipse.ui.handlers.IHandlerService;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DAState;
import org.tizen.dynamicanalyzer.common.Global;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.communicator.UnsupportedProtocolException;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.project.BinaryInfo;
import org.tizen.dynamicanalyzer.project.ProcessInformation;
public static void setPlatformSDK() {
AnalyzerManager.setPlatformSDK(SettingDataManager.INSTANCE.isPlatformDA());
}
+
+ /**
+ * Captures screenshot on target and shows Screenshot chart if it is not
+ * shown yet.
+ */
+ public static void captureScreenshot() {
+ if (!DAState.isRunning())
+ return;
+
+ SettingDataManager.INSTANCE.enableScreenshotFeature(true);
+
+ try {
+ if (!DACommunicator.captureScreenshot().isSuccess()) {
+ Logger.error("Failed to capture screenshot");
+ }
+ } catch (InterruptedException ex) {
+ Logger.warning("Interrupted during send screenshot message");
+ } catch (UnsupportedProtocolException ex) {
+ Logger.warning("Message to capture screenshot is not supported by communicator");
+ }
+ }
}