isHome =/= is a ground station, add eventvoid hook to signal when the network updates#70
Conversation
| // Home Stations are directional, but treated as always pointing towards the peer. | ||
| float allbody = rx.ParentNode.isHome ? AllBodyTemps(rx, origin - rx.Position) : AllBodyTemps(rx, rx.ToTarget); | ||
| // Tracking antennas always point towards the peer. | ||
| float allbody = rx.IsTracking ? AllBodyTemps(rx, origin - rx.Position) : AllBodyTemps(rx, rx.ToTarget); |
There was a problem hiding this comment.
Please ensure that all standard (non-Skopos) ground stations will always have isTracking == true
There was a problem hiding this comment.
Ah, it'd be false for the ones that are weak enough to be considered Omni antennas. For all the non-omni antennas associated with ground stations, though, either isHome is defined with no target (so it is considered isTracking), or it's a Skopos station manually defining an empty TARGET {}.
|
The isTracking condition is just that the antenna isn't Omni and the Target is null. Is it correct to assume that omni antennas "point" towards their targets? I will admit I am not too familiar with the physics behind omni antenna.s |
…ing a TARGET node.
| if (config.HasNode("TARGET")) | ||
| Target = Targeting.AntennaTarget.LoadFromConfig(config.GetNode("TARGET"), this); | ||
| else if (Shape != AntennaShape.Omni && (ParentNode == null || !ParentNode.isHome) && !(Target?.Validate() == true) && HighLogic.LoadedSceneHasPlanetarium) | ||
| else if (ParentNode is RACommNode RANode && RANode.isGroundStation) { |
There was a problem hiding this comment.
Should we move this condition to SetDefaultTarget instead (and make the default target TARGET{} for ground stations)?
There was a problem hiding this comment.
I think ParentNode being null is a sign something is broken. Can't participate in the network if you ...don't have a node in the network. Yeah, a validity check probably goes in SetDefaultTarget.
| if (config.HasNode("TARGET")) | ||
| Target = Targeting.AntennaTarget.LoadFromConfig(config.GetNode("TARGET"), this); | ||
| else if (Shape != AntennaShape.Omni && (ParentNode == null || !ParentNode.isHome) && !(Target?.Validate() == true) && HighLogic.LoadedSceneHasPlanetarium) | ||
| else if (ParentNode is RACommNode RANode && RANode.isGroundStation) { |
There was a problem hiding this comment.
I think ParentNode being null is a sign something is broken. Can't participate in the network if you ...don't have a node in the network. Yeah, a validity check probably goes in SetDefaultTarget.
Need to figure this first one out.
It's for sorting the planner window IIRC. Change this one to isGroundStation, there's no reason it should necessarily compute for a science destination. (It's a different sort of awkward to make a super strong Skopos station that won't accept science comms, but that's a distinction for another time.) |
|
Please review all Physics uses of ParentBody != null eg |
|
Antenna planning is broken. Looking into it. |
| if (!(ParentNode is RACommNode)) | ||
| Debug.Log($"{ModTag} {ParentNode?.displayName} is not an RA comm node but has a RealAntenna! Defaulting target for {Name} to null"); |
There was a problem hiding this comment.
I think this should refactor slightly. If you somehow hit this condition, scream loudly and ... set Target to null?
if (!(ParentNode is RACommNode raNode))
Target = null;
else if (raNode.isGroundStation)
Target = null;
else {
...
}
DRVeyl
left a comment
There was a problem hiding this comment.
With this minor exception, this looks good.
Fixes for Skopos, and the hook needed for mockingbirdnest/Skopos#70.
This formally distinguishes between "ground stations" and "homes". Checks that appear to apply to all ground stations (and not just "homes") now check the
isGroundStationflag, which checks ifParentBodyis not null.Two non-trivial usages of
CommNode.isHomeare currently left unmodified:RealAntenna.LoadFromConfigNode: I am not confident that the ParentNode is fully initialised when we call this function.RATools.HighestGainCompatibleDSNAntenna: The function name appears to imply it is intended for "home" antennas, though it is currently unused in the code (?).I don't think replacing the
isHomeusages inPhysics.csactually changed any calculations? When I checked a link with low antenna elevation and high beamwidth (GEO sat to Bering Sea ship), it had no impact on the calculated noise temperature.