From e7939713e74a7a11fa8f5d17374b2f4330c2dd67 Mon Sep 17 00:00:00 2001 From: 02090095 Date: Tue, 8 Oct 2024 15:32:39 +0300 Subject: [PATCH] no message --- .idea/workspace.xml | 104 +++--------------- properties | 1 - src/Common/Mode.java | 10 ++ src/Common/Utils/CommonUtils.java | 8 +- src/Common/Utils/Loggable.java | 4 +- src/Common/Visual/DataSetControlForm.java | 2 - src/Common_old/Current.java | 14 --- src/Common_old/GlobalProperties.java | 5 +- src/Common_old/UI/UI.java | 8 +- src/GlobalData/Grid/TableVisualData.java | 2 + src/ProjectData/Messages/Message.java | 5 +- src/ProjectData/Project/db_project_info.java | 2 +- src/Repository/Component/Sapfor/Sapfor.java | 4 +- src/TestingSystem/Common/Group/Group.java | 2 +- .../Common/MachineProcess/MachineProcess.java | 9 +- src/TestingSystem/Common/Test/Test.java | 2 +- src/TestingSystem/Common/TestingPlanner.java | 3 +- .../SAPFOR/SapforTestingPlanner.java | 6 +- .../Passes/All/DeleteVersion.java | 4 +- .../Passes/All/SPF_CreateParallelVariant.java | 9 +- .../Passes/All/SPF_ParseFilesWithOrder.java | 2 +- src/Visual_DVM_2021/Passes/Pass_2021.java | 18 +-- .../Passes/SapforAnalysis.java | 3 +- src/_VisualDVM/Global.java | 10 +- 24 files changed, 82 insertions(+), 155 deletions(-) create mode 100644 src/Common/Mode.java diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5f112f2a..130f386a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,96 +7,28 @@ - + + - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + diff --git a/properties b/properties index 2e627f77..8d5e29f1 100644 --- a/properties +++ b/properties @@ -34,7 +34,6 @@ "InstructionPath": "", "PerformanceAnalyzerPath": "", "ComponentsBackUpsCount": 10, - "TestingKernels": 64, "AutoCheckTesting": true, "CheckTestingIntervalSeconds": 10, "EmailOnTestingProgress": true, diff --git a/src/Common/Mode.java b/src/Common/Mode.java new file mode 100644 index 00000000..499bafce --- /dev/null +++ b/src/Common/Mode.java @@ -0,0 +1,10 @@ +package Common; +public enum Mode { + Undefined, + Normal, + Server, + Testing, + Package, + MachineQueue, + LocalMachineQueue +} diff --git a/src/Common/Utils/CommonUtils.java b/src/Common/Utils/CommonUtils.java index da8fb1ba..9db3b445 100644 --- a/src/Common/Utils/CommonUtils.java +++ b/src/Common/Utils/CommonUtils.java @@ -1,7 +1,8 @@ package Common.Utils; import Common.CommonConstants; -import Common.Database.Database; import Common.Database.VisualiserDatabase; +import Common.Mode; +import Common_old.Current; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import org.apache.commons.io.FileUtils; @@ -23,6 +24,11 @@ import java.util.concurrent.Semaphore; import java.util.regex.Matcher; import java.util.stream.Collectors; public class CommonUtils { + //Режим + public static Mode mode= Mode.Undefined; + public static boolean hasUI() { + return mode.equals(Mode.Normal); + } //Текущая оперционная система public static boolean isWindows=true; //Домашняя папка. diff --git a/src/Common/Utils/Loggable.java b/src/Common/Utils/Loggable.java index 5273a774..b7143d0a 100644 --- a/src/Common/Utils/Loggable.java +++ b/src/Common/Utils/Loggable.java @@ -1,6 +1,4 @@ package Common.Utils; -import Common.Utils.CommonUtils; -import Common_old.Current; import Common_old.UI.DebugPrintLevel; import Common_old.UI.UI; import Common_old.Utils.Utils; @@ -42,7 +40,7 @@ public interface Loggable { ex.printStackTrace(writer); writer.flush(); Print(out.toString()); - if (Current.hasUI()) + if (CommonUtils.hasUI()) UI.Error("Возникло исключение. Подробности в файле журнала\n" + CommonUtils.Brackets(getLogFile().getAbsolutePath())); } diff --git a/src/Common/Visual/DataSetControlForm.java b/src/Common/Visual/DataSetControlForm.java index e5c12d8c..bf3667b1 100644 --- a/src/Common/Visual/DataSetControlForm.java +++ b/src/Common/Visual/DataSetControlForm.java @@ -68,7 +68,6 @@ public class DataSetControlForm extends ControlWithCurrentForm { try { if ((CurrentName() != null)) { String tableName= CurrentName().toString(); - System.out.println(tableName+" savingColumns..."); Vector 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; @@ -80,7 +79,6 @@ public class DataSetControlForm extends ControlWithCurrentForm { } tableVisualData.sizes = packed; CommonUtils.db.Update(tableVisualData); - System.out.println("done"); } } catch (Exception ex) { ex.printStackTrace(); diff --git a/src/Common_old/Current.java b/src/Common_old/Current.java index 572c18d0..ea75800c 100644 --- a/src/Common_old/Current.java +++ b/src/Common_old/Current.java @@ -108,10 +108,6 @@ public enum Current implements CurrentAnchestor { SapforSettings, SapforSettingsCommand, DVMSettings; - public static Mode mode; - public static boolean hasUI() { - return Current.mode.equals(Current.Mode.Normal); - } public static boolean HasProject() { return CurrentAnchestor.get(Project) != null; } @@ -463,14 +459,4 @@ public enum Current implements CurrentAnchestor { return ""; } } - //--- - public enum Mode { - Undefined, - Normal, - Server, - Testing, - Package, - MachineQueue, - LocalMachineQueue - } } diff --git a/src/Common_old/GlobalProperties.java b/src/Common_old/GlobalProperties.java index 8ab37449..d1b37526 100644 --- a/src/Common_old/GlobalProperties.java +++ b/src/Common_old/GlobalProperties.java @@ -26,7 +26,7 @@ public class GlobalProperties extends Properties { } } @Expose - public Current.Mode Mode = Current.Mode.Normal; + public Common.Mode Mode = Common.Mode.Normal; @Expose public String ServerAddress = "alex-freenas.ddns.net"; @Expose @@ -105,8 +105,6 @@ public class GlobalProperties extends Properties { public int ComponentsBackUpsCount = 10; //- тестирование. @Expose - public int TestingKernels = 4; //число ядер для тестирования - @Expose public boolean AutoCheckTesting = false; // проверять ли задачи тестирования при включенном визуализаторе. @Expose public int CheckTestingIntervalSeconds = 10; //интервал автопроверки тестирования @@ -159,7 +157,6 @@ public class GlobalProperties extends Properties { InstructionPath = p.InstructionPath; PerformanceAnalyzerPath = p.PerformanceAnalyzerPath; ComponentsBackUpsCount = p.ComponentsBackUpsCount; - TestingKernels = p.TestingKernels; AutoCheckTesting = p.AutoCheckTesting; CheckTestingIntervalSeconds = p.CheckTestingIntervalSeconds; EmailOnTestingProgress = p.EmailOnTestingProgress; diff --git a/src/Common_old/UI/UI.java b/src/Common_old/UI/UI.java index a0f0698e..d42fbd06 100644 --- a/src/Common_old/UI/UI.java +++ b/src/Common_old/UI/UI.java @@ -319,7 +319,7 @@ public class UI { } //--------------- public static boolean Question(Component parent, String text) { - return !Current.hasUI() || (JOptionPane.showConfirmDialog(parent, + return !CommonUtils.hasUI() || (JOptionPane.showConfirmDialog(parent, text + "?", "Подтверждение", JOptionPane.YES_NO_OPTION, @@ -330,16 +330,16 @@ public class UI { } public static void Info(String message) { CommonUtils.CopyToClipboard(message); - if (Current.hasUI()) + if (CommonUtils.hasUI()) JOptionPane.showMessageDialog(getFrontWindow(), message, "", 1); } public static void Error(String message) { CommonUtils.CopyToClipboard(message); - if (Current.hasUI()) + if (CommonUtils.hasUI()) JOptionPane.showMessageDialog(getFrontWindow(), message, "", 0); } public static boolean Warning(String text) { - return !Current.hasUI() || + return !CommonUtils.hasUI() || JOptionPane.showConfirmDialog(getFrontWindow(), text + "\nВы уверены?", "Подтверждение", diff --git a/src/GlobalData/Grid/TableVisualData.java b/src/GlobalData/Grid/TableVisualData.java index 0f6d0354..e244586a 100644 --- a/src/GlobalData/Grid/TableVisualData.java +++ b/src/GlobalData/Grid/TableVisualData.java @@ -9,6 +9,8 @@ import java.util.stream.Collectors; public class TableVisualData extends DBObject { @Description("PRIMARY KEY, UNIQUE") //имя таблицы public String name = null; + + //todo запаковать в json (?) @Description("DEFAULT ''") public String sizes = ""; //ширины столбцов запакованные через |. вводить объекты ради них нецелесообразно. public TableVisualData() { diff --git a/src/ProjectData/Messages/Message.java b/src/ProjectData/Messages/Message.java index 7e4023e8..0f1ee69f 100644 --- a/src/ProjectData/Messages/Message.java +++ b/src/ProjectData/Messages/Message.java @@ -1,13 +1,14 @@ package ProjectData.Messages; import Common.CurrentAnchestor; +import Common.Mode; import Common.Utils.CommonUtils; import Common_old.Constants; import Common_old.Current; -import _VisualDVM.Global; import GlobalData.Settings.SettingName; import ProjectData.SapforData.FileObject; import ProjectData.SapforData.FileObjectWithMessages; import Visual_DVM_2021.Passes.PassException; +import _VisualDVM.Global; import java.util.HashMap; import java.util.Map; @@ -26,7 +27,7 @@ public class Message extends FileObject { setGroup(group_in); if ((group == Constants.parser_group) || (group == Constants.compiler_group) || - (Current.mode != Current.Mode.Normal)) { + (CommonUtils.mode != Mode.Normal)) { value = value_in; } else { value = !Global.getSetting(SettingName.TRANSLATE_MESSAGES).toBoolean() ? value_in : decodeRussianMessage(value_in); diff --git a/src/ProjectData/Project/db_project_info.java b/src/ProjectData/Project/db_project_info.java index e835e0f1..a691c38f 100644 --- a/src/ProjectData/Project/db_project_info.java +++ b/src/ProjectData/Project/db_project_info.java @@ -691,7 +691,7 @@ public class db_project_info extends DBObject { Utils.forceDeleteWithCheck(file); } public void CreateInterruptFile() throws Exception { - FileUtils.write(getInterruptFile(), Current.mode.toString()); + FileUtils.write(getInterruptFile(), CommonUtils.mode.toString()); } public void AppendScenario(String line_in) { Scenario += (line_in + "\n"); diff --git a/src/Repository/Component/Sapfor/Sapfor.java b/src/Repository/Component/Sapfor/Sapfor.java index 44b13c10..62c503f6 100644 --- a/src/Repository/Component/Sapfor/Sapfor.java +++ b/src/Repository/Component/Sapfor/Sapfor.java @@ -351,13 +351,13 @@ public abstract class Sapfor extends OSDComponent { for (PassCode_2021 code : getAnalysesCodes()) (Pass_2021.passes.get(code)).Reset(); //------------------------------------------------------------------------------------------>>>> пакетный режим. - if (Current.hasUI()) { + if (CommonUtils.hasUI()) { Pass_2021.passes.get(PassCode_2021.Precompilation).Reset(); Pass_2021.passes.get(PassCode_2021.SPF_GetGCovInfo).Reset(); } Global.enable_text_changed = false; Global.transformationPermission = TransformationPermission.None; - if ((Current.hasUI()) && (UI.getMainWindow() != null) && (UI.getVersionsWindow() != null)) + if ((CommonUtils.hasUI()) && (UI.getMainWindow() != null) && (UI.getVersionsWindow() != null)) UI.getVersionsWindow().BlockVariants(); } //--------------------------------------------------------------------------->> diff --git a/src/TestingSystem/Common/Group/Group.java b/src/TestingSystem/Common/Group/Group.java index 84bf3326..246a7b0d 100644 --- a/src/TestingSystem/Common/Group/Group.java +++ b/src/TestingSystem/Common/Group/Group.java @@ -45,7 +45,7 @@ public class Group extends riDBObject { @Override public void select(boolean flag) { super.select(flag); - if (Current.hasUI()) + if (CommonUtils.hasUI()) UI.getMainWindow().ShowCheckedTestsCount(); } //-- diff --git a/src/TestingSystem/Common/MachineProcess/MachineProcess.java b/src/TestingSystem/Common/MachineProcess/MachineProcess.java index 4261545b..24cdf4bb 100644 --- a/src/TestingSystem/Common/MachineProcess/MachineProcess.java +++ b/src/TestingSystem/Common/MachineProcess/MachineProcess.java @@ -1,13 +1,13 @@ package TestingSystem.Common.MachineProcess; import Common.CommonConstants; +import Common.Database.Objects.DBObject; +import Common.Mode; import Common.Utils.CommonUtils; import Common_old.Constants; -import Common_old.Current; -import Common.Database.Objects.DBObject; -import _VisualDVM.Global; import Common_old.GlobalProperties; import Common_old.Utils.Utils; import TestingSystem.DVM.DVMPackage.DVMPackage; +import _VisualDVM.Global; import org.apache.commons.io.FileUtils; import java.io.File; @@ -101,8 +101,7 @@ public class MachineProcess extends DBObject { FileUtils.copyFile(src, supervisor); //создание настроек GlobalProperties properties = new GlobalProperties(Global.properties); - properties.Mode = //isLocal()?Current.Mode.LocalMachineQueue: - Current.Mode.MachineQueue; + properties.Mode = Mode.MachineQueue; CommonUtils.jsonToFile(properties, new File(workspace, "properties")); Vector args = new Vector<>(); args.add(CommonUtils.DQuotes(machineAddress)); diff --git a/src/TestingSystem/Common/Test/Test.java b/src/TestingSystem/Common/Test/Test.java index 029327a4..c14fc251 100644 --- a/src/TestingSystem/Common/Test/Test.java +++ b/src/TestingSystem/Common/Test/Test.java @@ -53,7 +53,7 @@ public class Test extends riDBObject { @Override public void select(boolean flag) { super.select(flag); - if (Current.hasUI()) + if (CommonUtils.hasUI()) UI.getMainWindow().ShowCheckedTestsCount(); } //--- diff --git a/src/TestingSystem/Common/TestingPlanner.java b/src/TestingSystem/Common/TestingPlanner.java index 6f3df357..79e0f84d 100644 --- a/src/TestingSystem/Common/TestingPlanner.java +++ b/src/TestingSystem/Common/TestingPlanner.java @@ -2,7 +2,6 @@ package TestingSystem.Common; import Common.CommonConstants; import Common.Utils.CommonUtils; import Common_old.Constants; -import Common_old.Current; import _VisualDVM.Global; import Common_old.Utils.Utils; import GlobalData.Machine.Machine; @@ -206,7 +205,7 @@ public abstract class TestingPlanner

extends Repositor } @Override public String getLogName() { - return Current.mode.toString(); + return CommonUtils.mode.toString(); } }; CommonUtils.MainLog.ClearLog(); diff --git a/src/TestingSystem/SAPFOR/SapforTestingPlanner.java b/src/TestingSystem/SAPFOR/SapforTestingPlanner.java index 71825805..b340f686 100644 --- a/src/TestingSystem/SAPFOR/SapforTestingPlanner.java +++ b/src/TestingSystem/SAPFOR/SapforTestingPlanner.java @@ -1,9 +1,8 @@ package TestingSystem.SAPFOR; import Common.CommonConstants; +import Common.Mode; import Common.Utils.CommonUtils; import Common_old.Constants; -import Common_old.Current; -import _VisualDVM.Global; import Common_old.GlobalProperties; import Common_old.Utils.Utils; import ProjectData.LanguageName; @@ -18,6 +17,7 @@ import TestingSystem.SAPFOR.Json.SapforTestingSet_json; import TestingSystem.SAPFOR.SapforPackage.SapforPackage; import TestingSystem.SAPFOR.ServerSapfor.ServerSapfor; import TestingSystem.SAPFOR.ServerSapfor.ServerSapforState; +import _VisualDVM.Global; import javafx.util.Pair; import org.apache.commons.io.FileUtils; @@ -94,7 +94,7 @@ public class SapforTestingPlanner extends TestingPlanner { FileUtils.copyFile(new File(CommonUtils.Home, "TestingSystem.jar"), visualiser); //создание настроек GlobalProperties properties = new GlobalProperties(Global.properties); - properties.Mode = Current.Mode.Package; + properties.Mode = Mode.Package; CommonUtils.jsonToFile(properties, new File(workspace, "properties")); //подготовка пакетного режима. Запустит его уже очередь. Utils.createScript(workspace, workspace, "start", "java -jar VisualSapfor.jar"); diff --git a/src/Visual_DVM_2021/Passes/All/DeleteVersion.java b/src/Visual_DVM_2021/Passes/All/DeleteVersion.java index 0c9c534b..b4f1d96b 100644 --- a/src/Visual_DVM_2021/Passes/All/DeleteVersion.java +++ b/src/Visual_DVM_2021/Passes/All/DeleteVersion.java @@ -21,7 +21,7 @@ public class DeleteVersion extends Pass_2021 { current = (Current.getVersion() != null) && Current.getVersion().Home.equals(target.Home); return true; } else { - if (((target = Current.getVersion()) != null) && (!Current.hasUI() || + if (((target = Current.getVersion()) != null) && (!CommonUtils.hasUI() || UI.Warning("Удалить " + ((Current.HasProject() && target.Home.equals(Current.getProject().Home)) ? "текущий проект" : "версию ") + CommonUtils.Brackets(target.name)))) { @@ -39,7 +39,7 @@ public class DeleteVersion extends Pass_2021 { if ((Current.getProject().Home.getAbsolutePath().startsWith(target.Home.getAbsolutePath()))) passes.get(PassCode_2021.CloseCurrentProject).Do(); } - if (Current.hasUI()) { + if (CommonUtils.hasUI()) { UI.getVersionsWindow().RemoveVersionFromComparison(target); } } diff --git a/src/Visual_DVM_2021/Passes/All/SPF_CreateParallelVariant.java b/src/Visual_DVM_2021/Passes/All/SPF_CreateParallelVariant.java index d79239e9..9fa8740d 100644 --- a/src/Visual_DVM_2021/Passes/All/SPF_CreateParallelVariant.java +++ b/src/Visual_DVM_2021/Passes/All/SPF_CreateParallelVariant.java @@ -1,10 +1,11 @@ package Visual_DVM_2021.Passes.All; -import Common_old.Current; -import _VisualDVM.Global; +import Common.Mode; +import Common.Utils.CommonUtils; import ProjectData.SapforData.Variants.ParallelVariant; import Repository.Component.Sapfor.TransformationPermission; import Visual_DVM_2021.Passes.PassCode_2021; import Visual_DVM_2021.Passes.SapforTransformation; +import _VisualDVM.Global; public class SPF_CreateParallelVariant extends SapforTransformation { ParallelVariant variant = null; @Override @@ -65,13 +66,13 @@ public class SPF_CreateParallelVariant extends SapforTransformation { protected void performDone() throws Exception { Global.transformationPermission = TransformationPermission.VariantsOnly; target.migrateFilesSettings(target.last_version, true, true); - if (Current.hasUI()) + if (CommonUtils.hasUI()) variant.UpdateStats(sapfor.getPredictorStats(), target.last_version.name); } @Override protected void performFinish() throws Exception { //в пакетном режиме вариант всегда один. поэтому, сообщения надо распаковать сразу. - if (Current.mode.equals(Current.Mode.Package)) + if (CommonUtils.mode.equals(Mode.Package)) super.performFinish(); } @Override diff --git a/src/Visual_DVM_2021/Passes/All/SPF_ParseFilesWithOrder.java b/src/Visual_DVM_2021/Passes/All/SPF_ParseFilesWithOrder.java index 2c4b7390..77bf45ac 100644 --- a/src/Visual_DVM_2021/Passes/All/SPF_ParseFilesWithOrder.java +++ b/src/Visual_DVM_2021/Passes/All/SPF_ParseFilesWithOrder.java @@ -111,7 +111,7 @@ public class SPF_ParseFilesWithOrder extends SapforAnalysis { protected void performPreparation() throws Exception { super.performPreparation(); //удаление интеррупта. //------------------------------------------------------------------------------------------>>> пакетный режим. - if (!precompilation_done && Current.hasUI()) { + if (!precompilation_done && CommonUtils.hasUI()) { passes.get(PassCode_2021.Save).Do(); target.CleanAnalyses(); } diff --git a/src/Visual_DVM_2021/Passes/Pass_2021.java b/src/Visual_DVM_2021/Passes/Pass_2021.java index 0e0b0657..6f5aa455 100644 --- a/src/Visual_DVM_2021/Passes/Pass_2021.java +++ b/src/Visual_DVM_2021/Passes/Pass_2021.java @@ -191,30 +191,30 @@ public class Pass_2021 { //- private void PerformCanNotStart() throws Exception { performCanNotStart(); - if (Current.hasUI()) + if (CommonUtils.hasUI()) showCanNotStart(); } protected void PerformPreparation() throws Exception { performPreparation(); - if (Current.hasUI()) + if (CommonUtils.hasUI()) showPreparation(); } private void PerformFinish() throws Exception { performFinish(); //- - if (Current.hasUI()) + if (CommonUtils.hasUI()) showFinish(); } private void PerformDone() throws Exception { performDone(); //- - if (Current.hasUI()) + if (CommonUtils.hasUI()) showDone(); } private void PerformFail() throws Exception { performFail(); //- - if (Current.hasUI()) + if (CommonUtils.hasUI()) showFail(); } //------ @@ -298,11 +298,11 @@ public class Pass_2021 { timer.Start(); //-------------------------------> try { - if (Current.hasUI()) FocusBeforeStart(); + if (CommonUtils.hasUI()) FocusBeforeStart(); if (canStart(args)) { PerformPreparation(); //todo тут должна быть вилка на анимацию? - if (Current.hasUI() && needsAnimation()) { + if (CommonUtils.hasUI() && needsAnimation()) { animation_sem = new Semaphore(1); animation_sem.acquire(); //--- @@ -386,7 +386,7 @@ public class Pass_2021 { " окончен за " + timer.Print() + " состояние " + CommonUtils.Brackets(state.getDescription()) ); - if (!Log.isEmpty() && Current.hasUI()) + if (!Log.isEmpty() && CommonUtils.hasUI()) UI.Error( "проход " + CommonUtils.Brackets(getDescription()) + "\n" + state.getDescription() + "\n\n" + Log.toString()); @@ -396,7 +396,7 @@ public class Pass_2021 { } //-- public void ShowSapforMessage(String message) { - if (Current.hasUI() && form != null) { + if (CommonUtils.hasUI() && form != null) { String[] data = message.split(":"); switch (data[0]) { case "message_1": diff --git a/src/Visual_DVM_2021/Passes/SapforAnalysis.java b/src/Visual_DVM_2021/Passes/SapforAnalysis.java index 4352384d..78fc9c41 100644 --- a/src/Visual_DVM_2021/Passes/SapforAnalysis.java +++ b/src/Visual_DVM_2021/Passes/SapforAnalysis.java @@ -1,6 +1,5 @@ package Visual_DVM_2021.Passes; import Common.Utils.CommonUtils; -import Common_old.Current; import _VisualDVM.Global; import Common_old.UI.DebugPrintLevel; import Common_old.UI.Menus_2023.PassControl; @@ -49,7 +48,7 @@ public class SapforAnalysis extends SapforPass { @Override protected void PerformPreparation() throws Exception { //- - if (Current.hasUI()) + if (CommonUtils.hasUI()) showPreparation(); // отображение пустых данных //- performPreparation(); //в данном случае удаление данных diff --git a/src/_VisualDVM/Global.java b/src/_VisualDVM/Global.java index 179fd756..e64080b5 100644 --- a/src/_VisualDVM/Global.java +++ b/src/_VisualDVM/Global.java @@ -146,7 +146,7 @@ public class Global { } @Override public String getLogName() { - return Current.mode.toString(); + return CommonUtils.mode.toString(); } }; CommonUtils.MainLog.ClearLog(); @@ -216,7 +216,7 @@ public class Global { } //возможно заменить settings на properties public static DBSetting getSetting(SettingName settingName) throws Exception { - switch (Current.mode) { + switch (CommonUtils.mode) { case Normal: return ((GlobalDatabase)CommonUtils.db).settings.get(settingName); default: @@ -386,10 +386,10 @@ public class Global { System.out.println("home directory is" + CommonUtils.Brackets(CommonUtils.Home)); //--- SynschronizeProperties(); - Current.mode = properties.Mode; - System.out.println("mode is " + Current.mode); + CommonUtils.mode = properties.Mode; + System.out.println("mode is " + CommonUtils.mode); try { - switch (Current.mode) { + switch (CommonUtils.mode) { case Normal: NormalMode(Integer.parseInt(args[1])); break;