постепенное выведение старой концепции текущих объектов, касаемо табличных лучше держать их в интерфейсе таблиц, чтобы не писать описание объекта дважды и не мучиться с типом. некоторые фиксы

This commit is contained in:
2024-10-24 23:40:24 +03:00
parent f811d9b3ac
commit 36c11ac93f
153 changed files with 765 additions and 739 deletions

View File

@@ -1,10 +1,10 @@
package _VisualDVM.Passes.All;
import _VisualDVM.Current;
import _VisualDVM.Passes.Testing.AbortTestingPackage;
import _VisualDVM.TestingSystem.DVM.DVMPackage.DVMPackage;
public class AbortDVMPackage extends AbortTestingPackage {
@Override
public Current currentName() {
return Current.DVMPackage;
public Class currentClass() {
return DVMPackage.class;
}
@Override
public int getAbortType() {

View File

@@ -1,10 +1,10 @@
package _VisualDVM.Passes.All;
import _VisualDVM.Current;
import _VisualDVM.Passes.Testing.AbortTestingPackage;
import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackage;
public class AbortSapforPackage extends AbortTestingPackage {
@Override
public Current currentName() {
return Current.SapforPackage;
public Class currentClass() {
return SapforPackage.class;
}
@Override
public int getAbortType() {

View File

@@ -8,7 +8,7 @@ public class AddCompiler extends AddObjectPass<Compiler> {
super(Compiler.class);
}
@Override
public Class<? extends DBObject> getOwner() {
protected Class<? extends DBObject> getOwnerClass() {
return Machine.class;
}
}

View File

@@ -8,7 +8,7 @@ public class AddDVMParameter extends AddObjectPass<DVMParameter> {
super(DVMParameter.class);
}
@Override
public Class<? extends DBObject> getOwner() {
protected Class<? extends DBObject> getOwnerClass() {
return RunConfiguration.class;
}
}

View File

@@ -10,7 +10,7 @@ public class AddMakefile extends AddObjectPass<Makefile> {
super(Makefile.class);
}
@Override
public Class<? extends DBObject> getOwner() {
protected Class<? extends DBObject> getOwnerClass() {
return Machine.class;
}
@Override

View File

@@ -8,7 +8,7 @@ public class AddRunConfiguration extends AddObjectPass<RunConfiguration> {
super(RunConfiguration.class);
}
@Override
public Class<? extends DBObject> getOwner() {
protected Class<? extends DBObject> getOwnerClass() {
return Machine.class;
}
}

View File

@@ -11,13 +11,13 @@ public class AddUser extends AddObjectPass<User> {
super(User.class);
}
@Override
public Class<? extends DBObject> getOwner() {
protected Class<? extends DBObject> getOwnerClass() {
return Machine.class;
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (super.canStart(args)) {
Machine machine = Global.mainModule.getMachine();
Machine machine = (Machine) getOwner();
if (machine.type.equals(MachineType.Local) && (machine.getUsers().size() > 0)) {
Log.Writeln_("У локальной машины может быть только один пользователь");
return false;

View File

@@ -1,6 +1,5 @@
package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
@@ -29,8 +28,8 @@ public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Global.mainModule.Check(Log, Current.BugReport)) {
target = Global.mainModule.getBugReport();
if (server.db.bugReports.getUI().Check(Log)) {
target = server.db.bugReports.getUI().getCurrent();
if (!target.CheckNotDraft(Log))
return false;
fieldName = (String) args[0];
@@ -61,7 +60,7 @@ public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
}
@Override
protected void showFinish() throws Exception {
server.db.bugReports.getUI().Refresh();
server.db.bugReports.RefreshUI();
Global.mainModule.getUI().getMainWindow().getCallbackWindow().ShowCurrentBugReport();
}
@Override

View File

@@ -22,8 +22,8 @@ public class ApplyBugReportSettings extends Pass<BugReport> {
}
@Override
protected boolean canStart(Object... args) {
if (Global.mainModule.Check(Log, Current.BugReport)) {
target = Global.mainModule.getBugReport();
if (Global.componentsServer.db.bugReports.getUI().Check(Log)) {
target = Global.componentsServer.db.bugReports.getUI().getCurrent();
long vv = target.visualiser_version;
if (vv < 500) {
Log.Writeln_("Автоматическое применение настроек поддерживается только в отчётах об ошибках,\n" +

View File

@@ -1,4 +1,5 @@
package _VisualDVM.Passes.All;
import Common.MainModule_;
import Common.Passes.Pass;
import _VisualDVM.Current;
import _VisualDVM.Global;
@@ -22,8 +23,8 @@ public class ApplyProfile extends Pass<SapforProfile> {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Global.mainModule.Check(Log, Current.SapforProfile)) {
target = (SapforProfile) Global.mainModule.get(Current.SapforProfile);
if (MainModule_.instance.getDb().getTable(SapforProfile.class).getUI().Check(Log)) {
target = MainModule_.instance.getDb().getTable(SapforProfile.class).getUI().getCurrent();
return true;
}
return false;

View File

@@ -19,7 +19,7 @@ public class BuildComponent extends ProcessPass<Component> {
}
@Override
protected boolean canStart(Object... args) throws Exception {
target = Global.mainModule.getComponent();
target = Global.components.getUI().getCurrent();
return true;
}
@Override

View File

@@ -56,7 +56,7 @@ public class CheckAccount extends Pass<Boolean> {
protected void showDone() throws Exception {
if (Global.mainModule.getUI().getMainWindow() != null) {
Global.mainModule.getUI().getMainWindow().getCallbackWindow().ShowAccount();
if (Global.mainModule.HasBugReport())
if (Global.componentsServer.db.bugReports.getUI().getCurrent()!=null)
Global.mainModule.getUI().getMainWindow().getCallbackWindow().ShowCurrentBugReport();
}
if (Global.mainModule.getAccount().isAdmin())

View File

@@ -1,5 +1,8 @@
package _VisualDVM.Passes.All;
import Common.MainModule_;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.User.User;
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
@@ -13,8 +16,8 @@ public class CheckRemoteWorkspace extends ComponentsRepositoryPass<SubscriberWor
@Override
protected void ServerAction() throws Exception {
String email = Global.mainModule.getAccount().email;
String machineURL = Global.mainModule.getMachine().getURL();
String login = Global.mainModule.getUser().login;
String machineURL = MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().getURL();
String login = MainModule_.instance.getDb().getTable(User.class).getUI().getCurrent().login;
Command(new ServerExchangeUnit_2021(ServerCode.CheckURLRegistered,
email + "\n" + machineURL + "\n" + login));
target = (SubscriberWorkspace) response.object;

View File

@@ -9,7 +9,7 @@ public class CloneDVMSettings extends CloneServerObject<TestingServer, DVMSettin
super(Global.testingServer, DVMSettings.class);
}
@Override
protected Current currentName() {
return Current.DVMSettings;
protected Class currentClass() {
return DVMSettings.class;
}
}

View File

@@ -16,8 +16,8 @@ public class CloneSapforSettings extends CloneServerObject<TestingServer, Sapfor
super(Global.testingServer, SapforSettings.class);
}
@Override
protected Current currentName() {
return Current.SapforSettings;
protected Class currentClass() {
return SapforSettings.class;
}
@Override
protected void ServerAction() throws Exception {

View File

@@ -37,8 +37,8 @@ public class CompareDVMRunTasks extends Pass<Vector<DVMRunTask>> {
master = target.get(0);
slave = null;
return UI.Question("Отобразить задачу " + Utils_.Brackets(master.getPK()));
} else if ((target.size() == 0) && (Global.mainModule.HasDVMRunTask())) {
master = Global.mainModule.getDVMRunTask();
} else if ((target.size() == 0) && (Global.testingServer.db.dvmRunTasks.getUI().getCurrent()!=null)) {
master = Global.testingServer.db.dvmRunTasks.getUI().getCurrent();
slave = null;
return UI.Question("Отобразить задачу " + Utils_.Brackets(master.getPK()));
} else {

View File

@@ -37,8 +37,8 @@ public class CompareSapforPackages extends Pass<Vector<SapforPackage>> {
master = target.get(0);
slave = null;
return UI.Question("Отобразить пакет " + Utils_.Brackets(master.getPK()));
} else if ((target.size() == 0) && (Global.mainModule.HasSapforPackage())) {
master = Global.mainModule.getSapforPackage();
} else if ((target.size() == 0) && ( (Global.testingServer.db.sapforPackages.getUI().getCurrent()!=null))) {
master = Global.testingServer.db.sapforPackages.getUI().getCurrent();
slave = null;
return UI.Question("Отобразить пакет " + Utils_.Brackets(master.getPK()));
} else {

View File

@@ -4,8 +4,11 @@ import Common.Passes.PassException;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.Makefile.Makefile;
import _VisualDVM.GlobalData.Tasks.CompilationTask.CompilationTask;
import _VisualDVM.GlobalData.Tasks.TaskState;
import _VisualDVM.GlobalData.User.User;
import _VisualDVM.GlobalData.User.UserState;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.ProjectData.LanguageName;
@@ -13,6 +16,9 @@ import _VisualDVM.ProjectData.Project.db_project_info;
public class Compile extends Pass<db_project_info> {
Pass subpass = null;
CompilationTask compilationTask = null;
Machine machine = null;
User user = null;
Makefile makefile = null;
@Override
protected PassCode necessary() {
return Global.mainModule.getProject().languageName.equals(LanguageName.fortran) ? PassCode.SPF_ParseFilesWithOrder : null;
@@ -27,15 +33,23 @@ public class Compile extends Pass<db_project_info> {
}
@Override
protected boolean canStart(Object... args) {
if (Global.mainModule.Check(Log, Current.Project, Current.Machine, Current.User, Current.Makefile)) {
if (Global.mainModule.Check(Log, Current.Project) && Global.mainModule.getDb().Check(Log, Machine.class, User.class, Makefile.class)) {
target = Global.mainModule.getProject();
//--
machine = Global.mainModule.getDb().getTable(Machine.class).getUI().getCurrent();
user= Global.mainModule.getDb().getTable(User.class).getUI().getCurrent();
makefile= Global.mainModule.getDb().getTable(Makefile.class).getUI().getCurrent();
//--
subpass = null;
compilationTask = null;
if (Global.mainModule.getUser().state != UserState.ready_to_work)
Log.Writeln_("Пользователь " + Utils_.Brackets(Global.mainModule.getUser().login) +
if (user.state != UserState.ready_to_work)
Log.Writeln_("Пользователь " +
Utils_.Brackets(
user.login
) +
" не проинициализирован\ерейдите на вкладку 'Настройки компиляции и запуска',\n" +
" и выполните команду 'Инициализация пользователя'\n");
Global.mainModule.getMakefile().Validate(Log);
makefile.Validate(Log);
return Log.isEmpty();
}
return false;
@@ -43,9 +57,9 @@ public class Compile extends Pass<db_project_info> {
@Override
protected void performPreparation() throws Exception {
compilationTask = new CompilationTask();
compilationTask.machine_id = Global.mainModule.getMachine().id;
compilationTask.user_id = Global.mainModule.getUser().id;
compilationTask.makefile_id = Global.mainModule.getMakefile().id;
compilationTask.machine_id = machine.id;
compilationTask.user_id = user.id;
compilationTask.makefile_id = makefile.id;
compilationTask.project_path = target.Home.getAbsolutePath();
compilationTask.project_description = target.description;
//------------------------------------------
@@ -60,7 +74,7 @@ public class Compile extends Pass<db_project_info> {
}
@Override
protected void body() throws Exception {
switch (Global.mainModule.getMachine().type) {
switch (machine.type) {
case Local:
if (Utils_.isWindows()) {
subpass = Global.mainModule.getPass(PassCode.WindowsLocalCompilation);
@@ -69,12 +83,13 @@ public class Compile extends Pass<db_project_info> {
break;
case Undefined:
case MVS_cluster:
throw new PassException("Компиляция не реализована для типа машины " + Utils_.DQuotes(Global.mainModule.getMachine().type));
throw new PassException("Компиляция не реализована для типа машины " +
Utils_.DQuotes(machine.type));
default:
subpass = Global.mainModule.getPass(PassCode.RemoteCompilation);
break;
}
subpass.Do(Global.mainModule.getCompilationTask(), Global.mainModule.getProject());
subpass.Do(compilationTask, Global.mainModule.getProject());
}
@Override
protected boolean validate() {

View File

@@ -27,7 +27,7 @@ public class ConvertCorrectnessTests extends TestingSystemPass<File> {
Log.Writeln_("Вы не являетесь администратором");
return false;
}
if (!Global.mainModule.Check(Log, Current.ServerSapfor)) {
if (! Global.testingServer.db.serverSapfors.getUI().Check(Log)) {
return false;
}
return UI.Warning("Загрузить полный пакет DVM тестов на корректность и производительность.");
@@ -49,7 +49,8 @@ public class ConvertCorrectnessTests extends TestingSystemPass<File> {
@Override
protected void ServerAction() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.RefreshDVMTests,
String.valueOf(Global.mainModule.getServerSapfor().id), Global.mainModule.getAccount()));
String.valueOf(
Global.testingServer.db.serverSapfors.getUI().getCurrent().id), Global.mainModule.getAccount()));
}
@Override
protected void performFinish() throws Exception {

View File

@@ -58,7 +58,7 @@ public class CreateGroupFromDirectory extends PublishTests {
return false;
}
if (Global.mainModule.getPass(PassCode.PublishGroup).Do(dir.getName().toUpperCase())) {
group = Global.mainModule.getGroup();
group = Global.testingServer.db.groups.getUI().getCurrent();
} else return false;
//---------------
Vector<File> files = new Vector<>(Arrays.asList(files_));

View File

@@ -43,7 +43,7 @@ public class CreateGroupFromFiles extends PublishTests {
return false;
}
if (Global.mainModule.getPass(PassCode.PublishGroup).Do(dir.getName().toUpperCase())) {
group = Global.mainModule.getGroup();
group = Global.testingServer.db.groups.getUI().getCurrent();
} else return false;
//--
return super.canStart(files, group);

View File

@@ -71,9 +71,9 @@ public class CreateTestFromDirectory extends Pass<Test> {
if (args.length == 0) {
//--
from_files_chooser = true;
if (!Global.mainModule.Check(Log, Current.Group))
if (!Global.testingServer.db.groups.getUI().Check(Log))
return false;
group = Global.mainModule.getGroup();
group = Global.testingServer.db.groups.getUI().getCurrent();
if (!selectFiles())
return false;
//-

View File

@@ -15,9 +15,9 @@ public class CreateTestFromProject extends CreateTestFromDirectory {
@Override
protected boolean canStart(Object... args) throws Exception {
if (args.length == 0) {
if (Global.mainModule.Check(Log, Current.Group, Current.Project)) {
if (Global.testingServer.db.groups.getUI().Check(Log) && Global.mainModule.Check(Log, Current.Project)) {
project = Global.mainModule.getProject();
if (super.canStart(Global.mainModule.getProject().Home, Global.mainModule.getGroup())) {
if (super.canStart(Global.testingServer.db.groups.getUI().getCurrent())) {
from_files_chooser = true; //чтобы опубликовал.
return true;
}

View File

@@ -20,7 +20,7 @@ public class CreateTestsFromFiles extends PublishTests {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Global.mainModule.Check(Log, Current.Group)) {
if (Global.testingServer.db.groups.getUI().Check(Log)) {
Utils.RestoreSelectedDirectory(fileChooser);
Vector<File> files = fileChooser.ShowMultiDialog();
if (files.isEmpty()) {
@@ -28,7 +28,7 @@ public class CreateTestsFromFiles extends PublishTests {
return false;
}
Global.mainModule.getPass(PassCode.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, fileChooser.getCurrentDirectory());
return super.canStart(files, Global.mainModule.getGroup());
return super.canStart(files, Global.testingServer.db.groups.getUI().getCurrent());
}
return false;
}

View File

@@ -22,8 +22,8 @@ public class CreateTestsGroupFromSelectedVersions extends PublishTests {
protected boolean canStart(Object... args) throws Exception {
target = new Vector<>();
//---
if (Global.mainModule.Check(Log, Current.Group)) {
group = Global.mainModule.getGroup();
if (Global.testingServer.db.groups.getUI().Check(Log)) {
group = Global.testingServer.db.groups.getUI().getCurrent();
} else
return false;
//---------------------

View File

@@ -8,7 +8,7 @@ import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
public class DownloadComponent extends ComponentsRepositoryPass<Component> {
@Override
protected void ServerAction() throws Exception {
target = Global.mainModule.getComponent();
target = Global.components.getUI().getCurrent();
String packed = target.getComponentType() + "\n" + target.getFileName();
Command(new ServerExchangeUnit_2021(ServerCode.ReceiveComponent, packed));
Utils_.bytesToFile((byte[]) response.object, target.getNewFile());

View File

@@ -13,9 +13,9 @@ public class DownloadDVMPackage extends DownloadDVMPackages {
return "/icons/Comparsion.png";
}
protected boolean canStart(Object... args) throws Exception {
if (Global.mainModule.Check(Log, Current.DVMPackage)) {
if (Global.testingServer.db.dvmPackages.getUI().Check(Log)) {
//--
dvmPackage = Global.mainModule.getDVMPackage();
dvmPackage = Global.testingServer.db.dvmPackages.getUI().getCurrent();
//--
if (!dvmPackage.state.isDone()
) {

View File

@@ -11,8 +11,9 @@ public class DownloadTaskTest extends DownloadTest {
@Override
protected boolean canStart(Object... args) throws Exception {
target = null;
if (Global.mainModule.getAccount().CheckRegistered(Log) && Global.mainModule.Check(Log, Current.DVMRunTask)) {
DVMRunTask task = Global.mainModule.getDVMRunTask();
if (Global.mainModule.getAccount().CheckRegistered(Log) &&
Global.testingServer.db.dvmRunTasks.getUI().Check(Log)) {
DVMRunTask task = Global.testingServer.db.dvmRunTasks.getUI().getCurrent();
//-- квазиобъект, нам от него нужно только имя.
target = new Test();
target.id = task.test_id;

View File

@@ -20,8 +20,10 @@ public class DownloadTest extends TestingSystemPass<Test> {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Global.mainModule.getAccount().CheckRegistered(Log) && Global.mainModule.Check(Log, Current.Test)) {
target = Global.mainModule.getTest();
if (Global.mainModule.getAccount().CheckRegistered(Log) &&
Global.testingServer.db.tests.getUI().Check(Log)
) {
target = Global.testingServer.db.tests.getUI().getCurrent();
return true;
}
return false;

View File

@@ -61,9 +61,11 @@ public class ExportDVMPackageToExcel extends Pass<Vector<DVMPackage>> {
if (Global.testingServer.db.dvmPackages.getUI().getSelectedCount() > 0) {
target = Global.testingServer.db.dvmPackages.getUI().getSelectedItems();
} else {
if (Global.mainModule.Check(Log, Current.DVMPackage)) {
if (Global.testingServer.db.dvmPackages.getUI().Check(Log)) {
target = new Vector<>();
target.add(Global.mainModule.getDVMPackage());
target.add(
Global.testingServer.db.dvmPackages.getUI().getCurrent()
);
} else return false;
}
Vector<Integer> packagesToDownload = new Vector<>();

View File

@@ -11,17 +11,19 @@ public class GetComponentsBackupsFromServer extends ComponentsRepositoryPass<Vec
@Override
protected boolean canStart(Object... args) throws Exception {
target = new Vector<>();
return (Global.mainModule.Check(Log, Current.Component));
return Global.components.getUI().Check(Log);
}
@Override
protected void ServerAction() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.GetComponentsBackups, Global.mainModule.getComponent().getComponentType().toString()));
Command(new ServerExchangeUnit_2021(ServerCode.GetComponentsBackups,
Global.components.getUI().getCurrent().getComponentType().toString()));
target = (Vector<File>) response.object;
}
@Override
protected boolean validate() {
if (target.isEmpty()) {
Log.Writeln_("Не найдено резервных копий на сервере для компонента " + Global.mainModule.getComponent().getComponentType().getDescription());
Log.Writeln_("Не найдено резервных копий на сервере для компонента "
+ Global.components.getUI().getCurrent().getComponentType().getDescription());
return false;
}
return true;

View File

@@ -1,9 +1,11 @@
package _VisualDVM.Passes.All;
import Common.MainModule_;
import Common.Passes.Pass;
import Common.Passes.PassException;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
import _VisualDVM.GlobalData.User.User;
import _VisualDVM.GlobalData.User.UserState;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Repository.SubscriberWorkspace.SubscriberWorkspace;
@@ -18,11 +20,13 @@ public class InitialiseUser extends Pass {
}
@Override
protected boolean canStart(Object... args) throws Exception {
return Global.mainModule.Check(Log, Current.Machine, Current.User);
return MainModule_.instance.getDb().Check(Log, Machine.class, User.class);
}
@Override
protected void body() throws Exception {
switch (Global.mainModule.getMachine().type) {
Machine machine = MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent();
User user = MainModule_.instance.getDb().getTable(User.class).getUI().getCurrent();
switch (machine.type) {
case Local:
Global.mainModule.getPass(PassCode.LocalInitaliseUser).Do();
break;
@@ -34,21 +38,21 @@ public class InitialiseUser extends Pass {
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.URL = machine.getURL();
workspace.login = user.login;
workspace.path = ((RemoteFile) Global.mainModule.getPass(PassCode.RemoteInitialiseUser).target).full_name;
//---
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());
user.workspace = workspace.path;
user.state = UserState.ready_to_work;
Global.mainModule.getDb().Update(user);
}
}
} else {
//рега была. просто заносим то что там пользователю
Global.mainModule.getUser().workspace = workspace.path;
Global.mainModule.getUser().state = UserState.ready_to_work;
Global.mainModule.getDb().Update(Global.mainModule.getUser());
user.workspace = workspace.path;
user.state = UserState.ready_to_work;
Global.mainModule.getDb().Update(user);
}
}
break;
@@ -58,6 +62,6 @@ public class InitialiseUser extends Pass {
}
@Override
protected void showFinish() throws Exception {
Global.mainModule.getDb().users.getUI().Refresh();
Global.mainModule.getDb().users.getUI().RedrawControl();
}
}

View File

@@ -1,6 +1,8 @@
package _VisualDVM.Passes.All;
import Common.MainModule_;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.User.User;
import _VisualDVM.GlobalData.User.UserState;
import _VisualDVM.Passes.ProcessPass;
@@ -11,7 +13,7 @@ import java.io.File;
public class LocalInitaliseUser extends ProcessPass<User> {
@Override
protected boolean canStart(Object... args) throws Exception {
target = Global.mainModule.getUser();
target = MainModule_.instance.getDb().getTable(User.class).getUI().getCurrent();
return true;
}
@Override

View File

@@ -22,8 +22,8 @@ public class OpenBugReportTestProject extends Pass<BugReport> {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Global.mainModule.Check(Log, Current.BugReport) &&
(target = Global.mainModule.getBugReport()).CheckNotDraft(Log)) {
if (Global.componentsServer.db.Check(Log, BugReport.class) &&
(target = Global.componentsServer.db.bugReports.getUI().getCurrent()).CheckNotDraft(Log)) {
if (!target.project_version.isEmpty()) {
root = Paths.get(ComponentsSet.visualiser.getWorkspace().getAbsolutePath(),
target.id).toFile();

View File

@@ -16,6 +16,7 @@ import javax.swing.*;
import java.util.LinkedHashMap;
public class PickCompilerEnvironments extends Pass<String> {
Compiler compiler = null;
RunConfiguration configuration = null;
@Override
public String getIconPath() {
return "/icons/Menu/Regions.png";
@@ -27,8 +28,8 @@ public class PickCompilerEnvironments extends Pass<String> {
//-
@Override
protected boolean canStart(Object... args) throws Exception {
if (Global.mainModule.Check(Log, Current.RunConfiguration)) {
RunConfiguration configuration = Global.mainModule.getRunConfiguration();
if (Global.mainModule.getDb().runConfigurations.getUI().Check(Log)) {
configuration = Global.mainModule.getDb().runConfigurations.getUI().getCurrent();
if (configuration.compiler_id == CommonConstants.Nan) {
Log.Writeln_("Отсутвует DVM компилятор, связанный с текущей конфигурацией запуска.\n" +
"Если конфигурация содержит вызов DVM компилятора, но была создана на версии 801 и ниже,\n" +
@@ -70,14 +71,14 @@ public class PickCompilerEnvironments extends Pass<String> {
}
@Override
protected void body() throws Exception {
LinkedHashMap<String, String> envValues = Global.mainModule.getRunConfiguration().getEnvMap();
LinkedHashMap<String, String> envValues = configuration.getEnvMap();
for (CompilerEnvironment compilerEnv : compiler.environments.Data.values()) {
if (compilerEnv.isSelected()) {
EnvironmentValue confEnv;
if (!envValues.containsKey(compilerEnv.name)) {
confEnv = new EnvironmentValue();
confEnv.machine_id = Global.mainModule.getRunConfiguration().machine_id;
confEnv.run_configuration_id = Global.mainModule.getRunConfiguration().id;
confEnv.machine_id = configuration.machine_id;
confEnv.run_configuration_id = configuration.id;
confEnv.name = compilerEnv.name;
confEnv.value = compilerEnv.value;
Global.mainModule.getDb().Insert(confEnv);

View File

@@ -21,7 +21,7 @@ public class PickCompilerEnvironmentsForTesting extends Pass<String> {
return false;
}
target = "";
compiler = Global.mainModule.getCompiler();
compiler = Global.mainModule.getDb().compilers.getUI().getCurrent();
if (!compiler.type.equals(CompilerType.dvm)) {
Log.Writeln_("Выбор переменных окружения возможен только для DVM компилятора,");
return false;

View File

@@ -2,7 +2,6 @@ package _VisualDVM.Passes.All;
import Common.Passes.Pass;
import Common.Utils.Utils_;
import Common.Visual.UI;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Repository.BugReport.BugReport;
@@ -22,8 +21,8 @@ public class PublishBugReport extends Pass<BugReport> {
}
@Override
protected boolean canStart(Object... args) {
if (Global.mainModule.Check(Log, Current.BugReport)) {
target = Global.mainModule.getBugReport();
if ( Global.componentsServer.db.bugReports.getUI().Check(Log)) {
target = Global.componentsServer.db.bugReports.getUI().getCurrent();
if (!target.state.equals(BugReportState.draft)) {
Log.Writeln_("Отчёт об ошибке " + target.id + " уже опубликован!");
return false;
@@ -69,7 +68,7 @@ public class PublishBugReport extends Pass<BugReport> {
}
@Override
protected void showDone() throws Exception {
Global.componentsServer.db.bugReports.getUI().Refresh();
Global.componentsServer.db.bugReports.RefreshUI();
Global.mainModule.getUI().getMainWindow().getCallbackWindow().ShowCurrentBugReport();
}
}

View File

@@ -41,8 +41,8 @@ public class PublishComponent extends ComponentsRepositoryPass<Component> {
Log.Writeln_("Вы не являетесь администратором");
}
;
if (Global.mainModule.Check(Log, Current.Component)) {
target = Global.mainModule.getComponent();
if (Global.components.getUI().Check(Log)) {
target = Global.components.getUI().getCurrent();
target.needs_update_minimal_version = false;
f.fields.cbUpdateMinimalVersion.setSelected(false);
f.fields.lMinimalVersion.setText(String.valueOf(target.minimal_version));

View File

@@ -3,6 +3,7 @@ import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Passes.Server.PublishServerObject;
import _VisualDVM.TestingSystem.Common.TestingServer;
import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.SapforSettings;
import _VisualDVM.TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsCommand;
public class PublishSapforSettingsCommand extends PublishServerObject<TestingServer, SapforSettingsCommand> {
public PublishSapforSettingsCommand() {
@@ -10,11 +11,11 @@ public class PublishSapforSettingsCommand extends PublishServerObject<TestingSer
}
@Override
public boolean fillObjectFields() throws Exception {
target.sapforsettings_id = Global.mainModule.getSapforSettings().id;
target.sapforsettings_id = Global.testingServer.db.getTable(SapforSettings.class).getUI().getCurrent().id;
return super.fillObjectFields();
}
@Override
protected boolean canStart(Object... args) throws Exception {
return Global.mainModule.Check(Log, Current.SapforSettings) && super.canStart(args);
return Global.testingServer.db.getTable(SapforSettings.class).getUI().Check(Log) && super.canStart(args);
}
}

View File

@@ -1,10 +1,13 @@
package _VisualDVM.Passes.All;
import Common.MainModule_;
import Common.Passes.PassException;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
import _VisualDVM.GlobalData.User.User;
import _VisualDVM.Passes.SSH.ConnectionPass;
import java.util.Vector;
@@ -16,12 +19,12 @@ public class RemoteInitialiseUser extends ConnectionPass<RemoteFile> {
}
@Override
protected boolean canStart(Object... args) {
return Global.mainModule.Check(Log, Current.User);
return MainModule_.instance.getDb().getTable(User.class).getUI().Check(Log);
}
@Override
protected void Connect() throws Exception {
machine = Global.mainModule.getMachine();
user = Global.mainModule.getUser();
machine = MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent();
user = MainModule_.instance.getDb().getTable(User.class).getUI().getCurrent();
super.Connect();
}
@Override

View File

@@ -34,8 +34,8 @@ public class ReplaceTestProject extends CreateTestFromProject {
}
@Override
protected boolean initTarget() throws Exception {
if (Global.mainModule.Check(Log, Current.Test)) {
target = Global.mainModule.getTest();
if (Global.testingServer.db.tests.getUI().Check(Log)) {
target = Global.testingServer.db.tests.getUI().getCurrent();
return true;
}
return false;

View File

@@ -33,9 +33,9 @@ public class ReplaceTestsFromFiles extends TestingSystemPass<Vector<Test>> {
//-
@Override
protected boolean canStart(Object... args) throws Exception {
if (!Global.mainModule.Check(Log, Current.Group))
if (!Global.testingServer.db.groups.getUI().Check(Log))
return false;
group = Global.mainModule.getGroup();
group = Global.testingServer.db.groups.getUI().getCurrent();
//--->>>
Utils.RestoreSelectedDirectory(fileChooser);
Vector<File> files = fileChooser.ShowMultiDialog();

View File

@@ -1,12 +1,18 @@
package _VisualDVM.Passes.All;
import Common.MainModule_;
import Common.Passes.Pass;
import Common.Passes.PassException;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.Machine.MachineType;
import _VisualDVM.GlobalData.Makefile.Makefile;
import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
import _VisualDVM.GlobalData.Tasks.CompilationTask.CompilationTask;
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
import _VisualDVM.GlobalData.Tasks.TaskState;
import _VisualDVM.GlobalData.User.User;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.ProjectData.Project.db_project_info;
@@ -24,7 +30,9 @@ public class Run extends Pass<db_project_info> {
}
@Override
protected void performPreparation() throws Exception {
runTasks = Global.mainModule.getRunConfiguration().generateRunTasks(target, Global.mainModule.getCompilationTask());
runTasks = MainModule_.instance.getDb().getTable(RunConfiguration.class).getUI().getCurrent().generateRunTasks(target,
MainModule_.instance.getDb().getTable(CompilationTask.class).getUI().getCurrent()
);
for (RunTask runTask : runTasks) {
Global.mainModule.getDb().Insert(runTask);
Utils_.forceDeleteWithCheck(runTask.getLocalWorkspace());
@@ -37,17 +45,17 @@ public class Run extends Pass<db_project_info> {
@Override
protected boolean canStart(Object... args) {
subpass = null;
if (Global.mainModule.Check(Log, Current.Project, Current.Machine, Current.User, Current.Makefile, Current.RunConfiguration,
Current.CompilationTask)) {
if ((Global.mainModule.Check(Log, Current.Project))&&
MainModule_.instance.getDb().Check(Log,Machine.class, User.class, Makefile.class, RunConfiguration.class,CompilationTask.class)) {
//-
target = Global.mainModule.getProject();
//-
if (Global.mainModule.getMachine().type.equals(MachineType.MVS_cluster) &&
Global.mainModule.getRunConfiguration().LauncherCall.isEmpty()
if (MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().type.equals(MachineType.MVS_cluster) &&
MainModule_.instance.getDb().getTable(RunConfiguration.class).getUI().getCurrent().LauncherCall.isEmpty()
) {
Log.Writeln_("Запуск напрямую на кластере запрещён.Используйте для запуска DVM систему или MPI");
}
if (!Global.mainModule.getCompilationTask().state.equals(TaskState.Done))
if (!MainModule_.instance.getDb().getTable(CompilationTask.class).getUI().getCurrent().state.equals(TaskState.Done))
Log.Writeln_("Текущая задача на компиляцию еще не выполнялась, или была завершена с ошибками");
return Log.isEmpty();
}
@@ -55,7 +63,7 @@ public class Run extends Pass<db_project_info> {
}
@Override
protected void body() throws Exception {
switch (Global.mainModule.getMachine().type) {
switch (MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().type) {
case Local:
if (Utils_.isWindows()) {
subpass = Global.mainModule.getPass(PassCode.WindowsLocalRun);
@@ -64,7 +72,9 @@ public class Run extends Pass<db_project_info> {
break;
case Undefined:
case MVS_cluster:
throw new PassException("Запуск не реализован для типа машины " + Utils_.DQuotes(Global.mainModule.getMachine().type));
throw new PassException("Запуск не реализован для типа машины "
+ Utils_.DQuotes(
MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().type));
/*
case MVS_cluster:
subpass = passes.get(PassCode_2021.MVSRun);
@@ -81,7 +91,7 @@ public class Run extends Pass<db_project_info> {
boolean task_completed = false;
task.setProgress(i, runTasks.size());
//-
Global.mainModule.getDb().runTasks.getUI().Refresh();
Global.mainModule.getDb().runTasks.getUI().RedrawControl();
Global.mainModule.getDb().runTasks.getUI().SetCurrentByPK(task.id);
//-
subpass.Do(task, target);
@@ -102,7 +112,7 @@ public class Run extends Pass<db_project_info> {
break;
}
//-
Global.mainModule.getDb().runTasks.getUI().Refresh();
Global.mainModule.getDb().runTasks.getUI().RedrawControl();
Global.mainModule.getUI().getDebugWindow().ShowCurrentRunTask();
//-
if (!task_completed) break;

View File

@@ -22,8 +22,10 @@ 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) && Global.mainModule.getPass(PassCode.SPF_GetArrayLinks).Do()) {
region = Global.mainModule.getParallelRegion();
if (
Global.mainModule.getProject().parallelRegions.getUI().Check(Log)
&& super.canStart(args) && Global.mainModule.getPass(PassCode.SPF_GetArrayLinks).Do()) {
region = Global.mainModule.getProject().parallelRegions.getUI().getCurrent();
DBObjectDialog dialog = new DBObjectDialog<ParallelRegion, ParallelRegionFields>(ParallelRegionFields.class) {
@Override
public int getDefaultHeight() {

View File

@@ -12,9 +12,9 @@ public class SaveBugReportExecutor extends UpdateBugReportField {
}
@Override
protected boolean canStart(Object... args) throws Exception {
return (Global.mainModule.Check(Log, Current.Subscriber)) &&
super.canStart("executor", Global.mainModule.getSubscriber().name,
"executor_address", Global.mainModule.getSubscriber().address
return Global.componentsServer.db.subscribers.getUI().Check(Log) &&
super.canStart("executor",Global.componentsServer.db.subscribers.getUI().getCurrent().name,
"executor_address", Global.componentsServer.db.subscribers.getUI().getCurrent().address
);
}
}

View File

@@ -8,7 +8,7 @@ public class SaveCurrentDVMConfiguration extends SaveCurrentConfiguration<DVMCon
super(DVMConfiguration.class, DVMSettings.class);
}
@Override
public Current currentName() {
return Current.DVMConfiguration;
protected Class currentClass() {
return DVMConfiguration.class;
}
}

View File

@@ -8,8 +8,8 @@ public class SaveCurrentSAPFORConfiguration extends SaveCurrentConfiguration<Sap
super(SapforConfiguration.class, SapforSettings.class);
}
@Override
public Current currentName() {
return Current.SapforConfiguration;
protected Class currentClass() {
return SapforConfiguration.class;
}
}

View File

@@ -1,13 +1,15 @@
package _VisualDVM.Passes.All;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.User.User;
import _VisualDVM.Passes.SSH.CurrentConnectionPass;
public class SelectRemoteFile extends CurrentConnectionPass {
boolean dialogOK;
boolean needs_directory = false;
@Override
protected boolean canStart(Object... args) {
if (Global.mainModule.Check(Log, Current.Machine, Current.User)) {
if (Global.mainModule.getDb().Check(Log, Machine.class, User.class)) {
needs_directory = (boolean) args[0];
Global.mainModule.set(Current.RemoteFile, null);
return true;

View File

@@ -2,24 +2,26 @@ package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
import _VisualDVM.Repository.BugReport.BugReport;
import _VisualDVM.Repository.BugReport.BugReportState;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
public class SendBugReport extends ComponentsRepositoryPass {
public class SendBugReport extends ComponentsRepositoryPass<BugReport> {
@Override
protected void ServerAction() throws Exception {
if (!Global.mainModule.getBugReport().project_version.isEmpty()) {
target = Global.componentsServer.db.bugReports.getUI().getCurrent();
if (!target.project_version.isEmpty()) {
//отправить архив.
Command(new ServerExchangeUnit_2021(ServerCode.SendBugReport,
Global.mainModule.getBugReport().id,
Utils_.fileToBytes(Global.mainModule.getBugReport().getArchiveFile())
target.id,
Utils_.fileToBytes(target.getArchiveFile())
));
}
// синхрон бд
Command(new ServerExchangeUnit_2021(ServerCode.PublishObject, "", Global.mainModule.getBugReport()));
Command(new ServerExchangeUnit_2021(ServerCode.PublishObject, "", target));
}
@Override
protected void performFail() throws Exception {
Global.mainModule.getBugReport().state = BugReportState.draft;
target.state = BugReportState.draft;
}
}

View File

@@ -1,8 +1,10 @@
package _VisualDVM.Passes.All;
import Common.MainModule_;
import Common.Passes.Pass;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.Machine.MachineType;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Visual.Windows.ReadOnlyMultilineTextForm;
@@ -23,8 +25,8 @@ public class ShowCompilerHelp extends Pass<String> {
protected boolean canStart(Object... args) throws Exception {
target = null;
if (args.length == 0) {
if (Global.mainModule.Check(Log, Current.Compiler)) {
compiler = Global.mainModule.getCompiler();
if (MainModule_.instance.getDb().getTable(Compiler.class).getUI().Check(Log)) {
compiler = MainModule_.instance.getDb().getTable(Compiler.class).getUI().getCurrent();
needsShow = true;
return true;
}
@@ -39,7 +41,7 @@ public class ShowCompilerHelp extends Pass<String> {
protected void body() throws Exception {
subpass = null;
compiler.ResetHelp();
if (Global.mainModule.getMachine().type.equals(MachineType.Local)) {
if (MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().type.equals(MachineType.Local)) {
subpass = Global.mainModule.getPass(PassCode.LocalSingleCommand);
} else {
subpass = Global.mainModule.getPass(PassCode.RemoteSingleCommand);

View File

@@ -1,8 +1,9 @@
package _VisualDVM.Passes.All;
import Common.MainModule_;
import Common.Passes.Pass;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.Machine.MachineType;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Visual.Windows.ReadOnlyMultilineTextForm;
@@ -23,8 +24,8 @@ public class ShowCompilerVersion extends Pass<String> {
protected boolean canStart(Object... args) throws Exception {
target = null;
if (args.length == 0) {
if (Global.mainModule.Check(Log, Current.Compiler)) {
compiler = Global.mainModule.getCompiler();
if (MainModule_.instance.getDb().getTable(Compiler.class).getUI().Check(Log)) {
compiler = MainModule_.instance.getDb().getTable(Compiler.class).getUI().getCurrent();
needsShow = true;
return true;
}
@@ -39,7 +40,7 @@ public class ShowCompilerVersion extends Pass<String> {
protected void body() throws Exception {
subpass = null;
compiler.ResetVersion();
if (Global.mainModule.getMachine().type.equals(MachineType.Local)) {
if (MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().type.equals(MachineType.Local)) {
subpass = Global.mainModule.getPass(PassCode.LocalSingleCommand);
} else {
subpass = Global.mainModule.getPass(PassCode.RemoteSingleCommand);
@@ -59,7 +60,7 @@ public class ShowCompilerVersion extends Pass<String> {
@Override
protected void showDone() throws Exception {
if (needsShow) {
(Global.mainModule.getDb()).compilers.getUI().Refresh();
(Global.mainModule.getDb()).compilers.RefreshUI();
ReadOnlyMultilineTextForm ff = new ReadOnlyMultilineTextForm();
ff.ShowDialog("Версия", target);
}

View File

@@ -25,8 +25,8 @@ public class ShowComponentChangesLog extends ComponentsRepositoryPass<Component>
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Global.mainModule.Check(Log, Current.Component)) {
target = Global.mainModule.getComponent();
if (Global.components.getUI().Check(Log)) {
target = Global.components.getUI().getCurrent();
return true;
}
return false;

View File

@@ -10,8 +10,8 @@ import _VisualDVM.TestingSystem.DVM.DVMSettings.DVMSettings;
import java.util.Vector;
public class ShowCurrentDVMConfigurationTests extends ShowCurrentConfigurationTests<DVMConfiguration> {
@Override
public Current currentName() {
return Current.DVMConfiguration;
public Class currentClass() {
return DVMConfiguration.class;
}
@Override
protected void showDone() throws Exception {

View File

@@ -10,8 +10,8 @@ import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.SapforSettings;
import java.util.Vector;
public class ShowCurrentSAPFORConfigurationTests extends ShowCurrentConfigurationTests<SapforConfiguration> {
@Override
public Current currentName() {
return Current.SapforConfiguration;
public Class currentClass() {
return SapforConfiguration.class;
}
@Override
protected void showDone() throws Exception {

View File

@@ -1,7 +1,9 @@
package _VisualDVM.Passes.All;
import Common.MainModule_;
import Common.Passes.Pass;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Makefile.Makefile;
import _VisualDVM.GlobalData.Makefile.UI.MakefilePreviewForm;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.ProjectData.Project.db_project_info;
@@ -20,7 +22,7 @@ public class ShowMakefilePreview extends Pass<db_project_info> {
}
@Override
protected boolean canStart(Object... args) {
if (Global.mainModule.Check(Log, Current.Project, Current.Makefile)) {
if (Global.mainModule.Check(Log, Current.Project) &&MainModule_.instance.getDb().getTable(Makefile.class).getUI().Check(Log) ) {
target = Global.mainModule.getProject();
return true;
}
@@ -29,6 +31,6 @@ public class ShowMakefilePreview extends Pass<db_project_info> {
@Override
protected void body() throws Exception {
new MakefilePreviewForm().ShowDialog("Предпросмотр мейкфайла для текущего проекта",
Global.mainModule.getMakefile().Generate(target));
MainModule_.instance.getDb().getTable(Makefile.class).getUI().getCurrent().Generate(target));
}
}

View File

@@ -18,9 +18,10 @@ public class ShowSapforCompilationErr extends ShowTestingServerFile {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (!Global.mainModule.Check(Log, Current.ServerSapfor)) {
if (!Global.testingServer.db.serverSapfors.getUI().Check(Log)) {
return false;
}
return super.canStart("Поток ошибок", new RemoteFile(Global.mainModule.getServerSapfor().home_path, Constants.err_file));
return super.canStart("Поток ошибок", new RemoteFile(
Global.testingServer.db.serverSapfors.getUI().getCurrent().home_path, Constants.err_file));
}
}

View File

@@ -18,9 +18,10 @@ public class ShowSapforCompilationOut extends ShowTestingServerFile {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (!Global.mainModule.Check(Log, Current.ServerSapfor)) {
if (!Global.testingServer.db.serverSapfors.getUI().Check(Log)) {
return false;
}
return super.canStart("Поток вывода", new RemoteFile(Global.mainModule.getServerSapfor().home_path, Constants.out_file));
return super.canStart("Поток вывода", new RemoteFile(
Global.testingServer.db.serverSapfors.getUI().getCurrent().home_path, Constants.out_file));
}
}

View File

@@ -1,9 +1,12 @@
package _VisualDVM.Passes.All;
import Common.MainModule_;
import Common.Visual.UI;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.Compiler.CompilerType;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.Machine.MachineType;
import _VisualDVM.GlobalData.User.User;
import _VisualDVM.GlobalData.User.UserState;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Passes.Server.PublishServerObject;
@@ -26,22 +29,27 @@ public class StartSelectedDVMConfigurations extends PublishServerObject<TestingS
if (!Global.mainModule.getAccount().CheckRegistered(Log)) {
return false;
}
if (!Global.mainModule.Check(Log, Current.Machine, Current.User, Current.Compiler))
if (!MainModule_.instance.getDb().Check(Log, Machine.class, User.class, Compiler.class))
return false;
if (!Global.mainModule.getMachine().type.equals(MachineType.Server)) {
//--
Machine machine = MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent();
User user = MainModule_.instance.getDb().getTable(User.class).getUI().getCurrent();
Compiler compiler = MainModule_.instance.getDb().getTable(Compiler.class).getUI().getCurrent();
//--
if (!machine.type.equals(MachineType.Server)) {
Log.Writeln_("Тестирование поддерживается только на одиночном удалённом сервере.");
return false;
}
if (!Global.mainModule.getUser().state.equals(UserState.ready_to_work)) {
if (!user.state.equals(UserState.ready_to_work)) {
Log.Writeln_("Пользователь не готов к работе. Выполните инициализацию пользователя!");
return false;
}
if (!Global.mainModule.getCompiler().type.equals(CompilerType.dvm)) {
if (!compiler.type.equals(CompilerType.dvm)) {
Log.Writeln_("Тестирование поддерживается только для DVM компиляторов.");
return false;
}
if (!Global.mainModule.getCompiler().versionLoaded)
Global.mainModule.getPass(PassCode.ShowCompilerVersion).Do(Global.mainModule.getCompiler(), false);
if (!compiler.versionLoaded)
Global.mainModule.getPass(PassCode.ShowCompilerVersion).Do(compiler, false);
//-----
if (!Global.testingServer.db.dvm_configurations.getUI().CheckSelectedOrCurrent(Log)) {
return false;
@@ -50,9 +58,9 @@ public class StartSelectedDVMConfigurations extends PublishServerObject<TestingS
//---
target = new DVMPackage(
Global.mainModule.getAccount(),
Global.mainModule.getMachine(),
Global.mainModule.getUser(),
Global.mainModule.getCompiler(),
machine,
user,
compiler,
configurations,
Global.properties.EmailOnTestingProgress ? 1 : 0
);

View File

@@ -27,10 +27,10 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
if (!Global.mainModule.getAccount().CheckRegistered(Log)) {
return false;
}
if (!Global.mainModule.Check(Log, Current.ServerSapfor)) {
if (!Global.testingServer.db.serverSapfors.getUI().Check(Log)) {
return false;
}
if (!Global.mainModule.getServerSapfor().state.equals(ServerSapforState.Done)) {
if (!Global.testingServer.db.serverSapfors.getUI().getCurrent().state.equals(ServerSapforState.Done)) {
Log.Writeln_("Выбранная версия SAPFOR не собрана!");
return false;
}
@@ -40,7 +40,7 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
}
configurations = Global.testingServer.db.sapforConfigurations.getUI().getSelectedOrCurrent();
target = new SapforPackage(Global.mainModule.getAccount(),
Global.mainModule.getServerSapfor(),
Global.testingServer.db.serverSapfors.getUI().getCurrent(),
configurations,
Global.properties.EmailOnTestingProgress ? 1 : 0,
Log);

View File

@@ -1,6 +1,5 @@
package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
@@ -25,12 +24,12 @@ public class UpdateBugReportField extends ComponentsRepositoryPass<BugReport> {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (!Global.mainModule.Check(Log, Current.BugReport))
if (!Global.componentsServer.db.bugReports.getUI().Check(Log))
return false;
old_description = "";
old_comment = "";
//--
target = Global.mainModule.getBugReport();
target = Global.componentsServer.db.bugReports.getUI().getCurrent();
fieldNames.clear();
fieldValues.clear();
for (int i = 0; i < args.length; ++i) {
@@ -51,7 +50,7 @@ public class UpdateBugReportField extends ComponentsRepositoryPass<BugReport> {
BugReport.class.getField(fieldNames.get(i)).set(target, fieldValues.get(i));
target.change_date = new Date().getTime();
server.db.Update(target);
server.db.bugReports.getUI().Refresh();
server.db.bugReports.RefreshUI();
Global.mainModule.getUI().getMainWindow().getCallbackWindow().ShowCurrentBugReport();
} else
return canUpdate();
@@ -83,7 +82,7 @@ public class UpdateBugReportField extends ComponentsRepositoryPass<BugReport> {
}
@Override
protected void showFinish() throws Exception {
Global.componentsServer.db.bugReports.getUI().Refresh();
Global.componentsServer.db.bugReports.RefreshUI();
Global.mainModule.getUI().getMainWindow().getCallbackWindow().ShowCurrentBugReport();
}
@Override

View File

@@ -13,10 +13,11 @@ public class UpdateBugReportProgress extends UpdateBugReportField {
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (!Global.mainModule.Check(Log, Current.BugReport))
if (!Global.componentsServer.db.bugReports.getUI().Check(Log))
return false;
PercentsForm f = new PercentsForm();
if (f.ShowDialog("Завершённость работы над ошибкой", Global.mainModule.getBugReport().percentage))
if (f.ShowDialog("Завершённость работы над ошибкой",
Global.componentsServer.db.bugReports.getUI().getCurrent().percentage))
return super.canStart("percentage", f.Result);
return false;
}

View File

@@ -16,9 +16,10 @@ public class UpdateComponent extends Pass<Component> {
}
@Override
protected void body() throws Exception {
target = Global.components.getUI().getCurrent();
PassCode subPassCode = null;
//<editor-fold desc="получение нового файла компонента">
switch (Global.mainModule.getComponent().getComponentType()) {
switch (target.getComponentType()) {
case Sapfor_F:
case Visualizer_2:
subPassCode = Utils_.isWindows() ? PassCode.DownloadComponent : PassCode.BuildComponent;
@@ -31,15 +32,15 @@ public class UpdateComponent extends Pass<Component> {
}
if ((subPassCode != null) && Global.mainModule.getPass(subPassCode).Do()) {
//</editor-fold>
if (!Global.mainModule.getComponent().getNewFile().exists())
throw new PassException("Не удалось получить новый файл для компонента " + Global.mainModule.getComponent().getComponentType().getDescription());
if (!target.getNewFile().exists())
throw new PassException("Не удалось получить новый файл для компонента " + target.getComponentType().getDescription());
//непосредственное обновление.
Global.mainModule.getComponent().Update();
target.Update();
}
}
@Override
protected void performFinish() throws Exception {
Global.mainModule.getComponent().CheckIfNeedsUpdateOrPublish();
target.CheckIfNeedsUpdateOrPublish();
}
@Override
protected void showDone() throws Exception {