CANopenNode / CANopenEditor

CANopen Object Dictionary Editor
GNU General Public License v3.0
122 stars 60 forks source link

added module tab back to deviceview #123

Closed nimrof closed 1 month ago

nimrof commented 1 month ago

Think i reverted everything done here (https://github.com/CANopenNode/CANopenEditor/commit/43592ba22ea9438d3f9987d60a371aa47d56c1d8), but not sure how it should work :(. Can you help @trojanobelix

nimrof commented 1 month ago

Think it is needed to fix this: https://github.com/CANopenNode/CANopenEditor/issues/69

trojanobelix commented 1 month ago

Think you are right

CiA Draft Standard Proposal 306: "If several modules are gathered to form a new Sub-Index, then the number is 0, followed by semicolon and the number of bits that are created per module to build a new Sub-Index"

This feature is not implemented yet, and the parser will crash if something like Count=0;4 occurs.

Example from WI133489V1_25.eds:

[M1SubExt6000]
ParameterName=ReadInput8Bit
ObjectType=0x7
DataType=0x0005
AccessType=ro
PDOMapping=1
Count=0;4
CANopenNode commented 1 month ago

I tried to open that eds file from Weidmuller. File is opened without problems, modules are listed "Modues" tab. Information are just listed there, I didn't find any commands to interact with modules in GUI. I wasn't able to crash the program.

"Object Dictionary" tab does not show objects from any module, so it seems something is not yet implemented.

Some more tests: Added this into eds file and open it (after [SupportedModules]):

[ConnectedModules]
NrOfEntries=3
1=2
2=2
3=4

showed a warning, but program didn't crash (correct behavior):

System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at libEDSsharp.ConnectedModules..ctor(Dictionary`2 section) in Z:\CANopen\CANopenEditor\libEDSsharp\CanOpenEDS.cs:line 308
   at libEDSsharp.EDSsharp.Loadfile(String filename) in Z:\CANopen\CANopenEditor\libEDSsharp\CanOpenEDS.cs:line 951
   at ODEditor.ODEditor_MainForm.openEDSfile(String path, Filetype ft) in Z:\CANopen\CANopenEditor\EDSEditorGUI\Form1.cs:line 193

Next test, added this into eds file:

[ConnectedModules]
NrOfEntries=1
1=1

Opens correctly, list of modules is nicely colored, there is still no object 0x6000 in "Object Dictionary" tab.

Anyway, I think, it is safe to merge this PR for now.