diff --git a/Borepin/Borepin/Model/MachineVisualize.cs b/Borepin/Borepin/Model/MachineVisualize.cs
index 709c7c5..c0f87a4 100644
--- a/Borepin/Borepin/Model/MachineVisualize.cs
+++ b/Borepin/Borepin/Model/MachineVisualize.cs
@@ -75,6 +75,7 @@ namespace Borepin.Model
CanManage = !((ManageInterface_Proxy)_Machine.Manage).IsNull;
CanAdmin = !((AdminInterface_Proxy)_Machine.Admin).IsNull;
CanNotUseByPermission = State == MachineState.free && !CanUse;
+ IsLock = !((ProdInterface_Proxy)_Machine.Prodable).IsNull;
}
#endregion
@@ -197,6 +198,13 @@ namespace Borepin.Model
get => _CanNotUseByPermission;
set => SetProperty(ref _CanNotUseByPermission, value);
}
+
+ private bool _IsLock;
+ public bool IsLock
+ {
+ get => _IsLock;
+ set => SetProperty(ref _IsLock, value);
+ }
#endregion
}
}
diff --git a/Borepin/Borepin/Page/MachinePage.xaml b/Borepin/Borepin/Page/MachinePage.xaml
index 99ebf23..7a44c6a 100644
--- a/Borepin/Borepin/Page/MachinePage.xaml
+++ b/Borepin/Borepin/Page/MachinePage.xaml
@@ -46,6 +46,25 @@
+
+
+
+
+
diff --git a/Borepin/Borepin/PageModel/MachinePageModel.cs b/Borepin/Borepin/PageModel/MachinePageModel.cs
index 10d8d80..6db1a02 100644
--- a/Borepin/Borepin/PageModel/MachinePageModel.cs
+++ b/Borepin/Borepin/PageModel/MachinePageModel.cs
@@ -11,6 +11,7 @@ using Borepin.Base.Exceptions;
using Capnp.Rpc;
using System;
using Borepin.Service.Browser;
+using System.Text;
namespace Borepin.PageModel
{
@@ -236,6 +237,60 @@ namespace Borepin.PageModel
}
}
}
+
+ private ICommand _UnlockLockCommand;
+ public ICommand UnlockLockCommand
+ {
+ get => _UnlockLockCommand;
+ set => SetProperty(ref _UnlockLockCommand, value);
+ }
+
+ public async void UnlockLockCommandExecute()
+ {
+ IsBusy = true;
+
+ if (_API.IsConnected)
+ {
+ try
+ {
+ Machine.IProdInterface prodInterface = _Machine.Prodable;
+ await prodInterface.ProdWithData(Encoding.ASCII.GetBytes("action: unlock")).ConfigureAwait(false);
+ }
+ catch (RpcException exception) when (string.Equals(exception.Message, "RPC connection is broken. Task would never return.", StringComparison.Ordinal))
+ {
+ Log.Debug("RPC Connection Loss");
+ }
+ }
+
+ IsBusy = false;
+ }
+
+ private ICommand _IdentifyLockCommand;
+ public ICommand IdentifyLockCommand
+ {
+ get => _IdentifyLockCommand;
+ set => SetProperty(ref _IdentifyLockCommand, value);
+ }
+
+ public async void IdentifyLockCommandExecute()
+ {
+ IsBusy = true;
+
+ if (_API.IsConnected)
+ {
+ try
+ {
+ Machine.IProdInterface prodInterface = _Machine.Prodable;
+ await prodInterface.ProdWithData(Encoding.ASCII.GetBytes("action: identify")).ConfigureAwait(false);
+ }
+ catch (RpcException exception) when (string.Equals(exception.Message, "RPC connection is broken. Task would never return.", StringComparison.Ordinal))
+ {
+ Log.Debug("RPC Connection Loss");
+ }
+ }
+
+ IsBusy = false;
+ }
#endregion
}
}
diff --git a/Borepin/Borepin/Resources/Text/TextResource.Designer.cs b/Borepin/Borepin/Resources/Text/TextResource.Designer.cs
index 60a9afa..9138cd6 100644
--- a/Borepin/Borepin/Resources/Text/TextResource.Designer.cs
+++ b/Borepin/Borepin/Resources/Text/TextResource.Designer.cs
@@ -504,6 +504,15 @@ namespace Borepin.Resources.Text {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Identify ähnelt.
+ ///
+ internal static string MachinePage_Identify {
+ get {
+ return ResourceManager.GetString("MachinePage_Identify", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die Last User: ähnelt.
///
diff --git a/Borepin/Borepin/Resources/Text/TextResource.resx b/Borepin/Borepin/Resources/Text/TextResource.resx
index 1b7a9cf..1256cc6 100644
--- a/Borepin/Borepin/Resources/Text/TextResource.resx
+++ b/Borepin/Borepin/Resources/Text/TextResource.resx
@@ -284,6 +284,9 @@ Ask in your Space if you can be trained on the machine to be unlocked for the ma
GiveBack
+
+ Identify
+
Last User: