-
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
Unified file exporter interface #131
Conversation
LGTM2 |
Very nice. Few comments:
Basically CANopenNode don't need connection to the GUI. We can keep the setting, but instead "Select exporter" dropbox, we can use checkbox "Legacy CANopen properties". I can prepare a PR for this if you like.
Maybe some extra explanation, that "type" is equal to description listed below.
Maybe "FileExporters"? Or class could be part of IFileExporter.cs, as it is short and somehow belongs there? |
I checked that part again. And have a suggestion. There is a setting
I think, this will not add any extra confusion to the user. CANopenNode V4 users won't notice the difference, except GUI in DeviceODView.cs. CANopenNodeV1.3 may have problems with wrong setting with DevicePDOView2.cs. |
Thx, fixed
You are correct, i misread, fixed by switching to .nxdd
Yes absolutely!
If you have the time, please do. It looks like the next few weeks will be busy for me.
good point, tried to fix
Totally forgot to mention it🙈, but I was hoping to get importers into the same class in the near future. |
Hi @nimrof, I was quite busy last days, I didn't manage to check your PR. As I understand, it is finished, but not yet added to GUI menu entry. There is some complexity with "ExporterType", but I think, we should not care about it at this point. If you will find time, you could add new exporter interface into "Form1.cs"
Just remove ExporterType dependency from that file. I will make this setting more clear and independent in separate PR. |
I find the generation of the CANopenNode c/h files under ‘Export’ unfortunate. I would prefer a menu item like ‘Generate CanopeNode OD ’ justmy2ct |
No problem.
Hope to get some time this weekend🤞
👍
Agree, we can always reconsider changing it the new gui |
Hi all.
I ended up delaying changes to the GUI, it was more complicated as the canopennode version has a loot of connection to the gui, and #130 made me focus on the cli part
A little explaining is needed on the changes
Please use a little extra time to check the helptext, changes to EDSSharp and a better class name than Filetypes
The unified exporter
all classes that can export something to file has a new function GetExporters from IFileExporter
That function returns a array contains all the the cli/gui program needs to describe it to user and do the actual export.
The class Filetypes (suggestion on better name are welcome 🙈) uses reflection and finds all classes that support IFileExporter and uses GetExporters to make a list of all supported export formats.
Changes to EDSSharp
It should be 100% backwards compatible as long as you followed the original documentation
There are no changes to how --infile work.
--type is now optional and is only needed if the file extension in --outfile can not be used to find one exporter, if more than one or zero is found to match --type is used.
new helptext