Skip to content

Commit

Permalink
Fix: Some edgecases when generating symbol tables
Browse files Browse the repository at this point in the history
- Use DbPath instead of ID if additional information is available
  • Loading branch information
TomMuehlegger committed Aug 27, 2024
1 parent e948431 commit 7a60c72
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions LibNoDaveConnectionLibrary/Projectfiles/Step7ProjectV5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,7 @@ private SymbolTable _GetSymTabForProject(S7ProgrammFolder myBlockFolder, bool sh
}
}

var dbPath = tmpId2.ToString();
//Look fro Symlist Name
{
var dbfTbl = DBF.ParseDBF.ReadDBF(ProjectFolder + "YDBs" + _DirSeperator + "SYMLISTS.DBF", _ziphelper, _DirSeperator);
Expand All @@ -1653,20 +1654,21 @@ private SymbolTable _GetSymTabForProject(S7ProgrammFolder myBlockFolder, bool sh
if ((int)row["_ID"] == tmpId2)
{
retVal.Name = (string)row["_UName"];
dbPath = (string)row["_DbPath"];
if ((bool)row["DELETED_FLAG"]) retVal.Name = "$$_" + retVal.Name;
break;
}
}
}
}

if (string.IsNullOrEmpty(retVal.Name) && !File.Exists(ProjectFolder + "YDBs" + _DirSeperator + tmpId2.ToString() + _DirSeperator + "SYMLIST.DBF"))
if (string.IsNullOrEmpty(retVal.Name) && !File.Exists(ProjectFolder + "YDBs" + _DirSeperator + dbPath + _DirSeperator + "SYMLIST.DBF"))
return null;

retVal.showDeleted = showDeleted;
if (tmpId2 != 0)
retVal.Folder = ProjectFolder + "YDBs" + _DirSeperator + tmpId2.ToString() + _DirSeperator;
retVal.Folder = ProjectFolder + "YDBs" + _DirSeperator + dbPath + _DirSeperator;

return retVal;
}

Expand Down

0 comments on commit 7a60c72

Please sign in to comment.