aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection
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
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')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs7
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/IMachineProvider.cs3
2 files changed, 7 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 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 });
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/IMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/IMachineProvider.cs
index 43a6c290e..10180b9cc 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/IMachineProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/IMachineProvider.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Tango.BL;
using Tango.BL.Entities;
using Tango.Integration.ExternalBridge;
using Tango.Integration.Operation;
@@ -27,7 +28,7 @@ namespace Tango.PPC.Common.Connection
/// <summary>
/// Initializes this machine provider start machine port scanning and connection.
/// </summary>
- void Init(Machine machine);
+ void Init(Machine machine, ObservablesContext context);
/// <summary>
/// Saves the machine settings.