no message
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package _VisualDVM.ProjectData.SapforData;
|
||||
import Common.Properties;
|
||||
import Common.Utils.Vector_;
|
||||
import _VisualDVM.ComponentsServer.BugReport.Json.VisualiserSettingJson;
|
||||
import _VisualDVM.ComponentsServer.BugReport.Json.VisualiserSettingsJson;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.SapforProfileSetting.SapforProfileSetting;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
@@ -177,50 +177,7 @@ public class SapforProperties extends Properties {
|
||||
}
|
||||
return String.join("\n", res);
|
||||
}
|
||||
public void applyPatch(VisualiserSettingsJson settings) {
|
||||
Vector<String> changedFields = new Vector<>();
|
||||
try {
|
||||
for (VisualiserSettingJson setting : settings.array) {
|
||||
Field field = null;
|
||||
try {
|
||||
field = getClass().getField(setting.name);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
if (field != null) {
|
||||
if (field.getName().equals(setting.name)) {
|
||||
changedFields.add(setting.name);
|
||||
switch (setting.name) {
|
||||
case "GCOVLimit":
|
||||
GCOVLimit = Integer.parseInt(setting.value);
|
||||
break;
|
||||
case "MAX_SHADOW_WIDTH":
|
||||
MAX_SHADOW_WIDTH = Integer.parseInt(setting.value);
|
||||
break;
|
||||
case "ANALYSIS_OPTIONS":
|
||||
ANALYSIS_OPTIONS = setting.value;
|
||||
break;
|
||||
case "DVMConvertationOptions":
|
||||
DVMConvertationOptions = setting.value;
|
||||
break;
|
||||
default:
|
||||
int value_ = Integer.parseInt(setting.value);
|
||||
field.set(this, value_ != 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!changedFields.isEmpty()) {
|
||||
this.Update();
|
||||
for (String fieldName : changedFields) {
|
||||
Mark(fieldName, getMenuItem(fieldName));
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
//--
|
||||
public void applyProfile(Vector<SapforProfileSetting> settings) {
|
||||
Vector<String> changedFields = new Vector<>();
|
||||
try {
|
||||
@@ -265,6 +222,52 @@ public class SapforProperties extends Properties {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
public void applyBugReportSettings(BugReport bugReport) {
|
||||
Vector<String> changedFields = new Vector<>();
|
||||
Vector<BugReportSetting> settings = Global.componentsServer.db.getVectorByFK(bugReport, BugReportSetting.class);
|
||||
for (BugReportSetting setting : settings) {
|
||||
try {
|
||||
Field field = null;
|
||||
try {
|
||||
field = getClass().getField(setting.name);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
if (field != null) {
|
||||
if (field.getName().equals(setting.name)) {
|
||||
changedFields.add(setting.name);
|
||||
switch (setting.name) {
|
||||
case "GCOVLimit":
|
||||
GCOVLimit = Integer.parseInt(setting.value);
|
||||
break;
|
||||
case "MAX_SHADOW_WIDTH":
|
||||
MAX_SHADOW_WIDTH = Integer.parseInt(setting.value);
|
||||
break;
|
||||
case "ANALYSIS_OPTIONS":
|
||||
ANALYSIS_OPTIONS = setting.value;
|
||||
break;
|
||||
case "DVMConvertationOptions":
|
||||
DVMConvertationOptions = setting.value;
|
||||
break;
|
||||
default:
|
||||
int value_ = Integer.parseInt(setting.value);
|
||||
field.set(this, value_ != 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (!changedFields.isEmpty()) {
|
||||
this.Update();
|
||||
for (String fieldName : changedFields) {
|
||||
Mark(fieldName, getMenuItem(fieldName));
|
||||
}
|
||||
}
|
||||
}
|
||||
//--
|
||||
public LinkedHashMap<String, String> toMap() {
|
||||
LinkedHashMap<String, String> res = new LinkedHashMap<>();
|
||||
Vector<String> forbidden = new Vector_<String>(
|
||||
@@ -289,4 +292,32 @@ public class SapforProperties extends Properties {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//--
|
||||
public Vector<BugReportSetting> toBugReportSettings() {
|
||||
Vector<BugReportSetting> res = new Vector<>();
|
||||
res.addAll(new Vector_<>(
|
||||
new BugReportSetting("STATIC_SHADOW_ANALYSIS", STATIC_SHADOW_ANALYSIS),
|
||||
new BugReportSetting("STATIC_PRIVATE_ANALYSIS", STATIC_PRIVATE_ANALYSIS),
|
||||
new BugReportSetting("FREE_FORM", FREE_FORM),
|
||||
new BugReportSetting("KEEP_DVM_DIRECTIVES", KEEP_DVM_DIRECTIVES),
|
||||
new BugReportSetting("KEEP_SPF_DIRECTIVES", KEEP_SPF_DIRECTIVES),
|
||||
new BugReportSetting("PARALLELIZE_FREE_LOOPS", PARALLELIZE_FREE_LOOPS),
|
||||
new BugReportSetting("MAX_SHADOW_WIDTH", MAX_SHADOW_WIDTH),
|
||||
new BugReportSetting("OUTPUT_UPPER", OUTPUT_UPPER),
|
||||
new BugReportSetting("TRANSLATE_MESSAGES", TRANSLATE_MESSAGES),
|
||||
new BugReportSetting("KEEP_LOOPS_CLOSE_NESTING", KEEP_LOOPS_CLOSE_NESTING),
|
||||
new BugReportSetting("KEEP_GCOV", KEEP_GCOV),
|
||||
new BugReportSetting("ANALYSIS_OPTIONS", ANALYSIS_OPTIONS),
|
||||
new BugReportSetting("DEBUG_PRINT_ON", DEBUG_PRINT_ON),
|
||||
new BugReportSetting("MPI_PROGRAM", MPI_PROGRAM),
|
||||
new BugReportSetting("IGNORE_IO_SAPFOR", IGNORE_IO_SAPFOR),
|
||||
new BugReportSetting("KEEP_SPF_DIRECTIVES_AMONG_TRANSFORMATIONS", KEEP_SPF_DIRECTIVES_AMONG_TRANSFORMATIONS),
|
||||
new BugReportSetting("PARSE_FOR_INLINE", PARSE_FOR_INLINE),
|
||||
new BugReportSetting("Precompilation", Precompilation),
|
||||
new BugReportSetting("SaveModifications", SaveModifications),
|
||||
new BugReportSetting("GCOVLimit", GCOVLimit),
|
||||
new BugReportSetting("DVMConvertationOptions", DVMConvertationOptions)
|
||||
));
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user