Skip to content

Commit

Permalink
Add defaults to profile and endState (#88)
Browse files Browse the repository at this point in the history
#87 (non-breaking)
  • Loading branch information
tthiery authored Sep 2, 2020
1 parent 1f6198a commit 2ea4db1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions src/SharpBrick.PoweredUp/Devices/AbsoluteMotor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ protected AbsoluteMotor(ILegoWirelessProtocol protocol, byte hubId, byte portId)
/// <param name="absolutePosition">Absolute Position (0 is the position at the start of the motor)</param>
/// <param name="speed">The speed used to move to the absolute position.</param>
/// <param name="maxPower">Maximum Power level used.</param>
/// <param name="endState">After time has expired, either Float, Hold or Brake.</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration</param>
/// <param name="endState">After time has expired, either Float, Hold or Brake.. Defaults to Brake.</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration. Defaults to None.</param>
/// <returns></returns>
public async Task<PortFeedback> GotoPositionAsync(int absolutePosition, sbyte speed, byte maxPower, SpecialSpeed endState, SpeedProfiles profile)
public async Task<PortFeedback> GotoPositionAsync(int absolutePosition, sbyte speed, byte maxPower, SpecialSpeed endState = SpecialSpeed.Brake, SpeedProfiles profile = SpeedProfiles.None)
{
AssertValidSpeed(speed, nameof(speed));
AssertValidMaxPower(maxPower, nameof(maxPower));
Expand Down Expand Up @@ -75,10 +75,10 @@ public async Task<PortFeedback> GotoPositionAsync(int absolutePosition, sbyte sp
/// <param name="absolutePosition2">Absolute Position of motor 2 (0 is the position at the start of the motor)</param>
/// <param name="speed">The speed used to move to the absolute position.</param>
/// <param name="maxPower">Maximum Power level used.</param>
/// <param name="endState">After time has expired, either Float, Hold or Brake.</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration</param>
/// <param name="endState">After time has expired, either Float, Hold or Brake. Defaults to Brake.</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration. Defaults to None.</param>
/// <returns></returns>
public async Task<PortFeedback> GotoPositionAsync(int absolutePosition1, int absolutePosition2, sbyte speed, byte maxPower, SpecialSpeed endState, SpeedProfiles profile)
public async Task<PortFeedback> GotoPositionAsync(int absolutePosition1, int absolutePosition2, sbyte speed, byte maxPower, SpecialSpeed endState = SpecialSpeed.Brake, SpeedProfiles profile = SpeedProfiles.None)
{
AssertValidSpeed(speed, nameof(speed));
AssertValidMaxPower(maxPower, nameof(maxPower));
Expand Down
32 changes: 16 additions & 16 deletions src/SharpBrick.PoweredUp/Devices/TachoMotor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ public async Task<PortFeedback> SetDecelerationTimeAsync(ushort timeInMs, SpeedP
/// - Stop Motor (hold position): 0 (use StartPower for floating and braking)
/// </param>
/// <param name="maxPower">Maximum Power level used.</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration. Defaults to None.</param>
/// <returns></returns>
public async Task<PortFeedback> StartSpeedAsync(sbyte speed, byte maxPower, SpeedProfiles profile)
public async Task<PortFeedback> StartSpeedAsync(sbyte speed, byte maxPower, SpeedProfiles profile = SpeedProfiles.None)
{
AssertValidSpeed(speed, nameof(speed));
AssertValidMaxPower(maxPower, nameof(maxPower));
Expand Down Expand Up @@ -140,9 +140,9 @@ public async Task<PortFeedback> StartSpeedAsync(sbyte speed, byte maxPower, Spee
/// - Stop Motor (hold position): 0 (use StartPower for floating and braking)
/// </param>
/// <param name="maxPower">Maximum Power level used.</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration. Defaults to None.</param>
/// <returns></returns>
public async Task<PortFeedback> StartSpeedAsync(sbyte speedOnMotor1, sbyte speedOnMotor2, byte maxPower, SpeedProfiles profile)
public async Task<PortFeedback> StartSpeedAsync(sbyte speedOnMotor1, sbyte speedOnMotor2, byte maxPower, SpeedProfiles profile = SpeedProfiles.None)
{
AssertValidSpeed(speedOnMotor1, nameof(speedOnMotor1));
AssertValidSpeed(speedOnMotor2, nameof(speedOnMotor2));
Expand Down Expand Up @@ -174,10 +174,10 @@ public async Task<PortFeedback> StartSpeedAsync(sbyte speedOnMotor1, sbyte speed
/// - Stop Motor (hold position): 0 (use StartPower for floating and braking)
/// </param>
/// <param name="maxPower">Maximum Power level used.</param>
/// <param name="endState">After time has expired, either Float, Hold or Brake.</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration</param>
/// <param name="endState">After time has expired, either Float, Hold or Brake. Defaults to Brake.</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration. Defaults to None.</param>
/// <returns></returns>
public async Task<PortFeedback> StartSpeedForTimeAsync(ushort timeInMs, sbyte speed, byte maxPower, SpecialSpeed endState, SpeedProfiles profile)
public async Task<PortFeedback> StartSpeedForTimeAsync(ushort timeInMs, sbyte speed, byte maxPower, SpecialSpeed endState = SpecialSpeed.Brake, SpeedProfiles profile = SpeedProfiles.None)
{
AssertValidSpeed(speed, nameof(speed));
AssertValidMaxPower(maxPower, nameof(maxPower));
Expand Down Expand Up @@ -212,10 +212,10 @@ public async Task<PortFeedback> StartSpeedForTimeAsync(ushort timeInMs, sbyte sp
/// - Stop Motor (hold position): 0 (use StartPower for floating and braking)
/// </param>
/// <param name="maxPower">Maximum Power level used.</param>
/// <param name="endState">After time has expired, either Float, Hold or Brake.</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration</param>
/// <param name="endState">After time has expired, either Float, Hold or Brake. Defaults to Brake.</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration. Defaults to None.</param>
/// <returns></returns>
public async Task<PortFeedback> StartSpeedForTimeAsync(ushort timeInMs, sbyte speedOnMotor1, sbyte speedOnMotor2, byte maxPower, SpecialSpeed endState, SpeedProfiles profile)
public async Task<PortFeedback> StartSpeedForTimeAsync(ushort timeInMs, sbyte speedOnMotor1, sbyte speedOnMotor2, byte maxPower, SpecialSpeed endState = SpecialSpeed.Brake, SpeedProfiles profile = SpeedProfiles.None)
{
AssertValidSpeed(speedOnMotor1, nameof(speedOnMotor1));
AssertValidSpeed(speedOnMotor2, nameof(speedOnMotor2));
Expand Down Expand Up @@ -251,10 +251,10 @@ public async Task<PortFeedback> StartSpeedForTimeAsync(ushort timeInMs, sbyte sp
/// <param name="degrees"></param>
/// <param name="speed"></param>
/// <param name="maxPower">Maximum Power level used.</param>
/// <param name="endState">After time has expired, either Float, Hold or Brake.</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration</param>
/// <param name="endState">After time has expired, either Float, Hold or Brake. Defaults to Brake.</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration. Defaults to None.</param>
/// <returns></returns>
public async Task<PortFeedback> StartSpeedForDegreesAsync(uint degrees, sbyte speed, byte maxPower, SpecialSpeed endState, SpeedProfiles profile)
public async Task<PortFeedback> StartSpeedForDegreesAsync(uint degrees, sbyte speed, byte maxPower, SpecialSpeed endState = SpecialSpeed.Brake, SpeedProfiles profile = SpeedProfiles.None)
{
AssertValidDegrees(degrees, nameof(degrees));
AssertValidSpeed(speed, nameof(speed));
Expand Down Expand Up @@ -289,10 +289,10 @@ public async Task<PortFeedback> StartSpeedForDegreesAsync(uint degrees, sbyte sp
/// <param name="speedOnMotor1"></param>
/// <param name="speedOnMotor2"></param>
/// <param name="maxPower">Maximum Power level used.</param>
/// <param name="endState">After time has expired, either Float, Hold or Brake.</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration</param>
/// <param name="endState">After time has expired, either Float, Hold or Brake. Defaults to Brake.</param>
/// <param name="profile">The speed profiles used (as flags) for acceleration and deceleration. Defaults to None.</param>
/// <returns></returns>
public async Task<PortFeedback> StartSpeedForDegreesAsync(uint degrees, sbyte speedOnMotor1, sbyte speedOnMotor2, byte maxPower, SpecialSpeed endState, SpeedProfiles profile)
public async Task<PortFeedback> StartSpeedForDegreesAsync(uint degrees, sbyte speedOnMotor1, sbyte speedOnMotor2, byte maxPower, SpecialSpeed endState = SpecialSpeed.Brake, SpeedProfiles profile = SpeedProfiles.None)
{
AssertValidDegrees(degrees, nameof(degrees));
AssertValidSpeed(speedOnMotor1, nameof(speedOnMotor1));
Expand Down

0 comments on commit 2ea4db1

Please sign in to comment.