-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
Download the artifacts for this pull request: |
public static Encoder Get(string name, int level) | ||
{ | ||
return string.IsNullOrEmpty(name) || !All.TryGetValue(name, out Encoder encoder) ? Encoder.GetFromTechLevel(level) : encoder; | ||
} |
There was a problem hiding this comment.
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)
.
There was a problem hiding this comment.
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; } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.