no message
This commit is contained in:
5
.idea/workspace.xml
generated
5
.idea/workspace.xml
generated
@@ -8,10 +8,9 @@
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/SapforProfileSetting/UI/SapforProfileSettingsForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/SapforProfileSetting/UI/SapforProfileSettingsForm.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/ApplyProfile.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/ApplyProfile.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/GlobalDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/GlobalDatabase.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/SapforProperties.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/SapforProperties.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/ProjectMenuBar/ProjectSettingsMenu.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/ProjectMenuBar/ProjectSettingsMenu.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
||||
@@ -111,35 +111,23 @@ public class GlobalDatabase extends VisualiserDatabase {
|
||||
}
|
||||
}
|
||||
//--
|
||||
|
||||
public LinkedHashMap<String, String> getSapforSettingsForProfile() {
|
||||
/*
|
||||
LinkedHashMap<SettingName, String> res = new LinkedHashMap<>();
|
||||
for (DBSetting setting : settings.getSettingsByOwner(ComponentType.SapforOptions))
|
||||
if (setting.Visible)
|
||||
res.put(setting.Name, setting.Value);
|
||||
*/
|
||||
return null;
|
||||
}
|
||||
//проверить, есть ли профиль с таким же набором настроек.
|
||||
public SapforProfile checkProfileForCurrentSettings() {
|
||||
/*
|
||||
LinkedHashMap<SettingName, String> current_values = getSapforSettingsForProfile();
|
||||
|
||||
LinkedHashMap<String, String> current_values = Global.mainModule.getProject().sapforProperties.toMap();
|
||||
for (SapforProfile profile : sapforProfiles.Data.values()) {
|
||||
//--получить все настройки профиля
|
||||
LinkedHashMap<SettingName, String> profileValues = new LinkedHashMap<>();
|
||||
LinkedHashMap<String, String> profileValues = new LinkedHashMap<>();
|
||||
for (SapforProfileSetting setting : sapforProfilesSettings.Data.values())
|
||||
if (setting.sapforprofile_id == profile.id) profileValues.put(setting.name, setting.value);
|
||||
//--
|
||||
if (current_values.equals(profileValues)) return profile;
|
||||
}
|
||||
*/
|
||||
return null;
|
||||
}
|
||||
public void insertProfileSettings(SapforProfile profile) throws Exception {
|
||||
/*
|
||||
LinkedHashMap<SettingName, String> current_values = getSapforSettingsForProfile();
|
||||
for (SettingName name : current_values.keySet()) {
|
||||
LinkedHashMap<String, String> current_values = Global.mainModule.getProject().sapforProperties.toMap();
|
||||
for (String name : current_values.keySet()) {
|
||||
//--
|
||||
SapforProfileSetting sapforProfileSetting = new SapforProfileSetting();
|
||||
sapforProfileSetting.name = name;
|
||||
@@ -148,7 +136,6 @@ public class GlobalDatabase extends VisualiserDatabase {
|
||||
//--
|
||||
Insert(sapforProfileSetting);
|
||||
}
|
||||
*/
|
||||
}
|
||||
public void saveCurrentProfile(String name_in) throws Exception {
|
||||
if (checkProfileForCurrentSettings() == null) {
|
||||
|
||||
@@ -12,22 +12,14 @@ import com.google.gson.annotations.Expose;
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class SapforProperties extends Properties {
|
||||
//побочные настройки визулизатора
|
||||
@Expose
|
||||
public boolean Precompilation = true;
|
||||
@Expose
|
||||
public boolean SaveModifications = true; // сохранять исходную версию
|
||||
@Expose
|
||||
public int GCOVLimit = 10;
|
||||
@Expose
|
||||
public String DVMConvertationOptions = " ";
|
||||
//настройки для компонента SAPFOR
|
||||
@Expose
|
||||
public boolean STATIC_SHADOW_ANALYSIS = false;
|
||||
@Expose
|
||||
public boolean STATIC_PRIVATE_ANALYSIS = true;
|
||||
public boolean STATIC_PRIVATE_ANALYSIS = true;//выключено
|
||||
@Expose
|
||||
public boolean FREE_FORM = false;
|
||||
@Expose
|
||||
@@ -35,7 +27,7 @@ public class SapforProperties extends Properties {
|
||||
@Expose
|
||||
public boolean KEEP_SPF_DIRECTIVES = false;
|
||||
@Expose
|
||||
public boolean PARALLELIZE_FREE_LOOPS = false;
|
||||
public boolean PARALLELIZE_FREE_LOOPS = false; //выключено
|
||||
@Expose
|
||||
public int MAX_SHADOW_WIDTH = 50;
|
||||
@Expose
|
||||
@@ -57,7 +49,16 @@ public class SapforProperties extends Properties {
|
||||
@Expose
|
||||
public boolean KEEP_SPF_DIRECTIVES_AMONG_TRANSFORMATIONS = false;
|
||||
@Expose
|
||||
public boolean PARSE_FOR_INLINE = false;
|
||||
public boolean PARSE_FOR_INLINE = false; //не видимая
|
||||
//побочные настройки визулизатора
|
||||
@Expose
|
||||
public boolean Precompilation = true;
|
||||
@Expose
|
||||
public boolean SaveModifications = true; // сохранять исходную версию
|
||||
@Expose
|
||||
public int GCOVLimit = 10;
|
||||
@Expose
|
||||
public String DVMConvertationOptions = " ";
|
||||
public String pack() {
|
||||
Vector<String> res = new Vector_<String>(
|
||||
STATIC_SHADOW_ANALYSIS ? "1" : "0",
|
||||
@@ -166,31 +167,29 @@ public class SapforProperties extends Properties {
|
||||
public boolean controlAction(String fieldName, JMenuItem control) {
|
||||
return (Global.mainModule.getPass(PassCode.UpdateSapforProperty).Do(fieldName));
|
||||
}
|
||||
public String getSummary(){
|
||||
public String getSummary() {
|
||||
Vector<String> res = new Vector<>();
|
||||
for (Field field: this.getClass().getFields()){
|
||||
for (Field field : this.getClass().getFields()) {
|
||||
try {
|
||||
res.add(getFieldDescription(field.getName()) + "=" + field.get(this));
|
||||
}
|
||||
catch (Exception ex){
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
return String.join("\n", res);
|
||||
}
|
||||
public void applyPatch(VisualiserSettingsJson settings){
|
||||
public void applyPatch(VisualiserSettingsJson settings) {
|
||||
Vector<String> changedFields = new Vector<>();
|
||||
try {
|
||||
for (VisualiserSettingJson setting : settings.array) {
|
||||
System.out.println(setting.name+"="+ Utils_.Brackets(setting.value));
|
||||
System.out.println(setting.name + "=" + Utils_.Brackets(setting.value));
|
||||
Field field = null;
|
||||
try {
|
||||
field = getClass().getField(setting.name);
|
||||
}
|
||||
catch (Exception ex){
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
if (field!=null) {
|
||||
if (field != null) {
|
||||
if (field.getName().equals(setting.name)) {
|
||||
changedFields.add(setting.name);
|
||||
switch (setting.name) {
|
||||
@@ -216,28 +215,26 @@ public class SapforProperties extends Properties {
|
||||
}
|
||||
if (!changedFields.isEmpty()) {
|
||||
this.Update();
|
||||
for (String fieldName: changedFields){
|
||||
for (String fieldName : changedFields) {
|
||||
Mark(fieldName, getMenuItem(fieldName));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
public void applyProfile(Vector<SapforProfileSetting> settings){
|
||||
public void applyProfile(Vector<SapforProfileSetting> settings) {
|
||||
Vector<String> changedFields = new Vector<>();
|
||||
try {
|
||||
for (SapforProfileSetting setting : settings) {
|
||||
System.out.println(setting.name+"="+ Utils_.Brackets(setting.value));
|
||||
System.out.println(setting.name + "=" + Utils_.Brackets(setting.value));
|
||||
Field field = null;
|
||||
try {
|
||||
field = getClass().getField(setting.name);
|
||||
}
|
||||
catch (Exception ex){
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
if (field!=null) {
|
||||
if (field != null) {
|
||||
if (field.getName().equals(setting.name)) {
|
||||
changedFields.add(setting.name);
|
||||
switch (setting.name) {
|
||||
@@ -263,13 +260,36 @@ public class SapforProperties extends Properties {
|
||||
}
|
||||
if (!changedFields.isEmpty()) {
|
||||
this.Update();
|
||||
for (String fieldName: changedFields){
|
||||
for (String fieldName : changedFields) {
|
||||
Mark(fieldName, getMenuItem(fieldName));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
public LinkedHashMap<String, String> toMap() {
|
||||
LinkedHashMap<String, String> res = new LinkedHashMap<>();
|
||||
Vector<String> forbidden = new Vector_<String>(
|
||||
// "Precompilation",
|
||||
// "SaveModifications",
|
||||
// "GCOVLimit",
|
||||
// "DVMConvertationOptions",
|
||||
"PARSE_FOR_INLINE",
|
||||
"STATIC_PRIVATE_ANALYSIS",
|
||||
"PARALLELIZE_FREE_LOOPS"
|
||||
);
|
||||
try {
|
||||
for (Field field : getClass().getFields()) {
|
||||
if (!forbidden.contains(field.getName())) {
|
||||
Object value = field.get(this);
|
||||
String value_ = (value instanceof Boolean) ? ((boolean) value ? "1" : "0") : value.toString();
|
||||
res.put(field.getName(), value_);
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ public class ProjectSettingsMenu extends VisualiserMenu {
|
||||
add(new PropertiesSubmenu("Анализ", null,
|
||||
Global.mainModule.getProject().sapforProperties,
|
||||
"Precompilation",
|
||||
"STATIC_SHADOW_ANALYSIS",
|
||||
"KEEP_DVM_DIRECTIVES",
|
||||
"IGNORE_IO_SAPFOR",
|
||||
"MPI_PROGRAM",
|
||||
|
||||
Reference in New Issue
Block a user