TrakHound / MTConnect.NET

Fully featured .NET library in C# to build MTConnect Agent, Adapter, and Client Applications. Pre-built Agents with Windows Installers. Support for Windows and Linux. Supports MTConnect Versions up to 2.3. Supports .NET Framework 4.6.1 up to .NET 8
http://www.TrakHound.com
MIT License
99 stars 39 forks source link

Component hierarchy from devices.xml is lost #25

Closed SergeyGulik closed 2 years ago

SergeyGulik commented 2 years ago

Hi Patrick,

At the moment when probe arrives all components are placed on the first level of hierarchy. image So the structure is lost. I cannot figure out who is child of whom. I found that you was trying to track hierarchy in public void AssignTypePaths(), but completely commented out this code in 0e50b3ba0c3403b4c86f5813944cf991ec523c38 Instead of just fixing component hierarchy I decided to ask what are your thoughts/ideas? How you saw it implemented?

Best regards, Sergii

PatrickRitchie commented 2 years ago

@SergeyGulik The Components should form a hierarchy and I haven't seen the issue of them being read as flat before.

The expected behavior is shown below where Device contains Axes & Controller and Controller contains two Paths: image

The AssignTypePaths() method was from an older version of MTConnect.NET and I couldn't decide whether to leave it in or not as it shouldn't be needed (assuming everything else if working correctly) but could possibly be useful to show something like breadcrumbs in a UI. I will add this back in on the next release.

I would be curious to see what the Probe XML looks like that you read from to get the result you showed. It looks like the Components other than Axes & Controller are read as a 'generic' Component instead of a derived class based on the Type.

-Patrick

SergeyGulik commented 2 years ago

Hi Patrick, I apologize. There was no bug there. All components are in place. Best regards, Sergii.