Skip to content
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

Refactoring; splitting up modelDescription & terminalsAndIcons parsing #136

Merged
merged 27 commits into from
Aug 8, 2024

Conversation

PeterMeisrimelModelon
Copy link
Contributor

@PeterMeisrimelModelon PeterMeisrimelModelon commented Aug 7, 2024

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:

  • Re-location of code into more suitable logical file structures
  • Clean-up of imports

@PeterMeisrimelModelon PeterMeisrimelModelon self-assigned this Aug 7, 2024
@PeterMeisrimelModelon PeterMeisrimelModelon marked this pull request as ready for review August 7, 2024 09:25
Copy link
Collaborator

@modelonrobinandersson modelonrobinandersson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this all looks very good, well done!
I only noticed some very minor things (feel free to ignore).

src/XML/src/FMI3/fmi3_xml_parser.c Show resolved Hide resolved
src/XML/src/FMI3/fmi3_xml_parser.c Outdated Show resolved Hide resolved
src/XML/src/FMI3/fmi3_xml_parser.c Outdated Show resolved Hide resolved
src/XML/src/FMI3/fmi3_xml_parser.c Outdated Show resolved Hide resolved
src/XML/src/FMI3/fmi3_xml_parser_context_impl.h Outdated Show resolved Hide resolved
Co-authored-by: Robin Andersson <robin.andersson@modelon.com>
@PeterMeisrimelModelon
Copy link
Contributor Author

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

@modelonrobinandersson
Copy link
Collaborator

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

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

@PeterMeisrimelModelon PeterMeisrimelModelon merged commit 8ec1b43 into master Aug 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants