++
добавление учета пробелов в сравнение
This commit is contained in:
7
.idea/workspace.xml
generated
7
.idea/workspace.xml
generated
@@ -9,10 +9,9 @@
|
|||||||
<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$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/Json/SapforVersion_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/Json/SapforVersion_json.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_InsertIncludesPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_InsertIncludesPass.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/ComparisonForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/ComparisonForm.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/Project/db_project_info.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/Project/db_project_info.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/SapforPackagesComparisonForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/SapforPackagesComparisonForm.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/Transformation/IncludeToInsertJson.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/Transformation/IncludeToInsertJson.java" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -5,16 +5,16 @@ public class IntegerPairJson {
|
|||||||
public int key;
|
public int key;
|
||||||
@Expose
|
@Expose
|
||||||
public int value;
|
public int value;
|
||||||
public int getKey() {
|
|
||||||
return key;
|
|
||||||
}
|
|
||||||
public int getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
public IntegerPairJson(int key_in, int value_in) {
|
public IntegerPairJson(int key_in, int value_in) {
|
||||||
key = key_in;
|
key = key_in;
|
||||||
value = value_in;
|
value = value_in;
|
||||||
}
|
}
|
||||||
public IntegerPairJson() {
|
public IntegerPairJson() {
|
||||||
}
|
}
|
||||||
|
public int getKey() {
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
public int getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package Common.Visual;
|
package Common.Visual;
|
||||||
import Common.MainModule_;
|
import Common.MainModule_;
|
||||||
import Common.Utils.Utils_;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import Common.Utils.Vector_;
|
|||||||
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class Constants {
|
public class Constants {
|
||||||
public static final int version = 1254;
|
public static final int version = 1255;
|
||||||
public static final int planner_version = 24;
|
public static final int planner_version = 24;
|
||||||
public static final int testingMaxKernels = 64;
|
public static final int testingMaxKernels = 64;
|
||||||
//--
|
//--
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package _VisualDVM.Passes.All;
|
package _VisualDVM.Passes.All;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import Common.Visual.UI;
|
|
||||||
import Common.Visual.Windows.Dialog.Text.ComboTextDialog;
|
import Common.Visual.Windows.Dialog.Text.ComboTextDialog;
|
||||||
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
||||||
import _VisualDVM.ComponentsServer.Component.Sapfor.TransformationPermission;
|
import _VisualDVM.ComponentsServer.Component.Sapfor.TransformationPermission;
|
||||||
@@ -55,7 +54,6 @@ public class CombineFiles extends Transformation {
|
|||||||
Vector<String> result_lines = new Vector<>();
|
Vector<String> result_lines = new Vector<>();
|
||||||
Vector<String> all_includes = new Vector<>();
|
Vector<String> all_includes = new Vector<>();
|
||||||
//-----------------------------
|
//-----------------------------
|
||||||
|
|
||||||
result_lines.add("!-Found " + target.allIncludes.size() + " headers");
|
result_lines.add("!-Found " + target.allIncludes.size() + " headers");
|
||||||
System.out.println("found " + target.allIncludes.size() + " headers");
|
System.out.println("found " + target.allIncludes.size() + " headers");
|
||||||
for (String name : target.allIncludes) {
|
for (String name : target.allIncludes) {
|
||||||
@@ -88,7 +86,6 @@ public class CombineFiles extends Transformation {
|
|||||||
result_lines.addAll(FileUtils.readLines(target.db.files.Data.get(name).file));
|
result_lines.addAll(FileUtils.readLines(target.db.files.Data.get(name).file));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FileUtils.writeLines(result, result_lines, false);
|
FileUtils.writeLines(result, result_lines, false);
|
||||||
//-------------------------------
|
//-------------------------------
|
||||||
//теперь скопировать остальные файлы
|
//теперь скопировать остальные файлы
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
package _VisualDVM.Passes.All;
|
package _VisualDVM.Passes.All;
|
||||||
import Common.Utils.Index;
|
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import Common.Visual.UI;
|
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
||||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||||
import _VisualDVM.ProjectData.SapforData.Arrays.ArrayDecl;
|
import _VisualDVM.ProjectData.SapforData.Arrays.ArrayDecl;
|
||||||
import _VisualDVM.ProjectData.SapforData.Arrays.ArraysJson;
|
import _VisualDVM.ProjectData.SapforData.Arrays.ArraysJson;
|
||||||
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
|
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
|
||||||
|
|
||||||
import javax.rmi.CORBA.Util;
|
|
||||||
import java.math.BigInteger;
|
|
||||||
public class SPF_GetAllDeclaratedArrays extends SapforAnalysis {
|
public class SPF_GetAllDeclaratedArrays extends SapforAnalysis {
|
||||||
@Override
|
@Override
|
||||||
public String phase() {
|
public String phase() {
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
package _VisualDVM.Passes.All;
|
package _VisualDVM.Passes.All;
|
||||||
import Common.Utils.Index;
|
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import Common.Utils.Vector_;
|
import Common.Utils.Vector_;
|
||||||
import Common.Visual.Controls.PassControl;
|
import Common.Visual.Controls.PassControl;
|
||||||
import Common.Visual.UI;
|
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
||||||
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
|
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
package _VisualDVM.Passes.All;
|
package _VisualDVM.Passes.All;
|
||||||
import Common.Utils.Index;
|
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ public class SPF_GetGCovInfo extends SilentSapforPass {
|
|||||||
long v_execution = (lineJson.execution >= 0) ? lineJson.execution : 0;
|
long v_execution = (lineJson.execution >= 0) ? lineJson.execution : 0;
|
||||||
if (!projectFile.gcov_info.line_info.containsKey(v_line)) {
|
if (!projectFile.gcov_info.line_info.containsKey(v_line)) {
|
||||||
projectFile.gcov_info.add_line(v_line, v_execution);
|
projectFile.gcov_info.add_line(v_line, v_execution);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ public class SPF_GetIncludeDependencies extends SapforAnalysis {
|
|||||||
if (Global.mainModule.HasFile() && Global.mainModule.getFile().name.equals(include_file.name))
|
if (Global.mainModule.HasFile() && Global.mainModule.getFile().name.equals(include_file.name))
|
||||||
update_current = true;
|
update_current = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
System.out.println(Utils_.Brackets(include.dependencyFileName) + " не существует!");
|
System.out.println(Utils_.Brackets(include.dependencyFileName) + " не существует!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ public class SPF_InsertIncludesPass extends SapforTransformation {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (super.canStart(args)) {
|
if (super.canStart(args)) {
|
||||||
if (target.numAddicted <= 0) {
|
if (target.numAddicted <= 0) {
|
||||||
|
|||||||
@@ -257,7 +257,6 @@ public class DBProjectFile extends ProjectFile {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddNewMessage(Message message) throws Exception {
|
public void AddNewMessage(Message message) throws Exception {
|
||||||
switch (message.type) {
|
switch (message.type) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -282,8 +281,6 @@ public class DBProjectFile extends ProjectFile {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public DefaultMutableTreeNode show_loop_graph_r(FileObjectWithMessages element) {
|
public DefaultMutableTreeNode show_loop_graph_r(FileObjectWithMessages element) {
|
||||||
DefaultMutableTreeNode res = new DefaultMutableTreeNode(element);
|
DefaultMutableTreeNode res = new DefaultMutableTreeNode(element);
|
||||||
if (element instanceof Loop) {
|
if (element instanceof Loop) {
|
||||||
|
|||||||
@@ -26,18 +26,6 @@ public class Message extends iDBObject {
|
|||||||
//--
|
//--
|
||||||
@Description("DEFAULT ''")
|
@Description("DEFAULT ''")
|
||||||
public String file = "";
|
public String file = "";
|
||||||
public String getGroup_s() {
|
|
||||||
switch (group) {
|
|
||||||
case 0:
|
|
||||||
return "#m0000";
|
|
||||||
case Constants.parser_group: //сообщения от парсера.
|
|
||||||
return "#parser";
|
|
||||||
case Constants.compiler_group:
|
|
||||||
return "#compiler";
|
|
||||||
default:
|
|
||||||
return "#"+group;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//--
|
//--
|
||||||
public Message() {
|
public Message() {
|
||||||
}
|
}
|
||||||
@@ -455,4 +443,16 @@ public class Message extends iDBObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public String getGroup_s() {
|
||||||
|
switch (group) {
|
||||||
|
case 0:
|
||||||
|
return "#m0000";
|
||||||
|
case Constants.parser_group: //сообщения от парсера.
|
||||||
|
return "#parser";
|
||||||
|
case Constants.compiler_group:
|
||||||
|
return "#compiler";
|
||||||
|
default:
|
||||||
|
return "#" + group;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,14 +39,6 @@ public class AlignRule {
|
|||||||
alignRuleWith.add(new AlignRuleWidthJson(dimNum, a, b));
|
alignRuleWith.add(new AlignRuleWidthJson(dimNum, a, b));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void Init(){
|
|
||||||
//--
|
|
||||||
alignArray_address = new BigInteger(packedAlignArrayAddress);
|
|
||||||
alignWith_address = new BigInteger(packedAlignWithAddress);
|
|
||||||
//--
|
|
||||||
packedAlignArrayAddress = null;
|
|
||||||
packedAlignWithAddress = null;
|
|
||||||
}
|
|
||||||
private static Pair<String, String> convertDigitToPositive(int digit) {
|
private static Pair<String, String> convertDigitToPositive(int digit) {
|
||||||
String buf = "";
|
String buf = "";
|
||||||
String sign = " + ";
|
String sign = " + ";
|
||||||
@@ -58,6 +50,14 @@ public class AlignRule {
|
|||||||
buf += String.valueOf(digit);
|
buf += String.valueOf(digit);
|
||||||
return new Pair<>(sign, buf);
|
return new Pair<>(sign, buf);
|
||||||
}
|
}
|
||||||
|
public void Init() {
|
||||||
|
//--
|
||||||
|
alignArray_address = new BigInteger(packedAlignArrayAddress);
|
||||||
|
alignWith_address = new BigInteger(packedAlignWithAddress);
|
||||||
|
//--
|
||||||
|
packedAlignArrayAddress = null;
|
||||||
|
packedAlignWithAddress = null;
|
||||||
|
}
|
||||||
public ProjectArray getAlignArray() {
|
public ProjectArray getAlignArray() {
|
||||||
return parent_region.arraysMap.get(alignArray_address);
|
return parent_region.arraysMap.get(alignArray_address);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,13 @@ public class AlignRuleWidthJson {
|
|||||||
public int a;
|
public int a;
|
||||||
@Expose
|
@Expose
|
||||||
public int b;
|
public int b;
|
||||||
|
public AlignRuleWidthJson() {
|
||||||
|
}
|
||||||
|
public AlignRuleWidthJson(int i_in, int a_in, int b_in) {
|
||||||
|
dimNum = i_in;
|
||||||
|
a = a_in;
|
||||||
|
b = b_in;
|
||||||
|
}
|
||||||
//dim -> a * dim_t + b
|
//dim -> a * dim_t + b
|
||||||
public int getDimNum() {
|
public int getDimNum() {
|
||||||
return dimNum;
|
return dimNum;
|
||||||
@@ -17,12 +24,4 @@ public class AlignRuleWidthJson {
|
|||||||
public int getB() {
|
public int getB() {
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
public AlignRuleWidthJson(){
|
|
||||||
|
|
||||||
}
|
|
||||||
public AlignRuleWidthJson(int i_in, int a_in, int b_in){
|
|
||||||
dimNum = i_in;
|
|
||||||
a = a_in;
|
|
||||||
b = b_in;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
package _VisualDVM.ProjectData.SapforData.Arrays;
|
package _VisualDVM.ProjectData.SapforData.Arrays;
|
||||||
import Common.Database.Objects.DBObject;
|
import Common.Database.Objects.DBObject;
|
||||||
import Common.Utils.Index;
|
|
||||||
import Common.Utils.IntegerPairJson;
|
import Common.Utils.IntegerPairJson;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
import _VisualDVM.ProjectData.DBArray.DBArray;
|
import _VisualDVM.ProjectData.DBArray.DBArray;
|
||||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
|
||||||
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateDimension;
|
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateDimension;
|
||||||
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateDimensionState;
|
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateDimensionState;
|
||||||
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateLink;
|
|
||||||
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
|
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
|
||||||
import _VisualDVM.ProjectData.SapforData.Regions.UI.ArrayAlignmentBar;
|
import _VisualDVM.ProjectData.SapforData.Regions.UI.ArrayAlignmentBar;
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
@@ -21,6 +18,9 @@ import java.util.List;
|
|||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
public class ProjectArray extends DBObject {
|
public class ProjectArray extends DBObject {
|
||||||
|
//--
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
public static final String[] alignNames = {"i", "j", "k", "l", "m", "n", "q", "r", "s", "t", "u", "w", "x", "y", "z"};
|
||||||
@Expose
|
@Expose
|
||||||
public long id;
|
public long id;
|
||||||
@Expose
|
@Expose
|
||||||
@@ -34,10 +34,6 @@ public class ProjectArray extends DBObject {
|
|||||||
@Expose
|
@Expose
|
||||||
public int typeSize;
|
public int typeSize;
|
||||||
@Expose
|
@Expose
|
||||||
int state;
|
|
||||||
@Expose
|
|
||||||
int location;
|
|
||||||
@Expose
|
|
||||||
public String locName;
|
public String locName;
|
||||||
@Expose
|
@Expose
|
||||||
public int isTemplFlag;
|
public int isTemplFlag;
|
||||||
@@ -45,17 +41,6 @@ public class ProjectArray extends DBObject {
|
|||||||
public int isLoopArrayFlag;
|
public int isLoopArrayFlag;
|
||||||
@Expose
|
@Expose
|
||||||
public Vector<ArrayDecl> declPlaces = new Vector<>();
|
public Vector<ArrayDecl> declPlaces = new Vector<>();
|
||||||
@Expose
|
|
||||||
List<Integer> deprecateToDist = new Vector<>();
|
|
||||||
@Expose
|
|
||||||
List<Integer> mappedDims = new Vector<>();
|
|
||||||
@Expose
|
|
||||||
Vector<IntegerPairJson> sizes = new Vector<>();
|
|
||||||
@Expose
|
|
||||||
Vector<String> regions = new Vector<>();
|
|
||||||
//--
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
public static final String[] alignNames = {"i", "j", "k", "l", "m", "n", "q", "r", "s", "t", "u", "w", "x", "y", "z"};
|
|
||||||
public String UniqKey;
|
public String UniqKey;
|
||||||
public BigInteger address;
|
public BigInteger address;
|
||||||
//только для шаблонов. для ФИЛЬТРА управления распределением измерений.
|
//только для шаблонов. для ФИЛЬТРА управления распределением измерений.
|
||||||
@@ -73,6 +58,33 @@ public class ProjectArray extends DBObject {
|
|||||||
public LinkedHashMap<Integer, Dimension> ac_new;
|
public LinkedHashMap<Integer, Dimension> ac_new;
|
||||||
//https://stackoverflow.com/questions/4941372/how-to-insert-image-into-jtable-cell
|
//https://stackoverflow.com/questions/4941372/how-to-insert-image-into-jtable-cell
|
||||||
public ArrayAlignmentBar bar = null;
|
public ArrayAlignmentBar bar = null;
|
||||||
|
@Expose
|
||||||
|
int state;
|
||||||
|
@Expose
|
||||||
|
int location;
|
||||||
|
@Expose
|
||||||
|
List<Integer> deprecateToDist = new Vector<>();
|
||||||
|
@Expose
|
||||||
|
List<Integer> mappedDims = new Vector<>();
|
||||||
|
@Expose
|
||||||
|
Vector<IntegerPairJson> sizes = new Vector<>();
|
||||||
|
@Expose
|
||||||
|
Vector<String> regions = new Vector<>();
|
||||||
|
public static String fill_binary(int d, String binary) {
|
||||||
|
int delta = Math.abs(binary.length() - d);
|
||||||
|
String res = binary;
|
||||||
|
for (int i = 0; i < delta; ++i) {
|
||||||
|
res = ("0" + res);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
//длина должна быть равной, ищем есть ли совпадающие позиции с единицами
|
||||||
|
public static boolean mask(String banned, String variant) {
|
||||||
|
for (int i = 0; i < variant.length(); ++i)
|
||||||
|
if ((variant.toCharArray()[i] == '1') && (banned.toCharArray()[i] == '1')) //попался, масконосец!
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
//------
|
//------
|
||||||
public void print() {
|
public void print() {
|
||||||
Vector<String> res = new Vector<>();
|
Vector<String> res = new Vector<>();
|
||||||
@@ -119,21 +131,6 @@ public class ProjectArray extends DBObject {
|
|||||||
ac_new = new LinkedHashMap<>();
|
ac_new = new LinkedHashMap<>();
|
||||||
//--FileForm
|
//--FileForm
|
||||||
}
|
}
|
||||||
public static String fill_binary(int d, String binary) {
|
|
||||||
int delta = Math.abs(binary.length() - d);
|
|
||||||
String res = binary;
|
|
||||||
for (int i = 0; i < delta; ++i) {
|
|
||||||
res = ("0" + res);
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
//длина должна быть равной, ищем есть ли совпадающие позиции с единицами
|
|
||||||
public static boolean mask(String banned, String variant) {
|
|
||||||
for (int i = 0; i < variant.length(); ++i)
|
|
||||||
if ((variant.toCharArray()[i] == '1') && (banned.toCharArray()[i] == '1')) //попался, масконосец!
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
public String printLinks() {
|
public String printLinks() {
|
||||||
Vector<String> res = links.keySet().stream().map(Object::toString).collect(Collectors.toCollection(Vector::new));
|
Vector<String> res = links.keySet().stream().map(Object::toString).collect(Collectors.toCollection(Vector::new));
|
||||||
return String.join(" ", res);
|
return String.join(" ", res);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package _VisualDVM.ProjectData.SapforData.Includes.Analysis;
|
package _VisualDVM.ProjectData.SapforData.Includes.Analysis;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import _VisualDVM.ProjectData.SapforData.FileObject;
|
import _VisualDVM.ProjectData.SapforData.FileObject;
|
||||||
import _VisualDVM.ProjectData.SapforData.Includes.Analysis.Include;
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
package _VisualDVM.ProjectData.SapforData.Regions;
|
package _VisualDVM.ProjectData.SapforData.Regions;
|
||||||
import Common.Database.Objects.DBObject;
|
import Common.Database.Objects.DBObject;
|
||||||
import Common.Utils.Index;
|
|
||||||
import Common.Utils.IntegerPairJson;
|
import Common.Utils.IntegerPairJson;
|
||||||
import Common.Utils.Pair;
|
import Common.Utils.Pair;
|
||||||
import Common.Utils.Utils_;
|
|
||||||
import Common.Visual.UI;
|
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||||
import _VisualDVM.ProjectData.SapforData.Arrays.AlignRule;
|
import _VisualDVM.ProjectData.SapforData.Arrays.AlignRule;
|
||||||
@@ -30,6 +27,21 @@ public class ParallelRegion extends DBObject {
|
|||||||
public Vector<AlignRule> alignRules;
|
public Vector<AlignRule> alignRules;
|
||||||
//----
|
//----
|
||||||
public Vector<String> rules;
|
public Vector<String> rules;
|
||||||
|
//--
|
||||||
|
public BigInteger regionId;
|
||||||
|
//name in program
|
||||||
|
// file -> <start, end> lines
|
||||||
|
public LinkedHashMap<String, List<IntegerPairJson>> lines; //+
|
||||||
|
//ключ - адрес. меняем
|
||||||
|
public LinkedHashMap<BigInteger, ProjectArray> arraysMap; //+
|
||||||
|
//for directive creating
|
||||||
|
public int maxdim = 0;
|
||||||
|
public Vector<String> fragments; //+
|
||||||
|
public int lines_count = 0;
|
||||||
|
public int loops_count = 0;
|
||||||
|
public int arrays_count = 0;
|
||||||
|
public int fd_count = 0;
|
||||||
|
public int fc_count = 0;
|
||||||
public void genRules(LinkedHashMap<BigInteger, ProjectArray> Arrays) {
|
public void genRules(LinkedHashMap<BigInteger, ProjectArray> Arrays) {
|
||||||
rules.clear();
|
rules.clear();
|
||||||
int maxLen = 0;
|
int maxLen = 0;
|
||||||
@@ -48,21 +60,6 @@ public class ParallelRegion extends DBObject {
|
|||||||
for (String r : v)
|
for (String r : v)
|
||||||
rules.add(r);
|
rules.add(r);
|
||||||
}
|
}
|
||||||
//--
|
|
||||||
public BigInteger regionId;
|
|
||||||
//name in program
|
|
||||||
// file -> <start, end> lines
|
|
||||||
public LinkedHashMap<String, List<IntegerPairJson>> lines; //+
|
|
||||||
//ключ - адрес. меняем
|
|
||||||
public LinkedHashMap<BigInteger, ProjectArray> arraysMap; //+
|
|
||||||
//for directive creating
|
|
||||||
public int maxdim = 0;
|
|
||||||
public Vector<String> fragments; //+
|
|
||||||
public int lines_count = 0;
|
|
||||||
public int loops_count = 0;
|
|
||||||
public int arrays_count = 0;
|
|
||||||
public int fd_count = 0;
|
|
||||||
public int fc_count = 0;
|
|
||||||
public void Init() {
|
public void Init() {
|
||||||
arraysMap = new LinkedHashMap<>();
|
arraysMap = new LinkedHashMap<>();
|
||||||
lines = new LinkedHashMap<>();
|
lines = new LinkedHashMap<>();
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
package _VisualDVM.TestingSystem.SAPFOR.Json;
|
package _VisualDVM.TestingSystem.SAPFOR.Json;
|
||||||
import Common.CommonConstants;
|
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
||||||
import _VisualDVM.Constants;
|
import _VisualDVM.Constants;
|
||||||
@@ -7,13 +6,11 @@ import _VisualDVM.ProjectData.Files.DBProjectFile;
|
|||||||
import _VisualDVM.ProjectData.Files.FileType;
|
import _VisualDVM.ProjectData.Files.FileType;
|
||||||
import _VisualDVM.ProjectData.Files.ProjectFile;
|
import _VisualDVM.ProjectData.Files.ProjectFile;
|
||||||
import _VisualDVM.ProjectData.LanguageName;
|
import _VisualDVM.ProjectData.LanguageName;
|
||||||
import _VisualDVM.ProjectData.Messages.Errors.MessageError;
|
|
||||||
import _VisualDVM.ProjectData.Messages.FileMessagesJson;
|
import _VisualDVM.ProjectData.Messages.FileMessagesJson;
|
||||||
import _VisualDVM.ProjectData.Messages.Message;
|
import _VisualDVM.ProjectData.Messages.Message;
|
||||||
import _VisualDVM.ProjectData.Messages.MessagesJson;
|
import _VisualDVM.ProjectData.Messages.MessagesJson;
|
||||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTask.SapforTask;
|
import _VisualDVM.TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||||
import _VisualDVM.Utils;
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
|
|
||||||
@@ -23,8 +20,6 @@ import java.nio.charset.Charset;
|
|||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import static java.lang.Character.isDigit;
|
|
||||||
public class SapforVersion_json implements Serializable {
|
public class SapforVersion_json implements Serializable {
|
||||||
@Expose
|
@Expose
|
||||||
public String version = "";
|
public String version = "";
|
||||||
@@ -127,40 +122,6 @@ public class SapforVersion_json implements Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean isMatch(SapforVersion_json version_json) {
|
|
||||||
if (!description.equals(version_json.description)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (files.size() != version_json.files.size()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
for (String name1 : files.keySet()) {
|
|
||||||
if (!version_json.files.containsKey(name1)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (String name1 : files.keySet()) {
|
|
||||||
ProjectFile file1 = files.get(name1);
|
|
||||||
ProjectFile file2 = version_json.files.get(name1);
|
|
||||||
//---
|
|
||||||
String text1 = "";
|
|
||||||
String text2 = "";
|
|
||||||
try {
|
|
||||||
text1 = FileUtils.readFileToString(file1.file, Charset.defaultCharset());
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
text2 = FileUtils.readFileToString(file2.file, Charset.defaultCharset());
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
if (!Utils.compareFortranTexts(text1, text2)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public boolean isMatchServer(SapforVersion_json version_json) {
|
public boolean isMatchServer(SapforVersion_json version_json) {
|
||||||
if (!description.equals(version_json.description)) {
|
if (!description.equals(version_json.description)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -233,8 +194,7 @@ public class SapforVersion_json implements Serializable {
|
|||||||
try {
|
try {
|
||||||
String packed = FileUtils.readFileToString(messages_dump);
|
String packed = FileUtils.readFileToString(messages_dump);
|
||||||
messagesJson = Utils_.gson.fromJson(packed, MessagesJson.class);
|
messagesJson = Utils_.gson.fromJson(packed, MessagesJson.class);
|
||||||
}
|
} catch (Exception ex) {
|
||||||
catch (Exception ex){
|
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ public class SapforTask extends DBObject {
|
|||||||
SapforVersion_json version1 = versions1.get(name1);
|
SapforVersion_json version1 = versions1.get(name1);
|
||||||
SapforVersion_json version2 = versions2.get(name1);
|
SapforVersion_json version2 = versions2.get(name1);
|
||||||
//---
|
//---
|
||||||
if (!version1.isMatch(version2)) {
|
if (!version1.isMatchServer(version2)) {
|
||||||
comparisonState = ComparisonState.NotMatch;
|
comparisonState = ComparisonState.NotMatch;
|
||||||
task2.comparisonState = ComparisonState.NotMatch;
|
task2.comparisonState = ComparisonState.NotMatch;
|
||||||
version1.comparisonState = VersionComparisonState.NotMatch;
|
version1.comparisonState = VersionComparisonState.NotMatch;
|
||||||
|
|||||||
@@ -597,6 +597,7 @@ public class Utils {
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
public static Pair<Vector<String>, Vector<String>> getFortranLines(String text) {
|
public static Pair<Vector<String>, Vector<String>> getFortranLines(String text) {
|
||||||
Vector<String> lines = new Vector<>();
|
Vector<String> lines = new Vector<>();
|
||||||
Vector<String> visible_lines = new Vector<>();
|
Vector<String> visible_lines = new Vector<>();
|
||||||
@@ -674,6 +675,8 @@ public class Utils {
|
|||||||
}
|
}
|
||||||
return new Pair<>(lines, visible_lines);
|
return new Pair<>(lines, visible_lines);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
/*
|
||||||
public static boolean CompareLines(String line1_raw, String line2_raw) {
|
public static boolean CompareLines(String line1_raw, String line2_raw) {
|
||||||
String line1 = line1_raw;
|
String line1 = line1_raw;
|
||||||
String line2 = line2_raw;
|
String line2 = line2_raw;
|
||||||
@@ -693,19 +696,7 @@ public class Utils {
|
|||||||
if (CompareLines(list.get(i), line)) last_index = i;
|
if (CompareLines(list.get(i), line)) last_index = i;
|
||||||
return (last_index >= max_index);
|
return (last_index >= max_index);
|
||||||
}
|
}
|
||||||
public static boolean compareFortranTexts(String text1, String text2) {
|
*/
|
||||||
Pair<Vector<String>, Vector<String>> p1 = getFortranLines(text1);
|
|
||||||
Pair<Vector<String>, Vector<String>> p2 = getFortranLines(text2);
|
|
||||||
Vector<String> lines1 = p1.getKey();
|
|
||||||
Vector<String> lines2 = p2.getKey();
|
|
||||||
if (lines1.size() != lines2.size())
|
|
||||||
return false;
|
|
||||||
for (int i = 0; i < lines1.size(); ++i) {
|
|
||||||
if (!CompareLines(lines1.get(i), lines2.get(i)))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
//--
|
//--
|
||||||
private static void get_newest_file_date_r(File dir, Vector<Long> dates) {
|
private static void get_newest_file_date_r(File dir, Vector<Long> dates) {
|
||||||
Vector<File> files = new Vector(Arrays.asList(dir.listFiles(new FileFilter() {
|
Vector<File> files = new Vector(Arrays.asList(dir.listFiles(new FileFilter() {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import javax.swing.*;
|
|||||||
import javax.swing.text.Highlighter;
|
import javax.swing.text.Highlighter;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public abstract class ComparisonForm<T> {
|
public abstract class ComparisonForm<T> {
|
||||||
@@ -25,7 +26,6 @@ public abstract class ComparisonForm<T> {
|
|||||||
final char cseparator = '\u200B';
|
final char cseparator = '\u200B';
|
||||||
public Class<T> t; //класс объектов.
|
public Class<T> t; //класс объектов.
|
||||||
//-->>
|
//-->>
|
||||||
public Vector<String> lines = new Vector<>(); //строки с учетом/неучетом пробелов. для сравнения
|
|
||||||
public Vector<String> visible_lines = new Vector<>(); //строки с нетронутыми пробелами. для отображения
|
public Vector<String> visible_lines = new Vector<>(); //строки с нетронутыми пробелами. для отображения
|
||||||
protected JToolBar tools;
|
protected JToolBar tools;
|
||||||
protected JLabel lObjectName;
|
protected JLabel lObjectName;
|
||||||
@@ -159,12 +159,8 @@ public abstract class ComparisonForm<T> {
|
|||||||
showObject();
|
showObject();
|
||||||
}
|
}
|
||||||
private void getLines() {
|
private void getLines() {
|
||||||
lines.clear();
|
|
||||||
visible_lines.clear();
|
visible_lines.clear();
|
||||||
//--
|
visible_lines = new Vector<String>(Arrays.asList(getText().split("\n")));
|
||||||
Pair<Vector<String>, Vector<String>> p = Utils.getFortranLines(getText());
|
|
||||||
lines = p.getKey();
|
|
||||||
visible_lines = p.getValue();
|
|
||||||
}
|
}
|
||||||
protected void ClearText() {
|
protected void ClearText() {
|
||||||
events_on = false;
|
events_on = false;
|
||||||
@@ -189,7 +185,7 @@ public abstract class ComparisonForm<T> {
|
|||||||
DiffRowGenerator generator = DiffRowGenerator.create()
|
DiffRowGenerator generator = DiffRowGenerator.create()
|
||||||
.showInlineDiffs(true)
|
.showInlineDiffs(true)
|
||||||
.inlineDiffByWord(true)
|
.inlineDiffByWord(true)
|
||||||
.ignoreWhiteSpaces(true)
|
// .ignoreWhiteSpaces(false)
|
||||||
.oldTag(f -> separator)
|
.oldTag(f -> separator)
|
||||||
.newTag(f -> separator)
|
.newTag(f -> separator)
|
||||||
.build();
|
.build();
|
||||||
@@ -274,9 +270,9 @@ public abstract class ComparisonForm<T> {
|
|||||||
t2.addAll(slave.visible_lines);
|
t2.addAll(slave.visible_lines);
|
||||||
//просто выясняем кто из них длиннее, и короткий дополняем пустыми строками.]
|
//просто выясняем кто из них длиннее, и короткий дополняем пустыми строками.]
|
||||||
int delta = Math.abs(t1.size() - t2.size());
|
int delta = Math.abs(t1.size() - t2.size());
|
||||||
if (lines.size() > slave.lines.size()) {
|
if (visible_lines.size() > slave.visible_lines.size()) {
|
||||||
Utils.addEmptyLines(t2, delta);
|
Utils.addEmptyLines(t2, delta);
|
||||||
} else if (lines.size() < slave.lines.size()) {
|
} else if (visible_lines.size() < slave.visible_lines.size()) {
|
||||||
Utils.addEmptyLines(t1, delta);
|
Utils.addEmptyLines(t1, delta);
|
||||||
}
|
}
|
||||||
///----------------
|
///----------------
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ public class SapforPackagesComparisonForm {
|
|||||||
package1.package_json.tasks.parallelStream()
|
package1.package_json.tasks.parallelStream()
|
||||||
.forEach(task1 -> {
|
.forEach(task1 -> {
|
||||||
SapforTask task2 = package2.package_json.getTaskByKey(task1.getUniqueKey());
|
SapforTask task2 = package2.package_json.getTaskByKey(task1.getUniqueKey());
|
||||||
task1.checkMatch(task2);
|
task1.checkMatchServer(task2);
|
||||||
})
|
})
|
||||||
).join();
|
).join();
|
||||||
System.out.println("done");
|
System.out.println("done");
|
||||||
|
|||||||
Reference in New Issue
Block a user