сообщение R204
This commit is contained in:
2024-04-13 20:09:26 +03:00
parent 97a26f7a0e
commit 5d09ae430c
12 changed files with 172 additions and 87 deletions

View File

@@ -480,6 +480,7 @@ public enum Current {
Normal,
Server,
Testing,
Package
Package,
MachineQueue
}
}

View File

@@ -1,10 +1,7 @@
package Common;
import Common.Database.DataSet;
import Repository.Component.ComponentsMenuBar;
import Common.UI.UI;
import Common.Utils.Utils;
import GlobalData.Account.Account;
import GlobalData.Account.AccountRole;
import GlobalData.GlobalDatabase;
import GlobalData.Settings.DBSetting;
import GlobalData.Settings.SettingName;
@@ -15,8 +12,9 @@ import Repository.Component.Sapfor.MessagesServer;
import Repository.Component.Sapfor.Sapfor_F;
import Repository.Component.Sapfor.TransformationPermission;
import Repository.Server.ComponentsServer;
import TestingSystem.SAPFOR.PackageModeSupervisor;
import TestingSystem.Common.TestingServer;
import TestingSystem.DVM.MachineQueueSupervisor;
import TestingSystem.SAPFOR.PackageModeSupervisor;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Visual_DVM_2021.UI.Interface.Loggable;
@@ -140,7 +138,7 @@ public class Global {
Utils.CheckDirectory(SapforsDirectory = Paths.get(Home, "Sapfors").toFile());
Utils.CheckDirectory(SapforPackagesDirectory = Paths.get(Home, "SapforPackages").toFile());
}
public static void CreateLog() {
public static void CreateLogAtComponentsPath() {
Log = new Loggable() {
@Override
public String getLogHomePath() {
@@ -153,6 +151,19 @@ public class Global {
};
Log.ClearLog();
}
public static void CreateLogAtHome() {
Log = new Loggable() {
@Override
public String getLogHomePath() {
return Home;
}
@Override
public String getLogName() {
return Current.mode.toString();
}
};
Log.ClearLog();
}
//-
public static void FinishApplication() {
try {
@@ -248,7 +259,7 @@ public class Global {
if (files != null) {
for (File file : files) {
if (file.getName().contains(Constants.old_tests_db_name)) {
System.out.println("found "+Utils.Brackets(file.getAbsolutePath()));
System.out.println("found " + Utils.Brackets(file.getAbsolutePath()));
try {
Utils.forceDeleteWithCheck(file);
} catch (Exception ex) {
@@ -262,7 +273,7 @@ public class Global {
isWindows = System.getProperty("os.name").startsWith("Windows");
removeOldDatabases();
CheckVisualiserDirectories();
CreateLog();
CreateLogAtComponentsPath();
//-
visualizer_2 = new Visualizer_2(port);
visualizer_2.Connect();
@@ -348,7 +359,7 @@ public class Global {
public static void ServerMode() throws Exception {
isWindows = false;
CheckServerDirectories();
CreateLog();
CreateLogAtComponentsPath();
componentsServer = new ComponentsServer();
componentsServer.ActivateDB();
componentsServer.Start();
@@ -357,30 +368,20 @@ public class Global {
public static void TestingSystemMode() throws Exception {
isWindows = false;
CheckTestingSystemDirectories();
CreateLog();
CreateLogAtComponentsPath();
testingServer = new TestingServer();
testingServer.ActivateDB();
testingServer.Start();
System.exit(0);
}
//режим запуска пакета Сапфор
public static void PackageMode() throws Exception {
isWindows = System.getProperty("os.name").startsWith("Windows");
Log = new Loggable() {
@Override
public String getLogHomePath() {
return Home;
}
@Override
public String getLogName() {
return "Package";
}
};
Log.ClearLog();
CreateLogAtHome();
PackageModeSupervisor planner = new PackageModeSupervisor();
planner.Start();
}
//---
//---
public static void Init(String... args) {
System.out.println("VisualSapfor.jar started..");
Home = System.getProperty("user.dir"); //если Linux, дает без слеша в конце !!!
@@ -403,6 +404,11 @@ public class Global {
case Package:
PackageMode();
break;
case MachineQueue:
CreateLogAtHome();
MachineQueueSupervisor supervisor = new MachineQueueSupervisor(args);
supervisor.Start();
break;
case Undefined:
break;
}

View File

@@ -65,8 +65,7 @@ public class MainMenuBar extends VisualiserMenuBar {
});
}
});
*/
//---
*/
ShowProject(false);
}
public void ShowUpdatesIcon() {