From d265a6983283a29622038a1acd3313ae62ac9876 Mon Sep 17 00:00:00 2001 From: artwhaley Date: Tue, 10 Aug 2021 03:11:58 -0500 Subject: [PATCH 1/2] Add Rotation Features to Docking Ports --- .../src/Services/Parts/DockingPort.cs | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/service/SpaceCenter/src/Services/Parts/DockingPort.cs b/service/SpaceCenter/src/Services/Parts/DockingPort.cs index 7579b217e..9842d30aa 100644 --- a/service/SpaceCenter/src/Services/Parts/DockingPort.cs +++ b/service/SpaceCenter/src/Services/Parts/DockingPort.cs @@ -201,6 +201,48 @@ public bool Shielded { } } + /// + /// Can the docking port use the 1.12 version rotation feature + /// + /// Returns true if the docking port can be commanded to rotate while docked. + /// Otherwise returns false. + /// + [KRPCProperty] + public bool CanRotate + { + get { return port.canRotate; } + } + + /// + /// Maximum Rotation Angle + /// + [KRPCProperty] + public float MaximumRotation + { + get { return port.hardMinMaxLimits.y; } + } + + /// + /// Minimum Rotation Angle + /// + [KRPCProperty] + public float MinimumRotation + { + get { return port.hardMinMaxLimits.x; } + } + + /// + /// Set the rotation target angle + /// + [KRPCProperty] + public float RotationTarget + { + get { return port.targetAngle; } + set { port.targetAngle = value; } + } + + + /// /// The position of the docking port, in the given reference frame. /// From 2def586dd511cca6c3352fcf0773928a8d849cd6 Mon Sep 17 00:00:00 2001 From: artwhaley Date: Tue, 10 Aug 2021 03:31:49 -0500 Subject: [PATCH 2/2] Additional rotation support --- service/SpaceCenter/src/Services/Parts/DockingPort.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/service/SpaceCenter/src/Services/Parts/DockingPort.cs b/service/SpaceCenter/src/Services/Parts/DockingPort.cs index 9842d30aa..25dd72883 100644 --- a/service/SpaceCenter/src/Services/Parts/DockingPort.cs +++ b/service/SpaceCenter/src/Services/Parts/DockingPort.cs @@ -241,7 +241,16 @@ public float RotationTarget set { port.targetAngle = value; } } - + /// + /// Set the Docking Port Rotation as Locked to allow Autostrut to function across joint + /// + [KRPCProperty] + public bool RotationLocked + { + get { return port.nodeIsLocked; } + set { port.nodeIsLocked = value; } + } + /// /// The position of the docking port, in the given reference frame.