промежуточный. перенос настроек в проект. есть баги. завтра доделываю, версия не вполне рабочая
This commit is contained in:
@@ -46,7 +46,7 @@ public class AddBugReport extends AddObjectPass<BugReport> {
|
||||
target.project_version = "";
|
||||
target.visualiser_version = ComponentsSet.visualiser.version;
|
||||
target.sapfor_version = Global.components.get(ComponentType.Sapfor_F).version;
|
||||
target.packedSettingsJson = Utils_.gson.toJson(Global.mainModule.getDb().settings.getSapforSettingsJson());
|
||||
target.packedSettingsJson = "";// Utils_.gson.toJson(Global.mainModule.getDb().settings.getSapforSettingsJson());
|
||||
target.percentage = 0;
|
||||
target.description = "Черновик отчёта об ошибке.\nЗаполните описание ошибочной ситуации, и нажмите 'Опубликовать'";
|
||||
target.date = new Date().getTime();
|
||||
|
||||
@@ -2,7 +2,6 @@ package _VisualDVM.Passes.All;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Repository.BugReport.BugReport;
|
||||
import _VisualDVM.Repository.BugReport.Json.VisualiserSettingJson;
|
||||
@@ -38,6 +37,7 @@ public class ApplyBugReportSettings extends Pass<BugReport> {
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
/*
|
||||
LinkedHashMap<SettingName, String> to_apply = new LinkedHashMap<>();
|
||||
VisualiserSettingsJson settings = Utils_.gson.fromJson(target.packedSettingsJson, VisualiserSettingsJson.class);
|
||||
for (VisualiserSettingJson setting : settings.array) {
|
||||
@@ -50,6 +50,7 @@ public class ApplyBugReportSettings extends Pass<BugReport> {
|
||||
if (!settingName.equals(SettingName.Undefined))
|
||||
to_apply.put(settingName, setting.value);
|
||||
}
|
||||
*/
|
||||
/*
|
||||
String[] lines = target.sapfor_settings.split("\n");
|
||||
LinkedHashMap<SettingName, String> to_apply = new LinkedHashMap<>();
|
||||
@@ -64,10 +65,12 @@ public class ApplyBugReportSettings extends Pass<BugReport> {
|
||||
// Global.db.rewriteProfileByDescription("Saved Profile");
|
||||
//--
|
||||
//само применение.
|
||||
/*
|
||||
for (SettingName settingName : to_apply.keySet())
|
||||
Global.mainModule.getPass(PassCode.UpdateSetting).Do(
|
||||
settingName,
|
||||
to_apply.get(settingName));
|
||||
*/
|
||||
//сохранить настройки бага как профиль
|
||||
// Global.db.rewriteProfileByDescription(target.id);
|
||||
}
|
||||
|
||||
@@ -35,9 +35,11 @@ public class ApplyProfile extends Pass<SapforProfile> {
|
||||
if (sapforProfileSetting.sapforprofile_id == target.id)
|
||||
settings.add(sapforProfileSetting);
|
||||
//--
|
||||
/*
|
||||
for (SapforProfileSetting setting : settings)
|
||||
if (Global.mainModule.getDb().settings.containsKey(setting.name))
|
||||
Global.mainModule.getPass(PassCode.UpdateSetting).Do(setting.name, setting.value);
|
||||
//--
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
public class CheckAccount extends Pass<Boolean> {
|
||||
|
||||
@@ -3,7 +3,6 @@ import Common.Utils.Utils_;
|
||||
import Common.Visual.Windows.Dialog.VDirectoryChooser;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Utils;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import Common.Utils.Utils_;
|
||||
import Common.Visual.Windows.Dialog.VFileChooser;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.TestingSystem.Common.Group.Group;
|
||||
import _VisualDVM.Utils;
|
||||
|
||||
@@ -5,7 +5,6 @@ import Common.Utils.Utils_;
|
||||
import Common.Visual.Windows.Dialog.VDirectoryChooser;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ProjectData.Files.ProjectFile;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Visual.Windows.Dialog.VFileChooser;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Utils;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import Common.Visual.Controls.PassMenuItem;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
@@ -97,7 +96,7 @@ public class DVMConvertProject extends ComponentsRepositoryPass<db_project_info>
|
||||
Vector<String> unit_args = new Vector<>();
|
||||
unit_args.add(target.name);
|
||||
unit_args.add(target.languageName.toString());
|
||||
unit_args.add((Global.mainModule.getDb()).settings.get(SettingName.DVMConvertationOptions).toString());
|
||||
unit_args.add(target.sapforProperties.DVMConvertationOptions);
|
||||
unit_args.addAll(programsNames);
|
||||
unit.arg = String.join("\n", unit_args);
|
||||
Command(unit);
|
||||
|
||||
@@ -6,7 +6,6 @@ import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.FileObject.DirInfo;
|
||||
import _VisualDVM.GlobalData.FileObject.DirInfosDataSet;
|
||||
import _VisualDVM.GlobalData.FileObject.UI.DirInfosFields;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -3,7 +3,6 @@ import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.Server.EditServerObject;
|
||||
import _VisualDVM.TestingSystem.Common.TestingServer;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
||||
public class EditSapforConfiguration extends EditServerObject<TestingServer, SapforConfiguration> {
|
||||
public EditSapforConfiguration() {
|
||||
super(Global.testingServer, SapforConfiguration.class);
|
||||
|
||||
@@ -3,7 +3,6 @@ import Common.Passes.Pass;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.FileObject.DirInfo;
|
||||
import _VisualDVM.GlobalData.FileObject.DirInfosDataSet;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Repository.Component.ComponentsSet;
|
||||
import _VisualDVM.Utils;
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import _VisualDVM.Constants;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.DBLastProject.DBLastProject;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ProjectData.Files.LanguageStyle;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
@@ -108,9 +107,7 @@ public class OpenCurrentProject extends Pass<db_project_info> {
|
||||
if (root_changes)
|
||||
Global.mainModule.set(Current.Root, new_root);
|
||||
Global.mainModule.getPass(PassCode.UpdateProperty).Do("ProjectsSearchDirectory", dir.getParent());
|
||||
Global.mainModule.getPass(PassCode.UpdateSetting).Do(
|
||||
SettingName.FREE_FORM, target.style.equals(LanguageStyle.free) ? "1" : "0")
|
||||
;
|
||||
target.sapforProperties.FREE_FORM = target.style.equals(LanguageStyle.free);
|
||||
DBLastProject lastProject;
|
||||
if ((Global.mainModule.getDb()).lastProjects.containsKey(target.Home.getAbsolutePath())) {
|
||||
lastProject = Global.mainModule.getDb().lastProjects.get(target.Home.getAbsolutePath());
|
||||
|
||||
@@ -10,7 +10,6 @@ import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Compiler.CompilerType;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
import _VisualDVM.GlobalData.Module.Module;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
@@ -99,14 +98,14 @@ public class Precompilation extends Pass<db_project_info> {
|
||||
Log.Writeln_("Не задан путь к make.exe.\n " +
|
||||
"Укажите его в меню глобальных настроек." +
|
||||
"\nПредварительная компиляция будет отключена.");
|
||||
Global.mainModule.getPass(PassCode.UpdateSetting).Do(SettingName.Precompilation, "0");
|
||||
Global.mainModule.getPass(PassCode.UpdateSapforProperty).Do("Precompilation", false);
|
||||
return false;
|
||||
}
|
||||
if (!(new File(makepath).exists())) {
|
||||
Log.Writeln_("Файла по пути к make.exe не существует.\n" +
|
||||
"Проверьте правильность его указания в глобальных настройках." +
|
||||
"\nПредварительная компиляция будет отключена.");
|
||||
Global.mainModule.getPass(PassCode.UpdateSetting).Do(SettingName.Precompilation, "0");
|
||||
Global.mainModule.getPass(PassCode.UpdateSapforProperty).Do("Precompilation", false);
|
||||
return false;
|
||||
}
|
||||
//--
|
||||
|
||||
@@ -5,7 +5,6 @@ import Common.Visual.UI;
|
||||
import Common.Visual.Windows.Dialog.VFileChooser;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Server.TestingSystemPass;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
||||
public class SPF_GetArrayDistribution extends SPF_GetArrayDistributionOnlyAnalysis {
|
||||
@@ -28,7 +27,7 @@ public class SPF_GetArrayDistribution extends SPF_GetArrayDistributionOnlyAnalys
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Global.mainModule.getDb().settings.get(SettingName.MPI_PROGRAM).toBoolean()) {
|
||||
if (Global.mainModule.getProject().sapforProperties.MPI_PROGRAM) {
|
||||
UI.Info("Включена настройка SAPFOR 'MPI программа'." +
|
||||
"\nПостроение распределения данных невозможно.");
|
||||
Global.mainModule.getPass(PassCode.SPF_SharedMemoryParallelization).Do();
|
||||
|
||||
@@ -3,7 +3,6 @@ import Common.Utils.Index;
|
||||
import Common.Utils.Vector_;
|
||||
import Common.Visual.Controls.PassControl;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
||||
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
|
||||
|
||||
@@ -69,8 +68,7 @@ public class SPF_GetArrayDistributionOnlyAnalysis extends SapforAnalysis {
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return Global.mainModule.getDb().settings.get(SettingName.MPI_PROGRAM).toBoolean() ?
|
||||
"Анализ кода (общая память)" : "Анализ кода";
|
||||
return "Анализ кода";
|
||||
}
|
||||
public void RefreshControls() {
|
||||
for (PassControl control : controls)
|
||||
|
||||
@@ -8,7 +8,7 @@ public class SPF_GetArrayLinks extends SilentSapforPass {
|
||||
sapfor.RunAnalysis(
|
||||
getSapforPassName(),
|
||||
-Global.messagesServer.getPort(),
|
||||
Global.packSapforSettings(),
|
||||
target.sapforProperties.pack(),
|
||||
target.getProjFile().getAbsolutePath());
|
||||
}
|
||||
protected void unpack(String packed) throws Exception {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class SPF_GetGCovInfo extends SilentSapforPass {
|
||||
sapfor.RunAnalysis(
|
||||
getSapforPassName(),
|
||||
-Global.messagesServer.getPort(),
|
||||
Global.packSapforSettings(),
|
||||
target.sapforProperties.pack(),
|
||||
target.getProjFile().getAbsolutePath());
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -262,7 +262,7 @@ public class SPF_GetGraphFunctionPositions extends SilentSapforPass {
|
||||
sapfor.RunAnalysis(
|
||||
getSapforPassName(),
|
||||
-Global.messagesServer.getPort(),
|
||||
Global.packSapforSettings() +
|
||||
target.sapforProperties.pack() +
|
||||
packFgSettings(),
|
||||
target.getProjFile().getAbsolutePath());
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public class SPF_GetMaxMinBlockDistribution extends SilentSapforPass {
|
||||
sapfor.RunAnalysis(
|
||||
getSapforPassName(),
|
||||
-Global.messagesServer.getPort(),
|
||||
Global.packSapforSettings(),
|
||||
target.sapforProperties.pack(),
|
||||
target.getProjFile().getAbsolutePath());
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Sapfor.SapforFilesModification;
|
||||
import _VisualDVM.ProjectData.SapforData.Functions.FuncCall;
|
||||
@@ -16,8 +15,8 @@ public class SPF_InlineProcedure extends SapforFilesModification {
|
||||
if (super.canStart(args) && (call = (args.length > 0) ? (FuncCall) args[0] : null) != null) {
|
||||
addOpt1 = call.funcName + "|" + Global.mainModule.getFile().name;
|
||||
addOpt2 = String.valueOf(call.parent_offset);
|
||||
Global.changeSetting(SettingName.PARSE_FOR_INLINE, "1");
|
||||
// Pass_2021.passes.get(PassCode_2021.UpdateSetting).Do(SettingName.PARSE_FOR_INLINE, "1");
|
||||
target.sapforProperties.PARSE_FOR_INLINE=true;
|
||||
target.sapforProperties.Update();
|
||||
SPF_ParseFilesWithOrder.silent = true;
|
||||
return Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).Do();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Sapfor.SapforTransformation;
|
||||
import _VisualDVM.ProjectData.SapforData.Functions.FuncCall;
|
||||
@@ -42,7 +41,8 @@ public class SPF_InlineProcedures extends SapforTransformation {
|
||||
return false;
|
||||
}
|
||||
Options = Utils_.toU(String.join("|", Result));
|
||||
Global.changeSetting(SettingName.PARSE_FOR_INLINE, "1");
|
||||
target.sapforProperties.PARSE_FOR_INLINE=true;
|
||||
target.sapforProperties.Update();
|
||||
SPF_ParseFilesWithOrder.silent = true;
|
||||
return Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).Do(false);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Sapfor.SapforTransformation;
|
||||
import _VisualDVM.ProjectData.SapforData.Functions.FuncCallH;
|
||||
@@ -72,7 +71,8 @@ public class SPF_InlineProceduresH extends SapforTransformation {
|
||||
}
|
||||
}
|
||||
Options = Utils_.toU(String.join("|", Result));
|
||||
Global.changeSetting(SettingName.PARSE_FOR_INLINE, "1");
|
||||
target.sapforProperties.PARSE_FOR_INLINE=true;
|
||||
target.sapforProperties.Update();
|
||||
SPF_ParseFilesWithOrder.silent = true;
|
||||
return Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).Do();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
@@ -43,7 +42,7 @@ public class SPF_ParseFilesWithOrder extends SapforAnalysis {
|
||||
precompilation_done = false;
|
||||
boolean res = (
|
||||
silent ||
|
||||
(!Global.mainModule.getDb().settings.get(SettingName.Precompilation).toBoolean() ||
|
||||
(!Global.mainModule.getProject().sapforProperties.Precompilation ||
|
||||
(precompilation_done = Global.mainModule.getPass(PassCode.Precompilation).Do())))
|
||||
&& super.canStart(args) && checkActiveFiles();
|
||||
return res;
|
||||
@@ -173,8 +172,8 @@ public class SPF_ParseFilesWithOrder extends SapforAnalysis {
|
||||
*/
|
||||
@Override
|
||||
protected void performFinish() throws Exception {
|
||||
Global.changeSetting(SettingName.PARSE_FOR_INLINE, "0");
|
||||
// Pass_2021.passes.get(PassCode_2021.UpdateSetting).Do(SettingName.PARSE_FOR_INLINE, "0");
|
||||
target.sapforProperties.PARSE_FOR_INLINE=false;
|
||||
target.sapforProperties.Update();
|
||||
super.performFinish();
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -22,7 +22,7 @@ public class SPF_PredictParallelVariant extends SilentSapforPass {
|
||||
sapfor.RunTransformation(
|
||||
"SPF_CreateParallelVariant",
|
||||
-Global.messagesServer.getPort(),
|
||||
Global.packSapforSettings(),
|
||||
target.sapforProperties.pack(),
|
||||
target.getProjFile().getAbsolutePath(),
|
||||
"",
|
||||
Options
|
||||
|
||||
@@ -21,7 +21,7 @@ public class SPF_StatisticAnalyzer extends SilentSapforPass {
|
||||
sapfor.RunAnalysis(
|
||||
getName(),
|
||||
-Global.messagesServer.getPort(),
|
||||
Global.packSapforSettings(),
|
||||
target.sapforProperties.pack(),
|
||||
Utils_.DQuotes(task.getLocalStsFile().getAbsolutePath()) +
|
||||
" "
|
||||
+ Utils_.DQuotes(target.getStsFile().getAbsolutePath()));
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Repository.BugReport.BugReport;
|
||||
import _VisualDVM.Repository.BugReport.Json.RecipientsJson;
|
||||
public class SaveBugReportRecipients extends UpdateBugReportField {
|
||||
@Override
|
||||
|
||||
@@ -7,7 +7,6 @@ import Common.Visual.Windows.Dialog.VDirectoryChooser;
|
||||
import Common.Visual.Windows.Dialog.VFileChooser;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalProperties;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Utils;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
77
src/_VisualDVM/Passes/All/UpdateSapforProperty.java
Normal file
77
src/_VisualDVM/Passes/All/UpdateSapforProperty.java
Normal file
@@ -0,0 +1,77 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Visual.Windows.Dialog.PercentsForm;
|
||||
import Common.Visual.Windows.Dialog.Text.TextFieldDialog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ProjectData.SapforData.SapforProperties;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
public class UpdateSapforProperty extends Pass<Object> {
|
||||
SapforProperties properties = null;
|
||||
String name = "";
|
||||
Field field = null;
|
||||
Object oldValue = null;
|
||||
Object newValue = null;
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
properties = Global.mainModule.getProject().sapforProperties;
|
||||
//---
|
||||
name = (String) args[0];
|
||||
String description = properties.getFieldDescription(name);
|
||||
field = SapforProperties.class.getField(name);
|
||||
oldValue = field.get(properties);
|
||||
newValue = null;
|
||||
//-
|
||||
if (args.length == 1) {
|
||||
if (oldValue instanceof Boolean) {
|
||||
newValue = !(Boolean) oldValue;
|
||||
return true;
|
||||
} else {
|
||||
switch (name) {
|
||||
case "GCOVLimit":
|
||||
case "MAX_SHADOW_WIDTH":
|
||||
PercentsForm percentsForm = new PercentsForm();
|
||||
if (percentsForm.ShowDialog(description, oldValue))
|
||||
newValue = percentsForm.Result;
|
||||
break;
|
||||
case "DVMConvertationOptions": case "ANALYSIS_OPTIONS":
|
||||
TextFieldDialog textFieldDialog = new TextFieldDialog();
|
||||
if (textFieldDialog.ShowDialog(description, oldValue)) {
|
||||
newValue = textFieldDialog.Result;
|
||||
if (newValue.toString().isEmpty())
|
||||
newValue = " ";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else
|
||||
newValue = args[1];
|
||||
//--
|
||||
return newValue != null && !newValue.equals(oldValue);
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
field.set(properties, newValue);
|
||||
properties.Update();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
switch (name) {
|
||||
case "GCOVLimit":
|
||||
if (Global.mainModule.HasFile())
|
||||
Global.mainModule.getFile().form.ShowGCOV();
|
||||
break;
|
||||
case "MPI_PROGRAM":
|
||||
Global.mainModule.getPass(PassCode.CleanAnalyses).Do();
|
||||
((SPF_GetArrayDistributionOnlyAnalysis)
|
||||
Global.mainModule.getPass(PassCode.SPF_GetArrayDistributionOnlyAnalysis)).RefreshControls();
|
||||
break;
|
||||
case "Precompilation":
|
||||
Global.mainModule.getSapfor().ResetAllAnalyses();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.MainModule_;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Visual.Windows.Dialog.*;
|
||||
import Common.Visual.Windows.Dialog.Text.TextFieldDialog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.DBSetting;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Utils;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
public class UpdateSetting extends Pass<DBSetting> {
|
||||
String NewValue;
|
||||
VDirectoryChooser directoryChooser = new VDirectoryChooser("");
|
||||
VFileChooser fileChooser = new VFileChooser("", "exe");
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = (Global.mainModule.getDb()).settings.get(args[0]);
|
||||
NewValue = target.Value;
|
||||
if (args.length == 1) {
|
||||
//интерфейсный режим. получение по клику на пункт меню.
|
||||
switch (target.settingType) {
|
||||
case SapforFlag:
|
||||
NewValue = target.toBoolean() ? "0" : "1";
|
||||
break;
|
||||
case PercentField:
|
||||
PercentsForm f = new PercentsForm();
|
||||
if (f.ShowDialog(target.Name.getDescription(), target.toInt32()))
|
||||
NewValue = String.valueOf(f.Result);
|
||||
break;
|
||||
case StringField:
|
||||
switch (target.Name) {
|
||||
default:
|
||||
TextFieldDialog ff = new TextFieldDialog();
|
||||
if (ff.ShowDialog(target.Name.getDescription(), target.Value)) {
|
||||
NewValue = ff.Result;
|
||||
if (NewValue.length() == 0)
|
||||
NewValue = " ";
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
NewValue = args[1].toString();
|
||||
}
|
||||
//программный, тихий режим.}
|
||||
return !NewValue.equals(target.Value);
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
target.Value = NewValue;
|
||||
Global.mainModule.getDb().Update(target);
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
if (target.Visible) {
|
||||
target.Mark();
|
||||
switch (target.Name) {
|
||||
case GCOVLimit:
|
||||
if (Global.mainModule.HasFile())
|
||||
Global.mainModule.getFile().form.ShowGCOV();
|
||||
break;
|
||||
|
||||
case MPI_PROGRAM:
|
||||
Global.mainModule.getPass(PassCode.CleanAnalyses).Do();
|
||||
((SPF_GetArrayDistributionOnlyAnalysis)
|
||||
Global.mainModule.getPass(PassCode.SPF_GetArrayDistributionOnlyAnalysis)).RefreshControls();
|
||||
break;
|
||||
case Precompilation:
|
||||
Global.mainModule.getSapfor().ResetAllAnalyses();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user