aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-12 19:07:24 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-12 19:07:24 +0300
commit33a68a0e46e55e86a4c1f100ea3d7e9180a801a3 (patch)
tree52e10805c666d22fd5d8f004eeb06edffd22df90 /Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
parent7b86ad443156b9b9bac43082a638e0d55f784a94 (diff)
downloadTango-33a68a0e46e55e86a4c1f100ea3d7e9180a801a3.tar.gz
Tango-33a68a0e46e55e86a4c1f100ea3d7e9180a801a3.zip
Working on PPC & Tango.Integration.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
index 636a73d3c..1fd5fdd0a 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
@@ -53,6 +53,11 @@ namespace Tango.PPC.Common.Connection
MachineOperatorChanged?.Invoke(this, new MachineOperatorChangedEventArgs(oldOperator, newOperator));
}
+ public DefaultMachineProvider()
+ {
+ MachineOperator = new MachineOperator();
+ }
+
public void Init()
{
if (!_isInitialized)
@@ -69,9 +74,9 @@ namespace Tango.PPC.Common.Connection
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();
- MachineOperator = machine;
+ await MachineOperator.Disconnect();
+ MachineOperator.Adapter = response.Adapter;
+ await MachineOperator.Connect();
}
}
}