отображение инклудов

This commit is contained in:
2025-04-16 14:16:38 +03:00
parent a0c45a2df0
commit 611194be8c
5 changed files with 29 additions and 61 deletions

4
.idea/workspace.xml generated
View File

@@ -11,9 +11,7 @@
<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/Passes/All/CombineFiles.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/CombineFiles.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/CombineFiles.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/CombineFiles.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetIncludeDependencies.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetIncludeDependencies.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetIncludeDependencies.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetIncludeDependencies.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/Files/DBProjectFile.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/Files/DBProjectFile.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/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Utils.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/MainEditorMenu.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/MainEditorMenu.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" />

View File

@@ -4,7 +4,7 @@
"ServerUserPassword": "mprit_2011", "ServerUserPassword": "mprit_2011",
"OfferRegistrationOnStart": true, "OfferRegistrationOnStart": true,
"Workspace": "E:\\Tests", "Workspace": "E:\\Tests",
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bug_1643809587", "ProjectsSearchDirectory": "E:\\Tests\\Downloads",
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system", "DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
"VisualiserPath": "C:\\Users\\misha\\Downloads", "VisualiserPath": "C:\\Users\\misha\\Downloads",
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F", "Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",

View File

@@ -55,7 +55,7 @@ public class CombineFiles extends Transformation {
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");
for (String name : target.allIncludes.keySet()) { for (String name : target.allIncludes) {
all_includes.add(" include " + Utils_.Quotes(Utils_.toU(name))); all_includes.add(" include " + Utils_.Quotes(Utils_.toU(name)));
result_lines.add("! include " + Utils_.Quotes(Utils_.toU(name))); result_lines.add("! include " + Utils_.Quotes(Utils_.toU(name)));
} }

View File

@@ -35,66 +35,36 @@ public class SPF_GetIncludeDependencies extends SapforAnalysis {
} }
@Override @Override
public void unpack(String packed) throws Exception { public void unpack(String packed) throws Exception {
/*
IncludesJson includesJson = Utils_.gson.fromJson(packed, IncludesJson.class); IncludesJson includesJson = Utils_.gson.fromJson(packed, IncludesJson.class);
System.out.println("packed="+packed);
for (FileIncludesJson fileIncludesJson : includesJson.allIncludes) {
String file_name = Utils_.toW(fileIncludesJson.file);
DBProjectFile dbProjectFile = target.db.files.get(file_name);
for (Include include : fileIncludesJson.includes)
dbProjectFile.dependencies.add(include.dependencyFileName);
}
*/
//--
update_current = false; update_current = false;
FileInfo fileInfo = null; for (FileIncludesJson fileIncludesJson : includesJson.allIncludes) {
String[] data_ = packed.split("@"); fileIncludesJson.file = Utils_.toW(fileIncludesJson.file);
for (int i = 0; i < data_.length; ++i) { FileInfo fileInfo = new FileInfo(fileIncludesJson.file);
String s = Utils_.toW(data_[i]); //---
if (i % 2 == 0) { DBProjectFile file = target.db.files.get(fileIncludesJson.file);
if (target.db.files.Data.containsKey(s)) { for (Include include : fileIncludesJson.includes) {
fileInfo = new FileInfo(s); fileInfo.dependencies.add(include);
} else fileInfo = null; if (!target.allIncludes.contains(include.file))
} else { target.allIncludes.add(include.file);
if ((fileInfo != null) && (s != "")) { //- определение типов языков инклудов по файлу куда они цепляютс.
String[] data__ = s.split("\\|"); if (!file.dependencies.contains(include.dependencyFileName)) {
for (int j = 0; j < data__.length; ++j) { file.dependencies.add(include.dependencyFileName);
if (data__[j].length() > 0) { //---
fileInfo.dependencies.add( DBProjectFile include_file = target.db.files.get(include.dependencyFileName);
new Include(fileInfo.file, data__[j])); include_file.UpdateType(FileType.header);
//------------------------------------- if (include_file.languageName == LanguageName.n)
include_file.UpdateLanguage(file.languageName);
if (include_file.style == LanguageStyle.none)
include_file.UpdateStyle(file.style);
if (Global.mainModule.HasFile() && Global.mainModule.getFile().name.equals(include_file.name))
update_current = true;
}
}
//----
if (!target.addictedFiles.containsKey(fileInfo.file)) if (!target.addictedFiles.containsKey(fileInfo.file))
target.addictedFiles.put(fileInfo.file, fileInfo); target.addictedFiles.put(fileInfo.file, fileInfo);
//-------------------------------------
String include_name = data__[j];
if (target.db.files.containsKey(include_name)) {
DBProjectFile d_file = target.db.files.Data.get(include_name);
//----------------->>
if (!target.allIncludes.containsKey(d_file.name))
target.allIncludes.put(d_file.name, d_file);
//----------------->>
//--
DBProjectFile father = target.db.files.Data.get(fileInfo.file);
if (!father.dependencies.contains(include_name))
father.dependencies.add(include_name);
//--
d_file.UpdateType(FileType.header);
if (d_file.languageName == LanguageName.n)
d_file.UpdateLanguage(father.languageName);
if (d_file.style == LanguageStyle.none)
d_file.UpdateStyle(father.style);
//----------------------------------------
if (Global.mainModule.HasFile() && Global.mainModule.getFile().name.equals(d_file.name))
update_current = true;
//-----------------------------------------
} }
} //-теперь строим граф. todo отображать его аналогично графу процедур?
}
}
fileInfo = null;
}
}
//-теперь строим граф
for (FileInfo file : target.addictedFiles.values()) { for (FileInfo file : target.addictedFiles.values()) {
DefaultMutableTreeNode node = new DefaultMutableTreeNode( DefaultMutableTreeNode node = new DefaultMutableTreeNode(
file); file);

View File

@@ -145,7 +145,7 @@ public class db_project_info extends DBObject {
public File Home = null; public File Home = null;
public DefaultMutableTreeNode filesTreeRoot = null; public DefaultMutableTreeNode filesTreeRoot = null;
public ProjectDatabase db = null; public ProjectDatabase db = null;
public LinkedHashMap<String, DBProjectFile> allIncludes = new LinkedHashMap<>(); public Vector<String> allIncludes = new Vector<>();
public SapforProperties sapforProperties = null; public SapforProperties sapforProperties = null;
DBLastProject info = null; //обновляется при открытии проекта. DBLastProject info = null; //обновляется при открытии проекта.
public db_project_info() { public db_project_info() {