постепенное выведение старой концепции текущих объектов, касаемо табличных лучше держать их в интерфейсе таблиц, чтобы не писать описание объекта дважды и не мучиться с типом. некоторые фиксы
This commit is contained in:
@@ -4,6 +4,7 @@ import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Database.Tables.DBTableColumn;
|
||||
import Common.Passes.PassException;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import javafx.util.Pair;
|
||||
@@ -255,4 +256,14 @@ public abstract class SQLiteDatabase extends Database {
|
||||
}
|
||||
//--
|
||||
//https://stackoverflow.com/questions/8558099/sqlite-query-with-byte-where-clause
|
||||
//получение "текущих" объектов. скорее временная мера.
|
||||
public boolean Check(TextLog log, Class... tablesClasses) {
|
||||
for (Class tableClass : tablesClasses) {
|
||||
getTable(tableClass).getUI().Check(log);
|
||||
}
|
||||
return log.isEmpty();
|
||||
}
|
||||
public boolean matchCurrentID(Class tableClass, int id_in) {
|
||||
return getTable(tableClass).getUI().matchCurrentID(id_in);
|
||||
}
|
||||
}
|
||||
@@ -64,6 +64,10 @@ public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||
ui.Show(key);
|
||||
}
|
||||
}
|
||||
public void RefreshUI(){
|
||||
if ((ui != null) && ui.isShown())
|
||||
ui.RedrawControl();
|
||||
}
|
||||
//СОДЕРЖИМОЕ
|
||||
public D getFirstRecord() {
|
||||
return Data.values().stream().findFirst().orElse(null);
|
||||
|
||||
@@ -5,6 +5,7 @@ import Common.Database.Objects.PassStats.PassStatsDBTable;
|
||||
import Common.Database.Objects.Splitter.SplittersDBTable;
|
||||
import Common.Database.SQLITE.SQLiteDatabase;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Utils.TextLog;
|
||||
|
||||
import java.io.File;
|
||||
public class VisualiserDatabase extends SQLiteDatabase {
|
||||
@@ -26,4 +27,5 @@ public class VisualiserDatabase extends SQLiteDatabase {
|
||||
public PassCode_ getSynchronizePassCode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public abstract class MainModule_<D extends VisualiserDatabase, U extends UIModu
|
||||
//--
|
||||
D db = null;
|
||||
Class<D> db_class = null;
|
||||
LinkedHashMap<Current_, Object> objects = null; //Current
|
||||
LinkedHashMap<Current_, Object> objects = null; //Current/ большинство выведено
|
||||
//--
|
||||
LinkedHashMap<PassCode_, Pass> passes = null;
|
||||
//--
|
||||
@@ -87,9 +87,11 @@ public abstract class MainModule_<D extends VisualiserDatabase, U extends UIModu
|
||||
Log.Writeln_(name.getDescription() + " не выбран(а)");
|
||||
return Log.isEmpty();
|
||||
}
|
||||
/*
|
||||
public boolean matchCurrentID(Current_ name, int id) {
|
||||
return (get(name) != null) && (((iDBObject) get(name)).id == id);
|
||||
}
|
||||
*/
|
||||
//ПРОХОДЫ
|
||||
public abstract Class getPassCodesEnum();
|
||||
public abstract String getAllPassesClassPrefix();
|
||||
|
||||
@@ -4,9 +4,12 @@ public abstract class AddObjectPass<D extends DBObject> extends ObjectPass<D> {
|
||||
public AddObjectPass(Class<D> d_in) {
|
||||
super(d_in);
|
||||
}
|
||||
public Class<? extends DBObject> getOwner() {
|
||||
protected Class<? extends DBObject> getOwnerClass() {
|
||||
return null;
|
||||
}
|
||||
protected DBObject getOwner() {
|
||||
return getDb().getTable(getOwnerClass()).getUI().getCurrent();
|
||||
}
|
||||
@Override
|
||||
public String getDescription_() {
|
||||
return "добавление";
|
||||
@@ -14,9 +17,7 @@ public abstract class AddObjectPass<D extends DBObject> extends ObjectPass<D> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = d.newInstance();
|
||||
return
|
||||
((getOwner() == null) || (getDb().getTable(getOwner()).getUI().CheckCurrent(Log))) &&
|
||||
fillObjectFields();
|
||||
return ((getOwnerClass() == null) || (getDb().getTable(getOwnerClass()).getUI().Check(Log))) && fillObjectFields();
|
||||
}
|
||||
protected boolean fillObjectFields() throws Exception {
|
||||
return getTable().getUI().ShowAddObjectDialog(target);
|
||||
|
||||
@@ -15,7 +15,7 @@ public abstract class DeleteObjectPass<D extends DBObject> extends ObjectPass<D>
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = (D) getTable().getUI().getCurrent();
|
||||
return getTable().getUI().CheckCurrent(Log) && getTable().getUI().ShowDeleteObjectDialog(target);
|
||||
return getTable().getUI().Check(Log) && getTable().getUI().ShowDeleteObjectDialog(target);
|
||||
}
|
||||
//Очищаем все связанные таблицы, чтобы не допустить перерисовки во время удаления объекта.
|
||||
@Override
|
||||
|
||||
@@ -14,7 +14,7 @@ public abstract class EditObjectPass<D extends DBObject> extends ObjectPass<D> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = (D) getTable().getUI().getCurrent();
|
||||
return getTable().getUI().CheckCurrent(Log) && getTable().getUI().ShowEditObjectDialog(target);
|
||||
return getTable().getUI().Check(Log) && getTable().getUI().ShowEditObjectDialog(target);
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
@@ -23,7 +23,8 @@ public abstract class EditObjectPass<D extends DBObject> extends ObjectPass<D> {
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
getTable().ShowUI(target.getPK());
|
||||
for (Class dep : getTable().getFKDependencies().keySet())
|
||||
getDb().getTable(dep).getUI().Refresh();
|
||||
for (Class dep : getTable().getFKDependencies().keySet()) {
|
||||
getDb().getTable(dep).RefreshUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ControlForm<C extends Component> {
|
||||
UI.Clear(scrollPanel);
|
||||
control = null; //очищено.
|
||||
}
|
||||
public void Refresh() {
|
||||
public void RedrawControl() {
|
||||
if (control != null)
|
||||
redrawControl();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package Common.Visual;
|
||||
import Common.CommonConstants;
|
||||
import Common.Current_;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.Grid.TableVisualData;
|
||||
import Common.Database.Tables.DBTable;
|
||||
@@ -29,6 +28,7 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTable> {
|
||||
protected DataSet<?, D> dataSource; //источник данных
|
||||
protected D current = null; //заменить все обращения к мейн модулю.
|
||||
protected DataMenuBar bar = null; //верхняя панель меню
|
||||
protected int current_row_i; //индекс текущей строки.
|
||||
protected boolean events_on = true;
|
||||
@@ -99,15 +99,15 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
void SaveColumns() {
|
||||
if (MainModule_.instance.getDb() != null) {
|
||||
try {
|
||||
if (CurrentName() != null) {
|
||||
String tableName = CurrentName().toString();
|
||||
if (needsCurrent()) {
|
||||
Vector<String> widths = IntStream.range(0, columns.size()).mapToObj(i -> String.valueOf(control.getColumnModel().getColumn(i).getWidth())).collect(Collectors.toCollection(Vector::new));
|
||||
String packed = String.join("|", widths);
|
||||
TableVisualData tableVisualData;
|
||||
if (MainModule_.instance.getDb().tablesVisualData.containsKey(tableName)) {
|
||||
tableVisualData = MainModule_.instance.getDb().tablesVisualData.get(tableName);
|
||||
//todo метод сохрания к бд отнести, как с окнами и проходами. (?)
|
||||
if (MainModule_.instance.getDb().tablesVisualData.containsKey(getCurrentName())) {
|
||||
tableVisualData = MainModule_.instance.getDb().tablesVisualData.get(getCurrentName());
|
||||
} else {
|
||||
tableVisualData = new TableVisualData(tableName);
|
||||
tableVisualData = new TableVisualData(getCurrentName());
|
||||
MainModule_.instance.getDb().Insert(tableVisualData);
|
||||
}
|
||||
tableVisualData.sizes = packed;
|
||||
@@ -202,10 +202,10 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
@Override
|
||||
public void CorrectColumnsSizes() {
|
||||
if ((MainModule_.instance.getDb() != null)
|
||||
&& CurrentName() != null
|
||||
&& MainModule_.instance.getDb().tablesVisualData.containsKey(CurrentName().toString())) {
|
||||
&& needsCurrent()
|
||||
&& MainModule_.instance.getDb().tablesVisualData.containsKey(getCurrentName())) {
|
||||
if (!getColumnsProfile().equalsIgnoreCase(colNamesAndSizes)) {
|
||||
TableVisualData grid = MainModule_.instance.getDb().tablesVisualData.get(CurrentName().toString());
|
||||
TableVisualData grid = MainModule_.instance.getDb().tablesVisualData.get(getCurrentName());
|
||||
String[] data = grid.sizes.split("\\|");
|
||||
for (int i = 0; i < columns.size(); ++i) {
|
||||
if (i <= (data.length - 1)) {
|
||||
@@ -261,7 +261,7 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
//------------------------->>
|
||||
}
|
||||
};
|
||||
if (CurrentName() != null) {
|
||||
if (needsCurrent()) {
|
||||
current_row_i = CommonConstants.Nan;
|
||||
ListSelectionModel selModel = control.getSelectionModel();
|
||||
selModel.addListSelectionListener(e -> {
|
||||
@@ -269,7 +269,7 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
if ((row >= 0)) {
|
||||
if (row != current_row_i) {
|
||||
current_row_i = row;
|
||||
MainModule_.instance.set(CurrentName(), control.getRowObject(row));
|
||||
setCurrent((D) control.getRowObject(row));
|
||||
if (events_on) {
|
||||
try {
|
||||
ShowCurrentObject();
|
||||
@@ -390,12 +390,8 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
protected boolean hasMenuBar() {
|
||||
return true;
|
||||
}
|
||||
//-
|
||||
protected Current_ CurrentName() {
|
||||
return null;
|
||||
}
|
||||
void dropCurrent() {
|
||||
MainModule_.instance.set(CurrentName(), null);
|
||||
public void dropCurrent() {
|
||||
current = null;
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
protected DBObjectDialog getDialog() {
|
||||
@@ -428,7 +424,7 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
public void SaveLastCurrent() {
|
||||
savedCurrentKey = null;
|
||||
savedSelectedKeys.clear();
|
||||
if ((CurrentName() != null) && (getCurrent() != null)) {
|
||||
if (needsCurrent() && (getCurrent() != null)) {
|
||||
savedCurrentKey = getCurrent().getPK();
|
||||
}
|
||||
savedSelectedKeys = getSelectedKeys();
|
||||
@@ -454,26 +450,43 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
public Vector<Object> getSelectedKeys() {
|
||||
return dataSource.Data.values().stream().filter(DBObject::isSelected).map(d -> d.getPK()).collect(Collectors.toCollection(Vector::new));
|
||||
}
|
||||
public boolean CheckCurrent(TextLog log) {
|
||||
return MainModule_.instance.Check(log, CurrentName());
|
||||
//переименовать в CheckCurrent
|
||||
public boolean Check(TextLog log) {
|
||||
if (current == null) {
|
||||
log.Writeln_(dataSource.getSingleDescription() + " не выбран(а)");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public boolean matchCurrentID(int id_in) {
|
||||
return (current != null) && (((int) current.getPK()) == id_in);
|
||||
}
|
||||
public boolean CheckSelectedOrCurrent(TextLog log) {
|
||||
if ((getSelectedCount() == 0) && (CurrentName() == null || (getCurrent() == null))) {
|
||||
if ((getSelectedCount() == 0) && (!needsCurrent() || (getCurrent() == null))) {
|
||||
log.Writeln_(dataSource.getPluralDescription() + ":");
|
||||
log.Writeln_("Отсутствуют отмеченные объекты, или текущий объект!");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
protected boolean needsCurrent() {
|
||||
return false;
|
||||
} //нужно ли отслеживать текущий объект.
|
||||
protected String getCurrentName() {
|
||||
return dataSource.d.getSimpleName();
|
||||
}
|
||||
public D getCurrent() {
|
||||
return (D) MainModule_.instance.get(CurrentName());
|
||||
return current;
|
||||
}
|
||||
public D setCurrent(D object) {
|
||||
return current = object;
|
||||
}
|
||||
public Vector<D> getSelectedOrCurrent() {
|
||||
Vector<D> res = new Vector<>();
|
||||
if (getSelectedCount() > 0)
|
||||
res = getSelectedItems();
|
||||
else {
|
||||
if ((CurrentName() != null) && (getCurrent() != null)) {
|
||||
if (needsCurrent() && (getCurrent() != null)) {
|
||||
res.add(getCurrent());
|
||||
}
|
||||
}
|
||||
@@ -484,7 +497,7 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
if (getSelectedCount() > 0)
|
||||
res = getSelectedKeys();
|
||||
else {
|
||||
if ((CurrentName() != null) && (getCurrent() != null)) {
|
||||
if (needsCurrent() && (getCurrent() != null)) {
|
||||
res.add(getCurrent().getPK());
|
||||
}
|
||||
}
|
||||
@@ -502,7 +515,7 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
if (isObjectVisible(object))
|
||||
object.Select(flag);
|
||||
}
|
||||
Refresh();
|
||||
RedrawControl();
|
||||
}
|
||||
//ДИАЛОГИ
|
||||
public boolean ShowAddObjectDialog(D object) {
|
||||
|
||||
@@ -1,39 +1,20 @@
|
||||
package _VisualDVM;
|
||||
import Common.Current_;
|
||||
public enum Current implements Current_ {
|
||||
Account, //нет формы таблиц.
|
||||
//--
|
||||
DVMPackage,
|
||||
SapforPackage,
|
||||
//--
|
||||
ServerSapfor,
|
||||
SapforEtalonVersion,
|
||||
SapforVersion,
|
||||
//--
|
||||
ComponentServerBackup,
|
||||
Subscriber,
|
||||
FileGraphElement,
|
||||
InlineGraphElement,
|
||||
InlineGraphElement2,
|
||||
IncludeGraphElement,
|
||||
Component,
|
||||
Project,
|
||||
File,
|
||||
Root,
|
||||
Version,
|
||||
BugReport,
|
||||
Account,
|
||||
DBArray,
|
||||
ProjectArray,
|
||||
ParallelRegionInfo,
|
||||
ParallelVariant,
|
||||
Machine,
|
||||
User,
|
||||
Compiler,
|
||||
Makefile,
|
||||
Module,
|
||||
RunConfiguration,
|
||||
EnvironmentValue,
|
||||
CompilationTask,
|
||||
RunTask,
|
||||
ProjectNode, //узел в дереве проекта. нужен для отображения добавленных файлов
|
||||
SelectedDirectory,
|
||||
@@ -42,120 +23,42 @@ public enum Current implements Current_ {
|
||||
RemoteFile,
|
||||
RunStsRecord,
|
||||
//только для того, чтобы закодировать таблицу.
|
||||
Array,
|
||||
ParallelRegion,
|
||||
Dimensions,
|
||||
//----------
|
||||
Warnings,
|
||||
Errors,
|
||||
Notes,
|
||||
Recommendations,
|
||||
//-
|
||||
Sapfor,
|
||||
//-
|
||||
Scenario,
|
||||
ScenarioCommand,
|
||||
//-
|
||||
DVMConfiguration,
|
||||
Group,
|
||||
//-
|
||||
DVMParameterValue,
|
||||
Test,
|
||||
Function,
|
||||
SelectedFunction,
|
||||
//-
|
||||
Credentials,
|
||||
//-
|
||||
PackageVersion,
|
||||
SapforConfiguration,
|
||||
SapforProfile,
|
||||
SapforProfileSetting,
|
||||
//--
|
||||
ProjectView,
|
||||
SubscriberWorkspace,
|
||||
DVMRunTask,
|
||||
SapforSettings,
|
||||
SapforSettingsCommand,
|
||||
DVMSettings;
|
||||
ProjectView, Credentials;
|
||||
@Override
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case DVMSettings:
|
||||
return "Параметры тестирования DVM системы";
|
||||
case SapforSettings:
|
||||
return "Параметры тестирования системы SAPFOR";
|
||||
case SapforSettingsCommand:
|
||||
return "Команда SAPFOR";
|
||||
case DVMRunTask:
|
||||
return "Задача DVM тестирования";
|
||||
case SapforPackage:
|
||||
return "Пакет тестирования SAPFOR";
|
||||
case DVMPackage:
|
||||
return "Пакет тестирования DVM";
|
||||
case DVMConfiguration:
|
||||
return "Конфигурация тестирования";
|
||||
case ServerSapfor:
|
||||
return "тестовая версия SAPFOR";
|
||||
case SubscriberWorkspace:
|
||||
return "рабочее пространство пользователя";
|
||||
case SapforProfile:
|
||||
return "Профиль SAPFOR";
|
||||
case SapforProfileSetting:
|
||||
return "Настройка профиля SAPFOR";
|
||||
case SapforEtalonVersion:
|
||||
return "Версия SAPFOR(Эталон)";
|
||||
case SapforVersion:
|
||||
return "Версия SAPFOR";
|
||||
case ComponentServerBackup:
|
||||
return "Версия компонента для восстановления с сервера";
|
||||
case Subscriber:
|
||||
return "Адресат";
|
||||
case SelectedFunction:
|
||||
return "Выбранный узел графа процедур";
|
||||
case SapforConfiguration:
|
||||
return "Конфигурация тестирования SAPFOR";
|
||||
case PackageVersion:
|
||||
return "Версия пакетного режима";
|
||||
case Credentials:
|
||||
return "Учётные данные";
|
||||
case Function:
|
||||
return "Функция";
|
||||
case DVMParameterValue:
|
||||
return "Параметр DVM системы";
|
||||
case ParallelRegion:
|
||||
return "Область распараллеливания";
|
||||
case Group:
|
||||
return "Группа тестов DVM";
|
||||
case Scenario:
|
||||
return "Сценарий";
|
||||
case ScenarioCommand:
|
||||
return "Команда сценария";
|
||||
case ProjectNode:
|
||||
return "текущий узел дерева проектов"; //служебка
|
||||
case Test:
|
||||
return "Тест";
|
||||
case Sapfor:
|
||||
return "SAPFOR";
|
||||
case EnvironmentValue:
|
||||
return "Значение переменной окружения";
|
||||
case SelectedDirectory:
|
||||
return "Папка проекта";
|
||||
case SelectedFile:
|
||||
return "Файл проекта";
|
||||
case RunConfiguration:
|
||||
return "Конфигурация запуска";
|
||||
case RunTask:
|
||||
return "Задача на запуск";
|
||||
case CompilationTask:
|
||||
return "Задача на компиляцию";
|
||||
case Makefile:
|
||||
return "Мейкфайл";
|
||||
case Module:
|
||||
return "Языковой модуль мейкфайла";
|
||||
case RemoteFile:
|
||||
return "Удалённый файл";
|
||||
case Component:
|
||||
return "Компонент";
|
||||
case Project:
|
||||
return "Проект";
|
||||
case File:
|
||||
@@ -164,16 +67,6 @@ public enum Current implements Current_ {
|
||||
return "Корень дерева версий";
|
||||
case Version:
|
||||
return "Версия";
|
||||
case BugReport:
|
||||
return "Отчёт об ошибке";
|
||||
case Account:
|
||||
return "Аккаунт";
|
||||
case Machine:
|
||||
return "Машина";
|
||||
case User:
|
||||
return "Пользователь";
|
||||
case Compiler:
|
||||
return "Компилятор";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Compiler.CompilerType;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.Validators.PathValidator;
|
||||
public class CompilerDialog extends DBObjectDialog<Compiler, CompilerFields> {
|
||||
@@ -75,7 +76,7 @@ public class CompilerDialog extends DBObjectDialog<Compiler, CompilerFields> {
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.machine_id = Global.mainModule.getMachine().id;
|
||||
Result.machine_id = Global.mainModule.getDb().getTable(Machine.class).getUI().getCurrent().id;
|
||||
Result.description = fields.tfDescription.getText();
|
||||
Result.call_command = fields.tfCallCommand.getText();
|
||||
Result.help_command = fields.tfHelpCommand.getText();
|
||||
|
||||
@@ -5,6 +5,7 @@ import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import Common.Visual.Windows.Dialog.VDirectoryChooser;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Compiler.CompilerType;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.Machine.MachineType;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
@@ -30,7 +31,7 @@ public class CompilerFields implements DialogFields {
|
||||
CompilerType type = (CompilerType) cbCompilerType.getSelectedItem();
|
||||
if (type == CompilerType.dvm) {
|
||||
String dst = null;
|
||||
if (Global.mainModule.getMachine().type.equals(MachineType.Local)) {
|
||||
if (Global.mainModule.getDb().getTable(Machine.class).getUI().getCurrent().type.equals(MachineType.Local)) {
|
||||
File file = directoryChooser.ShowDialog();
|
||||
if (file != null)
|
||||
dst = file.getAbsolutePath();
|
||||
|
||||
@@ -7,6 +7,7 @@ import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -15,8 +16,8 @@ public class CompilersForm extends DataSetControlForm<Compiler> {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected Current CurrentName() {
|
||||
return Current.Compiler;
|
||||
protected boolean needsCurrent() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean hasCheckBox() {
|
||||
@@ -68,7 +69,8 @@ public class CompilersForm extends DataSetControlForm<Compiler> {
|
||||
}
|
||||
@Override
|
||||
public boolean isObjectVisible(Compiler object) {
|
||||
return super.isObjectVisible(object) && MainModule_.instance.matchCurrentID(Current.Machine, object.machine_id);
|
||||
return super.isObjectVisible(object) &&
|
||||
Global.mainModule.getDb().getTable(Machine.class).getUI().matchCurrentID(object.machine_id);
|
||||
}
|
||||
@Override
|
||||
protected DBObjectDialog getDialog() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Credentials;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
//todo реализовать стандартно для выбранных объектов (?)
|
||||
public class CredentialsDBTable extends iDBTable<Credentials> {
|
||||
public CredentialsDBTable() {
|
||||
super(Credentials.class);
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package _VisualDVM.GlobalData.DVMParameter.UI;
|
||||
import Common.MainModule_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.DVMParameter.DVMParameter;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
|
||||
import _VisualDVM.Utils;
|
||||
public class DVMParameterDialog extends DBObjectDialog<DVMParameter, DVMParameterFields> {
|
||||
public DVMParameterDialog() {
|
||||
@@ -45,8 +48,8 @@ public class DVMParameterDialog extends DBObjectDialog<DVMParameter, DVMParamete
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.machine_id = Global.mainModule.getMachine().id;
|
||||
Result.run_configuration_id = Global.mainModule.getRunConfiguration().id;
|
||||
Result.machine_id = MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().id;
|
||||
Result.run_configuration_id = MainModule_.instance.getDb().getTable(RunConfiguration.class).getUI().getCurrent().id;
|
||||
Result.name = (String) fields.cbName.getSelectedItem();
|
||||
Result.value = fields.tfValue.getText();
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ public class DVMParametersForm extends DataSetControlForm<DVMParameter> {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected Current CurrentName() {
|
||||
return Current.DVMParameterValue;
|
||||
protected boolean needsCurrent() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package _VisualDVM.GlobalData.EnvironmentValue.UI;
|
||||
import Common.MainModule_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.EnvironmentValue.EnvironmentValue;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
|
||||
import _VisualDVM.Utils;
|
||||
public class EnvironmentValueDialog extends DBObjectDialog<EnvironmentValue, EnvironmentValueFields> {
|
||||
public EnvironmentValueDialog() {
|
||||
@@ -40,8 +43,8 @@ public class EnvironmentValueDialog extends DBObjectDialog<EnvironmentValue, Env
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.machine_id = Global.mainModule.getMachine().id;
|
||||
Result.run_configuration_id = Global.mainModule.getRunConfiguration().id;
|
||||
Result.machine_id = MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().id;
|
||||
Result.run_configuration_id = MainModule_.instance.getDb().getTable(RunConfiguration.class).getUI().getCurrent().id;
|
||||
Result.name = (String) fields.cbName.getSelectedItem();
|
||||
Result.value = fields.tfValue.getText();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.GlobalData.EnvironmentValue.EnvironmentValue;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -15,8 +16,8 @@ public class EnvironmentsValuesForm extends DataSetControlForm<EnvironmentValue>
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected Current CurrentName() {
|
||||
return Current.EnvironmentValue;
|
||||
protected boolean needsCurrent() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
@@ -48,7 +49,8 @@ public class EnvironmentsValuesForm extends DataSetControlForm<EnvironmentValue>
|
||||
}
|
||||
@Override
|
||||
public boolean isObjectVisible(EnvironmentValue object) {
|
||||
return super.isObjectVisible(object) && MainModule_.instance.matchCurrentID(Current.RunConfiguration, object.run_configuration_id);
|
||||
return super.isObjectVisible(object) &&
|
||||
MainModule_.instance.getDb().matchCurrentID(RunConfiguration.class,object.run_configuration_id );
|
||||
}
|
||||
@Override
|
||||
protected DBObjectDialog<EnvironmentValue, ? extends DialogFields> getDialog() {
|
||||
|
||||
@@ -6,15 +6,19 @@ import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Account.Account;
|
||||
import _VisualDVM.GlobalData.Account.AccountsDBTable;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Compiler.CompilersDBTable;
|
||||
import _VisualDVM.GlobalData.Credentials.Credentials;
|
||||
import _VisualDVM.GlobalData.Credentials.CredentialsDBTable;
|
||||
import _VisualDVM.GlobalData.DBLastProject.LastProjectsDBTable;
|
||||
import _VisualDVM.GlobalData.DVMParameter.DVMParameterDBTable;
|
||||
import _VisualDVM.GlobalData.EnvironmentValue.EnvironmentValuesDBTable;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.Machine.MachinesDBTable;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
import _VisualDVM.GlobalData.Makefile.MakefilesDBTable;
|
||||
import _VisualDVM.GlobalData.Module.ModulesDBTable;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.RunConfigurationsDBTable;
|
||||
import _VisualDVM.GlobalData.SapforProfile.SapforProfile;
|
||||
import _VisualDVM.GlobalData.SapforProfile.SapforProfilesDBTable;
|
||||
@@ -25,6 +29,7 @@ import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.GlobalData.Settings.SettingsDBTable;
|
||||
import _VisualDVM.GlobalData.Tasks.CompilationTask.CompilationTasksDBTable;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTasksDBTable;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
import _VisualDVM.GlobalData.User.UsersDBTable;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Repository.Component.ComponentType;
|
||||
@@ -97,30 +102,46 @@ public class GlobalDatabase extends VisualiserDatabase {
|
||||
public PassCode getSynchronizePassCode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
//todo централизованное сохранение текущих объектов в базах
|
||||
|
||||
public void SaveCredentials() {
|
||||
/*
|
||||
try {
|
||||
Credentials credentials = Global.mainModule.getCredentials();
|
||||
if (Global.mainModule.HasMachine())
|
||||
credentials.machine_id = Global.mainModule.getMachine().id;
|
||||
if (Global.mainModule.HasUser())
|
||||
credentials.user_id = Global.mainModule.getUser().id;
|
||||
if (Global.mainModule.HasCompiler())
|
||||
credentials.compiler_id = Global.mainModule.getCompiler().id;
|
||||
if (Global.mainModule.HasMakefile())
|
||||
credentials.makefile_id = Global.mainModule.getMakefile().id;
|
||||
if (Global.mainModule.HasRunConfiguration())
|
||||
credentials.runconfiguration_id = Global.mainModule.getRunConfiguration().id;
|
||||
|
||||
|
||||
Credentials credentials = MainModule_.instance.getDb().getTable(Credentials.class).getUI().getCurrent();
|
||||
if (MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent()!=null)
|
||||
credentials.machine_id = MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().id;
|
||||
|
||||
if (MainModule_.instance.getDb().getTable(User.class).getUI().getCurrent()!=null)
|
||||
credentials.user_id = MainModule_.instance.getDb().getTable(User.class).getUI().getCurrent().id;
|
||||
|
||||
if (MainModule_.instance.getDb().getTable(Compiler.class).getUI().getCurrent()!=null)
|
||||
credentials.compiler_id = MainModule_.instance.getDb().getTable(Compiler.class).getUI().getCurrent().id;
|
||||
|
||||
if (MainModule_.instance.getDb().getTable(Makefile.class).getUI().getCurrent()!=null)
|
||||
credentials.makefile_id =MainModule_.instance.getDb().getTable(Makefile.class).getUI().getCurrent().id;
|
||||
|
||||
if (MainModule_.instance.getDb().getTable(RunConfiguration.class).getUI().getCurrent()!=null)
|
||||
credentials.runconfiguration_id = MainModule_.instance.getDb().getTable(RunConfiguration.class).getUI().getCurrent().id;
|
||||
Update(credentials);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
public void UpdateCredentials() {
|
||||
/*
|
||||
}
|
||||
try {
|
||||
Update(Global.mainModule.getCredentials());
|
||||
Update(MainModule_.instance.getDb().getTable(Credentials.class).getUI().getCurrent());
|
||||
} catch (Exception ex) {
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
*/
|
||||
}
|
||||
//--
|
||||
public LinkedHashMap<SettingName, String> getSapforSettingsForProfile() {
|
||||
|
||||
@@ -18,8 +18,8 @@ public class MachinesForm extends DataSetControlForm<Machine> {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected Current CurrentName() {
|
||||
return Current.Machine;
|
||||
protected boolean needsCurrent() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean hasCheckBox() {
|
||||
|
||||
@@ -5,6 +5,7 @@ import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
import _VisualDVM.GlobalData.Module.UI.ModuleAnchestorFields;
|
||||
import _VisualDVM.GlobalData.Module.UI.ModuleAnchestorForm;
|
||||
@@ -16,8 +17,8 @@ public class MakefilesForm extends DataSetControlForm<Makefile> {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected Current CurrentName() {
|
||||
return Current.Makefile;
|
||||
protected boolean needsCurrent() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean hasCheckBox() {
|
||||
@@ -64,7 +65,7 @@ public class MakefilesForm extends DataSetControlForm<Makefile> {
|
||||
@Override
|
||||
public boolean isObjectVisible(Makefile object) {
|
||||
return super.isObjectVisible(object) &&
|
||||
MainModule_.instance.matchCurrentID(Current.Machine, object.machine_id);
|
||||
MainModule_.instance.getDb().getTable(Machine.class).getUI().matchCurrentID(object.machine_id);
|
||||
}
|
||||
@Override
|
||||
protected DBObjectDialog<Makefile, ModuleAnchestorFields> getDialog() {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package _VisualDVM.GlobalData.Module.UI;
|
||||
import Common.MainModule_;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Visual.Controls.StyledTextComboBox;
|
||||
import Common.Visual.UI;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
import _VisualDVM.GlobalData.Module.Module;
|
||||
import _VisualDVM.GlobalData.Module.ModuleAnchestor;
|
||||
@@ -27,7 +29,7 @@ public class ModuleAnchestorFields implements DialogFields {
|
||||
//считаем что машина есть.
|
||||
public ModuleAnchestorFields() {
|
||||
//-
|
||||
LinkedHashMap<Integer, Compiler> compilers = Global.mainModule.getMachine().getCompilers();
|
||||
LinkedHashMap<Integer, Compiler> compilers = MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().getCompilers();
|
||||
compilers.values().forEach(compiler -> cbCompilers.addItem(compiler));
|
||||
bHelp.addActionListener(e -> {
|
||||
if (cbCompilers.getSelectedItem() != null) {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package _VisualDVM.GlobalData.Module.UI;
|
||||
import Common.CommonConstants;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.UI;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Compiler.CompilerType;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
import _VisualDVM.GlobalData.Module.Module;
|
||||
import _VisualDVM.GlobalData.Module.ModuleAnchestor;
|
||||
@@ -101,7 +103,7 @@ public class ModuleAnchestorForm<T extends ModuleAnchestor> extends DBObjectDial
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.machine_id = Global.mainModule.getMachine().id;
|
||||
Result.machine_id = MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().id;
|
||||
Compiler compiler = (Compiler) fields.cbCompilers.getSelectedItem();
|
||||
Result.compiler_id = (compiler != null) ? compiler.id : CommonConstants.Nan;
|
||||
Result.command = command;
|
||||
|
||||
@@ -6,6 +6,7 @@ import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
import _VisualDVM.GlobalData.Module.Module;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
@@ -15,8 +16,8 @@ public class ModulesForm extends DataSetControlForm<Module> {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected Current CurrentName() {
|
||||
return Current.Module;
|
||||
protected boolean needsCurrent() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean hasCheckBox() {
|
||||
@@ -56,7 +57,8 @@ public class ModulesForm extends DataSetControlForm<Module> {
|
||||
}
|
||||
@Override
|
||||
public boolean isObjectVisible(Module object) {
|
||||
return super.isObjectVisible(object) && MainModule_.instance.matchCurrentID(Current.Makefile, object.makefile_id);
|
||||
return super.isObjectVisible(object) &&
|
||||
MainModule_.instance.getDb().getTable(Makefile.class).getUI().matchCurrentID(object.makefile_id);
|
||||
}
|
||||
@Override
|
||||
protected DBObjectDialog<Module, ? extends DialogFields> getDialog() {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package _VisualDVM.GlobalData.RunConfiguration.UI;
|
||||
import Common.CommonConstants;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.UI;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Compiler.CompilerType;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -45,7 +47,7 @@ public class RunConfigurationDialog extends DBObjectDialog<RunConfiguration, Run
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.machine_id = Global.mainModule.getMachine().id;
|
||||
Result.machine_id = MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().id;
|
||||
Result.LauncherCall = fields.cbLauncherCall.getSelectedItem().toString();
|
||||
Result.LauncherOptions = (String) fields.cbLaunchOptions.getSelectedItem();
|
||||
if (fields.cbLauncherCall.getSelectedItem() instanceof Compiler) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
@@ -14,8 +15,8 @@ public class RunConfigurationsForm extends DataSetControlForm<RunConfiguration>
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected Current CurrentName() {
|
||||
return Current.RunConfiguration;
|
||||
protected boolean needsCurrent() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
@@ -69,7 +70,8 @@ public class RunConfigurationsForm extends DataSetControlForm<RunConfiguration>
|
||||
}
|
||||
@Override
|
||||
public boolean isObjectVisible(RunConfiguration object) {
|
||||
return super.isObjectVisible(object) && MainModule_.instance.matchCurrentID(Current.Machine, object.machine_id);
|
||||
return super.isObjectVisible(object) &&
|
||||
MainModule_.instance.getDb().getTable(Machine.class).getUI().matchCurrentID(object.machine_id);
|
||||
}
|
||||
@Override
|
||||
protected DBObjectDialog getDialog() {
|
||||
|
||||
@@ -15,10 +15,6 @@ public class SapforProfilesForm extends DataSetControlForm<SapforProfile> {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected Current CurrentName() {
|
||||
return Current.SapforProfile;
|
||||
}
|
||||
@Override
|
||||
protected boolean hasCheckBox() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ import Common.Database.Tables.DataSet;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.SapforProfile.SapforProfile;
|
||||
import _VisualDVM.GlobalData.SapforProfileSetting.SapforProfileSetting;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -11,8 +13,8 @@ public class SapforProfileSettingsForm extends DataSetControlForm<SapforProfileS
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected Current CurrentName() {
|
||||
return Current.SapforProfileSetting;
|
||||
protected boolean needsCurrent() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
@@ -42,6 +44,7 @@ public class SapforProfileSettingsForm extends DataSetControlForm<SapforProfileS
|
||||
}
|
||||
@Override
|
||||
public boolean isObjectVisible(SapforProfileSetting object) {
|
||||
return super.isObjectVisible(object) && MainModule_.instance.matchCurrentID(Current.SapforProfile, object.sapforprofile_id);
|
||||
return super.isObjectVisible(object) &&
|
||||
MainModule_.instance.getDb().getTable(SapforProfile.class).getUI().matchCurrentID(object.sapforprofile_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,10 @@ import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Tables.RendererDate;
|
||||
import Common.Visual.Tables.RendererStatusEnum;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -16,8 +17,8 @@ public class CompilationTasksForm extends DataSetControlForm<CompilationTask> {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected Current CurrentName() {
|
||||
return Current.CompilationTask;
|
||||
protected boolean needsCurrent() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean hasCheckBox() {
|
||||
@@ -62,8 +63,8 @@ public class CompilationTasksForm extends DataSetControlForm<CompilationTask> {
|
||||
@Override
|
||||
public boolean isObjectVisible(CompilationTask object) {
|
||||
return super.isObjectVisible(object) &&
|
||||
MainModule_.instance.matchCurrentID(Current.Machine, object.machine_id) &&
|
||||
MainModule_.instance.matchCurrentID(Current.User, object.user_id) &&
|
||||
MainModule_.instance.getDb().matchCurrentID(Machine.class, object.machine_id) &&
|
||||
MainModule_.instance.getDb().matchCurrentID(User.class, object.user_id) &&
|
||||
Global.mainModule.HasProject() &&
|
||||
object.belongsToProject(Global.mainModule.getProject());
|
||||
}
|
||||
|
||||
@@ -7,7 +7,11 @@ import Common.Visual.Tables.RendererDate;
|
||||
import Common.Visual.Tables.RendererStatusEnum;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
|
||||
import _VisualDVM.GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -16,8 +20,8 @@ public class RunTasksForm extends DataSetControlForm<RunTask> {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected Current CurrentName() {
|
||||
return Current.RunTask;
|
||||
protected boolean needsCurrent() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean hasCheckBox() {
|
||||
@@ -74,11 +78,11 @@ public class RunTasksForm extends DataSetControlForm<RunTask> {
|
||||
@Override
|
||||
public boolean isObjectVisible(RunTask object) {
|
||||
return super.isObjectVisible(object) &&
|
||||
MainModule_.instance.matchCurrentID(Current.Machine, object.machine_id) &&
|
||||
MainModule_.instance.matchCurrentID(Current.User, object.user_id) &&
|
||||
MainModule_.instance.matchCurrentID(Current.RunConfiguration, object.run_configuration_id) &&
|
||||
MainModule_.instance.getDb().getTable(Machine.class).getUI().matchCurrentID(object.machine_id) &&
|
||||
MainModule_.instance.getDb().getTable(User.class).getUI().matchCurrentID(object.user_id) &&
|
||||
MainModule_.instance.getDb().getTable(RunConfiguration.class).getUI().matchCurrentID(object.run_configuration_id) &&
|
||||
Global.mainModule.HasProject() &&
|
||||
object.belongsToProject(Global.mainModule.getProject()) &&
|
||||
MainModule_.instance.matchCurrentID(Current.CompilationTask, object.compilation_task_id);
|
||||
MainModule_.instance.getDb().getTable(CompilationTask.class).getUI().matchCurrentID(object.compilation_task_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor.Local.Linux;
|
||||
import Common.MainModule_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -16,7 +19,7 @@ public class LinuxLocalRunSupervisor extends LinuxLocalTaskSupervisor<RunTask> {
|
||||
}
|
||||
@Override
|
||||
protected Map<String, String> getEnvs() {
|
||||
return Global.mainModule.getRunConfiguration().getEnvMap();
|
||||
return MainModule_.instance.getDb().getTable(RunConfiguration.class).getUI().getCurrent().getEnvMap();
|
||||
}
|
||||
@Override
|
||||
protected String getScriptText() {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor.Local.Windows;
|
||||
import Common.MainModule_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -25,7 +28,7 @@ public class WindowsLocalRunSupervisor extends WindowsLocalTaskSupervisor<RunTas
|
||||
}
|
||||
@Override
|
||||
protected Map<String, String> getEnvs() {
|
||||
return Global.mainModule.getRunConfiguration().getEnvMap();
|
||||
return MainModule_.instance.getDb().getTable(RunConfiguration.class).getUI().getCurrent().getEnvMap();
|
||||
}
|
||||
void kill_mpi() throws Exception {
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor.Remote;
|
||||
import Common.MainModule_;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
|
||||
import _VisualDVM.GlobalData.Tasks.QueueSystem.MVS;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
public class MVSRunSupervisor extends ServerRunSupervisor {
|
||||
@@ -29,7 +32,7 @@ public class MVSRunSupervisor extends ServerRunSupervisor {
|
||||
}
|
||||
@Override
|
||||
protected void StartTask() throws Exception {
|
||||
String env = String.join(" ", Global.mainModule.getRunConfiguration().getEnvList());
|
||||
String env = String.join(" ", MainModule_.instance.getDb().getTable(RunConfiguration.class).getUI().getCurrent().getEnvList());
|
||||
mvs_time = (task.maxtime / 60); //в минутах
|
||||
if (task.maxtime % 60 > 0) mvs_time += 1;
|
||||
String res = "maxtime=" + Utils_.DQuotes(mvs_time) + " ./run";
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor.Remote;
|
||||
import Common.MainModule_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
import _VisualDVM.Utils;
|
||||
@@ -14,7 +17,7 @@ public class ServerRunSupervisor extends RemoteTaskSupervisor<RunTask> {
|
||||
@Override
|
||||
protected void StartTask() throws Exception {
|
||||
String res = "./run";
|
||||
String env = String.join(" ", Global.mainModule.getRunConfiguration().getEnvList());
|
||||
String env = String.join(" ", MainModule_.instance.getDb().getTable(RunConfiguration.class).getUI().getCurrent().getEnvList());
|
||||
if (!env.isEmpty()) res = env + " " + res;
|
||||
//--
|
||||
task.PID = pass.user.connection.startShellProcess(getRemoteProject(), "PID",
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package _VisualDVM.GlobalData.User.UI;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.Machine.MachineType;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
import _VisualDVM.GlobalData.User.UserAuthentication;
|
||||
@@ -14,7 +16,7 @@ public class UserDialog extends DBObjectDialog<User, UserFields> {
|
||||
}
|
||||
@Override
|
||||
public void fillFields() {
|
||||
if (Global.mainModule.getMachine().type.equals(MachineType.Local)) {
|
||||
if (MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().type.equals(MachineType.Local)) {
|
||||
Result.login = "этот пользователь";
|
||||
fields.tfLogin.setEditable(false);
|
||||
}
|
||||
@@ -29,7 +31,7 @@ public class UserDialog extends DBObjectDialog<User, UserFields> {
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.machine_id = Global.mainModule.getMachine().id;
|
||||
Result.machine_id = MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().id;
|
||||
Result.login = fields.tfLogin.getText();
|
||||
Result.authentication = UserAuthentication.password;
|
||||
Result.password = new String(fields.tfPassword.getPassword());
|
||||
|
||||
@@ -7,6 +7,7 @@ import Common.Visual.Tables.RendererStatusEnum;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
@@ -16,8 +17,8 @@ public class UsersForm extends DataSetControlForm<User> {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected Current CurrentName() {
|
||||
return Current.User;
|
||||
protected boolean needsCurrent() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean hasCheckBox() {
|
||||
@@ -65,7 +66,8 @@ public class UsersForm extends DataSetControlForm<User> {
|
||||
}
|
||||
@Override
|
||||
public boolean isObjectVisible(User object) {
|
||||
return super.isObjectVisible(object) && super.isObjectVisible(object) && MainModule_.instance.matchCurrentID(Current.Machine, object.machine_id);
|
||||
return super.isObjectVisible(object) &&
|
||||
MainModule_.instance.getDb().getTable(Machine.class).getUI().matchCurrentID(object.machine_id);
|
||||
}
|
||||
@Override
|
||||
protected DBObjectDialog getDialog() {
|
||||
|
||||
@@ -2,39 +2,15 @@ package _VisualDVM;
|
||||
import Common.MainModule_;
|
||||
import Common.Utils.Vector_;
|
||||
import _VisualDVM.GlobalData.Account.Account;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Credentials.Credentials;
|
||||
import _VisualDVM.GlobalData.GlobalDatabase;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
import _VisualDVM.GlobalData.Module.Module;
|
||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
|
||||
import _VisualDVM.GlobalData.SapforProfile.SapforProfile;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
import _VisualDVM.ProjectData.ProjectView;
|
||||
import _VisualDVM.ProjectData.SapforData.Functions.FuncInfo;
|
||||
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
|
||||
import _VisualDVM.Repository.BugReport.BugReport;
|
||||
import _VisualDVM.Repository.Component.Component;
|
||||
import _VisualDVM.Repository.Component.Sapfor.Sapfor;
|
||||
import _VisualDVM.Repository.SubscriberWorkspace.SubscriberWorkspace;
|
||||
import _VisualDVM.Repository.Subscribes.Subscriber;
|
||||
import _VisualDVM.TestingSystem.Common.Group.Group;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMRunTask;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.SapforSettings;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
|
||||
import _VisualDVM.Visual.MainUI;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
@@ -73,6 +49,8 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
|
||||
return "_VisualDVM.Passes.All.";
|
||||
}
|
||||
//--
|
||||
public boolean HasAccount(){return get(Current.Account)!=null; } //Бессмысленно. аккаунт всегда подразумевается. вывести.
|
||||
public Account getAccount(){return (Account) get(Current.Account);} //временно
|
||||
public boolean HasProject() {
|
||||
return get(Current.Project) != null;
|
||||
}
|
||||
@@ -83,54 +61,15 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
|
||||
public boolean HasFile() {
|
||||
return get(Current.File) != null;
|
||||
}
|
||||
public boolean HasAccount() {
|
||||
return get(Current.Account) != null;
|
||||
}
|
||||
public boolean HasMachine() {
|
||||
return get(Current.Machine) != null;
|
||||
}
|
||||
public boolean HasUser() {
|
||||
return get(Current.User) != null;
|
||||
}
|
||||
public boolean HasCompiler() {
|
||||
return get(Current.Compiler) != null;
|
||||
}
|
||||
public boolean HasRemoteFile() {
|
||||
return get(Current.RemoteFile) != null;
|
||||
}
|
||||
public boolean HasMakefile() {
|
||||
return get(Current.Makefile) != null;
|
||||
}
|
||||
public boolean HasRunConfiguration() {
|
||||
return get(Current.RunConfiguration) != null;
|
||||
}
|
||||
public boolean HasCompilationTask() {
|
||||
return get(Current.CompilationTask) != null;
|
||||
}
|
||||
public boolean HasRunTask() {
|
||||
return get(Current.RunTask) != null;
|
||||
}
|
||||
public boolean HasProjectView() {
|
||||
return get(Current.ProjectView) != null;
|
||||
}
|
||||
public Credentials getCredentials() {
|
||||
return (Credentials) get(Current.Credentials);
|
||||
}
|
||||
public SapforSettings getSapforSettings() {
|
||||
return (SapforSettings) get(Current.SapforSettings);
|
||||
}
|
||||
public boolean HasSapforSettings() {
|
||||
return get(Current.SapforSettings) != null;
|
||||
}
|
||||
public DBProjectFile getFile() {
|
||||
return (DBProjectFile) get(Current.File);
|
||||
}
|
||||
public Component getComponent() {
|
||||
return (Component) get(Current.Component);
|
||||
}
|
||||
public BugReport getBugReport() {
|
||||
return (BugReport) get(Current.BugReport);
|
||||
}
|
||||
public db_project_info getRoot() {
|
||||
return (db_project_info) get(Current.Root);
|
||||
}
|
||||
@@ -140,66 +79,12 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
|
||||
public db_project_info getVersion() {
|
||||
return (db_project_info) get(Current.Version);
|
||||
}
|
||||
public Account getAccount() {
|
||||
return (Account) get(Current.Account);
|
||||
}
|
||||
public boolean HasSubscriber() {
|
||||
return get(Current.Subscriber) != null;
|
||||
}
|
||||
public Subscriber getSubscriber() {
|
||||
return (Subscriber) get(Current.Subscriber);
|
||||
}
|
||||
public Machine getMachine() {
|
||||
return (Machine) get(Current.Machine);
|
||||
}
|
||||
public User getUser() {
|
||||
return (User) get(Current.User);
|
||||
}
|
||||
public Compiler getCompiler() {
|
||||
return (Compiler) get(Current.Compiler);
|
||||
}
|
||||
public CompilationTask getCompilationTask() {
|
||||
return (CompilationTask) get(Current.CompilationTask);
|
||||
}
|
||||
public RunTask getRunTask() {
|
||||
return (RunTask) get(Current.RunTask);
|
||||
}
|
||||
public RemoteFile getRemoteFile() {
|
||||
return (RemoteFile) get(Current.RemoteFile);
|
||||
}
|
||||
public Makefile getMakefile() {
|
||||
return (Makefile) get(Current.Makefile);
|
||||
}
|
||||
public Module getModule() {
|
||||
return (Module) get(Current.Module);
|
||||
}
|
||||
public RunConfiguration getRunConfiguration() {
|
||||
return (RunConfiguration) get(Current.RunConfiguration);
|
||||
}
|
||||
public Sapfor getSapfor() {
|
||||
return (Sapfor) get(Current.Sapfor);
|
||||
}
|
||||
public boolean HasGroup() {
|
||||
return get(Current.Group) != null;
|
||||
}
|
||||
public Group getGroup() {
|
||||
return (Group) get(Current.Group);
|
||||
}
|
||||
public boolean HasConfiguration() {
|
||||
return get(Current.DVMConfiguration) != null;
|
||||
}
|
||||
public DVMConfiguration getDVMConfiguration() {
|
||||
return (DVMConfiguration) get(Current.DVMConfiguration);
|
||||
}
|
||||
public SapforConfiguration getSapforConfiguration() {
|
||||
return (SapforConfiguration) get(Current.SapforConfiguration);
|
||||
}
|
||||
public Test getTest() {
|
||||
return (Test) get(Current.Test);
|
||||
}
|
||||
public boolean HasTest() {
|
||||
return get(Current.Test) != null;
|
||||
}
|
||||
public boolean HasVersion() {
|
||||
return get(Current.Version) != null;
|
||||
}
|
||||
@@ -225,15 +110,6 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
|
||||
public DBProjectFile getSelectedFile() {
|
||||
return (DBProjectFile) get(Current.SelectedFile);
|
||||
}
|
||||
public boolean HasBugReport() {
|
||||
return get(Current.BugReport) != null;
|
||||
}
|
||||
public ParallelRegion getParallelRegion() {
|
||||
return (ParallelRegion) get(Current.ParallelRegion);
|
||||
}
|
||||
public boolean HasParallelRegion() {
|
||||
return get(Current.ParallelRegion) != null;
|
||||
}
|
||||
public boolean HasFunction() {
|
||||
return get(Current.Function) != null;
|
||||
}
|
||||
@@ -246,63 +122,18 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
|
||||
public FuncInfo getSelectionFunction() {
|
||||
return (FuncInfo) get(Current.SelectedFunction);
|
||||
}
|
||||
public boolean HasScenario() {
|
||||
return get(Current.Scenario) != null;
|
||||
}
|
||||
public db_project_info getPackageVersion() {
|
||||
return (db_project_info) get(Current.PackageVersion);
|
||||
}
|
||||
public boolean HasPackageVersion() {
|
||||
return get(Current.PackageVersion) != null;
|
||||
}
|
||||
public boolean HasSapforConfiguration() {
|
||||
return get(Current.SapforConfiguration) != null;
|
||||
}
|
||||
public ProjectView getProjectView() {
|
||||
return (ProjectView) get(Current.ProjectView);
|
||||
}
|
||||
public boolean HasSapforProfile() {
|
||||
return get(Current.SapforProfile) != null;
|
||||
}
|
||||
public SapforProfile getSapforProfile() {
|
||||
return (SapforProfile) get(Current.SapforProfile);
|
||||
}
|
||||
public boolean HasServerSapfor() {
|
||||
return get(Current.ServerSapfor) != null;
|
||||
}
|
||||
public ServerSapfor getServerSapfor() {
|
||||
return (ServerSapfor) get(Current.ServerSapfor);
|
||||
}
|
||||
public boolean HasSubscriberWorkspace() {
|
||||
return get(Current.SubscriberWorkspace) != null;
|
||||
}
|
||||
public SubscriberWorkspace getSubscriberWorkspace() {
|
||||
return (SubscriberWorkspace) get(Current.SubscriberWorkspace);
|
||||
}
|
||||
public boolean HasDVMPackage() {
|
||||
return get(Current.DVMPackage) != null;
|
||||
}
|
||||
public DVMPackage getDVMPackage() {
|
||||
return (DVMPackage) get(Current.DVMPackage);
|
||||
}
|
||||
public boolean HasSapforPackage() {
|
||||
return get(Current.SapforPackage) != null;
|
||||
}
|
||||
public SapforPackage getSapforPackage() {
|
||||
return (SapforPackage) get(Current.SapforPackage);
|
||||
}
|
||||
public boolean HasDVMRunTask() {
|
||||
return get(Current.DVMRunTask) != null;
|
||||
}
|
||||
public DVMRunTask getDVMRunTask() {
|
||||
return (DVMRunTask) get(Current.DVMRunTask);
|
||||
}
|
||||
public void DropCurrentFile() {
|
||||
set(Current.File, null);
|
||||
set(Current.FileGraphElement, null);
|
||||
set(Current.Notes, null);
|
||||
set(Current.Warnings, null);
|
||||
set(Current.Errors, null);
|
||||
}
|
||||
public void DropCurrentProject() {
|
||||
set(Current.Project, null);
|
||||
@@ -312,10 +143,6 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
|
||||
set(Current.ProjectNode, null);
|
||||
set(Current.SelectedFile, null);
|
||||
set(Current.SelectedDirectory, null);
|
||||
set(Current.ParallelVariant, null);
|
||||
set(Current.Dimensions, null);
|
||||
set(Current.Array, null);
|
||||
set(Current.DBArray, null);
|
||||
}
|
||||
public void SetUserPassesAccess() {
|
||||
for (PassCode code : accountRoleDependentPasses)
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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" +
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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" +
|
||||
" и выполните команду 'Инициализация пользователя'\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() {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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_));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
//-
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
//---------------------
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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()
|
||||
) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<>();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -6,8 +6,8 @@ import _VisualDVM.Repository.Component.Component;
|
||||
public abstract class CurrentComponentPass extends Pass<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;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user