Setting : diable System CPU feature in feature dialog 05/28105/3
authorheeyoung <heeyoung1008.hwang@samsung.com>
Fri, 26 Sep 2014 07:20:24 +0000 (16:20 +0900)
committerheeyoung <heeyoung1008.hwang@samsung.com>
Fri, 26 Sep 2014 09:57:24 +0000 (18:57 +0900)
Change-Id: I5f75503a7945d16463f047caf8162fc067d802ee
Signed-off-by: heeyoung <heeyoung1008.hwang@samsung.com>
12 files changed:
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerConstants.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ConfigureLabels.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ConfigureLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FeatureData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FeatureDialogFeaturesTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FeatureDialogFeaturesTreeTableToggleRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialogManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialogTemplatePage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/TargetData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/WelcomeDialog.java

index 32f0052..090c071 100644 (file)
@@ -178,6 +178,7 @@ public class AnalyzerConstants {
        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;
index 183dede..b105134 100644 (file)
@@ -124,11 +124,9 @@ public class ConfigureLabels extends NLS {
 
        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;
index 71b6706..23151ed 100644 (file)
@@ -158,10 +158,7 @@ FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY=periodically
 
 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
index 735c724..5d24c38 100644 (file)
@@ -30,6 +30,8 @@ import java.util.List;
 
 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 {
 
@@ -37,6 +39,15 @@ 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;
@@ -49,7 +60,8 @@ public class FeatureData {
        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) {
@@ -102,7 +114,7 @@ public class FeatureData {
        }
 
        public void setMinValue(String minValue) {
-               if (isValidValue(minValue)) {
+               if (!isEmpty(minValue)) {
                        this.minValue = Integer.parseInt(minValue);
                }
        }
@@ -112,7 +124,7 @@ public class FeatureData {
        }
 
        public void setMaxValue(String maxValue) {
-               if (isValidValue(maxValue)) {
+               if (!isEmpty(maxValue)) {
                        this.maxValue = Integer.parseInt(maxValue);
                }
        }
@@ -122,18 +134,28 @@ public class FeatureData {
        }
 
        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);
                }
        }
 
@@ -142,7 +164,7 @@ public class FeatureData {
        }
 
        public void setOverheadValue(String overheadValue) {
-               if (isValidValue(overheadValue)) {
+               if (!isEmpty(overheadValue)) {
                        this.overheadValue = Long.parseLong(overheadValue);
                }
        }
@@ -193,10 +215,60 @@ public class FeatureData {
                } // 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;
        }
 }
index 294dcbc..226506c 100644 (file)
@@ -109,8 +109,6 @@ public class FeatureDialogFeaturesTable extends DATreeComposite {
                } else {
                        optionColumn.append(CommonConstants.EMPTY);
                }
-               
-
 
                // check parent feature : , parent_feature_name_xxx
                if ((feature.getParentName() != null) && 
index a4a89a0..b18e5b5 100644 (file)
@@ -51,7 +51,6 @@ import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
 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;
@@ -472,16 +471,25 @@ public class FeatureDialogFeaturesTreeTableToggleRenderer extends AbstractRender
        }
        
        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);
                        }
                }
        }
@@ -512,40 +520,17 @@ public class FeatureDialogFeaturesTreeTableToggleRenderer extends AbstractRender
                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) {
index 665e53d..8c542b1 100644 (file)
@@ -63,6 +63,9 @@ public class SettingDataManager {
        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";
@@ -70,7 +73,7 @@ public class SettingDataManager {
        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;
 
@@ -80,6 +83,11 @@ public class SettingDataManager {
        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;
@@ -154,9 +162,20 @@ public class SettingDataManager {
                } 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]);
@@ -239,12 +258,17 @@ public class SettingDataManager {
                        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();
@@ -312,6 +336,13 @@ public class SettingDataManager {
                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>();
@@ -521,72 +552,31 @@ public class SettingDataManager {
                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;
        }
index 34d8a28..871e144 100644 (file)
@@ -30,6 +30,8 @@ import org.eclipse.swt.events.DisposeEvent;
 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;
@@ -54,6 +56,7 @@ public class SettingDialog extends DAMessageBox {
        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;
@@ -74,6 +77,7 @@ public class SettingDialog extends DAMessageBox {
 
                @Override
                public void handleClickEvent(DACustomButton button) {
+                       isApply = true;
                        doApply();
                        doRun();
                        shell.close();  // close dialog
@@ -84,6 +88,7 @@ public class SettingDialog extends DAMessageBox {
 
                @Override
                public void handleClickEvent(DACustomButton button) {
+                       isApply = true;
                        doRevert();
                        doRun();
                        shell.close();  // close dialog
@@ -141,14 +146,16 @@ public class SettingDialog extends DAMessageBox {
        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();
+                       }
                }
        }
 
@@ -357,10 +364,14 @@ public class SettingDialog extends DAMessageBox {
                                opened = false;
                                ShortCutManager.getInstance().setEnabled(!opened);
                        }
+                       
+                       
                });             
+               
                opened = true;
                ShortCutManager.getInstance().setEnabled(!opened);
                
+               shell.addShellListener(shellListener);
                shell.open();
                return true;
        }
@@ -380,4 +391,40 @@ public class SettingDialog extends DAMessageBox {
 //             }
 //     }
 
+       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
+
+               }
+
+       };
 }
index ea6d5af..468b489 100644 (file)
@@ -26,6 +26,7 @@
 package org.tizen.dynamicanalyzer.ui.toolbar.setting;
 
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
@@ -313,8 +314,19 @@ public class SettingDialogManager {
         * 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?
index 6103ee5..4330a8c 100644 (file)
@@ -43,6 +43,7 @@ import org.eclipse.swt.widgets.Event;
 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;
@@ -266,6 +267,7 @@ public class SettingDialogTemplatePage extends DAPageComposite {
                                }
                        });
                }
+               
                // label
                targetLabel = new Label(targetComp, SWT.TRANSPARENT);
                FormData data = new FormData();
@@ -358,6 +360,10 @@ public class SettingDialogTemplatePage extends DAPageComposite {
                        }
                }               
                targetComp.layout(true);
+               
+               if (DACommunicator.isRunning()) {
+                       targetComp.setEnabled(false);
+               }
        }
        
        public void createTemplateDescriptionComposite() {
@@ -596,5 +602,9 @@ public class SettingDialogTemplatePage extends DAPageComposite {
                }
                
                templateComp.layout(true);
+               
+               if (DACommunicator.isRunning()) {
+                       templateComp.setEnabled(false);
+               }
        }
 }
\ No newline at end of file
index a4efcbd..0e7df56 100644 (file)
@@ -53,8 +53,9 @@ public class TargetData {
        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;
@@ -289,14 +290,19 @@ public class TargetData {
         * 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;
        }
@@ -359,7 +365,8 @@ public class TargetData {
                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]);             
        }
        
@@ -381,9 +388,9 @@ public class TargetData {
                        } // 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
index 92fae82..182b304 100644 (file)
@@ -57,6 +57,7 @@ public class WelcomeDialog extends DAMessageBox {
        
        private DACustomButton okButton = null;
        private DACustomButton cancelButton = null;
+       private boolean isApply = false;
        
 // HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)    
 //     private DACustomButton applyButton = null;
@@ -75,6 +76,7 @@ public class WelcomeDialog extends DAMessageBox {
 
                @Override
                public void handleClickEvent(DACustomButton button) {
+                       isApply = true;
                        doApply();
                        doRun();
                        shell.close();  // close dialog
@@ -85,6 +87,7 @@ public class WelcomeDialog extends DAMessageBox {
 
                @Override
                public void handleClickEvent(DACustomButton button) {
+                       isApply = true;
                        doRevert();
                        doRun();
                        shell.close();  // close dialog
@@ -132,14 +135,16 @@ public class WelcomeDialog extends DAMessageBox {
        }
 
        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() {
@@ -362,6 +367,10 @@ public class WelcomeDialog extends DAMessageBox {
                @Override
                public void shellClosed(ShellEvent e) {
                        // TODO Auto-generated method stub
+                       if (!isApply) {
+                               doRevert();
+                               doRun();
+                       }
                        notifyAutoRun();
                }