2024-10-07 00:58:29 +03:00
|
|
|
|
package _VisualDVM;
|
2024-10-08 01:30:25 +03:00
|
|
|
|
import Common.Utils.Loggable;
|
2024-10-12 00:17:51 +03:00
|
|
|
|
import Common.Utils.Utils_;
|
2024-10-15 15:13:57 +03:00
|
|
|
|
import Common.Visual.UI;
|
2024-10-09 22:21:57 +03:00
|
|
|
|
import _VisualDVM.GlobalData.Account.Account;
|
|
|
|
|
|
import _VisualDVM.GlobalData.Account.AccountRole;
|
|
|
|
|
|
import _VisualDVM.GlobalData.Settings.DBSetting;
|
|
|
|
|
|
import _VisualDVM.GlobalData.Settings.SettingName;
|
2024-10-14 15:19:13 +03:00
|
|
|
|
import _VisualDVM.Passes.PassCode;
|
2024-10-09 22:21:57 +03:00
|
|
|
|
import _VisualDVM.ProjectData.ProjectView;
|
|
|
|
|
|
import _VisualDVM.Repository.Component.*;
|
|
|
|
|
|
import _VisualDVM.Repository.Component.PerformanceAnalyzer.PerformanceAnalyzer;
|
|
|
|
|
|
import _VisualDVM.Repository.Component.Sapfor.MessagesServer;
|
|
|
|
|
|
import _VisualDVM.Repository.Component.Sapfor.Sapfor_F;
|
|
|
|
|
|
import _VisualDVM.Repository.Server.ComponentsServer;
|
|
|
|
|
|
import _VisualDVM.TestingSystem.Common.TestingServer;
|
|
|
|
|
|
import _VisualDVM.TestingSystem.DVM.RemoteDVMTestingPlanner;
|
|
|
|
|
|
import _VisualDVM.TestingSystem.SAPFOR.PackageModeSupervisor;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
|
|
|
|
|
|
import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
import java.nio.file.Paths;
|
|
|
|
|
|
import java.util.Vector;
|
|
|
|
|
|
public class Global {
|
2024-10-20 12:09:59 +03:00
|
|
|
|
//todo свести большинство к содержимому mainModule, сделать различные типы properties, переместить туда глобальный журнал (?)
|
2024-10-12 00:17:51 +03:00
|
|
|
|
public static MainModule mainModule = null;
|
2024-10-08 23:21:42 +03:00
|
|
|
|
//Режим
|
|
|
|
|
|
public static Mode mode = Mode.Undefined;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//--------------------------------------------------
|
|
|
|
|
|
public static GlobalProperties properties = new GlobalProperties();
|
|
|
|
|
|
//---
|
|
|
|
|
|
public static boolean files_multiselection = false;
|
|
|
|
|
|
public static boolean versions_multiselection = false;
|
|
|
|
|
|
//??
|
2024-10-22 20:16:57 +03:00
|
|
|
|
public static ComponentsSet components = null;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
public static MessagesServer messagesServer = null;
|
|
|
|
|
|
public static File ComponentsDirectory;
|
|
|
|
|
|
public static File DataDirectory;
|
|
|
|
|
|
public static File BugReportsDirectory;
|
|
|
|
|
|
public static File BackUpsDirectory;
|
|
|
|
|
|
public static File TempDirectory;
|
|
|
|
|
|
public static File ProjectsDirectory;
|
|
|
|
|
|
public static File CompilationTasksDirectory;
|
|
|
|
|
|
public static File RunTasksDirectory;
|
|
|
|
|
|
public static File StsDirectory;
|
|
|
|
|
|
public static File RepoDirectory;
|
|
|
|
|
|
public static File TestsDirectory;
|
|
|
|
|
|
public static File PerformanceAnalyzerDirectory;
|
|
|
|
|
|
public static File DataBackUpsDirectory;
|
2023-12-18 15:44:48 +03:00
|
|
|
|
public static File DVMPackagesDirectory;
|
2023-10-03 15:07:17 +03:00
|
|
|
|
public static File SapforsDirectory;
|
2023-10-08 01:57:25 +03:00
|
|
|
|
public static File SapforPackagesDirectory;
|
2024-04-21 00:01:17 +03:00
|
|
|
|
public static File MachinesDirectory;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
|
|
public static Visualiser visualiser = null;
|
|
|
|
|
|
public static Visualizer_2 visualizer_2 = null;
|
|
|
|
|
|
public static PerformanceAnalyzer performanceAnalyzer = null;
|
|
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
|
|
public static ComponentsServer componentsServer = new ComponentsServer();
|
|
|
|
|
|
public static TestingServer testingServer = new TestingServer();
|
|
|
|
|
|
public static void SynschronizeProperties() {
|
|
|
|
|
|
try {
|
2024-10-11 00:00:30 +03:00
|
|
|
|
File new_propertiesFile = new File(Utils_.getHomeDirectory(), "properties");
|
2023-09-29 22:17:44 +03:00
|
|
|
|
if (new_propertiesFile.exists())
|
2024-10-11 00:00:30 +03:00
|
|
|
|
properties = (GlobalProperties) Utils_.jsonFromFile(new_propertiesFile, GlobalProperties.class);
|
|
|
|
|
|
Utils_.jsonToFile(properties, new_propertiesFile);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public static void CheckVisualiserDirectories() {
|
2024-10-14 12:54:52 +03:00
|
|
|
|
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
|
|
|
|
|
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//-
|
2024-10-14 12:54:52 +03:00
|
|
|
|
Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(BugReportsDirectory = new File(Utils_.getHomeDirectory(), Constants.BugsDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(BackUpsDirectory = new File(Utils_.getHomeDirectory(), Constants.BackUpsDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(ProjectsDirectory = new File(Utils_.getHomeDirectory(), Constants.ProjectsDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(CompilationTasksDirectory = new File(Utils_.getHomeDirectory(), Constants.CompilationTasksDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(RunTasksDirectory = new File(Utils_.getHomeDirectory(), Constants.RunTasksDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(StsDirectory = new File(Utils_.getHomeDirectory(), Constants.StsDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(TestsDirectory = new File(Utils_.getHomeDirectory(), Constants.TestsDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(PerformanceAnalyzerDirectory = new File(Utils_.getHomeDirectory(), Constants.PerformanceAnalyzerDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(DVMPackagesDirectory = new File(Utils_.getHomeDirectory(), Constants.DVMPackagesDirectoryName));
|
2023-12-25 00:33:14 +03:00
|
|
|
|
//через пару версий заменить на clean.
|
2024-10-14 12:54:52 +03:00
|
|
|
|
Utils_.CheckDirectory(SapforPackagesDirectory = new File(Utils_.getHomeDirectory(), "SapforPackages"));
|
|
|
|
|
|
Utils_.CheckDirectory(MachinesDirectory = new File(Utils_.getHomeDirectory(), "Machines"));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
public static void CheckServerDirectories() {
|
2024-10-14 12:54:52 +03:00
|
|
|
|
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
|
|
|
|
|
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//-
|
2024-10-14 12:54:52 +03:00
|
|
|
|
Utils_.CheckDirectory(BugReportsDirectory = new File(Utils_.getHomeDirectory(), Constants.BugsDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(DataBackUpsDirectory = new File(Utils_.getHomeDirectory(), Constants.DataBackUpsDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(MachinesDirectory = new File(Utils_.getHomeDirectory(), "Machines"));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
public static void CheckTestingSystemDirectories() {
|
2024-10-14 12:54:52 +03:00
|
|
|
|
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
|
|
|
|
|
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//-
|
2024-10-14 12:54:52 +03:00
|
|
|
|
Utils_.CheckDirectory(TestsDirectory = new File(Utils_.getHomeDirectory(), Constants.TestsDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(DVMPackagesDirectory = new File(Utils_.getHomeDirectory(), Constants.DVMPackagesDirectoryName));
|
|
|
|
|
|
Utils_.CheckDirectory(SapforsDirectory = new File(Utils_.getHomeDirectory(), "Sapfors"));
|
|
|
|
|
|
Utils_.CheckDirectory(SapforPackagesDirectory = new File(Utils_.getHomeDirectory(), "SapforPackages"));
|
2024-04-26 17:57:58 +03:00
|
|
|
|
//CheclAndClean через неделю
|
2024-10-14 12:54:52 +03:00
|
|
|
|
Utils_.CheckDirectory(MachinesDirectory = new File(Utils_.getHomeDirectory(), "Machines"));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
2024-04-13 20:09:26 +03:00
|
|
|
|
public static void CreateLogAtComponentsPath() {
|
2024-10-11 00:00:30 +03:00
|
|
|
|
Utils_.MainLog = new Loggable() {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
@Override
|
|
|
|
|
|
public String getLogHomePath() {
|
2023-11-08 23:13:16 +03:00
|
|
|
|
return Paths.get(System.getProperty("user.dir"), "Components").toString();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getLogName() {
|
|
|
|
|
|
return "VisualDVM";
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2024-10-11 00:00:30 +03:00
|
|
|
|
Utils_.MainLog.ClearLog();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
2024-04-13 20:09:26 +03:00
|
|
|
|
public static void CreateLogAtHome() {
|
2024-10-11 00:00:30 +03:00
|
|
|
|
Utils_.MainLog = new Loggable() {
|
2024-04-13 20:09:26 +03:00
|
|
|
|
@Override
|
|
|
|
|
|
public String getLogHomePath() {
|
2024-10-11 00:00:30 +03:00
|
|
|
|
return Utils_.getHomePath();
|
2024-04-13 20:09:26 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getLogName() {
|
2024-10-08 22:33:49 +03:00
|
|
|
|
return mode.toString();
|
2024-04-13 20:09:26 +03:00
|
|
|
|
}
|
|
|
|
|
|
};
|
2024-10-11 00:00:30 +03:00
|
|
|
|
Utils_.MainLog.ClearLog();
|
2024-04-13 20:09:26 +03:00
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//-
|
|
|
|
|
|
public static void FinishApplication() {
|
|
|
|
|
|
try {
|
2024-10-12 00:17:51 +03:00
|
|
|
|
mainModule.DeactivateDB();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
if (componentsServer.db != null)
|
|
|
|
|
|
componentsServer.db.Disconnect();
|
|
|
|
|
|
if (testingServer.db != null)
|
|
|
|
|
|
testingServer.db.Disconnect();
|
|
|
|
|
|
if (visualizer_2 != null)
|
|
|
|
|
|
visualizer_2.Shutdown();
|
|
|
|
|
|
if (messagesServer != null)
|
|
|
|
|
|
messagesServer.Shutdown();
|
|
|
|
|
|
if (performanceAnalyzer != null)
|
|
|
|
|
|
performanceAnalyzer.Shutdown();
|
|
|
|
|
|
} catch (Exception ex) {
|
2024-10-11 00:00:30 +03:00
|
|
|
|
if (Utils_.MainLog != null) {
|
|
|
|
|
|
Utils_.MainLog.PrintException(ex);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
} else {
|
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
System.exit(0);
|
|
|
|
|
|
}
|
2024-10-22 20:16:57 +03:00
|
|
|
|
|
2023-09-17 22:13:42 +03:00
|
|
|
|
public static void changeSetting(SettingName settingName, Object new_value) throws Exception {
|
2024-10-13 23:55:03 +03:00
|
|
|
|
Global.mainModule.getPass(PassCode.UpdateSetting).Do(settingName, new_value);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
public static String packSapforSettings() {
|
|
|
|
|
|
Vector<String> res_ = new Vector<>();
|
|
|
|
|
|
Vector<SettingName> forbidden = new Vector<>();
|
|
|
|
|
|
forbidden.add(SettingName.GCOVLimit);
|
|
|
|
|
|
forbidden.add(SettingName.Precompilation);
|
|
|
|
|
|
forbidden.add(SettingName.DVMConvertationOptions);
|
|
|
|
|
|
forbidden.add(SettingName.SaveModifications);
|
2024-10-12 00:17:51 +03:00
|
|
|
|
for (DBSetting setting : mainModule.getDb().settings.getSettingsByOwner(ComponentType.SapforOptions)) {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
if (!forbidden.contains(setting.Name))
|
|
|
|
|
|
res_.add(setting.Value);
|
|
|
|
|
|
}
|
|
|
|
|
|
return String.join("|", res_);
|
|
|
|
|
|
}
|
|
|
|
|
|
//--
|
|
|
|
|
|
public static void NormalMode(int port) throws Exception {
|
2024-10-12 00:17:51 +03:00
|
|
|
|
//-------------------------------->>
|
2024-10-14 15:19:13 +03:00
|
|
|
|
mainModule = new MainModule();
|
2024-10-15 15:13:57 +03:00
|
|
|
|
mainModule.Init();
|
2024-10-14 18:41:02 +03:00
|
|
|
|
//--
|
2023-09-17 22:13:42 +03:00
|
|
|
|
CheckVisualiserDirectories();
|
2024-04-13 20:09:26 +03:00
|
|
|
|
CreateLogAtComponentsPath();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//-
|
|
|
|
|
|
visualizer_2 = new Visualizer_2(port);
|
|
|
|
|
|
visualizer_2.Connect();
|
|
|
|
|
|
visualizer_2.refreshPid();
|
|
|
|
|
|
//если делать раньше, то не удастся убить сервер.
|
2024-10-11 00:00:30 +03:00
|
|
|
|
if (Utils_.ContainsCyrillic(Utils_.getHomePath())) {
|
2024-10-15 15:13:57 +03:00
|
|
|
|
UI.Info("В пути к корневой папке " + Utils_.DQuotes(Utils_.getHomePath()) + "\n" +
|
2023-09-17 22:13:42 +03:00
|
|
|
|
"Найдены русские буквы.\n" +
|
|
|
|
|
|
"Визуализатор завершает работу."); //
|
|
|
|
|
|
FinishApplication();
|
|
|
|
|
|
}
|
|
|
|
|
|
messagesServer = new MessagesServer();
|
|
|
|
|
|
messagesServer.Start();
|
2024-10-22 20:16:57 +03:00
|
|
|
|
components = new ComponentsSet();
|
2024-10-13 22:08:13 +03:00
|
|
|
|
mainModule.set(Current.ProjectView, ProjectView.Files);
|
2024-10-22 20:16:57 +03:00
|
|
|
|
components.put(ComponentType.Visualiser, visualiser = new Visualiser());
|
|
|
|
|
|
components.put(ComponentType.Sapfor_F, (Component) mainModule.set(Current.Sapfor, new Sapfor_F()));
|
|
|
|
|
|
components.put(ComponentType.Visualizer_2, visualizer_2);
|
|
|
|
|
|
components.put(ComponentType.PerformanceAnalyzer, performanceAnalyzer = new PerformanceAnalyzer());
|
|
|
|
|
|
components.put(ComponentType.Instruction, new Instruction());
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//-
|
2024-10-22 20:16:57 +03:00
|
|
|
|
for (Component component : components.Data.values())
|
2024-10-20 21:59:39 +03:00
|
|
|
|
// if (component.isVisible())
|
|
|
|
|
|
component.InitialVersionCheck();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//-
|
|
|
|
|
|
AbstractTokenMakerFactory atmf = (AbstractTokenMakerFactory) TokenMakerFactory.getDefaultInstance();
|
2024-10-08 23:57:57 +03:00
|
|
|
|
atmf.putMapping("text/FortranSPF", "_VisualDVM.Visual.Syntax.FortranSPFTokenMaker");
|
|
|
|
|
|
atmf.putMapping("text/FreeFortranSPF", "_VisualDVM.Visual.Syntax.FreeFortranSPFTokenMaker");
|
2023-09-17 22:13:42 +03:00
|
|
|
|
// FoldParserManager.get().addFoldParserMapping("text/FortranSPF", new FortranFolder()); блоки кода. todo
|
2024-10-08 23:57:57 +03:00
|
|
|
|
//light_editor.xml-------->>
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//-------->>
|
|
|
|
|
|
if (properties.AutoUpdateSearch)
|
2024-10-13 23:55:03 +03:00
|
|
|
|
Global.mainModule.getPass(PassCode.GetComponentsActualVersions).Do();
|
2024-10-22 20:16:57 +03:00
|
|
|
|
components.validateStates();
|
|
|
|
|
|
if (components.needWindow()) {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
boolean flag = true;
|
|
|
|
|
|
do {
|
2024-10-15 02:32:52 +03:00
|
|
|
|
Global.mainModule.getUI().getComponentsWindow().ShowDialog("");
|
2024-10-22 20:16:57 +03:00
|
|
|
|
if (flag = (!components.validateStates())) {
|
|
|
|
|
|
if (!UI.Question("Найдено " + components.bad_state + " некорректных необходимых компонент.Работа визуализатора невозможна.\n" +
|
2023-09-17 22:13:42 +03:00
|
|
|
|
"Вернуться к окну компонент"
|
|
|
|
|
|
)) {
|
2024-10-15 15:13:57 +03:00
|
|
|
|
UI.Info("Визуализатор завершает работу.");
|
2023-09-17 22:13:42 +03:00
|
|
|
|
FinishApplication();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} while (flag);
|
|
|
|
|
|
}
|
2024-10-12 00:17:51 +03:00
|
|
|
|
mainModule.ActivateDB();
|
2024-10-13 22:08:13 +03:00
|
|
|
|
mainModule.set(Current.Account, new Account() {
|
2023-12-12 16:09:14 +03:00
|
|
|
|
{
|
|
|
|
|
|
name = "M";
|
2024-10-08 22:33:49 +03:00
|
|
|
|
email = "vmk-post@yandex.ru";
|
2023-12-12 16:09:14 +03:00
|
|
|
|
role = AccountRole.Admin;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2024-10-08 22:33:49 +03:00
|
|
|
|
// Pass_2021.passes.get(PassCode_2021.CheckAccount).Do();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//---------------
|
|
|
|
|
|
componentsServer.ActivateDB();
|
|
|
|
|
|
testingServer.ActivateDB();
|
2024-10-08 01:30:25 +03:00
|
|
|
|
//в проперти их!
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//-- чисто чтобы создать таблицы. соединения на стороне клиента не предвидится.
|
2024-10-12 00:17:51 +03:00
|
|
|
|
if (mainModule.getDb().settings.get(SettingName.AutoBugReportsLoad).toBoolean())
|
2024-10-13 23:55:03 +03:00
|
|
|
|
Global.mainModule.getPass(PassCode.SynchronizeBugReports).Do();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//--
|
2024-10-12 00:17:51 +03:00
|
|
|
|
if (mainModule.getDb().settings.get(SettingName.AutoTestsLoad).toBoolean())
|
2024-10-13 23:55:03 +03:00
|
|
|
|
Global.mainModule.getPass(PassCode.SynchronizeTests).Do();
|
2024-10-13 22:08:13 +03:00
|
|
|
|
Global.mainModule.getSapfor().refreshPid(); //без сапфора сюда это все равно не дойдет.
|
2024-10-15 02:32:52 +03:00
|
|
|
|
Global.mainModule.getUI().getMainWindow().Show();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
public static void ServerMode() throws Exception {
|
|
|
|
|
|
CheckServerDirectories();
|
2024-04-13 20:09:26 +03:00
|
|
|
|
CreateLogAtComponentsPath();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
componentsServer = new ComponentsServer();
|
|
|
|
|
|
componentsServer.ActivateDB();
|
|
|
|
|
|
componentsServer.Start();
|
|
|
|
|
|
System.exit(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
public static void TestingSystemMode() throws Exception {
|
|
|
|
|
|
CheckTestingSystemDirectories();
|
2024-04-13 20:09:26 +03:00
|
|
|
|
CreateLogAtComponentsPath();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
testingServer = new TestingServer();
|
|
|
|
|
|
testingServer.ActivateDB();
|
|
|
|
|
|
testingServer.Start();
|
|
|
|
|
|
System.exit(0);
|
|
|
|
|
|
}
|
2024-04-13 20:09:26 +03:00
|
|
|
|
//режим запуска пакета Сапфор
|
2023-10-08 02:05:57 +03:00
|
|
|
|
public static void PackageMode() throws Exception {
|
2024-04-13 20:09:26 +03:00
|
|
|
|
CreateLogAtHome();
|
2023-10-15 20:50:33 +03:00
|
|
|
|
PackageModeSupervisor planner = new PackageModeSupervisor();
|
2023-09-30 00:39:13 +03:00
|
|
|
|
planner.Start();
|
2023-09-29 22:17:44 +03:00
|
|
|
|
}
|
2024-04-21 23:23:57 +03:00
|
|
|
|
public static void MachineQueueMode(String... args) throws Exception {
|
2024-04-27 18:44:36 +03:00
|
|
|
|
RemoteDVMTestingPlanner supervisor = new RemoteDVMTestingPlanner(args);
|
|
|
|
|
|
while (true) {
|
|
|
|
|
|
supervisor.Perform();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//---
|
|
|
|
|
|
public static void Init(String... args) {
|
|
|
|
|
|
System.out.println("VisualSapfor.jar started..");
|
2024-10-11 00:00:30 +03:00
|
|
|
|
System.out.println("home directory is" + Utils_.Brackets(Utils_.getHomePath()));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//---
|
|
|
|
|
|
SynschronizeProperties();
|
2024-10-08 22:33:49 +03:00
|
|
|
|
mode = properties.Mode;
|
|
|
|
|
|
System.out.println("mode is " + mode);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
try {
|
2024-10-08 22:33:49 +03:00
|
|
|
|
switch (mode) {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
case Normal:
|
|
|
|
|
|
NormalMode(Integer.parseInt(args[1]));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case Server:
|
|
|
|
|
|
ServerMode();
|
|
|
|
|
|
break;
|
|
|
|
|
|
case Testing:
|
|
|
|
|
|
TestingSystemMode();
|
|
|
|
|
|
break;
|
2023-10-08 02:05:57 +03:00
|
|
|
|
case Package:
|
|
|
|
|
|
PackageMode();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
break;
|
2024-04-13 20:09:26 +03:00
|
|
|
|
case MachineQueue:
|
2024-04-21 23:23:57 +03:00
|
|
|
|
MachineQueueMode(args);
|
|
|
|
|
|
break;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
case Undefined:
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
System.out.println("VISUALISER FAILED");
|
|
|
|
|
|
ex.printStackTrace();
|
2024-10-11 00:00:30 +03:00
|
|
|
|
if (Utils_.MainLog != null)
|
|
|
|
|
|
Utils_.MainLog.PrintException(ex);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
FinishApplication();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|