перенос проходов в центральный модуль

This commit is contained in:
2024-10-13 23:55:03 +03:00
parent 6afa2dc892
commit 4e86871571
150 changed files with 510 additions and 576 deletions

View File

@@ -1,6 +1,7 @@
package Visual_DVM_2021.Passes.All;
import Visual_DVM_2021.Passes.PassCode;
import Common.Passes.Pass;
import _VisualDVM.Global;
public class ActualizePackages extends Pass {
@Override
protected boolean needsAnimation() {
@@ -8,8 +9,8 @@ public class ActualizePackages extends Pass {
}
@Override
protected void body() throws Exception {
passes.get(PassCode.ActualizeDVMPackages).Do();
passes.get(PassCode.ActualizeSapforPackages).Do();
passes.get(PassCode.ActualizeServerSapfors).Do();
Global.mainModule.getPass(PassCode.ActualizeDVMPackages).Do();
Global.mainModule.getPass(PassCode.ActualizeSapforPackages).Do();
Global.mainModule.getPass(PassCode.ActualizeServerSapfors).Do();
}
}

View File

@@ -9,6 +9,6 @@ public class ActualizeServerSapfors extends Pass {
}
@Override
protected void body() throws Exception {
passes.get(PassCode.SynchronizeTests).Do();
Global.mainModule.getPass(PassCode.SynchronizeTests).Do();
}
}

View File

@@ -81,7 +81,7 @@ public class AddBugReport extends AddObjectPass<BugReport> {
Files.copy(file.toPath(), Paths.get(attachementsDir.getAbsolutePath(), file.getName()), StandardCopyOption.REPLACE_EXISTING);
}
//запаковка рута
passes.get(PassCode.ZipFolderPass).Do(Global.mainModule.getRoot().Home.getAbsolutePath(), BugReportInterface.getArchiveFile(target).getAbsolutePath());
Global.mainModule.getPass(PassCode.ZipFolderPass).Do(Global.mainModule.getRoot().Home.getAbsolutePath(), BugReportInterface.getArchiveFile(target).getAbsolutePath());
}
}
@Override

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import _VisualDVM.Global;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
import _VisualDVM.Repository.Subscribes.Subscriber;
@@ -28,7 +29,7 @@ public class AddSubscriber extends ComponentsRepositoryPass<Subscriber> {
@Override
protected void performFinish() throws Exception {
super.performFinish();
passes.get(PassCode.SynchronizeBugReports).Do();
Global.mainModule.getPass(PassCode.SynchronizeBugReports).Do();
}
@Override
protected void showDone() throws Exception {

View File

@@ -32,6 +32,6 @@ public class AddUser extends AddObjectPass<User> {
@Override
protected void showDone() throws Exception {
super.showDone();
passes.get(PassCode.InitialiseUser).Do();
Global.mainModule.getPass(PassCode.InitialiseUser).Do();
}
}

View File

@@ -84,7 +84,7 @@ public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
message_text = target.comment;
break;
}
passes.get(PassCode.Email).Do(
Global.mainModule.getPass(PassCode.Email).Do(
new EmailMessage(
message_header + " " + Utils_.Brackets(Global.mainModule.getAccount().name),
message_text,

View File

@@ -50,7 +50,7 @@ public class ApplyBugReportSettings extends Pass<BugReport> {
//--
//само применение.
for (SettingName settingName : to_apply.keySet())
Pass.passes.get(PassCode.UpdateSetting).Do(
Global.mainModule.getPass(PassCode.UpdateSetting).Do(
settingName,
to_apply.get(settingName));
//сохранить настройки бага как профиль

View File

@@ -22,7 +22,7 @@ public class ApplyCurrentFunction extends Pass {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (passes.get(PassCode.SPF_GetGraphFunctions).isDone()) {
if ( Global.mainModule.getPass(PassCode.SPF_GetGraphFunctions).isDone()) {
ComboTextDialog ff = new ComboTextDialog();
Vector<String> names = new Vector<>(Global.mainModule.getProject().allFunctions.keySet());
names.sort(Comparator.naturalOrder());
@@ -43,7 +43,7 @@ public class ApplyCurrentFunction extends Pass {
protected void showDone() throws Exception {
UI.getMainWindow().getProjectWindow().getFunctionsWindow().ShowCurrentFunction();
if (SPF_GetGraphFunctionPositions.showByCurrentFunction) {
Pass.passes.get(PassCode.SPF_GetGraphFunctionPositions).Do();
Global.mainModule.getPass(PassCode.SPF_GetGraphFunctionPositions).Do();
}
}
}

View File

@@ -40,7 +40,7 @@ public class ApplyProfile extends Pass<SapforProfile> {
//--
for (SapforProfileSetting setting : settings)
if (Global.mainModule.getDb().settings.containsKey(setting.name))
passes.get(PassCode.UpdateSetting).Do(setting.name, setting.value);
Global.mainModule.getPass(PassCode.UpdateSetting).Do(setting.name, setting.value);
//--
}
}

View File

@@ -48,9 +48,9 @@ public class CheckAccount extends Pass<Boolean> {
//временно. оффлайн проверка по почте
target = Global.mainModule.getAccount().email.equals("?") ?
(Pass.passes.get(PassCode.EditAccount).Do() &&
Pass.passes.get(PassCode.CheckRegistrationOnServer).Do()) :
(Pass.passes.get(PassCode.CheckRegistrationOnServer).Do());
( Global.mainModule.getPass(PassCode.EditAccount).Do() &&
Global.mainModule.getPass(PassCode.CheckRegistrationOnServer).Do()) :
( Global.mainModule.getPass(PassCode.CheckRegistrationOnServer).Do());
}
@Override
protected boolean validate() {
@@ -64,7 +64,7 @@ public class CheckAccount extends Pass<Boolean> {
UI.getMainWindow().getCallbackWindow().ShowCurrentBugReport();
}
if (Global.mainModule.getAccount().isAdmin())
Pass.passes.get(PassCode.PublishComponent).setControlsVisible(true);
Global.mainModule.getPass(PassCode.PublishComponent).setControlsVisible(true);
setControlsVisible(false); //если проверка успешна, кнопку больше не показывать.
}
}

View File

@@ -29,7 +29,7 @@ public class CloseCurrentFile extends Pass<DBProjectFile> {
//действия по закрытию. сохранение и т д.
target.form.SaveSplitters();
target.UpdateLastLine(target.form.getEditor().getCurrentLine());
passes.get(PassCode.Save).Do();
Global.mainModule.getPass(PassCode.Save).Do();
UI.getSearchReplaceWindow().ClearMarkers();
target.form = null;
}

View File

@@ -28,7 +28,7 @@ public class CloseCurrentProject extends Pass<db_project_info> {
}
@Override
protected void performPreparation() throws Exception {
passes.get(PassCode.CloseCurrentFile).Do();
Global.mainModule.getPass(PassCode.CloseCurrentFile).Do();
}
@Override
protected void body() throws Exception {

View File

@@ -68,15 +68,15 @@ public class Compile extends Pass<db_project_info> {
switch (Global.mainModule.getMachine().type) {
case Local:
if (Utils_.isWindows()) {
subpass = passes.get(PassCode.WindowsLocalCompilation);
subpass = Global.mainModule.getPass(PassCode.WindowsLocalCompilation);
} else
subpass = passes.get(PassCode.LinuxLocalCompilation);
subpass = Global.mainModule.getPass(PassCode.LinuxLocalCompilation);
break;
case Undefined:
case MVS_cluster:
throw new PassException("Компиляция не реализована для типа машины " + Utils_.DQuotes(Global.mainModule.getMachine().type));
default:
subpass = passes.get(PassCode.RemoteCompilation);
subpass = Global.mainModule.getPass(PassCode.RemoteCompilation);
break;
}
subpass.Do(Global.mainModule.getCompilationTask(), Global.mainModule.getProject());

View File

@@ -40,7 +40,7 @@ public class ConvertCorrectnessTests extends TestingSystemPass<File> {
}
@Override
protected void performPreparation() throws Exception {
passes.get(PassCode.CloseCurrentProject);
Global.mainModule.getPass(PassCode.CloseCurrentProject);
Global.mainModule.set(Current.Root, null);
Global.mainModule.set(Current.Version, null);
}
@@ -56,7 +56,7 @@ public class ConvertCorrectnessTests extends TestingSystemPass<File> {
@Override
protected void performFinish() throws Exception {
super.performFinish();
passes.get(PassCode.SynchronizeTests).Do();
Global.mainModule.getPass(PassCode.SynchronizeTests).Do();
}
}

View File

@@ -15,7 +15,7 @@ public class CopyProject extends CurrentProjectPass {
protected File dstFile = null;
protected boolean migrateData = false;
@Override
protected boolean hasStats() {
public boolean hasStats() {
return true;
}
@Override
@@ -63,8 +63,8 @@ public class CopyProject extends CurrentProjectPass {
@Override
protected void performDone() throws Exception {
if (UI_.Question("копия текущего проекта успешно создана по адресу\n" + dstFile.getAbsolutePath() + "\nОткрыть её")) {
passes.get(PassCode.CloseCurrentProject).Do();
passes.get(PassCode.OpenCurrentProject).Do(dstFile);
Global.mainModule.getPass(PassCode.CloseCurrentProject).Do();
Global.mainModule.getPass(PassCode.OpenCurrentProject).Do(dstFile);
}
}
}

View File

@@ -41,6 +41,6 @@ public class CreateEmptyProject extends Pass<File> {
}
@Override
protected void performDone() throws Exception {
passes.get(PassCode.OpenCurrentProject).Do(target);
Global.mainModule.getPass(PassCode.OpenCurrentProject).Do(target);
}
}

View File

@@ -59,12 +59,12 @@ public class CreateGroupFromDirectory extends PublishTests {
Log.Writeln_("В выбранной папке не найдено ни одной папки");
return false;
}
if (passes.get(PassCode.PublishGroup).Do(dir.getName().toUpperCase())) {
if ( Global.mainModule.getPass(PassCode.PublishGroup).Do(dir.getName().toUpperCase())) {
group = Global.mainModule.getGroup();
} else return false;
//---------------
Vector<File> files = new Vector<>(Arrays.asList(files_));
Pass.passes.get(PassCode.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, directoryChooser.getCurrentDirectory());
Global.mainModule.getPass(PassCode.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, directoryChooser.getCurrentDirectory());
return super.canStart(files, group);
}
}

View File

@@ -33,7 +33,7 @@ public class CreateGroupFromFiles extends PublishTests{
return false;
}
File dir = fileChooser.getCurrentDirectory();
Pass.passes.get(PassCode.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, dir);
Global.mainModule.getPass(PassCode.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, dir);
//---------------
if (dir.getName().equals(Constants.data)) {
Log.Writeln_(Utils_.Brackets(dir) + "\nявляется служебной папкой визуализатора!");
@@ -45,7 +45,7 @@ public class CreateGroupFromFiles extends PublishTests{
+ Utils_.printAllForbiddenCharacters() + ", или кириллицу.");
return false;
}
if (passes.get(PassCode.PublishGroup).Do(dir.getName().toUpperCase())) {
if ( Global.mainModule.getPass(PassCode.PublishGroup).Do(dir.getName().toUpperCase())) {
group = Global.mainModule.getGroup();
} else return false;
//--

View File

@@ -38,7 +38,7 @@ public class CreateTestFromDirectory extends Pass<Test> {
boolean from_files_chooser = false;
//--
void saveDirectory() {
Pass.passes.get(PassCode.UpdateSetting).Do(SettingName.ProjectsSearchDirectory,
Global.mainModule.getPass(PassCode.UpdateSetting).Do(SettingName.ProjectsSearchDirectory,
(dir.getParentFile() == null) ? dir.getAbsolutePath() : dir.getParent()
);
}
@@ -215,6 +215,6 @@ public class CreateTestFromDirectory extends Pass<Test> {
protected void performDone() throws Exception {
super.performDone();
if (from_files_chooser)
passes.get(PassCode.PublishTest).Do(target);
Global.mainModule.getPass(PassCode.PublishTest).Do(target);
}
}

View File

@@ -29,7 +29,7 @@ public class CreateTestsFromFiles extends PublishTests {
Log.Writeln_("Не выбрано ни одного файла.");
return false;
}
Pass.passes.get(PassCode.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, fileChooser.getCurrentDirectory());
Global.mainModule.getPass(PassCode.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, fileChooser.getCurrentDirectory());
return super.canStart(files, Global.mainModule.getGroup());
}
return false;

View File

@@ -35,7 +35,7 @@ public class CreateTestsGroupFromSelectedVersions extends PublishTests {
return false;
}
//---
Pass createTestPass = passes.get(getCreateTestCode());
Pass createTestPass = Global.mainModule.getPass(getCreateTestCode());
//---
for (db_project_info version : versions) {
if (createTestPass.Do(version, group))

View File

@@ -1,5 +1,4 @@
package Visual_DVM_2021.Passes.All;
import Common.Current_;
import Common.Utils.Utils_;
import Common.Visual.UI_;
import _VisualDVM.Current;
@@ -7,7 +6,6 @@ import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.PassMenuItem;
import _VisualDVM.Visual.UI;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.GlobalDatabase;
import _VisualDVM.GlobalData.Settings.SettingName;
import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.Project.db_project_info;
@@ -62,7 +60,7 @@ public class DVMConvertProject extends ComponentsRepositoryPass<db_project_info>
FileUtils.forceMkdir(cleanCopy);
archive = Paths.get(workspace.getAbsolutePath(), target.name + ".zip").toFile();
target.Clone(cleanCopy, false);
if (!passes.get(PassCode.ZipFolderPass).Do(cleanCopy.getAbsolutePath(), archive.getAbsolutePath())) {
if (! Global.mainModule.getPass(PassCode.ZipFolderPass).Do(cleanCopy.getAbsolutePath(), archive.getAbsolutePath())) {
Log.Writeln_("Не удалось создать архив проекта!");
return false;
}
@@ -86,7 +84,7 @@ public class DVMConvertProject extends ComponentsRepositoryPass<db_project_info>
return "/icons/Transformations/" + code().toString() + ".png";
}
@Override
protected boolean hasStats() {
public boolean hasStats() {
return true;
}
@Override
@@ -108,7 +106,7 @@ public class DVMConvertProject extends ComponentsRepositoryPass<db_project_info>
versionArchive = new File(workspace, target.name + "_result.zip");
response.Unpack(versionArchive);
File result = new File(workspace, "result");
if (passes.get(PassCode.UnzipFolderPass).Do(versionArchive.getAbsolutePath(), result.getAbsolutePath())) {
if ( Global.mainModule.getPass(PassCode.UnzipFolderPass).Do(versionArchive.getAbsolutePath(), result.getAbsolutePath())) {
if (target.last_modification == null) {
target.last_modification = new db_project_info(target,
"m",

View File

@@ -16,7 +16,7 @@ public class DeleteBugReport extends DeleteObjectPass<BugReport> {
@Override
protected void performDone() throws Exception {
super.performDone();
passes.get(PassCode.DeleteBugReportFromServer).Do(target);
Global.mainModule.getPass(PassCode.DeleteBugReportFromServer).Do(target);
}
@Override
protected Database getDb() {

View File

@@ -37,7 +37,7 @@ public class DeleteDirectory extends ChangeFilePass {
@Override
protected void performPreparation() throws Exception {
if (Global.mainModule.HasFile() && (Utils.isAnchestor(Global.mainModule.getFile().file, target_dir)))
passes.get(PassCode.CloseCurrentFile).Do();
Global.mainModule.getPass(PassCode.CloseCurrentFile).Do();
}
@Override
protected void body() throws Exception {

View File

@@ -21,8 +21,8 @@ public class DeleteDownloadedBugReports extends Pass<DirInfosDataSet> {
@Override
protected boolean canStart(Object... args) throws Exception {
target = null;
if (passes.get(PassCode.GetOldBugReports).Do()){
target = (DirInfosDataSet) passes.get(PassCode.GetOldBugReports).target;
if ( Global.mainModule.getPass(PassCode.GetOldBugReports).Do()){
target = (DirInfosDataSet) Global.mainModule.getPass(PassCode.GetOldBugReports).target;
if (target.Data.isEmpty()){
Log.Writeln_("Не найдено отчетов, не использовавшихся " +
(Global.mainModule.getDb()).settings.get(SettingName.BugReportsAgeLimit).toInt32() +
@@ -59,7 +59,7 @@ public class DeleteDownloadedBugReports extends Pass<DirInfosDataSet> {
@Override
protected void performPreparation() throws Exception {
if (Global.mainModule.HasProject())
passes.get(PassCode.CloseCurrentProject).Do();
Global.mainModule.getPass(PassCode.CloseCurrentProject).Do();
}
@Override
protected void body() throws Exception {

View File

@@ -24,7 +24,7 @@ public class DeleteFile extends ChangeFilePass<DBProjectFile> {
@Override
protected void performPreparation() throws Exception {
if (Global.mainModule.HasFile() && (Global.mainModule.getFile().file.equals(target.file)))
passes.get(PassCode.CloseCurrentFile).Do();
Global.mainModule.getPass(PassCode.CloseCurrentFile).Do();
}
@Override
protected void body() throws Exception {

View File

@@ -20,7 +20,7 @@ public class DeleteLonelyM extends Pass<db_project_info> {
protected void body() throws Exception {
Vector<db_project_info> targets = target.getLonelyM();
for (db_project_info m : targets) {
passes.get(PassCode.DeleteVersion).Do(m);
Global.mainModule.getPass(PassCode.DeleteVersion).Do(m);
}
}
}

View File

@@ -34,7 +34,7 @@ public class DeleteSelectedFiles extends Pass {
}
}
if (hasCurrent)
passes.get(PassCode.CloseCurrentFile).Do();
Global.mainModule.getPass(PassCode.CloseCurrentFile).Do();
if (hasSelected) {
Global.mainModule.set(Current.SelectedFile, null);
Global.mainModule.set(Current.ProjectNode, null);

View File

@@ -50,6 +50,6 @@ public class DeleteSelectedVersions extends Pass<Vector<db_project_info>> {
@Override
protected void body() throws Exception {
for (db_project_info version : target)
passes.get(PassCode.DeleteVersion).Do(version);
Global.mainModule.getPass(PassCode.DeleteVersion).Do(version);
}
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.Project.db_project_info;
import Visual_DVM_2021.Passes.CurrentProjectPass;
import Visual_DVM_2021.Passes.PassCode;
@@ -13,7 +14,7 @@ public class DeleteSubversions extends CurrentProjectPass {
protected void body() throws Exception {
Vector<db_project_info> targets = new Vector<>(target.versions.values());
for (db_project_info m : targets) {
passes.get(PassCode.DeleteVersion).Do(m);
Global.mainModule.getPass(PassCode.DeleteVersion).Do(m);
}
}
}

View File

@@ -39,7 +39,7 @@ public class DeleteVersion extends Pass<db_project_info> {
target.parent.checkLastModification(target);
if (Global.mainModule.HasProject()) {
if ((Global.mainModule.getProject().Home.getAbsolutePath().startsWith(target.Home.getAbsolutePath())))
passes.get(PassCode.CloseCurrentProject).Do();
Global.mainModule.getPass(PassCode.CloseCurrentProject).Do();
}
if (UI_.isActive()) {
UI.getVersionsWindow().RemoveVersionFromComparison(target);

View File

@@ -22,7 +22,7 @@ public class DownloadAllBugReportsArchives extends ComponentsRepositoryPass<File
}
@Override
protected void performPreparation() throws Exception {
passes.get(PassCode.CloseCurrentProject).Do();
Global.mainModule.getPass(PassCode.CloseCurrentProject).Do();
Global.mainModule.set(Current.Root, null); //чтобы гарантированно не существовало корня.
Utils.CleanDirectory(Global.BugReportsDirectory);
}
@@ -43,7 +43,7 @@ public class DownloadAllBugReportsArchives extends ComponentsRepositoryPass<File
protected void performDone() throws Exception {
File tempFolder = Utils.getTempFileName("bugsBuffer");
//-
passes.get(PassCode.UnzipFolderPass).Do(
Global.mainModule.getPass(PassCode.UnzipFolderPass).Do(
target.getAbsolutePath(),
tempFolder.getAbsolutePath()
);

View File

@@ -69,7 +69,7 @@ public class DownloadDVMPackages extends Pass<Vector<Integer>> {
//---
Utils_.bytesToFile(packed_package.getKey(), results_zip);
Utils_.bytesToFile(packed_package.getValue(), dvmPackage.getJsonFile());
passes.get(PassCode.UnzipFolderPass).Do(results_zip.getAbsolutePath(), workspace.getAbsolutePath());
Global.mainModule.getPass(PassCode.UnzipFolderPass).Do(results_zip.getAbsolutePath(), workspace.getAbsolutePath());
FileUtils.writeStringToFile(loaded, new Date().toString());
}
}

View File

@@ -54,9 +54,9 @@ public class DownloadProject extends CurrentConnectionPass {
protected void performDone() throws Exception {
File project = Paths.get(Global.visualiser.getWorkspace().getAbsolutePath(),
Utils_.getDateName(src.name)).toFile();
if (passes.get(PassCode.UnzipFolderPass).Do(local_archive.getAbsolutePath(), project.getAbsolutePath())) {
if ( Global.mainModule.getPass(PassCode.UnzipFolderPass).Do(local_archive.getAbsolutePath(), project.getAbsolutePath())) {
if (UI_.Question("Проект " + Utils_.Brackets(src.name) + " успешно загружен. Открыть его"))
passes.get(PassCode.OpenCurrentProject).Do(project);
Global.mainModule.getPass(PassCode.OpenCurrentProject).Do(project);
}
}
}

View File

@@ -51,7 +51,7 @@ public class DownloadSapforPackage extends Pass<SapforPackage> {
Utils.forceDeleteWithCheck(workspace);
File archive = Utils.getTempFileName(String.valueOf(target.id));
Utils_.bytesToFile(packed,archive);
passes.get(PassCode.UnzipFolderPass).Do(archive.getAbsolutePath(), Global.SapforPackagesDirectory.getAbsolutePath());
Global.mainModule.getPass(PassCode.UnzipFolderPass).Do(archive.getAbsolutePath(), Global.SapforPackagesDirectory.getAbsolutePath());
FileUtils.writeStringToFile(loaded, new Date().toString());
}
}

View File

@@ -29,7 +29,7 @@ public class DownloadTest extends TestingSystemPass<Test> {
}
@Override
protected void performPreparation() throws Exception {
passes.get(PassCode.CloseCurrentProject).Do();
Global.mainModule.getPass(PassCode.CloseCurrentProject).Do();
Global.mainModule.set(Current.Root, null); //чтобы гарантированно не существовало корня.
Utils.forceDeleteWithCheck(target.getArchive());
Utils.forceDeleteWithCheck(target.getHomePath());
@@ -46,14 +46,14 @@ public class DownloadTest extends TestingSystemPass<Test> {
@Override
protected void performDone() throws Exception {
super.performDone();
if (passes.get(PassCode.UnzipFolderPass).Do(
if ( Global.mainModule.getPass(PassCode.UnzipFolderPass).Do(
target.getArchive().getAbsolutePath(),
Global.visualiser.getWorkspace().getAbsolutePath(), false
))
if (UI_.Question("Тестовый проект успешно загружен под именем\n" +
Utils_.Brackets(target.getHomePath().getName()) +
"\nОткрыть его"))
passes.get(PassCode.OpenCurrentProject).Do(target.getHomePath());
Global.mainModule.getPass(PassCode.OpenCurrentProject).Do(target.getHomePath());
}
}

View File

@@ -28,6 +28,6 @@ public class ExcludeSelectedFiles extends Pass<Vector<DBProjectFile>> {
@Override
protected void body() throws Exception {
for (DBProjectFile file : target)
passes.get(PassCode.ExcludeFile).Do(file);
Global.mainModule.getPass(PassCode.ExcludeFile).Do(file);
}
}

View File

@@ -78,7 +78,7 @@ public class ExportDVMPackageToExcel extends Pass<Vector<DVMPackage>> {
}
}
}
if (!passes.get(PassCode.DownloadDVMPackages).Do(packagesToDownload))
if (! Global.mainModule.getPass(PassCode.DownloadDVMPackages).Do(packagesToDownload))
{
return false;
}

View File

@@ -1,6 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.Module.Module;
@@ -28,7 +27,7 @@ public class GCOV extends Precompilation {
return "/icons/GCOV.PNG";
}
@Override
protected boolean hasStats() {
public boolean hasStats() {
return true;
}
@Override

View File

@@ -1,7 +1,8 @@
package Visual_DVM_2021.Passes.All;
import Common.Passes.Pass;
import Common.Visual.Windows.Dialog.VFileChooser;
import Visual_DVM_2021.Passes.PassCode;
import Common.Passes.Pass;
import _VisualDVM.Global;
import java.io.File;
import java.util.Arrays;
@@ -21,6 +22,6 @@ public class ImportFiles extends Pass<Vector<File>> {
@Override
protected void body() throws Exception {
for (File file : target)
passes.get(PassCode.AddFile).Do(file);
Global.mainModule.getPass(PassCode.AddFile).Do(file);
}
}

View File

@@ -27,6 +27,6 @@ public class IncludeSelectedFiles extends Pass<Vector<DBProjectFile>> {
@Override
protected void body() throws Exception {
for (DBProjectFile file : target)
passes.get(PassCode.IncludeFile).Do(file);
Global.mainModule.getPass(PassCode.IncludeFile).Do(file);
}
}

View File

@@ -27,21 +27,21 @@ public class InitialiseUser extends Pass {
protected void body() throws Exception {
switch (Global.mainModule.getMachine().type) {
case Local:
passes.get(PassCode.LocalInitaliseUser).Do();
Global.mainModule.getPass(PassCode.LocalInitaliseUser).Do();
break;
case Server:
case MVS_cluster:
if (passes.get(PassCode.CheckRemoteWorkspace).Do()) {
SubscriberWorkspace workspace = (SubscriberWorkspace) passes.get(PassCode.CheckRemoteWorkspace).target;
if ( Global.mainModule.getPass(PassCode.CheckRemoteWorkspace).Do()) {
SubscriberWorkspace workspace = (SubscriberWorkspace) Global.mainModule.getPass(PassCode.CheckRemoteWorkspace).target;
if (workspace == null) {
if (passes.get(PassCode.RemoteInitialiseUser).Do()){
if ( Global.mainModule.getPass(PassCode.RemoteInitialiseUser).Do()){
workspace = new SubscriberWorkspace();
workspace.email=Global.mainModule.getAccount().email;
workspace.URL=Global.mainModule.getMachine().getURL();
workspace.login=Global.mainModule.getUser().login;
workspace.path=((RemoteFile) passes.get(PassCode.RemoteInitialiseUser).target).full_name;
workspace.path=((RemoteFile) Global.mainModule.getPass(PassCode.RemoteInitialiseUser).target).full_name;
//---
if (passes.get(PassCode.PublishRemoteWorkspace).Do(workspace)) {
if ( Global.mainModule.getPass(PassCode.PublishRemoteWorkspace).Do(workspace)) {
Global.mainModule.getUser().workspace = workspace.path;
Global.mainModule.getUser().state = UserState.ready_to_work;
Global.mainModule.getDb().Update(Global.mainModule.getUser());

View File

@@ -1,8 +1,9 @@
package Visual_DVM_2021.Passes.All;
import _VisualDVM.ProjectData.SapforData.Arrays.ArrayState;
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
import Visual_DVM_2021.Passes.PassCode;
import Visual_DVM_2021.Passes.SapforModification;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.SapforData.Arrays.ArrayState;
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
import java.util.Vector;
@@ -40,7 +41,7 @@ public class MassSelectArrays extends SapforModification {
states.add(String.valueOf(new_state.ordinal()));
}
}
if (passes.get(PassCode.SPF_ParseFilesWithOrder).isDone()) {
if ( Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).isDone()) {
needs_sapfor = true;
addOpt1 = String.join("|", keys);
addOpt2 = String.join("|", states);

View File

@@ -42,15 +42,15 @@ public class OpenBugReportTestProject extends Pass<BugReport> {
}
@Override
protected void performPreparation() throws Exception {
passes.get(PassCode.CloseCurrentProject).Do();
Global.mainModule.getPass(PassCode.CloseCurrentProject).Do();
Global.mainModule.set(Current.Root, null); //чтобы гарантированно не существовало корня.
}
@Override
protected void body() throws Exception {
//попытка скачки. проверка существования архива уже там.
passes.get(PassCode.DownloadBugReport).Do(target);
Global.mainModule.getPass(PassCode.DownloadBugReport).Do(target);
if (BugReportInterface.getArchiveFile(target).exists()) {
passes.get(PassCode.UnzipFolderPass).Do(
Global.mainModule.getPass(PassCode.UnzipFolderPass).Do(
BugReportInterface.getArchiveFile(target).getAbsolutePath(),
root.getAbsolutePath()
);
@@ -67,7 +67,7 @@ public class OpenBugReportTestProject extends Pass<BugReport> {
}
@Override
protected void performDone() throws Exception {
if (passes.get(PassCode.OpenCurrentProject).Do(project))
passes.get(PassCode.ApplyBugReportSettings).Do();
if ( Global.mainModule.getPass(PassCode.OpenCurrentProject).Do(project))
Global.mainModule.getPass(PassCode.ApplyBugReportSettings).Do();
}
}

View File

@@ -16,7 +16,7 @@ public class OpenCurrentFile extends Pass<DBProjectFile> {
@Override
protected void performPreparation() throws Exception {
//закрыть старый текущий файл.
passes.get(PassCode.CloseCurrentFile).Do();
Global.mainModule.getPass(PassCode.CloseCurrentFile).Do();
}
@Override
protected void body() throws Exception {

View File

@@ -73,7 +73,7 @@ public class OpenCurrentProject extends Pass<db_project_info> {
}
@Override
protected void performPreparation() throws Exception {
passes.get(PassCode.CloseCurrentProject).Do();
Global.mainModule.getPass(PassCode.CloseCurrentProject).Do();
}
@Override
protected void body() throws Exception {
@@ -110,8 +110,8 @@ public class OpenCurrentProject extends Pass<db_project_info> {
Global.mainModule.set(Current.ProjectView, ProjectView.Files);
if (root_changes)
Global.mainModule.set(Current.Root, new_root);
Pass.passes.get(PassCode.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, dir.getParent());
Pass.passes.get(PassCode.UpdateSetting).Do(
Global.mainModule.getPass(PassCode.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, dir.getParent());
Global.mainModule.getPass(PassCode.UpdateSetting).Do(
SettingName.FREE_FORM, target.style.equals(LanguageStyle.free) ? "1" : "0")
;
DBLastProject lastProject;
@@ -134,7 +134,7 @@ public class OpenCurrentProject extends Pass<db_project_info> {
//-
UI.getMainWindow().ShowProject();
//криво. но при тихом режиме открытие файлов все равно не понадобится.
passes.get(PassCode.OpenCurrentFile).Do(target.getLastOpenedFile());
Global.mainModule.getPass(PassCode.OpenCurrentFile).Do(target.getLastOpenedFile());
}
@Override
protected void FocusResult() {

View File

@@ -13,7 +13,7 @@ public class OpenProject extends Pass<db_project_info> {
}
@Override
protected void performPreparation() throws Exception {
passes.get(PassCode.CloseProject).Do();
Global.mainModule.getPass(PassCode.CloseProject).Do();
}
@Override
protected void body() throws Exception {

View File

@@ -45,7 +45,7 @@ public class PickCompilerEnvironments extends Pass<String> {
return false;
}
//-
if (!(compiler.helpLoaded || passes.get(PassCode.ShowCompilerHelp).Do(compiler, false)))
if (!(compiler.helpLoaded || Global.mainModule.getPass(PassCode.ShowCompilerHelp).Do(compiler, false)))
return false;
//-
Dialog<String, CompilerEnvironmentsFields> dialog =

View File

@@ -27,7 +27,7 @@ public class PickCompilerEnvironmentsForTesting extends Pass<String> {
Log.Writeln_("Выбор переменных окружения возможен только для DVM компилятора,");
return false;
}
if (!(compiler.helpLoaded || passes.get(PassCode.ShowCompilerHelp).Do(compiler, false)))
if (!(compiler.helpLoaded || Global.mainModule.getPass(PassCode.ShowCompilerHelp).Do(compiler, false)))
return false;
Dialog<String, CompilerEnvironmentsFields> dialog =
new Dialog<String, CompilerEnvironmentsFields>(CompilerEnvironmentsFields.class) {

View File

@@ -1,11 +1,12 @@
package Visual_DVM_2021.Passes.All;
import Common.Passes.Pass;
import Common.Visual.Windows.Dialog.Dialog;
import Visual_DVM_2021.Passes.PassCode;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.Compiler.CompilerType;
import _VisualDVM.GlobalData.CompilerOption.CompilerOption;
import _VisualDVM.GlobalData.CompilerOption.UI.CompilerOptionsFields;
import Visual_DVM_2021.Passes.PassCode;
import Common.Passes.Pass;
import javax.swing.*;
import java.util.Vector;
@@ -23,7 +24,7 @@ public class PickCompilerOptions extends Pass<String> {
Log.Writeln_("Выбор опций возможен только для DVM компилятора,");
return false;
}
if (!(compiler.helpLoaded || passes.get(PassCode.ShowCompilerHelp).Do(compiler, false)))
if (!(compiler.helpLoaded || Global.mainModule.getPass(PassCode.ShowCompilerHelp).Do(compiler, false)))
return false;
Dialog<String, CompilerOptionsFields> dialog = new Dialog<String, CompilerOptionsFields>(CompilerOptionsFields.class) {
@Override

View File

@@ -57,14 +57,14 @@ public class Precompilation extends Pass<db_project_info> {
Log.Writeln_("Не задан путь к make.exe.\n " +
"Укажите его в меню глобальных настроек." +
"\редварительная компиляция будет отключена.");
passes.get(PassCode.UpdateSetting).Do(SettingName.Precompilation, "0");
Global.mainModule.getPass(PassCode.UpdateSetting).Do(SettingName.Precompilation, "0");
return false;
}
if (!(new File(makepath).exists())) {
Log.Writeln_("Файла по пути к make.exe не существует.\n" +
"Проверьте правильность его указания в глобальных настройках."+
"\редварительная компиляция будет отключена.");
passes.get(PassCode.UpdateSetting).Do(SettingName.Precompilation, "0");
Global.mainModule.getPass(PassCode.UpdateSetting).Do(SettingName.Precompilation, "0");
return false;
}
//--
@@ -89,7 +89,7 @@ public class Precompilation extends Pass<db_project_info> {
protected void performPreparation() throws Exception {
target.CleanInterruptFile();
//-
passes.get(PassCode.Save).Do(); //---->
Global.mainModule.getPass(PassCode.Save).Do(); //---->
prepareForParse(); //---->
//-
performanceTime = 0;

View File

@@ -53,7 +53,7 @@ public class PublishBugReport extends Pass<BugReport> {
@Override
protected void performDone() throws Exception {
//2 - Отправка на сервер, с активным состоянием?
passes.get(PassCode.SendBugReport).Do();
Global.mainModule.getPass(PassCode.SendBugReport).Do();
Global.componentsServer.db.Update(target);
//3- рассылка
EmailMessage message = new EmailMessage("Обнаружена ошибка " + Utils_.Brackets(target.id),
@@ -68,7 +68,7 @@ public class PublishBugReport extends Pass<BugReport> {
message.addAttachement(screen);
}
}
passes.get(PassCode.Email).Do(message);
Global.mainModule.getPass(PassCode.Email).Do(message);
}
@Override
protected void showDone() throws Exception {

View File

@@ -112,12 +112,12 @@ public class PublishComponent extends ComponentsRepositoryPass<Component> {
new Vector<>(Global.componentsServer.db.subscribers.Data.keySet()));
if (f.fields.cbForceMail.isSelected())
message.addAttachement(target.getFile());
Pass.passes.get(PassCode.Email).Do(message);
Global.mainModule.getPass(PassCode.Email).Do(message);
//---
if (target.getComponentType().equals(ComponentType.Sapfor_F) && f.fields.cbAssemblyOnServer.isSelected()) {
UI.getMainWindow().FocusTesting();
UI.getMainWindow().getTestingWindow().FocusSapforTesting();
passes.get(PassCode.CompileServerSapfor).Do();
Global.mainModule.getPass(PassCode.CompileServerSapfor).Do();
}
}
}

View File

@@ -24,9 +24,9 @@ public class PublishComponentsServer extends RepositoryServerSSHPass {
//3. запустить сервер.
@Override
protected void ServerAction() throws Exception {
if (passes.get(PassCode.PingComponentsServer).Do(true))
if ( Global.mainModule.getPass(PassCode.PingComponentsServer).Do(true))
ShutdownServer();
if (passes.get(PassCode.PingComponentsServer).Do(true)) {
if ( Global.mainModule.getPass(PassCode.PingComponentsServer).Do(true)) {
throw new PassException("Не удалось остановить сервер.");
}
File src = Global.visualiser.getFile();
@@ -40,7 +40,7 @@ public class PublishComponentsServer extends RepositoryServerSSHPass {
@Override
protected boolean validate() {
if (!passes.get(PassCode.PingComponentsServer).Do(true)) {
if (! Global.mainModule.getPass(PassCode.PingComponentsServer).Do(true)) {
Log.Writeln_("Не удалось запустить сервер.");
}
return true;

View File

@@ -24,9 +24,9 @@ public class PublishTestingServer extends RepositoryServerSSHPass {
//3. запустить сервер.
@Override
protected void ServerAction() throws Exception {
if (passes.get(PassCode.PingTestingServer).Do(true))
if ( Global.mainModule.getPass(PassCode.PingTestingServer).Do(true))
ShutdownServer();
if (passes.get(PassCode.PingTestingServer).Do(true)) {
if ( Global.mainModule.getPass(PassCode.PingTestingServer).Do(true)) {
throw new PassException("Не удалось остановить сервер.");
}
File src = Global.visualiser.getFile();
@@ -41,7 +41,7 @@ public class PublishTestingServer extends RepositoryServerSSHPass {
@Override
protected boolean validate() {
if (!passes.get(PassCode.PingTestingServer).Do(true)) {
if (! Global.mainModule.getPass(PassCode.PingTestingServer).Do(true)) {
Log.Writeln_("Не удалось запустить сервер.");
}
return true;

View File

@@ -1,6 +1,7 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.Utils_;
import Common.Visual.UI_;
import _VisualDVM.Global;
import _VisualDVM.Visual.UI;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
@@ -34,7 +35,7 @@ public abstract class PublishTests extends TestingSystemPass<Vector<Test>> {
@Override
protected void performFinish() throws Exception {
super.performFinish();
passes.get(PassCode.SynchronizeTests).Do();
Global.mainModule.getPass(PassCode.SynchronizeTests).Do();
}
@Override
protected void FocusResult() {
@@ -55,7 +56,7 @@ public abstract class PublishTests extends TestingSystemPass<Vector<Test>> {
return false;
}
//---
Pass createTestPass = passes.get(getCreateTestCode());
Pass createTestPass = Global.mainModule.getPass(getCreateTestCode());
//---
for (File file : files) {
if (createTestPass.Do(file, group))

View File

@@ -1,8 +1,9 @@
package Visual_DVM_2021.Passes.All;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
import Visual_DVM_2021.Passes.PassCode;
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
import _VisualDVM.Global;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
public class RefreshDVMTests extends TestingSystemPass<Object>{
@Override
public String getIconPath() {
@@ -19,7 +20,7 @@ public class RefreshDVMTests extends TestingSystemPass<Object>{
@Override
protected void performFinish() throws Exception {
super.performFinish();
passes.get(PassCode.SynchronizeTests).Do();
Global.mainModule.getPass(PassCode.SynchronizeTests).Do();
}
//todo будет реализован когда наладится запуск сапфора на сервере тестирования.

View File

@@ -51,7 +51,7 @@ public class RenameDirectory extends ChangeFilePass {
@Override
protected void performPreparation() throws Exception {
if (current)
passes.get(PassCode.CloseCurrentFile).Do();
Global.mainModule.getPass(PassCode.CloseCurrentFile).Do();
}
@Override
protected void body() throws Exception {
@@ -84,7 +84,7 @@ public class RenameDirectory extends ChangeFilePass {
Global.mainModule.getSapfor().ResetAllAnalyses();
Global.mainModule.set(Current.SelectedDirectory, dst);
if (current && new_current_file != null)
passes.get(PassCode.OpenCurrentFile).Do(new_current_file);
Global.mainModule.getPass(PassCode.OpenCurrentFile).Do(new_current_file);
}
@Override
protected void showDone() throws Exception {

View File

@@ -45,7 +45,7 @@ public class RenameFile extends ChangeFilePass<DBProjectFile> {
@Override
protected void performPreparation() throws Exception {
if (current)
passes.get(PassCode.CloseCurrentFile).Do();
Global.mainModule.getPass(PassCode.CloseCurrentFile).Do();
}
@Override
protected void body() throws Exception {
@@ -62,7 +62,7 @@ public class RenameFile extends ChangeFilePass<DBProjectFile> {
Global.mainModule.getSapfor().ResetAllAnalyses();
Global.mainModule.set(Current.SelectedFile, target);
if (current)
passes.get(PassCode.OpenCurrentFile).Do(target);
Global.mainModule.getPass(PassCode.OpenCurrentFile).Do(target);
}
@Override
protected void showDone() throws Exception {

View File

@@ -31,7 +31,7 @@ public class ReplaceTestProject extends CreateTestFromProject {
}
};
testingSystemPass.Do(target);
passes.get(PassCode.SynchronizeTests).Do();
Global.mainModule.getPass(PassCode.SynchronizeTests).Do();
}
@Override
protected boolean initTarget() throws Exception {

View File

@@ -43,7 +43,7 @@ public class ReplaceTestsFromFiles extends TestingSystemPass<Vector<Test>> {
//---------------------------------------------------------------
//--
File dir = fileChooser.getCurrentDirectory();
Pass.passes.get(PassCode.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, dir);
Global.mainModule.getPass(PassCode.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, dir);
//---------------
if (dir.getName().equals(Constants.data)) {
Log.Writeln_(Utils_.Brackets(dir) + "\nявляется служебной папкой визуализатора!");
@@ -99,7 +99,7 @@ public class ReplaceTestsFromFiles extends TestingSystemPass<Vector<Test>> {
"Продолжить"
)) {
replaceTests = new Vector<>();
Pass createTestPass = passes.get(PassCode.CreateTestFromFile);
Pass createTestPass = Global.mainModule.getPass(PassCode.CreateTestFromFile);
for (Test old_test : oldTests.values()) {
File file = filesByNames.get(old_test.description);
if (createTestPass.Do(file, group)) {
@@ -133,6 +133,6 @@ public class ReplaceTestsFromFiles extends TestingSystemPass<Vector<Test>> {
@Override
protected void performFinish() throws Exception {
super.performFinish();
passes.get(PassCode.SynchronizeTests).Do();
Global.mainModule.getPass(PassCode.SynchronizeTests).Do();
}
}

View File

@@ -8,8 +8,8 @@ import _VisualDVM.Global;
public class ResetCurrentProject extends CurrentProjectPass {
@Override
protected void performPreparation() throws Exception {
passes.get(PassCode.DeleteDebugResults).Do();
passes.get(PassCode.CloseCurrentProject).Do();
Global.mainModule.getPass(PassCode.DeleteDebugResults).Do();
Global.mainModule.getPass(PassCode.CloseCurrentProject).Do();
Global.mainModule.set(Current.Root, null);
}
@Override
@@ -20,6 +20,6 @@ public class ResetCurrentProject extends CurrentProjectPass {
}
@Override
protected void performDone() throws Exception {
passes.get(PassCode.OpenCurrentProject).Do(target.Home);
Global.mainModule.getPass(PassCode.OpenCurrentProject).Do(target.Home);
}
}

View File

@@ -37,9 +37,9 @@ public class ResurrectComponentFromServer extends CurrentComponentPass {
protected boolean canStart(Object... args) throws Exception {
remoteFile = null;
localFile = null;
if (super.canStart() && passes.get(PassCode.GetComponentsBackupsFromServer).Do()) {
if (super.canStart() && Global.mainModule.getPass(PassCode.GetComponentsBackupsFromServer).Do()) {
//1. Получить список бекапов.
backups = (Vector<RemoteFile>) passes.get(PassCode.GetComponentsBackupsFromServer).target;
backups = (Vector<RemoteFile>) Global.mainModule.getPass(PassCode.GetComponentsBackupsFromServer).target;
backups.sort((o1, o2) -> o2.name.compareTo(o1.name));
Dialog d = new Dialog(null) {
@Override

View File

@@ -62,9 +62,9 @@ public class Run extends Pass<db_project_info> {
switch (Global.mainModule.getMachine().type) {
case Local:
if (Utils_.isWindows()) {
subpass = passes.get(PassCode.WindowsLocalRun);
subpass = Global.mainModule.getPass(PassCode.WindowsLocalRun);
} else
subpass = passes.get(PassCode.LinuxLocalRun);
subpass = Global.mainModule.getPass(PassCode.LinuxLocalRun);
break;
case Undefined:
case MVS_cluster:
@@ -75,7 +75,7 @@ public class Run extends Pass<db_project_info> {
break;
*/
default:
subpass = passes.get(PassCode.ServerRun);
subpass = Global.mainModule.getPass(PassCode.ServerRun);
break;
}
int i = 1;
@@ -96,7 +96,7 @@ public class Run extends Pass<db_project_info> {
task_completed = true;
if (task.hasDvmSts) {
Utils.CheckAndCleanDirectory(Global.mainModule.getProject().getStatisticDirectory());
Pass.passes.get(PassCode.SPF_StatisticAnalyzer).Do(task);
Global.mainModule.getPass(PassCode.SPF_StatisticAnalyzer).Do(task);
}
break;
case Finished:

View File

@@ -12,7 +12,7 @@ public class SPF_CreateParallelVariant extends SapforTransformation {
return TransformationPermission.VariantsOnly;
}
@Override
protected boolean hasStats() {
public boolean hasStats() {
return false;
}
@Override

View File

@@ -11,7 +11,7 @@ public class SPF_GetArrayDistribution extends SPF_GetArrayDistributionOnlyAnalys
@Override
protected void performDone() throws Exception {
super.performDone();
SapforAnalysis code_analysis = (SapforAnalysis) passes.get(PassCode.SPF_GetArrayDistributionOnlyAnalysis);
SapforAnalysis code_analysis = (SapforAnalysis) Global.mainModule.getPass(PassCode.SPF_GetArrayDistributionOnlyAnalysis);
if (!code_analysis.isDone()) {
code_analysis.setDone();
code_analysis.MarkAsDone();
@@ -34,7 +34,7 @@ public class SPF_GetArrayDistribution extends SPF_GetArrayDistributionOnlyAnalys
if (Global.mainModule.getDb().settings.get(SettingName.MPI_PROGRAM).toBoolean()) {
UI_.Info("Включена настройка SAPFOR 'MPI программа'." +
"\остроение распределения данных невозможно.");
passes.get(PassCode.SPF_SharedMemoryParallelization).Do();
Global.mainModule.getPass(PassCode.SPF_SharedMemoryParallelization).Do();
return false;
}
return super.canStart(args);

View File

@@ -1,6 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Visual.UI_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import Common.Passes.PassState;
import _VisualDVM.Visual.Controls.PassControl;
@@ -16,14 +15,14 @@ public class SPF_GetGCovInfo extends SilentSapforPass {
return "/icons/Pick.png";
}
@Override
protected boolean hasStats() {
public boolean hasStats() {
return true;
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (UI_.Question("Все анализы будут сброшены.Продолжить")) {
SPF_ParseFilesWithOrder.silent = true;
return super.canStart(args) && passes.get(PassCode.GCOV).Do()&&passes.get(PassCode.SPF_ParseFilesWithOrder).Do();
return super.canStart(args) && Global.mainModule.getPass(PassCode.GCOV).Do()&& Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).Do();
}
return false;
}

View File

@@ -31,7 +31,7 @@ public class SPF_GetGraphFunctionPositions extends SilentSapforPass {
public static String filterName = "";
@Override
protected boolean canStart(Object... args) throws Exception {
return passes.get(PassCode.SPF_GetGraphFunctions).isDone() && super.canStart(args);
return Global.mainModule.getPass(PassCode.SPF_GetGraphFunctions).isDone() && super.canStart(args);
}
//--------------------
@Override

View File

@@ -142,6 +142,6 @@ public class SPF_GetGraphFunctions extends SapforAnalysis {
UI.getMainWindow().getProjectWindow().getAnalysisWindow().ShowRegions();
if (Global.mainModule.HasFile())
Global.mainModule.getFile().form.ShowFunctions();
passes.get(PassCode.SPF_GetGraphFunctionPositions).Do();
Global.mainModule.getPass(PassCode.SPF_GetGraphFunctionPositions).Do();
}
}

View File

@@ -15,7 +15,7 @@ public class SPF_GetMaxMinBlockDistribution extends SilentSapforPass {
protected boolean canStart(Object... args) throws Exception {
if (super.canStart(args)){
SPF_ParseFilesWithOrder.silent = true;
return (passes.get(PassCode.SPF_ParseFilesWithOrder).isDone() || passes.get(PassCode.SPF_ParseFilesWithOrder).Do());
return ( Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).isDone() || Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).Do());
}
return false;
}

View File

@@ -20,7 +20,7 @@ public class SPF_InlineProcedure extends SapforFilesModification {
Global.changeSetting(SettingName.PARSE_FOR_INLINE, "1");
// Pass_2021.passes.get(PassCode_2021.UpdateSetting).Do(SettingName.PARSE_FOR_INLINE, "1");
SPF_ParseFilesWithOrder.silent = true;
return passes.get(PassCode.SPF_ParseFilesWithOrder).Do();
return Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).Do();
}
return false;
}

View File

@@ -45,7 +45,7 @@ public class SPF_InlineProcedures extends SapforTransformation {
Options = Utils_.toU(String.join("|", Result));
Global.changeSetting(SettingName.PARSE_FOR_INLINE, "1");
SPF_ParseFilesWithOrder.silent = true;
return passes.get(PassCode.SPF_ParseFilesWithOrder).Do(false);
return Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).Do(false);
}
return false;
}

View File

@@ -75,7 +75,7 @@ public class SPF_InlineProceduresH extends SapforTransformation {
Options = Utils_.toU(String.join("|", Result));
Global.changeSetting(SettingName.PARSE_FOR_INLINE, "1");
SPF_ParseFilesWithOrder.silent = true;
return passes.get(PassCode.SPF_ParseFilesWithOrder).Do();
return Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).Do();
}
return false;
}

View File

@@ -24,7 +24,7 @@ public class SPF_ModifyArrayDistribution extends SapforModification {
@Override
protected boolean canStart(Object... args) throws Exception {
region = null;
if (Global.mainModule.Check(Log, Current.ParallelRegion) && super.canStart(args) && passes.get(PassCode.SPF_GetArrayLinks).Do()) {
if (Global.mainModule.Check(Log, Current.ParallelRegion) && super.canStart(args) && Global.mainModule.getPass(PassCode.SPF_GetArrayLinks).Do()) {
region = Global.mainModule.getParallelRegion();
DBObjectDialog dialog = new DBObjectDialog<ParallelRegion, ParallelRegionFields>(ParallelRegionFields.class) {
@Override
@@ -92,7 +92,7 @@ public class SPF_ModifyArrayDistribution extends SapforModification {
@Override
protected void performDone() throws Exception {
super.performDone();
passes.get(PassCode.SPF_GetArrayDistribution).Do();
Global.mainModule.getPass(PassCode.SPF_GetArrayDistribution).Do();
}
//распаковать журнал
@Override

View File

@@ -46,7 +46,7 @@ public class SPF_ParseFilesWithOrder extends SapforAnalysis {
boolean res = (
silent ||
(!Global.mainModule.getDb().settings.get(SettingName.Precompilation).toBoolean() ||
(precompilation_done = passes.get(PassCode.Precompilation).Do())))
(precompilation_done = Global.mainModule.getPass(PassCode.Precompilation).Do())))
&& super.canStart(args) && checkActiveFiles();
return res;
}
@@ -114,7 +114,7 @@ public class SPF_ParseFilesWithOrder extends SapforAnalysis {
super.performPreparation(); //удаление интеррупта.
//------------------------------------------------------------------------------------------>>> пакетный режим.
if (!precompilation_done && UI_.isActive()) {
passes.get(PassCode.Save).Do();
Global.mainModule.getPass(PassCode.Save).Do();
target.CleanAnalyses();
}
//перезапуск сапфора.------
@@ -155,7 +155,7 @@ public class SPF_ParseFilesWithOrder extends SapforAnalysis {
super.performDone();
sapfor.Restart(); //рестарт скидывает все анализы в том числе парс и текущую папку.
sapfor.cd(target.Home);
passes.get(PassCode.RestoreSavedArrays).Do();
Global.mainModule.getPass(PassCode.RestoreSavedArrays).Do();
setDone();
/*
//особенность парса. журнал появляется только сейчас.

View File

@@ -41,9 +41,9 @@ public class ShowCompilerHelp extends Pass<String> {
subpass = null;
compiler.ResetHelp();
if (Global.mainModule.getMachine().type.equals(MachineType.Local)) {
subpass = passes.get(PassCode.LocalSingleCommand);
subpass = Global.mainModule.getPass(PassCode.LocalSingleCommand);
} else {
subpass = passes.get(PassCode.RemoteSingleCommand);
subpass = Global.mainModule.getPass(PassCode.RemoteSingleCommand);
}
if (subpass != null) {
if (compiler.helpLoaded = subpass.Do(compiler.getHelpCommand())) {

View File

@@ -43,9 +43,9 @@ public class ShowCompilerVersion extends Pass<String> {
subpass = null;
compiler.ResetVersion();
if (Global.mainModule.getMachine().type.equals(MachineType.Local)) {
subpass = passes.get(PassCode.LocalSingleCommand);
subpass = Global.mainModule.getPass(PassCode.LocalSingleCommand);
} else {
subpass = passes.get(PassCode.RemoteSingleCommand);
subpass = Global.mainModule.getPass(PassCode.RemoteSingleCommand);
}
if (subpass != null) {
if (compiler.versionLoaded = subpass.Do(compiler.getVersionCommand())) {

View File

@@ -1,6 +1,7 @@
package Visual_DVM_2021.Passes.All;
import Visual_DVM_2021.Passes.PassCode;
import Visual_DVM_2021.Passes.SSH.RepositoryServerSSHPass;
import _VisualDVM.Global;
public class ShutdownComponentsServer extends RepositoryServerSSHPass {
@Override
protected String getServerFileName() {
@@ -15,7 +16,7 @@ public class ShutdownComponentsServer extends RepositoryServerSSHPass {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (passes.get(PassCode.PingTestingServer).Do(true)){
if ( Global.mainModule.getPass(PassCode.PingTestingServer).Do(true)){
return true;
}else {
Log.Writeln_("Сервер уже неактивен!");

View File

@@ -1,6 +1,7 @@
package Visual_DVM_2021.Passes.All;
import Visual_DVM_2021.Passes.PassCode;
import Visual_DVM_2021.Passes.SSH.RepositoryServerSSHPass;
import _VisualDVM.Global;
public class ShutdownTestingServer extends RepositoryServerSSHPass {
@Override
protected String getServerFileName() {
@@ -16,7 +17,7 @@ public class ShutdownTestingServer extends RepositoryServerSSHPass {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (passes.get(PassCode.PingTestingServer).Do(true)){
if ( Global.mainModule.getPass(PassCode.PingTestingServer).Do(true)){
return true;
}else {
Log.Writeln_("Сервер уже неактивен!");

View File

@@ -1,6 +1,7 @@
package Visual_DVM_2021.Passes.All;
import Visual_DVM_2021.Passes.PassCode;
import Visual_DVM_2021.Passes.SSH.RepositoryServerSSHPass;
import _VisualDVM.Global;
public class StartComponentsServer extends RepositoryServerSSHPass {
@Override
public String getIconPath() {
@@ -15,7 +16,7 @@ public class StartComponentsServer extends RepositoryServerSSHPass {
//--
@Override
protected boolean canStart(Object... args) throws Exception {
if (passes.get(PassCode.PingComponentsServer).Do(true)) {
if ( Global.mainModule.getPass(PassCode.PingComponentsServer).Do(true)) {
Log.Writeln_("Сервер уже активен!");
return false;
}
@@ -27,6 +28,6 @@ public class StartComponentsServer extends RepositoryServerSSHPass {
}
@Override
protected boolean validate() {
return passes.get(PassCode.PingComponentsServer).Do();
return Global.mainModule.getPass(PassCode.PingComponentsServer).Do();
}
}

View File

@@ -42,7 +42,7 @@ public class StartSelectedDVMConfigurations extends PublishServerObject<TestingS
return false;
}
if (!Global.mainModule.getCompiler().versionLoaded)
passes.get(PassCode.ShowCompilerVersion).Do(Global.mainModule.getCompiler(), false);
Global.mainModule.getPass(PassCode.ShowCompilerVersion).Do(Global.mainModule.getCompiler(), false);
//-----
Vector<DVMConfiguration> configurations = Global.testingServer.db.dvm_configurations.getCheckedOrCurrent();
if (configurations.isEmpty()) {

View File

@@ -1,6 +1,7 @@
package Visual_DVM_2021.Passes.All;
import Visual_DVM_2021.Passes.PassCode;
import Visual_DVM_2021.Passes.SSH.RepositoryServerSSHPass;
import _VisualDVM.Global;
public class StartTestingServer extends RepositoryServerSSHPass {
@Override
public String getIconPath() {
@@ -12,7 +13,7 @@ public class StartTestingServer extends RepositoryServerSSHPass {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (passes.get(PassCode.PingTestingServer).Do(true)) {
if ( Global.mainModule.getPass(PassCode.PingTestingServer).Do(true)) {
Log.Writeln_("Сервер уже активен!");
return false;
}
@@ -24,7 +25,7 @@ public class StartTestingServer extends RepositoryServerSSHPass {
}
@Override
protected boolean validate() {
return passes.get(PassCode.PingTestingServer).Do();
return Global.mainModule.getPass(PassCode.PingTestingServer).Do();
}
@Override
protected String getServerFileName() {

View File

@@ -125,7 +125,7 @@ public class UpdateBugReportField extends ComponentsRepositoryPass<BugReport> {
message_header += "состояние изменилось на " + Utils_.Brackets(target.state.getDescription());
break;
}
passes.get(PassCode.Email).Do(
Global.mainModule.getPass(PassCode.Email).Do(
new EmailMessage(message_header,
message_text,
BugReportInterface.getRecipients(target))

View File

@@ -30,7 +30,7 @@ public class UpdateComponent extends Pass<Component> {
subPassCode = PassCode.DownloadComponent;
break;
}
if ((subPassCode != null) && passes.get(subPassCode).Do()) {
if ((subPassCode != null) && Global.mainModule.getPass(subPassCode).Do()) {
//</editor-fold>
if (!Global.mainModule.getComponent().getNewFile().exists())
throw new PassException("Не удалось получить новый файл для компонента " + Global.mainModule.getComponent().getComponentType().getDescription());

View File

@@ -42,7 +42,7 @@ public class UpdateSelectedComponents extends Pass<Vector<Component>> {
protected void body() throws Exception {
for (Component component : target) {
Global.Components.ui_.Select(component.getPK());
passes.get(PassCode.UpdateComponent).Do();
Global.mainModule.getPass(PassCode.UpdateComponent).Do();
}
}
}

View File

@@ -141,9 +141,9 @@ public class UpdateSetting extends Pass<DBSetting> {
Global.mainModule.getFile().form.RefreshTabsNames();
break;
case MPI_PROGRAM:
Pass.passes.get(PassCode.CleanAnalyses).Do();
Global.mainModule.getPass(PassCode.CleanAnalyses).Do();
((SPF_GetArrayDistributionOnlyAnalysis)
Pass.passes.get(PassCode.SPF_GetArrayDistributionOnlyAnalysis)).RefreshControls();
Global.mainModule.getPass(PassCode.SPF_GetArrayDistributionOnlyAnalysis)).RefreshControls();
break;
case SmallScreen:
boolean small = target.toBoolean();