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

Fixes #132 - Implement ArcGen #210

Merged
merged 9 commits into from
Sep 13, 2023
Merged

Fixes #132 - Implement ArcGen #210

merged 9 commits into from
Sep 13, 2023

Conversation

AliceFord
Copy link
Contributor

@AliceFord AliceFord commented Aug 29, 2023

Fixes #132

Implement the ArcGen algorithm with some improvements. Features:

  • Full circle
  • Circle bounded by start and end points, like in the AIP
  • Automatic radius updating (sometimes the radius listed in the AIP is slightly wrong so it can be automatically fixed)

Full circles with radius and centre:
`;Arc centre N051.29.02.000 W000.36.14.000 radius 1.25`
@AliceFord AliceFord marked this pull request as draft August 29, 2023 12:51
@AliceFord AliceFord changed the title Fixes 132 Fixes #132 - Implement ArcGen Aug 29, 2023
@AliceFord AliceFord marked this pull request as ready for review August 29, 2023 14:41
@AliceFord
Copy link
Contributor Author

Not sure about the testing in SectorDataFileTest, feel like it could be done better, but the rest isn't too bad :)

Copy link
Contributor

@AndyTWF AndyTWF left a comment

Choose a reason for hiding this comment

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

LGTM so far - just some thoughts! :)

tests/CompilerTest/Model/CoordinateTest.cs Outdated Show resolved Hide resolved
/*
* Returns whether or not the line is an arc gen line
*/
public bool IsArcGenLine(string line) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if there's an alternate way to express arcs that don't require them to be comments 🤔 I think if we start to make some comments "special", things could get confusing.

I think we could look at creating a macro expression (I hate macros, but they're great for this), that gets expanded. That way, we don't have this situation where some comments are special.

Perhaps something like @ARC(arc def here)?

For a first pass, we can just parse macros in the parser, but perhaps in the future we can implement something that expands all macros on a line, before we send things over to the parser?

LMK what you think :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was also thinking the syntax of the arcs could be changed, I was just going off of what went into the ArcGen tool. Eventually yeah I could also write a macro expander - I had a look in the rest of the replacers but they were only for options in the file.

@AndyTWF AndyTWF merged commit c01cfce into VATSIM-UK:main Sep 13, 2023
3 checks passed
@github-actions
Copy link

🎉 This PR is included in version 1.16.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement ArcGen
2 participants