no message

This commit is contained in:
2025-01-18 01:36:02 +03:00
parent 69151dd7a8
commit 18b4d58682
47 changed files with 724 additions and 532 deletions

View File

@@ -1,10 +1,10 @@
package _VisualDVM;
import Common.Properties;
import Common.Utils.Loggable;
import Common.Utils.Utils_;
import Common.Visual.UI;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.ProjectData.ProjectView;
import _VisualDVM.Repository.Component.ComponentType;
import _VisualDVM.Repository.Component.ComponentsSet;
import _VisualDVM.Repository.Component.PerformanceAnalyzer.PerformanceAnalyzer;
import _VisualDVM.Repository.Component.Sapfor.MessagesServer;
@@ -18,14 +18,16 @@ import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
import java.io.File;
import java.nio.file.Paths;
import java.util.Vector;
public class Global {
//todo свести большинство к содержимому mainModule, сделать различные типы properties, переместить туда глобальный журнал (?)
public static MainModule mainModule = null;
//Режим
public static Mode mode = Mode.Undefined;
//--------------------------------------------------
public static GlobalProperties properties = null;
public static VisualDVMProperties properties= null;
public static NormalProperties normalProperties = null;
public static ComponentsServerProperties componentsServerProperties = null;
public static TestingServerProperties testingServerProperties = null;
//---
public static boolean files_multiselection = false;
public static boolean versions_multiselection = false;
@@ -53,7 +55,6 @@ public class Global {
public static ComponentsServer componentsServer = new ComponentsServer();
public static TestingServer testingServer = new TestingServer();
public static PerformanceAnalyzer performanceAnalyzer = null;
public static void CheckVisualiserDirectories() {
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
@@ -144,21 +145,6 @@ public class Global {
}
System.exit(0);
}
/*
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);
for (DBSetting setting : mainModule.getDb().settings.getSettingsByOwner(ComponentType.SapforOptions)) {
if (!forbidden.contains(setting.Name))
res_.add(setting.Value);
}
return String.join("|", res_);
}
*/
//--
public static void NormalMode(int port) throws Exception {
//-------------------------------->>
@@ -183,7 +169,7 @@ public class Global {
components = new ComponentsSet();
components.initialVersionsCheck();
//-------->>
if (properties.AutoUpdateSearch)
if (normalProperties.AutoUpdateSearch)
Global.mainModule.getPass(PassCode.GetComponentsActualVersions).Do();
components.validateStates();
if (components.needChanges()) {
@@ -223,9 +209,9 @@ public class Global {
componentsServer.ActivateDB();
testingServer.ActivateDB();
//-- чисто чтобы создать таблицы. соединения на стороне клиента не предвидится.
if (Global.properties.AutoBugReportsLoad)
if (normalProperties.AutoBugReportsLoad)
Global.mainModule.getPass(PassCode.SynchronizeBugReports).Do();
if (Global.properties.AutoTestsLoad)
if (normalProperties.AutoTestsLoad)
Global.mainModule.getPass(PassCode.SynchronizeTests).Do();
//--
Global.mainModule.getSapfor().refreshPid(); //без сапфора сюда это все равно не дойдет.
@@ -260,17 +246,41 @@ public class Global {
}
}
//---
public static void SynchronizeProperties() throws Exception {
File propertiesFile = new File(System.getProperty("user.dir"), "properties");
if (!propertiesFile.exists()) {
mode = Mode.Normal;
properties=normalProperties = Utils_.SynschronizeProperties(propertiesFile, NormalProperties.class);
} else {
properties = Utils_.jsonFromFile(propertiesFile, VisualDVMProperties.class);
mode = properties.Mode;
//--->>
switch (mode){
case Normal:
normalProperties = Utils_.SynschronizeProperties(propertiesFile, NormalProperties.class);
break;
case Server:
componentsServerProperties = Utils_.SynschronizeProperties(propertiesFile, ComponentsServerProperties.class);
break;
case Testing:
testingServerProperties = Utils_.SynschronizeProperties(propertiesFile, TestingServerProperties.class);
break;
case MachineQueue:
case Package:
break;
default:
break;
}
}
}
//---
public static void Init(String... args) {
System.out.println("VisualSapfor.jar started..");
System.out.println("home directory is" + Utils_.Brackets(Utils_.getHomePath()));
//--->
properties=Utils_.SynschronizeProperties(
Paths.get(System.getProperty("user.dir"), "properties").toFile(),
GlobalProperties.class);
//--->
mode = properties.Mode;
System.out.println("mode is " + mode);
try {
SynchronizeProperties();
System.out.println("mode is " + mode);
switch (mode) {
case Normal:
NormalMode(Integer.parseInt(args[1]));