aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy.mail.net@gmail.com>2023-10-26 08:57:49 +0300
committerRoy Ben-Shabat <Roy.mail.net@gmail.com>2023-10-26 08:57:49 +0300
commit0e25d9d077bdca2a93c2eb24a723a4fd0a3ea620 (patch)
tree17bd3e8da10ab4bceaee8dc22e76706d0b2c6598 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
parentcbde37e91134e36e4001418756e7bb6611022441 (diff)
parentbf7234e0757a53129bd4991d3db30b03ff5049b3 (diff)
downloadTango-0e25d9d077bdca2a93c2eb24a723a4fd0a3ea620.tar.gz
Tango-0e25d9d077bdca2a93c2eb24a723a4fd0a3ea620.zip
Merge branch 'software' of https://twinetfs.visualstudio.com/Tango/_git/Tango into software
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs44
1 files changed, 44 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
index 7eb6e9058..e3c128cb7 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
@@ -41,6 +41,8 @@ namespace Tango.MachineStudio.RML.ViewModels
private ObservablesContext _active_context;
+ #region Properties
+
private List<RmlModel> _rmls;
public List<RmlModel> Rmls
{
@@ -237,7 +239,10 @@ namespace Tango.MachineStudio.RML.ViewModels
get { return _RMLFilter; }
set { _RMLFilter = value; RaisePropertyChangedAuto(); OnRMLFilterChanged(); }
}
+
+ #endregion
+ #region Commands
/// <summary>
/// Gets or sets the manage RML command.
/// </summary>
@@ -300,6 +305,10 @@ namespace Tango.MachineStudio.RML.ViewModels
public RelayCommand BatchConversionCommand { get; set; }
+ public RelayCommand ActivatedInSitesCommand { get; set; }
+
+ #endregion
+
public MainViewVM(INotificationProvider notificationProvider, IAuthenticationProvider authentication, IActionLogManager actionLogManager)
{
_notification = notificationProvider;
@@ -316,6 +325,7 @@ namespace Tango.MachineStudio.RML.ViewModels
RemoveLiquidFactorCommand = new RelayCommand<LiquidTypesRml>(RemoveLiquidFactor, () => IsFree);
CreateCalibrationDataExcelTemplateCommand = new RelayCommand(CreateCalibrationDataExcelTemplate);
SaveCommand = new RelayCommand(Save, () => IsFree);
+ ActivatedInSitesCommand = new RelayCommand(ActivatedInSitesDialog, () => SelectedRML != null);
ImportForwardDataCommand = new RelayCommand(ImportCCTData, () => ActiveRML != null && IsFree);
@@ -1128,6 +1138,40 @@ namespace Tango.MachineStudio.RML.ViewModels
}
}
+ private async void ActivatedInSitesDialog()
+ {
+ if(SelectedRML == null)
+ return;
+
+ try
+ {
+ using (ObservablesContext db = ObservablesContext.CreateDefault())
+ {
+ IsFree = false;
+
+ var selSites = await db.SitesRmls.OrderBy(x => x.ID).Where(y => y.RmlGuid == SelectedRML.Guid).Include(x=>x.Site).Select(x => x.Site.Name).ToListAsync();
+
+ var vm = new RmlActiveSitesDialogVM(selSites, SelectedRML.Name);
+ _notification.ShowModalDialog<RmlActiveSitesDialogVM, RmlActiveSitesDialog>(vm, (x) => { }, () => { });
+
+ if (!vm.DialogResult)
+ {
+ return;
+ }
+
+
+ }
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, $"Error display Activated In Sites selected RML {SelectedRML?.Name}.");
+ }
+ finally
+ {
+ IsFree = true;
+ }
+ }
+
private async void BackToRmls()
{
View.NavigateTo(RmlNavigationView.RmlsView);