mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-29 23:56:29 +02:00
Version 3.0.371
This commit is contained in:
parent
bdb2dec1c1
commit
6d22dbf40b
145 changed files with 2289 additions and 764 deletions
|
@ -20,7 +20,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock
|
|||
/// <param name="tariffDescription">Hold tariff description of bike.</param>
|
||||
public BikeInfo(
|
||||
Bike bike,
|
||||
Drive drive,
|
||||
DriveMutable drive,
|
||||
DataSource dataSource,
|
||||
int lockId,
|
||||
Guid lockGuid,
|
||||
|
@ -65,7 +65,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock
|
|||
/// <param name="dateTimeProvider">Date time provider to calculate remaining time.</param>
|
||||
public BikeInfo(
|
||||
Bike bike,
|
||||
Drive drive,
|
||||
DriveMutable drive,
|
||||
DataSource dataSource,
|
||||
int lockId,
|
||||
Guid lockGuid,
|
||||
|
@ -121,7 +121,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock
|
|||
/// <param name="wheelType"></param>
|
||||
public BikeInfo(
|
||||
Bike bike,
|
||||
Drive drive,
|
||||
DriveMutable drive,
|
||||
DataSource dataSource,
|
||||
int lockId,
|
||||
Guid lockGuid,
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock.Command
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Possible steps of closing a lock.
|
||||
/// Possible states of closing a lock.
|
||||
/// </summary>
|
||||
public enum State
|
||||
{
|
||||
|
@ -182,7 +182,8 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock.Command
|
|||
}
|
||||
}
|
||||
|
||||
// Start query geolocation data.
|
||||
//// Start Action
|
||||
//// Step: Start query geolocation data.
|
||||
Log.ForContext<T>().Debug($"Starting step {Step.StartingQueryingLocation}...");
|
||||
InvokeCurrentStep(Step.StartingQueryingLocation);
|
||||
var ctsLocation = new CancellationTokenSource();
|
||||
|
@ -199,7 +200,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock.Command
|
|||
await InvokeCurrentStateAsync(State.StartGeolocationException, ex.Message);
|
||||
}
|
||||
|
||||
// Close lock.
|
||||
//// Step: Close lock.
|
||||
IGeolocation currentLocation;
|
||||
Log.ForContext<T>().Debug($"Starting step {Step.ClosingLock}...");
|
||||
InvokeCurrentStep(Step.ClosingLock);
|
||||
|
@ -236,7 +237,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock.Command
|
|||
// Signal cts to cancel getting geolocation.
|
||||
ctsLocation.Cancel();
|
||||
|
||||
//// Step: Wait until getting geolocation and stop polling has completed.
|
||||
// Wait until getting geolocation and stop polling has completed.
|
||||
currentLocation = await WaitForPendingTasks(currentLocationTask);
|
||||
|
||||
// Update current state from exception
|
||||
|
@ -256,14 +257,14 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock.Command
|
|||
throw;
|
||||
}
|
||||
|
||||
// Step: Update backend.
|
||||
// Update backend.
|
||||
// Do this even if current lock state is open (lock state must not necessarily be open before try to open, i.e. something undefined between open and closed).
|
||||
await UpdateLockingState(currentLocation, timeStampNow);
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
//// Step: Wait until getting geolocation and stop polling has completed.
|
||||
//// Step: Wait until getting geolocation and stop polling has completed.
|
||||
currentLocation = await WaitForPendingTasks(currentLocationTask);
|
||||
|
||||
bike.LockInfo.State = lockingState?.GetLockingState() ?? LockingState.UnknownDisconnected;
|
||||
|
@ -276,7 +277,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock.Command
|
|||
return;
|
||||
}
|
||||
|
||||
//// Step: Update backend.
|
||||
//// Step: Update backend.
|
||||
await UpdateLockingState(currentLocation, timeStampNow);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,6 +97,8 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock.Command
|
|||
}
|
||||
}
|
||||
|
||||
//// Start Action
|
||||
//// Step: Start query geolocation data.
|
||||
InvokeCurrentStep(Step.StartingQueryLocation);
|
||||
|
||||
// Get geolocation which was requested when closing lock.
|
||||
|
@ -123,7 +125,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock.Command
|
|||
|
||||
await InvokeCurrentStateAsync(State.DisconnetedNoLocationError, "");
|
||||
|
||||
// Disconnect lock.
|
||||
//// Step: Disconnect lock.
|
||||
InvokeCurrentStep(Step.DisconnectingLockOnDisconnectedNoLocationError);
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue