-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change RevisionNumber to string and implemented relative TextBox #113
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Thanks for the pull request.
Adding extra elements to the xsd would make it fail its validation so that is not the way, but where should the extra values be?
Do any of you know @CANopenNode @trojanobelix?
The xsd has been removed from CiA for some reason 😑
libEDSsharp/eds.cs
Outdated
@@ -679,7 +679,7 @@ public partial class DeviceInfo : InfoSection | |||
/// product revision number according to identity object sub-index 03h (Unsigned32) | |||
/// </summary> | |||
[EdsExport] | |||
public UInt32 RevisionNumber; | |||
public string RevisionNumber=""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why you want to change this into string.
Is it done to avoid converting the (hopefully) number in the textbox into a int?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RevisionNumber is like ProductNumber, I used string because it can be represented as both decimal and hexadecimal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tool always uses the string type for this data, the RevisionNumber (must have the major equal to OD 1018 subindex 3) was always set by default and could not be changed from the graphical interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RevisionNumber is like ProductNumber, I used string because it can be represented as both decimal and hexadecimal
I see, but how can we make sure it only contains a valid number and not a string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tool does not check this in any object, you can try for example with the ProductID, DeviceType, etc...
I changed the RevisionNumber to a string to make it conform to the rest of the existing code.
To solve your question, you should create a universal function that does this check and attach it to all objects, but it requires a major change (but this was not my goal)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to stay uint32 in database. GUI should be able to represent it as both decimal and hexadecimal.
However, ProductNumber
should also be uint32
...
See also our new ideas for those issues in #115
@nimrof, what do you mean by that? |
the xml schemas |
Interesting. I think, |
|
Not sure what the xml standards says, but in this case the files used to be there.
Yes, but it is currently for paying members only, so out of reach for me at the moment😶 |
I'm a member, if you need some information I can look into the standards. |
|
I do not have access to the CiA DS311. But in 306 (EDS) and 301 RevisionNumber and ProductNuber are unsigned32. So I assume in DS311 it would be unsigned32, too. |
I changed the RevisionNumber back to UInt32 as requested, I set the display to hexadecimal to better differentiate the major and minor revision. |
RevisionNumber and OrderCode are in the [DeviceInfo] section. |
…evice Info