отображение инклудов
This commit is contained in:
4
.idea/workspace.xml
generated
4
.idea/workspace.xml
generated
@@ -11,9 +11,7 @@
|
||||
<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/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/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" />
|
||||
<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" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"ServerUserPassword": "mprit_2011",
|
||||
"OfferRegistrationOnStart": true,
|
||||
"Workspace": "E:\\Tests",
|
||||
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bug_1643809587",
|
||||
"ProjectsSearchDirectory": "E:\\Tests\\Downloads",
|
||||
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
|
||||
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
||||
|
||||
@@ -55,7 +55,7 @@ public class CombineFiles extends Transformation {
|
||||
Vector<String> all_includes = new Vector<>();
|
||||
//-----------------------------
|
||||
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)));
|
||||
result_lines.add("! include " + Utils_.Quotes(Utils_.toU(name)));
|
||||
}
|
||||
|
||||
@@ -35,66 +35,36 @@ public class SPF_GetIncludeDependencies extends SapforAnalysis {
|
||||
}
|
||||
@Override
|
||||
public void unpack(String packed) throws Exception {
|
||||
/*
|
||||
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;
|
||||
FileInfo fileInfo = null;
|
||||
String[] data_ = packed.split("@");
|
||||
for (int i = 0; i < data_.length; ++i) {
|
||||
String s = Utils_.toW(data_[i]);
|
||||
if (i % 2 == 0) {
|
||||
if (target.db.files.Data.containsKey(s)) {
|
||||
fileInfo = new FileInfo(s);
|
||||
} else fileInfo = null;
|
||||
} else {
|
||||
if ((fileInfo != null) && (s != "")) {
|
||||
String[] data__ = s.split("\\|");
|
||||
for (int j = 0; j < data__.length; ++j) {
|
||||
if (data__[j].length() > 0) {
|
||||
fileInfo.dependencies.add(
|
||||
new Include(fileInfo.file, data__[j]));
|
||||
//-------------------------------------
|
||||
if (!target.addictedFiles.containsKey(fileInfo.file))
|
||||
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;
|
||||
//-----------------------------------------
|
||||
}
|
||||
}
|
||||
}
|
||||
for (FileIncludesJson fileIncludesJson : includesJson.allIncludes) {
|
||||
fileIncludesJson.file = Utils_.toW(fileIncludesJson.file);
|
||||
FileInfo fileInfo = new FileInfo(fileIncludesJson.file);
|
||||
//---
|
||||
DBProjectFile file = target.db.files.get(fileIncludesJson.file);
|
||||
for (Include include : fileIncludesJson.includes) {
|
||||
fileInfo.dependencies.add(include);
|
||||
if (!target.allIncludes.contains(include.file))
|
||||
target.allIncludes.add(include.file);
|
||||
//- определение типов языков инклудов по файлу куда они цепляютс.
|
||||
if (!file.dependencies.contains(include.dependencyFileName)) {
|
||||
file.dependencies.add(include.dependencyFileName);
|
||||
//---
|
||||
DBProjectFile include_file = target.db.files.get(include.dependencyFileName);
|
||||
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;
|
||||
}
|
||||
fileInfo = null;
|
||||
}
|
||||
//----
|
||||
if (!target.addictedFiles.containsKey(fileInfo.file))
|
||||
target.addictedFiles.put(fileInfo.file, fileInfo);
|
||||
}
|
||||
//-теперь строим граф
|
||||
//-теперь строим граф. todo отображать его аналогично графу процедур?
|
||||
for (FileInfo file : target.addictedFiles.values()) {
|
||||
DefaultMutableTreeNode node = new DefaultMutableTreeNode(
|
||||
file);
|
||||
|
||||
@@ -145,7 +145,7 @@ public class db_project_info extends DBObject {
|
||||
public File Home = null;
|
||||
public DefaultMutableTreeNode filesTreeRoot = null;
|
||||
public ProjectDatabase db = null;
|
||||
public LinkedHashMap<String, DBProjectFile> allIncludes = new LinkedHashMap<>();
|
||||
public Vector<String> allIncludes = new Vector<>();
|
||||
public SapforProperties sapforProperties = null;
|
||||
DBLastProject info = null; //обновляется при открытии проекта.
|
||||
public db_project_info() {
|
||||
|
||||
Reference in New Issue
Block a user