From e0b0859f62924d38c8cd7ac9975303c4bfb08624 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 20 Dec 2018 14:24:19 +0200 Subject: Added environments support for users & roles !! --- .../MachineSetup/MachineSetupManager.cs | 35 +++++++--------------- .../MachineSetup/MachineSetupResponse.cs | 6 ++-- 2 files changed, 14 insertions(+), 27 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs index 1f86e0953..b8638b158 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs @@ -207,22 +207,20 @@ namespace Tango.PPC.Common.MachineSetup //Synchronize database UpdateProgress("Updating Database", "Initializing..."); - String db_name = "Tango"; - String localAddress = SettingsManager.Default.GetOrCreate().DataSource.Address; - String remote_address = setup_response.DbAddress; + var localDataSource = SettingsManager.Default.GetOrCreate().DataSource; - LogManager.Log($"Synchronizing database '{remote_address}\\{db_name}' => '{localAddress}\\{db_name}'..."); + LogManager.Log($"Synchronizing database '{setup_response.DataSource.ToString()}' => '{localDataSource.ToString()}'..."); UpdateProgress("Updating Database", "Connecting to local database..."); - LogManager.Log($"Connecting to local database at {localAddress}..."); - DbManager db = DbManager.FromAddress(localAddress); + LogManager.Log($"Connecting to local database at {localDataSource}..."); + DbManager db = DbManager.FromAddress(localDataSource.Address); - LogManager.Log($"Ensuring {db_name} database exists on the local machine..."); - if (!db.Exists(db_name)) + LogManager.Log($"Ensuring {localDataSource.Catalog} database exists on the local machine..."); + if (!db.Exists(localDataSource.Catalog)) { UpdateProgress("Updating Database", "Creating new database..."); LogManager.Log("Database does not exist. Creating new database..."); - db.Create(db_name); + db.Create(localDataSource.Catalog); } else { @@ -232,7 +230,7 @@ namespace Tango.PPC.Common.MachineSetup db.Dispose(); LogManager.Log("Initializing database manager..."); - db = DbManager.FromAddressAndName(localAddress, db_name); + db = DbManager.FromDataSource(localDataSource); UpdateProgress("Updating Database", "Clearing current database..."); LogManager.Log("Clearing database..."); @@ -248,20 +246,9 @@ namespace Tango.PPC.Common.MachineSetup ExaminerSequenceConfigurationRunner runner = new ExaminerSequenceConfigurationRunner( Path.Combine(_newPackageTempFolder, "Provision Scripts", "config.xml"), Path.Combine(_newPackageTempFolder, "Provision Scripts"), - new ExaminerSequenceDataSource() - { - Address = remote_address, - DataBaseName = db_name, - IntegratedSecurity = false, - UserName = setup_response.DbUserName, - Password = setup_response.DbPassword, - }, - new ExaminerSequenceDataSource() - { - Address = localAddress, - DataBaseName = db_name, - IntegratedSecurity = true, - }, serialNumber); + setup_response.DataSource, + localDataSource, + serialNumber); runner.Log += (x, msg) => { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupResponse.cs index 89450a1d1..5e8885af7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupResponse.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupResponse.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.Core; using Tango.Transport.Web; namespace Tango.PPC.Common.MachineSetup @@ -13,9 +14,7 @@ namespace Tango.PPC.Common.MachineSetup public String BlobAddress { get; set; } - public String DbAddress { get; set; } - public String DbUserName { get; set; } - public String DbPassword { get; set; } + public DataSource DataSource { get; set; } public String OSKey { get; set; } @@ -23,6 +22,7 @@ namespace Tango.PPC.Common.MachineSetup public bool SetupRemoteAssistance { get; set; } public bool SetupUWF { get; set; } public bool SetupFirmware { get; set; } + public bool SetupFPGA { get; set; } public bool IsDemo { get; set; } } } -- cgit v1.3.1