From 7a60c726b5c1a16a81cc4422d58485ed07dabbb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BChlegger?= Date: Tue, 27 Aug 2024 09:50:04 +0200 Subject: [PATCH] Fix: Some edgecases when generating symbol tables - Use DbPath instead of ID if additional information is available --- LibNoDaveConnectionLibrary/Projectfiles/Step7ProjectV5.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/LibNoDaveConnectionLibrary/Projectfiles/Step7ProjectV5.cs b/LibNoDaveConnectionLibrary/Projectfiles/Step7ProjectV5.cs index 71e75977..2fb0c67f 100644 --- a/LibNoDaveConnectionLibrary/Projectfiles/Step7ProjectV5.cs +++ b/LibNoDaveConnectionLibrary/Projectfiles/Step7ProjectV5.cs @@ -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); @@ -1653,6 +1654,7 @@ 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; } @@ -1660,13 +1662,13 @@ private SymbolTable _GetSymTabForProject(S7ProgrammFolder myBlockFolder, bool sh } } - 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; }