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

Allow encoders to be manually defined by ground stations #45

Merged
merged 2 commits into from
Oct 19, 2024

Conversation

Capkirk123
Copy link
Member

Allow encoders to be manually selected by name for ground stations. This will allow Skopos ground stations to select historically accurate encoders rather than being forced to use the default encoders included with RealAntennas.

@Capkirk123 Capkirk123 linked an issue Aug 29, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Aug 29, 2024

Download the artifacts for this pull request:

Comment on lines 34 to 37
public static Encoder Get(string name, int level)
{
return string.IsNullOrEmpty(name) || !All.TryGetValue(name, out Encoder encoder) ? Encoder.GetFromTechLevel(level) : encoder;
}
Copy link

Choose a reason for hiding this comment

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

TBH I would write this as GetByName and then in calling code use GetByName(overrride) ?? GetFromTechLevel(level).

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright rewrote it so the discrimination is done when the function is called.

@@ -27,8 +27,9 @@ public class RealAntenna
public virtual double Bandwidth => DataRate; // RF bandwidth required.
public virtual float AMWTemp { get; set; }
public virtual float Beamwidth => Physics.Beamwidth(Gain);
public string encoderOverride { get; set; }
Copy link

Choose a reason for hiding this comment

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

You should match case with the rest of the code. Also I spot an extra whitespace.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to match the formatting (although I have no idea what virtual means, it still works fine) and I think I removed the whitespace in question.

@siimav siimav merged commit c839ffa into master Oct 19, 2024
3 checks passed
@siimav siimav deleted the Encoderstuff branch October 19, 2024 18:04
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.

Allow encoders to be manually defined (for ground stations)
2 participants