public static final long SYSTEM_PROCESS_LOAD = 0x100 ;
public static final long SYSTEM_PROCESSES = 0x10 << 2 | SYSTEM_PROCESS_LOAD;
public static final long SYSTEM_THREAD_LOAD = 0x10 << 3; //0x10 << 3;
+ public static final long SYSTEM_PROCESS = 0x10 << 2;
// public static final long SYSTEM_FD = 0x100 << 1;
// public static final long SYSTEM_DISK = 0x100 << 2;
public static String FEATURE_DETAIL_VALUE_WARNING_FOR_EMPTY;
public static String FEATURE_DETAIL_VALUE_WARNING_FOR_CHARACTER;
+ public static String FEATURE_DETAIL_VALUE_WARNING_FOR_OUT_OF_RANGE;
public static String FEATURE_DETAIL_VALUE_WARNING_FOR_HAVE_TO_SET_MULTIPLE_OF_10MS_IN_SYSTEM_SAMPLING_RATE;
- public static String FEATURE_DETAIL_VALUE_WARNING_FOR_OUT_OF_RANGE_IN_SYSTEM_SAMPLING_RATE;
- public static String FEATURE_DETAIL_VALUE_WARNING_FOR_OUT_OF_RANGE_IN_FUNCTION_PROFILING_SAMPLING_RATE;
- public static String FEATURE_DETAIL_VALUE_WARNING_FOR_OUT_OF_RANGE_IN_SCREENSHOT_PERIODIC;
-
+
public static String SETTING_OPTION_TAB_DESCRIPTION;
public static String SETTING_OPTION_SHOW_INITIAL;
FEATURE_DETAIL_VALUE_WARNING_FOR_EMPTY=value is empty
FEATURE_DETAIL_VALUE_WARNING_FOR_CHARACTER=you have to set character
+FEATURE_DETAIL_VALUE_WARNING_FOR_OUT_OF_RANGE=value should be in range from minValue to maxValue
FEATURE_DETAIL_VALUE_WARNING_FOR_HAVE_TO_SET_MULTIPLE_OF_10MS_IN_SYSTEM_SAMPLING_RATE=you have to set multiple of 10ms
-FEATURE_DETAIL_VALUE_WARNING_FOR_OUT_OF_RANGE_IN_SYSTEM_SAMPLING_RATE=value should be in range from 1 to 1000
-FEATURE_DETAIL_VALUE_WARNING_FOR_OUT_OF_RANGE_IN_FUNCTION_PROFILING_SAMPLING_RATE=value should be in range from 1 to 1000
-FEATURE_DETAIL_VALUE_WARNING_FOR_OUT_OF_RANGE_IN_SCREENSHOT_PERIODIC=value should be in range from 1 to 100
-
SETTING_OPTION_SHOW_INITIAL=Use this as the default and do not ask again.
SETTING_OPTION_AUTO_STOP=Auto-stop while replaying
\ No newline at end of file
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
public class FeatureData {
public static final int FEATURE_TYPE_SUB = 1;
public static final int FEATURE_TYPE_DETAIL = 2;
+ public static final int FEATURE_VAILD_VALUE = 0;
+ public static final int FEATURE_INVAILD_VALUE_EMPTY = -1;
+ public static final int FEATURE_INVAILD_VALUE_CHARACTER = -2;
+ public static final int FEATURE_INVAILD_VALUE_RANGE = -3;
+ public static final int FEATURE_INVALID_VALUE_RISE_RANGE = -4;
+
+ public static final String MIN_VALUE = "minValue";
+ public static final String MAX_VALUE = "maxValue";
+
private String targetName = null;
private String featureName = null;
private int minValue = 0;
private int maxValue = 0;
private int defaultValue = 0;
- private long swapValue = AnalyzerConstants.FEATURE_OFF; // 0x0000
+ private long swapLowValue = AnalyzerConstants.FEATURE_OFF; // 0x0000
+ private long swapHighValue = AnalyzerConstants.FEATURE_OFF; // 0x0000
private long overheadValue = AnalyzerConstants.FEATURE_OFF; // 0x0000
public FeatureData(String targetName, String featureName) {
}
public void setMinValue(String minValue) {
- if (isValidValue(minValue)) {
+ if (!isEmpty(minValue)) {
this.minValue = Integer.parseInt(minValue);
}
}
}
public void setMaxValue(String maxValue) {
- if (isValidValue(maxValue)) {
+ if (!isEmpty(maxValue)) {
this.maxValue = Integer.parseInt(maxValue);
}
}
}
public void setDefaultValue(String defaultValue) {
- if (isValidValue(defaultValue)) {
+ if (!isEmpty(defaultValue)) {
this.defaultValue = Integer.parseInt(defaultValue);
}
}
- public long getSwapValue() {
- return swapValue;
+ public long getSwapLowValue() {
+ return swapLowValue;
+ }
+
+ public void setSwapLowValue(String swapLowValue) {
+ if (!isEmpty(swapLowValue)) {
+ this.swapLowValue = Long.parseLong(swapLowValue);
+ }
+ }
+
+ public long getSwapHighValue() {
+ return swapHighValue;
}
- public void setSwapValue(String swapValue) {
- if (isValidValue(swapValue)) {
- this.swapValue = Long.parseLong(swapValue);
+ public void setSwapHighValue(String swapHighValue) {
+ if (!isEmpty(swapHighValue)) {
+ this.swapHighValue = Long.parseLong(swapHighValue);
}
}
}
public void setOverheadValue(String overheadValue) {
- if (isValidValue(overheadValue)) {
+ if (!isEmpty(overheadValue)) {
this.overheadValue = Long.parseLong(overheadValue);
}
}
} // else : do nothing
}
- private boolean isValidValue(String value) {
+ private boolean isEmpty(String value) {
if ((null != value) && (CommonConstants.EMPTY.equals(value) == false)) {
- return true;
+ return false;
+ }
+ return true;
+ }
+
+ public int checkValidInputValue(String value) {
+ // check empty
+ if (isEmpty(value)) {
+ return FEATURE_INVAILD_VALUE_EMPTY;
+ }
+
+ // check character
+ if (!AnalyzerUtil.isInteger(value)) {
+ return FEATURE_INVAILD_VALUE_CHARACTER;
+ }
+
+ // check range
+ int iValue = Integer.parseInt(value);
+ if (iValue < minValue || maxValue < iValue) {
+ return FEATURE_INVAILD_VALUE_RANGE;
+ }
+
+ // check rise range : system information
+ if (featureName.equals(ConfigureLabels.FEATURE_DETAIL_VALUE_SYSTEM_SAMPLING_RATE)
+ && (iValue % 10 != 0)) {
+ return FEATURE_INVALID_VALUE_RISE_RANGE;
+ }
+
+ return FEATURE_VAILD_VALUE;
+ }
+
+ public String getValueWarningMessage(int errorCode) {
+ String ret = CommonConstants.EMPTY;
+
+ switch(errorCode) {
+ case FEATURE_INVAILD_VALUE_EMPTY:
+ ret = ConfigureLabels.FEATURE_DETAIL_VALUE_WARNING_FOR_EMPTY;
+ break;
+ case FEATURE_INVAILD_VALUE_CHARACTER:
+ ret = ConfigureLabels.FEATURE_DETAIL_VALUE_WARNING_FOR_CHARACTER;
+ break;
+ case FEATURE_INVAILD_VALUE_RANGE:
+ ret = ConfigureLabels.FEATURE_DETAIL_VALUE_WARNING_FOR_OUT_OF_RANGE
+ .replace(MIN_VALUE, String.valueOf(minValue));
+ ret = ret.replace(MAX_VALUE, String.valueOf(maxValue));
+ break;
+ case FEATURE_INVALID_VALUE_RISE_RANGE:
+ ret = ConfigureLabels.FEATURE_DETAIL_VALUE_WARNING_FOR_HAVE_TO_SET_MULTIPLE_OF_10MS_IN_SYSTEM_SAMPLING_RATE;
+ break;
+ default:
+ break;
}
- return false;
+ return ret;
}
}
} else {
optionColumn.append(CommonConstants.EMPTY);
}
-
-
// check parent feature : , parent_feature_name_xxx
if ((feature.getParentName() != null) &&
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.widgets.button.radio.DARadioButton;
import org.tizen.dynamicanalyzer.widgets.button.radio.DARadioGroup;
import org.tizen.dynamicanalyzer.widgets.button.radio.DARadioSelectionListener;
}
private void checkRunningState() {
- if (DACommunicator.isRunning()) {
- if (null != detailSystemComposit) {
- detailSystemComposit.setEnabled(false);
+ if (DACommunicator.isRunning()) {
+ if (null != systemTextBox) {
+ systemTextBox.getControl().setEnabled(false);
}
- if (null != detailSamplingComposit) {
- detailSamplingComposit.setEnabled(false);
+
+ if (null != samplingTextBox) {
+ samplingTextBox.getControl().setEnabled(false);
+ }
+
+ if (null != auto) {
+ auto.setEnabled(false);
}
- if (null != detailScreenShotComposit) {
- detailScreenShotComposit.setEnabled(false);
+ if (null != period) {
+ period.setEnabled(false);
+ }
+
+ if (null != screenShotTextBox) {
+ screenShotTextBox.getControl().setEnabled(false);
}
}
}
return null;
}
- // TODO:refactoring about the legacy code.
private boolean checkValidInputText(String featuresName, DAText textBox, Label info) {
- if (textBox.getText().isEmpty()) {
- info.setText(ConfigureLabels.FEATURE_DETAIL_VALUE_WARNING_FOR_EMPTY);
+ TargetData target = SettingDataManager.getInstance().getTarget(null);
+ FeatureData feature = target.getAvailableFeature(featuresName);
+ int errorCode = feature.checkValidInputValue(textBox.getText());
+ if (errorCode != FeatureData.FEATURE_VAILD_VALUE) {
+ info.setText(feature.getValueWarningMessage(errorCode));
return false;
- } else if (!AnalyzerUtil.isInteger(textBox.getText())) {
- info.setText(ConfigureLabels.FEATURE_DETAIL_VALUE_WARNING_FOR_CHARACTER);
- return false;
- }
- int value = Integer.parseInt(textBox.getText());
- if (featuresName.equals(ConfigureLabels.FEATURE_DETAIL_VALUE_SYSTEM_SAMPLING_RATE)
- || featuresName.equals(ConfigureLabels.FEATURE_DETAIL_VALUE_FUNCTION_PROFILING_SAMPLING_RATE)) {
- if (value < 0 || 1000 < value) {
- info.setText(ConfigureLabels.FEATURE_DETAIL_VALUE_WARNING_FOR_OUT_OF_RANGE_IN_SYSTEM_SAMPLING_RATE);
- return false;
- }
- }
-
- if (featuresName.equals(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY)) {
- if (value < 0 || 100 < value) {
- info.setText(ConfigureLabels.FEATURE_DETAIL_VALUE_WARNING_FOR_OUT_OF_RANGE_IN_SCREENSHOT_PERIODIC);
- return false;
- }
- }
-
- if (featuresName.equals(ConfigureLabels.FEATURE_DETAIL_VALUE_SYSTEM_SAMPLING_RATE)) {
- if (value % 10 != 0) {
- info.setText(ConfigureLabels.FEATURE_DETAIL_VALUE_WARNING_FOR_HAVE_TO_SET_MULTIPLE_OF_10MS_IN_SYSTEM_SAMPLING_RATE);
- return false;
- }
+ } else {
+ info.setText(CommonConstants.EMPTY);
+ return true;
}
-
- info.setText(CommonConstants.EMPTY);
- return true;
}
private String getOptionText(GridItem item, String optionName) {
public static final String TEMPLATE_FILE_NAME = "template";
// key name in setting file
+ public static final String KEY_VERSION="Version";
+ public static final String KEY_DEFAULT_CHART_LIST = "Default Chart List";
+ public static final String KEY_DEFAULT_SWAP_VALUE = "Default Swap Value";
public static final String KEY_TARGET_LIST = "Target List";
public static final String KEY_SELECTED_TARGET = "Selected Target";
public static final String KEY_SELECTED_TEMPLATE = "Selected Template";
public static final String KEY_AVAILABLE_CHART_LIST = "Available Chart List";
public static final String KEY_SELECTED_CHART_LIST = "Selected Chart List";
public static final String KEY_SHOW_INITIAL = "Show Initial";
- public static final String AUTO_STOP = "Auto Stop";
+ public static final String KEY_AUTO_STOP = "Auto Stop";
public boolean existSettingFile = true;
private boolean initAutoStop = false;
// setting information
+ private double version = 0;
+ private List<String> defaultChartList = null;
+ private long defaultLowSwapValue = AnalyzerConstants.FEATURE_OFF;
+ private long defaultHighSwapValue = AnalyzerConstants.FEATURE_OFF;
+
private String selectedTarget = null;
private List<String> selectedChartList = null; // TODO : remove?
private boolean showInitial = false;
} else if (list[0].equals(KEY_SHOW_INITIAL)) {
showInitial = Boolean.parseBoolean(list[1]);
initShowInitial = Boolean.parseBoolean(list[1]);
- } else if (list[0].equals(AUTO_STOP)) {
+ } else if (list[0].equals(KEY_AUTO_STOP)) {
autoStop = Boolean.parseBoolean(list[1]);
initAutoStop = Boolean.parseBoolean(list[1]);
+ } else if (list[0].equals(KEY_VERSION)) {
+ version = Double.parseDouble(list[1]);
+ } else if (list[0].equals(KEY_DEFAULT_CHART_LIST)) {
+ makeChartList(getDefaultChartList(), list);
+ } else if (list[0].equals(KEY_DEFAULT_SWAP_VALUE)) {
+ if ((list[1] != null) && (list[1].isEmpty() == false)) {
+ defaultLowSwapValue = Long.parseLong(list[1]);
+ }
+ if ((list[2] != null) && (list[2].isEmpty() == false)) {
+ defaultHighSwapValue = Long.parseLong(list[2]);
+ }
} else {
if (null != list[0]) {
Logger.debug("unknown setting key : " + list[0]);
buffWriter = new BufferedWriter(fileWriter);
printWriter = new PrintWriter(buffWriter);
+ printWriter.println(KEY_VERSION + WRITE_CSV_SEPARATOR + version);
printWriter.println(writeTargetData());
printWriter.println(KEY_SELECTED_TARGET + WRITE_CSV_SEPARATOR + selectedTarget);
printWriter.println(writeChartList(getSelectedChartList(), KEY_SELECTED_CHART_LIST));
printWriter.println(KEY_SHOW_INITIAL + WRITE_CSV_SEPARATOR
+ String.valueOf(showInitial));
- printWriter.println(AUTO_STOP + WRITE_CSV_SEPARATOR + String.valueOf(autoStop));
+ printWriter.println(KEY_AUTO_STOP + WRITE_CSV_SEPARATOR + String.valueOf(autoStop));
+ printWriter.println(writeChartList(getDefaultChartList(), KEY_DEFAULT_CHART_LIST));
+ printWriter.println(KEY_DEFAULT_SWAP_VALUE + WRITE_CSV_SEPARATOR + String.valueOf(defaultLowSwapValue)
+ + WRITE_CSV_SEPARATOR + String.valueOf(defaultHighSwapValue));
+
// target : selected Template, selected feature, available chart list
Map<String, TargetData> map = getTargetListMap();
this.autoStop = autoStop;
}
+ public List<String> getDefaultChartList() {
+ if (defaultChartList == null) {
+ defaultChartList = new ArrayList<String>();
+ }
+ return defaultChartList;
+ }
+
public List<String> getSelectedChartList() {
if (selectedChartList == null) {
selectedChartList = new ArrayList<String>();
writeSettingDataToFile();
}
- public long getSelectedFeatureSwapValue() {
- long state = 0;
- TargetData target = SettingDataManager.getInstance().getTarget(null);
- List<FeatureValueData> featureList = target.getSelectedFeatureList();
-
- for (int i = 0; i < featureList.size(); i++) {
- state |= target.getSelectedFeatureSwapValue(featureList.get(i).getFeatureName());
- }
- return state;
- }
-
public long getConfiguration(DeviceInfo devInfo) {
TargetData target = SettingDataManager.getInstance().getConnectedTarget();
- long state = 0;
-
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_FUNCTION_PROFILING);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_FUNCTION_SAMPLING);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_MEMORY_ALLOCATION);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_FILE);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_THREAD);
+ long state = defaultLowSwapValue; // set default swap value
- if (target.isSelectedFeature(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY) == false) {
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_SCREENSHOT);
- }
-
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_USER_EVENT);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_RECORDING);
-
- if (DACommunicator.isSWAPVersion(devInfo)) {
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_SYSTEM_CALL_IPC);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_SYSTEM_CALL_PROCESS);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_SYSTEM_CALL_SIGNAL);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_SYSTEM_CALL_NETWORK);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_SYSTEM_CALL_DESC);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_CONTEXT_SWITCH);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_NETWORK);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_OPENGL);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_INSIDE_THE_PLATFORM_MEMORY);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_INSIDE_THE_PLATFORM_THREAD);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_INSIDE_THE_PLATFORM_FILE);
-
- if ((target.isSelectedFeature(ConfigureLabels.FEATURE_NAME_FILE)
- || (target.isSelectedFeature(ConfigureLabels.FEATURE_NAME_SYSTEM_CALL_FILE)))) {
- state |= AnalyzerConstants.FEATURE_SYSCALL_FILE;
- }
+ // set selected swap value
+ List<FeatureValueData> featureList = target.getSelectedFeatureList();
+ for (int i = 0; i < featureList.size(); i++) {
+ if (ConfigureLabels.FEATURE_NAME_SCREENSHOT.equals(featureList.get(i).getFeatureName())
+ && target.isSelectedFeature(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY)) {
+ continue;
+ } else {
+ state |= target.getSelectedFeatureSwapValue(featureList.get(i).getFeatureName(), true);
+ }
}
return state;
}
public long getPreConfiguration(DeviceInfo devInfo) {
TargetData target = SettingDataManager.getInstance().getConnectedTarget();
- long state = 0;
- if (DACommunicator.isSWAPVersion(devInfo)) {
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_INSIDE_THE_PLATFORM_NETWORK);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_INSIDE_THE_PLATFORM_OPENGL);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_SYSTEM_CPU);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_SYSTEM_PROCESSES);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_SYSTEM_MEMORY);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_SYSTEM_DISK);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_SYSTEM_NETWORK);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_SYSTEM_DEVICE);
- state |= target.getSelectedFeatureSwapValue(ConfigureLabels.FEATURE_NAME_SYSTEM_ENERGY);
-
- if (target.isSelectedFeature(ConfigureLabels.FEATURE_NAME_THREAD)) {
- state |= AnalyzerConstants.SYSTEM_THREAD_LOAD;
- }
+ long state = defaultHighSwapValue; // set default swap value
+
+ // set default swap value
+ List<FeatureValueData> featureList = target.getSelectedFeatureList();
+ for (int i = 0; i < featureList.size(); i++) {
+ state |= target.getSelectedFeatureSwapValue(featureList.get(i).getFeatureName(), false);
}
return state;
}
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.events.ShellListener;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
private static boolean opened = false;
private DACustomButton okButton = null;
private DACustomButton cancelButton = null;
+ private boolean isApply = false;
// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)
// private DACustomButton applyButton = null;
@Override
public void handleClickEvent(DACustomButton button) {
+ isApply = true;
doApply();
doRun();
shell.close(); // close dialog
@Override
public void handleClickEvent(DACustomButton button) {
+ isApply = true;
doRevert();
doRun();
shell.close(); // close dialog
private void doRevert() {
Composite selectedComposite = tabView.getTopComposite();
if (!(selectedComposite instanceof SettingDialogBinarySettingsPage)) {
- // rollback setting data
- SettingDataManager.getInstance().revertSettingData();
+ if (DACommunicator.isRunning() == false) {
+ // rollback setting data
+ SettingDataManager.getInstance().revertSettingData();
// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)
-// // update template view
-// templatesPage.createTemplateTitleComposite();
-// templatesPage.createTemplateDescriptionComposite();
-// templatesPage.createTargetComposite();
+// // update template view
+// templatesPage.createTemplateTitleComposite();
+// templatesPage.createTemplateDescriptionComposite();
+// templatesPage.createTargetComposite();
+ }
}
}
opened = false;
ShortCutManager.getInstance().setEnabled(!opened);
}
+
+
});
+
opened = true;
ShortCutManager.getInstance().setEnabled(!opened);
+ shell.addShellListener(shellListener);
shell.open();
return true;
}
// }
// }
+ private ShellListener shellListener = new ShellListener() {
+
+ @Override
+ public void shellActivated(ShellEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void shellClosed(ShellEvent e) {
+ // TODO Auto-generated method stub
+ if (!isApply) {
+ doRevert();
+ doRun();
+ }
+ }
+
+ @Override
+ public void shellDeactivated(ShellEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void shellDeiconified(ShellEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void shellIconified(ShellEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ };
}
package org.tizen.dynamicanalyzer.ui.toolbar.setting;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import java.util.Set;
* update chart list
*/
public void updateChartList() {
+ Set<String> selectedChartList = new HashSet<String>();
+
+ // set default chart list
+ List<String> defaultChartList = SettingDataManager.getInstance().getDefaultChartList();
+ if (defaultChartList.size() > 0) {
+ selectedChartList.addAll(defaultChartList);
+ }
+
+ // set selected chart list
TargetData target = SettingDataManager.getInstance().getConnectedTarget();
- Set<String> selectedChartList = target.getSelectedChartList();
+ selectedChartList.addAll(target.getSelectedChartList());
+
+ // update chart list in timeline page
TimelineChartManager.getInstance().loadSelectedChartList(selectedChartList);
// TODO : selectedChartList remove?
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
import org.tizen.dynamicanalyzer.nl.WidgetLabels;
}
});
}
+
// label
targetLabel = new Label(targetComp, SWT.TRANSPARENT);
FormData data = new FormData();
}
}
targetComp.layout(true);
+
+ if (DACommunicator.isRunning()) {
+ targetComp.setEnabled(false);
+ }
}
public void createTemplateDescriptionComposite() {
}
templateComp.layout(true);
+
+ if (DACommunicator.isRunning()) {
+ templateComp.setEnabled(false);
+ }
}
}
\ No newline at end of file
public static final int FEATURE_KEY_MIN_VALUE = 7;
public static final int FEATURE_KEY_MAX_VALUE = 8;
public static final int FEATURE_KEY_DEFAULT_VALUE = 9;
- public static final int FEATURE_KEY_SWAP_VALUE = 10;
- public static final int FEATURE_KEY_OVERHEAD_VALUE = 11;
+ public static final int FEATURE_KEY_SWAP_LOW_VALUE = 10;
+ public static final int FEATURE_KEY_SWAP_HIGH_VALUE = 11;
+ public static final int FEATURE_KEY_OVERHEAD_VALUE = 12;
// template key index
public static final int TEMPLATE_KEY_TARGET_NAME = 0;
* Get the swap value of the selected feature.
*
* @param featureName featureName
+ * @param isLow swap low or high value
*
* @return feature swap value (If the feature is not selected, returns 0x0000.)
*/
- public long getSelectedFeatureSwapValue(String featureName) {
+ public long getSelectedFeatureSwapValue(String featureName, boolean isLow) {
if (isSelectedFeature(featureName) == true) {
Map<String, FeatureData> map = getAvailableFeatureListMap();
FeatureData feature = map.get(featureName);
- return feature.getSwapValue();
+ if (isLow) {
+ return feature.getSwapLowValue();
+ } else {
+ return feature.getSwapHighValue();
+ }
}
return AnalyzerConstants.FEATURE_OFF;
}
feature.setMinValue(list[FEATURE_KEY_MIN_VALUE]);
feature.setMaxValue(list[FEATURE_KEY_MAX_VALUE]);
feature.setDefaultValue(list[FEATURE_KEY_DEFAULT_VALUE]);
- feature.setSwapValue(list[FEATURE_KEY_SWAP_VALUE]);
+ feature.setSwapLowValue(list[FEATURE_KEY_SWAP_LOW_VALUE]);
+ feature.setSwapHighValue(list[FEATURE_KEY_SWAP_HIGH_VALUE]);;
feature.setOverheadValue(list[FEATURE_KEY_OVERHEAD_VALUE]);
}
} // else : feature is check status
// validation : available feature
- if (isAvailableFeature(valueList[0]) == true) {
+// if (isAvailableFeature(valueList[0]) == true) {
featureList.add(feature);
- } // else : invalid feature
+// } // else : invalid feature
}
// init Feature list
private DACustomButton okButton = null;
private DACustomButton cancelButton = null;
+ private boolean isApply = false;
// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)
// private DACustomButton applyButton = null;
@Override
public void handleClickEvent(DACustomButton button) {
+ isApply = true;
doApply();
doRun();
shell.close(); // close dialog
@Override
public void handleClickEvent(DACustomButton button) {
+ isApply = true;
doRevert();
doRun();
shell.close(); // close dialog
}
private void doRevert() {
- // rollback setting data
- SettingDataManager.getInstance().revertSettingData();
+ if (DACommunicator.isRunning() == false) {
+ // rollback setting data
+ SettingDataManager.getInstance().revertSettingData();
// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)
-// // update template view
-// templatesPage.createTemplateTitleComposite();
-// templatesPage.createTemplateDescriptionComposite();
-// templatesPage.createTargetComposite();
+// // update template view
+// templatesPage.createTemplateTitleComposite();
+// templatesPage.createTemplateDescriptionComposite();
+// templatesPage.createTargetComposite();
+ }
}
private void doRun() {
@Override
public void shellClosed(ShellEvent e) {
// TODO Auto-generated method stub
+ if (!isApply) {
+ doRevert();
+ doRun();
+ }
notifyAutoRun();
}