diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 7807312f..5ab5276e 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -10,8 +10,8 @@
-
-
+
+
diff --git a/properties b/properties
index 5c3567d5..9ba582ab 100644
--- a/properties
+++ b/properties
@@ -4,7 +4,7 @@
"ServerUserPassword": "mprit_2011",
"OfferRegistrationOnStart": true,
"Workspace": "E:\\Tests",
- "ProjectsSearchDirectory": "E:\\BUG",
+ "ProjectsSearchDirectory": "E:\\Tests\\Downloads\\composit_1749198959",
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
"VisualiserPath": "C:\\Users\\misha\\Downloads",
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
diff --git a/src/_VisualDVM/Constants.java b/src/_VisualDVM/Constants.java
index 2a09d483..d6db99f4 100644
--- a/src/_VisualDVM/Constants.java
+++ b/src/_VisualDVM/Constants.java
@@ -3,7 +3,7 @@ import Common.Utils.Vector_;
import java.util.Vector;
public class Constants {
- public static final int version = 1250;
+ public static final int version = 1252;
public static final int planner_version = 24;
public static final int testingMaxKernels = 64;
//--
diff --git a/src/_VisualDVM/TestingSystem/SAPFOR/Json/SapforVersion_json.java b/src/_VisualDVM/TestingSystem/SAPFOR/Json/SapforVersion_json.java
index 0777b96c..ec5c6c82 100644
--- a/src/_VisualDVM/TestingSystem/SAPFOR/Json/SapforVersion_json.java
+++ b/src/_VisualDVM/TestingSystem/SAPFOR/Json/SapforVersion_json.java
@@ -8,6 +8,9 @@ import _VisualDVM.ProjectData.Files.FileType;
import _VisualDVM.ProjectData.Files.ProjectFile;
import _VisualDVM.ProjectData.LanguageName;
import _VisualDVM.ProjectData.Messages.Errors.MessageError;
+import _VisualDVM.ProjectData.Messages.FileMessagesJson;
+import _VisualDVM.ProjectData.Messages.Message;
+import _VisualDVM.ProjectData.Messages.MessagesJson;
import _VisualDVM.ProjectData.Project.db_project_info;
import _VisualDVM.TestingSystem.SAPFOR.SapforTask.SapforTask;
import _VisualDVM.Utils;
@@ -187,130 +190,9 @@ public class SapforVersion_json implements Serializable {
ex.printStackTrace();
}
return text1.equalsIgnoreCase(text2);
- // if (!Utils.compareFortranTexts(text1, text2)) {
- // return false;
- // }
}
return true;
}
- public MessageError unpackMessage(String line_in) throws Exception {
- MessageError res = new MessageError();
- res.file = "";
- res.line = CommonConstants.Nan;
- res.value = "";
- String line = line_in.substring(9);
- int i = 0;
- int s = 0;
- String lexeme = "";
- //#1020: red43.fdv: line 988]: Active DVM directives are not supported (turn on DVM-directive support option)
- for (char c : line.toCharArray()) {
- switch (s) {
- case 0:
- //поиск groups_s
- if (c == '#') {
- s = 1;
- lexeme = "";
- } else return null;
- break;
- case 1:
- //group_s
- if (isDigit(c)) {
- // res.group_s = res.getGroup_s() + c;
- lexeme += c;
- } else if (c == ':') {
- s = 2;
- res.group = Integer.parseInt(lexeme);
- } else return null;
- break;
- case 2:
- //поиск filename
- if (c == ' ') {
- s = 3;
- } else return null;
- break;
- case 3:
- //filename
- if (c == ':') {
- s = 4;
- } else {
- res.file += c;
- }
- break;
- case 4:
- //поиск line
- if (c == ' ') {
- s = 5;
- lexeme = "";
- } else return null;
- break;
- case 5:
- //line
- if (c == ' ') {
- if (!lexeme.equals("line"))
- return null;
- else {
- s = 6;
- lexeme = "";
- }
- } else {
- lexeme += c;
- }
- break;
- case 6:
- //line number
- if (isDigit(c)) {
- lexeme += c;
- } else if (c == ']') {
- res.line = Integer.parseInt(lexeme);
- s = 7;
- } else return null;
- break;
- case 7:
- //Поиск value
- if (c == ':') {
- s = 8;
- } else return null;
- break;
- case 8:
- if (c == ' ') {
- s = 9;
- } else return null;
- break;
- case 9:
- //value
- res.value += c;
- break;
- }
- ;
- ++i;
- }
- //--
- if (s != 9)
- return null;
- //--
- return res;
- }
- public void readMessagesFromFileDump(File file, Vector messages) {
- try {
- //Образец запакованного сообщения
- //ERROR - [#1020: red43.fdv: line 988]: Active DVM directives are not supported (turn on DVM-directive support option)
- Vector lines = new Vector<>(FileUtils.readLines(file));
- if (!lines.isEmpty()) {
- for (int i = lines.size() - 1; i >= 0; --i) {
- String line = lines.get(i);
- if (line.startsWith("ERROR - ")) {
- MessageError message = unpackMessage(line);
- if (message != null)
- messages.add(message);
- //--
- } else break;
- }
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
- //--
public void createProject(File rootHome) throws Exception {
project = null;
String version_ = Utils_.isWindows() ? Utils_.toW(version) : Utils_.toU(version);
@@ -327,20 +209,19 @@ public class SapforVersion_json implements Serializable {
}
public void ReadMessages() throws Exception {
if (project != null) {
- Vector messages = new Vector<>();
//--
File p_out = Paths.get(project.Home.getAbsolutePath(), Constants.data, Constants.parse_out_file).toFile();
File p_err = Paths.get(project.Home.getAbsolutePath(), Constants.data, Constants.parse_err_file).toFile();
File out = Paths.get(project.Home.getAbsolutePath(), Constants.data, Constants.out_file).toFile();
File err = Paths.get(project.Home.getAbsolutePath(), Constants.data, Constants.err_file).toFile();
+ File messages_dump = Paths.get(project.Home.getAbsolutePath(), Constants.data, "error_messages.json").toFile();
+ MessagesJson messagesJson = null;
//--
if (p_out.exists()) {
project.Log += (FileUtils.readFileToString(p_out));
- readMessagesFromFileDump(p_out, messages);
}
if (out.exists()) {
project.Log += "\n" + FileUtils.readFileToString(out);
- readMessagesFromFileDump(out, messages);
}
//в потоки ошибок идет информация от операционной системы. сообщений там быть не должно.
if (p_err.exists())
@@ -348,19 +229,33 @@ public class SapforVersion_json implements Serializable {
if (err.exists())
project.Log += "\n" + FileUtils.readFileToString(err);
//--
+ if (messages_dump.exists()){
+ try {
+ String packed = FileUtils.readFileToString(messages_dump);
+ messagesJson = Utils_.gson.fromJson(packed, MessagesJson.class);
+ }
+ catch (Exception ex){
+ ex.printStackTrace();
+ }
+ }
project.Open();
project.Update(); //Журнал
//а так же, убрать dep и txt
- project.db.BeginTransaction();
- for (MessageError m : messages) {
- if (project.db.files.containsKey(m.file)) {
- DBProjectFile file = project.db.files.Data.get(m.file);
- file.CreateAndAddNewMessage(1, m.value, m.line, m.group);
+ if (messagesJson!=null){
+ project.db.BeginTransaction();
+ //-
+ for (FileMessagesJson fileMessagesJson: messagesJson.allMessages){
+ fileMessagesJson.file = Utils_.toW(fileMessagesJson.file);
+ //--
+ DBProjectFile file = project.db.files.Data.get(fileMessagesJson.file);
+ for (Message message: fileMessagesJson.messages) {
+ file.CreateAndAddNewMessage(1, message.value, message.line, message.group);
+ }
//update file
project.db.Update(file);
}
+ project.db.Commit();
}
- project.db.Commit();
project.db.Disconnect();
}
}
diff --git a/src/_VisualDVM/TestingSystem/SAPFOR/SapforTestingPlanner.java b/src/_VisualDVM/TestingSystem/SAPFOR/SapforTestingPlanner.java
index e88c1adc..c5ed991f 100644
--- a/src/_VisualDVM/TestingSystem/SAPFOR/SapforTestingPlanner.java
+++ b/src/_VisualDVM/TestingSystem/SAPFOR/SapforTestingPlanner.java
@@ -195,7 +195,7 @@ public class SapforTestingPlanner extends TestingPlanner {
Print("сравнение завершено");
log.Writeln_("Различий с эталоном: " + testingPackage.mismatchesCount);
if (testingPackage.mismatchesCount > 0) {
- testingPackage.doneTasksCount -= testingPackage.mismatchesCount;
+ // testingPackage.doneTasksCount -= testingPackage.mismatchesCount;
testingPackage.state = TasksPackageState.DoneWithErrors;
}
return;