aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-11 20:05:13 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-11 20:05:13 +0300
commit14cd4ba2174c3e0bd74f58f2cc72769fd326a6e6 (patch)
tree78901a0b5053610ce2f86b436a037f17715d6368 /Software/Visual_Studio/PPC/Tango.PPC.UI
parent009a02d57e244e9a8ed5d70fc0743f10f68f5a33 (diff)
downloadTango-14cd4ba2174c3e0bd74f58f2cc72769fd326a6e6.tar.gz
Tango-14cd4ba2174c3e0bd74f58f2cc72769fd326a6e6.zip
Working on PPC.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs19
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs10
2 files changed, 22 insertions, 7 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
index 448fc0edc..0ede1306f 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
@@ -28,6 +28,7 @@ namespace Tango.PPC.UI.Navigation
private Object _currentVM;
private String _lastFullPath;
private bool _preventHistory;
+ private bool _navigating_back;
private Stack<String> _navigationHistory;
@@ -139,9 +140,19 @@ namespace Tango.PPC.UI.Navigation
if (_currentVM != null && _currentVM is INavigationBlocker)
{
- if (!await (_currentVM as INavigationBlocker).OnNavigateOutRequest())
+ if (_navigating_back)
{
- return false;
+ if (!await (_currentVM as INavigationBlocker).OnNavigateBackRequest())
+ {
+ return false;
+ }
+ }
+ else
+ {
+ if (!await (_currentVM as INavigationBlocker).OnNavigateOutRequest())
+ {
+ return false;
+ }
}
}
@@ -260,6 +271,8 @@ namespace Tango.PPC.UI.Navigation
/// </summary>
public async Task<bool> NavigateBack()
{
+ _navigating_back = true;
+
String first = _navigationHistory.Pop();
_preventHistory = true;
@@ -268,12 +281,14 @@ namespace Tango.PPC.UI.Navigation
{
RaisePropertyChanged(nameof(CanNavigateBack));
_preventHistory = false;
+ _navigating_back = false;
return true;
}
else
{
_navigationHistory.Push(first);
_preventHistory = false;
+ _navigating_back = false;
RaisePropertyChanged(nameof(CanNavigateBack));
return false;
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
index 8c112ff7a..c67e83fc6 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
@@ -193,12 +193,12 @@ namespace Tango.PPC.UI.PPCApplication
private async void ConnectToMachine()
{
- //Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse> scanner = new Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse>(UsbSerialBaudRates.BR_9600);
- //var response = await scanner.Scan(new ConnectRequest() { Password = "1234" }, TimeSpan.FromSeconds(10));
+ Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse> scanner = new Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse>(UsbSerialBaudRates.BR_9600);
+ var response = await scanner.Scan(new ConnectRequest() { Password = "1234" }, TimeSpan.FromSeconds(10));
- //var machine = new MachineOperator(response.Adapter);
- //await machine.Connect();
- //ConnectedMachine = machine;
+ var machine = new MachineOperator(response.Adapter);
+ await machine.Connect();
+ ConnectedMachine = machine;
}
}
}