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 ProjectData.Project;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
import Common.Database.Objects.DBObject;
@@ -65,7 +67,7 @@ public class db_project_info extends DBObject {
public String Log = "";//текст выдаваемый сапфором
//-----------------------------------------------
@Description("DEFAULT -1")
public long creationDate = Constants.Nan; //--------------------------------------------------NEW.
public long creationDate = CommonConstants.Nan; //--------------------------------------------------NEW.
@Description("DEFAULT ''")
public String compilation_output = "";
@Description("DEFAULT ''")
@@ -88,19 +90,19 @@ public class db_project_info extends DBObject {
public int maxdim = 0;
//<editor-fold desc="Метрика">
@Description("DEFAULT -1")
public int numLines = Constants.Nan;
public int numLines = CommonConstants.Nan;
@Description("DEFAULT -1")
public int numSPF = Constants.Nan;
public int numSPF = CommonConstants.Nan;
@Description("DEFAULT -1")
public int numDVM = Constants.Nan;
public int numDVM = CommonConstants.Nan;
@Description("DEFAULT -1")
public int numArrays = Constants.Nan;
public int numArrays = CommonConstants.Nan;
@Description("DEFAULT -1")
public int numLoops = Constants.Nan;
public int numLoops = CommonConstants.Nan;
@Description("DEFAULT -1")
public int numFunctions = Constants.Nan;
public int numFunctions = CommonConstants.Nan;
@Description("DEFAULT -1")
public int numAddicted = Constants.Nan;
public int numAddicted = CommonConstants.Nan;
//-------------------------------------
//параметры графа функций. храним для каждого проекта.
@Description("DEFAULT 500")
@@ -309,10 +311,10 @@ public class db_project_info extends DBObject {
}
public boolean IsMCopy() {
String lname = name.toLowerCase();
return (lname.startsWith("m") && Utils.isDigit(lname.substring(1)));
return (lname.startsWith("m") && CommonUtils.isDigit(lname.substring(1)));
}
public String getTitle() {
return name + " " + Utils.DQuotes(description);
return name + " " + CommonUtils.DQuotes(description);
}
public File getProjFile() {
return Paths.get(Home.getAbsolutePath(), Constants.data, Constants.spf).toFile();
@@ -398,13 +400,13 @@ public class db_project_info extends DBObject {
allIncludes.clear();
files_order.clear();
functionsGraph.Clear();
numLines = Constants.Nan;
numSPF = Constants.Nan;
numDVM = Constants.Nan;
numArrays = Constants.Nan;
numFunctions = Constants.Nan;
numAddicted = Constants.Nan;
numLoops = Constants.Nan;
numLines = CommonConstants.Nan;
numSPF = CommonConstants.Nan;
numDVM = CommonConstants.Nan;
numArrays = CommonConstants.Nan;
numFunctions = CommonConstants.Nan;
numAddicted = CommonConstants.Nan;
numLoops = CommonConstants.Nan;
Log = "";
Scenario = "";
declaratedArrays.clear();
@@ -528,10 +530,10 @@ public class db_project_info extends DBObject {
return numLoops == ParallelVariant.statNaN ? recommendAnalysis(PassCode_2021.SPF_GetGraphLoops) : String.valueOf(numLoops);
}
public String FunctionsCount() {
return numFunctions == Constants.Nan ? recommendAnalysis(PassCode_2021.SPF_GetGraphFunctions) : String.valueOf(numFunctions);
return numFunctions == CommonConstants.Nan ? recommendAnalysis(PassCode_2021.SPF_GetGraphFunctions) : String.valueOf(numFunctions);
}
public String AddictedCount() {
return numAddicted == Constants.Nan ? recommendAnalysis(PassCode_2021.SPF_GetIncludeDependencies) : String.valueOf(numAddicted);
return numAddicted == CommonConstants.Nan ? recommendAnalysis(PassCode_2021.SPF_GetIncludeDependencies) : String.valueOf(numAddicted);
}
public boolean UpdateLinesCount() {
try {
@@ -673,8 +675,8 @@ public class db_project_info extends DBObject {
public boolean FolderNotExists(File new_directory, File subdir, TextLog passLog) {
for (File pf : getSubdirectoriesSimple(subdir)) {
if (pf.getName().equals(new_directory.getName())) {
passLog.Writeln("В папке " + Utils.Brackets(subdir.getAbsolutePath()) + "\n" +
"уже существует папка с именем " + Utils.Brackets(new_directory.getName()));
passLog.Writeln("В папке " + CommonUtils.Brackets(subdir.getAbsolutePath()) + "\n" +
"уже существует папка с именем " + CommonUtils.Brackets(new_directory.getName()));
return false;
}
}
@@ -713,8 +715,8 @@ public class db_project_info extends DBObject {
}
public boolean CheckAttachmentFile(File f, TextLog Log) {
Utils.validateFileShortNewName(f.getName(), Log);
if (Utils.getFileSizeMegaBytes(f) > 2)
Log.Writeln_("Размер вложения " + Utils.Brackets(f.getName()) + " превышает 2 Мb");
if (CommonUtils.getFileSizeMegaBytes(f) > 2)
Log.Writeln_("Размер вложения " + CommonUtils.Brackets(f.getName()) + " превышает 2 Мb");
return Log.isEmpty();
}
public boolean CheckAllAttachments(TextLog Log) {
@@ -843,7 +845,7 @@ public class db_project_info extends DBObject {
for (String key_ : versions.keySet()) {
String[] data_ = key_.split(letter);
String last = data_[data_.length - 1];
if (Utils.isDigit(last)) {
if (CommonUtils.isDigit(last)) {
int vn = Integer.parseInt(last);
if (vn > max_vn)
max_vn = vn;
@@ -1123,7 +1125,7 @@ public class db_project_info extends DBObject {
String[] splited = packed_messages.split("\\|");
int numberOfFiles = Integer.parseInt(splited[idx++]);
for (int i = 0; i < numberOfFiles; ++i) {
String message_file = Utils.toW(splited[idx++]); //для ключа.
String message_file = CommonUtils.toW(splited[idx++]); //для ключа.
int numberOfMessages = Integer.parseInt(splited[idx++]);
if (!db.files.Data.containsKey(message_file)) {
throw new PassException("Ошибка при распаковке сообщений: файл: [" +