no message

This commit is contained in:
2024-02-25 20:34:00 +03:00
parent 1c57e1821f
commit 848d95ee14
3 changed files with 25 additions and 46 deletions

2
.idea/workspace.xml generated
View File

@@ -9,8 +9,6 @@
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment=""> <list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforPackage_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforPackage_json.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforPackage_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforPackage_json.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTask/SapforTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTask/SapforTask.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/AddTasksToSapforPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/AddTasksToSapforPackage.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/SapforPackagesComparisonForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/SapforPackagesComparisonForm.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/SapforPackagesComparisonForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/SapforPackagesComparisonForm.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />

View File

@@ -1,5 +1,4 @@
package TestingSystem.SAPFOR.Json; package TestingSystem.SAPFOR.Json;
import Common.UI.UI;
import GlobalData.Tasks.TaskState; import GlobalData.Tasks.TaskState;
import TestingSystem.SAPFOR.SapforPackage.SapforPackage; import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
import TestingSystem.SAPFOR.SapforTask.MatchState; import TestingSystem.SAPFOR.SapforTask.MatchState;
@@ -11,6 +10,8 @@ import com.google.gson.annotations.Expose;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import java.io.Serializable; import java.io.Serializable;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Vector; import java.util.Vector;
public class SapforPackage_json implements Serializable { public class SapforPackage_json implements Serializable {
@@ -39,6 +40,23 @@ public class SapforPackage_json implements Serializable {
//-- //--
@Expose @Expose
public List<SapforTask> tasks = new Vector<>(); public List<SapforTask> tasks = new Vector<>();
//---
public void sortTasks() {
tasks.sort(new Comparator<SapforTask>() {
@Override
public int compare(SapforTask o1, SapforTask o2) {
return Integer.compare(o1.state.ordinal(), o2.state.ordinal());
}
});
}
public void sortTasksForComparison() {
tasks.sort(new Comparator<SapforTask>() {
@Override
public int compare(SapforTask o1, SapforTask o2) {
return Integer.compare(o1.comparisonState.ordinal(), o2.comparisonState.ordinal());
}
});
}
public boolean containsKey(String key) { public boolean containsKey(String key) {
for (SapforTask task : tasks) { for (SapforTask task : tasks) {
if (task.getUniqueKey().equals(key)) if (task.getUniqueKey().equals(key))
@@ -59,7 +77,6 @@ public class SapforPackage_json implements Serializable {
//--------- //---------
public void DropComparison() { public void DropComparison() {
comparison_root = null; comparison_root = null;
UI.Info("DROP COMPARISON");
for (SapforTask task : tasks) for (SapforTask task : tasks)
task.comparisonState = MatchState.Unknown; task.comparisonState = MatchState.Unknown;
} }
@@ -72,6 +89,8 @@ public class SapforPackage_json implements Serializable {
root.count = tasks.size(); root.count = tasks.size();
root.errors_count = 0; root.errors_count = 0;
//-- //--
sortTasks();
//--
for (SapforTask task : tasks) { for (SapforTask task : tasks) {
DefaultMutableTreeNode taskNode = task.getNode(Paths.get( DefaultMutableTreeNode taskNode = task.getNode(Paths.get(
package_in.getLocalWorkspace().getAbsolutePath(), package_in.getLocalWorkspace().getAbsolutePath(),
@@ -84,13 +103,13 @@ public class SapforPackage_json implements Serializable {
} }
} }
public void buildComparisonTree(SapforPackage package_in) { public void buildComparisonTree(SapforPackage package_in) {
System.out.println(package_in.id);
comparison_root = new PackageComparisonSummary(); comparison_root = new PackageComparisonSummary();
comparison_root.count = tasks.size(); comparison_root.count = tasks.size();
comparison_root.mismatches_count = 0; comparison_root.mismatches_count = 0;
//-- //--
sortTasksForComparison();
//--
for (SapforTask task : tasks) { for (SapforTask task : tasks) {
// System.out.println(task.getUniqueKey()+":"+task.comparisonState);
DefaultMutableTreeNode taskNode = task.getNode(Paths.get( DefaultMutableTreeNode taskNode = task.getNode(Paths.get(
package_in.getLocalWorkspace().getAbsolutePath(), package_in.getLocalWorkspace().getAbsolutePath(),
String.valueOf(task.set_id), String.valueOf(task.set_id),
@@ -100,6 +119,5 @@ public class SapforPackage_json implements Serializable {
if (task.comparisonState.equals(MatchState.NotMatch)) if (task.comparisonState.equals(MatchState.NotMatch))
comparison_root.mismatches_count++; comparison_root.mismatches_count++;
} }
System.out.println("====");
} }
} }

View File

@@ -5,7 +5,6 @@ import Common.UI.Menus_2023.VisualiserMenuBar;
import Common.UI.UI; import Common.UI.UI;
import Common.Utils.TextLog; import Common.Utils.TextLog;
import TestingSystem.SAPFOR.SapforPackage.SapforPackage; import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
import TestingSystem.SAPFOR.SapforTask.MatchState;
import TestingSystem.SAPFOR.SapforTask.SapforTask; import TestingSystem.SAPFOR.SapforTask.SapforTask;
import TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforTasksPackageTree; import TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforTasksPackageTree;
import Visual_DVM_2021.Passes.PassCode_2021; import Visual_DVM_2021.Passes.PassCode_2021;
@@ -121,7 +120,7 @@ public class SapforPackagesComparisonForm {
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
}else { } else {
object.package_json.DropComparison(); object.package_json.DropComparison();
} }
//-- //--
@@ -229,51 +228,15 @@ public class SapforPackagesComparisonForm {
} }
@Override @Override
protected void body() throws Exception { protected void body() throws Exception {
System.out.println(package1.package_json.tasks.size());
System.out.println(package2.package_json.tasks.size());
//------------------------
for (SapforTask task1: package1.package_json.tasks){
}
//теперь сравниваем задачи //теперь сравниваем задачи
int i = 1; int i = 1;
for (SapforTask task1 : package1.package_json.tasks) { for (SapforTask task1 : package1.package_json.tasks) {
if (task1.id==161){
UI.Info("161");
SapforTask task2 = package2.package_json.getTaskByKey(task1.getUniqueKey()); SapforTask task2 = package2.package_json.getTaskByKey(task1.getUniqueKey());
task1.comparisonState=MatchState.Match; task1.checkMatch(task2);
task2.comparisonState=MatchState.Match;
UI.Info(String.valueOf(task2.id));
}
// System.out.println(i + "=" + task1.getUniqueKey());
SapforTask task2 = package2.package_json.getTaskByKey(task1.getUniqueKey());
task1.comparisonState=MatchState.Match;
task2.comparisonState=MatchState.Match;
// task1.checkMatch(task2);
//-- //--
++i; ++i;
//--- //---
} }
System.out.println("i="+i);
//--
int unknown_1 = 0;
for (SapforTask task: package1.package_json.tasks){
if (task.comparisonState.equals(MatchState.Unknown))
unknown_1++;
}
System.out.println("UNknown1="+unknown_1);
//--
int unknown_2 = 0;
for (SapforTask task: package2.package_json.tasks){
if (task.comparisonState.equals(MatchState.Unknown))
unknown_2++;
}
System.out.println("UNknown2="+unknown_2); //??!!
//--
package1.package_json.buildComparisonTree(package1); package1.package_json.buildComparisonTree(package1);
package2.package_json.buildComparisonTree(package2); package2.package_json.buildComparisonTree(package2);
} }