Skip to content

Commit

Permalink
Add ControlSurface.AuthorityLimiter (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
djungelorm committed Feb 27, 2017
1 parent 2f4d3be commit 8044701
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/order.txt
Expand Up @@ -453,6 +453,7 @@ SpaceCenter.ControlSurface.Part
SpaceCenter.ControlSurface.PitchEnabled
SpaceCenter.ControlSurface.YawEnabled
SpaceCenter.ControlSurface.RollEnabled
SpaceCenter.ControlSurface.AuthorityLimiter
SpaceCenter.ControlSurface.Inverted
SpaceCenter.ControlSurface.Deployed
SpaceCenter.ControlSurface.SurfaceArea
Expand Down
1 change: 1 addition & 0 deletions service/SpaceCenter/CHANGES.txt
Expand Up @@ -7,6 +7,7 @@ v0.3.8
* Fix bug with Part.Rotation (#371)
* Fix bug with Part.BoundingBox (#370)
* Add support for procedural fairings mod http://forum.kerbalspaceprogram.com/index.php?showtopic=36371 (#368)
* Add ControlSurface.AuthorityLimiter (#352)

v0.3.7
* Add custom reference frames (ReferenceFrame.CreateRelative and CreateHybrid) (#252)
Expand Down
11 changes: 10 additions & 1 deletion service/SpaceCenter/src/Services/Parts/ControlSurface.cs
Expand Up @@ -82,6 +82,15 @@ public override int GetHashCode ()
set { controlSurface.ignoreRoll = !value; }
}

/// <summary>
/// The authority limiter for the control surface, which controls how far the control surface will move.
/// </summary>
[KRPCProperty]
public float AuthorityLimiter {
get { return controlSurface.authorityLimiter; }
set { controlSurface.authorityLimiter = value; }
}

/// <summary>
/// Whether the control surface movement is inverted.
/// </summary>
Expand Down Expand Up @@ -120,7 +129,7 @@ public override int GetHashCode ()
}

[SuppressMessage ("Gendarme.Rules.Design.Generic", "DoNotExposeNestedGenericSignaturesRule")]
internal Tuple<Vector3d,Vector3d> AvailableTorqueVectors {
internal Tuple<Vector3d, Vector3d> AvailableTorqueVectors {
get { return controlSurface.GetPotentialTorque (); }
}
}
Expand Down
7 changes: 7 additions & 0 deletions service/SpaceCenter/test/test_parts_control_surface.py
Expand Up @@ -56,6 +56,13 @@ def test_toggle_pyr_enabled(self):
self.assertTrue(self.ctrlsrf.yaw_enabled)
self.assertFalse(self.ctrlsrf.roll_enabled)

def test_authority_limiter(self):
self.assertEqual(100, self.ctrlsrf.authority_limiter)
self.ctrlsrf.authority_limiter = 50
self.assertEqual(50, self.ctrlsrf.authority_limiter)
self.ctrlsrf.authority_limiter = 100
self.assertEqual(100, self.ctrlsrf.authority_limiter)

def test_inverted(self):
self.assertFalse(self.ctrlsrf.inverted)
self.ctrlsrf.inverted = True
Expand Down

0 comments on commit 8044701

Please sign in to comment.