no message

This commit is contained in:
2024-10-07 14:22:52 +03:00
parent 6b1576461d
commit 61fc37b574
173 changed files with 960 additions and 1526 deletions

View File

@@ -1,4 +1,6 @@
package Repository.Component;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common.Database.Objects.DBObject;
import _VisualDVM.Global;
@@ -14,9 +16,9 @@ import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
public abstract class Component extends DBObject implements Loggable {
public String date_text = Constants.dateNaN;
public long version = Constants.Nan;
public long actual_version = Constants.Nan;
public long minimal_version = Constants.Nan;
public long version = CommonConstants.Nan;
public long actual_version = CommonConstants.Nan;
public long minimal_version = CommonConstants.Nan;
//--
public String code = "";
public String actual_code = "";
@@ -26,7 +28,7 @@ public abstract class Component extends DBObject implements Loggable {
VFileChooser fileChooser = null; ///для ручной установки.
public VFileChooser getFileChooser() {
return (fileChooser == null) ? (fileChooser = new VFileChooser("выбор файла для компонента " +
Utils.Brackets(getComponentType().getDescription()), Utils.getExtension(getFile())))
CommonUtils.Brackets(getComponentType().getDescription()), CommonUtils.getExtension(getFile())))
: fileChooser;
}
//--
@@ -34,7 +36,7 @@ public abstract class Component extends DBObject implements Loggable {
return String.valueOf(version);
}
public void CheckIfNeedsUpdateOrPublish() {
if (actual_version != Constants.Nan) {
if (actual_version != CommonConstants.Nan) {
if (version < minimal_version) setState(ComponentState.Old_version);
else {
ComponentState new_state =
@@ -48,7 +50,7 @@ public abstract class Component extends DBObject implements Loggable {
setState(ComponentState.Undefined);
if (getFile().exists()) {
GetVersionInfo();
if (version == Constants.Nan)
if (version == CommonConstants.Nan)
setState(ComponentState.Unknown_version);
} else setState(ComponentState.Not_found);
}
@@ -84,8 +86,8 @@ public abstract class Component extends DBObject implements Loggable {
return getComponentType();
}
public boolean isValidVersion(TextLog Log, String desc) {
if (version == Constants.Nan) {
Log.Writeln_("Не определена версия " + desc + " компонента " + Utils.Brackets(getComponentType().getDescription()));
if (version == CommonConstants.Nan) {
Log.Writeln_("Не определена версия " + desc + " компонента " + CommonUtils.Brackets(getComponentType().getDescription()));
return false;
}
return true;

View File

@@ -1,4 +1,5 @@
package Repository.Component.PerformanceAnalyzer;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import analyzer.common.MessageJtoJ;
@@ -102,7 +103,7 @@ public class PerformanceAnalyzer extends Component {
return null;
});
Utils.startScript(Global.TempDirectory, Global.ComponentsDirectory, "analyzer",
"java -jar -Dprism.order=sw "+ Utils.DQuotes(Global.performanceAnalyzer.getFile()) + " --port "+ getPort()+ " --version" );
"java -jar -Dprism.order=sw "+ CommonUtils.DQuotes(Global.performanceAnalyzer.getFile()) + " --port "+ getPort()+ " --version" );
//-
server_thread.join();
} catch (Exception ex) {
@@ -124,7 +125,7 @@ public class PerformanceAnalyzer extends Component {
try {
Utils.startScript(Global.TempDirectory, Global.ComponentsDirectory, "analyzer",
"java -jar -Dprism.order=sw "+ Utils.DQuotes(Global.performanceAnalyzer.getFile()) + " --port "+ getPort());
"java -jar -Dprism.order=sw "+ CommonUtils.DQuotes(Global.performanceAnalyzer.getFile()) + " --port "+ getPort());
//-
} catch (Exception ex) {
ex.printStackTrace();

View File

@@ -1,4 +1,6 @@
package Repository.Component.Sapfor;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
import _VisualDVM.Global;
@@ -137,7 +139,7 @@ public abstract class Sapfor extends OSDComponent {
Visualizer_2.UnpackVersionInfo(this, getResult());
} catch (Exception e) {
Global.Log.PrintException(e);
UI.Error("Не удалось получить версию компонента " + Utils.DQuotes(getComponentType().getDescription()));
UI.Error("Не удалось получить версию компонента " + CommonUtils.DQuotes(getComponentType().getDescription()));
}
}
public abstract String getUpdateCommand();
@@ -165,9 +167,9 @@ public abstract class Sapfor extends OSDComponent {
RunAnalysis("SPF_StatisticAnalyzer",
-1,
"",
Utils.DQuotes(src.getAbsolutePath()) +
CommonUtils.DQuotes(src.getAbsolutePath()) +
" "
+ Utils.DQuotes(dst.getAbsolutePath())
+ CommonUtils.DQuotes(dst.getAbsolutePath())
);
}
public void Restart() throws Exception {
@@ -181,7 +183,7 @@ public abstract class Sapfor extends OSDComponent {
public void cd(File directory_in) throws Exception {
if (RunAnalysis("SPF_ChangeDirectory", -1, directory_in.getAbsolutePath(), "") != 0)
throw new PassException("Sapfor: Не удалось перейти в папку "
+ Utils.Brackets(directory_in.getAbsolutePath()) +
+ CommonUtils.Brackets(directory_in.getAbsolutePath()) +
"\n" + "Код возврата: " + getErrorCode());
}
public String getResult() {
@@ -253,7 +255,7 @@ public abstract class Sapfor extends OSDComponent {
}
} else if (z == 1) file_text = sub;
else if (z == 2) {
ModifiedFiles.put(Utils.toW(sub), file_text);
ModifiedFiles.put(CommonUtils.toW(sub), file_text);
file_text = null;
}
codeIdx += count;
@@ -444,7 +446,7 @@ public abstract class Sapfor extends OSDComponent {
Vector<String> resultLines
) throws Exception {
Process process = null;
int exit_code = Constants.Nan;
int exit_code = CommonConstants.Nan;
//---
File data_workspace = new File(workspace, Constants.data);
Utils.CheckDirectory(data_workspace);
@@ -455,14 +457,14 @@ public abstract class Sapfor extends OSDComponent {
//---
File file = new File(data_workspace, name + (Global.isWindows ? ".bat" : ".sh"));
FileUtils.write(file,
Utils.DQuotes(sapfor_drv)
CommonUtils.DQuotes(sapfor_drv)
+ (flags.isEmpty() ? "" : (" " + flags))
+ " -noLogo"
+ " " + command +
" 1>" +
Utils.DQuotes(outputFile.getAbsolutePath()) +
CommonUtils.DQuotes(outputFile.getAbsolutePath()) +
" 2>" +
Utils.DQuotes(errorsFile.getAbsolutePath()),
CommonUtils.DQuotes(errorsFile.getAbsolutePath()),
Charset.defaultCharset());
if (!file.setExecutable(true))
throw new Exception("Не удалось сделать файл скрипта " + name + " исполняемым!");
@@ -557,7 +559,7 @@ public abstract class Sapfor extends OSDComponent {
return false;
}
public static int readVersionFromCode(File versionFile) {
int res = Constants.Nan;
int res = CommonConstants.Nan;
if (versionFile.exists()) {
try {
List<String> data = FileUtils.readLines(versionFile);

View File

@@ -1,4 +1,5 @@
package Repository.Component;
import Common.Utils.CommonUtils;
import _VisualDVM.Global;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
@@ -119,7 +120,7 @@ public class Visualizer_2 extends OSDComponent {
case "NOT_FOUND":
case "WRONG":
case "SEG_FAULT":
throw new PassException("Команда серверу SAPFOR вернула " + Utils.Brackets(response));
throw new PassException("Команда серверу SAPFOR вернула " + CommonUtils.Brackets(response));
default:
break;
}