no message
This commit is contained in:
@@ -5,6 +5,7 @@ import _VisualDVM.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.DVMParameter.UI.DVMParameterFields;
|
||||
import _VisualDVM.GlobalData.GlobalDatabase;
|
||||
@@ -76,7 +77,7 @@ public class DVMParameterDBTable extends iDBTable<DVMParameter> {
|
||||
Log.Writeln("Значение переменной окружения не может содержать двойные кавычки");
|
||||
}
|
||||
*/
|
||||
for (DVMParameter par : ((GlobalDatabase) Utils_.db).dvmParameters.Data.values()) {
|
||||
for (DVMParameter par : (Global.mainModule.getDb()).dvmParameters.Data.values()) {
|
||||
if (par.isVisible() && (Result.id != par.id) && (par.name.equals(name))) {
|
||||
Log.Writeln("В конфигурации запуска уже задан параметр DVM системы с именем " + Utils_.Brackets(name));
|
||||
break;
|
||||
|
||||
@@ -5,6 +5,7 @@ import _VisualDVM.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.EnvironmentValue.UI.EnvironmentValueFields;
|
||||
import _VisualDVM.GlobalData.GlobalDatabase;
|
||||
@@ -43,7 +44,7 @@ public class EnvironmentValuesDBTable extends iDBTable<EnvironmentValue> {
|
||||
if (value.contains("\"")) {
|
||||
Log.Writeln("Значение переменной окружения не может содержать двойные кавычки");
|
||||
}
|
||||
for (EnvironmentValue env : ((GlobalDatabase) Utils_.db).environmentValues.Data.values()) {
|
||||
for (EnvironmentValue env : (Global.mainModule.getDb()).environmentValues.Data.values()) {
|
||||
if (env.isVisible() && (Result.id != env.id) && (env.name.equals(name))) {
|
||||
Log.Writeln("В конфигурации запуска уже задана переменная окружения с именем " + Utils_.Brackets(name));
|
||||
break;
|
||||
|
||||
@@ -58,7 +58,7 @@ public class GlobalDatabase extends VisualiserDatabase {
|
||||
public SapforProfileSettingsDBTable sapforProfilesSettings = null;
|
||||
//-
|
||||
public GlobalDatabase() {
|
||||
super(Paths.get(System.getProperty("user.dir"), "Data", Global.properties.GlobalDBName).toFile());
|
||||
super(Paths.get(System.getProperty("user.dir"), "Data", "db7.sqlite").toFile());
|
||||
}
|
||||
@Override
|
||||
protected void initAllTables() throws Exception {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package _VisualDVM.GlobalData.Machine;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
|
||||
@@ -26,10 +27,10 @@ public class Machine extends iDBObject {
|
||||
"Машина по адресу " + Utils_.Brackets(getURL());
|
||||
}
|
||||
public LinkedHashMap<Integer, Compiler> getCompilers() {
|
||||
return Utils_.db.getMapByFKi(this, Compiler.class);
|
||||
return Global.mainModule.getDb().getMapByFKi(this, Compiler.class);
|
||||
}
|
||||
public LinkedHashMap<Integer, User> getUsers() {
|
||||
return Utils_.db.getMapByFKi(this, User.class);
|
||||
return Global.mainModule.getDb().getMapByFKi(this, User.class);
|
||||
}
|
||||
@Override
|
||||
public String getDialogName() {
|
||||
|
||||
@@ -2,6 +2,7 @@ package _VisualDVM.GlobalData.Makefile;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Utils.TextLog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Compiler.CompilerType;
|
||||
@@ -25,10 +26,10 @@ public class Makefile extends ModuleAnchestor {
|
||||
return Current.HasMachine() && (machine_id == Current.getMachine().id);
|
||||
}
|
||||
public LinkedHashMap<LanguageName, Module> getActiveModules() {
|
||||
return Utils_.db.getByFKAndGroupBy(this, Module.class, "language", LanguageName.class).values().stream().filter(Module::isSelected).collect(Collectors.toMap(module -> module.language, module -> module, (a, b) -> b, LinkedHashMap::new));
|
||||
return Global.mainModule.getDb().getByFKAndGroupBy(this, Module.class, "language", LanguageName.class).values().stream().filter(Module::isSelected).collect(Collectors.toMap(module -> module.language, module -> module, (a, b) -> b, LinkedHashMap::new));
|
||||
}
|
||||
public LinkedHashMap<LanguageName, Module> getModules() {
|
||||
return Utils_.db.getByFKAndGroupBy(this, Module.class, "language", LanguageName.class);
|
||||
return Global.mainModule.getDb().getByFKAndGroupBy(this, Module.class, "language", LanguageName.class);
|
||||
}
|
||||
public String Generate(db_project_info project, boolean useFilesOrder, LinkedHashMap<LanguageName, Module> modules) throws Exception {
|
||||
Compiler linker = getCompiler();
|
||||
@@ -159,7 +160,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
//todo возможно улучшить
|
||||
//https://habr.com/ru/post/211751/
|
||||
public Machine getMachine() {
|
||||
return Utils_.db.getById(Machine.class, machine_id);
|
||||
return Global.mainModule.getDb().getById(Machine.class, machine_id);
|
||||
}
|
||||
public boolean DependsToCompiler(Compiler compiler) {
|
||||
if (compiler_id == compiler.id) return true;
|
||||
|
||||
@@ -2,6 +2,7 @@ package _VisualDVM.GlobalData.Module;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
public class Module extends ModuleAnchestor {
|
||||
@@ -29,7 +30,7 @@ public class Module extends ModuleAnchestor {
|
||||
public void Select(boolean flag) {
|
||||
on = flag ? 1 : 0;
|
||||
try {
|
||||
Utils_.db.Update(this);
|
||||
Global.mainModule.getDb().Update(this);
|
||||
} catch (Exception e) {
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package _VisualDVM.GlobalData.Module;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
public class ModuleAnchestor extends iDBObject {
|
||||
//--------------------------------------------------------------------------------------
|
||||
@@ -16,7 +17,7 @@ public class ModuleAnchestor extends iDBObject {
|
||||
return ((compiler = getCompiler()) == null) ? "" : compiler.getDescription();
|
||||
}
|
||||
public Compiler getCompiler() {
|
||||
return Utils_.db.getById(Compiler.class, compiler_id);
|
||||
return Global.mainModule.getDb().getById(Compiler.class, compiler_id);
|
||||
}
|
||||
public String getDescription() {
|
||||
String res = "";
|
||||
|
||||
@@ -4,6 +4,7 @@ import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import Common.Utils.TextLog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.DVMParameter.DVMParameter;
|
||||
import _VisualDVM.GlobalData.EnvironmentValue.EnvironmentValue;
|
||||
@@ -117,7 +118,7 @@ public class RunConfiguration extends iDBObject {
|
||||
}
|
||||
//---------------------------------------->
|
||||
public Compiler getCompiler() {
|
||||
return Utils_.db.getById(Compiler.class, compiler_id);
|
||||
return Global.mainModule.getDb().getById(Compiler.class, compiler_id);
|
||||
}
|
||||
public boolean isCube() {
|
||||
return cube != 0;
|
||||
@@ -189,13 +190,13 @@ public class RunConfiguration extends iDBObject {
|
||||
return "run_configuration_id";
|
||||
}
|
||||
public Vector<String> getEnvList() {
|
||||
return Utils_.db.getVectorStringByFK(this, EnvironmentValue.class);
|
||||
return Global.mainModule.getDb().getVectorStringByFK(this, EnvironmentValue.class);
|
||||
}
|
||||
public Vector<String> getParList() {
|
||||
return Utils_.db.getVectorStringByFK(this, DVMParameter.class);
|
||||
return Global.mainModule.getDb().getVectorStringByFK(this, DVMParameter.class);
|
||||
}
|
||||
public LinkedHashMap<String, String> getEnvMap() {
|
||||
LinkedHashMap<Integer, EnvironmentValue> envs = Utils_.db.getMapByFKi(this, EnvironmentValue.class);
|
||||
LinkedHashMap<Integer, EnvironmentValue> envs = Global.mainModule.getDb().getMapByFKi(this, EnvironmentValue.class);
|
||||
LinkedHashMap<String, String> res = new LinkedHashMap<>();
|
||||
for (EnvironmentValue e : envs.values()) {
|
||||
if (!res.containsKey(e.name))
|
||||
|
||||
@@ -10,6 +10,7 @@ import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Compiler.CompilerType;
|
||||
import _VisualDVM.GlobalData.DVMParameter.DVMParameter;
|
||||
@@ -40,7 +41,7 @@ public class RunConfigurationsDBTable extends iDBTable<RunConfiguration> {
|
||||
return new DBObjectDialog<RunConfiguration, RunConfigurationFields>(RunConfigurationFields.class) {
|
||||
@Override
|
||||
public void fillFields() {
|
||||
for (Compiler compiler : ((GlobalDatabase) Utils_.db).compilers.Data.values()) {
|
||||
for (Compiler compiler : (Global.mainModule.getDb()).compilers.Data.values()) {
|
||||
if (compiler.isVisible() && compiler.type.equals(CompilerType.dvm))
|
||||
fields.cbLauncherCall.addItem(compiler);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class CompilationTask extends Task {
|
||||
break;
|
||||
}
|
||||
}
|
||||
Utils_.db.Update(this);
|
||||
Global.mainModule.getDb().Update(this);
|
||||
}
|
||||
//---------------------------------------------------
|
||||
@Override
|
||||
@@ -80,7 +80,7 @@ public class CompilationTask extends Task {
|
||||
belongsToProject(Current.getProject());
|
||||
}
|
||||
public Makefile getMakefile() {
|
||||
return Utils_.db.getById(Makefile.class, makefile_id);
|
||||
return Global.mainModule.getDb().getById(Makefile.class, makefile_id);
|
||||
}
|
||||
@Override
|
||||
public String getFullCommand() {
|
||||
@@ -90,7 +90,7 @@ public class CompilationTask extends Task {
|
||||
LinkedHashMap<Integer, RunTask> res = new LinkedHashMap<>();
|
||||
//так не получится. не правильно назвал ключевое поле. F...
|
||||
// return Global.db.getMapByFKi(this, RunTask.class);
|
||||
for (RunTask runTask : ((GlobalDatabase) Utils_.db).runTasks.Data.values()) {
|
||||
for (RunTask runTask : (Global.mainModule.getDb()).runTasks.Data.values()) {
|
||||
if (runTask.compilation_task_id == id)
|
||||
res.put(runTask.id, runTask);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class RunTask extends Task {
|
||||
super.DropResults();
|
||||
Utils.forceDeleteWithCheck(getLocalStsFile());
|
||||
CleanTime = 0;
|
||||
Utils_.db.Update(this);
|
||||
Global.mainModule.getDb().Update(this);
|
||||
}
|
||||
@Override
|
||||
public File getHome() {
|
||||
@@ -62,16 +62,16 @@ public class RunTask extends Task {
|
||||
compilation_task_id == Current.getCompilationTask().id;
|
||||
}
|
||||
public RunConfiguration getRunConfiguration() {
|
||||
return ((GlobalDatabase) Utils_.db).runConfigurations.Data.get(run_configuration_id);
|
||||
return (Global.mainModule.getDb()).runConfigurations.Data.get(run_configuration_id);
|
||||
}
|
||||
public CompilationTask getCompilationTask() {
|
||||
return ((GlobalDatabase) Utils_.db).compilationTasks.Data.get(compilation_task_id);
|
||||
return (Global.mainModule.getDb()).compilationTasks.Data.get(compilation_task_id);
|
||||
}
|
||||
public void UpdateLastStsName(String file_name) {
|
||||
if (!last_sts_name.equals(file_name)) {
|
||||
last_sts_name = file_name;
|
||||
try {
|
||||
Utils_.db.Update(this);
|
||||
Global.mainModule.getDb().Update(this);
|
||||
} catch (Exception ex) {
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor.Local.Windows;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.GlobalDatabase;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
@@ -19,7 +20,7 @@ public class WindowsLocalCompilationSupervisor extends WindowsLocalTaskSuperviso
|
||||
}
|
||||
@Override
|
||||
protected String getScriptText() {
|
||||
return Utils_.DQuotes(((GlobalDatabase) Utils_.db).settings.get(SettingName.LocalMakePathWindows).Value) + " 1>out.txt 2>err.txt";
|
||||
return Utils_.DQuotes((Global.mainModule.getDb()).settings.get(SettingName.LocalMakePathWindows).Value) + " 1>out.txt 2>err.txt";
|
||||
}
|
||||
//скорее всего как то выделить подготовку к компиляции как метод предка.
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Tasks.Task;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
@@ -16,7 +17,7 @@ public abstract class TaskSupervisor<T extends Task, P extends Pass> {
|
||||
public void ShowTaskState(){
|
||||
|
||||
|
||||
Utils_.db.tables.get(task.getClass()).ShowUI(task.getPK());
|
||||
Global.mainModule.getDb().tables.get(task.getClass()).ShowUI(task.getPK());
|
||||
}
|
||||
public void Init(T task_in, P pass_in, db_project_info project_in) {
|
||||
task = task_in;
|
||||
@@ -132,6 +133,6 @@ public abstract class TaskSupervisor<T extends Task, P extends Pass> {
|
||||
}
|
||||
}
|
||||
public void UpdateTask() throws Exception {
|
||||
Utils_.db.Update(task);
|
||||
Global.mainModule.getDb().Update(task);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import Common.CommonConstants;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
@@ -44,7 +45,7 @@ public abstract class Task extends iDBObject {
|
||||
EndDate = 0;
|
||||
Time = 0;
|
||||
state = TaskState.Inactive;
|
||||
Utils_.db.Update(this);
|
||||
Global.mainModule.getDb().Update(this);
|
||||
}
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="локальные файлы">
|
||||
@@ -66,10 +67,10 @@ public abstract class Task extends iDBObject {
|
||||
return new Date(EndDate);
|
||||
}
|
||||
public Machine getMachine() {
|
||||
return Utils_.db.getById(Machine.class, machine_id);
|
||||
return Global.mainModule.getDb().getById(Machine.class, machine_id);
|
||||
}
|
||||
public User getUser() {
|
||||
return Utils_.db.getById(User.class, user_id);
|
||||
return Global.mainModule.getDb().getById(User.class, user_id);
|
||||
}
|
||||
protected String getTextResult(File file) {
|
||||
return (file.exists()) ? Utils.ReadAllText(file) : "файл не найден. Задача еще не выполнялась или была завершена некорректно";
|
||||
@@ -92,7 +93,7 @@ public abstract class Task extends iDBObject {
|
||||
if (state != state_in) {
|
||||
state = state_in;
|
||||
try {
|
||||
Utils_.db.Update(this);
|
||||
Global.mainModule.getDb().Update(this);
|
||||
} catch (Exception ex) {
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user