-
Notifications
You must be signed in to change notification settings - Fork 67
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
suggested changes to protobuffer after eds mapping experience #152
Comments
Hi, sorry for mu inactivity last two weeks. Here are some mu thoughts:
String adds some extra work to the programmer, but it is much more readable from the json. I think, it is very important. That is the only reason, I prefer string.
I think, that would only bloat the proto file. Canopeneditor does not use them in any way and currently I don't see practical usage. We can still produce perfectly correct eds file without that.
CANopen has great standards and I like them very much. But I like little less the standards for eds and xdd. I don't like to add complexity to the proto file just to strictly follow the (imperfect) standard. I think, it is enough, if we produce correct eds file from our data. And our data contains all necessary for that. And we could freely discuss about the shape of our data.
I agree with that. We could add optional node-id, name, description for each device. Sorry for my negative opinions. I was thinking about that a lot in the past and I have some quite strong opinions. But we can always discuss and find better solutions. Also, some other users may have expectations, I'm not avare of. |
That surprises me a little ;-) I'm quite a fan of sticking strictly to the standard. There are often considerations behind it that I can't assess. Deviations should be well justified (e.g. obvious errors) |
no problem
Did not think about that usage and i see your point, but not sure if that case outweigh the extra work. I see some problems/questions:
I see, but we cannot perfectly convert from one format to a different one and Canopen editor can support them in the future :)
The idea comes partly from #148 (comment) So its not just to support it some parts of the standard, but to use the parts of standard to make the protobuffer storage more generic and make it possible for others to expand.
👍
No problem with negative or strong opinion, i am not expecting everyone to agree with me. |
For 1 and 2 I will try to write some pros and cons next week. For 3 I agree with "Add a map<string, string> to object & subobjects That will allow us to store non-standard key & values in a standard way". But I would still like to keep some non standard properties (disabled, storageGroup) specified by protobuffer. Standards must be "live", they have to develop. Maybe our efforts will add some contribution to them once in the future. I'm trying to follow their evolution: eds, xdd(too complex), xdd for canfd(simplified, but no space for custom properties). I also found some other canopen device developers to use custom simple format for device description. Nanotec doesn't offer eds or xdd at all. |
I don't know the nooks and crannies of eds and XDD in detail. But the possibilities of the CanOpenEditor to convert different formats (via export) is great. It has a high benefit for users. I am not aware of any tools that can handle the different formats so comprehensively (if you know of one: please share). That is why I have come to appreciate the CANopenEditor. I think it would be important to retain this benefit when using the protobuffer. But this is certainly possible even if a different (read: another) data format is used internally.
I think this is a serious mistake. I consider the exchange via EDS and XDD files, as standard exchange formats, to be essential. btw: @robincornelius changed the internal main file format form proprietary XML to XDD six years ago |
I agree with that. But, I think, some responsibility is also in side of the standard. I didn't find eds files on their web page, but they may be accessible by email.
I took 100 lines of python to generate json file according to our CANopen.proto specification. CANopenEditor could then generate any standard file from it. |
Currently our protobuffer gives this json output:
Currently key for index is string with four hex digits and for subindex with two hex digits. Maybe prepending "0x" would be more clear. But I insist with hex numbers or json file will lose all human readability. I think, some validation of the database would be very useful. Protobuffer itself does not offer validation except data types. As I know, application level validation is suggested. It also does not provide uint8_t or uint16_t datatype. So that makes no difference if we just use string. And string suits perfectly into json. EDS uses |
This is a long story. I was thinking about deftype and defstruct in the past. Short answer: deftype and defstruct are not used (totally unused) by CANopenEditor, there are only two search results from this project: this issue and one place in the code, where enum is defined. Nobody never asked for them. deftype: If CANopenEditor use deftype, then DataType must not be specified as enum. It has to be something dynamically defined. I don't vote for that. defstruct: I was seriously thinking about implementing defstruct into CANopenEditor. CANopen objects with the same complex data type(records), would then be forced to have the same structure, as specified by defstruct. There are pros and cons and are also some inconsistencies in the standard. I found much simpler to keep defstruct unused, data structure is specified by each object individually. If we include null,domain,deftype,defstruct into proto definition, there will be problems explaining what they actually mean. If we don't use null,domain,deftype,defstruct, then some entries from eds file will probably be skipped. However, when exporting eds file, we could still generate deftype and defstruct objects from internal data. There is also some philosophy: CANopen.proto is new, we don't have to take the burden (of obsolete parts) from the standards. I suggest, we try to keep it as simple as possible. It is very easy to add some properties into proto file in the future if there will be a real reason. |
Actually there is no need for additional node-id, name, description for each device. Those information is already included inside |
As I mention above, I think it is a very good idea. We could discuss later how to use individual non-standard properties. |
Hi,
Got some changes to protobuffer i want to discuss
Its easier to work with integers and i not sure if there is a good reason why its a string.
It makes it easier to map other standard formats
That will allow us to store non-standard key & values in a standard way and would be equivalent to xdd property that is currently used to store canopennode values.
We could probably add some generic known key system that could allow us to treat them as integer/enum/other in the gui although they are stored at string.
This could also be a better way to treat some of canopennode non-standard data in a generic way
That allow us to store multiple devices in a single file if we want, its a little tricky/hacky to parse multiple files if we write just write multiple files without protobuffer support
The text was updated successfully, but these errors were encountered: