From a7d617e1b864903df0da66632c27f5fe9983363d Mon Sep 17 00:00:00 2001 From: adammada Date: Tue, 26 Nov 2013 20:18:30 +0100 Subject: [PATCH] https://github.com/Nivekk/KOS/issues/271 --- Node.cs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Node.cs b/Node.cs index 72398b0..139cb54 100644 --- a/Node.cs +++ b/Node.cs @@ -84,6 +84,13 @@ public Vector GetBurnVector() return new Vector(nodeRef.GetBurnVector(vesselRef.GetOrbit())); } + public Vector GetPosition() + { + CheckNodeRef(); + + return new Vector(nodeRef.patch.getRelativePositionAtUT(this.UT)); + } + private void updateValues() { // If this node is attached, and the values on the attached node have chaged, I need to reflect that @@ -117,7 +124,20 @@ public override object GetSuffix(string suffixName) if (nodeRef == null) throw new kOSException("Node must be added to flight plan first"); return nodeRef.nextPatch.PeA; } - + else if (suffixName == "APOAPSISETA") + { + if (nodeRef == null) throw new kOSException("Node must be added to flight plan first"); + return nodeRef.nextPatch.timeToAp + UT - Planetarium.GetUniversalTime(); + } + else if (suffixName == "PERIAPSISETA") + { + if (nodeRef == null) throw new kOSException("Node must be added to flight plan first"); + return nodeRef.nextPatch.timeToPe + UT - Planetarium.GetUniversalTime(); + } + else if (suffixName == "POSITION") + { + return GetPosition(); + } return base.GetSuffix(suffixName); }