Skip to content

Commit 8ad300f

Browse files
authored
Merge pull request #215 from TomMuehlegger/master
Minor fixes
2 parents 4f7e58f + 7a60c72 commit 8ad300f

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

LibNoDaveConnectionLibrary/DataTypes/Blocks/Step7V5/S7FunctionBlockRow.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -770,9 +770,13 @@ public string ToString(bool useSymbol, bool addSemicolonAfterCommand, bool useDa
770770
}
771771
else
772772
{
773-
par = "\"" + sym.Symbol + "\"." + paras[1];
774-
if (hasBit)
775-
par += "." + paras[2];
773+
if (sym != null)
774+
{
775+
par = "\"" + sym.Symbol + "\"." + paras[1];
776+
777+
if (hasBit)
778+
par += "." + paras[2];
779+
}
776780
}
777781
}
778782
else

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)