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>2019-03-04 15:49:59 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-03-04 15:49:59 +0200
commit1746d2c7f601f44c23399aa6d19661fb7ff937ec (patch)
tree829c2a33a7b5c67696c683df5a11780fae620fae /Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
parent56b984bf7c4785cd0bcfd45a174ea802c6d0d471 (diff)
downloadTango-1746d2c7f601f44c23399aa6d19661fb7ff937ec.tar.gz
Tango-1746d2c7f601f44c23399aa6d19661fb7ff937ec.zip
Fixed several issues with PPC.
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.cs7
1 files changed, 5 insertions, 2 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 95912e1ea..9a7e29bb7 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
@@ -32,6 +32,7 @@ namespace Tango.PPC.Common.Connection
{
private bool _isInitialized;
private Thread _connection_thread;
+ private ObservablesContext _context;
private Machine _machine;
/// <summary>
@@ -165,7 +166,7 @@ namespace Tango.PPC.Common.Connection
/// <summary>
/// Initializes this machine provider start machine port scanning and connection.
/// </summary>
- public void Init(Machine machine)
+ public void Init(Machine machine, ObservablesContext context)
{
if (!_isInitialized)
{
@@ -175,6 +176,7 @@ namespace Tango.PPC.Common.Connection
LogManager.Log("Retrieving first machine database entry...");
+ _context = context;
Machine = machine;
if (Machine != null)
@@ -209,7 +211,8 @@ namespace Tango.PPC.Common.Connection
/// <returns></returns>
public async Task SaveMachine()
{
- await Machine.GetDbContext().SaveChangesAsync();
+ await _context.SaveChangesAsync();
+ Machine = await new MachineBuilder(_context).SetFirst().WithSettings().BuildAsync();
TangoMessenger.Default.Send(new MachineSettingsSavedMessage() { Machine = Machine });
}