mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-12-22 06:56:25 +01:00
Version 3.0.363
This commit is contained in:
parent
4ff3307997
commit
91d42552c7
212 changed files with 1799 additions and 1318 deletions
17
.vsspell
Normal file
17
.vsspell
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Visual Studio Spell Checker configuration file - [https://github.com/EWSoftware/VSSpellChecker]
|
||||||
|
Do not edit the XML. Use the configuration file editor in Visual Studio to modify the settings. -->
|
||||||
|
<SpellCheckerConfiguration Format="2018.8.16.0">
|
||||||
|
<InheritAdditionalDictionaryFolders>True</InheritAdditionalDictionaryFolders>
|
||||||
|
<AdditionalDictionaryFolders>
|
||||||
|
<Folder>.\\</Folder>
|
||||||
|
</AdditionalDictionaryFolders>
|
||||||
|
<SelectedLanguages />
|
||||||
|
<InheritIgnoredClassifications>True</InheritIgnoredClassifications>
|
||||||
|
<IgnoredClassifications />
|
||||||
|
<InheritIgnoredWords>True</InheritIgnoredWords>
|
||||||
|
<IgnoredWordsFile>IgnoredWords.dic</IgnoredWordsFile>
|
||||||
|
<InheritExclusionExpressions>True</InheritExclusionExpressions>
|
||||||
|
<InheritIgnoredFilePatterns>True</InheritIgnoredFilePatterns>
|
||||||
|
<InheritXmlSettings>True</InheritXmlSettings>
|
||||||
|
</SpellCheckerConfiguration>
|
11
IgnoredWords.dic
Normal file
11
IgnoredWords.dic
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
cts
|
||||||
|
Darmstadt
|
||||||
|
enum
|
||||||
|
Freiburg
|
||||||
|
haveltec
|
||||||
|
javaminister
|
||||||
|
konrad
|
||||||
|
Mein
|
||||||
|
sharee
|
||||||
|
tink
|
||||||
|
xdoc
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.LastenradBayern" android:versionName="3.0.362" android:versionCode="362">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.LastenradBayern" android:versionName="3.0.363" android:versionCode="363">
|
||||||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" />
|
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" />
|
||||||
<!-- Google Maps related permissions -->
|
<!-- Google Maps related permissions -->
|
||||||
<!-- Permission to receive remote notifications from Google Play Services -->
|
<!-- Permission to receive remote notifications from Google Play Services -->
|
||||||
|
|
|
@ -56,8 +56,8 @@
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>LastenradBayern</string>
|
<string>LastenradBayern</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>362</string>
|
<string>363</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>3.0.362</string>
|
<string>3.0.363</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<Frame>
|
<Frame>
|
||||||
<StackLayout>
|
<StackLayout>
|
||||||
<Label FormattedText="{Binding LikeTinkApp}"/>
|
<Label FormattedText="{Binding LikeTinkApp}"/>
|
||||||
<!--- Mail to app- releated support -->
|
<!--- Mail to app- related support -->
|
||||||
<Button
|
<Button
|
||||||
Text="{x:Static resources:AppResources.ActionContactMailAppReleated}"
|
Text="{x:Static resources:AppResources.ActionContactMailAppReleated}"
|
||||||
IsEnabled="{Binding IsSendMailAvailable}"
|
IsEnabled="{Binding IsSendMailAvailable}"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
|
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
|
||||||
using Xamarin.CommunityToolkit.UI.Views;
|
using Xamarin.CommunityToolkit.UI.Views;
|
||||||
using Xamarin.Forms.Xaml;
|
using Xamarin.Forms.Xaml;
|
||||||
|
@ -69,7 +69,7 @@ namespace TINK.View
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds the current chargeing level of the battery entered by user in bars, null if unkonwn.
|
/// Holds the current charging level of the battery entered by user in bars, null if unknown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? CurrentChargeBars { get; set; }
|
public int? CurrentChargeBars { get; set; }
|
||||||
|
|
||||||
|
@ -87,4 +87,4 @@ namespace TINK.View
|
||||||
public string Message { get; set; }
|
public string Message { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
x:Name="EMailEntry"
|
x:Name="EMailEntry"
|
||||||
Text="{Binding MailAddress}"
|
Text="{Binding MailAddress}"
|
||||||
IsEnabled="{Binding IsLoggedOut}"/>
|
IsEnabled="{Binding IsLoggedOut}"/>
|
||||||
<Label Text="{x:Static resources:AppResources.MarkingLoginPasswordLabel}"/>
|
<Label Text="{x:Static resources:AppResources.MarkingLoginPasswordPlaceholder}"/>
|
||||||
<Entry
|
<Entry
|
||||||
Placeholder="{x:Static resources:AppResources.MarkingLoginPasswordPlaceholder}"
|
Placeholder="{x:Static resources:AppResources.MarkingLoginPasswordPlaceholder}"
|
||||||
AutomationId="password_text"
|
AutomationId="password_text"
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace TINK.View.MyBikes
|
||||||
{
|
{
|
||||||
if (m_oViewModel == null)
|
if (m_oViewModel == null)
|
||||||
{
|
{
|
||||||
// View model might be null (Example: Occured when page to querry for location permissions was opened)
|
// View model might be null (Example: Occured when page to query for location permissions was opened)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using TINK.Model.Station;
|
using TINK.Model.Stations;
|
||||||
#if USEFLYOUT
|
#if USEFLYOUT
|
||||||
using TINK.View.MasterDetail;
|
using TINK.View.MasterDetail;
|
||||||
#endif
|
#endif
|
||||||
|
@ -9,12 +9,12 @@ using Xamarin.Forms.Xaml;
|
||||||
namespace TINK.View.Root
|
namespace TINK.View.Root
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Mamages creation of detail pages if a flyout page menu entry is selected.
|
/// Manages creation of detail pages if a flyout page menu entry is selected.
|
||||||
/// Exposes flyout page style navigation which is used by detail pages.
|
/// Exposes flyout page style navigation which is used by detail pages.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Examples of use cases when detail pages do navigation:
|
/// Examples of use cases when detail pages do navigation:
|
||||||
// - switch to map page after succesfully logging in/ logging out
|
// - switch to map page after successfully logging in/ logging out
|
||||||
// - switch to login page form bikes at station page if not yet logged in
|
// - switch to login page form bikes at station page if not yet logged in
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||||
|
@ -29,7 +29,7 @@ namespace TINK.View.Root
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
FlyoutPage.ListView.ItemSelected += OnListViewItemSelected;
|
FlyoutPage.ListView.ItemSelected += OnListViewItemSelected;
|
||||||
|
|
||||||
// Any type of split behaviour conflics with map shifting functionality (assuming FlyoutPage behaves same like MasterDetailPage).
|
// Any type of split behavior conflicts with map shifting functionality (assuming FlyoutPage behaves same like MasterDetailPage).
|
||||||
FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover;
|
FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover;
|
||||||
|
|
||||||
var navigationPage = Detail as NavigationPage;
|
var navigationPage = Detail as NavigationPage;
|
||||||
|
@ -62,7 +62,7 @@ namespace TINK.View.Root
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set selected station to new
|
// Set selected station to new
|
||||||
App.ModelRoot.SelectedStation = new NullStation();
|
App.ModelRoot.SelectedStation = new TINK.Model.Stations.StationNS.NullStation();
|
||||||
|
|
||||||
ShowPage(item.TargetType, item.Title);
|
ShowPage(item.TargetType, item.Title);
|
||||||
|
|
||||||
|
@ -92,4 +92,4 @@ namespace TINK.View.Root
|
||||||
Detail = new NavigationPage(page);
|
Detail = new NavigationPage(page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -441,7 +441,7 @@ namespace TINK.Services.BluetoothLock.BLE
|
||||||
if (authInfo.K_seed.Length != SEEDLENGTH
|
if (authInfo.K_seed.Length != SEEDLENGTH
|
||||||
|| authInfo.K_u.Length <= 0)
|
|| authInfo.K_u.Length <= 0)
|
||||||
{
|
{
|
||||||
throw new AuthKeyException($"Can not authenticate. Invalid seed-/ k-user-lenght {authInfo.K_seed.Length}/ {authInfo.K_u.Length} detected.");
|
throw new AuthKeyException($"Can not authenticate. Invalid seed-/ k-user-length {authInfo.K_seed.Length}/ {authInfo.K_u.Length} detected.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Device.State == Plugin.BLE.Abstractions.DeviceState.Connected)
|
if (Device.State == Plugin.BLE.Abstractions.DeviceState.Connected)
|
||||||
|
@ -551,7 +551,7 @@ namespace TINK.Services.BluetoothLock.BLE
|
||||||
if (authInfo.K_seed.Length != SEEDLENGTH
|
if (authInfo.K_seed.Length != SEEDLENGTH
|
||||||
|| authInfo.K_u.Length <= 0)
|
|| authInfo.K_u.Length <= 0)
|
||||||
{
|
{
|
||||||
throw new AuthKeyException($"Can not authenticate. Invalid seed-/ k-user-lenght {authInfo.K_seed.Length}/ {authInfo.K_u.Length} detected.");
|
throw new AuthKeyException($"Can not authenticate. Invalid seed-/ k-user-length {authInfo.K_seed.Length}/ {authInfo.K_u.Length} detected.");
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.ForContext<LockItBase>().Debug($"Connection state is {deviceState} in context of auth.");
|
Log.ForContext<LockItBase>().Debug($"Connection state is {deviceState} in context of auth.");
|
||||||
|
@ -636,11 +636,11 @@ namespace TINK.Services.BluetoothLock.BLE
|
||||||
cts.CancelAfter(READ_TIMEOUT_MS);
|
cts.CancelAfter(READ_TIMEOUT_MS);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
seedLockEncrypted = await authCharacteristic.ReadAsync(cts.Token); // encrypted seed value (random value) from lock to decypt using k_user
|
seedLockEncrypted = await authCharacteristic.ReadAsync(cts.Token); // encrypted seed value (random value) from lock to decrypt using k_user
|
||||||
}
|
}
|
||||||
catch (System.Exception exception)
|
catch (System.Exception exception)
|
||||||
{
|
{
|
||||||
Log.ForContext<LockItBase>().Error("Retrieveing encrypted random value from lock (seed)(ReadAsync-call) failed.{ReadCharacteristic}{Exception}", ToSerilogString(authCharacteristic), exception);
|
Log.ForContext<LockItBase>().Error("Retrieving encrypted random value from lock (seed)(ReadAsync-call) failed.{ReadCharacteristic}{Exception}", ToSerilogString(authCharacteristic), exception);
|
||||||
throw new System.Exception(string.Format("Can not authenticate. Reading encrypted seed failed. {0}", exception.Message), exception);
|
throw new System.Exception(string.Format("Can not authenticate. Reading encrypted seed failed. {0}", exception.Message), exception);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -648,7 +648,7 @@ namespace TINK.Services.BluetoothLock.BLE
|
||||||
cts.Dispose();
|
cts.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.ForContext<LockItBase>().Debug("Retrieveing encrypted random value from lock (seed)(ReadAsync-call) succeeded.{ReadCharacteristic}{Reading}", ToSerilogString(authCharacteristic), "***");
|
Log.ForContext<LockItBase>().Debug("Retrieving encrypted random value from lock (seed)(ReadAsync-call) succeeded.{ReadCharacteristic}{Reading}", ToSerilogString(authCharacteristic), "***");
|
||||||
|
|
||||||
var crypto = new AuthCryptoHelper(
|
var crypto = new AuthCryptoHelper(
|
||||||
seedLockEncrypted,
|
seedLockEncrypted,
|
||||||
|
@ -701,7 +701,7 @@ namespace TINK.Services.BluetoothLock.BLE
|
||||||
/// <exception cref="BluetoothDisconnectedException">App is not connected to lock.</exception>
|
/// <exception cref="BluetoothDisconnectedException">App is not connected to lock.</exception>
|
||||||
/// <exception cref="CoundntGetCharacteristicException">Getting state characteristic to read from failed.</exception>
|
/// <exception cref="CoundntGetCharacteristicException">Getting state characteristic to read from failed.</exception>
|
||||||
/// <exception cref="Exception">
|
/// <exception cref="Exception">
|
||||||
/// Call not from main thread or unkonwn platform detected or
|
/// Call not from main thread or unknown platform detected or
|
||||||
/// query device state (connected, disconnected, ....) failed for an unknown reason or returned an unexpected value or
|
/// query device state (connected, disconnected, ....) failed for an unknown reason or returned an unexpected value or
|
||||||
/// reading state characteristic failed or reading from characteristic was empty.
|
/// reading state characteristic failed or reading from characteristic was empty.
|
||||||
/// </exception>
|
/// </exception>
|
||||||
|
@ -1044,8 +1044,8 @@ namespace TINK.Services.BluetoothLock.BLE
|
||||||
{
|
{
|
||||||
ActivateLockWriteCounter--;
|
ActivateLockWriteCounter--;
|
||||||
Log.ForContext<LockItBase>().Error(open
|
Log.ForContext<LockItBase>().Error(open
|
||||||
? "Encypting command to open lock failed. {Exception}"
|
? "Encrypting command to open lock failed. {Exception}"
|
||||||
: "Encypting command to close lock failed. {Exception}",
|
: "Encrypting command to close lock failed. {Exception}",
|
||||||
exception);
|
exception);
|
||||||
throw new System.Exception(open
|
throw new System.Exception(open
|
||||||
? $"Can not open lock. Encrypting command to lock/ unlock failed. {exception.Message}"
|
? $"Can not open lock. Encrypting command to lock/ unlock failed. {exception.Message}"
|
||||||
|
@ -1251,6 +1251,6 @@ namespace TINK.Services.BluetoothLock.BLE
|
||||||
=> charcteristic.Id.ToString();
|
=> charcteristic.Id.ToString();
|
||||||
|
|
||||||
private static string ToSerilogString(byte[] byteArray)
|
private static string ToSerilogString(byte[] byteArray)
|
||||||
=> "***"; // For debuging purposes it might be reqired to return string.Join(",", byteArray); Do not log any confidental value in production context.
|
=> "***"; // For debugging purposes it might be required to return string.Join(",", byteArray); Do not log any confidental value in production context.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,7 +162,7 @@ namespace TINK.Services.BluetoothLock.BLE
|
||||||
// - LockitLockingState.Closed
|
// - LockitLockingState.Closed
|
||||||
// - LockitLockingState.Unknown
|
// - LockitLockingState.Unknown
|
||||||
// - LockitLockingState.CouldntOpenBoldBlocked
|
// - LockitLockingState.CouldntOpenBoldBlocked
|
||||||
// Internal error which sould never occure. Lock refuses to open but connection is ok.
|
// Internal error which should never occur. Lock refuses to open but connection is ok.
|
||||||
Log.ForContext<LockItEventBased>().Debug($"Opening lock failed. Unexpected lock state {lockingState.Value.GetLockingState()} detected.");
|
Log.ForContext<LockItEventBased>().Debug($"Opening lock failed. Unexpected lock state {lockingState.Value.GetLockingState()} detected.");
|
||||||
throw new CouldntOpenInconsistentStateExecption(lockingState.Value.GetLockingState());
|
throw new CouldntOpenInconsistentStateExecption(lockingState.Value.GetLockingState());
|
||||||
}
|
}
|
||||||
|
@ -280,7 +280,7 @@ namespace TINK.Services.BluetoothLock.BLE
|
||||||
// - LockitLockingState.Open
|
// - LockitLockingState.Open
|
||||||
// - LockitLockingState.Unknown
|
// - LockitLockingState.Unknown
|
||||||
// - LockitLockingState.CouldntOpenBoldBlocked
|
// - LockitLockingState.CouldntOpenBoldBlocked
|
||||||
// Internal error which sould never occurre. Lock refuses to close but connection is ok.
|
// Internal error which should never occur. Lock refuses to close but connection is ok.
|
||||||
Log.ForContext<LockItEventBased>().Debug($"Opening lock failed. Unexpected lock state {lockingState.Value.GetLockingState()} detected.");
|
Log.ForContext<LockItEventBased>().Debug($"Opening lock failed. Unexpected lock state {lockingState.Value.GetLockingState()} detected.");
|
||||||
throw new CouldntCloseInconsistentStateExecption(lockingState.Value.GetLockingState());
|
throw new CouldntCloseInconsistentStateExecption(lockingState.Value.GetLockingState());
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,7 @@ namespace TINK.Services.BluetoothLock.BLE
|
||||||
// - LockitLockingState.Closed
|
// - LockitLockingState.Closed
|
||||||
// - LockitLockingState.CouldntCloseMoving (should never happen because command open was send)
|
// - LockitLockingState.CouldntCloseMoving (should never happen because command open was send)
|
||||||
// - LockitLockingState.CouldntCloseBoldBlocked (should never happen because command open was send)
|
// - LockitLockingState.CouldntCloseBoldBlocked (should never happen because command open was send)
|
||||||
// Internal error which sould never occure. Lock refuses to open but connection is ok.
|
// Internal error which should never occur. Lock refuses to open but connection is ok.
|
||||||
Log.ForContext<LockItPolling>().Debug($"Opening lock failed. Unexpected lock state {info.State.Value.GetLockingState()} detected.");
|
Log.ForContext<LockItPolling>().Debug($"Opening lock failed. Unexpected lock state {info.State.Value.GetLockingState()} detected.");
|
||||||
throw new CouldntOpenInconsistentStateExecption(info.State.Value.GetLockingState());
|
throw new CouldntOpenInconsistentStateExecption(info.State.Value.GetLockingState());
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ namespace TINK.Services.BluetoothLock.BLE
|
||||||
// - LockitLockingState.Open
|
// - LockitLockingState.Open
|
||||||
// - LockitLockingState.Unknown
|
// - LockitLockingState.Unknown
|
||||||
// - LockitLockingState.CouldntOpenBoldBlocked
|
// - LockitLockingState.CouldntOpenBoldBlocked
|
||||||
// Internal error which sould never occurre. Lock refuses to close but connection is ok.
|
// Internal error which should never occur. Lock refuses to close but connection is ok.
|
||||||
Log.ForContext<LockItPolling>().Debug($"Closing lock failed. Unexpected lock state {info.State.Value.GetLockingState()} detected.");
|
Log.ForContext<LockItPolling>().Debug($"Closing lock failed. Unexpected lock state {info.State.Value.GetLockingState()} detected.");
|
||||||
throw new CouldntCloseInconsistentStateExecption(info.State.Value.GetLockingState());
|
throw new CouldntCloseInconsistentStateExecption(info.State.Value.GetLockingState());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
@ -20,7 +20,7 @@ namespace TINK.Services.BluetoothLock.BLE
|
||||||
Cipher = cipher;
|
Cipher = cipher;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Holds timeout values for series of connecting attemps to a lock or multiple locks. </summary>
|
/// <summary> Holds timeout values for series of connecting attempts to a lock or multiple locks. </summary>
|
||||||
public ITimeOutProvider TimeOut { get; set; }
|
public ITimeOutProvider TimeOut { get; set; }
|
||||||
|
|
||||||
protected ICipher Cipher { get; }
|
protected ICipher Cipher { get; }
|
||||||
|
@ -179,4 +179,4 @@ namespace TINK.Services.BluetoothLock.BLE
|
||||||
return LockingState.UnknownDisconnected;
|
return LockingState.UnknownDisconnected;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
|
@ -8,7 +8,7 @@ namespace TINK.Services.BluetoothLock
|
||||||
{
|
{
|
||||||
public interface ILocksService
|
public interface ILocksService
|
||||||
{
|
{
|
||||||
/// <summary> Holds timeout values for series of connecting attemps to a lock or multiple locks. </summary>
|
/// <summary> Holds timeout values for series of connecting attempts to a lock or multiple locks. </summary>
|
||||||
ITimeOutProvider TimeOut { get; set; }
|
ITimeOutProvider TimeOut { get; set; }
|
||||||
|
|
||||||
/// <summary> Gets lock info for all lock in reach./// </summary>
|
/// <summary> Gets lock info for all lock in reach./// </summary>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.Meinkonrad" android:versionName="3.0.362" android:versionCode="362">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.Meinkonrad" android:versionName="3.0.363" android:versionCode="363">
|
||||||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" />
|
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" />
|
||||||
<!-- Google Maps related permissions -->
|
<!-- Google Maps related permissions -->
|
||||||
<!-- Permission to receive remote notifications from Google Play Services -->
|
<!-- Permission to receive remote notifications from Google Play Services -->
|
||||||
|
|
|
@ -56,8 +56,8 @@
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>Mein konrad</string>
|
<string>Mein konrad</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>362</string>
|
<string>363</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>3.0.362</string>
|
<string>3.0.363</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
@ -30,6 +30,13 @@
|
||||||
<!--Arrow down from line-->
|
<!--Arrow down from line-->
|
||||||
<x:String x:Key="ArrowDown"></x:String>
|
<x:String x:Key="ArrowDown"></x:String>
|
||||||
|
|
||||||
|
<!--Info in Circle-->
|
||||||
|
<x:String x:Key="InfoCircle"></x:String>
|
||||||
|
|
||||||
|
<!--AaAbRideType-->
|
||||||
|
<x:String x:Key="LocationPin"></x:String>
|
||||||
|
<x:String x:Key="ArrowReturnBack"></x:String>
|
||||||
|
|
||||||
<!-- Add more resources here -->
|
<!-- Add more resources here -->
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<!-- Add more resource dictionaries here -->
|
<!-- Add more resource dictionaries here -->
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<ContentView.Resources>
|
<ContentView.Resources>
|
||||||
<conv:StringNotNullOrEmptyToVisibleConverter x:Key="Label_Converter"/>
|
<conv:StringNotNullOrEmptyToVisibleConverter x:Key="Label_Converter"/>
|
||||||
</ContentView.Resources>
|
</ContentView.Resources>
|
||||||
|
|
||||||
<Frame
|
<Frame
|
||||||
Padding="10"
|
Padding="10"
|
||||||
Margin="0,5,0,5"
|
Margin="0,5,0,5"
|
||||||
|
@ -23,75 +24,157 @@
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Padding="10">
|
Padding="10">
|
||||||
|
|
||||||
<!-- Icons, Name, ID -->
|
<!-- Icons, Name, ID, ... -->
|
||||||
<Grid Padding="0,0,5,10"
|
<Grid
|
||||||
|
Padding="0"
|
||||||
|
RowSpacing="15"
|
||||||
|
ColumnSpacing="5"
|
||||||
ColumnDefinitions="Auto,Auto,*"
|
ColumnDefinitions="Auto,Auto,*"
|
||||||
RowDefinitions="Auto,Auto">
|
RowDefinitions="Auto,Auto,Auto">
|
||||||
|
|
||||||
<!-- Icon of the bike -->
|
<!-- Bike image -->
|
||||||
<Image
|
<Image
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.RowSpan="2"
|
Grid.RowSpan="2"
|
||||||
Source="{Binding DisplayedBikeImageSourceString}"
|
VerticalOptions="End"
|
||||||
HeightRequest="60"
|
Source="{Binding DisplayedBikeImageSourceString}"
|
||||||
Aspect="AspectFit"
|
HeightRequest="60"
|
||||||
HorizontalOptions="Start"
|
Aspect="AspectFit"/>
|
||||||
VerticalOptions="End"/>
|
|
||||||
|
|
||||||
<!-- Battery level -->
|
<!-- Battery level image -->
|
||||||
<sharedGui:BarLevelView
|
<sharedGui:BarLevelView
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Grid.Row="1"
|
Grid.Row="0"
|
||||||
Current="{Binding CurrentChargeBars}"
|
Grid.RowSpan="2"
|
||||||
Maximum="{Binding MaxChargeBars}"
|
VerticalOptions="End"
|
||||||
VerticalOptions="End"
|
Current="{Binding CurrentChargeBars}"
|
||||||
IsVisible="{Binding IsBatteryChargeVisible}"/>
|
Maximum="{Binding MaxChargeBars}"
|
||||||
|
IsVisible="{Binding IsBatteryChargeVisible}"/>
|
||||||
|
|
||||||
<!-- Name of the bike -->
|
<!-- Rental state and error -->
|
||||||
<Label
|
<StackLayout
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
Grid.Row="2"
|
||||||
|
Spacing="0"
|
||||||
|
Orientation="Vertical"
|
||||||
|
HorizontalOptions="Start"
|
||||||
|
VerticalOptions="End">
|
||||||
|
|
||||||
|
<!-- Rental state -->
|
||||||
|
<Label
|
||||||
|
Text="{Binding StateText}"
|
||||||
|
FontSize="Small"
|
||||||
|
TextColor="{Binding StateColor}"/>
|
||||||
|
|
||||||
|
<!-- Rental state error info -->
|
||||||
|
<Label
|
||||||
|
Text="{Binding ErrorText}"
|
||||||
|
FontSize="Small"
|
||||||
|
IsVisible="{Binding ErrorText, Converter={StaticResource Label_Converter}}"
|
||||||
|
TextColor="Red"/>
|
||||||
|
|
||||||
|
</StackLayout>
|
||||||
|
|
||||||
|
<!-- Name and Id of the bike -->
|
||||||
|
<StackLayout
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Grid.ColumnSpan="2"
|
Grid.ColumnSpan="2"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
FontAttributes="Bold"
|
Orientation="Vertical"
|
||||||
FontSize="Large"
|
VerticalOptions="Start"
|
||||||
HorizontalTextAlignment="Right"
|
HorizontalOptions="End"
|
||||||
Text="{Binding Name}"/>
|
Spacing="0">
|
||||||
|
|
||||||
<!-- Id of the bike -->
|
<!-- Name -->
|
||||||
<Label
|
<Label
|
||||||
|
FontAttributes="Bold"
|
||||||
|
FontSize="Large"
|
||||||
|
TextColor="Black"
|
||||||
|
HorizontalTextAlignment="Right"
|
||||||
|
Text="{Binding Name}"/>
|
||||||
|
|
||||||
|
<!-- Id -->
|
||||||
|
<Label
|
||||||
|
TextColor="DimGray"
|
||||||
|
FontAttributes="Bold"
|
||||||
|
HorizontalTextAlignment="Right"
|
||||||
|
IsVisible="{Binding DisplayId, Converter={StaticResource Label_Converter}}"
|
||||||
|
Text="{Binding DisplayId}"/>
|
||||||
|
|
||||||
|
</StackLayout>
|
||||||
|
|
||||||
|
<!-- AaAbRideType -->
|
||||||
|
<StackLayout
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
FontAttributes="Bold"
|
Grid.RowSpan="2"
|
||||||
HorizontalTextAlignment="Right"
|
Spacing="0"
|
||||||
IsVisible="{Binding DisplayId, Converter={StaticResource Label_Converter}}"
|
HorizontalOptions="End"
|
||||||
Text="{Binding DisplayId}"/>
|
VerticalOptions="End"
|
||||||
|
IsVisible="{Binding AaRideType}">
|
||||||
|
<StackLayout
|
||||||
|
Orientation="Horizontal"
|
||||||
|
HorizontalOptions="End">
|
||||||
|
<Image>
|
||||||
|
<Image.Source>
|
||||||
|
<FontImageSource
|
||||||
|
Glyph="{StaticResource LocationPin}"
|
||||||
|
Color="Black"
|
||||||
|
FontFamily="FA-S"
|
||||||
|
Size="20"/>
|
||||||
|
</Image.Source>
|
||||||
|
</Image>
|
||||||
|
<Image>
|
||||||
|
<Image.Source>
|
||||||
|
<FontImageSource
|
||||||
|
Glyph="{StaticResource ArrowReturnBack}"
|
||||||
|
Color="Black"
|
||||||
|
FontFamily="FA-S"
|
||||||
|
Size="20"/>
|
||||||
|
</Image.Source>
|
||||||
|
</Image>
|
||||||
|
<Button
|
||||||
|
Command="{Binding ShowRideTypeInfoCommand}"
|
||||||
|
WidthRequest="24"
|
||||||
|
HeightRequest="24"
|
||||||
|
BackgroundColor="Transparent"
|
||||||
|
BorderWidth="0"
|
||||||
|
Padding="0"
|
||||||
|
Margin="5,0,0,0">
|
||||||
|
<Button.ImageSource>
|
||||||
|
<FontImageSource
|
||||||
|
Glyph="{StaticResource InfoCircle}"
|
||||||
|
Color="DimGray"
|
||||||
|
FontFamily="FA-S"
|
||||||
|
Size="20"/>
|
||||||
|
</Button.ImageSource>
|
||||||
|
</Button>
|
||||||
|
</StackLayout>
|
||||||
|
<Label
|
||||||
|
Text= "{Binding StationId}"
|
||||||
|
FontSize="Small"
|
||||||
|
HorizontalOptions="End"/>
|
||||||
|
</StackLayout>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- Rental state -->
|
|
||||||
<Label
|
|
||||||
Text="{Binding StateText}"
|
|
||||||
TextColor="{Binding StateColor}"/>
|
|
||||||
<Label
|
|
||||||
Text="{Binding ErrorText}"
|
|
||||||
IsVisible="{Binding ErrorText, Converter={StaticResource Label_Converter}}"
|
|
||||||
TextColor="Red"/>
|
|
||||||
|
|
||||||
<!-- Buttons -->
|
<!-- Buttons -->
|
||||||
<Button
|
<Button
|
||||||
Text="{Binding ButtonText}"
|
Text="{Binding ButtonText}"
|
||||||
IsVisible="{Binding IsButtonVisible}"
|
IsVisible="{Binding IsButtonVisible}"
|
||||||
Command="{Binding OnButtonClicked}"/>
|
Command="{Binding OnButtonClicked}"/>
|
||||||
<Button
|
<Button
|
||||||
Style="{StaticResource SecondaryButton}"
|
Style="{StaticResource SecondaryButton}"
|
||||||
Text="{Binding LockitButtonText}"
|
Text="{Binding LockitButtonText}"
|
||||||
IsVisible="{Binding IsLockitButtonVisible}"
|
IsVisible="{Binding IsLockitButtonVisible}"
|
||||||
Command="{Binding OnLockitButtonClicked}"/>
|
Command="{Binding OnLockitButtonClicked}"/>
|
||||||
|
|
||||||
<!-- Rental description (tarif name, options and rental info -->
|
<!-- Rental description (tarif name, options and rental info -->
|
||||||
<Grid
|
<Grid
|
||||||
RowSpacing="0"
|
RowSpacing="0"
|
||||||
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}">
|
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<!-- start tarif- entries -->
|
<!-- start tarif- entries -->
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
|
@ -115,19 +198,52 @@
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- start tarif- entries (should be a CollectionView) -->
|
<!-- start tarif- entries (should be a CollectionView) -->
|
||||||
<Label
|
<Label
|
||||||
Text= "{x:Static resources:AppResources.MessageBikesManagementTariffDescriptionTariffHeader}"
|
Text= "{x:Static resources:AppResources.MessageBikesManagementTariffDescriptionTariffHeader}"
|
||||||
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
FontAttributes="Bold"/>
|
FontAttributes="Bold"/>
|
||||||
<Label
|
<Label
|
||||||
Text="{Binding TariffDescription.Header}"
|
Text="{Binding TariffDescription.Header}"
|
||||||
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
FontAttributes="Bold"/>
|
FontAttributes="Bold"/>
|
||||||
|
|
||||||
|
<!--Tracking-->
|
||||||
|
<Grid
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
ColumnDefinitions="*,Auto"
|
||||||
|
IsVisible="{Binding TariffDescription.TrackingInfoText, Converter={StaticResource Label_Converter}}">
|
||||||
|
<Label
|
||||||
|
Text= "Tracking"
|
||||||
|
Grid.Column="0"
|
||||||
|
HorizontalOptions="End"/>
|
||||||
|
<Button
|
||||||
|
Command="{Binding ShowTrackingInfoCommand}"
|
||||||
|
WidthRequest="24"
|
||||||
|
HeightRequest="24"
|
||||||
|
BackgroundColor="Transparent"
|
||||||
|
BorderWidth="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
Padding="0"
|
||||||
|
Margin="0">
|
||||||
|
<Button.ImageSource>
|
||||||
|
<FontImageSource
|
||||||
|
Glyph="{StaticResource InfoCircle}"
|
||||||
|
Color="DimGray"
|
||||||
|
FontFamily="FA-S"
|
||||||
|
Size="20"/>
|
||||||
|
</Button.ImageSource>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label
|
<Label
|
||||||
Text= "{Binding TariffDescription.TarifEntry1.Description}"
|
Text= "{Binding TariffDescription.TarifEntry1.Description}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry1.Description, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry1.Description, Converter={StaticResource Label_Converter}}"
|
||||||
|
@ -136,7 +252,8 @@
|
||||||
Text="{Binding TariffDescription.TarifEntry1.Value}"
|
Text="{Binding TariffDescription.TarifEntry1.Value}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry1.Value, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry1.Value, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="1"/>
|
Grid.Column="1"
|
||||||
|
Grid.ColumnSpan="2"/>
|
||||||
<Label
|
<Label
|
||||||
Text= "{Binding TariffDescription.TarifEntry2.Description}"
|
Text= "{Binding TariffDescription.TarifEntry2.Description}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry2.Description, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry2.Description, Converter={StaticResource Label_Converter}}"
|
||||||
|
@ -145,7 +262,8 @@
|
||||||
Text="{Binding TariffDescription.TarifEntry2.Value}"
|
Text="{Binding TariffDescription.TarifEntry2.Value}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry2.Value, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry2.Value, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Grid.Column="1"/>
|
Grid.Column="1"
|
||||||
|
Grid.ColumnSpan="2"/>
|
||||||
<Label
|
<Label
|
||||||
Text= "{Binding TariffDescription.TarifEntry3.Description}"
|
Text= "{Binding TariffDescription.TarifEntry3.Description}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry3.Description, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry3.Description, Converter={StaticResource Label_Converter}}"
|
||||||
|
@ -154,7 +272,8 @@
|
||||||
Text="{Binding TariffDescription.TarifEntry3.Value}"
|
Text="{Binding TariffDescription.TarifEntry3.Value}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry3.Value, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry3.Value, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
Grid.Column="1"/>
|
Grid.Column="1"
|
||||||
|
Grid.ColumnSpan="2"/>
|
||||||
<Label
|
<Label
|
||||||
Text= "{Binding TariffDescription.TarifEntry4.Description}"
|
Text= "{Binding TariffDescription.TarifEntry4.Description}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry4.Description, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry4.Description, Converter={StaticResource Label_Converter}}"
|
||||||
|
@ -163,7 +282,8 @@
|
||||||
Text="{Binding TariffDescription.TarifEntry4.Value}"
|
Text="{Binding TariffDescription.TarifEntry4.Value}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry4.Value, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry4.Value, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="4"
|
Grid.Row="4"
|
||||||
Grid.Column="1"/>
|
Grid.Column="1"
|
||||||
|
Grid.ColumnSpan="2"/>
|
||||||
<Label
|
<Label
|
||||||
Text= "{Binding TariffDescription.TarifEntry5.Description}"
|
Text= "{Binding TariffDescription.TarifEntry5.Description}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry5.Description, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry5.Description, Converter={StaticResource Label_Converter}}"
|
||||||
|
@ -172,7 +292,8 @@
|
||||||
Text="{Binding TariffDescription.TarifEntry5.Value}"
|
Text="{Binding TariffDescription.TarifEntry5.Value}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry5.Value, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry5.Value, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
Grid.Column="1"/>
|
Grid.Column="1"
|
||||||
|
Grid.ColumnSpan="2"/>
|
||||||
<Label
|
<Label
|
||||||
Text= "{Binding TariffDescription.TarifEntry6.Description}"
|
Text= "{Binding TariffDescription.TarifEntry6.Description}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry6.Description, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry6.Description, Converter={StaticResource Label_Converter}}"
|
||||||
|
@ -181,7 +302,8 @@
|
||||||
Text="{Binding TariffDescription.TarifEntry6.Value}"
|
Text="{Binding TariffDescription.TarifEntry6.Value}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry6.Value, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry6.Value, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="6"
|
Grid.Row="6"
|
||||||
Grid.Column="1"/>
|
Grid.Column="1"
|
||||||
|
Grid.ColumnSpan="2"/>
|
||||||
<Label
|
<Label
|
||||||
Text= "{Binding TariffDescription.TarifEntry7.Description}"
|
Text= "{Binding TariffDescription.TarifEntry7.Description}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry7.Description, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry7.Description, Converter={StaticResource Label_Converter}}"
|
||||||
|
@ -190,7 +312,8 @@
|
||||||
Text="{Binding TariffDescription.TarifEntry7.Value}"
|
Text="{Binding TariffDescription.TarifEntry7.Value}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry7.Value, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry7.Value, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="7"
|
Grid.Row="7"
|
||||||
Grid.Column="1"/>
|
Grid.Column="1"
|
||||||
|
Grid.ColumnSpan="2"/>
|
||||||
<Label
|
<Label
|
||||||
Text= "{Binding TariffDescription.TarifEntry8.Description}"
|
Text= "{Binding TariffDescription.TarifEntry8.Description}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry8.Description, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry8.Description, Converter={StaticResource Label_Converter}}"
|
||||||
|
@ -199,7 +322,8 @@
|
||||||
Text="{Binding TariffDescription.TarifEntry8.Value}"
|
Text="{Binding TariffDescription.TarifEntry8.Value}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry8.Value, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry8.Value, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="8"
|
Grid.Row="8"
|
||||||
Grid.Column="1"/>
|
Grid.Column="1"
|
||||||
|
Grid.ColumnSpan="2"/>
|
||||||
<Label
|
<Label
|
||||||
Text= "{Binding TariffDescription.TarifEntry9.Description}"
|
Text= "{Binding TariffDescription.TarifEntry9.Description}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry9.Description, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry9.Description, Converter={StaticResource Label_Converter}}"
|
||||||
|
@ -208,33 +332,29 @@
|
||||||
Text="{Binding TariffDescription.TarifEntry9.Value}"
|
Text="{Binding TariffDescription.TarifEntry9.Value}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry9.Value, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry9.Value, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="9"
|
Grid.Row="9"
|
||||||
Grid.Column="1"/>
|
Grid.Column="1"
|
||||||
|
Grid.ColumnSpan="2"/>
|
||||||
<!-- start tarif- entries (should be a CollectionView) -->
|
<!-- start tarif- entries (should be a CollectionView) -->
|
||||||
<Label
|
<Label
|
||||||
Text= "{Binding TariffDescription.InfoEntry1}"
|
Text= "{Binding TariffDescription.InfoEntry1}"
|
||||||
IsVisible="{Binding TariffDescription.InfoEntry1, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.InfoEntry1, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="10"
|
Grid.Row="10"
|
||||||
Grid.ColumnSpan="2"/>
|
Grid.ColumnSpan="3"/>
|
||||||
<Label
|
<Label
|
||||||
Text= "{Binding TariffDescription.InfoEntry2}"
|
Text= "{Binding TariffDescription.InfoEntry2}"
|
||||||
IsVisible="{Binding TariffDescription.InfoEntry2, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.InfoEntry2, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="11"
|
Grid.Row="11"
|
||||||
Grid.ColumnSpan="2"/>
|
Grid.ColumnSpan="3"/>
|
||||||
<Label
|
<Label
|
||||||
Text= "{Binding TariffDescription.InfoEntry3}"
|
Text= "{Binding TariffDescription.InfoEntry3}"
|
||||||
IsVisible="{Binding TariffDescription.InfoEntry3, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.InfoEntry3, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="12"
|
Grid.Row="12"
|
||||||
Grid.ColumnSpan="2"/>
|
Grid.ColumnSpan="3"/>
|
||||||
<Label
|
<Label
|
||||||
Text= "{Binding TariffDescription.InfoEntry4}"
|
Text= "{Binding TariffDescription.InfoEntry4}"
|
||||||
IsVisible="{Binding TariffDescription.InfoEntry4, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.InfoEntry4, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="13"
|
Grid.Row="13"
|
||||||
Grid.ColumnSpan="2"/>
|
Grid.ColumnSpan="3"/>
|
||||||
<Label
|
|
||||||
Text= "{Binding TariffDescription.TrackingInfoText}"
|
|
||||||
IsVisible="{Binding TariffDescription.TrackingInfoText, Converter={StaticResource Label_Converter}}"
|
|
||||||
Grid.Row="14"
|
|
||||||
Grid.ColumnSpan="2"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:conv="clr-namespace:TINK.View"
|
xmlns:conv="clr-namespace:TINK.View"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
<Frame>
|
<Frame>
|
||||||
<StackLayout>
|
<StackLayout>
|
||||||
<Label FormattedText="{Binding LikeTinkApp}"/>
|
<Label FormattedText="{Binding LikeTinkApp}"/>
|
||||||
<!--- Mail to app- releated support -->
|
<!--- Mail to app- related support -->
|
||||||
<Button
|
<Button
|
||||||
Text="{x:Static resources:AppResources.ActionContactMailAppReleated}"
|
Text="{x:Static resources:AppResources.ActionContactMailAppReleated}"
|
||||||
IsEnabled="{Binding IsSendMailAvailable}"
|
IsEnabled="{Binding IsSendMailAvailable}"
|
||||||
|
@ -90,4 +90,4 @@
|
||||||
</Frame>
|
</Frame>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</ContentPage.Content>
|
</ContentPage.Content>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
|
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
|
||||||
using Xamarin.CommunityToolkit.UI.Views;
|
using Xamarin.CommunityToolkit.UI.Views;
|
||||||
using Xamarin.Forms.Xaml;
|
using Xamarin.Forms.Xaml;
|
||||||
|
@ -70,7 +70,7 @@ namespace TINK.View
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds the current chargeing level of the battery entered by user in bars, null if unkonwn.
|
/// Holds the current charging level of the battery entered by user in bars, null if unknown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? CurrentChargeBars { get; set; }
|
public int? CurrentChargeBars { get; set; }
|
||||||
|
|
||||||
|
@ -88,4 +88,4 @@ namespace TINK.View
|
||||||
public string Message { get; set; }
|
public string Message { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace TINK.View.MyBikes
|
||||||
{
|
{
|
||||||
if (m_oViewModel == null)
|
if (m_oViewModel == null)
|
||||||
{
|
{
|
||||||
// View model might be null (Example: Occured when page to querry for location permissions was opened)
|
// View model might be null (Example: Occured when page to query for location permissions was opened)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using TINK.Model.Station;
|
using TINK.Model.Stations;
|
||||||
#if USEFLYOUT
|
#if USEFLYOUT
|
||||||
using TINK.View.MasterDetail;
|
using TINK.View.MasterDetail;
|
||||||
#endif
|
#endif
|
||||||
|
@ -9,12 +9,12 @@ using Xamarin.Forms.Xaml;
|
||||||
namespace TINK.View.Root
|
namespace TINK.View.Root
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Mamages creation of detail pages if a flyout page menu entry is selected.
|
/// Manages creation of detail pages if a flyout page menu entry is selected.
|
||||||
/// Exposes flyout page style navigation which is used by detail pages.
|
/// Exposes flyout page style navigation which is used by detail pages.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Examples of use cases when detail pages do navigation:
|
/// Examples of use cases when detail pages do navigation:
|
||||||
// - switch to map page after succesfully logging in/ logging out
|
// - switch to map page after successfully logging in/ logging out
|
||||||
// - switch to login page form bikes at station page if not yet logged in
|
// - switch to login page form bikes at station page if not yet logged in
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||||
|
@ -29,7 +29,7 @@ namespace TINK.View.Root
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
FlyoutPage.ListView.ItemSelected += OnListViewItemSelected;
|
FlyoutPage.ListView.ItemSelected += OnListViewItemSelected;
|
||||||
|
|
||||||
// Any type of split behaviour conflics with map shifting functionality (assuming FlyoutPage behaves same like MasterDetailPage).
|
// Any type of split behavior conflics with map shifting functionality (assuming FlyoutPage behaves same like MasterDetailPage).
|
||||||
FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover;
|
FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover;
|
||||||
|
|
||||||
var navigationPage = Detail as NavigationPage;
|
var navigationPage = Detail as NavigationPage;
|
||||||
|
@ -62,7 +62,7 @@ namespace TINK.View.Root
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set selected station to new
|
// Set selected station to new
|
||||||
App.ModelRoot.SelectedStation = new NullStation();
|
App.ModelRoot.SelectedStation = new TINK.Model.Stations.StationNS.NullStation();
|
||||||
|
|
||||||
ShowPage(item.TargetType, item.Title);
|
ShowPage(item.TargetType, item.Title);
|
||||||
|
|
||||||
|
@ -92,4 +92,4 @@ namespace TINK.View.Root
|
||||||
Detail = new NavigationPage(page);
|
Detail = new NavigationPage(page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1
TINK.sln
1
TINK.sln
|
@ -46,6 +46,7 @@ EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D5B69C6F-3413-4773-923E-21A65B21C3A3}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D5B69C6F-3413-4773-923E-21A65B21C3A3}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
.editorconfig = .editorconfig
|
.editorconfig = .editorconfig
|
||||||
|
.vsspell = .vsspell
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.hauffware.sharee" android:versionName="3.0.362" android:versionCode="362">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.hauffware.sharee" android:versionName="3.0.363" android:versionCode="363">
|
||||||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" />
|
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" />
|
||||||
<!-- Google Maps related permissions -->
|
<!-- Google Maps related permissions -->
|
||||||
<!-- Permission to receive remote notifications from Google Play Services -->
|
<!-- Permission to receive remote notifications from Google Play Services -->
|
||||||
|
|
|
@ -56,8 +56,8 @@
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>sharee.bike</string>
|
<string>sharee.bike</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>362</string>
|
<string>363</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>3.0.362</string>
|
<string>3.0.363</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
@ -32,7 +32,11 @@
|
||||||
|
|
||||||
<!--Info in Circle-->
|
<!--Info in Circle-->
|
||||||
<x:String x:Key="InfoCircle"></x:String>
|
<x:String x:Key="InfoCircle"></x:String>
|
||||||
|
|
||||||
|
<!--AaAbRideType-->
|
||||||
|
<x:String x:Key="LocationPin"></x:String>
|
||||||
|
<x:String x:Key="ArrowReturnBack"></x:String>
|
||||||
|
|
||||||
<!-- Add more resources here -->
|
<!-- Add more resources here -->
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<!-- Add more resource dictionaries here -->
|
<!-- Add more resource dictionaries here -->
|
||||||
|
|
|
@ -25,77 +25,158 @@
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Padding="10">
|
Padding="10">
|
||||||
|
|
||||||
<!-- Icons, Name, ID -->
|
<!-- Icons, Name, ID, ... -->
|
||||||
<Grid Padding="0,0,5,10"
|
<Grid
|
||||||
|
Padding="0"
|
||||||
|
RowSpacing="15"
|
||||||
|
ColumnSpacing="5"
|
||||||
ColumnDefinitions="Auto,Auto,*"
|
ColumnDefinitions="Auto,Auto,*"
|
||||||
RowDefinitions="Auto,Auto">
|
RowDefinitions="Auto,Auto,Auto">
|
||||||
|
|
||||||
<!-- Icon of the bike -->
|
<!-- Bike image -->
|
||||||
<Image
|
<Image
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.RowSpan="2"
|
Grid.RowSpan="2"
|
||||||
Source="{Binding DisplayedBikeImageSourceString}"
|
VerticalOptions="End"
|
||||||
HeightRequest="60"
|
Source="{Binding DisplayedBikeImageSourceString}"
|
||||||
Aspect="AspectFit"
|
HeightRequest="60"
|
||||||
HorizontalOptions="Start"
|
Aspect="AspectFit"/>
|
||||||
VerticalOptions="End"/>
|
|
||||||
|
|
||||||
<!-- Battery level -->
|
<!-- Battery level image -->
|
||||||
<sharedGui:BarLevelView
|
<sharedGui:BarLevelView
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Grid.Row="1"
|
Grid.Row="0"
|
||||||
Current="{Binding CurrentChargeBars}"
|
Grid.RowSpan="2"
|
||||||
Maximum="{Binding MaxChargeBars}"
|
VerticalOptions="End"
|
||||||
VerticalOptions="End"
|
Current="{Binding CurrentChargeBars}"
|
||||||
IsVisible="{Binding IsBatteryChargeVisible}"/>
|
Maximum="{Binding MaxChargeBars}"
|
||||||
|
IsVisible="{Binding IsBatteryChargeVisible}"/>
|
||||||
|
|
||||||
<!-- Name of the bike -->
|
<!-- Rental state and error -->
|
||||||
<Label
|
<StackLayout
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
Grid.Row="2"
|
||||||
|
Spacing="0"
|
||||||
|
Orientation="Vertical"
|
||||||
|
HorizontalOptions="Start"
|
||||||
|
VerticalOptions="End">
|
||||||
|
|
||||||
|
<!-- Rental state -->
|
||||||
|
<Label
|
||||||
|
Text="{Binding StateText}"
|
||||||
|
FontSize="Small"
|
||||||
|
TextColor="{Binding StateColor}"/>
|
||||||
|
|
||||||
|
<!-- Rental state error info -->
|
||||||
|
<Label
|
||||||
|
Text="{Binding ErrorText}"
|
||||||
|
FontSize="Small"
|
||||||
|
IsVisible="{Binding ErrorText, Converter={StaticResource Label_Converter}}"
|
||||||
|
TextColor="Red"/>
|
||||||
|
|
||||||
|
</StackLayout>
|
||||||
|
|
||||||
|
<!-- Name and Id of the bike -->
|
||||||
|
<StackLayout
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Grid.ColumnSpan="2"
|
Grid.ColumnSpan="2"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
FontAttributes="Bold"
|
Orientation="Vertical"
|
||||||
FontSize="Large"
|
VerticalOptions="Start"
|
||||||
HorizontalTextAlignment="Right"
|
HorizontalOptions="End"
|
||||||
Text="{Binding Name}"/>
|
Spacing="0">
|
||||||
|
|
||||||
|
<!-- Name -->
|
||||||
|
<Label
|
||||||
|
FontAttributes="Bold"
|
||||||
|
FontSize="Large"
|
||||||
|
TextColor="Black"
|
||||||
|
HorizontalTextAlignment="Right"
|
||||||
|
Text="{Binding Name}"/>
|
||||||
|
|
||||||
<!-- Id of the bike -->
|
<!-- Id -->
|
||||||
<Label
|
<Label
|
||||||
|
TextColor="DimGray"
|
||||||
|
FontAttributes="Bold"
|
||||||
|
HorizontalTextAlignment="Right"
|
||||||
|
IsVisible="{Binding DisplayId, Converter={StaticResource Label_Converter}}"
|
||||||
|
Text="{Binding DisplayId}"/>
|
||||||
|
|
||||||
|
</StackLayout>
|
||||||
|
|
||||||
|
<!-- AaAbRideType -->
|
||||||
|
<StackLayout
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
FontAttributes="Bold"
|
Grid.RowSpan="2"
|
||||||
HorizontalTextAlignment="Right"
|
Spacing="0"
|
||||||
IsVisible="{Binding DisplayId, Converter={StaticResource Label_Converter}}"
|
HorizontalOptions="End"
|
||||||
Text="{Binding DisplayId}"/>
|
VerticalOptions="End"
|
||||||
|
IsVisible="{Binding AaRideType}">
|
||||||
|
<StackLayout
|
||||||
|
Orientation="Horizontal"
|
||||||
|
HorizontalOptions="End">
|
||||||
|
<Image>
|
||||||
|
<Image.Source>
|
||||||
|
<FontImageSource
|
||||||
|
Glyph="{StaticResource LocationPin}"
|
||||||
|
Color="Black"
|
||||||
|
FontFamily="FA-S"
|
||||||
|
Size="20"/>
|
||||||
|
</Image.Source>
|
||||||
|
</Image>
|
||||||
|
<Image>
|
||||||
|
<Image.Source>
|
||||||
|
<FontImageSource
|
||||||
|
Glyph="{StaticResource ArrowReturnBack}"
|
||||||
|
Color="Black"
|
||||||
|
FontFamily="FA-S"
|
||||||
|
Size="20"/>
|
||||||
|
</Image.Source>
|
||||||
|
</Image>
|
||||||
|
<Button
|
||||||
|
Command="{Binding ShowRideTypeInfoCommand}"
|
||||||
|
WidthRequest="24"
|
||||||
|
HeightRequest="24"
|
||||||
|
BackgroundColor="Transparent"
|
||||||
|
BorderWidth="0"
|
||||||
|
Padding="0"
|
||||||
|
Margin="5,0,0,0">
|
||||||
|
<Button.ImageSource>
|
||||||
|
<FontImageSource
|
||||||
|
Glyph="{StaticResource InfoCircle}"
|
||||||
|
Color="DimGray"
|
||||||
|
FontFamily="FA-S"
|
||||||
|
Size="20"/>
|
||||||
|
</Button.ImageSource>
|
||||||
|
</Button>
|
||||||
|
</StackLayout>
|
||||||
|
<Label
|
||||||
|
Text= "{Binding StationId}"
|
||||||
|
FontSize="Small"
|
||||||
|
HorizontalOptions="End"/>
|
||||||
|
</StackLayout>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- Rental state -->
|
<!-- Buttons -->
|
||||||
<Label
|
<Button
|
||||||
Text="{Binding StateText}"
|
Text="{Binding ButtonText}"
|
||||||
TextColor="{Binding StateColor}"/>
|
IsVisible="{Binding IsButtonVisible}"
|
||||||
<Label
|
Command="{Binding OnButtonClicked}"/>
|
||||||
Text="{Binding ErrorText}"
|
<Button
|
||||||
IsVisible="{Binding ErrorText, Converter={StaticResource Label_Converter}}"
|
Style="{StaticResource SecondaryButton}"
|
||||||
TextColor="Red"/>
|
Text="{Binding LockitButtonText}"
|
||||||
|
IsVisible="{Binding IsLockitButtonVisible}"
|
||||||
|
Command="{Binding OnLockitButtonClicked}"/>
|
||||||
|
|
||||||
<!-- Buttons -->
|
<!-- Rental description (tarif name, options and rental info -->
|
||||||
<Button
|
<Grid
|
||||||
Text="{Binding ButtonText}"
|
RowSpacing="0"
|
||||||
IsVisible="{Binding IsButtonVisible}"
|
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}">
|
||||||
Command="{Binding OnButtonClicked}"/>
|
<Grid.RowDefinitions>
|
||||||
<Button
|
|
||||||
Style="{StaticResource SecondaryButton}"
|
|
||||||
Text="{Binding LockitButtonText}"
|
|
||||||
IsVisible="{Binding IsLockitButtonVisible}"
|
|
||||||
Command="{Binding OnLockitButtonClicked}"/>
|
|
||||||
|
|
||||||
<!-- Rental description (tarif name, options and rental info -->
|
|
||||||
<Grid
|
|
||||||
RowSpacing="0"
|
|
||||||
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<!-- start tarif- entries -->
|
<!-- start tarif- entries -->
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
|
@ -113,59 +194,58 @@
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- start tarif- entries (should be a CollectionView) -->
|
<!-- start tarif- entries (should be a CollectionView) -->
|
||||||
<Label
|
<Label
|
||||||
Text= "{x:Static resources:AppResources.MessageBikesManagementTariffDescriptionTariffHeader}"
|
Text= "{x:Static resources:AppResources.MessageBikesManagementTariffDescriptionTariffHeader}"
|
||||||
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
FontAttributes="Bold"/>
|
FontAttributes="Bold"/>
|
||||||
<Label
|
<Label
|
||||||
Text="{Binding TariffDescription.Header}"
|
Text="{Binding TariffDescription.Header}"
|
||||||
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.Column="1"
|
|
||||||
FontAttributes="Bold"/>
|
|
||||||
|
|
||||||
<!--Tracking-->
|
|
||||||
<Grid
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="1"
|
|
||||||
Grid.ColumnSpan="2"
|
|
||||||
ColumnDefinitions="*,Auto"
|
|
||||||
IsVisible="{Binding TariffDescription.TrackingInfoText, Converter={StaticResource Label_Converter}}">
|
|
||||||
<Label
|
|
||||||
Text= "Tracking"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
Grid.Column="0"
|
|
||||||
HorizontalOptions="End"/>
|
|
||||||
<Button
|
|
||||||
Command="{Binding ShowTrackingInfoCommand}"
|
|
||||||
WidthRequest="24"
|
|
||||||
HeightRequest="24"
|
|
||||||
BackgroundColor="Transparent"
|
|
||||||
BorderWidth="0"
|
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Padding="0"
|
FontAttributes="Bold"/>
|
||||||
Margin="0">
|
|
||||||
<Button.ImageSource>
|
|
||||||
<FontImageSource
|
|
||||||
Glyph="{StaticResource InfoCircle}"
|
|
||||||
Color="DimGray"
|
|
||||||
FontFamily="FA-S"
|
|
||||||
Size="20"/>
|
|
||||||
</Button.ImageSource>
|
|
||||||
</Button>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
|
<!--Tracking-->
|
||||||
|
<Grid
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
ColumnDefinitions="*,Auto"
|
||||||
|
IsVisible="{Binding TariffDescription.TrackingInfoText, Converter={StaticResource Label_Converter}}">
|
||||||
<Label
|
<Label
|
||||||
|
Text= "Tracking"
|
||||||
|
Grid.Column="0"
|
||||||
|
HorizontalOptions="End"/>
|
||||||
|
<Button
|
||||||
|
Command="{Binding ShowTrackingInfoCommand}"
|
||||||
|
WidthRequest="24"
|
||||||
|
HeightRequest="24"
|
||||||
|
BackgroundColor="Transparent"
|
||||||
|
BorderWidth="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
Padding="0"
|
||||||
|
Margin="0">
|
||||||
|
<Button.ImageSource>
|
||||||
|
<FontImageSource
|
||||||
|
Glyph="{StaticResource InfoCircle}"
|
||||||
|
Color="DimGray"
|
||||||
|
FontFamily="FA-S"
|
||||||
|
Size="20"/>
|
||||||
|
</Button.ImageSource>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Label
|
||||||
Text= "{Binding TariffDescription.TarifEntry1.Description}"
|
Text= "{Binding TariffDescription.TarifEntry1.Description}"
|
||||||
IsVisible="{Binding TariffDescription.TarifEntry1.Description, Converter={StaticResource Label_Converter}}"
|
IsVisible="{Binding TariffDescription.TarifEntry1.Description, Converter={StaticResource Label_Converter}}"
|
||||||
Grid.Row="1"/>
|
Grid.Row="1"/>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:conv="clr-namespace:TINK.View"
|
xmlns:conv="clr-namespace:TINK.View"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
<Frame>
|
<Frame>
|
||||||
<StackLayout>
|
<StackLayout>
|
||||||
<Label FormattedText="{Binding LikeTinkApp}"/>
|
<Label FormattedText="{Binding LikeTinkApp}"/>
|
||||||
<!--- Mail to app- releated support -->
|
<!--- Mail to app- related support -->
|
||||||
<Button
|
<Button
|
||||||
Text="{x:Static resources:AppResources.ActionContactMailAppReleated}"
|
Text="{x:Static resources:AppResources.ActionContactMailAppReleated}"
|
||||||
IsEnabled="{Binding IsSendMailAvailable}"
|
IsEnabled="{Binding IsSendMailAvailable}"
|
||||||
|
@ -89,4 +89,4 @@
|
||||||
</Frame>
|
</Frame>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</ContentPage.Content>
|
</ContentPage.Content>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
|
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
|
||||||
using Xamarin.CommunityToolkit.UI.Views;
|
using Xamarin.CommunityToolkit.UI.Views;
|
||||||
using Xamarin.Forms.Xaml;
|
using Xamarin.Forms.Xaml;
|
||||||
|
@ -69,7 +69,7 @@ namespace TINK.View
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds the current chargeing level of the battery entered by user in bars, null if unkonwn.
|
/// Holds the current charging level of the battery entered by user in bars, null if unknown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? CurrentChargeBars { get; set; }
|
public int? CurrentChargeBars { get; set; }
|
||||||
|
|
||||||
|
@ -87,4 +87,4 @@ namespace TINK.View
|
||||||
public string Message { get; set; }
|
public string Message { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace TINK.View.MyBikes
|
||||||
{
|
{
|
||||||
if (m_oViewModel == null)
|
if (m_oViewModel == null)
|
||||||
{
|
{
|
||||||
// View model might be null (Example: Occured when page to querry for location permissions was opened)
|
// View model might be null (Example: Occured when page to query for location permissions was opened)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using TINK.Model.Station;
|
using TINK.Model.Stations;
|
||||||
#if USEFLYOUT
|
#if USEFLYOUT
|
||||||
using TINK.View.MasterDetail;
|
using TINK.View.MasterDetail;
|
||||||
#endif
|
#endif
|
||||||
|
@ -9,12 +9,12 @@ using Xamarin.Forms.Xaml;
|
||||||
namespace TINK.View.Root
|
namespace TINK.View.Root
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Mamages creation of detail pages if a flyout page menu entry is selected.
|
/// Manages creation of detail pages if a flyout page menu entry is selected.
|
||||||
/// Exposes flyout page style navigation which is used by detail pages.
|
/// Exposes flyout page style navigation which is used by detail pages.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Examples of use cases when detail pages do navigation:
|
/// Examples of use cases when detail pages do navigation:
|
||||||
// - switch to map page after succesfully logging in/ logging out
|
// - switch to map page after successfully logging in/ logging out
|
||||||
// - switch to login page form bikes at station page if not yet logged in
|
// - switch to login page form bikes at station page if not yet logged in
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||||
|
@ -29,7 +29,7 @@ namespace TINK.View.Root
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
FlyoutPage.ListView.ItemSelected += OnListViewItemSelected;
|
FlyoutPage.ListView.ItemSelected += OnListViewItemSelected;
|
||||||
|
|
||||||
// Any type of split behaviour conflics with map shifting functionality (assuming FlyoutPage behaves same like MasterDetailPage).
|
// Any type of split behavior conflics with map shifting functionality (assuming FlyoutPage behaves same like MasterDetailPage).
|
||||||
FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover;
|
FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover;
|
||||||
|
|
||||||
var navigationPage = Detail as NavigationPage;
|
var navigationPage = Detail as NavigationPage;
|
||||||
|
@ -62,7 +62,7 @@ namespace TINK.View.Root
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set selected station to new
|
// Set selected station to new
|
||||||
App.ModelRoot.SelectedStation = new NullStation();
|
App.ModelRoot.SelectedStation = new TINK.Model.Stations.StationNS.NullStation();
|
||||||
|
|
||||||
ShowPage(item.TargetType, item.Title);
|
ShowPage(item.TargetType, item.Title);
|
||||||
|
|
||||||
|
@ -92,4 +92,4 @@ namespace TINK.View.Root
|
||||||
Detail = new NavigationPage(page);
|
Detail = new NavigationPage(page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using TINK.Model.Station;
|
using TINK.Model.Stations.StationNS;
|
||||||
using BikeInfo = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfo;
|
using BikeInfo = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfo;
|
||||||
using BikeInfoMutable = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfoMutable;
|
using BikeInfoMutable = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfoMutable;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ namespace TINK.Model.Bikes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="bikesAll"> Object holding bikes info from copri to update from. Holds station id but not station name.</param>
|
/// <param name="bikesAll"> Object holding bikes info from copri to update from. Holds station id but not station name.</param>
|
||||||
/// <param name="stations"> All stations to get station names from.</param>
|
/// <param name="stations"> All stations to get station names from.</param>
|
||||||
/// <param name="p_oDateTimeProvider">Provices date time information.</param>
|
/// <param name="p_oDateTimeProvider">Provides date time information.</param>
|
||||||
public void Update(
|
public void Update(
|
||||||
IEnumerable<BikeInfo> bikesAll,
|
IEnumerable<BikeInfo> bikesAll,
|
||||||
IEnumerable<IStation> stations)
|
IEnumerable<IStation> stations)
|
||||||
|
@ -74,18 +74,18 @@ namespace TINK.Model.Bikes
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a new bike to collecion of bike.
|
/// Adds a new bike to collection of bike.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="newBike">New bike to add.</param>
|
/// <param name="newBike">New bike to add.</param>
|
||||||
/// <exception cref="Exception">Thrown if bike is not unique.</exception>
|
/// <exception cref="Exception">Thrown if bike is not unique.</exception>
|
||||||
public new void Add(BikeInfoMutable newBike)
|
public new void Add(BikeInfoMutable newBike)
|
||||||
{
|
{
|
||||||
// Ensure that bike id of new bike is is unique
|
// Ensure that bike id of new bike is unique
|
||||||
foreach (BikeInfoMutable bike in Items)
|
foreach (BikeInfoMutable bike in Items)
|
||||||
{
|
{
|
||||||
if (bike.Id == newBike.Id)
|
if (bike.Id == newBike.Id)
|
||||||
{
|
{
|
||||||
throw new Exception(string.Format("Can not add bike with {0} to collection ob bike. Id is not unnique.", newBike));
|
throw new Exception(string.Format("Can not add bike with {0} to collection ob bike. Id is not unique.", newBike));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ namespace TINK.Model.Bikes
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Bike selected by user for regerving or cancel reservation.
|
/// Bike selected by user for reserving or cancel reservation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public BikeInfoMutable SelectedBike
|
public BikeInfoMutable SelectedBike
|
||||||
{
|
{
|
||||||
|
@ -115,7 +115,7 @@ namespace TINK.Model.Bikes
|
||||||
=> this.FirstOrDefault(bike => bike.Id == id);
|
=> this.FirstOrDefault(bike => bike.Id == id);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deteermines whether a bike by given key exists.
|
/// Determines whether a bike by given key exists.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="p_strKey">Key to check.</param>
|
/// <param name="p_strKey">Key to check.</param>
|
||||||
/// <returns>True if bike exists.</returns>
|
/// <returns>True if bike exists.</returns>
|
||||||
|
|
|
@ -6,7 +6,7 @@ using TINK.Model.State;
|
||||||
|
|
||||||
namespace TINK.Model.Bikes.BikeInfoNS.BC
|
namespace TINK.Model.Bikes.BikeInfoNS.BC
|
||||||
{
|
{
|
||||||
public class BikeInfo : IBikeInfo
|
public abstract class BikeInfo : IBikeInfo
|
||||||
{
|
{
|
||||||
/// <summary> Default value of demo property. </summary>
|
/// <summary> Default value of demo property. </summary>
|
||||||
public const bool DEFAULTVALUEISDEMO = false;
|
public const bool DEFAULTVALUEISDEMO = false;
|
||||||
|
@ -64,72 +64,6 @@ namespace TINK.Model.Bikes.BikeInfoNS.BC
|
||||||
bikeInfo.TariffDescription)
|
bikeInfo.TariffDescription)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructs a bike info object for a available bike.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dataSource">Specified the source of the data.</param>
|
|
||||||
/// <param name="stationId">Id of station where bike is located.</param>
|
|
||||||
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
|
||||||
/// <param name="tariffDescription">Hold tariff description of bike.</param>
|
|
||||||
public BikeInfo(
|
|
||||||
Bike bike,
|
|
||||||
Drive drive,
|
|
||||||
DataSource dataSource,
|
|
||||||
string stationId,
|
|
||||||
Uri operatorUri = null,
|
|
||||||
RentalDescription tariffDescription = null,
|
|
||||||
bool? isDemo = DEFAULTVALUEISDEMO,
|
|
||||||
IEnumerable<string> group = null) : this(
|
|
||||||
new StateInfo(),
|
|
||||||
bike,
|
|
||||||
drive,
|
|
||||||
dataSource,
|
|
||||||
isDemo,
|
|
||||||
group,
|
|
||||||
stationId,
|
|
||||||
operatorUri,
|
|
||||||
tariffDescription)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructs a bike info object for a booked bike.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dataSource">Specified the source of the data.</param>
|
|
||||||
/// <param name="dateTimeProvider">Provider for current date time to calculate remainig time on demand for state of type reserved.</param>
|
|
||||||
/// <param name="currentStationId">Name of station where bike is located, null if bike is on the road.</param>
|
|
||||||
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
|
||||||
/// <param name="tariffDescription">Hold tariff description of bike.</param>
|
|
||||||
/// <param name="bookedAt">Date time when bike was booked</param>
|
|
||||||
/// <param name="mailAddress">Mail address of user which booked bike.</param>
|
|
||||||
/// <param name="code">Booking code.</param>
|
|
||||||
public BikeInfo(
|
|
||||||
Bike bike,
|
|
||||||
Drive drive,
|
|
||||||
DataSource dataSource,
|
|
||||||
bool? isDemo,
|
|
||||||
IEnumerable<string> group,
|
|
||||||
string currentStationId,
|
|
||||||
Uri operatorUri,
|
|
||||||
RentalDescription tariffDescription,
|
|
||||||
DateTime bookedAt,
|
|
||||||
string mailAddress,
|
|
||||||
string code) : this(
|
|
||||||
new StateInfo(
|
|
||||||
bookedAt,
|
|
||||||
mailAddress,
|
|
||||||
code),
|
|
||||||
bike,
|
|
||||||
drive,
|
|
||||||
dataSource,
|
|
||||||
isDemo,
|
|
||||||
group,
|
|
||||||
currentStationId,
|
|
||||||
operatorUri,
|
|
||||||
tariffDescription)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary> True if device is demo device, false otherwise. </summary>
|
/// <summary> True if device is demo device, false otherwise. </summary>
|
||||||
public bool IsDemo { get; }
|
public bool IsDemo { get; }
|
||||||
|
|
||||||
|
@ -141,7 +75,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.BC
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string StationId { get; }
|
public string StationId { get; }
|
||||||
|
|
||||||
/// <summary> Holds description about the tarif. </summary>
|
/// <summary> Holds description about the tariff. </summary>
|
||||||
public RentalDescription TariffDescription { get; }
|
public RentalDescription TariffDescription { get; }
|
||||||
|
|
||||||
/// Holds the rent state of the bike.
|
/// Holds the rent state of the bike.
|
||||||
|
|
|
@ -9,7 +9,7 @@ using TINK.Model.State;
|
||||||
namespace TINK.Model.Bikes.BikeInfoNS.BC
|
namespace TINK.Model.Bikes.BikeInfoNS.BC
|
||||||
{
|
{
|
||||||
[DataContract]
|
[DataContract]
|
||||||
public class BikeInfoMutable : IBikeInfoMutable, INotifyPropertyChanged
|
public abstract class BikeInfoMutable : IBikeInfoMutable, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
/// <summary> Holds the bike. </summary>
|
/// <summary> Holds the bike. </summary>
|
||||||
private readonly Bike _Bike;
|
private readonly Bike _Bike;
|
||||||
|
@ -24,7 +24,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.BC
|
||||||
/// Constructs a bike.
|
/// Constructs a bike.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="isDemo">True if device is demo device, false otherwise.</param>
|
/// <param name="isDemo">True if device is demo device, false otherwise.</param>
|
||||||
/// <param name="dateTimeProvider">Provider for current date time to calculate remainig time on demand for state of type reserved.</param>
|
/// <param name="dateTimeProvider">Provider for current date time to calculate remaining time on demand for state of type reserved.</param>
|
||||||
/// <param name="stationId">Name of station where bike is located, null if bike is on the road.</param>
|
/// <param name="stationId">Name of station where bike is located, null if bike is on the road.</param>
|
||||||
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
||||||
/// <param name="tariffDescription">Hold tariff description of bike.</param>
|
/// <param name="tariffDescription">Hold tariff description of bike.</param>
|
||||||
|
@ -55,24 +55,6 @@ namespace TINK.Model.Bikes.BikeInfoNS.BC
|
||||||
TariffDescription = tariffDescription;
|
TariffDescription = tariffDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Constructs a bike object from source. </summary>
|
|
||||||
public BikeInfoMutable(IBikeInfo bike, string stationName) : this(
|
|
||||||
bike != null
|
|
||||||
? bike.Bike
|
|
||||||
: throw new ArgumentNullException(nameof(bike)),
|
|
||||||
bike.Drive,
|
|
||||||
bike.DataSource,
|
|
||||||
bike.IsDemo,
|
|
||||||
bike.Group,
|
|
||||||
bike.StationId,
|
|
||||||
stationName,
|
|
||||||
bike.OperatorUri,
|
|
||||||
bike.TariffDescription,
|
|
||||||
null /* date time provider */,
|
|
||||||
bike.State)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary> Id of station a which bike is located, null otherwise.</summary>
|
/// <summary> Id of station a which bike is located, null otherwise.</summary>
|
||||||
[DataMember]
|
[DataMember]
|
||||||
public string StationId { get; }
|
public string StationId { get; }
|
||||||
|
@ -81,7 +63,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.BC
|
||||||
[DataMember]
|
[DataMember]
|
||||||
public string StationName { get; }
|
public string StationName { get; }
|
||||||
|
|
||||||
/// <summary> Holds description about the tarif. </summary>
|
/// <summary> Holds description about the tariff. </summary>
|
||||||
[DataMember]
|
[DataMember]
|
||||||
public RentalDescription TariffDescription { get; private set; }
|
public RentalDescription TariffDescription { get; private set; }
|
||||||
|
|
||||||
|
@ -113,6 +95,12 @@ namespace TINK.Model.Bikes.BikeInfoNS.BC
|
||||||
|
|
||||||
public TypeOfBike? TypeOfBike => _Bike.TypeOfBike;
|
public TypeOfBike? TypeOfBike => _Bike.TypeOfBike;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets whether bike is a AA bike (bike must be always returned a the same station) or AB bike (start and end stations can be different stations).
|
||||||
|
/// </summary>
|
||||||
|
public AaRideType? AaRideType => _Bike.AaRideType;
|
||||||
|
|
||||||
|
|
||||||
public LockModel LockModel => _Bike.LockModel;
|
public LockModel LockModel => _Bike.LockModel;
|
||||||
|
|
||||||
public string Description => _Bike.Description;
|
public string Description => _Bike.Description;
|
||||||
|
|
|
@ -30,6 +30,11 @@ namespace TINK.Model.Bikes.BikeInfoNS.BC
|
||||||
/// </summary>
|
/// </summary>
|
||||||
TypeOfBike? TypeOfBike { get; }
|
TypeOfBike? TypeOfBike { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets whether bike is a AA bike (bike must be always returned a the same station) or AB bike (start and end stations can be different stations).
|
||||||
|
/// </summary>
|
||||||
|
AaRideType? AaRideType { get; }
|
||||||
|
|
||||||
/// <summary> Gets the model of the lock. </summary>
|
/// <summary> Gets the model of the lock. </summary>
|
||||||
LockModel LockModel { get; }
|
LockModel LockModel { get; }
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace TINK.Model.Bikes.BikeInfoNS.BikeNS
|
namespace TINK.Model.Bikes.BikeInfoNS.BikeNS
|
||||||
|
@ -21,12 +21,19 @@ namespace TINK.Model.Bikes.BikeInfoNS.BikeNS
|
||||||
City = 2,
|
City = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary> Holds whether bike is a AA bike (bike must be always returned a the same station) or AB bike (start and end stations can be different stations).</summary>
|
||||||
|
public enum AaRideType
|
||||||
|
{
|
||||||
|
NoAaRide = 0,
|
||||||
|
AaRide = 1,
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary> Holds the model of lock. </summary>
|
/// <summary> Holds the model of lock. </summary>
|
||||||
public enum LockModel
|
public enum LockModel
|
||||||
{
|
{
|
||||||
ILockIt, // haveltec GbmH Brandenburg, Germany bluetooth lock
|
ILockIt, // haveltec GbmH Brandenburg, Germany bluetooth lock
|
||||||
BordComputer, // Teilrad BC
|
BordComputer, // TeilRad BC
|
||||||
Sigo, // Sigo Gmbh Darmstadt, Germany bike lock
|
Sigo, // Sigo GmbH Darmstadt, Germany bike lock
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Holds the type of lock. </summary>
|
/// <summary> Holds the type of lock. </summary>
|
||||||
|
@ -47,10 +54,12 @@ namespace TINK.Model.Bikes.BikeInfoNS.BikeNS
|
||||||
LockModel lockModel,
|
LockModel lockModel,
|
||||||
WheelType? wheelType = null,
|
WheelType? wheelType = null,
|
||||||
TypeOfBike? typeOfBike = null,
|
TypeOfBike? typeOfBike = null,
|
||||||
|
AaRideType? aaRideType = null,
|
||||||
string description = null)
|
string description = null)
|
||||||
{
|
{
|
||||||
WheelType = wheelType;
|
WheelType = wheelType;
|
||||||
TypeOfBike = typeOfBike;
|
TypeOfBike = typeOfBike;
|
||||||
|
AaRideType = aaRideType;
|
||||||
LockModel = lockModel;
|
LockModel = lockModel;
|
||||||
Id = id;
|
Id = id;
|
||||||
Description = description;
|
Description = description;
|
||||||
|
@ -71,6 +80,11 @@ namespace TINK.Model.Bikes.BikeInfoNS.BikeNS
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TypeOfBike? TypeOfBike { get; }
|
public TypeOfBike? TypeOfBike { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets whether bike is a AA bike (bike must be always returned a the same station) or AB bike (start and end stations can be different stations).
|
||||||
|
/// </summary>
|
||||||
|
public AaRideType? AaRideType { get; }
|
||||||
|
|
||||||
/// <summary> Gets the model of the lock. </summary>
|
/// <summary> Gets the model of the lock. </summary>
|
||||||
public LockModel LockModel { get; private set; }
|
public LockModel LockModel { get; private set; }
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,10 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock
|
||||||
bike != null
|
bike != null
|
||||||
? new Bike(
|
? new Bike(
|
||||||
bike.Id,
|
bike.Id,
|
||||||
LockModel.ILockIt /* Ensure consistend lock model value */,
|
LockModel.ILockIt /* Ensure consistent lock model value */,
|
||||||
bike.WheelType,
|
bike.WheelType,
|
||||||
bike.TypeOfBike,
|
bike.TypeOfBike,
|
||||||
|
bike.AaRideType,
|
||||||
bike.Description)
|
bike.Description)
|
||||||
: throw new ArgumentNullException(nameof(bike)),
|
: throw new ArgumentNullException(nameof(bike)),
|
||||||
drive,
|
drive,
|
||||||
|
@ -53,7 +54,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock
|
||||||
/// Constructs a bike info object for a requested bike.
|
/// Constructs a bike info object for a requested bike.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dataSource">Specified the source of the data.</param>
|
/// <param name="dataSource">Specified the source of the data.</param>
|
||||||
/// <param name="dateTimeProvider">Provider for current date time to calculate remainig time on demand for state of type reserved.</param>
|
/// <param name="dateTimeProvider">Provider for current date time to calculate remaining time on demand for state of type reserved.</param>
|
||||||
/// <param name="lockId">Id of the lock.</param>
|
/// <param name="lockId">Id of the lock.</param>
|
||||||
/// <param name="lockGuid">GUID specifying the lock.</param>
|
/// <param name="lockGuid">GUID specifying the lock.</param>
|
||||||
/// <param name="requestedAt">Date time when bike was requested</param>
|
/// <param name="requestedAt">Date time when bike was requested</param>
|
||||||
|
@ -61,7 +62,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock
|
||||||
/// <param name="currentStationId">Name of station where bike is located, null if bike is on the road.</param>
|
/// <param name="currentStationId">Name of station where bike is located, null if bike is on the road.</param>
|
||||||
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
||||||
/// <param name="tariffDescription">Hold tariff description of bike.</param>
|
/// <param name="tariffDescription">Hold tariff description of bike.</param>
|
||||||
/// <param name="dateTimeProvider">Date time provider to calculate reaining time.</param>
|
/// <param name="dateTimeProvider">Date time provider to calculate remaining time.</param>
|
||||||
public BikeInfo(
|
public BikeInfo(
|
||||||
Bike bike,
|
Bike bike,
|
||||||
Drive drive,
|
Drive drive,
|
||||||
|
@ -87,9 +88,10 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock
|
||||||
bike != null
|
bike != null
|
||||||
? new Bike(
|
? new Bike(
|
||||||
bike.Id,
|
bike.Id,
|
||||||
LockModel.ILockIt /* Ensure consistend lock model value */,
|
LockModel.ILockIt /* Ensure consistent lock model value */,
|
||||||
bike.WheelType,
|
bike.WheelType,
|
||||||
bike.TypeOfBike,
|
bike.TypeOfBike,
|
||||||
|
bike.AaRideType,
|
||||||
bike.Description)
|
bike.Description)
|
||||||
: throw new ArgumentNullException(nameof(bike)),
|
: throw new ArgumentNullException(nameof(bike)),
|
||||||
drive,
|
drive,
|
||||||
|
@ -139,9 +141,10 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock
|
||||||
bike != null
|
bike != null
|
||||||
? new Bike(
|
? new Bike(
|
||||||
bike.Id,
|
bike.Id,
|
||||||
LockModel.ILockIt /* Ensure consistend lock model value */,
|
LockModel.ILockIt /* Ensure consistent lock model value */,
|
||||||
bike.WheelType,
|
bike.WheelType,
|
||||||
bike.TypeOfBike,
|
bike.TypeOfBike,
|
||||||
|
bike.AaRideType,
|
||||||
bike.Description)
|
bike.Description)
|
||||||
: throw new ArgumentNullException(),
|
: throw new ArgumentNullException(),
|
||||||
drive,
|
drive,
|
||||||
|
@ -155,7 +158,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock
|
||||||
LockInfo = new LockInfo.Builder { Id = lockId, Guid = lockGuid, UserKey = userKey, AdminKey = adminKey, Seed = seed }.Build();
|
LockInfo = new LockInfo.Builder { Id = lockId, Guid = lockGuid, UserKey = userKey, AdminKey = adminKey, Seed = seed }.Build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public BikeInfo(Model.Bikes.BikeInfoNS.BC.BikeInfo bikeInfo, LockInfo lockInfo) : base(
|
public BikeInfo(BC.BikeInfo bikeInfo, LockInfo lockInfo) : base(
|
||||||
bikeInfo ?? throw new ArgumentException($"Can not copy-construct {typeof(BikeInfo).Name}-object. Source bike info must not be null."))
|
bikeInfo ?? throw new ArgumentException($"Can not copy-construct {typeof(BikeInfo).Name}-object. Source bike info must not be null."))
|
||||||
{
|
{
|
||||||
LockInfo = lockInfo
|
LockInfo = lockInfo
|
||||||
|
|
|
@ -38,8 +38,9 @@ namespace TINK.Model.Bikes.BikeInfoNS.CopriLock
|
||||||
? new Bike(
|
? new Bike(
|
||||||
bike.Id,
|
bike.Id,
|
||||||
LockModel.Sigo,
|
LockModel.Sigo,
|
||||||
bike.WheelType /* Ensure consistend lock model value */,
|
bike.WheelType /* Ensure consistent lock model value */,
|
||||||
bike.TypeOfBike,
|
bike.TypeOfBike,
|
||||||
|
bike.AaRideType,
|
||||||
bike.Description)
|
bike.Description)
|
||||||
: throw new ArgumentNullException(nameof(bike)),
|
: throw new ArgumentNullException(nameof(bike)),
|
||||||
drive,
|
drive,
|
||||||
|
@ -66,7 +67,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.CopriLock
|
||||||
/// <param name="lockInfo">Lock info.</param>
|
/// <param name="lockInfo">Lock info.</param>
|
||||||
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
||||||
/// <param name="tariffDescription">Hold tariff description of bike.</param>
|
/// <param name="tariffDescription">Hold tariff description of bike.</param>
|
||||||
/// <param name="dateTimeProvider">Provider for current date time to calculate remainig time on demand for state of type reserved.</param>
|
/// <param name="dateTimeProvider">Provider for current date time to calculate remaining time on demand for state of type reserved.</param>
|
||||||
public BikeInfo(
|
public BikeInfo(
|
||||||
Bike bike,
|
Bike bike,
|
||||||
Drive drive,
|
Drive drive,
|
||||||
|
@ -88,9 +89,10 @@ namespace TINK.Model.Bikes.BikeInfoNS.CopriLock
|
||||||
bike != null
|
bike != null
|
||||||
? new Bike(
|
? new Bike(
|
||||||
bike.Id,
|
bike.Id,
|
||||||
LockModel.Sigo /* Ensure consistend lock model value */,
|
LockModel.Sigo /* Ensure consistent lock model value */,
|
||||||
bike.WheelType,
|
bike.WheelType,
|
||||||
bike.TypeOfBike,
|
bike.TypeOfBike,
|
||||||
|
bike.AaRideType,
|
||||||
bike.Description)
|
bike.Description)
|
||||||
: throw new ArgumentNullException(nameof(bike)),
|
: throw new ArgumentNullException(nameof(bike)),
|
||||||
drive,
|
drive,
|
||||||
|
@ -136,9 +138,10 @@ namespace TINK.Model.Bikes.BikeInfoNS.CopriLock
|
||||||
bike != null
|
bike != null
|
||||||
? new Bike(
|
? new Bike(
|
||||||
bike.Id,
|
bike.Id,
|
||||||
LockModel.Sigo /* Ensure consistend lock model value */,
|
LockModel.Sigo /* Ensure consistent lock model value */,
|
||||||
bike.WheelType,
|
bike.WheelType,
|
||||||
bike.TypeOfBike,
|
bike.TypeOfBike,
|
||||||
|
bike.AaRideType,
|
||||||
bike.Description)
|
bike.Description)
|
||||||
: throw new ArgumentNullException(nameof(bike)),
|
: throw new ArgumentNullException(nameof(bike)),
|
||||||
drive,
|
drive,
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.CopriLock
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a dummy querry. Querries are not yet read from COPRI but compiled into the app.
|
// Add a dummy query. Querries are not yet read from COPRI but compiled into the app.
|
||||||
BookingFinishedModel.MiniSurvey.Questions.Add("q1", new MiniSurvey.QuestionModel());
|
BookingFinishedModel.MiniSurvey.Questions.Add("q1", new MiniSurvey.QuestionModel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS
|
namespace TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS
|
||||||
{
|
{
|
||||||
|
@ -12,12 +12,12 @@ namespace TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS
|
||||||
public double CurrentChargePercent { get; private set; } = double.NaN;
|
public double CurrentChargePercent { get; private set; } = double.NaN;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds the current chargeing level of the battery in bars, null if unkonwn.
|
/// Holds the current charging level of the battery in bars, null if unknown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? CurrentChargeBars { get; private set; } = null;
|
public int? CurrentChargeBars { get; private set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds the maximum chargeing level of the battery in bars, null if unkonwn.
|
/// Holds the maximum charging level of the battery in bars, null if unknown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? MaxChargeBars { get; private set; } = null;
|
public int? MaxChargeBars { get; private set; } = null;
|
||||||
|
|
||||||
|
@ -34,12 +34,12 @@ namespace TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS
|
||||||
public class Builder
|
public class Builder
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds the current chargeing level of the battery in bars.
|
/// Holds the current charging level of the battery in bars.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? CurrentChargeBars { get; set; } = null;
|
public int? CurrentChargeBars { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds the maximum chargeing level of the battery in bars.
|
/// Holds the maximum charging level of the battery in bars.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? MaxChargeBars { get; set; } = null;
|
public int? MaxChargeBars { get; set; } = null;
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS
|
||||||
&& MaxChargeBars == null)
|
&& MaxChargeBars == null)
|
||||||
{
|
{
|
||||||
// If current charge bars is set, max charge must be set as well.
|
// If current charge bars is set, max charge must be set as well.
|
||||||
Log.ForContext<Battery>().Error($"Current bars value can not be set to {CurrentChargeBars} if max bars is not se.");
|
Log.ForContext<Battery>().Error($"Current bars value can not be set to {CurrentChargeBars} if max bars is not set.");
|
||||||
CurrentChargeBars = null;
|
CurrentChargeBars = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ namespace TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS
|
||||||
&& CurrentChargeBars > MaxChargeBars)
|
&& CurrentChargeBars > MaxChargeBars)
|
||||||
{
|
{
|
||||||
// If current charge bars must never be larger than max charge bars.
|
// If current charge bars must never be larger than max charge bars.
|
||||||
Log.ForContext<Battery>().Error($"Invalid current bars value {CurrentChargeBars} detected. Value must never be largen than max value bars {MaxChargeBars}.");
|
Log.ForContext<Battery>().Error($"Invalid current bars value {CurrentChargeBars} detected. Value must never be larger than max value bars {MaxChargeBars}.");
|
||||||
CurrentChargeBars = null;
|
CurrentChargeBars = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
|
|
||||||
namespace TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS
|
namespace TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS
|
||||||
{
|
{
|
||||||
public interface IBattery
|
public interface IBattery
|
||||||
|
@ -9,12 +9,12 @@ namespace TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS
|
||||||
double CurrentChargePercent { get; }
|
double CurrentChargePercent { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds the current chargeing level of the battery in bars. Must not be arger than MaxChargeBars, null if unkonwn.
|
/// Holds the current charging level of the battery in bars. Must not be larger than MaxChargeBars, null if unknown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int? CurrentChargeBars { get; }
|
int? CurrentChargeBars { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds the maximum chargeing level of the battery in bars, null if unkonwn.
|
/// Holds the maximum charging level of the battery in bars, null if unknown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int? MaxChargeBars { get; }
|
int? MaxChargeBars { get; }
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace TINK.Model.Bikes
|
namespace TINK.Model.Bikes
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ namespace TINK.Model.Bikes
|
||||||
T GetById(string id);
|
T GetById(string id);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deteermines whether a bike by given key exists.
|
/// Determines whether a bike by given key exists.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="p_strKey">Key to check.</param>
|
/// <param name="p_strKey">Key to check.</param>
|
||||||
/// <returns>True if bike exists.</returns>
|
/// <returns>True if bike exists.</returns>
|
||||||
|
@ -27,7 +27,7 @@ namespace TINK.Model.Bikes
|
||||||
void RemoveById(string id);
|
void RemoveById(string id);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a new element to dictinary.
|
/// Adds a new element to dictionary.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="newElement">New element to add.</param>
|
/// <param name="newElement">New element to add.</param>
|
||||||
void Add(T newElement);
|
void Add(T newElement);
|
||||||
|
|
|
@ -129,7 +129,7 @@ namespace TINK.Model.Connector
|
||||||
string BikeId { get; }
|
string BikeId { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds the current chargeing level of the battery in bars, null if unkonwn.
|
/// Holds the current charging level of the battery in bars, null if unknown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int? CurrentChargeBars { get; set; }
|
int? CurrentChargeBars { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
|
|
||||||
namespace TINK.Model.Connector
|
namespace TINK.Model.Connector
|
||||||
{
|
{
|
||||||
#if USCSHARP9
|
#if USCSHARP9
|
||||||
|
@ -18,7 +18,7 @@ namespace TINK.Model.Connector
|
||||||
public string BikeId { get; set; }
|
public string BikeId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds the current chargeing level of the battery in bars, null if unkonwn.
|
/// Holds the current charging level of the battery in bars, null if unknown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? CurrentChargeBars { get; set; }
|
public int? CurrentChargeBars { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TINK.Model.Bikes;
|
using TINK.Model.Bikes;
|
||||||
using TINK.Model.Connector.Filter;
|
using TINK.Model.Connector.Filter;
|
||||||
using TINK.Model.Services.CopriApi;
|
using TINK.Model.Services.CopriApi;
|
||||||
using TINK.Model.Station;
|
using TINK.Model.Stations;
|
||||||
|
using TINK.Model.Stations.StationNS;
|
||||||
using BikeInfo = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfo;
|
using BikeInfo = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfo;
|
||||||
|
|
||||||
namespace TINK.Model.Connector
|
namespace TINK.Model.Connector
|
||||||
{
|
{
|
||||||
/// <summary> Filters connector respones.</summary>
|
/// <summary> Filters connector responses.</summary>
|
||||||
/// <remarks>Former name: Filter</remarks>
|
/// <remarks>Former name: Filter</remarks>
|
||||||
public class FilteredConnector : IFilteredConnector
|
public class FilteredConnector : IFilteredConnector
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ namespace TINK.Model.Connector
|
||||||
/// <summary> Holds the filter. </summary>
|
/// <summary> Holds the filter. </summary>
|
||||||
private IGroupFilter Filter { get; }
|
private IGroupFilter Filter { get; }
|
||||||
|
|
||||||
/// <summary> Holds the reference to object which performs copry queries.</summary>
|
/// <summary> Holds the reference to object which performs copri queries.</summary>
|
||||||
private IQuery m_oInnerQuery;
|
private IQuery m_oInnerQuery;
|
||||||
|
|
||||||
/// <summary> Constructs a query object.</summary>
|
/// <summary> Constructs a query object.</summary>
|
||||||
|
@ -111,7 +111,7 @@ namespace TINK.Model.Connector
|
||||||
return bikes.Where(x => filter.DoFilter(x.Group).Count() > 0).ToDictionary(x => x.Id);
|
return bikes.Where(x => filter.DoFilter(x.Group).Count() > 0).ToDictionary(x => x.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Filter stations by broup. </summary>
|
/// <summary> Filter stations by group. </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private static Dictionary<string, IStation> DoFilter(StationDictionary stations, IGroupFilter filter)
|
private static Dictionary<string, IStation> DoFilter(StationDictionary stations, IGroupFilter filter)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TINK.Model.Bikes;
|
using TINK.Model.Bikes;
|
||||||
using TINK.Model.Services.CopriApi;
|
using TINK.Model.Services.CopriApi;
|
||||||
using TINK.Model.Station;
|
using TINK.Model.Stations;
|
||||||
|
using TINK.Model.Stations.StationNS;
|
||||||
using BikeInfo = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfo;
|
using BikeInfo = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfo;
|
||||||
|
|
||||||
namespace TINK.Model.Connector
|
namespace TINK.Model.Connector
|
||||||
{
|
{
|
||||||
/// <summary> Filters connector respones.</summary>
|
/// <summary> Filters connector responses.</summary>
|
||||||
public class NullFilterConnector : IFilteredConnector
|
public class NullFilterConnector : IFilteredConnector
|
||||||
{
|
{
|
||||||
/// <summary> Constructs a filter object. </summary>
|
/// <summary> Constructs a filter object. </summary>
|
||||||
|
@ -44,7 +44,7 @@ namespace TINK.Model.Connector
|
||||||
/// <summary> Object to perform filtered queries.</summary>
|
/// <summary> Object to perform filtered queries.</summary>
|
||||||
private class QueryProvider : IQuery
|
private class QueryProvider : IQuery
|
||||||
{
|
{
|
||||||
/// <summary> Holds the reference to object which performs copry queries.</summary>
|
/// <summary> Holds the reference to object which performs copri queries.</summary>
|
||||||
private IQuery m_oInnerQuery;
|
private IQuery m_oInnerQuery;
|
||||||
|
|
||||||
/// <summary> Constructs a query object.</summary>
|
/// <summary> Constructs a query object.</summary>
|
||||||
|
@ -100,7 +100,7 @@ namespace TINK.Model.Connector
|
||||||
return bikes.Where(x => x.Group.Intersect(filter).Count() > 0).ToDictionary(x => x.Id);
|
return bikes.Where(x => x.Group.Intersect(filter).Count() > 0).ToDictionary(x => x.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Filter stations by broup. </summary>
|
/// <summary> Filter stations by group. </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static Dictionary<string, IStation> DoFilter(StationDictionary stations, IEnumerable<string> p_oFilter)
|
public static Dictionary<string, IStation> DoFilter(StationDictionary stations, IEnumerable<string> p_oFilter)
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace TINK.Model.Connector
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Gets all stations including postions and bikes.</summary>
|
/// <summary> Gets all stations including positions and bikes.</summary>
|
||||||
public async Task<Result<StationsAndBikesContainer>> GetBikesAndStationsAsync()
|
public async Task<Result<StationsAndBikesContainer>> GetBikesAndStationsAsync()
|
||||||
{
|
{
|
||||||
var resultStations = await server.GetStations();
|
var resultStations = await server.GetStations();
|
||||||
|
@ -73,7 +73,7 @@ namespace TINK.Model.Connector
|
||||||
/// <returns>Collection of bikes.</returns>
|
/// <returns>Collection of bikes.</returns>
|
||||||
public async Task<Result<BikeCollection>> GetBikesOccupiedAsync()
|
public async Task<Result<BikeCollection>> GetBikesOccupiedAsync()
|
||||||
{
|
{
|
||||||
Log.ForContext<CachedQuery>().Error("Unexpected call to get be bikes occpied detected. No user is logged in.");
|
Log.ForContext<CachedQuery>().Error("Unexpected call to get be bikes occupied detected. No user is logged in.");
|
||||||
|
|
||||||
return new Result<BikeCollection>(
|
return new Result<BikeCollection>(
|
||||||
typeof(CopriCallsMonkeyStore),
|
typeof(CopriCallsMonkeyStore),
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace TINK.Model.Connector
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Gets all stations including postions.</summary>
|
/// <summary> Gets all stations including positions.</summary>
|
||||||
public async Task<Result<StationsAndBikesContainer>> GetBikesAndStationsAsync()
|
public async Task<Result<StationsAndBikesContainer>> GetBikesAndStationsAsync()
|
||||||
{
|
{
|
||||||
var stationsResponse = await Server.GetStations();
|
var stationsResponse = await Server.GetStations();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TINK.Model.Bikes;
|
using TINK.Model.Bikes;
|
||||||
using TINK.Model.Services.CopriApi;
|
using TINK.Model.Services.CopriApi;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ namespace TINK.Model.Connector
|
||||||
{
|
{
|
||||||
public interface IQuery
|
public interface IQuery
|
||||||
{
|
{
|
||||||
/// <summary> Gets all stations including postions.</summary>
|
/// <summary> Gets all stations including positions.</summary>
|
||||||
Task<Result<StationsAndBikesContainer>> GetBikesAndStationsAsync();
|
Task<Result<StationsAndBikesContainer>> GetBikesAndStationsAsync();
|
||||||
|
|
||||||
/// <summary> Gets bikes occupied is a user is logged in. </summary>
|
/// <summary> Gets bikes occupied is a user is logged in. </summary>
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace TINK.Model.Connector
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Gets all stations including postions.</summary>
|
/// <summary> Gets all stations including positions.</summary>
|
||||||
public async Task<Result<StationsAndBikesContainer>> GetBikesAndStationsAsync()
|
public async Task<Result<StationsAndBikesContainer>> GetBikesAndStationsAsync()
|
||||||
{
|
{
|
||||||
var stationsAllResponse = await server.GetStationsAsync();
|
var stationsAllResponse = await server.GetStationsAsync();
|
||||||
|
@ -44,7 +44,7 @@ namespace TINK.Model.Connector
|
||||||
/// <returns>Collection of bikes.</returns>
|
/// <returns>Collection of bikes.</returns>
|
||||||
public async Task<Result<BikeCollection>> GetBikesOccupiedAsync()
|
public async Task<Result<BikeCollection>> GetBikesOccupiedAsync()
|
||||||
{
|
{
|
||||||
Log.ForContext<Query>().Error("Unexpected call to get be bikes occpied detected. No user is logged in.");
|
Log.ForContext<Query>().Error("Unexpected call to get be bikes occupied detected. No user is logged in.");
|
||||||
return new Result<BikeCollection>(
|
return new Result<BikeCollection>(
|
||||||
typeof(CopriCallsMonkeyStore),
|
typeof(CopriCallsMonkeyStore),
|
||||||
await Task.FromResult(new BikeCollection(new Dictionary<string, BikeInfo>())),
|
await Task.FromResult(new BikeCollection(new Dictionary<string, BikeInfo>())),
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace TINK.Model.Connector
|
||||||
server = copriServer as ICopriServer;
|
server = copriServer as ICopriServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Gets all stations including postions.</summary>
|
/// <summary> Gets all stations including positions.</summary>
|
||||||
public async Task<Result<StationsAndBikesContainer>> GetBikesAndStationsAsync()
|
public async Task<Result<StationsAndBikesContainer>> GetBikesAndStationsAsync()
|
||||||
{
|
{
|
||||||
var stationResponse = await server.GetStationsAsync();
|
var stationResponse = await server.GetStationsAsync();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -9,6 +9,7 @@ using TINK.Model.Services.CopriApi.ServerUris;
|
||||||
using TINK.Model.State;
|
using TINK.Model.State;
|
||||||
using TINK.Repository.Exception;
|
using TINK.Repository.Exception;
|
||||||
using TINK.Repository.Response;
|
using TINK.Repository.Response;
|
||||||
|
using TINK.Repository.Response.Stations.Station;
|
||||||
|
|
||||||
namespace TINK.Model.Connector
|
namespace TINK.Model.Connector
|
||||||
{
|
{
|
||||||
|
@ -26,7 +27,7 @@ namespace TINK.Model.Connector
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="stationInfo">Object to get information from.</param>
|
/// <param name="stationInfo">Object to get information from.</param>
|
||||||
/// <returns>Position information.</returns>
|
/// <returns>Position information.</returns>
|
||||||
public static IPosition GetPosition(this StationsAvailableResponse.StationInfo stationInfo)
|
public static IPosition GetPosition(this StationInfo stationInfo)
|
||||||
=> GetPosition(stationInfo.gps);
|
=> GetPosition(stationInfo.gps);
|
||||||
|
|
||||||
/// <summary> Gets the position from StationInfo object. </summary>
|
/// <summary> Gets the position from StationInfo object. </summary>
|
||||||
|
@ -52,14 +53,14 @@ namespace TINK.Model.Connector
|
||||||
if (group == null || group.Length == 0)
|
if (group == null || group.Length == 0)
|
||||||
{
|
{
|
||||||
// If not logged in stations groups are empty form COPRI version v4.1.
|
// If not logged in stations groups are empty form COPRI version v4.1.
|
||||||
Log.Debug("Can not get goup form string. Group text can not be null.");
|
Log.Debug("Can not get group form string. Group text can not be null.");
|
||||||
return new List<string>();
|
return new List<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new HashSet<string>(group).ToList();
|
return new HashSet<string>(group).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Gets if user acknowldged ags or not. </summary>
|
/// <summary> Gets if user acknowledged AGBs or not. </summary>
|
||||||
/// <param name="authorizationResponse">Object to get information from.</param>
|
/// <param name="authorizationResponse">Object to get information from.</param>
|
||||||
/// <returns>Position information.</returns>
|
/// <returns>Position information.</returns>
|
||||||
public static bool GetIsAgbAcknowledged(this AuthorizationResponse authorizationResponse)
|
public static bool GetIsAgbAcknowledged(this AuthorizationResponse authorizationResponse)
|
||||||
|
@ -77,7 +78,7 @@ namespace TINK.Model.Connector
|
||||||
/// <summary> Gets the position from StationInfo object. </summary>
|
/// <summary> Gets the position from StationInfo object. </summary>
|
||||||
/// <param name="stationInfo">Object to get information from.</param>
|
/// <param name="stationInfo">Object to get information from.</param>
|
||||||
/// <returns>Position information.</returns>
|
/// <returns>Position information.</returns>
|
||||||
public static IEnumerable<string> GetGroup(this StationsAvailableResponse.StationInfo stationInfo)
|
public static IEnumerable<string> GetGroup(this StationInfo stationInfo)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -297,8 +298,19 @@ namespace TINK.Model.Connector
|
||||||
? typeOfBike
|
? typeOfBike
|
||||||
: (TypeOfBike?)null;
|
: (TypeOfBike?)null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets whether bike is a AA bike (bike must be always returned a the same station) or AB bike (start and end stations can be different stations).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bikeInfo">Object to get AA info from.</param>
|
||||||
|
/// <returns>AA info.</returns>
|
||||||
|
public static AaRideType? GetAaRideType(this BikeInfoBase bikeInfo)
|
||||||
|
=> Enum.TryParse(bikeInfo?.aa_ride, true, out AaRideType aaRide)
|
||||||
|
? aaRide
|
||||||
|
: (AaRideType?)null;
|
||||||
|
|
||||||
|
|
||||||
/// <summary> Get position from a ,- separated string. </summary>
|
/// <summary> Get position from a ,- separated string. </summary>
|
||||||
/// <param name="gps">Text to extract positon from.</param>
|
/// <param name="gps">Text to extract position from.</param>
|
||||||
/// <returns>Position object.</returns>
|
/// <returns>Position object.</returns>
|
||||||
public static IPosition GetPosition(Repository.Response.Position gps)
|
public static IPosition GetPosition(Repository.Response.Position gps)
|
||||||
=> PositionFactory.Create(
|
=> PositionFactory.Create(
|
||||||
|
@ -306,7 +318,7 @@ namespace TINK.Model.Connector
|
||||||
double.TryParse(gps?.longitude, NumberStyles.Float, CultureInfo.InvariantCulture, out double longitude) ? longitude : double.NaN);
|
double.TryParse(gps?.longitude, NumberStyles.Float, CultureInfo.InvariantCulture, out double longitude) ? longitude : double.NaN);
|
||||||
|
|
||||||
/// <summary> Get position from a ,- separated string. </summary>
|
/// <summary> Get position from a ,- separated string. </summary>
|
||||||
/// <param name="gps">Text to extract positon from.</param>
|
/// <param name="gps">Text to extract position from.</param>
|
||||||
/// <returns>Position object.</returns>
|
/// <returns>Position object.</returns>
|
||||||
public static Map.IMapSpan GetMapSpan(this MapSpan mapSpan)
|
public static Map.IMapSpan GetMapSpan(this MapSpan mapSpan)
|
||||||
=> Map.MapSpanFactory.Create(
|
=> Map.MapSpanFactory.Create(
|
||||||
|
@ -343,7 +355,7 @@ namespace TINK.Model.Connector
|
||||||
/// Gets the operator Uri from response.
|
/// Gets the operator Uri from response.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="bikeInfo"> Response to get uri from.</param>
|
/// <param name="bikeInfo"> Response to get uri from.</param>
|
||||||
/// <returns>Operatore Uri</returns>
|
/// <returns>Operator Uri</returns>
|
||||||
public static Uri GetOperatorUri(this BikeInfoBase bikeInfo)
|
public static Uri GetOperatorUri(this BikeInfoBase bikeInfo)
|
||||||
{
|
{
|
||||||
return bikeInfo?.uri_operator != null && !string.IsNullOrEmpty(bikeInfo?.uri_operator)
|
return bikeInfo?.uri_operator != null && !string.IsNullOrEmpty(bikeInfo?.uri_operator)
|
||||||
|
@ -351,7 +363,7 @@ namespace TINK.Model.Connector
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Tries to get the copriversion from response.</summary>
|
/// <summary> Tries to get the copri version from response.</summary>
|
||||||
/// <param name="response">Response to get version info from.</param>
|
/// <param name="response">Response to get version info from.</param>
|
||||||
/// <returns>COPRI version</returns>
|
/// <returns>COPRI version</returns>
|
||||||
public static bool TryGetCopriVersion(this CopriVersion response, out Version copriVersion)
|
public static bool TryGetCopriVersion(this CopriVersion response, out Version copriVersion)
|
||||||
|
@ -362,7 +374,7 @@ namespace TINK.Model.Connector
|
||||||
&& Version.TryParse(response.copri_version, out copriVersion);
|
&& Version.TryParse(response.copri_version, out copriVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Gets the copriversion from.</summary>
|
/// <summary> Gets the copri version from.</summary>
|
||||||
/// <param name="response">Response to get version info from.</param>
|
/// <param name="response">Response to get version info from.</param>
|
||||||
/// <returns>COPRI version</returns>
|
/// <returns>COPRI version</returns>
|
||||||
public static Version GetCopriVersion(this CopriVersion response)
|
public static Version GetCopriVersion(this CopriVersion response)
|
||||||
|
|
|
@ -7,7 +7,6 @@ using TINK.Model.MiniSurvey;
|
||||||
using TINK.Model.State;
|
using TINK.Model.State;
|
||||||
using TINK.Repository.Response;
|
using TINK.Repository.Response;
|
||||||
using BikeExtension = TINK.Model.Bikes.BikeInfoNS.BikeNS.BikeExtension;
|
using BikeExtension = TINK.Model.Bikes.BikeInfoNS.BikeNS.BikeExtension;
|
||||||
using BikeInfo = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfo;
|
|
||||||
|
|
||||||
namespace TINK.Model.Connector.Updater
|
namespace TINK.Model.Connector.Updater
|
||||||
{
|
{
|
||||||
|
@ -63,7 +62,7 @@ namespace TINK.Model.Connector.Updater
|
||||||
|
|
||||||
var lockType = lockModel.HasValue
|
var lockType = lockModel.HasValue
|
||||||
? BikeExtension.GetLockType(lockModel.Value)
|
? BikeExtension.GetLockType(lockModel.Value)
|
||||||
: BikeExtension.GetLockType(DEFAULTLOCKMODEL); // Map bikes without "system"- entry in response to backend- locks.
|
: BikeExtension.GetLockType(DEFAULTLOCKMODEL); // Map bikes without "system"- entry in response to back end- locks.
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -76,6 +75,7 @@ namespace TINK.Model.Connector.Updater
|
||||||
LockModel.Sigo,
|
LockModel.Sigo,
|
||||||
bikeInfo.GetWheelType(),
|
bikeInfo.GetWheelType(),
|
||||||
bikeInfo.GetTypeOfBike(),
|
bikeInfo.GetTypeOfBike(),
|
||||||
|
bikeInfo.GetAaRideType(),
|
||||||
bikeInfo.description),
|
bikeInfo.description),
|
||||||
DriveFactory.Create(bikeInfo?.bike_type),
|
DriveFactory.Create(bikeInfo?.bike_type),
|
||||||
dataSource,
|
dataSource,
|
||||||
|
@ -94,7 +94,7 @@ namespace TINK.Model.Connector.Updater
|
||||||
bikeInfo.GetGroup(),
|
bikeInfo.GetGroup(),
|
||||||
miniSurvey: bikeInfo.user_miniquery != null
|
miniSurvey: bikeInfo.user_miniquery != null
|
||||||
? new MiniSurveyModel(new Dictionary<string, IQuestionModel> {
|
? new MiniSurveyModel(new Dictionary<string, IQuestionModel> {
|
||||||
{ "q1", new QuestionModel()} // Add a dummy querry. Querries are not yet read from COPRI but compiled into the app.
|
{ "q1", new QuestionModel()} // Add a dummy query. Queries are not yet read from COPRI but compiled into the app.
|
||||||
})
|
})
|
||||||
: new MiniSurveyModel(),
|
: new MiniSurveyModel(),
|
||||||
co2Saving: bikeInfo.co2saving);
|
co2Saving: bikeInfo.co2saving);
|
||||||
|
@ -106,6 +106,7 @@ namespace TINK.Model.Connector.Updater
|
||||||
LockModel.ILockIt,
|
LockModel.ILockIt,
|
||||||
bikeInfo.GetWheelType(),
|
bikeInfo.GetWheelType(),
|
||||||
bikeInfo.GetTypeOfBike(),
|
bikeInfo.GetTypeOfBike(),
|
||||||
|
bikeInfo.GetAaRideType(),
|
||||||
bikeInfo.description),
|
bikeInfo.description),
|
||||||
DriveFactory.Create(bikeInfo?.bike_type),
|
DriveFactory.Create(bikeInfo?.bike_type),
|
||||||
dataSource,
|
dataSource,
|
||||||
|
@ -129,7 +130,7 @@ namespace TINK.Model.Connector.Updater
|
||||||
}
|
}
|
||||||
catch (ArgumentException ex)
|
catch (ArgumentException ex)
|
||||||
{
|
{
|
||||||
// Contructor reported invalid arguemts (missing lock id, ....).
|
// Constructor reported invalid arguments (missing lock id, ....).
|
||||||
Log.Error($"Can not create new {nameof(BikeInfo)}-object from {nameof(BikeInfoAvailable)} argument. Invalid response detected. Available bike with id {bikeInfo.bike} skipped. {ex.Message}");
|
Log.Error($"Can not create new {nameof(BikeInfo)}-object from {nameof(BikeInfoAvailable)} argument. Invalid response detected. Available bike with id {bikeInfo.bike} skipped. {ex.Message}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -184,6 +185,7 @@ namespace TINK.Model.Connector.Updater
|
||||||
LockModel.ILockIt,
|
LockModel.ILockIt,
|
||||||
bikeInfo.GetWheelType(),
|
bikeInfo.GetWheelType(),
|
||||||
bikeInfo.GetTypeOfBike(),
|
bikeInfo.GetTypeOfBike(),
|
||||||
|
bikeInfo.GetAaRideType(),
|
||||||
bikeInfo.description),
|
bikeInfo.description),
|
||||||
DriveFactory.Create(bikeInfo?.bike_type),
|
DriveFactory.Create(bikeInfo?.bike_type),
|
||||||
dataSource,
|
dataSource,
|
||||||
|
@ -214,6 +216,7 @@ namespace TINK.Model.Connector.Updater
|
||||||
LockModel.Sigo,
|
LockModel.Sigo,
|
||||||
bikeInfo.GetWheelType(),
|
bikeInfo.GetWheelType(),
|
||||||
bikeInfo.GetTypeOfBike(),
|
bikeInfo.GetTypeOfBike(),
|
||||||
|
bikeInfo.GetAaRideType(),
|
||||||
bikeInfo.description),
|
bikeInfo.description),
|
||||||
DriveFactory.Create(bikeInfo?.bike_type),
|
DriveFactory.Create(bikeInfo?.bike_type),
|
||||||
dataSource,
|
dataSource,
|
||||||
|
@ -238,7 +241,7 @@ namespace TINK.Model.Connector.Updater
|
||||||
}
|
}
|
||||||
catch (ArgumentException ex)
|
catch (ArgumentException ex)
|
||||||
{
|
{
|
||||||
// Contructor reported invalid arguemts (missing lock id, ....).
|
// Constructor reported invalid arguments (missing lock id, ....).
|
||||||
Log.Error($"Can not create new {nameof(BikeInfo)}-object from {nameof(BikeInfoReservedOrBooked)} argument. Invalid response detected. Reserved bike with id {bikeInfo.bike} skipped. {ex.Message}");
|
Log.Error($"Can not create new {nameof(BikeInfo)}-object from {nameof(BikeInfoReservedOrBooked)} argument. Invalid response detected. Reserved bike with id {bikeInfo.bike} skipped. {ex.Message}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -255,6 +258,7 @@ namespace TINK.Model.Connector.Updater
|
||||||
LockModel.ILockIt,
|
LockModel.ILockIt,
|
||||||
bikeInfo.GetWheelType(),
|
bikeInfo.GetWheelType(),
|
||||||
bikeInfo.GetTypeOfBike(),
|
bikeInfo.GetTypeOfBike(),
|
||||||
|
bikeInfo.GetAaRideType(),
|
||||||
bikeInfo.description),
|
bikeInfo.description),
|
||||||
DriveFactory.Create(bikeInfo?.bike_type),
|
DriveFactory.Create(bikeInfo?.bike_type),
|
||||||
dataSource,
|
dataSource,
|
||||||
|
@ -278,29 +282,8 @@ namespace TINK.Model.Connector.Updater
|
||||||
bikeInfo.GetGroup());
|
bikeInfo.GetGroup());
|
||||||
|
|
||||||
case LockModel.BordComputer:
|
case LockModel.BordComputer:
|
||||||
return new BikeInfo(
|
throw new NotSupportedException($"Bikes with lock model of type {lockModel} are no more supported.");
|
||||||
new Bike(
|
|
||||||
bikeInfo.bike,
|
|
||||||
LockModel.BordComputer,
|
|
||||||
bikeInfo.GetWheelType(),
|
|
||||||
bikeInfo.GetTypeOfBike(),
|
|
||||||
bikeInfo.description),
|
|
||||||
DriveFactory.Create(bikeInfo?.bike_type),
|
|
||||||
dataSource,
|
|
||||||
bikeInfo.GetIsDemo(),
|
|
||||||
bikeInfo.GetGroup(),
|
|
||||||
bikeInfo.station,
|
|
||||||
bikeInfo.GetOperatorUri(),
|
|
||||||
#if !NOTARIFFDESCRIPTION
|
|
||||||
bikeInfo.rental_description != null
|
|
||||||
? RentalDescriptionFactory.Create(bikeInfo.rental_description)
|
|
||||||
: TariffDescriptionFactory.Create(bikeInfo.tariff_description),
|
|
||||||
#else
|
|
||||||
Create((TINK.Repository.Response.TariffDescription)null),
|
|
||||||
#endif
|
|
||||||
bikeInfo.GetFrom(),
|
|
||||||
mailAddress,
|
|
||||||
bikeInfo.timeCode);
|
|
||||||
default:
|
default:
|
||||||
return new Bikes.BikeInfoNS.CopriLock.BikeInfo(
|
return new Bikes.BikeInfoNS.CopriLock.BikeInfo(
|
||||||
new Bike(
|
new Bike(
|
||||||
|
@ -308,6 +291,7 @@ namespace TINK.Model.Connector.Updater
|
||||||
LockModel.Sigo,
|
LockModel.Sigo,
|
||||||
bikeInfo.GetWheelType(),
|
bikeInfo.GetWheelType(),
|
||||||
bikeInfo.GetTypeOfBike(),
|
bikeInfo.GetTypeOfBike(),
|
||||||
|
bikeInfo.GetAaRideType(),
|
||||||
bikeInfo.description),
|
bikeInfo.description),
|
||||||
DriveFactory.Create(bikeInfo?.bike_type),
|
DriveFactory.Create(bikeInfo?.bike_type),
|
||||||
DataSource.Copri,
|
DataSource.Copri,
|
||||||
|
|
|
@ -1,17 +1,14 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using Serilog;
|
|
||||||
using TINK.Model.Bikes;
|
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BC;
|
using TINK.Model.Bikes.BikeInfoNS.BC;
|
||||||
using TINK.Model.State;
|
using TINK.Model.State;
|
||||||
using TINK.Model.Station;
|
using TINK.Model.Stations;
|
||||||
using TINK.Model.Station.Operator;
|
using TINK.Model.Stations.StationNS.Operator;
|
||||||
using TINK.Model.User.Account;
|
using TINK.Model.User.Account;
|
||||||
using TINK.Repository.Exception;
|
using TINK.Repository.Exception;
|
||||||
using TINK.Repository.Response;
|
using TINK.Repository.Response;
|
||||||
|
using TINK.Repository.Response.Stations;
|
||||||
using TINK.Services.CopriApi;
|
using TINK.Services.CopriApi;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using BikeInfo = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfo;
|
|
||||||
using IBikeInfoMutable = TINK.Model.Bikes.BikeInfoNS.BC.IBikeInfoMutable;
|
using IBikeInfoMutable = TINK.Model.Bikes.BikeInfoNS.BC.IBikeInfoMutable;
|
||||||
|
|
||||||
namespace TINK.Model.Connector.Updater
|
namespace TINK.Model.Connector.Updater
|
||||||
|
@ -31,7 +28,7 @@ namespace TINK.Model.Connector.Updater
|
||||||
=> bike.State.Load(InUseStateEnum.Disposable, notifyLevel: notifyLevel);
|
=> bike.State.Load(InUseStateEnum.Disposable, notifyLevel: notifyLevel);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets all statsion for station provider and add them into station list.
|
/// Gets all station for station provider and add them into station list.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="p_oStationList">List of stations to update.</param>
|
/// <param name="p_oStationList">List of stations to update.</param>
|
||||||
public static StationDictionary GetStationsAllMutable(this StationsAvailableResponse stationsAllResponse)
|
public static StationDictionary GetStationsAllMutable(this StationsAvailableResponse stationsAllResponse)
|
||||||
|
@ -57,7 +54,7 @@ namespace TINK.Model.Connector.Updater
|
||||||
string.Format("Station id {0} is not unique.", station.Value.station), stationsAllResponse);
|
string.Format("Station id {0} is not unique.", station.Value.station), stationsAllResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
stations.Add(new Station.Station(
|
stations.Add(new Stations.StationNS.Station(
|
||||||
station.Value.station,
|
station.Value.station,
|
||||||
station.Value.GetGroup(),
|
station.Value.GetGroup(),
|
||||||
station.Value.GetPosition(),
|
station.Value.GetPosition(),
|
||||||
|
@ -89,7 +86,7 @@ namespace TINK.Model.Connector.Updater
|
||||||
new ResourceUrls(response.tariff_info_html, response.bike_info_html, response.agb_html, response.privacy_html, response.impress_html));
|
new ResourceUrls(response.tariff_info_html, response.bike_info_html, response.agb_html, response.privacy_html, response.impress_html));
|
||||||
|
|
||||||
/// <summary> Gets account object from login response.</summary>
|
/// <summary> Gets account object from login response.</summary>
|
||||||
/// <param name="merchantId">Needed to extract cookie from autorization response.</param>
|
/// <param name="merchantId">Needed to extract cookie from authorization response.</param>
|
||||||
/// <param name="loginResponse">Response to get session cookie and debug level from.</param>
|
/// <param name="loginResponse">Response to get session cookie and debug level from.</param>
|
||||||
/// <param name="mail">Mail address needed to construct a complete account object (is not part of response).</param>
|
/// <param name="mail">Mail address needed to construct a complete account object (is not part of response).</param>
|
||||||
/// <param name="password">Password needed to construct a complete account object (is not part of response).</param>
|
/// <param name="password">Password needed to construct a complete account object (is not part of response).</param>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using TINK.Model.Connector;
|
using TINK.Model.Connector;
|
||||||
using TINK.ViewModel.Map;
|
using TINK.ViewModel.Map;
|
||||||
using TINK.ViewModel.Settings;
|
using TINK.ViewModel.Settings;
|
||||||
|
|
||||||
namespace TINK.Model
|
namespace TINK.Model
|
||||||
{
|
{
|
||||||
/// <summary> Holds collecion of filters to filter options (TINK, Konrad, ....). </summary>
|
/// <summary> Holds collection of filters to filter options (TINK, Konrad, ....). </summary>
|
||||||
/// <remarks> Former name: FilterCollection.</remarks>
|
/// <remarks> Former name: FilterCollection.</remarks>
|
||||||
public static class GroupFilterHelper
|
public static class GroupFilterHelper
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,7 +7,7 @@ using TINK.Model.Connector;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
using TINK.Model.Services.CopriApi.ServerUris;
|
using TINK.Model.Services.CopriApi.ServerUris;
|
||||||
using TINK.Model.Settings;
|
using TINK.Model.Settings;
|
||||||
using TINK.Model.Station;
|
using TINK.Model.Stations.StationNS;
|
||||||
using TINK.Services;
|
using TINK.Services;
|
||||||
using TINK.Services.BluetoothLock;
|
using TINK.Services.BluetoothLock;
|
||||||
using TINK.Settings;
|
using TINK.Settings;
|
||||||
|
@ -46,15 +46,15 @@ namespace TINK.Model
|
||||||
/// <summary> Name of the station which is selected. </summary>
|
/// <summary> Name of the station which is selected. </summary>
|
||||||
IStation SelectedStation { get; set; }
|
IStation SelectedStation { get; set; }
|
||||||
|
|
||||||
/// <summary>Polling periode.</summary>
|
/// <summary>Polling period.</summary>
|
||||||
PollingParameters Polling { get; set; }
|
PollingParameters Polling { get; set; }
|
||||||
|
|
||||||
TimeSpan ExpiresAfter { get; set; }
|
TimeSpan ExpiresAfter { get; set; }
|
||||||
|
|
||||||
/// <summary> Holds status about whants new page. </summary>
|
/// <summary> Holds status about whats new page. </summary>
|
||||||
WhatsNew WhatsNew { get; }
|
WhatsNew WhatsNew { get; }
|
||||||
|
|
||||||
/// <summary> Gets whether device is connected to internet or not. </summary>
|
/// <summary> Gets whether device is connected to Internet or not. </summary>
|
||||||
bool GetIsConnected();
|
bool GetIsConnected();
|
||||||
|
|
||||||
/// <summary> Action to post to GUI thread.</summary>
|
/// <summary> Action to post to GUI thread.</summary>
|
||||||
|
@ -69,7 +69,7 @@ namespace TINK.Model
|
||||||
/// <summary>Settings determining the startup behavior of the app.</summary>
|
/// <summary>Settings determining the startup behavior of the app.</summary>
|
||||||
IStartupSettings StartupSettings { get; }
|
IStartupSettings StartupSettings { get; }
|
||||||
|
|
||||||
/// <summary> Value indicating whether map is centerted to current position or not. </summary>
|
/// <summary> Value indicating whether map is centered to current position or not. </summary>
|
||||||
bool CenterMapToCurrentLocation { get; set; }
|
bool CenterMapToCurrentLocation { get; set; }
|
||||||
|
|
||||||
/// <summary> Holds the map area where user is or was located or null if position is unknown. </summary>
|
/// <summary> Holds the map area where user is or was located or null if position is unknown. </summary>
|
||||||
|
@ -98,7 +98,7 @@ namespace TINK.Model
|
||||||
/// <summary> Holds the different lock service implementations.</summary>
|
/// <summary> Holds the different lock service implementations.</summary>
|
||||||
LocksServicesContainerMutable LocksServices { get; }
|
LocksServicesContainerMutable LocksServices { get; }
|
||||||
|
|
||||||
/// <summary> Holds the flavor of the app, i.e. specifies if app is sharee.bike, Mein konrad or Lastenrad Bayern.</summary>
|
/// <summary> Holds the flavor of the app, i.e. specifies if app is sharee.bike, Mein konrad or LastenRad Bayern.</summary>
|
||||||
AppFlavor Flavor { get; }
|
AppFlavor Flavor { get; }
|
||||||
|
|
||||||
/// <summary> Holds available app themes.</summary>
|
/// <summary> Holds available app themes.</summary>
|
||||||
|
@ -113,7 +113,7 @@ namespace TINK.Model
|
||||||
/// <summary> Holds the external path. </summary>
|
/// <summary> Holds the external path. </summary>
|
||||||
string ExternalFolder { get; }
|
string ExternalFolder { get; }
|
||||||
|
|
||||||
/// <summary> Holds the stations availalbe. </summary>
|
/// <summary> Holds the stations centered. </summary>
|
||||||
IEnumerable<IStation> Stations { get; set; }
|
IEnumerable<IStation> Stations { get; set; }
|
||||||
|
|
||||||
/// <summary> Holds the Urs to query resources from. </summary>
|
/// <summary> Holds the Urs to query resources from. </summary>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ namespace TINK.Model.Logging
|
||||||
|
|
||||||
if (directoryExistsChecker == null)
|
if (directoryExistsChecker == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentException($"Can not instantiate {nameof(LoggingDirectoryManager)}- object. Directory existance checker delegate can not be null.");
|
throw new ArgumentException($"Can not instantiate {nameof(LoggingDirectoryManager)}- object. Directory existence checker delegate can not be null.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (directoryCreator == null)
|
if (directoryCreator == null)
|
||||||
|
@ -42,7 +42,7 @@ namespace TINK.Model.Logging
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(directorySeparatorChar.ToString()))
|
if (string.IsNullOrEmpty(directorySeparatorChar.ToString()))
|
||||||
{
|
{
|
||||||
throw new ArgumentException($"Can not instantiate {nameof(LoggingDirectoryManager)}- object. Directory separtor character can not be null or empty.");
|
throw new ArgumentException($"Can not instantiate {nameof(LoggingDirectoryManager)}- object. Directory separator character can not be null or empty.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_iRetainedFilesCountLimit < 1)
|
if (p_iRetainedFilesCountLimit < 1)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
namespace TINK.Model
|
namespace TINK.Model
|
||||||
{
|
{
|
||||||
public class NullPostion : IPosition
|
public class NullPosition : IPosition
|
||||||
{
|
{
|
||||||
internal NullPostion() { }
|
internal NullPosition() { }
|
||||||
|
|
||||||
public double Latitude => double.NaN;
|
public double Latitude => double.NaN;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,6 @@ namespace TINK.Model
|
||||||
public static IPosition Create(double latitude = double.NaN, double longitude = double.NaN)
|
public static IPosition Create(double latitude = double.NaN, double longitude = double.NaN)
|
||||||
=> Position.GetIsValid(longitude, latitude)
|
=> Position.GetIsValid(longitude, latitude)
|
||||||
? new Position(latitude, longitude) as IPosition
|
? new Position(latitude, longitude) as IPosition
|
||||||
: new NullPostion();
|
: new NullPosition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,7 +194,7 @@ namespace TINK.Model.Settings
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary> Sets whether polling is on or off and the periode if polling is on. </summary>
|
/// <summary> Sets whether polling is on or off and the period if polling is on. </summary>
|
||||||
/// <param name="settingsJSON">Dictionary to write entries to.</param>
|
/// <param name="settingsJSON">Dictionary to write entries to.</param>
|
||||||
public static Dictionary<string, string> SetPollingParameters(
|
public static Dictionary<string, string> SetPollingParameters(
|
||||||
this IDictionary<string, string> targetDictionary,
|
this IDictionary<string, string> targetDictionary,
|
||||||
|
@ -210,19 +210,19 @@ namespace TINK.Model.Settings
|
||||||
}).ToDictionary(key => key.Key, value => value.Value);
|
}).ToDictionary(key => key.Key, value => value.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Get whether polling is on or off and the periode if polling is on. </summary>
|
/// <summary> Get whether polling is on or off and the period if polling is on. </summary>
|
||||||
/// <param name="settingsJSON">Dictionary holding parameters from JSON.</param>
|
/// <param name="settingsJSON">Dictionary holding parameters from JSON.</param>
|
||||||
/// <returns>Polling parameters.</returns>
|
/// <returns>Polling parameters.</returns>
|
||||||
public static PollingParameters GetPollingParameters(this IDictionary<string, string> settingsJSON)
|
public static PollingParameters GetPollingParameters(this IDictionary<string, string> settingsJSON)
|
||||||
{
|
{
|
||||||
// Check if dictionary contains entry for periode.
|
// Check if dictionary contains entry for period.
|
||||||
if (settingsJSON.TryGetValue($"{typeof(PollingParameters).Name}_{typeof(TimeSpan).Name}", out string periode)
|
if (settingsJSON.TryGetValue($"{typeof(PollingParameters).Name}_{typeof(TimeSpan).Name}", out string period)
|
||||||
&& settingsJSON.TryGetValue($"{typeof(PollingParameters).Name}_{typeof(bool).Name}", out string active)
|
&& settingsJSON.TryGetValue($"{typeof(PollingParameters).Name}_{typeof(bool).Name}", out string active)
|
||||||
&& !string.IsNullOrEmpty(periode)
|
&& !string.IsNullOrEmpty(period)
|
||||||
&& !string.IsNullOrEmpty(active))
|
&& !string.IsNullOrEmpty(active))
|
||||||
{
|
{
|
||||||
return new PollingParameters(
|
return new PollingParameters(
|
||||||
JsonConvert.DeserializeObject<TimeSpan>(periode),
|
JsonConvert.DeserializeObject<TimeSpan>(period),
|
||||||
JsonConvert.DeserializeObject<bool>(active));
|
JsonConvert.DeserializeObject<bool>(active));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,15 +16,15 @@ namespace TINK.Settings
|
||||||
false);
|
false);
|
||||||
|
|
||||||
/// <summary> Constructs a polling parameter object. </summary>
|
/// <summary> Constructs a polling parameter object. </summary>
|
||||||
/// <param name="periode">Polling periode.</param>
|
/// <param name="period">Polling period.</param>
|
||||||
/// <param name="activated">True if polling is activated.</param>
|
/// <param name="activated">True if polling is activated.</param>
|
||||||
public PollingParameters(TimeSpan periode, bool activated)
|
public PollingParameters(TimeSpan period, bool activated)
|
||||||
{
|
{
|
||||||
Periode = periode; // Can not be null because is a struct.
|
Periode = period; // Can not be null because is a struct.
|
||||||
IsActivated = activated;
|
IsActivated = activated;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Holds the polling periode.</summary>
|
/// <summary>Holds the polling period.</summary>
|
||||||
public TimeSpan Periode { get; }
|
public TimeSpan Periode { get; }
|
||||||
|
|
||||||
/// <summary> Holds value whether polling is activated or not.</summary>
|
/// <summary> Holds value whether polling is activated or not.</summary>
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace TINK.Model.Settings
|
||||||
public const bool DEFAULTREPOTLEVEL = false;
|
public const bool DEFAULTREPOTLEVEL = false;
|
||||||
|
|
||||||
/// <summary> Gets the type of the default geolocation service. </summary>
|
/// <summary> Gets the type of the default geolocation service. </summary>
|
||||||
/// <remarks> Swtiched from GeolocationService (GeolocationAccuracyMediumService) to GeolocationAccuracyHighService in app version 3.0.290.</remarks>
|
/// <remarks> Switched from GeolocationService (GeolocationAccuracyMediumService) to GeolocationAccuracyHighService in app version 3.0.290.</remarks>
|
||||||
public static Type DefaultLocationService => typeof(GeolocationAccuracyHighService);
|
public static Type DefaultLocationService => typeof(GeolocationAccuracyHighService);
|
||||||
|
|
||||||
// Default value of the expires after entry. Controls the expiration time of the cache values.
|
// Default value of the expires after entry. Controls the expiration time of the cache values.
|
||||||
|
@ -54,8 +54,8 @@ namespace TINK.Model.Settings
|
||||||
bool? isSiteCachingOn = null,
|
bool? isSiteCachingOn = null,
|
||||||
string activeTheme = null)
|
string activeTheme = null)
|
||||||
{
|
{
|
||||||
GroupFilterMapPage = groupFilterMapPage ?? new GroupFilterMapPage(); // Default behaviour: No filtering.
|
GroupFilterMapPage = groupFilterMapPage ?? new GroupFilterMapPage(); // Default behavior: No filtering.
|
||||||
GroupFilterSettings = groupFilterSettings ?? new GroupFilterSettings(); // Default behaviour: No filtering.
|
GroupFilterSettings = groupFilterSettings ?? new GroupFilterSettings(); // Default behavior: No filtering.
|
||||||
StartupSettings = startupSettings ?? new StartupSettings();
|
StartupSettings = startupSettings ?? new StartupSettings();
|
||||||
ActiveUri = GetActiveUri(activeUri);
|
ActiveUri = GetActiveUri(activeUri);
|
||||||
PollingParameters = pollingParameters ?? PollingParameters.Default;
|
PollingParameters = pollingParameters ?? PollingParameters.Default;
|
||||||
|
@ -64,7 +64,7 @@ namespace TINK.Model.Settings
|
||||||
ExpiresAfter = expiresAfter ?? DEFAULTEXPIRESAFTER;
|
ExpiresAfter = expiresAfter ?? DEFAULTEXPIRESAFTER;
|
||||||
ActiveLockService = activeLockService ?? LocksServicesContainerMutable.DefaultLocksservice;
|
ActiveLockService = activeLockService ?? LocksServicesContainerMutable.DefaultLocksservice;
|
||||||
ConnectTimeout = connectTimeout ?? new TimeSpan(0, 0, TimeOutProvider.DEFAULT_BLUETOOTHCONNECT_TIMEOUTSECONDS); // Try one sec. to connect.
|
ConnectTimeout = connectTimeout ?? new TimeSpan(0, 0, TimeOutProvider.DEFAULT_BLUETOOTHCONNECT_TIMEOUTSECONDS); // Try one sec. to connect.
|
||||||
ActiveGeolocationService = activeGeolocationService ?? DefaultLocationService.Name;
|
ActiveGeolocationService = activeGeolocationService ?? DefaultLocationService.FullName;
|
||||||
CenterMapToCurrentLocation = centerMapToCurrentLocation ?? GetCenterMapToCurrentLocation(activeUri);
|
CenterMapToCurrentLocation = centerMapToCurrentLocation ?? GetCenterMapToCurrentLocation(activeUri);
|
||||||
MapSpan = mapSpan;
|
MapSpan = mapSpan;
|
||||||
LogToExternalFolder = logToExternalFolder ?? false;
|
LogToExternalFolder = logToExternalFolder ?? false;
|
||||||
|
@ -78,7 +78,7 @@ namespace TINK.Model.Settings
|
||||||
/// <summary> Holds the filters loaded from settings. </summary>
|
/// <summary> Holds the filters loaded from settings. </summary>
|
||||||
public IGroupFilterSettings GroupFilterSettings { get; }
|
public IGroupFilterSettings GroupFilterSettings { get; }
|
||||||
|
|
||||||
/// <summary> Holds the stettings determining app startup behavior. </summary>
|
/// <summary> Holds the settings determining app startup behavior. </summary>
|
||||||
public IStartupSettings StartupSettings { get; }
|
public IStartupSettings StartupSettings { get; }
|
||||||
|
|
||||||
/// <summary> Holds the uri to connect to. </summary>
|
/// <summary> Holds the uri to connect to. </summary>
|
||||||
|
@ -102,7 +102,7 @@ namespace TINK.Model.Settings
|
||||||
/// <summary> Gets the geolocation service to use.</summary>
|
/// <summary> Gets the geolocation service to use.</summary>
|
||||||
public string ActiveGeolocationService { get; }
|
public string ActiveGeolocationService { get; }
|
||||||
|
|
||||||
/// <summary> True if map is centered to current positon, false if not to center map.</summary>
|
/// <summary> True if map is centered to current position, false if not to center map.</summary>
|
||||||
public bool CenterMapToCurrentLocation { get; }
|
public bool CenterMapToCurrentLocation { get; }
|
||||||
|
|
||||||
/// <summary> Holds the map area to display. </summary>
|
/// <summary> Holds the map area to display. </summary>
|
||||||
|
@ -121,7 +121,7 @@ namespace TINK.Model.Settings
|
||||||
|
|
||||||
public static bool GetCenterMapToCurrentLocation(Uri activeUri)
|
public static bool GetCenterMapToCurrentLocation(Uri activeUri)
|
||||||
{
|
{
|
||||||
// TINK does not require acess to current location. Deactivate center map to current location for this reason.
|
// TINK does not require access to current location. Deactivate center map to current location for this reason.
|
||||||
return !GetActiveUri(activeUri).Host.GetIsCopri();
|
return !GetActiveUri(activeUri).Host.GetIsCopri();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace TINK.Model.State
|
namespace TINK.Model.State
|
||||||
{
|
{
|
||||||
|
@ -262,7 +262,7 @@ namespace TINK.Model.State
|
||||||
if (_RemainingTime.HasValue == false)
|
if (_RemainingTime.HasValue == false)
|
||||||
{
|
{
|
||||||
// Value was not yet querried.
|
// Value was not yet querried.
|
||||||
// Do querry before returning object.
|
// Do query before returning object.
|
||||||
_StateInfo.GetIsStillReserved(out _RemainingTime);
|
_StateInfo.GetIsStillReserved(out _RemainingTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using TINK.Model.Stations.StationNS;
|
||||||
|
|
||||||
namespace TINK.Model.Station
|
namespace TINK.Model.Stations
|
||||||
{
|
{
|
||||||
public class StationDictionary : IEnumerable<IStation>
|
public class StationDictionary : IEnumerable<IStation>
|
||||||
{
|
{
|
||||||
|
@ -31,7 +32,7 @@ namespace TINK.Model.Station
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deteermines whether a station by given key exists.
|
/// Determines whether a station by given key exists.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="key">Key to check.</param>
|
/// <param name="key">Key to check.</param>
|
||||||
/// <returns>True if station exists.</returns>
|
/// <returns>True if station exists.</returns>
|
|
@ -1,7 +1,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using TINK.Model.Station.Operator;
|
using TINK.Model.Stations.StationNS.Operator;
|
||||||
|
|
||||||
namespace TINK.Model.Station
|
namespace TINK.Model.Stations.StationNS
|
||||||
{
|
{
|
||||||
public interface IStation
|
public interface IStation
|
||||||
{
|
{
|
|
@ -1,7 +1,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using TINK.Model.Station.Operator;
|
using TINK.Model.Stations.StationNS.Operator;
|
||||||
|
|
||||||
namespace TINK.Model.Station
|
namespace TINK.Model.Stations.StationNS
|
||||||
{
|
{
|
||||||
/// <summary> Holds object representing null station.</summary>
|
/// <summary> Holds object representing null station.</summary>
|
||||||
public class NullStation : IStation
|
public class NullStation : IStation
|
|
@ -1,6 +1,6 @@
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
|
|
||||||
namespace TINK.Model.Station.Operator
|
namespace TINK.Model.Stations.StationNS.Operator
|
||||||
{
|
{
|
||||||
/// <summary> Holds operator related data.</summary>
|
/// <summary> Holds operator related data.</summary>
|
||||||
public class Data : IData
|
public class Data : IData
|
|
@ -1,6 +1,6 @@
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
|
|
||||||
namespace TINK.Model.Station.Operator
|
namespace TINK.Model.Stations.StationNS.Operator
|
||||||
{
|
{
|
||||||
public interface IData
|
public interface IData
|
||||||
{
|
{
|
|
@ -1,8 +1,8 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using TINK.Model.Station.Operator;
|
using TINK.Model.Stations.StationNS.Operator;
|
||||||
|
|
||||||
namespace TINK.Model.Station
|
namespace TINK.Model.Stations.StationNS
|
||||||
{
|
{
|
||||||
/// <summary> Holds station info. </summary>
|
/// <summary> Holds station info. </summary>
|
||||||
public class Station : IStation
|
public class Station : IStation
|
|
@ -13,7 +13,7 @@ using TINK.Model.Device;
|
||||||
using TINK.Model.Logging;
|
using TINK.Model.Logging;
|
||||||
using TINK.Model.Services.CopriApi.ServerUris;
|
using TINK.Model.Services.CopriApi.ServerUris;
|
||||||
using TINK.Model.Settings;
|
using TINK.Model.Settings;
|
||||||
using TINK.Model.Station;
|
using TINK.Model.Stations.StationNS;
|
||||||
using TINK.Model.User.Account;
|
using TINK.Model.User.Account;
|
||||||
using TINK.Services;
|
using TINK.Services;
|
||||||
using TINK.Services.BluetoothLock;
|
using TINK.Services.BluetoothLock;
|
||||||
|
@ -42,7 +42,7 @@ namespace TINK.Model
|
||||||
public static string MerchantId { get; private set; }
|
public static string MerchantId { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds status about whants new page.
|
/// Holds status about whats new page.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public WhatsNew WhatsNew { get; private set; }
|
public WhatsNew WhatsNew { get; private set; }
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ namespace TINK.Model
|
||||||
set => m_oFilterDictionaryMapPage = value ?? new GroupFilterMapPage();
|
set => m_oFilterDictionaryMapPage = value ?? new GroupFilterMapPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Value indicating whether map is centerted to current position or not. </summary>
|
/// <summary> Value indicating whether map is centered to current position or not. </summary>
|
||||||
public bool CenterMapToCurrentLocation { get; set; }
|
public bool CenterMapToCurrentLocation { get; set; }
|
||||||
|
|
||||||
/// <summary> Holds the map area to display when starting app for first time/ when center map to is off. </summary>
|
/// <summary> Holds the map area to display when starting app for first time/ when center map to is off. </summary>
|
||||||
|
@ -123,7 +123,7 @@ namespace TINK.Model
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update connector from filters when
|
/// Update connector from filters when
|
||||||
/// - login state changes
|
/// - login state changes
|
||||||
/// - view is toggled (TINK to Kornrad and vice versa)
|
/// - view is toggled (TINK to Konrad and vice versa)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void UpdateConnector()
|
public void UpdateConnector()
|
||||||
{
|
{
|
||||||
|
@ -133,7 +133,7 @@ namespace TINK.Model
|
||||||
m_oConnector.Connector);
|
m_oConnector.Connector);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Polling periode.</summary>
|
/// <summary>Polling period.</summary>
|
||||||
public PollingParameters Polling { get; set; }
|
public PollingParameters Polling { get; set; }
|
||||||
|
|
||||||
public TimeSpan ExpiresAfter { get; set; }
|
public TimeSpan ExpiresAfter { get; set; }
|
||||||
|
@ -155,7 +155,7 @@ namespace TINK.Model
|
||||||
/// <param name="accountStore"></param>
|
/// <param name="accountStore"></param>
|
||||||
/// <param name="passwordValidator"></param>
|
/// <param name="passwordValidator"></param>
|
||||||
/// <param name="p_oConnectorFactory"></param>
|
/// <param name="p_oConnectorFactory"></param>
|
||||||
/// <param name="geolocationService">Null in productive context. Service to querry geoloation for testing purposes. Parameter can be made optional.</param>
|
/// <param name="geolocationService">Null in productive context. Service to query geolocation for testing purposes. Parameter can be made optional.</param>
|
||||||
/// <param name="locksService">Null in productive context. Service to control locks/ get locks information for testing proposes. Parameter can be made optional.</param>
|
/// <param name="locksService">Null in productive context. Service to control locks/ get locks information for testing proposes. Parameter can be made optional.</param>
|
||||||
/// <param name="device">Object allowing platform specific operations.</param>
|
/// <param name="device">Object allowing platform specific operations.</param>
|
||||||
/// <param name="specialFolder"></param>
|
/// <param name="specialFolder"></param>
|
||||||
|
@ -303,7 +303,7 @@ namespace TINK.Model
|
||||||
throw new ArgumentException($"Can not instantiate {nameof(TinkApp)}- object. Polling parameters must never be null.");
|
throw new ArgumentException($"Can not instantiate {nameof(TinkApp)}- object. Polling parameters must never be null.");
|
||||||
|
|
||||||
Polling = (lastVersion != null && lastVersion < new Version(3, 0, 358))
|
Polling = (lastVersion != null && lastVersion < new Version(3, 0, 358))
|
||||||
? PollingParameters.Default // Default polling periode was 10s up to 3.0.357. Is 60s for later versions.
|
? PollingParameters.Default // Default polling period was 10s up to 3.0.357. Is 60s for later versions.
|
||||||
: settings.PollingParameters;
|
: settings.PollingParameters;
|
||||||
|
|
||||||
AppVersion = currentVersion ?? new Version(3, 0, 122);
|
AppVersion = currentVersion ?? new Version(3, 0, 122);
|
||||||
|
@ -342,7 +342,7 @@ namespace TINK.Model
|
||||||
/// <summary> Holds delegate to determine whether device is connected or not.</summary>
|
/// <summary> Holds delegate to determine whether device is connected or not.</summary>
|
||||||
private readonly Func<bool> isConnectedFunc;
|
private readonly Func<bool> isConnectedFunc;
|
||||||
|
|
||||||
/// <summary> Gets whether device is connected to internet or not. </summary>
|
/// <summary> Gets whether device is connected to Internet or not. </summary>
|
||||||
public bool GetIsConnected() => isConnectedFunc();
|
public bool GetIsConnected() => isConnectedFunc();
|
||||||
|
|
||||||
/// <summary> Holds the folder where settings files are stored. </summary>
|
/// <summary> Holds the folder where settings files are stored. </summary>
|
||||||
|
@ -365,8 +365,8 @@ namespace TINK.Model
|
||||||
/// <summary> Name of the station which is selected. </summary>
|
/// <summary> Name of the station which is selected. </summary>
|
||||||
public IStation SelectedStation { get; set; } = new NullStation();
|
public IStation SelectedStation { get; set; } = new NullStation();
|
||||||
|
|
||||||
/// <summary> Holds the stations availalbe. </summary>
|
/// <summary> Holds the stations centered. </summary>
|
||||||
public IEnumerable<IStation> Stations { get; set; } = new List<Station.Station>();
|
public IEnumerable<IStation> Stations { get; set; } = new List<Station>();
|
||||||
|
|
||||||
public IResourceUrls ResourceUrls { get; set; } = new ResourceUrls();
|
public IResourceUrls ResourceUrls { get; set; } = new ResourceUrls();
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
|
@ -10,15 +10,15 @@ namespace TINK.Model.User.Account
|
||||||
{
|
{
|
||||||
None = 0, // No extra permissions.
|
None = 0, // No extra permissions.
|
||||||
PickCopriServer = 2, // Allows user to switch COPRI server.
|
PickCopriServer = 2, // Allows user to switch COPRI server.
|
||||||
ManageCopriCacheExpiration = 4, // Allows to manage the livetime of COPRI cache entries.
|
ManageCopriCacheExpiration = 4, // Allows to manage the live time of COPRI cache entries.
|
||||||
ManagePolling = 8, // Turn polling off or on and set pollig frequency.
|
ManagePolling = 8, // Turn polling off or on and set polling frequency.
|
||||||
PickLockServiceImplementation = 16, // Allows to pick the implementation which controls bluetooth lock mangement.
|
PickLockServiceImplementation = 16, // Allows to pick the implementation which controls bluetooth lock management.
|
||||||
PickLocationServiceImplementation = 32, // Allows to pick the implementation which gets location information.
|
PickLocationServiceImplementation = 32, // Allows to pick the implementation which gets location information.
|
||||||
PickLoggingLevel = 64, // Allows to select the logging level.
|
PickLoggingLevel = 64, // Allows to select the logging level.
|
||||||
ShowDiagnostics = 128, // Turns on display of diagnostics.
|
ShowDiagnostics = 128, // Turns on display of diagnostics.
|
||||||
SwitchNoSiteCaching = 1024, // Allows to turn off/ on caching of sites displayed in app hosted by COPRI
|
SwitchNoSiteCaching = 1024, // Allows to turn off/ on caching of sites displayed in app hosted by COPRI
|
||||||
ReportLevel = 2048, // Allows extent to show error messages.
|
ReportLevel = 2048, // Allows extent to show error messages.
|
||||||
SwitchTheme = 4096, // Allows user to switch theme (sharee.bike, Meinkonrad, Lastenrad Bayern)
|
SwitchTheme = 4096, // Allows user to switch theme (sharee.bike, Mein konrad, LastenRad Bayern)
|
||||||
All = PickCopriServer +
|
All = PickCopriServer +
|
||||||
ManageCopriCacheExpiration +
|
ManageCopriCacheExpiration +
|
||||||
ManagePolling +
|
ManagePolling +
|
||||||
|
@ -57,7 +57,7 @@ namespace TINK.Model.User.Account
|
||||||
/// <param name="mail">Mail address of the account holder.</param>
|
/// <param name="mail">Mail address of the account holder.</param>
|
||||||
/// <param name="password">Password.</param>
|
/// <param name="password">Password.</param>
|
||||||
/// <param name="sessionCookie">Session cookie from copri.</param>
|
/// <param name="sessionCookie">Session cookie from copri.</param>
|
||||||
/// <param name="bikeGroup">Group holdig info about Group (TINK, Konrad, ...)</param>
|
/// <param name="bikeGroup">Group holding info about Group (TINK, Konrad, ...)</param>
|
||||||
/// <param name="p_iDebugLevel">Flag which controls display of debug settings.</param>
|
/// <param name="p_iDebugLevel">Flag which controls display of debug settings.</param>
|
||||||
public Account(
|
public Account(
|
||||||
string mail,
|
string mail,
|
||||||
|
@ -87,7 +87,7 @@ namespace TINK.Model.User.Account
|
||||||
/// <summary>Password of to authenticate.</summary>
|
/// <summary>Password of to authenticate.</summary>
|
||||||
public string Pwd { get; }
|
public string Pwd { get; }
|
||||||
|
|
||||||
/// <summary>True if user acknowleged agbs.</summary>
|
/// <summary>True if user acknowledged AGBs.</summary>
|
||||||
public bool IsAgbAcknowledged { get; }
|
public bool IsAgbAcknowledged { get; }
|
||||||
|
|
||||||
/// <summary>Session cookie used to sign in to copri.</summary>
|
/// <summary>Session cookie used to sign in to copri.</summary>
|
||||||
|
|
|
@ -683,8 +683,8 @@ namespace TINK.Model
|
||||||
new List<AppFlavor> { AppFlavor.MeinKonrad, AppFlavor.ShareeBike }
|
new List<AppFlavor> { AppFlavor.MeinKonrad, AppFlavor.ShareeBike }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
new Version(3, 0, 362),
|
new Version(3, 0, 363),
|
||||||
AppResources.ChangeLog_3_0_362_MK_SB,
|
AppResources.ChangeLog_3_0_363_MK_SB,
|
||||||
new List<AppFlavor> { AppFlavor.MeinKonrad, AppFlavor.ShareeBike }
|
new List<AppFlavor> { AppFlavor.MeinKonrad, AppFlavor.ShareeBike }
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -693,7 +693,7 @@ namespace TINK.Model
|
||||||
/// <param name="currentVersion">Current version of the app.</param>
|
/// <param name="currentVersion">Current version of the app.</param>
|
||||||
/// <param name="lastVersion">Version of app which was used before this session, null if app is installed for the first time.</param>
|
/// <param name="lastVersion">Version of app which was used before this session, null if app is installed for the first time.</param>
|
||||||
/// <param name="shownInVersion">Null or version in which whats new dialog was shown last. Used to determine if AGB dialog has to be shown.</param>
|
/// <param name="shownInVersion">Null or version in which whats new dialog was shown last. Used to determine if AGB dialog has to be shown.</param>
|
||||||
/// <param name="flavor">Flavor of the app, i.e. specified if app is sharee.bike, Lastenrad Bayern, ...</param>
|
/// <param name="flavor">Flavor of the app, i.e. specified if app is sharee.bike, LastenRad Bayern, ...</param>
|
||||||
/// <param name="platform">Platform on which app is running.</param>
|
/// <param name="platform">Platform on which app is running.</param>
|
||||||
/// <param name="messages">Messages to inject for testing.</param>
|
/// <param name="messages">Messages to inject for testing.</param>
|
||||||
public WhatsNew(
|
public WhatsNew(
|
||||||
|
@ -727,7 +727,7 @@ namespace TINK.Model
|
||||||
IsShowRequired = true;
|
IsShowRequired = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Gets or sets value whehter whats new was alreay shonw in current settion or not. </summary>
|
/// <summary> Gets or sets value whether whats new was already shown in current session or not. </summary>
|
||||||
public bool WasShownInCurrentSession { get; set; }
|
public bool WasShownInCurrentSession { get; set; }
|
||||||
|
|
||||||
/// <summary> Holds the information in which version of the app the whats new dialog has been shown.</summary>
|
/// <summary> Holds the information in which version of the app the whats new dialog has been shown.</summary>
|
||||||
|
@ -736,10 +736,10 @@ namespace TINK.Model
|
||||||
/// <summary> Holds information whether whats new page was already shown or not.</summary>
|
/// <summary> Holds information whether whats new page was already shown or not.</summary>
|
||||||
public bool IsShowRequired { get; }
|
public bool IsShowRequired { get; }
|
||||||
|
|
||||||
/// <summary> True if info about modified agb has to be displayed. </summary>
|
/// <summary> True if info about modified AGB has to be displayed. </summary>
|
||||||
public bool IsShowAgbRequired => (WasShownVersion ?? AGBMODIFIEDBUILD) < AGBMODIFIEDBUILD;
|
public bool IsShowAgbRequired => (WasShownVersion ?? AGBMODIFIEDBUILD) < AGBMODIFIEDBUILD;
|
||||||
|
|
||||||
/// <summary> Get the whats new text depening of version gap.</summary>
|
/// <summary> Get the whats new text depending of version gap.</summary>
|
||||||
/// <param name="messages">Messages to process.</param>
|
/// <param name="messages">Messages to process.</param>
|
||||||
public IDictionary<Version, string> WhatsNewText { get; }
|
public IDictionary<Version, string> WhatsNewText { get; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -781,6 +781,18 @@ namespace TINK.MultilingualResources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to - Bikes that must be returned to the starting station are marked as such with an icon and the station id.<br/>
|
||||||
|
///- What used to be called 'return bike' is now called 'end rental'. Always make sure to end your chargeable rental!<br/>
|
||||||
|
///- Bug fixes<br/>
|
||||||
|
///- Package updates.
|
||||||
|
/// </summary>
|
||||||
|
public static string ChangeLog_3_0_363_MK_SB {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ChangeLog_3_0_363_MK_SB", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to We have fixed some bugs. Enjoy the ride!.
|
/// Looks up a localized string similar to We have fixed some bugs. Enjoy the ride!.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -2406,6 +2418,15 @@ namespace TINK.MultilingualResources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Circular drives only!.
|
||||||
|
/// </summary>
|
||||||
|
public static string MessageAaRideTypeInfoTitle {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("MessageAaRideTypeInfoTitle", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Log out.
|
/// Looks up a localized string similar to Log out.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -2552,7 +2573,7 @@ namespace TINK.MultilingualResources {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Rental charges.
|
/// Looks up a localized string similar to Rental costs.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string MessageBikesManagementTariffDescriptionFeeEuroPerHour {
|
public static string MessageBikesManagementTariffDescriptionFeeEuroPerHour {
|
||||||
get {
|
get {
|
||||||
|
@ -2579,7 +2600,7 @@ namespace TINK.MultilingualResources {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Max. charges.
|
/// Looks up a localized string similar to Max. costs.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string MessageBikesManagementTariffDescriptionMaxFeeEuroPerDay {
|
public static string MessageBikesManagementTariffDescriptionMaxFeeEuroPerDay {
|
||||||
get {
|
get {
|
||||||
|
|
|
@ -475,7 +475,7 @@ Bitte App neu starten, um Radinfos zu bekommen.</value>
|
||||||
<value>Gratis Nutzung</value>
|
<value>Gratis Nutzung</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MessageBikesManagementTariffDescriptionMaxFeeEuroPerDay" xml:space="preserve">
|
<data name="MessageBikesManagementTariffDescriptionMaxFeeEuroPerDay" xml:space="preserve">
|
||||||
<value>Max. Gebühr</value>
|
<value>Max. Kosten</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MessageBikesManagementTariffDescriptionEuroPerHour" xml:space="preserve">
|
<data name="MessageBikesManagementTariffDescriptionEuroPerHour" xml:space="preserve">
|
||||||
<value>€/Std.</value>
|
<value>€/Std.</value>
|
||||||
|
@ -1165,6 +1165,15 @@ Treten Sie an das Rad heran, schalten Sie Bluetooth und Standortdienste ein und
|
||||||
<br/>
|
<br/>
|
||||||
Außerdem:<br/>
|
Außerdem:<br/>
|
||||||
- Kleinere Fehlerbehebungen<br/>
|
- Kleinere Fehlerbehebungen<br/>
|
||||||
|
- Paketaktualisierungen</value>
|
||||||
|
</data>
|
||||||
|
<data name="MessageAaRideTypeInfoTitle" xml:space="preserve">
|
||||||
|
<value>Nur Kreisfahrten!</value>
|
||||||
|
</data>
|
||||||
|
<data name="ChangeLog_3_0_363_MK_SB" xml:space="preserve">
|
||||||
|
<value>- Räder, die an der Startstation zurückgegeben werden müssen, sind als solche mit einem Symbol und der Stations-ID gekennzeichnet<br/>
|
||||||
|
- Was früher als "Fahrrad zurückgeben" bezeichnet wurde, heißt jetzt "Miete beenden". Vergewissern Sie sich immer, dass Sie Ihre kostenpflichtige Miete beenden!<br/>
|
||||||
|
- Fehlerbehebungen<br/>
|
||||||
- Paketaktualisierungen</value>
|
- Paketaktualisierungen</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -581,7 +581,7 @@ Please restart app in order to get bike info.</value>
|
||||||
<value>€/hour</value>
|
<value>€/hour</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MessageBikesManagementTariffDescriptionFeeEuroPerHour" xml:space="preserve">
|
<data name="MessageBikesManagementTariffDescriptionFeeEuroPerHour" xml:space="preserve">
|
||||||
<value>Rental charges</value>
|
<value>Rental costs</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MessageBikesManagementTariffDescriptionFreeTimePerSession" xml:space="preserve">
|
<data name="MessageBikesManagementTariffDescriptionFreeTimePerSession" xml:space="preserve">
|
||||||
<value>Free use</value>
|
<value>Free use</value>
|
||||||
|
@ -590,7 +590,7 @@ Please restart app in order to get bike info.</value>
|
||||||
<value>hour(s)/day</value>
|
<value>hour(s)/day</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MessageBikesManagementTariffDescriptionMaxFeeEuroPerDay" xml:space="preserve">
|
<data name="MessageBikesManagementTariffDescriptionMaxFeeEuroPerDay" xml:space="preserve">
|
||||||
<value>Max. charges</value>
|
<value>Max. costs</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MessageBikesManagementTariffDescriptionTariffHeader" xml:space="preserve">
|
<data name="MessageBikesManagementTariffDescriptionTariffHeader" xml:space="preserve">
|
||||||
<value>Tariff</value>
|
<value>Tariff</value>
|
||||||
|
@ -1254,6 +1254,15 @@ Approach the bike, turn on Bluetooth and Location services and try again.</value
|
||||||
<br/>
|
<br/>
|
||||||
Also:<br/>
|
Also:<br/>
|
||||||
- Minor bug fixes<br/>
|
- Minor bug fixes<br/>
|
||||||
|
- Package updates</value>
|
||||||
|
</data>
|
||||||
|
<data name="MessageAaRideTypeInfoTitle" xml:space="preserve">
|
||||||
|
<value>Circular drives only!</value>
|
||||||
|
</data>
|
||||||
|
<data name="ChangeLog_3_0_363_MK_SB" xml:space="preserve">
|
||||||
|
<value>- Bikes that must be returned to the starting station are marked as such with an icon and the station id.<br/>
|
||||||
|
- What used to be called 'return bike' is now called 'end rental'. Always make sure to end your chargeable rental!<br/>
|
||||||
|
- Bug fixes<br/>
|
||||||
- Package updates</value>
|
- Package updates</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -20,8 +20,7 @@
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="ActionCloseAndReturn" translate="yes" xml:space="preserve">
|
<trans-unit id="ActionCloseAndReturn" translate="yes" xml:space="preserve">
|
||||||
<source>Close lock & end rental</source>
|
<source>Close lock & end rental</source>
|
||||||
<target state="needs-review-translation">Schloss schließen & Miete beenden</target>
|
<target state="translated">Schloss schließen & Miete beenden</target>
|
||||||
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="ActionOpen" translate="yes" xml:space="preserve">
|
<trans-unit id="ActionOpen" translate="yes" xml:space="preserve">
|
||||||
<source>Open lock</source>
|
<source>Open lock</source>
|
||||||
|
@ -41,8 +40,7 @@
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="ActionReturn" translate="yes" xml:space="preserve">
|
<trans-unit id="ActionReturn" translate="yes" xml:space="preserve">
|
||||||
<source>End rental</source>
|
<source>End rental</source>
|
||||||
<target state="needs-review-translation">Miete beenden</target>
|
<target state="translated">Miete beenden</target>
|
||||||
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="MarkingMapPage" translate="yes" xml:space="preserve">
|
<trans-unit id="MarkingMapPage" translate="yes" xml:space="preserve">
|
||||||
<source>Bike Locations</source>
|
<source>Bike Locations</source>
|
||||||
|
@ -307,8 +305,7 @@ Bitte melden Sie sich erneut an.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="ActionLoginRegister" translate="yes" xml:space="preserve">
|
<trans-unit id="ActionLoginRegister" translate="yes" xml:space="preserve">
|
||||||
<source>Register for free</source>
|
<source>Register for free</source>
|
||||||
<target state="needs-review-translation">Kostenlos registrieren</target>
|
<target state="translated">Kostenlos registrieren</target>
|
||||||
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="MarkingLoginEmailAddressLabel" translate="yes" xml:space="preserve">
|
<trans-unit id="MarkingLoginEmailAddressLabel" translate="yes" xml:space="preserve">
|
||||||
<source>E-mail</source>
|
<source>E-mail</source>
|
||||||
|
@ -628,16 +625,17 @@ Bitte App neu starten, um Radinfos zu bekommen.</target>
|
||||||
<target state="translated">Abo-Preis</target>
|
<target state="translated">Abo-Preis</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="MessageBikesManagementTariffDescriptionFeeEuroPerHour" translate="yes" xml:space="preserve">
|
<trans-unit id="MessageBikesManagementTariffDescriptionFeeEuroPerHour" translate="yes" xml:space="preserve">
|
||||||
<source>Rental charges</source>
|
<source>Rental costs</source>
|
||||||
<target state="translated">Mietkosten</target>
|
<target state="translated">Mietkosten</target>
|
||||||
|
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="MessageBikesManagementTariffDescriptionFreeTimePerSession" translate="yes" xml:space="preserve">
|
<trans-unit id="MessageBikesManagementTariffDescriptionFreeTimePerSession" translate="yes" xml:space="preserve">
|
||||||
<source>Free use</source>
|
<source>Free use</source>
|
||||||
<target state="translated">Gratis Nutzung</target>
|
<target state="translated">Gratis Nutzung</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="MessageBikesManagementTariffDescriptionMaxFeeEuroPerDay" translate="yes" xml:space="preserve">
|
<trans-unit id="MessageBikesManagementTariffDescriptionMaxFeeEuroPerDay" translate="yes" xml:space="preserve">
|
||||||
<source>Max. charges</source>
|
<source>Max. costs</source>
|
||||||
<target state="needs-review-translation">Max. Gebühr</target>
|
<target state="translated">Max. Kosten</target>
|
||||||
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="MessageBikesManagementTariffDescriptionEuroPerHour" translate="yes" xml:space="preserve">
|
<trans-unit id="MessageBikesManagementTariffDescriptionEuroPerHour" translate="yes" xml:space="preserve">
|
||||||
|
@ -729,7 +727,7 @@ Bitte kontaktieren sie den Betreiber!</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="ChangeLog3_0_227" translate="yes" xml:space="preserve">
|
<trans-unit id="ChangeLog3_0_227" translate="yes" xml:space="preserve">
|
||||||
<source>Feedback dialog added which is shown after ending rental.</source>
|
<source>Feedback dialog added which is shown after ending rental.</source>
|
||||||
<target state="needs-review-translation">Seite zur Eingabe von Rückmeldungen hinzugefügt, der nach Rückgabe eines Rads angezeigt wird.</target>
|
<target state="translated">Seite zur Eingabe von Rückmeldungen hinzugefügt, der nach Rückgabe eines Rads angezeigt wird.</target>
|
||||||
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="ActivityTextConnectionStateOffline" translate="yes" xml:space="preserve">
|
<trans-unit id="ActivityTextConnectionStateOffline" translate="yes" xml:space="preserve">
|
||||||
|
@ -784,7 +782,7 @@ Layout Anzeige Radnamen und nummern verbessert.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="ChangeLog3_0_237" translate="yes" xml:space="preserve">
|
<trans-unit id="ChangeLog3_0_237" translate="yes" xml:space="preserve">
|
||||||
<source>Hard- and software information send to backend when ending rental.</source>
|
<source>Hard- and software information send to backend when ending rental.</source>
|
||||||
<target state="needs-review-translation">Hard- und software information werden an Backend übermittelt bei Radrückgabe.</target>
|
<target state="translated">Hard- und software information werden an Backend übermittelt bei Radrückgabe.</target>
|
||||||
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="ChangeLog3_0_239" translate="yes" xml:space="preserve">
|
<trans-unit id="ChangeLog3_0_239" translate="yes" xml:space="preserve">
|
||||||
|
@ -875,8 +873,7 @@ Kleinere Verbesserungen.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="MessageErrorQueryLocationTitle" translate="yes" xml:space="preserve">
|
<trans-unit id="MessageErrorQueryLocationTitle" translate="yes" xml:space="preserve">
|
||||||
<source>Error query location!</source>
|
<source>Error query location!</source>
|
||||||
<target state="needs-review-translation">Fehler bei Standortabfrage!</target>
|
<target state="translated">Fehler bei Standortabfrage!</target>
|
||||||
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="MessageErrorQueryLocationMessage" translate="yes" xml:space="preserve">
|
<trans-unit id="MessageErrorQueryLocationMessage" translate="yes" xml:space="preserve">
|
||||||
<source>Closing the lock and ending the rental is not possible.</source>
|
<source>Closing the lock and ending the rental is not possible.</source>
|
||||||
|
@ -884,7 +881,7 @@ Kleinere Verbesserungen.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="MessageErrorQueryLocationStartTitle" translate="yes" xml:space="preserve">
|
<trans-unit id="MessageErrorQueryLocationStartTitle" translate="yes" xml:space="preserve">
|
||||||
<source>Error start query location!</source>
|
<source>Error start query location!</source>
|
||||||
<target state="needs-review-translation">Fehler beim Start der Standortabfrage!</target>
|
<target state="translated">Fehler beim Start der Standortabfrage!</target>
|
||||||
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="ActivityTextErrorQueryLocationWhenAny" translate="yes" xml:space="preserve">
|
<trans-unit id="ActivityTextErrorQueryLocationWhenAny" translate="yes" xml:space="preserve">
|
||||||
|
@ -1239,12 +1236,12 @@ Kleinere Fehlerbehebungen.
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="ActionContactMailAppReleated" translate="yes" xml:space="preserve">
|
<trans-unit id="ActionContactMailAppReleated" translate="yes" xml:space="preserve">
|
||||||
<source>Feedback about the app</source>
|
<source>Feedback about the app</source>
|
||||||
<target state="needs-review-translation">Rückmeldung zur App</target>
|
<target state="translated">Rückmeldung zur App</target>
|
||||||
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="MiscContactMailAppReleatedSubject" translate="yes" xml:space="preserve">
|
<trans-unit id="MiscContactMailAppReleatedSubject" translate="yes" xml:space="preserve">
|
||||||
<source>{0}-app releated request</source>
|
<source>{0}-app releated request</source>
|
||||||
<target state="needs-review-translation">{0}-App Anfrage</target>
|
<target state="translated">{0}-App Anfrage</target>
|
||||||
<note from="MultilingualBuild" annotates="source" priority="2">Subject of contact mail to ("Feedback about the app").</note>
|
<note from="MultilingualBuild" annotates="source" priority="2">Subject of contact mail to ("Feedback about the app").</note>
|
||||||
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
@ -1567,7 +1564,7 @@ Wichtig: Schicken Sie eine E-Mail an den Betreiber (ansonsten läuft Ihre kosten
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="MarkingNoNetworkConnection" translate="yes" xml:space="preserve">
|
<trans-unit id="MarkingNoNetworkConnection" translate="yes" xml:space="preserve">
|
||||||
<source>Oops, there is no Internet connection.</source>
|
<source>Oops, there is no Internet connection.</source>
|
||||||
<target state="needs-review-translation">Ups, es ist keine Internetverbindung vorhanden.</target>
|
<target state="translated">Ups, es ist keine Internetverbindung vorhanden.</target>
|
||||||
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="ChangeLog_3_0_358_MK_SB" translate="yes" xml:space="preserve">
|
<trans-unit id="ChangeLog_3_0_358_MK_SB" translate="yes" xml:space="preserve">
|
||||||
|
@ -1614,6 +1611,21 @@ Also:<br/>
|
||||||
<br/>
|
<br/>
|
||||||
Außerdem:<br/>
|
Außerdem:<br/>
|
||||||
- Kleinere Fehlerbehebungen<br/>
|
- Kleinere Fehlerbehebungen<br/>
|
||||||
|
- Paketaktualisierungen</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="MessageAaRideTypeInfoTitle" translate="yes" xml:space="preserve">
|
||||||
|
<source>Circular drives only!</source>
|
||||||
|
<target state="translated">Nur Kreisfahrten!</target>
|
||||||
|
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="ChangeLog_3_0_363_MK_SB" translate="yes" xml:space="preserve">
|
||||||
|
<source>- Bikes that must be returned to the starting station are marked as such with an icon and the station id.<br/>
|
||||||
|
- What used to be called 'return bike' is now called 'end rental'. Always make sure to end your chargeable rental!<br/>
|
||||||
|
- Bug fixes<br/>
|
||||||
|
- Package updates</source>
|
||||||
|
<target state="translated">- Räder, die an der Startstation zurückgegeben werden müssen, sind als solche mit einem Symbol und der Stations-ID gekennzeichnet<br/>
|
||||||
|
- Was früher als "Fahrrad zurückgeben" bezeichnet wurde, heißt jetzt "Miete beenden". Vergewissern Sie sich immer, dass Sie Ihre kostenpflichtige Miete beenden!<br/>
|
||||||
|
- Fehlerbehebungen<br/>
|
||||||
- Paketaktualisierungen</target>
|
- Paketaktualisierungen</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
</group>
|
</group>
|
||||||
|
|
|
@ -13,6 +13,7 @@ using TINK.Model.Logging;
|
||||||
using TINK.Repository.Exception;
|
using TINK.Repository.Exception;
|
||||||
using TINK.Repository.Request;
|
using TINK.Repository.Request;
|
||||||
using TINK.Repository.Response;
|
using TINK.Repository.Response;
|
||||||
|
using TINK.Repository.Response.Stations;
|
||||||
|
|
||||||
namespace TINK.Repository
|
namespace TINK.Repository
|
||||||
{
|
{
|
||||||
|
@ -24,7 +25,7 @@ namespace TINK.Repository
|
||||||
|
|
||||||
/// <summary> Initializes a instance of the copri calls https object. </summary>
|
/// <summary> Initializes a instance of the copri calls https object. </summary>
|
||||||
/// <param name="copriHost">Host to connect to. </param>
|
/// <param name="copriHost">Host to connect to. </param>
|
||||||
/// <param name="appContextInfo">Provides app related info (app name and version, merchantid) to pass to COPRI.</param>
|
/// <param name="appContextInfo">Provides app related info (app name and version, merchant id) to pass to COPRI.</param>
|
||||||
/// <param name="uiIsoLangugageName">Two letter ISO language name.</param>
|
/// <param name="uiIsoLangugageName">Two letter ISO language name.</param>
|
||||||
/// <param name="smartDevice">Holds info about smart device.</param>
|
/// <param name="smartDevice">Holds info about smart device.</param>
|
||||||
/// <param name="sessionCookie">Session cookie if user is logged in, null otherwise.</param>
|
/// <param name="sessionCookie">Session cookie if user is logged in, null otherwise.</param>
|
||||||
|
@ -50,7 +51,7 @@ namespace TINK.Repository
|
||||||
/// <summary> Holds the URL for rest calls.</summary>
|
/// <summary> Holds the URL for rest calls.</summary>
|
||||||
private Uri m_oCopriHost;
|
private Uri m_oCopriHost;
|
||||||
|
|
||||||
/// <summary> Spacifies name and version of app. </summary>
|
/// <summary> Specifies name and version of app. </summary>
|
||||||
private string UserAgent { get; }
|
private string UserAgent { get; }
|
||||||
|
|
||||||
/// <summary> Returns true because value requested form copri server are returned. </summary>
|
/// <summary> Returns true because value requested form copri server are returned. </summary>
|
||||||
|
@ -63,7 +64,7 @@ namespace TINK.Repository
|
||||||
public string SessionCookie => requestBuilder.SessionCookie;
|
public string SessionCookie => requestBuilder.SessionCookie;
|
||||||
|
|
||||||
/// <summary> Logs user in. </summary>
|
/// <summary> Logs user in. </summary>
|
||||||
/// <param name="mailAddress">Mailaddress of user to log in.</param>
|
/// <param name="mailAddress">Mail address of user to log in.</param>
|
||||||
/// <param name="password">Password to log in.</param>
|
/// <param name="password">Password to log in.</param>
|
||||||
/// <param name="deviceId">Id specifying user and hardware.</param>
|
/// <param name="deviceId">Id specifying user and hardware.</param>
|
||||||
/// <remarks>Response which holds auth cookie <see cref="ResponseBase.authcookie"/></remarks>
|
/// <remarks>Response which holds auth cookie <see cref="ResponseBase.authcookie"/></remarks>
|
||||||
|
@ -87,7 +88,7 @@ namespace TINK.Repository
|
||||||
public async Task<BikesAvailableResponse> GetBikesAvailableAsync()
|
public async Task<BikesAvailableResponse> GetBikesAvailableAsync()
|
||||||
=> await GetBikesAvailableAsync(m_oCopriHost.AbsoluteUri, requestBuilder.GetBikesAvailable(), UserAgent);
|
=> await GetBikesAvailableAsync(m_oCopriHost.AbsoluteUri, requestBuilder.GetBikesAvailable(), UserAgent);
|
||||||
|
|
||||||
/// <summary> Gets a list of bikes reserved/ booked by acctive user. </summary>
|
/// <summary> Gets a list of bikes reserved/ booked by active user. </summary>
|
||||||
/// <returns>Response holding list of bikes.</returns>
|
/// <returns>Response holding list of bikes.</returns>
|
||||||
public async Task<BikesReservedOccupiedResponse> GetBikesOccupiedAsync()
|
public async Task<BikesReservedOccupiedResponse> GetBikesOccupiedAsync()
|
||||||
{
|
{
|
||||||
|
@ -127,7 +128,7 @@ namespace TINK.Repository
|
||||||
requestBuilder.DoReserve(bikeId),
|
requestBuilder.DoReserve(bikeId),
|
||||||
UserAgent);
|
UserAgent);
|
||||||
|
|
||||||
/// <summary> Gets canel booking request response.</summary>
|
/// <summary> Gets cancel booking request response.</summary>
|
||||||
/// <param name="bikeId">Id of the bike to book.</param>
|
/// <param name="bikeId">Id of the bike to book.</param>
|
||||||
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
||||||
/// <returns>Response on cancel booking request.</returns>
|
/// <returns>Response on cancel booking request.</returns>
|
||||||
|
@ -183,13 +184,13 @@ namespace TINK.Repository
|
||||||
requestBuilder.UpateLockingState(bikeId, state, location, batteryLevel, versionInfo),
|
requestBuilder.UpateLockingState(bikeId, state, location, batteryLevel, versionInfo),
|
||||||
UserAgent);
|
UserAgent);
|
||||||
|
|
||||||
/// <summary> Gets booking request request. </summary>
|
/// <summary> Gets booking request. </summary>
|
||||||
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
||||||
/// <param name="bikeId">Id of the bike to book.</param>
|
/// <param name="bikeId">Id of the bike to book.</param>
|
||||||
/// <param name="guid">Used to publish GUID from app to copri. Used for initial setup of bike in copri.</param>
|
/// <param name="guid">Used to publish GUID from app to copri. Used for initial setup of bike in copri.</param>
|
||||||
/// <param name="batteryPercentage">Holds the filling level percentage of the battery.</param>
|
/// <param name="batteryPercentage">Holds the filling level percentage of the battery.</param>
|
||||||
/// <param name="nextAction">If not null next locking action which is performed after booking.</param>
|
/// <param name="nextAction">If not null next locking action which is performed after booking.</param>
|
||||||
/// <returns>Requst on booking request.</returns>
|
/// <returns>Request on booking request.</returns>
|
||||||
public async Task<ReservationBookingResponse> DoBookAsync(
|
public async Task<ReservationBookingResponse> DoBookAsync(
|
||||||
Uri operatorUri,
|
Uri operatorUri,
|
||||||
string bikeId,
|
string bikeId,
|
||||||
|
@ -296,7 +297,7 @@ namespace TINK.Repository
|
||||||
copriHost,
|
copriHost,
|
||||||
command,
|
command,
|
||||||
userAgent,
|
userAgent,
|
||||||
displayCommand); // Do not include password into exception output when an error occurres.
|
displayCommand); // Do not include password into exception output when an error occurs.
|
||||||
}
|
}
|
||||||
catch (System.Exception l_oException)
|
catch (System.Exception l_oException)
|
||||||
{
|
{
|
||||||
|
@ -437,7 +438,7 @@ namespace TINK.Repository
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Gets a list of bikes reserved/ booked by acctive user from Copri.</summary>
|
/// <summary> Gets a list of bikes reserved/ booked by active user from Copri.</summary>
|
||||||
/// <param name="copriHost">URL of the copri host to connect to.</param>
|
/// <param name="copriHost">URL of the copri host to connect to.</param>
|
||||||
/// <param name="command">Command to post.</param>
|
/// <param name="command">Command to post.</param>
|
||||||
/// <returns>Response holding list of bikes.</returns>
|
/// <returns>Response holding list of bikes.</returns>
|
||||||
|
@ -785,8 +786,8 @@ namespace TINK.Repository
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> http get- request.</summary>
|
/// <summary> Https get- request.</summary>
|
||||||
/// <param name="Url">Ulr to get info from.</param>
|
/// <param name="Url">Url to get info from.</param>
|
||||||
/// <returns>response from server</returns>
|
/// <returns>response from server</returns>
|
||||||
public static async Task<string> Get(string Url)
|
public static async Task<string> Get(string Url)
|
||||||
{
|
{
|
||||||
|
@ -804,7 +805,7 @@ namespace TINK.Repository
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> http- post request.</summary>
|
/// <summary> Https- post request.</summary>
|
||||||
/// <param name="command">Command to send.</param>
|
/// <param name="command">Command to send.</param>
|
||||||
/// <param name="displayCommand">Command to display/ log used for error handling.</param>
|
/// <param name="displayCommand">Command to display/ log used for error handling.</param>
|
||||||
/// <param name="uRL">Address of server to communicate with.</param>
|
/// <param name="uRL">Address of server to communicate with.</param>
|
||||||
|
@ -838,7 +839,7 @@ namespace TINK.Repository
|
||||||
#if !WINDOWS_UWP
|
#if !WINDOWS_UWP
|
||||||
var l_strHost = uRL;
|
var l_strHost = uRL;
|
||||||
|
|
||||||
// Returns a http request.
|
// Returns a https request.
|
||||||
var request = WebRequest.CreateHttp(l_strHost);
|
var request = WebRequest.CreateHttp(l_strHost);
|
||||||
|
|
||||||
request.Method = "POST";
|
request.Method = "POST";
|
||||||
|
|
|
@ -5,12 +5,13 @@ using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
using TINK.Model.Connector;
|
using TINK.Model.Connector;
|
||||||
using TINK.Repository.Request;
|
using TINK.Repository.Request;
|
||||||
using TINK.Repository.Response;
|
using TINK.Repository.Response;
|
||||||
|
using TINK.Repository.Response.Stations;
|
||||||
|
|
||||||
namespace TINK.Repository
|
namespace TINK.Repository
|
||||||
{
|
{
|
||||||
public class CopriCallsMemory : ICopriServer
|
public class CopriCallsMemory : ICopriServer
|
||||||
{
|
{
|
||||||
/// <summary> Part in file specifying apiserver.</summary>
|
/// <summary> Part in file specifying api server.</summary>
|
||||||
private static string CopriDevelHostUri = @"https://tinkwwp.copri-bike.de/APIjsonserver";
|
private static string CopriDevelHostUri = @"https://tinkwwp.copri-bike.de/APIjsonserver";
|
||||||
|
|
||||||
public const string DO_AUTH_Unknown_User_FILE = @"
|
public const string DO_AUTH_Unknown_User_FILE = @"
|
||||||
|
@ -1335,7 +1336,7 @@ namespace TINK.Repository
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a list of bikes reserved/ booked by acctive user from Copri.
|
/// Gets a list of bikes reserved/ booked by active user from Copri.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="p_strSessionCookie">Cookie to authenticate user.</param>
|
/// <param name="p_strSessionCookie">Cookie to authenticate user.</param>
|
||||||
/// <returns>Response holding list of bikes.</returns>
|
/// <returns>Response holding list of bikes.</returns>
|
||||||
|
@ -1343,7 +1344,7 @@ namespace TINK.Repository
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
requestBuilder.GetBikesOccupied(); // Non mock implementation if ICopriServer call this member as well. To ensure comparable behaviour this member is called here as well.
|
requestBuilder.GetBikesOccupied(); // Non mock implementation if ICopriServer call this member as well. To ensure comparable behavior this member is called here as well.
|
||||||
}
|
}
|
||||||
catch (NotSupportedException)
|
catch (NotSupportedException)
|
||||||
{
|
{
|
||||||
|
@ -1673,7 +1674,7 @@ namespace TINK.Repository
|
||||||
=> null;
|
=> null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a list of bikes reserved/ booked by acctive user from Copri.
|
/// Gets a list of bikes reserved/ booked by active user from Copri.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sessionCookie">Cookie to authenticate user.</param>
|
/// <param name="sessionCookie">Cookie to authenticate user.</param>
|
||||||
/// <param name="SampleSet">Sample set to use.</param>
|
/// <param name="SampleSet">Sample set to use.</param>
|
||||||
|
|
|
@ -8,6 +8,7 @@ using TINK.Model.Device;
|
||||||
using TINK.Model.Services.CopriApi;
|
using TINK.Model.Services.CopriApi;
|
||||||
using TINK.Repository.Request;
|
using TINK.Repository.Request;
|
||||||
using TINK.Repository.Response;
|
using TINK.Repository.Response;
|
||||||
|
using TINK.Repository.Response.Stations;
|
||||||
|
|
||||||
namespace TINK.Repository
|
namespace TINK.Repository
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,9 +3,9 @@ using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
using TINK.Model.Connector;
|
using TINK.Model.Connector;
|
||||||
using TINK.Model.Device;
|
|
||||||
using TINK.Repository.Request;
|
using TINK.Repository.Request;
|
||||||
using TINK.Repository.Response;
|
using TINK.Repository.Response;
|
||||||
|
using TINK.Repository.Response.Stations;
|
||||||
|
|
||||||
namespace TINK.Repository
|
namespace TINK.Repository
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@ namespace TINK.Repository
|
||||||
public interface ICopriServerBase
|
public interface ICopriServerBase
|
||||||
{
|
{
|
||||||
/// <summary> Logs user in. </summary>
|
/// <summary> Logs user in. </summary>
|
||||||
/// <param name="mailAddress">Mailaddress of user to log in.</param>
|
/// <param name="mailAddress">Mail address of user to log in.</param>
|
||||||
/// <param name="password">Password to log in.</param>
|
/// <param name="password">Password to log in.</param>
|
||||||
/// <param name="deviceId">Id specifying user and hardware.</param>
|
/// <param name="deviceId">Id specifying user and hardware.</param>
|
||||||
/// <remarks>Response which holds auth cookie <see cref="ResponseBase.authcookie"/></remarks>
|
/// <remarks>Response which holds auth cookie <see cref="ResponseBase.authcookie"/></remarks>
|
||||||
|
@ -34,7 +34,7 @@ namespace TINK.Repository
|
||||||
string bikeId,
|
string bikeId,
|
||||||
Uri operatorUri);
|
Uri operatorUri);
|
||||||
|
|
||||||
/// <summary> Cancels reservation of bik. </summary>
|
/// <summary> Cancels reservation of bike. </summary>
|
||||||
/// <param name="bikeId">Id of the bike to reserve.</param>
|
/// <param name="bikeId">Id of the bike to reserve.</param>
|
||||||
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
||||||
/// <returns>Response on cancel reservation request.</returns>
|
/// <returns>Response on cancel reservation request.</returns>
|
||||||
|
@ -162,7 +162,7 @@ namespace TINK.Repository
|
||||||
/// <returns>Response holding list of bikes.</returns>
|
/// <returns>Response holding list of bikes.</returns>
|
||||||
Task<BikesAvailableResponse> GetBikesAvailableAsync();
|
Task<BikesAvailableResponse> GetBikesAvailableAsync();
|
||||||
|
|
||||||
/// <summary> Gets a list of bikes reserved/ booked by acctive user from Copri.</summary>
|
/// <summary> Gets a list of bikes reserved/ booked by active user from Copri.</summary>
|
||||||
/// <returns>Response holding list of bikes.</returns>
|
/// <returns>Response holding list of bikes.</returns>
|
||||||
Task<BikesReservedOccupiedResponse> GetBikesOccupiedAsync();
|
Task<BikesReservedOccupiedResponse> GetBikesOccupiedAsync();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,10 @@ namespace TINK.Repository.Request
|
||||||
string SessionCookie { get; }
|
string SessionCookie { get; }
|
||||||
|
|
||||||
/// <summary> Gets request to log user in. </summary>
|
/// <summary> Gets request to log user in. </summary>
|
||||||
/// <param name="mailAddress">Mailaddress of user to log in.</param>
|
/// <param name="mailAddress">Mail address of user to log in.</param>
|
||||||
/// <param name="password">Password to log in.</param>
|
/// <param name="password">Password to log in.</param>
|
||||||
/// <param name="deviceId">Id specifying user and hardware.</param>
|
/// <param name="deviceId">Id specifying user and hardware.</param>
|
||||||
/// <remarks>Requst which holds auth cookie <see cref="RequstBase.authcookie"/></remarks>
|
/// <remarks>Request which holds auth cookie <see cref="RequstBase.authcookie"/></remarks>
|
||||||
string DoAuthorization(
|
string DoAuthorization(
|
||||||
string mailAddress,
|
string mailAddress,
|
||||||
string password,
|
string password,
|
||||||
|
@ -37,7 +37,7 @@ namespace TINK.Repository.Request
|
||||||
/// <returns>Request to query list of bikes available.</returns>
|
/// <returns>Request to query list of bikes available.</returns>
|
||||||
string GetBikesAvailable();
|
string GetBikesAvailable();
|
||||||
|
|
||||||
/// <summary> Gets a list of bikes reserved/ booked by acctive user from Copri.</summary>
|
/// <summary> Gets a list of bikes reserved/ booked by active user from Copri.</summary>
|
||||||
/// <returns>Request to query list of bikes occupied.</returns>
|
/// <returns>Request to query list of bikes occupied.</returns>
|
||||||
string GetBikesOccupied();
|
string GetBikesOccupied();
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ namespace TINK.Repository.Request
|
||||||
SmartDevice.GetSmartDeviceParameters() +
|
SmartDevice.GetSmartDeviceParameters() +
|
||||||
UiIsoLanguageNameParameter;
|
UiIsoLanguageNameParameter;
|
||||||
|
|
||||||
/// <summary> Gets a list of bikes reserved/ booked by acctive user from Copri.</summary>
|
/// <summary> Gets a list of bikes reserved/ booked by active user from Copri.</summary>
|
||||||
/// <returns>Request to query list of bikes occupied.</returns>
|
/// <returns>Request to query list of bikes occupied.</returns>
|
||||||
public string GetBikesOccupied()
|
public string GetBikesOccupied()
|
||||||
=> throw new NotSupportedException();
|
=> throw new NotSupportedException();
|
||||||
|
|
|
@ -78,7 +78,7 @@ namespace TINK.Repository.Request
|
||||||
AuthCookieParameter +
|
AuthCookieParameter +
|
||||||
UiIsoLanguageNameParameter;
|
UiIsoLanguageNameParameter;
|
||||||
|
|
||||||
/// <summary> Gets a list of bikes reserved/ booked by acctive user from Copri.</summary>
|
/// <summary> Gets a list of bikes reserved/ booked by active user from Copri.</summary>
|
||||||
/// <returns>Request to query list of bikes occupied.</returns>
|
/// <returns>Request to query list of bikes occupied.</returns>
|
||||||
public string GetBikesOccupied()
|
public string GetBikesOccupied()
|
||||||
=> "request=user_bikes_occupied&system=all&genkey=1" +
|
=> "request=user_bikes_occupied&system=all&genkey=1" +
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
namespace TINK.Repository.Response
|
namespace TINK.Repository.Response
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ namespace TINK.Repository.Response
|
||||||
public string station { get; private set; }
|
public string station { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds the localized (german) description of the bike.
|
/// Holds the localized (German) description of the bike.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember]
|
[DataMember]
|
||||||
public string description { get; private set; }
|
public string description { get; private set; }
|
||||||
|
@ -78,6 +78,12 @@ namespace TINK.Repository.Response
|
||||||
/// <summary> Describes type of the bike.</summary>
|
/// <summary> Describes type of the bike.</summary>
|
||||||
public BikeType bike_type { get; private set; }
|
public BikeType bike_type { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Holds whether bike is a AA bike (bike must be always returned a the same station) or AB bike (start and end stations can be different stations).
|
||||||
|
/// </summary>
|
||||||
|
[DataMember]
|
||||||
|
public string aa_ride { get; private set; }
|
||||||
|
|
||||||
/// <summary> Loading state of motor battery in % ]0..100[. </summary>
|
/// <summary> Loading state of motor battery in % ]0..100[. </summary>
|
||||||
[DataMember]
|
[DataMember]
|
||||||
public string bike_charge { get; private set; }
|
public string bike_charge { get; private set; }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
namespace TINK.Repository.Response
|
namespace TINK.Repository.Response
|
||||||
{
|
{
|
||||||
|
@ -40,7 +40,7 @@ namespace TINK.Repository.Response
|
||||||
public string charge_current_percent { get; private set; }
|
public string charge_current_percent { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds the maximum chargeing level of the battery in bars.
|
/// Holds the maximum charging level of the battery in bars.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember]
|
[DataMember]
|
||||||
public string charge_max_bars { get; private set; }
|
public string charge_max_bars { get; private set; }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using TINK.MultilingualResources;
|
using TINK.MultilingualResources;
|
||||||
using TINK.Repository.Exception;
|
using TINK.Repository.Exception;
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ namespace TINK.Repository.Response
|
||||||
|
|
||||||
/// <summary>Gets if a call to reserve bike succeeded or not by checking a booking response.</summary>
|
/// <summary>Gets if a call to reserve bike succeeded or not by checking a booking response.</summary>
|
||||||
/// <param name="bikeId">Id of bike which should be booked.</param>
|
/// <param name="bikeId">Id of bike which should be booked.</param>
|
||||||
/// <param name="sessionCookie">Sessiong cookie of logged in user.</param>
|
/// <param name="sessionCookie">Session cookie of logged in user.</param>
|
||||||
/// <param name="bookingResponse">Response to check.</param>
|
/// <param name="bookingResponse">Response to check.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static BikeInfoReservedOrBooked GetIsReserveResponseOk(
|
public static BikeInfoReservedOrBooked GetIsReserveResponseOk(
|
||||||
|
|
27
TINKLib/Repository/Response/Stations/Station/OperatorData.cs
Normal file
27
TINKLib/Repository/Response/Stations/Station/OperatorData.cs
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
|
namespace TINK.Repository.Response.Stations.Station
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Holds info about operator data.
|
||||||
|
/// </summary>
|
||||||
|
[DataContract]
|
||||||
|
public class OperatorData
|
||||||
|
{
|
||||||
|
[DataMember]
|
||||||
|
public string operator_name { get; private set; }
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
|
public string operator_phone { get; private set; }
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
|
public string operator_hours { get; private set; }
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
|
public string operator_email { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
|
public string operator_color { get; private set; }
|
||||||
|
}
|
||||||
|
}
|
32
TINKLib/Repository/Response/Stations/Station/StationInfo.cs
Normal file
32
TINKLib/Repository/Response/Stations/Station/StationInfo.cs
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
|
namespace TINK.Repository.Response.Stations.Station
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Holds info about a single station.
|
||||||
|
/// </summary>
|
||||||
|
[DataContract]
|
||||||
|
public class StationInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Unique id of the station.
|
||||||
|
/// </summary>
|
||||||
|
[DataMember]
|
||||||
|
public string station { get; private set; }
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
|
public string[] station_group { get; private set; }
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
|
public string description { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Position of the station.
|
||||||
|
/// </summary>
|
||||||
|
[DataMember]
|
||||||
|
public Position gps { get; private set; }
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
|
public OperatorData operator_data { get; private set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using TINK.Repository.Response.Stations.Station;
|
||||||
|
|
||||||
|
namespace TINK.Repository.Response.Stations
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Holds the information about all stations and is used for deserialization of copri answer.
|
||||||
|
/// </summary>
|
||||||
|
[DataContract]
|
||||||
|
public class StationsAvailableResponse : ResponseBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Dictionary of bikes.
|
||||||
|
/// </summary>
|
||||||
|
[DataMember]
|
||||||
|
public Dictionary<string, StationInfo> stations { get; private set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,69 +0,0 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Runtime.Serialization;
|
|
||||||
|
|
||||||
namespace TINK.Repository.Response
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Holds the information about all stations and is used for deserialization of copri answer.
|
|
||||||
/// </summary>
|
|
||||||
[DataContract]
|
|
||||||
public class StationsAvailableResponse : ResponseBase
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Holds info about a single station.
|
|
||||||
/// </summary>
|
|
||||||
[DataContract]
|
|
||||||
public class StationInfo
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Holds info about opertor data.
|
|
||||||
/// </summary>
|
|
||||||
[DataContract]
|
|
||||||
public class OperatorData
|
|
||||||
{
|
|
||||||
[DataMember]
|
|
||||||
public string operator_name { get; private set; }
|
|
||||||
|
|
||||||
[DataMember]
|
|
||||||
public string operator_phone { get; private set; }
|
|
||||||
|
|
||||||
[DataMember]
|
|
||||||
public string operator_hours { get; private set; }
|
|
||||||
|
|
||||||
[DataMember]
|
|
||||||
public string operator_email { get; private set; }
|
|
||||||
|
|
||||||
|
|
||||||
[DataMember]
|
|
||||||
public string operator_color { get; private set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unique id of the station.
|
|
||||||
/// </summary>
|
|
||||||
[DataMember]
|
|
||||||
public string station { get; private set; }
|
|
||||||
|
|
||||||
[DataMember]
|
|
||||||
public string[] station_group { get; private set; }
|
|
||||||
|
|
||||||
[DataMember]
|
|
||||||
public string description { get; private set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Position of the station.
|
|
||||||
/// </summary>
|
|
||||||
[DataMember]
|
|
||||||
public Position gps { get; private set; }
|
|
||||||
|
|
||||||
[DataMember]
|
|
||||||
public OperatorData operator_data { get; private set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Dictionary of bikes.
|
|
||||||
/// </summary>
|
|
||||||
[DataMember]
|
|
||||||
public Dictionary<string, StationInfo> stations { get; private set; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
@ -10,13 +10,13 @@ using TINK.Services.BluetoothLock.Tdo;
|
||||||
namespace TINK.Services.BluetoothLock
|
namespace TINK.Services.BluetoothLock
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Facke locks service implementation which simulates locks which are in reach.
|
/// Fake locks service implementation which simulates locks which are in reach.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LocksServiceInReach : ILocksServiceFake
|
public class LocksServiceInReach : ILocksServiceFake
|
||||||
{
|
{
|
||||||
private IEnumerable<LockInfoTdo> LocksInfo { get; set; } = new List<LockInfoTdo>();
|
private IEnumerable<LockInfoTdo> LocksInfo { get; set; } = new List<LockInfoTdo>();
|
||||||
|
|
||||||
/// <summary> Holds timeout values for series of connecting attemps to a lock or multiple locks. </summary>
|
/// <summary> Holds timeout values for series of connecting attempts to a lock or multiple locks. </summary>
|
||||||
public ITimeOutProvider TimeOut { get; set; }
|
public ITimeOutProvider TimeOut { get; set; }
|
||||||
|
|
||||||
/// <summary> Connects to lock.</summary>
|
/// <summary> Connects to lock.</summary>
|
||||||
|
@ -45,7 +45,7 @@ namespace TINK.Services.BluetoothLock
|
||||||
switch (bikeInfo.State.Value)
|
switch (bikeInfo.State.Value)
|
||||||
{
|
{
|
||||||
case InUseStateEnum.Disposable:
|
case InUseStateEnum.Disposable:
|
||||||
case InUseStateEnum.FeedbackPending: // State feedback pending does not exist for bluetooth locks but maches from bluetooth perspective state disposable.
|
case InUseStateEnum.FeedbackPending: // State feedback pending does not exist for bluetooth locks but matches from bluetooth perspective state disposable.
|
||||||
switch (lockInfo.State)
|
switch (lockInfo.State)
|
||||||
{
|
{
|
||||||
case LockingState.Open:
|
case LockingState.Open:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
@ -9,13 +9,13 @@ using TINK.Services.BluetoothLock.Tdo;
|
||||||
namespace TINK.Services.BluetoothLock
|
namespace TINK.Services.BluetoothLock
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Facke locks service implementation which simulates locks which are out of reach.
|
/// Fake locks service implementation which simulates locks which are out of reach.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LocksServiceOutOfReach : ILocksServiceFake
|
public class LocksServiceOutOfReach : ILocksServiceFake
|
||||||
{
|
{
|
||||||
private IEnumerable<LockInfoTdo> LocksInfo { get; set; } = new List<LockInfoTdo>();
|
private IEnumerable<LockInfoTdo> LocksInfo { get; set; } = new List<LockInfoTdo>();
|
||||||
|
|
||||||
/// <summary> Holds timeout values for series of connecting attemps to a lock or multiple locks. </summary>
|
/// <summary> Holds timeout values for series of connecting attempts to a lock or multiple locks. </summary>
|
||||||
public ITimeOutProvider TimeOut { get; set; }
|
public ITimeOutProvider TimeOut { get; set; }
|
||||||
|
|
||||||
/// <summary> Connects to lock.</summary>
|
/// <summary> Connects to lock.</summary>
|
||||||
|
@ -26,7 +26,7 @@ namespace TINK.Services.BluetoothLock
|
||||||
return await Task.FromResult(new LockInfoTdo.Builder { Id = authInfo.Id, Guid = authInfo.Guid, State = null }.Build());
|
return await Task.FromResult(new LockInfoTdo.Builder { Id = authInfo.Id, Guid = authInfo.Guid, State = null }.Build());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> No info availalbe because no lock is in reach.</summary>
|
/// <summary> No info centered because no lock is in reach.</summary>
|
||||||
/// <param name="connectTimeout">Timeout for connect operation of a single lock.</param>
|
/// <param name="connectTimeout">Timeout for connect operation of a single lock.</param>
|
||||||
/// <returns>Empty collection.</returns>
|
/// <returns>Empty collection.</returns>
|
||||||
public async Task<IEnumerable<LockInfoTdo>> GetLocksStateAsync(IEnumerable<LockInfoAuthTdo> locksInfo, TimeSpan connectTimeout) => await Task.FromResult(LocksInfo);
|
public async Task<IEnumerable<LockInfoTdo>> GetLocksStateAsync(IEnumerable<LockInfoAuthTdo> locksInfo, TimeSpan connectTimeout) => await Task.FromResult(LocksInfo);
|
||||||
|
|
|
@ -9,6 +9,7 @@ using TINK.Model.Device;
|
||||||
using TINK.Repository;
|
using TINK.Repository;
|
||||||
using TINK.Repository.Request;
|
using TINK.Repository.Request;
|
||||||
using TINK.Repository.Response;
|
using TINK.Repository.Response;
|
||||||
|
using TINK.Repository.Response.Stations;
|
||||||
|
|
||||||
namespace TINK.Model.Services.CopriApi
|
namespace TINK.Model.Services.CopriApi
|
||||||
{
|
{
|
||||||
|
@ -18,7 +19,7 @@ namespace TINK.Model.Services.CopriApi
|
||||||
/// <summary> Object which manages stored copri answers. </summary>
|
/// <summary> Object which manages stored copri answers. </summary>
|
||||||
private ICopriCache CacheServer { get; }
|
private ICopriCache CacheServer { get; }
|
||||||
|
|
||||||
/// <summary> Communicates whith copri server. </summary>
|
/// <summary> Communicates with copri server. </summary>
|
||||||
private ICopriServer HttpsServer { get; }
|
private ICopriServer HttpsServer { get; }
|
||||||
|
|
||||||
/// <summary> True if connector has access to copri server, false if cached values are used. </summary>
|
/// <summary> True if connector has access to copri server, false if cached values are used. </summary>
|
||||||
|
@ -30,9 +31,9 @@ namespace TINK.Model.Services.CopriApi
|
||||||
/// <summary> Gets the merchant id.</summary>
|
/// <summary> Gets the merchant id.</summary>
|
||||||
public string MerchantId => HttpsServer.MerchantId;
|
public string MerchantId => HttpsServer.MerchantId;
|
||||||
|
|
||||||
/// <summary> Constructs copri provider object to connet to https using a cache objet. </summary>
|
/// <summary> Constructs copri provider object to connect to https using a cache object. </summary>
|
||||||
/// <param name="copriHost"></param>
|
/// <param name="copriHost"></param>
|
||||||
/// <param name="appContextInfo">Provides app related info (app name and version, merchantid) to pass to COPRI.</param>
|
/// <param name="appContextInfo">Provides app related info (app name and version, merchant id) to pass to COPRI.</param>
|
||||||
/// <param name="uiIsoLangugageName">Two letter ISO language name.</param>
|
/// <param name="uiIsoLangugageName">Two letter ISO language name.</param>
|
||||||
/// <param name="smartDevice">Holds info about smart device.</param>
|
/// <param name="smartDevice">Holds info about smart device.</param>
|
||||||
/// <param name="sessionCookie">Cookie of user if a user is logged in, false otherwise.</param>
|
/// <param name="sessionCookie">Cookie of user if a user is logged in, false otherwise.</param>
|
||||||
|
@ -68,7 +69,7 @@ namespace TINK.Model.Services.CopriApi
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.ForContext<CopriProviderHttps>().Debug($"Querrying bikes available from copri.");
|
Log.ForContext<CopriProviderHttps>().Debug($"Querying bikes available from copri.");
|
||||||
var bikesAvailableResponse = await HttpsServer.GetBikesAvailableAsync();
|
var bikesAvailableResponse = await HttpsServer.GetBikesAvailableAsync();
|
||||||
return new Result<BikesAvailableResponse>(
|
return new Result<BikesAvailableResponse>(
|
||||||
typeof(CopriCallsHttps),
|
typeof(CopriCallsHttps),
|
||||||
|
@ -78,13 +79,13 @@ namespace TINK.Model.Services.CopriApi
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
// Return response from cache.
|
// Return response from cache.
|
||||||
Log.ForContext<CopriProviderHttps>().Debug("An error occurred querrying bikes available. {Exception}.", exception);
|
Log.ForContext<CopriProviderHttps>().Debug("An error occurred querying bikes available. {Exception}.", exception);
|
||||||
var bikesAvailableResponse = await CacheServer.GetBikesAvailableAsync();
|
var bikesAvailableResponse = await CacheServer.GetBikesAvailableAsync();
|
||||||
return new Result<BikesAvailableResponse>(typeof(CopriCallsMonkeyStore), bikesAvailableResponse, bikesAvailableResponse.GetGeneralData(), exception);
|
return new Result<BikesAvailableResponse>(typeof(CopriCallsMonkeyStore), bikesAvailableResponse, bikesAvailableResponse.GetGeneralData(), exception);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Gets a list of bikes reserved/ booked by acctive user. </summary>
|
/// <summary> Gets a list of bikes reserved/ booked by active user. </summary>
|
||||||
/// <param name="sessionCookie">Cookie to authenticate user.</param>
|
/// <param name="sessionCookie">Cookie to authenticate user.</param>
|
||||||
/// <returns>Response holding list of bikes.</returns>
|
/// <returns>Response holding list of bikes.</returns>
|
||||||
public async Task<Result<BikesReservedOccupiedResponse>> GetBikesOccupied(bool fromCache = false)
|
public async Task<Result<BikesReservedOccupiedResponse>> GetBikesOccupied(bool fromCache = false)
|
||||||
|
@ -101,7 +102,7 @@ namespace TINK.Model.Services.CopriApi
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.ForContext<CopriProviderHttps>().Debug($"Querrying bikes occupied from copri.");
|
Log.ForContext<CopriProviderHttps>().Debug($"Querying bikes occupied from copri.");
|
||||||
var bikesOccupiedResponse = await HttpsServer.GetBikesOccupiedAsync();
|
var bikesOccupiedResponse = await HttpsServer.GetBikesOccupiedAsync();
|
||||||
return new Result<BikesReservedOccupiedResponse>(
|
return new Result<BikesReservedOccupiedResponse>(
|
||||||
typeof(CopriCallsHttps),
|
typeof(CopriCallsHttps),
|
||||||
|
@ -112,7 +113,7 @@ namespace TINK.Model.Services.CopriApi
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
// Return response from cache.
|
// Return response from cache.
|
||||||
Log.ForContext<CopriProviderHttps>().Debug("An error occurred querrying bikes occupied. {Exception}.", exception);
|
Log.ForContext<CopriProviderHttps>().Debug("An error occurred querying bikes occupied. {Exception}.", exception);
|
||||||
var bikesOccupiedResponse = await CacheServer.GetBikesOccupiedAsync();
|
var bikesOccupiedResponse = await CacheServer.GetBikesOccupiedAsync();
|
||||||
return new Result<BikesReservedOccupiedResponse>(typeof(CopriCallsMonkeyStore), bikesOccupiedResponse, bikesOccupiedResponse.GetGeneralData(), exception);
|
return new Result<BikesReservedOccupiedResponse>(typeof(CopriCallsMonkeyStore), bikesOccupiedResponse, bikesOccupiedResponse.GetGeneralData(), exception);
|
||||||
}
|
}
|
||||||
|
@ -134,7 +135,7 @@ namespace TINK.Model.Services.CopriApi
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.ForContext<CopriProviderHttps>().Debug($"Querrying stations from copri.");
|
Log.ForContext<CopriProviderHttps>().Debug($"Querying stations from copri.");
|
||||||
|
|
||||||
var stations = await HttpsServer.GetStationsAsync();
|
var stations = await HttpsServer.GetStationsAsync();
|
||||||
|
|
||||||
|
@ -146,7 +147,7 @@ namespace TINK.Model.Services.CopriApi
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
// Return response from cache.
|
// Return response from cache.
|
||||||
Log.ForContext<CopriProviderHttps>().Debug("An error occurred querrying stations. {Exception}.", exception);
|
Log.ForContext<CopriProviderHttps>().Debug("An error occurred querying stations. {Exception}.", exception);
|
||||||
var stationsResponse = await CacheServer.GetStationsAsync();
|
var stationsResponse = await CacheServer.GetStationsAsync();
|
||||||
return new Result<StationsAvailableResponse>(typeof(CopriCallsMonkeyStore), stationsResponse, stationsResponse.GetGeneralData(), exception);
|
return new Result<StationsAvailableResponse>(typeof(CopriCallsMonkeyStore), stationsResponse, stationsResponse.GetGeneralData(), exception);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ using TINK.Model.Device;
|
||||||
using TINK.Repository;
|
using TINK.Repository;
|
||||||
using TINK.Repository.Request;
|
using TINK.Repository.Request;
|
||||||
using TINK.Repository.Response;
|
using TINK.Repository.Response;
|
||||||
|
using TINK.Repository.Response.Stations;
|
||||||
using TINK.Services.CopriApi.Exception;
|
using TINK.Services.CopriApi.Exception;
|
||||||
|
|
||||||
namespace TINK.Model.Services.CopriApi
|
namespace TINK.Model.Services.CopriApi
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TINK.Repository;
|
using TINK.Repository;
|
||||||
using TINK.Repository.Response;
|
using TINK.Repository.Response;
|
||||||
|
using TINK.Repository.Response.Stations;
|
||||||
|
|
||||||
namespace TINK.Model.Services.CopriApi
|
namespace TINK.Model.Services.CopriApi
|
||||||
{
|
{
|
||||||
|
@ -16,7 +17,7 @@ namespace TINK.Model.Services.CopriApi
|
||||||
/// <returns>Response holding list of bikes.</returns>
|
/// <returns>Response holding list of bikes.</returns>
|
||||||
Task<Result<BikesAvailableResponse>> GetBikesAvailable(bool fromCache = false);
|
Task<Result<BikesAvailableResponse>> GetBikesAvailable(bool fromCache = false);
|
||||||
|
|
||||||
/// <summary> Gets a list of bikes reserved/ booked by acctive user from Copri.</summary>
|
/// <summary> Gets a list of bikes reserved/ booked by active user from Copri.</summary>
|
||||||
/// <returns>Response holding list of bikes.</returns>
|
/// <returns>Response holding list of bikes.</returns>
|
||||||
Task<Result<BikesReservedOccupiedResponse>> GetBikesOccupied(bool fromCache = false);
|
Task<Result<BikesReservedOccupiedResponse>> GetBikesOccupied(bool fromCache = false);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using TINK.Repository;
|
using TINK.Repository;
|
||||||
using TINK.Repository.Response;
|
using TINK.Repository.Response;
|
||||||
|
using TINK.Repository.Response.Stations;
|
||||||
|
|
||||||
namespace TINK.Model.Services.CopriApi
|
namespace TINK.Model.Services.CopriApi
|
||||||
{
|
{
|
||||||
|
|
|
@ -112,7 +112,7 @@ namespace TINK.Services.CopriApi
|
||||||
if (lockingState == null)
|
if (lockingState == null)
|
||||||
{
|
{
|
||||||
// User did not take bike out of the station
|
// User did not take bike out of the station
|
||||||
throw new BikeStillInStationException("Booking was cancelled because bike is still in station.");
|
throw new BikeStillInStationException("Booking was canceled because bike is still in station.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upate booking state.
|
// Upate booking state.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using TINK.Services.CopriApi;
|
using TINK.Services.CopriApi;
|
||||||
|
|
||||||
namespace TINK.Model.Services.CopriApi
|
namespace TINK.Model.Services.CopriApi
|
||||||
|
@ -10,7 +10,7 @@ namespace TINK.Model.Services.CopriApi
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="source">Type of source (data provider).</param>
|
/// <param name="source">Type of source (data provider).</param>
|
||||||
/// <param name="response">Requested data (bikes, station).</param>
|
/// <param name="response">Requested data (bikes, station).</param>
|
||||||
/// <param name="generalData">General data (common to all respones).</param>
|
/// <param name="generalData">General data (common to all responses).</param>
|
||||||
public Result(
|
public Result(
|
||||||
Type source,
|
Type source,
|
||||||
T response,
|
T response,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
using TINK.Model.Bikes;
|
using TINK.Model.Bikes;
|
||||||
using TINK.Model.Station;
|
using TINK.Model.Stations;
|
||||||
|
|
||||||
namespace TINK.Model.Services.CopriApi
|
namespace TINK.Model.Services.CopriApi
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace TINK.Services.Geolocation
|
||||||
|
|
||||||
/// <summary> Gets the current location.</summary>
|
/// <summary> Gets the current location.</summary>
|
||||||
/// <param name="cancellationToken">Token to cancel request for geolocation.</param>
|
/// <param name="cancellationToken">Token to cancel request for geolocation.</param>
|
||||||
/// <param name="timeStamp">Time when geolocation is of interest. Is used to determine whether cached geoloation can be used or not.</param>
|
/// <param name="timeStamp">Time when geolocation is of interest. Is used to determine whether cached geolocation can be used or not.</param>
|
||||||
public async Task<IGeolocation> GetAsync(CancellationToken? cancellationToken = null, DateTime? timeStamp = null)
|
public async Task<IGeolocation> GetAsync(CancellationToken? cancellationToken = null, DateTime? timeStamp = null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue