Skip to content

Repair issues in 'Reports' generation. - #224

Open
henri62 wants to merge 1 commit into
CANopenNode:mainfrom
henri62:bugfix/reports
Open

Repair issues in 'Reports' generation.#224
henri62 wants to merge 1 commit into
CANopenNode:mainfrom
henri62:bugfix/reports

Conversation

@henri62

@henri62 henri62 commented Jun 19, 2026

Copy link
Copy Markdown

Fixes:

  1. Fix an exception in the code when an non-existing subindex is referenced in a TPDO. See Unhandled exception running "Reports->Network PDO". #222 for details and reproduction.

  2. Fix an error when Reports->Documentation is called and you have spaces in your windows profile.

  3. Tested with a file that has a mapping to a non-existing sub-index, it now reports this error in the generated report with a RED colored message (via a style sheet ref) that the subindex is missing. To my opinion no error pop-up or something is needed because the goal is to make a report, so it suits the purpose.

  4. When you have a userprofile that contains spaces the generated temp file path for the *.md file also contains spaces and the viewer pop-up did not show up but gave an error of a missing file. The file is now quoted and the call is "modernized".

I have read the contributing guidelines, I agree to following them and I agree to the Developer's Certificate of Origin 1.1

@nimrof

nimrof commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Hi @henri62,
Sorry for the late reply.

I am unable to replicate the report generation problem with the file that is attached when using git master.
Could you check if the attached file causes the problem or if i am doing something wrong when trying to reproduce?

Recording.2026-07-25.115941.mp4

@nimrof nimrof added the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Jul 25, 2026
@henri62

henri62 commented Jul 25, 2026

Copy link
Copy Markdown
Author

That's strange, maybe I accidentally attached the (xdd) file where I fixed the issue already. Unfortunately our company just started the 3 weeks holiday so I cannot check if the file I attached here breaks the code. You have to wait for about 2 weeks, then I can test it. (And if it doesnt reproduce create the file again)

I tried to manually view the file to see if it should reproduce it but cannot see it. So please wait.

On june 17th, I reported to root cause of the problem in the original ticket #222

@henri62

henri62 commented Aug 11, 2026

Copy link
Copy Markdown
Author

I tried to reproduce the issue with the original version I encountered the problem first and the file I attached here. (From the opening post of the original bug report #222)

On opening the file I get this:

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: ColumnSpan
   at SourceGrid.Cells.Cell.set_ColumnSpan(Int32 value)
   at ODEditor.DevicePDOView2.UpdatePDOinfo(Boolean updatechoices) in D:\a\CANopenEditor\CANopenEditor\EDSEditorGUI\DevicePDOView2.cs:line 472
   at ODEditor.DeviceView.dispatch_updatePDOinfo() in D:\a\CANopenEditor\CANopenEditor\EDSEditorGUI\DeviceView.cs:line 99
   at ODEditor.MyTabUserControl.doUpdatePDOs() in D:\a\CANopenEditor\CANopenEditor\EDSEditorGUI\MyTabUserControl.cs:line 45
   at ODEditor.DeviceODView.PopulateObjectLists(EDSsharp eds_target) in D:\a\CANopenEditor\CANopenEditor\EDSEditorGUI\DeviceODView.cs:line 194
   at ODEditor.DeviceView.dispatch_updateOD() in D:\a\CANopenEditor\CANopenEditor\EDSEditorGUI\DeviceView.cs:line 110
   at ODEditor.ODEditor_MainForm.openXDDfile(String path) in D:\a\CANopenEditor\CANopenEditor\EDSEditorGUI\Form1.cs:line 366

The ReportView does not display anything valuable any more:

PDO Network Documentation 
[Node ID Name]

PDO Map

I think that its related to the .NET runtime I upgraded since reporting this issue between (because I was trying to build the project myself) so that the crash manifests this problem in a different way.

I will see if I can reproduce the original problem with a minimum file.

-EDIT 1-
When I open the same file in my own built editor version I do not see the red-marked line (has an entry is not mappable) any more too!
I only see it when I try to save the file. but that is another problem (0x2000 was not mappable).

-EDIT 2-
My original reproduction file was apparently "repaired" somehow.
I got it how to reproduce:

Create an SDO 0x2000 with only 1 entry subindex 0x00.
Then in a TPDO mapping add sub 0x01 and map it to 0x20000140 (so the wrong index 1).

I manually recreated/patched the offending file so you can see the final result with my patch above:
cleanopen-reproduce.zip

Of course its a problem in the file that the SDO shall have a subindex 0, what says what the maximum index shall be, but at least the tool should not crash on that.

You can also check it easily when making a TPDO mapping that is out of bounds in well defined SDO's, you get the same error.

@nimrof

nimrof commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Of course its a problem in the file that the SDO shall have a subindex 0, what says what the maximum index shall be, but at least the tool should not crash on that.

Agree,
Not sure if there are any failed-to-load error before, but i think that is one of them.
I cant think of a good automatic fix, do you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants