diff --git a/Borepin/Borepin/Model/MachineVisualize.cs b/Borepin/Borepin/Model/MachineVisualize.cs
index 8aac695..990a1c9 100644
--- a/Borepin/Borepin/Model/MachineVisualize.cs
+++ b/Borepin/Borepin/Model/MachineVisualize.cs
@@ -80,6 +80,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
@@ -202,6 +203,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 ee2f13d..e82055f 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 40587e6..15c3df3 100644
--- a/Borepin/Borepin/Resources/Text/TextResource.Designer.cs
+++ b/Borepin/Borepin/Resources/Text/TextResource.Designer.cs
@@ -531,6 +531,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 0c98615..1cfa36e 100644
--- a/Borepin/Borepin/Resources/Text/TextResource.resx
+++ b/Borepin/Borepin/Resources/Text/TextResource.resx
@@ -293,6 +293,9 @@ Please speak with the staff at the Space to receive the necessary training and a
GiveBack
+
+ Identify
+
Last User:
diff --git a/FabAccessAPI_Test/TestEnv.cs b/FabAccessAPI_Test/TestEnv.cs
index d702b75..356e208 100644
--- a/FabAccessAPI_Test/TestEnv.cs
+++ b/FabAccessAPI_Test/TestEnv.cs
@@ -1,4 +1,5 @@
using FabAccessAPI;
+using NUnit.Framework;
using System;
using System.Collections.Generic;
@@ -11,6 +12,7 @@ namespace FabAccessAPI_Test
public const int TESTSERVER_PORT = 59661;
public const string PASSWORD = "secret";
+ [TestCase("Testuser")]
public static ConnectionData CreateConnetionData(string username)
{
ConnectionData connectionData = new ConnectionData()