продолжение рефакторинга. создал предка для класса current

This commit is contained in:
2024-10-08 00:39:13 +03:00
parent 3516b58127
commit d0c08a2c7e
157 changed files with 648 additions and 421 deletions

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes;
import Common.CurrentAnchestor;
import Common_old.Current;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
@@ -20,8 +21,8 @@ public abstract class AbortTestingPackage extends TestingSystemPass<TestingPacka
@Override
protected boolean canStart(Object... args) throws Exception {
packageToKill = null;
if (Current.Check(Log, currentName())) {
target = (TestingPackage) Current.get(currentName());
if (CurrentAnchestor.Check(Log, currentName())) {
target = (TestingPackage) CurrentAnchestor.get(currentName());
switch (target.state) {
case Done:
case Aborted:

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
@@ -30,7 +31,7 @@ public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, Current.BugReport)) {
if (CurrentAnchestor.Check(Log, Current.BugReport)) {
target = Current.getBugReport();
if (!BugReportInterface.CheckNotDraft(target,Log))
return false;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import GlobalData.Settings.SettingName;
import Repository.BugReport.BugReport;
@@ -21,7 +22,7 @@ public class ApplyBugReportSettings extends Pass_2021<BugReport> {
}
@Override
protected boolean canStart(Object... args) {
if (Current.Check(Log, Current.BugReport)) {
if (CurrentAnchestor.Check(Log, Current.BugReport)) {
target = Current.getBugReport();
long vv = target.visualiser_version;
if (vv < 500) {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
@@ -28,7 +29,7 @@ public class ApplyCurrentFunction extends Pass_2021 {
String func_name = ff.Result;
if (Current.getProject().allFunctions.containsKey(func_name)) {
FuncInfo fi = Current.getProject().allFunctions.get(func_name);
Current.set(Current.Function, fi);
CurrentAnchestor.set(Current.Function, fi);
return true;
} else {
Log.Writeln_("Проект не содержит процедуры с именем " + CommonUtils.Brackets(func_name));

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import GlobalData.SapforProfile.SapforProfile;
@@ -22,8 +23,8 @@ public class ApplyProfile extends Pass_2021<SapforProfile> {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, Current.SapforProfile)) {
target = (SapforProfile) Current.get(Current.SapforProfile);
if (CurrentAnchestor.Check(Log, Current.SapforProfile)) {
target = (SapforProfile) CurrentAnchestor.get(Current.SapforProfile);
return true;
}
return false;

View File

@@ -1,5 +1,6 @@
package Visual_DVM_2021.Passes.All;
import Common.CommonConstants;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common.Database.Database;
@@ -139,7 +140,7 @@ public class CloneDVMPackage extends AddObjectPass<DVMPackage> {
return false;
}
//-
if (!Current.Check(Log, Current.Machine, Current.User, Current.Compiler))
if (!CurrentAnchestor.Check(Log, Current.Machine, Current.User, Current.Compiler))
return false;
//---
if (!Current.getMachine().type.equals(MachineType.Server)) {

View File

@@ -1,5 +1,6 @@
package Visual_DVM_2021.Passes.All;
import Common.CommonConstants;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common.Database.Database;
@@ -81,7 +82,7 @@ public class CloneSapforPackage extends AddObjectPass<SapforPackage> {
if (!Current.getAccount().CheckRegistered(Log))
return false;
//--
if (!Current.Check(Log, Current.ServerSapfor))
if (!CurrentAnchestor.Check(Log, Current.ServerSapfor))
return false;
if (!Current.getServerSapfor().state.equals(ServerSapforState.Done)) {
Log.Writeln_("Выбранная версия SAPFOR не собрана!");

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
@@ -35,12 +36,12 @@ public class CloseCurrentFile extends Pass_2021<DBProjectFile> {
}
@Override
protected void performDone() throws Exception {
Current.set(Current.File, null);
Current.set(Current.FileGraphElement, null);
CurrentAnchestor.set(Current.File, null);
CurrentAnchestor.set(Current.FileGraphElement, null);
//-
Current.set(Current.Notes, null);
Current.set(Current.Warnings, null);
Current.set(Current.Errors, null);
CurrentAnchestor.set(Current.Notes, null);
CurrentAnchestor.set(Current.Warnings, null);
CurrentAnchestor.set(Current.Errors, null);
//-
}
@Override

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
@@ -41,18 +42,18 @@ public class CloseCurrentProject extends Pass_2021<db_project_info> {
//--
Current.getSapfor().ResetAllAnalyses();
Current.getSapfor().cd(new File(CommonUtils.Home));
Current.set(Current.Project, null);
Current.set(Current.File, null);
Current.set(Current.Function, null);
Current.set(Current.SelectedFunction,null);
Current.set(Current.ProjectNode, null);
Current.set(Current.SelectedFile, null);
Current.set(Current.SelectedDirectory, null);
CurrentAnchestor.set(Current.Project, null);
CurrentAnchestor.set(Current.File, null);
CurrentAnchestor.set(Current.Function, null);
CurrentAnchestor.set(Current.SelectedFunction,null);
CurrentAnchestor.set(Current.ProjectNode, null);
CurrentAnchestor.set(Current.SelectedFile, null);
CurrentAnchestor.set(Current.SelectedDirectory, null);
//-мб перестраховка. мб и нет.
Current.set(Current.ParallelVariant, null);
Current.set(Current.Dimensions, null);
Current.set(Current.Array, null);
Current.set(Current.DBArray, null);
CurrentAnchestor.set(Current.ParallelVariant, null);
CurrentAnchestor.set(Current.Dimensions, null);
CurrentAnchestor.set(Current.Array, null);
CurrentAnchestor.set(Current.DBArray, null);
//-
}
@Override

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import ProjectData.Project.db_project_info;
@@ -18,7 +19,7 @@ public class CloseProject extends Pass_2021<db_project_info> {
protected void performDone() throws Exception {
Current.getSapfor().ResetAllAnalyses();
Current.getSapfor().cd(new File(CommonUtils.Home));
Current.set(Current.Project, null);
CurrentAnchestor.set(Current.Project, null);
//-
}
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
@@ -29,7 +30,7 @@ public class Compile extends Pass_2021<db_project_info> {
}
@Override
protected boolean canStart(Object... args) {
if (Current.Check(Log, Current.Project, Current.Machine, Current.User, Current.Makefile)) {
if (CurrentAnchestor.Check(Log, Current.Project, Current.Machine, Current.User, Current.Makefile)) {
target = Current.getProject();
subpass = null;
compilationTask = null;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import Common_old.UI.UI;
import Repository.Server.ServerCode;
@@ -26,7 +27,7 @@ public class ConvertCorrectnessTests extends TestingSystemPass<File> {
Log.Writeln_("Вы не являетесь администратором");
return false;
}
if (!Current.Check(Log, Current.ServerSapfor)){
if (!CurrentAnchestor.Check(Log, Current.ServerSapfor)){
return false;
}
return UI.Warning("Загрузить полный пакет DVM тестов на корректность и производительность.");
@@ -38,8 +39,8 @@ public class ConvertCorrectnessTests extends TestingSystemPass<File> {
@Override
protected void performPreparation() throws Exception {
passes.get(PassCode_2021.CloseCurrentProject);
Current.set(Current.Root, null);
Current.set(Current.Version, null);
CurrentAnchestor.set(Current.Root, null);
CurrentAnchestor.set(Current.Version, null);
}
@Override
protected void showPreparation() throws Exception {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
@@ -70,7 +71,7 @@ public class CreateTestFromDirectory extends Pass_2021<Test> {
if (args.length == 0) {
//--
from_files_chooser = true;
if (!Current.Check(Log, Current.Group))
if (!CurrentAnchestor.Check(Log, Current.Group))
return false;
group = Current.getGroup();
if (!selectFiles())

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import ProjectData.Files.FileState;
import ProjectData.Files.ProjectFile;
@@ -14,7 +15,7 @@ public class CreateTestFromProject extends CreateTestFromDirectory {
@Override
protected boolean canStart(Object... args) throws Exception {
if (args.length == 0) {
if (Current.Check(Log, Current.Group, Current.Project)) {
if (CurrentAnchestor.Check(Log, Current.Group, Current.Project)) {
project = Current.getProject();
if (super.canStart(Current.getProject().Home, Current.getGroup())){
from_files_chooser = true; //чтобы опубликовал.

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import Common_old.Utils.Files.VFileChooser;
import Common_old.Utils.Utils;
@@ -20,7 +21,7 @@ public class CreateTestsFromFiles extends PublishTests {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, Current.Group)){
if (CurrentAnchestor.Check(Log, Current.Group)){
Utils.RestoreSelectedDirectory(fileChooser);
Vector<File> files = fileChooser.ShowMultiDialog();
if (files.isEmpty()){

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
@@ -21,7 +22,7 @@ public class CreateTestsGroupFromSelectedVersions extends PublishTests {
protected boolean canStart(Object... args) throws Exception {
target = new Vector<>();
//---
if (Current.Check(Log, Current.Group)) {
if (CurrentAnchestor.Check(Log, Current.Group)) {
group = Current.getGroup();
} else
return false;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
@@ -39,7 +40,7 @@ public class DVMConvertProject extends ComponentsRepositoryPass<db_project_info>
version = null;
badFiles = "";
//--
if (Current.Check(Log, Current.Project)) {
if (CurrentAnchestor.Check(Log, Current.Project)) {
target = Current.getProject();
programsToConvert = target.getPrograms().get(target.languageName);
programsNames = new Vector<>();

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
@@ -54,7 +55,7 @@ public class DeleteDirectory extends ChangeFilePass {
}
@Override
protected void performDone() throws Exception {
Current.set(Current.SelectedDirectory, null);
Current.set(Current.ProjectNode, null);
CurrentAnchestor.set(Current.SelectedDirectory, null);
CurrentAnchestor.set(Current.ProjectNode, null);
}
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
@@ -14,7 +15,7 @@ public class DeleteFile extends ChangeFilePass<DBProjectFile> {
@Override
protected boolean canStart(Object... args) {
resetArgs();
return (Current.Check(Log, Current.SelectedFile)) &&
return (CurrentAnchestor.Check(Log, Current.SelectedFile)) &&
UI.Warning("Удалить файл "
+ CommonUtils.Brackets((target = Current.getSelectedFile()).name));
}
@@ -31,7 +32,7 @@ public class DeleteFile extends ChangeFilePass<DBProjectFile> {
}
@Override
protected void performDone() throws Exception {
Current.set(Current.SelectedFile, null);
Current.set(Current.ProjectNode, null);
CurrentAnchestor.set(Current.SelectedFile, null);
CurrentAnchestor.set(Current.ProjectNode, null);
}
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import ProjectData.Project.db_project_info;
import Visual_DVM_2021.Passes.PassCode_2021;
@@ -8,7 +9,7 @@ import java.util.Vector;
public class DeleteLonelyM extends Pass_2021<db_project_info> {
@Override
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, Current.Root)) {
if (CurrentAnchestor.Check(Log, Current.Root)) {
target = Current.getRoot();
return true;
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
@@ -33,8 +34,8 @@ public class DeleteSelectedFiles extends Pass_2021 {
if (hasCurrent)
passes.get(PassCode_2021.CloseCurrentFile).Do();
if (hasSelected) {
Current.set(Current.SelectedFile, null);
Current.set(Current.ProjectNode, null);
CurrentAnchestor.set(Current.SelectedFile, null);
CurrentAnchestor.set(Current.ProjectNode, null);
}
}
@Override

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
@@ -26,7 +27,7 @@ public class DeleteSelectedVersions extends Pass_2021<Vector<db_project_info>> {
Log.Writeln_("Нажмите правую клавишу мыши, и перейдите в режим выбора версий.");
return false;
}
if (!Current.Check(Log, Current.Root)) {
if (!CurrentAnchestor.Check(Log, Current.Root)) {
return false;
}
Vector<db_project_info> allVersions = new Vector<>();

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
@@ -50,11 +51,11 @@ public class DeleteVersion extends Pass_2021<db_project_info> {
protected void performDone() throws Exception {
parent = target.parent;
if (current)
Current.set(Current.Version, null);
CurrentAnchestor.set(Current.Version, null);
if (parent != null) {
UI.getVersionsWindow().getVersionsForm().getTree().RemoveNode(target.node);
parent.versions.remove(target.name);
} else
Current.set(Current.Root, null);
CurrentAnchestor.set(Current.Root, null);
}
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.Utils.Utils;
@@ -22,7 +23,7 @@ public class DownloadAllBugReportsArchives extends ComponentsRepositoryPass<File
@Override
protected void performPreparation() throws Exception {
passes.get(PassCode_2021.CloseCurrentProject).Do();
Current.set(Current.Root, null); //чтобы гарантированно не существовало корня.
CurrentAnchestor.set(Current.Root, null); //чтобы гарантированно не существовало корня.
Utils.CleanDirectory(Global.BugReportsDirectory);
}
@Override

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Constants;
import Common_old.Current;
import _VisualDVM.Global;
@@ -14,7 +15,7 @@ public class DownloadDVMPackage extends DownloadDVMPackages {
}
DVMPackage dvmPackage;
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, Current.DVMPackage)) {
if (CurrentAnchestor.Check(Log, Current.DVMPackage)) {
//--
dvmPackage = Current.getDVMPackage();
//--

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
@@ -40,12 +41,12 @@ public class DownloadProject extends CurrentConnectionPass {
} else throw new PassException("Размер проекта превышает " + maxSize + " KB.\n");
} else {
//диалога не вышло, сбрасываем файл.
Current.set(Current.RemoteFile, null);
CurrentAnchestor.set(Current.RemoteFile, null);
}
}
@Override
protected boolean validate() {
Current.Check(Log, Current.RemoteFile);
CurrentAnchestor.Check(Log, Current.RemoteFile);
return (Log.isEmpty());
}
@Override

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import TestingSystem.DVM.DVMTasks.DVMRunTask;
import TestingSystem.Common.Test.Test;
@@ -10,7 +11,7 @@ public class DownloadTaskTest extends DownloadTest {
@Override
protected boolean canStart(Object... args) throws Exception {
target = null;
if (Current.getAccount().CheckRegistered(Log) && Current.Check(Log, Current.DVMRunTask)) {
if (Current.getAccount().CheckRegistered(Log) && CurrentAnchestor.Check(Log, Current.DVMRunTask)) {
DVMRunTask task = Current.getDVMRunTask();
//-- квазиобъект, нам от него нужно только имя.
target = new Test();

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
@@ -20,7 +21,7 @@ public class DownloadTest extends TestingSystemPass<Test> {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Current.getAccount().CheckRegistered(Log) && Current.Check(Log, Current.Test)) {
if (Current.getAccount().CheckRegistered(Log) && CurrentAnchestor.Check(Log, Current.Test)) {
target = Current.getTest();
return true;
}
@@ -29,7 +30,7 @@ public class DownloadTest extends TestingSystemPass<Test> {
@Override
protected void performPreparation() throws Exception {
passes.get(PassCode_2021.CloseCurrentProject).Do();
Current.set(Current.Root, null); //чтобы гарантированно не существовало корня.
CurrentAnchestor.set(Current.Root, null); //чтобы гарантированно не существовало корня.
Utils.forceDeleteWithCheck(target.getArchive());
Utils.forceDeleteWithCheck(target.getHomePath());
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import Common_old.UI.UI;
import ProjectData.Files.DBProjectFile;
@@ -15,7 +16,7 @@ public class ExcludeFile extends Pass_2021<DBProjectFile> {
target = (DBProjectFile) args[0];
return !target.state.equals(FileState.Excluded);
}
return Current.Check(Log, Current.SelectedFile)
return CurrentAnchestor.Check(Log, Current.SelectedFile)
&& !(target = Current.getSelectedFile()).state.equals(FileState.Excluded);
}
@Override

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
@@ -61,7 +62,7 @@ public class ExportDVMPackageToExcel extends Pass_2021<Vector<DVMPackage>> {
if (Global.testingServer.db.dvmPackages.getCheckedCount() > 0) {
target = Global.testingServer.db.dvmPackages.getCheckedItems();
} else {
if (Current.Check(Log, Current.DVMPackage)) {
if (CurrentAnchestor.Check(Log, Current.DVMPackage)) {
target = new Vector<>();
target.add(Current.getDVMPackage());
} else return false;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
@@ -10,7 +11,7 @@ public class GetComponentsBackupsFromServer extends ComponentsRepositoryPass<Vec
@Override
protected boolean canStart(Object... args) throws Exception {
target = new Vector<>();
return (Current.Check(Log, Current.Component));
return (CurrentAnchestor.Check(Log, Current.Component));
}
@Override
protected void ServerAction() throws Exception {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import Common_old.UI.UI;
import ProjectData.Files.DBProjectFile;
@@ -15,7 +16,7 @@ public class IncludeFile extends Pass_2021<DBProjectFile> {
target = (DBProjectFile) args[0];
return target.state.equals(FileState.Excluded);
}
return Current.Check(Log, Current.SelectedFile)
return CurrentAnchestor.Check(Log, Current.SelectedFile)
&& (target = Current.getSelectedFile()).state.equals(FileState.Excluded);
}
@Override

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import GlobalData.RemoteFile.RemoteFile;
@@ -18,7 +19,7 @@ public class InitialiseUser extends Pass_2021 {
}
@Override
protected boolean canStart(Object... args) throws Exception {
return Current.Check(Log, Current.Machine, Current.User);
return CurrentAnchestor.Check(Log, Current.Machine, Current.User);
}
@Override
protected void body() throws Exception {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
@@ -22,7 +23,7 @@ public class OpenBugReportTestProject extends Pass_2021<BugReport> {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, Current.BugReport) &&
if (CurrentAnchestor.Check(Log, Current.BugReport) &&
(BugReportInterface.CheckNotDraft(target=Current.getBugReport(),Log))) {
if (!target.project_version.isEmpty()) {
@@ -42,7 +43,7 @@ public class OpenBugReportTestProject extends Pass_2021<BugReport> {
@Override
protected void performPreparation() throws Exception {
passes.get(PassCode_2021.CloseCurrentProject).Do();
Current.set(Current.Root, null); //чтобы гарантированно не существовало корня.
CurrentAnchestor.set(Current.Root, null); //чтобы гарантированно не существовало корня.
}
@Override
protected void body() throws Exception {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import Common_old.UI.UI;
import ProjectData.Files.DBProjectFile;
@@ -20,7 +21,7 @@ public class OpenCurrentFile extends Pass_2021<DBProjectFile> {
}
@Override
protected void performDone() throws Exception {
Current.set(Current.File, target);
CurrentAnchestor.set(Current.File, target);
}
@Override
protected void showDone() throws Exception {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
@@ -108,10 +109,10 @@ public class OpenCurrentProject extends Pass_2021<db_project_info> {
}
@Override
protected void performDone() throws Exception {
Current.set(Current.Project, target);
Current.set(Current.ProjectView, ProjectView.Files);
CurrentAnchestor.set(Current.Project, target);
CurrentAnchestor.set(Current.ProjectView, ProjectView.Files);
if (root_changes)
Current.set(Current.Root, new_root);
CurrentAnchestor.set(Current.Root, new_root);
Pass_2021.passes.get(PassCode_2021.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, dir.getParent());
Pass_2021.passes.get(PassCode_2021.UpdateSetting).Do(
SettingName.FREE_FORM, target.style.equals(LanguageStyle.free) ? "1" : "0")

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import ProjectData.Project.db_project_info;
import Visual_DVM_2021.Passes.PassCode_2021;
@@ -20,7 +21,7 @@ public class OpenProject extends Pass_2021<db_project_info> {
}
@Override
protected void performDone() throws Exception {
Current.set(Current.Project, target);
CurrentAnchestor.set(Current.Project, target);
/*
пока непонятно надо
Pass_2021.passes.get(PassCode_2021.UpdateSetting).Do(

View File

@@ -1,5 +1,6 @@
package Visual_DVM_2021.Passes.All;
import Common.CommonConstants;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.Windows.Dialog.Dialog;
@@ -27,7 +28,7 @@ public class PickCompilerEnvironments extends Pass_2021<String> {
//-
@Override
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, Current.RunConfiguration)) {
if (CurrentAnchestor.Check(Log, Current.RunConfiguration)) {
RunConfiguration configuration = Current.getRunConfiguration();
if (configuration.compiler_id == CommonConstants.Nan) {
Log.Writeln_("Отсутвует DVM компилятор, связанный с текущей конфигурацией запуска.\n" +

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
@@ -23,7 +24,7 @@ public class PublishBugReport extends Pass_2021<BugReport> {
}
@Override
protected boolean canStart(Object... args) {
if (Current.Check(Log, Current.BugReport)) {
if (CurrentAnchestor.Check(Log, Current.BugReport)) {
target = Current.getBugReport();
if (!target.state.equals(BugReportState.draft)) {
Log.Writeln_("Отчёт об ошибке " + target.id + " уже опубликован!");

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
@@ -43,7 +44,7 @@ public class PublishComponent extends ComponentsRepositoryPass<Component> {
Log.Writeln_("Вы не являетесь администратором");
}
;
if (Current.Check(Log, Current.Component)) {
if (CurrentAnchestor.Check(Log, Current.Component)) {
target = Current.getComponent();
target.needs_update_minimal_version = false;
f.fields.cbUpdateMinimalVersion.setSelected(false);

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import TestingSystem.Common.TestingServer;
@@ -15,6 +16,6 @@ public class PublishSapforSettingsCommand extends PublishServerObject<TestingSer
}
@Override
protected boolean canStart(Object... args) throws Exception {
return Current.Check(Log, Current.SapforSettings)&&super.canStart(args);
return CurrentAnchestor.Check(Log, Current.SapforSettings)&&super.canStart(args);
}
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
@@ -15,7 +16,7 @@ public class RemoteInitialiseUser extends ConnectionPass<RemoteFile> {
}
@Override
protected boolean canStart(Object... args) {
return Current.Check(Log, Current.User);
return CurrentAnchestor.Check(Log, Current.User);
}
@Override
protected void Connect() throws Exception {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
@@ -80,7 +81,7 @@ public class RenameDirectory extends ChangeFilePass {
@Override
protected void performDone() throws Exception {
Current.getSapfor().ResetAllAnalyses();
Current.set(Current.SelectedDirectory, dst);
CurrentAnchestor.set(Current.SelectedDirectory, dst);
if (current && new_current_file != null)
passes.get(PassCode_2021.OpenCurrentFile).Do(new_current_file);
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
@@ -18,7 +19,7 @@ public class RenameFile extends ChangeFilePass<DBProjectFile> {
protected boolean canStart(Object... args) {
resetArgs();
current = false;
if (Current.Check(Log, Current.SelectedFile)) {
if (CurrentAnchestor.Check(Log, Current.SelectedFile)) {
old = Current.getSelectedFile();
current = Current.HasFile() && Current.getFile().file.equals(old.file);
if ((ff = new FileNameForm()).ShowDialog("Введите новое имя файла", old.file.getName())) {
@@ -58,7 +59,7 @@ public class RenameFile extends ChangeFilePass<DBProjectFile> {
@Override
protected void performDone() throws Exception {
Current.getSapfor().ResetAllAnalyses();
Current.set(Current.SelectedFile, target);
CurrentAnchestor.set(Current.SelectedFile, target);
if (current)
passes.get(PassCode_2021.OpenCurrentFile).Do(target);
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
@@ -33,7 +34,7 @@ public class ReplaceTestProject extends CreateTestFromProject {
}
@Override
protected boolean initTarget() throws Exception {
if (Current.Check(Log, Current.Test)) {
if (CurrentAnchestor.Check(Log, Current.Test)) {
target = Current.getTest();
return true;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
@@ -32,7 +33,7 @@ public class ReplaceTestsFromFiles extends TestingSystemPass<Vector<Test>> {
//-
@Override
protected boolean canStart(Object... args) throws Exception {
if (!Current.Check(Log, Current.Group))
if (!CurrentAnchestor.Check(Log, Current.Group))
return false;
group = Current.getGroup();
//--->>>

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import Visual_DVM_2021.Passes.CurrentProjectPass;
@@ -8,7 +9,7 @@ public class ResetCurrentProject extends CurrentProjectPass {
protected void performPreparation() throws Exception {
passes.get(PassCode_2021.DeleteDebugResults).Do();
passes.get(PassCode_2021.CloseCurrentProject).Do();
Current.set(Current.Root, null);
CurrentAnchestor.set(Current.Root, null);
}
@Override
protected void body() throws Exception {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.Menus_2023.PassMenuItem;
@@ -77,7 +78,7 @@ public class ResurrectComponentFromServer extends CurrentComponentPass {
content = tree;
}
};
if (d.ShowDialog("Выбор версии для восстановления")&&Current.Check(Log, Current.ComponentServerBackup)){
if (d.ShowDialog("Выбор версии для восстановления")&& CurrentAnchestor.Check(Log, Current.ComponentServerBackup)){
remoteFile = Current.getComponentServerBackup();
return true;
};

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
@@ -39,7 +40,7 @@ public class Run extends Pass_2021<db_project_info> {
@Override
protected boolean canStart(Object... args) {
subpass = null;
if (Current.Check(Log, Current.Project, Current.Machine, Current.User, Current.Makefile, Current.RunConfiguration,
if (CurrentAnchestor.Check(Log, Current.Project, Current.Machine, Current.User, Current.Makefile, Current.RunConfiguration,
Current.CompilationTask)) {
//-
target = Current.getProject();

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import Visual_DVM_2021.Passes.SapforFilesModification;
public class SPF_ChangeSpfIntervals extends SapforFilesModification {
@@ -8,7 +9,7 @@ public class SPF_ChangeSpfIntervals extends SapforFilesModification {
int mod;
@Override
protected boolean canStart(Object... args) throws Exception {
if (super.canStart(args) && Current.Check(Log, Current.File)) {
if (super.canStart(args) && CurrentAnchestor.Check(Log, Current.File)) {
start = (int) args[0];
end = (int) args[1];
mod = (int) args[2];

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
@@ -32,8 +33,8 @@ public class SPF_GetGraphFunctions extends SapforAnalysis {
@Override
protected void performPreparation() throws Exception {
super.performPreparation(); //удаление интеррупта.
Current.set(Current.Function, null);
Current.set(Current.SelectedFunction,null);
CurrentAnchestor.set(Current.Function, null);
CurrentAnchestor.set(Current.SelectedFunction,null);
target.main_function = null;
target.main_functionH = null;
target.allFunctions.clear();

View File

@@ -1,11 +1,12 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import Visual_DVM_2021.Passes.SapforFilesModification;
// SPF_LoopUnionCurrent (addOpt1_c -> file, addOpt2_c-> line)
public class SPF_LoopUnionCurrent extends SapforFilesModification {
@Override
protected boolean canStart(Object... args) throws Exception {
if (super.canStart(args) && Current.Check(Log, Current.File)) {
if (super.canStart(args) && CurrentAnchestor.Check(Log, Current.File)) {
addOpt1 = Current.getFile().name;
addOpt2 = String.valueOf(Current.getFile().form.getEditor().getCurrentLine());
return true;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import Common_old.UI.UI;
import Common_old.UI.Windows.Dialog.DBObjectDialog;
@@ -22,7 +23,7 @@ public class SPF_ModifyArrayDistribution extends SapforModification {
@Override
protected boolean canStart(Object... args) throws Exception {
region = null;
if (Current.Check(Log, Current.ParallelRegion) && super.canStart(args) && passes.get(PassCode_2021.SPF_GetArrayLinks).Do()) {
if (CurrentAnchestor.Check(Log, Current.ParallelRegion) && super.canStart(args) && passes.get(PassCode_2021.SPF_GetArrayLinks).Do()) {
region = Current.getParallelRegion();
DBObjectDialog dialog = new DBObjectDialog<ParallelRegion, ParallelRegionFields>(ParallelRegionFields.class) {
@Override

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
public class SaveBugReportExecutor extends UpdateBugReportField {
@Override
@@ -11,7 +12,7 @@ public class SaveBugReportExecutor extends UpdateBugReportField {
}
@Override
protected boolean canStart(Object... args) throws Exception {
return (Current.Check(Log, Current.Subscriber)) &&
return (CurrentAnchestor.Check(Log, Current.Subscriber)) &&
super.canStart("executor", Current.getSubscriber().name,
"executor_address", Current.getSubscriber().address
);

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import Common_old.UI.UI;
import Visual_DVM_2021.Passes.SSH.CurrentConnectionPass;
@@ -7,9 +8,9 @@ public class SelectRemoteFile extends CurrentConnectionPass {
boolean needs_directory = false;
@Override
protected boolean canStart(Object... args) {
if (Current.Check(Log, Current.Machine, Current.User)) {
if (CurrentAnchestor.Check(Log, Current.Machine, Current.User)) {
needs_directory = (boolean) args[0];
Current.set(Current.RemoteFile, null);
CurrentAnchestor.set(Current.RemoteFile, null);
return true;
}
return false;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import Common_old.UI.Windows.Dialog.Text.ReadOnlyMultilineTextForm;
import GlobalData.Compiler.Compiler;
@@ -22,7 +23,7 @@ public class ShowCompilerHelp extends Pass_2021<String> {
protected boolean canStart(Object... args) throws Exception {
target = null;
if (args.length == 0) {
if (Current.Check(Log, Current.Compiler)) {
if (CurrentAnchestor.Check(Log, Current.Compiler)) {
compiler = Current.getCompiler();
needsShow = true;
return true;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.Windows.Dialog.Text.ReadOnlyMultilineTextForm;
@@ -23,7 +24,7 @@ public class ShowCompilerVersion extends Pass_2021<String> {
protected boolean canStart(Object... args) throws Exception {
target = null;
if (args.length == 0) {
if (Current.Check(Log, Current.Compiler)) {
if (CurrentAnchestor.Check(Log, Current.Compiler)) {
compiler = Current.getCompiler();
needsShow = true;
return true;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.Windows.Dialog.Text.ReadOnlyMultilineTextForm;
@@ -24,7 +25,7 @@ public class ShowComponentChangesLog extends ComponentsRepositoryPass<Component>
File res;
@Override
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, Current.Component)) {
if (CurrentAnchestor.Check(Log, Current.Component)) {
target = Current.getComponent();
return true;
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import GlobalData.Makefile.UI.MakefilePreviewForm;
import ProjectData.Project.db_project_info;
@@ -19,9 +20,9 @@ public class ShowMakefilePreview extends Pass_2021<db_project_info> {
}
@Override
protected boolean canStart(Object... args) {
if (Current.Check(Log, Current.Project)) {
if (CurrentAnchestor.Check(Log, Current.Project)) {
target = Current.getProject();
return Current.Check(Log, Current.Makefile);
return CurrentAnchestor.Check(Log, Current.Makefile);
}
return false;
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Constants;
import Common_old.Current;
import GlobalData.RemoteFile.RemoteFile;
@@ -17,7 +18,7 @@ public class ShowSapforCompilationErr extends ShowTestingServerFile{
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (!Current.Check(Log,Current.ServerSapfor)){
if (!CurrentAnchestor.Check(Log,Current.ServerSapfor)){
return false;
}
return super.canStart("Поток ошибок", new RemoteFile(Current.getServerSapfor().home_path, Constants.err_file));

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Constants;
import Common_old.Current;
import GlobalData.RemoteFile.RemoteFile;
@@ -17,7 +18,7 @@ public class ShowSapforCompilationOut extends ShowTestingServerFile{
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (!Current.Check(Log,Current.ServerSapfor)){
if (!CurrentAnchestor.Check(Log,Current.ServerSapfor)){
return false;
}
return super.canStart("Поток вывода", new RemoteFile(Current.getServerSapfor().home_path, Constants.out_file));

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
@@ -26,7 +27,7 @@ public class StartSelectedDVMConfigurations extends PublishServerObject<TestingS
if (!Current.getAccount().CheckRegistered(Log)) {
return false;
}
if (!Current.Check(Log, Current.Machine, Current.User, Current.Compiler))
if (!CurrentAnchestor.Check(Log, Current.Machine, Current.User, Current.Compiler))
return false;
if (!Current.getMachine().type.equals(MachineType.Server)) {
Log.Writeln_("Тестирование поддерживается только на одиночном удалённом сервере.");

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
@@ -27,7 +28,7 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
if (!Current.getAccount().CheckRegistered(Log)) {
return false;
}
if (!Current.Check(Log, Current.ServerSapfor)) {
if (!CurrentAnchestor.Check(Log, Current.ServerSapfor)) {
return false;
}
if (!Current.getServerSapfor().state.equals(ServerSapforState.Done)) {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
@@ -27,7 +28,7 @@ public class UpdateBugReportField extends ComponentsRepositoryPass<BugReport> {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (!Current.Check(Log, Current.BugReport))
if (!CurrentAnchestor.Check(Log, Current.BugReport))
return false;
old_description = "";
old_comment = "";

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import Common_old.UI.Windows.Dialog.PercentsForm;
public class UpdateBugReportProgress extends UpdateBugReportField {
@@ -12,7 +13,7 @@ public class UpdateBugReportProgress extends UpdateBugReportField {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (!Current.Check(Log, Current.BugReport))
if (!CurrentAnchestor.Check(Log, Current.BugReport))
return false;
PercentsForm f = new PercentsForm();
if (f.ShowDialog("Завершённость работы над ошибкой", Current.getBugReport().percentage))

View File

@@ -1,10 +1,11 @@
package Visual_DVM_2021.Passes;
import Common.CurrentAnchestor;
import Common_old.Current;
import Repository.Component.Component;
public abstract class CurrentComponentPass extends Pass_2021<Component> {
@Override
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, Current.Component)) {
if (CurrentAnchestor.Check(Log, Current.Component)) {
target = Current.getComponent();
return true;
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
@@ -24,8 +25,8 @@ public abstract class OpenSapforVersionPass extends Pass_2021<SapforVersion_json
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, getCurrentName())) {
target = (SapforVersion_json) Current.get(getCurrentName());
if (CurrentAnchestor.Check(Log, getCurrentName())) {
target = (SapforVersion_json) CurrentAnchestor.get(getCurrentName());
return true;
}
return false;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
@@ -305,10 +306,10 @@ public class Pass_2021<T> {
animation_sem.acquire();
//---
form = null;
Current.set(Current.PassForm, null);
CurrentAnchestor.set(Current.PassForm, null);
System.gc();
//--
Current.set(Current.PassForm, form = new PassForm(this));
CurrentAnchestor.set(Current.PassForm, form = new PassForm(this));
dispatcher = new SwingWorker() {
@Override
protected Object doInBackground() {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.SSH;
import Common.CurrentAnchestor;
import Common_old.Current;
//завязан на текущие машину и юзера
public abstract class CurrentConnectionPass<T> extends ConnectionPass<T> {
@@ -8,7 +9,7 @@ public abstract class CurrentConnectionPass<T> extends ConnectionPass<T> {
}
@Override
protected boolean canStart(Object... args) {
return Current.Check(Log, Current.User);
return CurrentAnchestor.Check(Log, Current.User);
}
@Override
public void Connect() throws Exception {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.Menus_2023.PassMenuItem;
@@ -77,7 +78,7 @@ public class SapforTransformation extends SapforPass {
@Override
protected void showFinish() throws Exception {
super.showFinish();
Current.set(Current.ProjectView, ProjectView.Files);
CurrentAnchestor.set(Current.ProjectView, ProjectView.Files);
UI.getMainWindow().getProjectWindow().ShowProjectView();
}
@Override

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import TestingSystem.Common.Configuration.Configuration;
@@ -26,8 +27,8 @@ public abstract class SaveCurrentConfiguration<C extends Configuration, S extend
public abstract Current currentName();
@Override
protected boolean canStart(Object... args) throws Exception {
if (!Current.Check(Log, currentName())) return false;
target = (C) Current.get(currentName());
if (!CurrentAnchestor.Check(Log, currentName())) return false;
target = (C) CurrentAnchestor.get(currentName());
//--
groups = new Vector<>();
tests = new Vector<>();

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.Server;
import Common.CurrentAnchestor;
import Common_old.Current;
import Common.Database.Objects.riDBObject;
import Repository.RepositoryServer;
@@ -15,14 +16,14 @@ public abstract class CloneServerObject<S extends RepositoryServer, D extends ri
@Override
protected boolean canStart(Object... args) throws Exception {
src=null;
if (!Current.Check(Log, currentName()))
if (!CurrentAnchestor.Check(Log, currentName()))
return false;
//---------
pk = null;
if (Current.getAccount().CheckRegistered(Log)) {
target = d.newInstance();
target.SynchronizeFields(src=(D) Current.get(currentName()));
target.SynchronizeFields(src=(D) CurrentAnchestor.get(currentName()));
//единственное отличие клона - текущий автор
target.description+=" копия";
target.sender_name = Current.getAccount().name;

View File

@@ -1,5 +1,5 @@
package Visual_DVM_2021.Passes.Server;
import Common_old.Current;
import Common.CurrentAnchestor;
import Common.Database.Objects.DBObject;
import Common.Database.Tables.DBTable;
import Common.Database.Database;
@@ -40,7 +40,7 @@ public class DeleteServerObjects <S extends RepositoryServer, D extends DBObject
return UI.Warning(table.getCheckedCount()+" объектов будет удален(о).");
}
else {
if (Current.Check(Log, table.CurrentName())){
if (CurrentAnchestor.Check(Log, table.CurrentName())){
target = new Vector<>();
target.add(table.getCurrent().getPK());
return getDb().tables.get(d).CheckCurrent(Log) && getDb().tables.get(d).ShowDeleteObjectDialog(table.getCurrent());

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.VisualCache.ConfigurationCache;
@@ -21,8 +22,8 @@ public abstract class ShowCurrentConfigurationTests<C extends Configuration> ext
@Override
protected boolean canStart(Object... args) throws Exception {
target = null;
if (Current.Check(Log, currentName())) {
target = (C) Current.get(currentName());
if (CurrentAnchestor.Check(Log, currentName())) {
target = (C) CurrentAnchestor.get(currentName());
return true;
}
return false;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
@@ -24,8 +25,8 @@ public abstract class StartTestingPackage<P extends TestingPackage> extends Publ
if (!Current.getAccount().CheckRegistered(Log)) {
return false;
}
if (Current.Check(Log, getCurrentName())) {
target = (P) Current.get(getCurrentName());
if (CurrentAnchestor.Check(Log, getCurrentName())) {
target = (P) CurrentAnchestor.get(getCurrentName());
//-
if (!target.state.equals(TasksPackageState.Draft)) {
Log.Writeln_("Возможно запустить только пакет, готовящийся к публикации!");

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes;
import Common.CurrentAnchestor;
import Common_old.Current;
import Common_old.UI.Menus_2023.PassMenuItem;
import Common_old.UI.UI;
@@ -38,7 +39,7 @@ public class Transformation extends CurrentProjectPass {
@Override
protected void showFinish() throws Exception {
super.showFinish();
Current.set(Current.ProjectView, ProjectView.Files);
CurrentAnchestor.set(Current.ProjectView, ProjectView.Files);
UI.getMainWindow().getProjectWindow().ShowProjectView();
}
@Override