Skip to content

Commit

Permalink
Fix displaying runtime parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillGutyrchik committed Jul 15, 2024
1 parent c0462e1 commit cfed1d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
11 changes: 8 additions & 3 deletions src/Configuration/DeviceBindingReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,14 @@ private void SetBind(string description, List<string> actions,
}

var devicesGroupingByAS = devices
.GroupBy(dev => dev.RuntimeParameters
.TryGetValue(IODevice.RuntimeParameter.R_AS_NUMBER, out var r_as_number)
? int.Parse(r_as_number.ToString()) : -1)
.GroupBy(dev =>
{
dev.RuntimeParameters.TryGetValue(IODevice.RuntimeParameter.R_AS_NUMBER,
out var r_as_number_str);
if (r_as_number_str != null && int.TryParse(r_as_number_str.ToString(), out var r_as_number))
return r_as_number;
return -1;
})
.Where(r_as_dev => r_as_dev.Key != -1);

foreach (var group in devicesGroupingByAS.Where(r_as_dev => r_as_dev.Count() > 1))
Expand Down
9 changes: 5 additions & 4 deletions src/DFrm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -791,10 +791,11 @@ private void FillTypeNode(EplanDevice.IODevice dev, Node root,
dev.ObjectNumber, devTypeNode);
Node devNode = MakeDeviceNode(devTypeNode, devObjectNode,
dev, deviceDescription);
bool isDevVisible = AddDevChannels(devNode, dev) ||
(displayParamsBtn.Checked && AddDevParametersAndProperties(devNode, dev));

HideIncorrectDeviceTypeSubType(devNode, isDevVisible, countDev,

bool isDevChannelsVisible = AddDevChannels(devNode, dev);
bool isDevParametersVisible = displayParamsBtn.Checked && AddDevParametersAndProperties(devNode, dev);

HideIncorrectDeviceTypeSubType(devNode, isDevChannelsVisible || isDevParametersVisible, countDev,
dev);
}

Expand Down

0 comments on commit cfed1d4

Please sign in to comment.