CANopenNode / CANopenEditor

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

A common interface to create and maintain file exporters #6

Closed North-Kraken closed 1 year ago

North-Kraken commented 3 years ago

Encapsulated many of the common data used by the file exporters into the IExporter class. To achieve this, IExporter was converted to an abstrac class.

DocumentationGen, implements two types of file exporters so thet were separated into DocumentationHTMLExporter and DocumentationMDExporter. In this fashion, the each exporter can be debuged separately without impacting the other. Both classes inherit IExporter to take advantage of the data encapsulation.

trojanobelix commented 2 years ago

The export_c exporter does not remove the ".c" file extension passed with "filename"

So it creates an invalid filename like e.g. "CO_OD.c.h".

include """ + filename + @".h"" // WRONG FILENAME because filename is with ".c" extension

include ""CO_SDO.h""

elif CO_VERSION_MAJOR < 4

include ""301/CO_driver.h"" // WRONG FILENAME because filename is with ".c" extension

include """ + filename + @".h""

This will correct the issue: #include """ + Path.GetFileNameWithoutExtension(filename) + @".h""

CANopenNode commented 1 year ago

This is quite a large PR with 16 files changed, not very clear and seems to have a bugs. Not sure if there is a problem, which should be solved with this PR. It is also very old, I'm closing it.