modelon-community / fmi-library

C library for importing FMUs
Other
115 stars 34 forks source link

Refactoring; splitting up modelDescription & terminalsAndIcons parsing #136

Closed PeterMeisrimelModelon closed 3 months ago

PeterMeisrimelModelon commented 3 months ago

Refactoring:

  1. Removed common (xml scheme) attributes list, instead duplicated for terminalsAndIcons (for simplicity)
  2. Split all scheme related enums, global maps into modelDescription, terminalsAndIcons
  3. Replaced element/attr enums by appropriate unions. Introduced new macros for easy allocation: FMI3_ATTR_ANY for xml independent contexts, FMI_ATTR_TERMICON for terminalsAndIcons, FMI3_ATTR for modelDescription (FMI3_ATTR_MODELDESCRIPTION would artificially blow up lines and the 3 implicitly points to FMI3 modelDescription)
  4. Added fmi3_xml_type enum for context struct
  5. All accesses to global structs are now via functions and use appropriate switch (xmlType) case ...

Next step:

PeterMeisrimelModelon commented 3 months ago

@modelonrobinandersson See latest commit for a few more things renamed for clarity/consistency.

modelonrobinandersson commented 3 months ago

@modelonrobinandersson See latest commit for a few more things renamed for clarity/consistency.

Looks great! I think the renaming also helped a lot.