aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj10
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs44
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RmlActiveSitesDialogVM.cs35
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlActiveSitesDialog.xaml71
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlActiveSitesDialog.xaml.cs28
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml19
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs57
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/Views/SiteDetailsView.xaml12
8 files changed, 274 insertions, 2 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj
index 4ba97e35b..dfa8e2add 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj
@@ -58,6 +58,8 @@
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
@@ -109,6 +111,7 @@
<Compile Include="ViewModels\LiquidVolumeVM.cs" />
<Compile Include="ViewModels\MainViewVM.cs" />
<Compile Include="ViewModels\RgbVM.cs" />
+ <Compile Include="ViewModels\RmlActiveSitesDialogVM.cs" />
<Compile Include="ViewModels\RmlDeleteDialogViewVM.cs" />
<Compile Include="Views\AddLiquidFactorView.xaml.cs">
<DependentUpon>AddLiquidFactorView.xaml</DependentUpon>
@@ -131,6 +134,9 @@
<Compile Include="Views\ProcessParametersView.xaml.cs">
<DependentUpon>ProcessParametersView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\RmlActiveSitesDialog.xaml.cs">
+ <DependentUpon>RmlActiveSitesDialog.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\RmlDeleteDialogView.xaml.cs">
<DependentUpon>RmlDeleteDialogView.xaml</DependentUpon>
</Compile>
@@ -258,6 +264,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="Views\RmlActiveSitesDialog.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Views\RmlDeleteDialogView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
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);
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RmlActiveSitesDialogVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RmlActiveSitesDialogVM.cs
new file mode 100644
index 000000000..dd5213bc3
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RmlActiveSitesDialogVM.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.SharedUI;
+
+namespace Tango.MachineStudio.RML.ViewModels
+{
+ public class RmlActiveSitesDialogVM : DialogViewVM
+ {
+ #region Properties
+
+ private List<string> _rmlSiteNamesList;
+
+ public List<string> RMLSiteNamesList
+ {
+ get { return _rmlSiteNamesList; }
+ set { _rmlSiteNamesList = value;
+ RaisePropertyChangedAuto();
+ }
+ }
+
+ public String RMLName { get; set; }
+
+
+ #endregion
+
+ public RmlActiveSitesDialogVM(List<string> rmlSitenamesList, string rmlName)
+ {
+ RMLSiteNamesList = rmlSitenamesList;
+ RMLName = rmlName;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlActiveSitesDialog.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlActiveSitesDialog.xaml
new file mode 100644
index 000000000..b02380508
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlActiveSitesDialog.xaml
@@ -0,0 +1,71 @@
+<UserControl x:Class="Tango.MachineStudio.RML.Views.RmlActiveSitesDialog"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+ xmlns:vm="clr-namespace:Tango.MachineStudio.RML.ViewModels"
+ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:local="clr-namespace:Tango.MachineStudio.RML.Views"
+ mc:Ignorable="d"
+ d:DesignHeight="400" d:DesignWidth="400" Height="600" Width="500" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:RmlDeleteDialogViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource Dialog.Foreground}">
+
+ <UserControl.Resources>
+ <Style x:Key="GridStyle" TargetType="DataGrid" BasedOn="{StaticResource {x:Type DataGrid}}">
+ <Setter Property="AutoGenerateColumns" Value="False"></Setter>
+ <Setter Property="SelectionMode" Value="Single"></Setter>
+ <Setter Property="SelectionUnit" Value="FullRow"></Setter>
+ <Setter Property="IsReadOnly" Value="True"></Setter>
+ </Style>
+ <Style x:Key="CellStyle" TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type DataGridCell}">
+ <Grid Background="{TemplateBinding Background}">
+ <ContentPresenter VerticalAlignment="Center" Margin="8" />
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ <Setter Property="BorderThickness" Value="0"/>
+ <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
+ <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
+ <Style.Triggers>
+ <Trigger Property="IsSelected" Value="True">
+ <Setter Property="BorderThickness" Value="0"/>
+ <Setter Property="BorderBrush" Value="Cyan"/>
+ </Trigger>
+ </Style.Triggers>
+ </Style>
+
+ </UserControl.Resources>
+
+ <Grid>
+ <DockPanel Margin="10">
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Center" DockPanel.Dock="Bottom">
+ <Button Command="{Binding CloseCommand}" Width="140" Height="40" Margin="0 0 10 0">
+ Close
+ </Button>
+ </StackPanel>
+
+ <Grid DockPanel.Dock="Top">
+ <DockPanel HorizontalAlignment="Stretch">
+ <Grid DockPanel.Dock="Left">
+ <materialDesign:PackIcon Kind="InformationVariant" Foreground="{StaticResource AccentColorBrush}" Width="28" Height="28" />
+ </Grid>
+ <TextBlock DockPanel.Dock="Left" Margin="10 5 0 0" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="18" TextWrapping="Wrap" Text="{Binding RMLName}"/>
+ </DockPanel>
+ </Grid>
+ <Grid DockPanel.Dock="Top" Margin="0 20 0 20">
+ <materialDesign:Card Background="{DynamicResource MaterialDesignBackground}" VerticalAlignment="Stretch">
+ <DataGrid ItemsSource="{Binding RMLSiteNamesList}" Style="{StaticResource GridStyle}" CellStyle="{StaticResource CellStyle}">
+ <DataGrid.Columns>
+ <DataGridTextColumn Header="SITE NAME" IsReadOnly="True" Binding="{Binding }" Width="1*" />
+ </DataGrid.Columns>
+ </DataGrid>
+ </materialDesign:Card>
+ </Grid>
+
+ </DockPanel>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlActiveSitesDialog.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlActiveSitesDialog.xaml.cs
new file mode 100644
index 000000000..f9c020506
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlActiveSitesDialog.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Tango.MachineStudio.RML.Views
+{
+ /// <summary>
+ /// Interaction logic for RmlActiveSitesDialog.xaml
+ /// </summary>
+ public partial class RmlActiveSitesDialog : UserControl
+ {
+ public RmlActiveSitesDialog()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml
index 9c684c052..2c0f77937 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml
@@ -77,6 +77,25 @@
<TextBlock VerticalAlignment="Center" Margin="10 0 0 0" TextDecorations="Underline">Export Thread File</TextBlock>
</StackPanel>
</Button>
+
+ <Button x:Name="ShowActiveInSitesBtn" Margin="30 0 0 0" Command="{Binding ActivatedInSitesCommand}" Foreground="{StaticResource BlackForegroundBrush}" FontSize="16" Style="{StaticResource emptyButton}" Cursor="Hand">
+ <StackPanel Orientation="Horizontal">
+ <materialDesign:PackIcon Kind="InformationVariant" VerticalAlignment="Center" Width="26" Height="26" Foreground="Blue"/>
+ <TextBlock VerticalAlignment="Center" Margin="0 0 0 0" TextDecorations="Underline" Text="Activated in sites…">
+ <TextBlock.Style>
+ <Style TargetType="TextBlock">
+ <Setter Property="Foreground" Value="{StaticResource BlackForegroundBrush}" />
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding ElementName=ShowActiveInSitesBtn, Path=IsEnabled}" Value="False">
+ <Setter Property="Foreground" Value="{StaticResource GrayBrush}" />
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </TextBlock.Style>
+ </TextBlock>
+ </StackPanel>
+ </Button>
+
</StackPanel>
</StackPanel>
</Grid>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs
index 02c9f4346..bf2ebdbcf 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs
@@ -14,6 +14,8 @@ using Tango.MachineStudio.Common.Authentication;
using Tango.BL.ActionLogs;
using Tango.BL.DTO;
using Tango.BL.Builders;
+using System.ComponentModel;
+using System.Windows.Data;
namespace Tango.MachineStudio.Sites.ViewModels
{
@@ -70,12 +72,44 @@ namespace Tango.MachineStudio.Sites.ViewModels
set { _spoolTypes = value; RaisePropertyChangedAuto(); }
}
+ private bool _showSelectedRMLsOnly;
+
+ public bool ShowSelectedRMLsOnly
+ {
+ get { return _showSelectedRMLsOnly; }
+ set { _showSelectedRMLsOnly = value;
+ RaisePropertyChangedAuto(); RMLCollection.Refresh(); }
+ }
+
+ private String _RMLFilter;
+
+ public String RMLFilter
+ {
+ get { return _RMLFilter; }
+ set {
+ _RMLFilter = value;
+ RaisePropertyChangedAuto();
+ RMLCollection.Refresh();
+ }
+ }
+
+
+ private ICollectionView _rmlscollectionFilter;
+ public ICollectionView RMLCollection
+ {
+ get { return _rmlscollectionFilter; }
+ set { _rmlscollectionFilter = value;
+ RaisePropertyChangedAuto(); }
+ }
+
+
public RelayCommand SaveCommand { get; set; }
public SiteDetailsViewVM()
{
SaveCommand = new RelayCommand(Save, () => IsFree);
+ _showSelectedRMLsOnly = true;
}
public async Task Init(String siteGuid, INotificationProvider notification, IAuthenticationProvider authentication, IActionLogManager actionLogManager, bool isNew, string newSiteName = null)
@@ -127,6 +161,29 @@ namespace Tango.MachineStudio.Sites.ViewModels
}
_siteBeforeSave = SiteDTO.FromObservable(Site);
+
+ RMLCollection = CollectionViewSource.GetDefaultView(Rmls);
+ RMLCollection.Filter = new Predicate<object>(x =>
+ {
+ SelectedObject Sel_rml = x as SelectedObject;
+
+ if (!String.IsNullOrEmpty(RMLFilter))// by filter and check box Show selected only
+ {
+ var rml = Sel_rml.Data as Rml;
+ if (rml != null && rml.Name.ToLower().Contains(RMLFilter.ToLower()))
+ {
+ return ShowSelectedRMLsOnly ? Sel_rml.IsSelected : true;
+ }
+ else
+ return false;
+ }
+ else
+ {
+ return ShowSelectedRMLsOnly ? Sel_rml.IsSelected : true;
+ }
+
+
+ });
}
private async void Save()
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/Views/SiteDetailsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/Views/SiteDetailsView.xaml
index b4da6f35c..e6c2e78f9 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/Views/SiteDetailsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/Views/SiteDetailsView.xaml
@@ -114,9 +114,11 @@
<DockPanel Margin="10">
<TextBlock DockPanel.Dock="Top" FontSize="16">SITE RML</TextBlock>
+ <Grid>
- <materialDesign:Card Margin="0 5 0 0" Background="{DynamicResource MaterialDesignBackground}" VerticalAlignment="Stretch">
- <DataGrid ItemsSource="{Binding Rmls}" Style="{StaticResource GridStyle}" CellStyle="{StaticResource CellStyle}">
+ <materialDesign:Card Margin="0 5 0 0" Background="{DynamicResource MaterialDesignBackground}" VerticalAlignment="Stretch">
+ <DataGrid ItemsSource="{Binding RMLCollection}" Style="{StaticResource GridStyle}" CellStyle="{StaticResource CellStyle}">
+
<DataGrid.Columns>
<DataGridTemplateColumn Header="" Width="Auto">
<DataGridTemplateColumn.CellTemplate>
@@ -129,6 +131,12 @@
</DataGrid.Columns>
</DataGrid>
</materialDesign:Card>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="120 20 0 10">
+ <materialDesign:PackIcon VerticalAlignment="Center" Kind="Magnify" Width="20" Height="20" />
+ <TextBox Width="200" FontSize="16" Margin="5 0 0 0" materialDesign:HintAssist.Hint="Name" Text="{Binding RMLFilter,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ></TextBox>
+ </StackPanel>
+ <CheckBox IsChecked="{Binding ShowSelectedRMLsOnly, Mode=TwoWay}" Content="Selected" FontSize="16" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0 25 20 0"/>
+ </Grid>
</DockPanel>
<DockPanel Margin="10" Grid.Column="1">