Skip to content

Conversation

@akeeste
Copy link
Contributor

@akeeste akeeste commented Jan 3, 2024

This PR fixes two bugs brought up in #1184:

  • loadInputFileCallback.m broke when the top level of a model had non-WEC-Sim library blocks
  • writeInputFromBlocks was not writing strings to the input file robustly. The command to write a new input file would break when paths contained "\U" or other special character combos, which was typical when a user selected a file of some kind (e.g. body(1).geometryFile = "C:\Users\name...\geometry\file.stl")

@akeeste akeeste self-assigned this Jan 3, 2024
@akeeste akeeste added the Bug bug in WEC-Sim source, high priority label Jan 3, 2024
@salhus salhus requested a review from kmruehl January 10, 2024 15:36
@akeeste
Copy link
Contributor Author

akeeste commented Jan 10, 2024

writeInputFromBlocks has many lines changed because I updated how the writeLineFromVar function works. This changed each call to writeLineFromVar within writeInputFromBlocks. Each line of the input file must be written using the '%s' notation in fprintf so that strings are written correctly and the line break can still be added.

@akeeste akeeste marked this pull request as draft January 15, 2024 15:24
@akeeste akeeste linked an issue Jan 15, 2024 that may be closed by this pull request
@akeeste
Copy link
Contributor Author

akeeste commented Jan 15, 2024

@kmruehl There was another problem identified with my solution in #1184 . I'll work to make this bugfix more robust this week.

@akeeste akeeste marked this pull request as ready for review January 17, 2024 15:13
@akeeste
Copy link
Contributor Author

akeeste commented Jan 25, 2024

@kmruehl This is now ready for review

@kmruehl kmruehl self-assigned this Jan 31, 2024
@kmruehl kmruehl requested review from MShabara and jleonqu January 31, 2024 15:37
@kmruehl kmruehl assigned MShabara and unassigned kmruehl and akeeste Jan 31, 2024
@kmruehl kmruehl removed their request for review January 31, 2024 15:37
@kmruehl
Copy link
Collaborator

kmruehl commented Feb 28, 2024

@MShabara and @jleonqu this is ready for review

@akeeste
Copy link
Contributor Author

akeeste commented Feb 28, 2024

FYI I know we want to get this doe, but please do not actually merge into main until we get a few things sorted on that branch

Copy link
Contributor

@jleonqu jleonqu left a comment

Choose a reason for hiding this comment

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

@akeeste I was able to test this PR and it works well on my end. I tested this PR in Matlab 2022b and Matlab 2023b.
I tested this PR in a similar way than you in issue #1184

@MShabara
Copy link
Contributor

@akeeste I tested the modifications using MATLAB 2023b and the model works perfectly,
good job!

@MShabara MShabara merged commit 5e65f1f into WEC-Sim:main Feb 28, 2024
@akeeste akeeste deleted the bugfix_runFromSim branch March 20, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug bug in WEC-Sim source, high priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Errors when using WEC-Sim GUI and Run From Simulink features

4 participants