Skip to content

Commit 7a60c72

Browse files
committed
Fix: Some edgecases when generating symbol tables
- Use DbPath instead of ID if additional information is available
1 parent e948431 commit 7a60c72

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

LibNoDaveConnectionLibrary/Projectfiles/Step7ProjectV5.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,7 @@ private SymbolTable _GetSymTabForProject(S7ProgrammFolder myBlockFolder, bool sh
16431643
}
16441644
}
16451645

1646+
var dbPath = tmpId2.ToString();
16461647
//Look fro Symlist Name
16471648
{
16481649
var dbfTbl = DBF.ParseDBF.ReadDBF(ProjectFolder + "YDBs" + _DirSeperator + "SYMLISTS.DBF", _ziphelper, _DirSeperator);
@@ -1653,20 +1654,21 @@ private SymbolTable _GetSymTabForProject(S7ProgrammFolder myBlockFolder, bool sh
16531654
if ((int)row["_ID"] == tmpId2)
16541655
{
16551656
retVal.Name = (string)row["_UName"];
1657+
dbPath = (string)row["_DbPath"];
16561658
if ((bool)row["DELETED_FLAG"]) retVal.Name = "$$_" + retVal.Name;
16571659
break;
16581660
}
16591661
}
16601662
}
16611663
}
16621664

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

16661668
retVal.showDeleted = showDeleted;
16671669
if (tmpId2 != 0)
1668-
retVal.Folder = ProjectFolder + "YDBs" + _DirSeperator + tmpId2.ToString() + _DirSeperator;
1669-
1670+
retVal.Folder = ProjectFolder + "YDBs" + _DirSeperator + dbPath + _DirSeperator;
1671+
16701672
return retVal;
16711673
}
16721674

0 commit comments

Comments
 (0)