diff options
| author | Roy <Roy.mail.net@gmail.com> | 2023-10-22 16:43:49 +0300 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2023-10-22 16:43:49 +0300 |
| commit | 4cebc14d3183ee4dc4ade0f85d9bf72cec44533c (patch) | |
| tree | b940003b7572fa616fd385ef5c5be00b06f5c01b | |
| parent | f35fea4ffd1219e844f94a0b72c12cc91af2c94e (diff) | |
| parent | 648437dec6e56e32218d88b7a85e70ac00b6e98a (diff) | |
| download | Tango-4cebc14d3183ee4dc4ade0f85d9bf72cec44533c.tar.gz Tango-4cebc14d3183ee4dc4ade0f85d9bf72cec44533c.zip | |
Merge branch 'software' of https://twinetfs.visualstudio.com/Tango/_git/Tango into software
49 files changed, 904 insertions, 230 deletions
diff --git a/Software/DB/PPC/PPC Test/Tango.mdf b/Software/DB/PPC/PPC Test/Tango.mdf Binary files differindex bd2c731af..6d98e04ea 100644 --- a/Software/DB/PPC/PPC Test/Tango.mdf +++ b/Software/DB/PPC/PPC Test/Tango.mdf diff --git a/Software/DB/PPC/PPC Test/Tango_log.ldf b/Software/DB/PPC/PPC Test/Tango_log.ldf Binary files differindex e8b820cee..c88b1302a 100644 --- a/Software/DB/PPC/PPC Test/Tango_log.ldf +++ b/Software/DB/PPC/PPC Test/Tango_log.ldf diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf Binary files differindex b9f5c1349..2267c9923 100644 --- a/Software/DB/PPC/Tango.mdf +++ b/Software/DB/PPC/Tango.mdf diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf Binary files differindex 575f06cfc..d6683c06e 100644 --- a/Software/DB/PPC/Tango_log.ldf +++ b/Software/DB/PPC/Tango_log.ldf diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex 2a7d934a3..e41e12e87 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex d577fcd32..4ce628579 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf 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"> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml index e737a8f7a..c60fed143 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml @@ -51,7 +51,7 @@ <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"> <touch:TouchScrollViewer CanContentScroll="True" Padding="{TemplateBinding Padding}" Focusable="False" Style="{StaticResource TouchVerticalScrollViewer}"> - <ItemsPresenter /> + <ItemsPresenter HorizontalAlignment="Stretch"/> </touch:TouchScrollViewer> </Border> </ControlTemplate> @@ -170,7 +170,7 @@ </Grid> <Canvas Grid.Column="1" Width="28" Height="28" VerticalAlignment="Top" HorizontalAlignment="Left"> - <touch:TouchToggleButton Canvas.Left="0" Canvas.Top="0" x:Name="addColorToGroup" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}" Background="Transparent" BorderThickness="0" Command="{Binding SaveMyColorsCommand}" > + <touch:TouchToggleButton Canvas.Left="0" Canvas.Top="0" x:Name="addColorToGroup" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}" Background="Transparent" BorderThickness="0" Command="{Binding OpenCloseAddMyColorDialogCommand}" > <touch:TouchToggleButton.Style> <Style TargetType="touch:TouchToggleButton" BasedOn="{StaticResource TangoTouchToggleButtonNoDisable}"> <Setter Property="IsEnabled" Value="True"/> @@ -376,18 +376,31 @@ <touch:TouchTextBox Width="220" Height="40" FontSize="{StaticResource TangoButtonFontSize}" Margin=" 20 0 10 0" Text="{Binding MyColorName}" FocusSelectionMode="SelectAll"></touch:TouchTextBox> </StackPanel> <Grid Margin="14 10 14 10" > - <ListBox HorizontalAlignment="Stretch" MaxHeight="220" ItemsSource="{Binding Libraries}" Style="{StaticResource ListBoxVerticalScroll}" - ScrollViewer.VerticalScrollBarVisibility="Visible" > + <ListBox HorizontalAlignment="Stretch" MaxHeight="220" ItemsSource="{Binding Libraries}" Style="{StaticResource ListBoxVerticalScroll}" SelectedItem="{Binding SelectedColorLibraryMyColor}" + ScrollViewer.VerticalScrollBarVisibility="Visible" HorizontalContentAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled"> <ListBox.ItemsPanel> <ItemsPanelTemplate> - <WrapPanel Orientation="Vertical" /> + <UniformGrid Columns="1" VerticalAlignment="Top" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate DataType="{x:Type models:ColorLibrary}"> - <touch:TouchButton Command="{Binding DataContext.AddColorToLibraryCommand, ElementName=colorSelectionView}" Style="{StaticResource TangoFlatButton}" CommandParameter="{Binding }" Background="Transparent"> - <TextBlock Text="{Binding Name}" FontSize="{StaticResource TangoButtonFontSize}"></TextBlock> - </touch:TouchButton> + <Grid HorizontalAlignment="Stretch" > + <Grid.Style > + <Style TargetType="Grid"> + <Setter Property="Background" Value="Transparent"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsSelected}" Value="True"> + <Setter Property="Background" Value="{StaticResource TangoLightSelectedBrush}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + + <touch:TouchButton Command="{Binding DataContext.SelectLibraryCommand, ElementName=colorSelectionView}" Style="{StaticResource TangoFlatButton}" CommandParameter="{Binding }" Background="Transparent"> + <TextBlock Text="{Binding Name}" FontSize="{StaticResource TangoButtonFontSize}"></TextBlock> + </touch:TouchButton> + </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> @@ -678,25 +691,25 @@ <Grid.Background> <SolidColorBrush Color="{StaticResource TangoDisabledBackgroundColor}" Opacity="0.65" /> </Grid.Background> - <Border Margin="72 20 69 325" CornerRadius="20" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <Border Margin="72 30 69 290" CornerRadius="20" Background="{StaticResource TangoPrimaryBackgroundBrush}"> <Border.Effect> <DropShadowEffect Opacity="0.5" ShadowDepth="6" Color="Silver" BlurRadius="10" Direction="270"/> </Border.Effect> <Border CornerRadius="20" Background="{StaticResource TangoPrimaryBackgroundBrush}"> <Grid> <DockPanel > - <Grid DockPanel.Dock="Bottom" Height="137"> - <Rectangle Height="1" Stroke="{StaticResource TangoDividerBrush}" HorizontalAlignment="Stretch"/> - <Grid Margin="48 30 0 0" > + <Grid DockPanel.Dock="Bottom" Height="136"> + <Rectangle Height="3" Stroke="{StaticResource TangoDividerBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0 10 0 0"/> + <Grid Margin="48 10 0 0" > <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="1*"/> </Grid.ColumnDefinitions> - <touch:TouchImageButton HorizontalAlignment="Left" Width="28" Height="38" Margin="0 20 23 0" EnableDropShadow="False" Background="Transparent" BorderThickness="0" Command="{ Binding AddGroupCommand}" Image="{StaticResource Add_group_mycolors}"/> - <TextBlock Grid.Column="1" Margin="20 20 0 0" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="SemiBold" Visibility="{Binding AddGroupMode, Converter={StaticResource BooleanToVisibilityInverseConverter}}">Add Group</TextBlock> + <touch:TouchImageButton HorizontalAlignment="Left" Width="28" Height="38" Margin="0 0 23 0" EnableDropShadow="False" Background="Transparent" BorderThickness="0" Command="{ Binding AddGroupCommand}" Image="{StaticResource Add_group_mycolors}"/> + <TextBlock Grid.Column="1" Margin="20 0 0 0" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="SemiBold" Visibility="{Binding AddGroupMode, Converter={StaticResource BooleanToVisibilityInverseConverter}}">Add Group</TextBlock> <DockPanel Visibility="{Binding AddGroupMode, Converter={StaticResource BooleanToVisibilityConverter}}" Grid.Column="1" Margin=" 20 0 0 20"> - <touch:TouchTextBox DockPanel.Dock="Left" Margin="0 0 80 0" x:Name="newGroupNametext" MinWidth="200" Height="Auto" Text="{Binding NewGroupName, Mode=TwoWay,UpdateSourceTrigger=LostFocus}"></touch:TouchTextBox> - <touch:TouchButton DockPanel.Dock="Right" Width="160" Height="40" CornerRadius="20" Background="Transparent" EnableDropShadow="False" TextElement.Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}" HorizontalAlignment="Right" Margin="10 26 20 0" VerticalAlignment="Bottom" + <touch:TouchTextBox DockPanel.Dock="Left" Margin="0 0 80 0" x:Name="newGroupNametext" MinWidth="350" Height="Auto" Text="{Binding NewGroupName, Mode=TwoWay,UpdateSourceTrigger=LostFocus}" VerticalAlignment="Center"></touch:TouchTextBox> + <touch:TouchButton DockPanel.Dock="Right" Width="160" Height="40" CornerRadius="20" Background="Transparent" EnableDropShadow="False" TextElement.Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}" HorizontalAlignment="Right" Margin="10 20 20 0" VerticalAlignment="Center" BorderThickness="1" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Command="{Binding AddNewGroupCommand}" CommandParameter="{Binding ElementName=newGroupNametext, Path=Text}">Add</touch:TouchButton> </DockPanel> @@ -707,25 +720,30 @@ <TextBlock DockPanel.Dock="Left" Margin="43 53 0 28" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">My Colors</TextBlock> <touch:TouchImageButton DockPanel.Dock="Top" Width="32" Height="32" Image="{StaticResource Close_mycolorsdlg}" HorizontalAlignment="Right" Margin="0 20 23 0" EnableDropShadow="False" Background="Transparent" BorderThickness="0" Command="{Binding CloseMyColorsCommand}"/> </DockPanel> - <StackPanel Orientation="Vertical" Margin="0"> - <DockPanel> + <StackPanel Orientation="Vertical" Margin="0 20 0 0"> + <DockPanel VerticalAlignment="Top"> <touch:TouchButton DockPanel.Dock="Right" Height="48" Command="{Binding DataContext.EditColorsLibrariesCommand, ElementName=colorSelectionView}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 0 30 10" Background="Transparent" ShadowDepth="0" ShadowColor="Transparent"> - <StackPanel Height="48" Width="160" Orientation="Horizontal"> - <touch:TouchIcon Margin="0 7 0 0" VerticalAlignment="Center" Foreground="{StaticResource TangoBlackInkBrush}" Height="16.5" Icon="PencilAltSolid" /> - <TextBlock Text="{Binding EditColorButtonName, Mode=TwoWay, TargetNullValue=EDIT}" Height="30" Margin="25 10 0 0" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="SemiBold" VerticalAlignment="Center" Foreground="{StaticResource TangoBlackInkBrush}" ></TextBlock> + <StackPanel Height="48" Width="160" Orientation="Horizontal" > + <touch:TouchIcon Margin="0 9 0 0" Foreground="{StaticResource TangoBlackInkBrush}" Height="25" Icon="PencilAltSolid" /> + <TextBlock Text="{Binding EditColorButtonName, Mode=TwoWay, TargetNullValue=EDIT}" Height="30" Margin="25 12 0 0" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="SemiBold" VerticalAlignment="Bottom" Foreground="{StaticResource TangoBlackInkBrush}" ></TextBlock> </StackPanel> </touch:TouchButton> - <Grid DockPanel.Dock="Left" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="60 0 0 0" Width="280"> + <Grid DockPanel.Dock="Left" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="60 0 0 0" Width="280" Height="48"> <DockPanel> <Image DockPanel.Dock="Left" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="40" Height="40" Source="{StaticResource SearchImage}"/> <!--<touch:TouchIcon DockPanel.Dock="Left" Foreground="{StaticResource TangoGrayBrush}" Width="20" Height="20" VerticalAlignment="Bottom" Icon="Magnify" />--> - <touch:TouchTextBox Margin="5 0 0 0" Width="300" Text="{Binding SearchColorText,Mode=TwoWay, UpdateSourceTrigger=LostFocus}" ></touch:TouchTextBox> + <touch:TouchTextBox Margin="15 0 0 0" Width="300" Text="{Binding SearchColorText,Mode=TwoWay, UpdateSourceTrigger=LostFocus}" VerticalAlignment="Center" ></touch:TouchTextBox> </DockPanel> </Grid> </DockPanel> - <ListBox x:Name="listLibraries" Grid.Row="1" Margin="10 0 10 60" ItemsSource="{Binding Libraries}" Style="{StaticResource ListBoxVerticalScroll}" + <ListBox x:Name="listLibraries" Margin="10 16 10 10" ItemsSource="{Binding Libraries}" Style="{StaticResource ListBoxVerticalScroll}" ScrollViewer.VerticalScrollBarVisibility="Visible" Width="560" ItemTemplate="{StaticResource ColorLibrary_Template}" Height="580"> </ListBox> + + <StackPanel Height="38" Width="160" Orientation="Horizontal" HorizontalAlignment="Left" Margin=" 50 20 20 0" VerticalAlignment="Bottom"> + <touch:TouchIconButton Margin="0 7 0 10" VerticalAlignment="Bottom" Foreground="{StaticResource TangoBlackInkBrush}" Width="26" Icon="Upload" Command="{Binding UploadFileCommand}"/> + <touch:TouchIconButton Margin="30 7 0 10" VerticalAlignment="Bottom" Foreground="{StaticResource TangoBlackInkBrush}" Width="26" Icon="Download" Command="{Binding DownloadFileCommand}"/> + </StackPanel> </StackPanel> </DockPanel> </Grid> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs index 3146da179..cc8ddc84e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs @@ -1,9 +1,11 @@ using ColorMine.ColorSpaces; +using Microsoft.Win32; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.ComponentModel; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -323,6 +325,24 @@ namespace Tango.PPC.Jobs.Dialogs private ColorLibrary SelectedColorLibrary { get; set; } + private ColorLibrary _selectedColorLibraryMyColor; + + public ColorLibrary SelectedColorLibraryMyColor + { + get { return _selectedColorLibraryMyColor; } + set { + if(_selectedColorLibraryMyColor != null) + _selectedColorLibraryMyColor.IsSelected = false; + + _selectedColorLibraryMyColor = value; + + if (_selectedColorLibraryMyColor != null) + _selectedColorLibraryMyColor.IsSelected = true; + RaisePropertyChangedAuto(); + } + } + + private FavoriteColor _selectedColor; public FavoriteColor SelectedColor @@ -439,17 +459,36 @@ namespace Tango.PPC.Jobs.Dialogs set { _editColorButtonName = value; RaisePropertyChangedAuto();} } - + + private PPCSettings _settings; + /// <summary> + /// Gets the main PPC settings. + /// </summary> + public PPCSettings Settings + { + get + { + if (_settings == null) + { + _settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); + } + + return _settings; + } + private set { _settings = value; } + } + #endregion #region commands /// <summary> /// Gets or sets the save my colors command. /// </summary> + public RelayCommand OpenCloseAddMyColorDialogCommand { get; set; } public RelayCommand SaveMyColorsCommand { get; set; } public RelayCommand<string> AddNewGroupCommand { get; set; } public RelayCommand<string> AddNewGroupAndColorCommand { get; set; } - public RelayCommand<ColorLibrary> AddColorToLibraryCommand { get; set; } + public RelayCommand<ColorLibrary> SelectLibraryCommand { get; set; } /// <summary> /// Gets or sets the open my colors command. @@ -464,6 +503,8 @@ namespace Tango.PPC.Jobs.Dialogs public RelayCommand<object> DeleteColorCommand { get; set; } public RelayCommand VectorFineTuningCommand { get; set; } + public RelayCommand UploadFileCommand { get; set; } + public RelayCommand DownloadFileCommand { get; set; } #endregion @@ -501,6 +542,7 @@ namespace Tango.PPC.Jobs.Dialogs } }); + OpenCloseAddMyColorDialogCommand = new RelayCommand(OpenCloseAddMyColorDialog); SaveMyColorsCommand = new RelayCommand(SaveMyColors); OpenMyColorsCommand = new RelayCommand(() => { MyColorsMode = true; }); CloseMyColorsCommand = new RelayCommand(() => { MyColorsMode = false; SearchColorText = "";}); @@ -508,11 +550,15 @@ namespace Tango.PPC.Jobs.Dialogs AddGroupCommand = new RelayCommand(AddGroup); AddNewGroupCommand = new RelayCommand<string>(AddNewGroup); AddNewGroupAndColorCommand = new RelayCommand<string>(AddNewGroupAndColor); - AddColorToLibraryCommand = new RelayCommand<ColorLibrary>(AddColorToLibrary); + + SelectLibraryCommand = new RelayCommand<ColorLibrary>(SelectLibrary); DeleteGroupCommand = new RelayCommand<ColorLibrary>(DeleteGroup); EditColorsLibraryCommand = new RelayCommand<ColorLibrary>(EditColorsLibrary); EditColorsLibrariesCommand = new RelayCommand(EditColorsLibraries); DeleteColorCommand = new RelayCommand<object>(DeleteColor); + UploadFileCommand = new RelayCommand(UploadFile); + DownloadFileCommand = new RelayCommand(DownloadFile); + MyColorsMode = false; EditColorsGroupMode = false; SaveMyColorMode = false; @@ -616,9 +662,7 @@ namespace Tango.PPC.Jobs.Dialogs CheckIsSelectedColorInLibrary(); SelectedBrushStop.ConvertColor();//test OOG } - - private void OnSelectedtabChanged() { switch (SelectedColorTab) @@ -824,7 +868,7 @@ namespace Tango.PPC.Jobs.Dialogs #region MyColors - private void SaveMyColors() + private void OpenCloseAddMyColorDialog() { if(IsBusy) return; @@ -866,17 +910,37 @@ namespace Tango.PPC.Jobs.Dialogs else { SaveMyColorMode = !SaveMyColorMode; + //Init MyColorName on open the dialog String colorName = "MyColor"; - if (SelectedBrushStop != null && SelectedBrushStop.SegmentModel != null - && SelectedBrushStop.SegmentModel.Job != null) + if ( SelectedBrushStop != null && SelectedBrushStop.SegmentModel != null && SelectedBrushStop.SegmentModel.Job != null ) { colorName = SelectedBrushStop.SegmentModel.Job.Name; if(colorName.Length > 40) colorName = colorName.Substring(0, 40); } MyColorName = colorName; + SelectedColorLibraryMyColor = null; + AddGroupMode = false; } - + IsBusy = false; + + } + + /// <summary> + /// Saves my colors on OK button of dialog "Add my Color" + /// </summary> + private void SaveMyColors() + { + if (IsBusy) + return; + IsBusy = true; + if (SelectedColorLibraryMyColor != null) + { + AddColorToLibrary(SelectedColorLibraryMyColor); + } + SelectedColorLibraryMyColor = null; + AddGroupMode = false; + SaveMyColorMode = false; IsBusy = false; } @@ -932,14 +996,15 @@ namespace Tango.PPC.Jobs.Dialogs { NotificationProvider.ShowInfo("A group with this name already exists. Try adding a different name."); } + SelectedColorLibrary = library; - AddColorToLibrary(library); + // AddColorToLibrary(library); } NewGroupName = "Library" + (Libraries.Count() + 1); - SaveMyColorMode = false; - AddGroupMode = false; + //SaveMyColorMode = false; + //AddGroupMode = false; } - + /// <summary> /// Adds the selected color to library in Save my Colors. /// </summary> @@ -985,6 +1050,11 @@ namespace Tango.PPC.Jobs.Dialogs SaveMyColorMode = false; } + private void SelectLibrary(ColorLibrary library) + { + SelectedColorLibraryMyColor = library; + } + private void SelectColor(FavoriteColor favoriteColor) { SelectedColor = favoriteColor; @@ -1101,6 +1171,70 @@ namespace Tango.PPC.Jobs.Dialogs } } + private async void UploadFile() + { + if (Settings.StorageRootPath == null || false == Directory.Exists(Settings.StorageRootPath)) + { + Settings.StorageRootPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Twine", "Storage"); + Directory.CreateDirectory(Settings.StorageRootPath); + } + SaveFileDialog dlg = new SaveFileDialog(); + dlg.InitialDirectory = Path.GetFullPath(Settings.StorageRootPath); + dlg.RestoreDirectory = true; + dlg.Filter = "Tango Update My Colors|*.colr"; + dlg.FileName = "MyColors"; + dlg.DefaultExt = ".colr"; + if (dlg.ShowDialog().Value) + { + try + { + IsFree = false; + MyColorsEngine.Default.ToFile(dlg.FileName); + await NotificationProvider.ShowSuccess("My colors file saved successfully."); + LogManager.Log($"My colors file saved successfully to file {dlg.FileName}."); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error saving My colors to file."); + await NotificationProvider.ShowError($"Error creating My colors file:\n{ex.Message}"); + } + finally + { + IsFree = true; + } + } + } + + private void DownloadFile() + { + if (Settings.StorageRootPath == null || false == Directory.Exists(Settings.StorageRootPath)) + { + Settings.StorageRootPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Twine", "Storage"); + Directory.CreateDirectory(Settings.StorageRootPath); + } + if (Directory.Exists(Settings.StorageRootPath)) + { + Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog + { + InitialDirectory = Settings.StorageRootPath, + Title = "Browse My Colors Files", + + CheckFileExists = true, + CheckPathExists = true, + + DefaultExt = "colr", + Filter = "job files (*.colr)|*.colr", + ReadOnlyChecked = true, + ShowReadOnly = true + }; + if (openFileDialog.ShowDialog().Value) + { + MyColorsEngine.Default.FromFile(openFileDialog.FileName); + Libraries = MyColorsEngine.Default.GetAll().ToObservableCollection(); + } + } + } + private void LoadLibraryDictionary() { _colorSpaceToFavoriteColorDictionary = new Dictionary<ColorSpaces, List<FavoriteColor>>(); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Images/JobView/select_all.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Images/JobView/select_all.png Binary files differnew file mode 100644 index 000000000..0a27c2aaa --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Images/JobView/select_all.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ColorLibrary.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ColorLibrary.cs index 62dc7ec1b..284b2c787 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ColorLibrary.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ColorLibrary.cs @@ -16,6 +16,7 @@ namespace Tango.PPC.Jobs.Models { public class ColorLibrary: ExtendedObject { + #region Properties private ObservableCollection<FavoriteColor> _colorList; public ObservableCollection<FavoriteColor> ColorList { @@ -51,7 +52,23 @@ namespace Tango.PPC.Jobs.Models OnEditGroupModeChanged(); RaisePropertyChangedAuto(); } } - + + private bool _isSelected; + [BsonIgnore] + public bool IsSelected + { + get { + return _isSelected; + } + set { + _isSelected = value; + RaisePropertyChangedAuto(); + } + } + + + #endregion + public ColorLibrary() { _colorList = new ObservableCollection<FavoriteColor>(); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColor.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColor.cs index 00c8293bd..1d7b7c7c2 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColor.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColor.cs @@ -10,6 +10,7 @@ using System.Windows; using ColorMine.ColorSpaces; using Tango.Core; using LiteDB; +using Newtonsoft.Json; namespace Tango.PPC.Jobs.Models { @@ -86,14 +87,18 @@ namespace Tango.PPC.Jobs.Models } [BsonIgnore] + [JsonIgnore] public SolidColorBrush Brush { get { return new SolidColorBrush(Color); } } [BsonIgnore] + [JsonIgnore] private bool _isSelected; + [BsonIgnore] + [JsonIgnore] public bool IsSelected { get { return _isSelected; } @@ -117,5 +122,17 @@ namespace Tango.PPC.Jobs.Models ColorSpace = ColorSpaces.Volume; IsSelected = false; } + + public bool Equals(FavoriteColor color) + { + if(color == null) + return false; + + return (ColorSpace == color.ColorSpace + && Cyan == color.Cyan && Magenta == color.Magenta && Yellow == color.Yellow && Black ==color.Black + && Red == color.Red && Green == color.Green && Blue == color.Blue + && L == color.L && A == color.A && B == color.B + && Hue == color.Hue && Saturation == color.Saturation && Brightness == color.Brightness); + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs index d8a71fc78..983719e57 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs @@ -79,7 +79,7 @@ namespace Tango.PPC.Jobs.Models if (Segments != null) { if((EnableInterSegment && IsAllSegmentsPerSpool)) - return GroupingSegments.Count > 0 ? (GroupingSegments.Sum(x => x.LengthWithInterSegment) - InterSegmentLength) : 0; + return GroupingSegments.Count > 0 ? (GroupingSegments.Sum(x => x.LengthWithInterSegment) ) : 0; return GroupingSegments.Sum(x => x.FullLength); //return Segments.Sum(x => x.LengthWithInterSegment); // return Segments.Sum(x => x.LengthWithFactor) + ((EnableInterSegment && IsAllSegmentsPerSpool) ? (InterSegmentLength * (Segments.Count > 0 ? Segments.Count - 1 : Segments.Count)) : 0); @@ -1097,8 +1097,9 @@ namespace Tango.PPC.Jobs.Models // NumberOfUnits = (int)maxRep; //} } - RaisePropertyChanged(nameof(Length)); + OnUpdateLengthhWeight(); + RaisePropertyChanged(nameof(Length)); } RaisePropertyChanged(nameof(GetEstimatedDuration)); @@ -1131,8 +1132,11 @@ namespace Tango.PPC.Jobs.Models int max = GroupingSegments.Max(x => x.SegmentIndex); GroupingSegments.Where(i => i.SegmentIndex != max).ToList().ForEach(x => x.EnableInterSegment = InterSegmentLength > 0); } + _enableintersegment = InterSegmentLength > 0; _preventChange = false; + OnLengthChanged(); + UpdateEffectiveSegments(); } private void OnNumberOfSpoolsChanged() diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/MyColors/MyColorsEngine.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/MyColors/MyColorsEngine.cs index 27dabc2e7..2963d290b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/MyColors/MyColorsEngine.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/MyColors/MyColorsEngine.cs @@ -6,11 +6,15 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.PPC.Jobs.Models; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; namespace Tango.PPC.Jobs.MyColors { public class MyColorsEngine : IDisposable { + private JsonSerializerSettings _settings; + private LiteDatabase _db; private ILiteCollection<ColorLibrary> _collection; @@ -35,6 +39,14 @@ namespace Tango.PPC.Jobs.MyColors Directory.CreateDirectory(dbFolder); _db = new LiteDatabase($"Filename={Path.Combine(dbFolder, "color_library.db")}"); _collection = _db.GetCollection<ColorLibrary>("Libraries"); + + _settings = new JsonSerializerSettings() + { + TypeNameHandling = TypeNameHandling.Auto, + Formatting = Formatting.Indented, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore, + PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.Objects + }; } public void UpdateLibrary(ColorLibrary library) @@ -72,5 +84,34 @@ namespace Tango.PPC.Jobs.MyColors { _collection.Delete(library.ID); } + + public void ToFile( string flePath) + { + string jsonCollection = JsonConvert.SerializeObject(GetAll(), _settings); + File.WriteAllText(flePath, jsonCollection); + } + + public void FromFile(String fileName) + { + string json = File.ReadAllText(fileName); + List<ColorLibrary> colorCollection = JsonConvert.DeserializeObject<List<ColorLibrary>>(json, _settings); + foreach(var colorLib in colorCollection) + { + var currentLib = _collection.FindOne(x => x.Name == colorLib.Name); + if (currentLib != null) + { + var newlist = colorLib.ColorList.Where(s => !currentLib.ColorList.Any(p => p.Equals(s))); + foreach( var x in newlist) + currentLib.ColorList.Add(x); + + UpdateLibrary(currentLib); + } + else + { + _collection.Insert(colorLib); + } + + } + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj index 96083d842..33ccc5b53 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj @@ -752,10 +752,13 @@ <ItemGroup> <Resource Include="Images\ColorSelection\SearchImage.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\JobView\select_all.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs index 345231e57..8a01e07cc 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs @@ -110,6 +110,17 @@ namespace Tango.PPC.Jobs.ViewModels } } + public bool CanDropResume + { + get + { + return Job != null && HasResumeModel && + (!MachineProvider.MachineOperator.IsPrinting + || (MachineProvider.MachineOperator.RunningJob != null + && MachineProvider.MachineOperator.RunningJob.Guid != Job.Guid)); + } + } + private ICollectionView _segmentsCollectionView; /// <summary> /// Gets or sets the job segments collection view. @@ -280,19 +291,7 @@ namespace Tango.PPC.Jobs.ViewModels } } } - - private bool _showAdvanced; - - public bool ShowAdvanced - { - get { return _showAdvanced; } - set - { - _showAdvanced = value; - RaisePropertyChangedAuto(); - } - } - + private JobResumeModel _resumeModel; public JobResumeModel ResumeModel { @@ -435,7 +434,7 @@ namespace Tango.PPC.Jobs.ViewModels CopyCommand = new RelayCommand(Copy); UndoCommand = new RelayCommand(Undo);//(x) => { return UndoRedoManager.Instance.IsEnableUndoOperation(); } RedoCommand = new RelayCommand(Redo);//(x) => { return UndoRedoManager.Instance.IsEnableRedoOperation();} - DropResumeCommand = new RelayCommand(DropResume); + DropResumeCommand = new RelayCommand(DropResume, (x)=> CanDropResume); NavigateBackToJobs = new RelayCommand(NavigateBack); @@ -522,6 +521,7 @@ namespace Tango.PPC.Jobs.ViewModels } RaisePropertyChanged(nameof(CanEdit)); + DropResumeCommand.RaiseCanExecuteChanged(); Job.NameChanged -= Job_NameChanged; Job.NameChanged += Job_NameChanged; @@ -547,7 +547,7 @@ namespace Tango.PPC.Jobs.ViewModels RaisePropertyChanged(nameof(SelectedRML)); await LoadRML(_selectedRML); - if (BuildProvider.IsEureka && Job.Segments.Count == 1 && Job.Segments[0].BrushStops.Count == 1) + if (BuildProvider.IsEureka && Job.Segments.Count == 1 && Job.Segments[0].BrushStops.Count <= 1) { IsBasicMode = true; } @@ -581,7 +581,6 @@ namespace Tango.PPC.Jobs.ViewModels IsFullMode = true; DyeCommand.RaiseCanExecuteChanged(); - ShowAdvanced = Settings.ShowAdvancedOptions; } catch (Exception ex) { @@ -633,8 +632,8 @@ namespace Tango.PPC.Jobs.ViewModels JobType = Job.JobType, InterSegmentLength = Job.InterSegmentLength, EnableInterSegment = Job.EnableInterSegment, - NumberSpools = (BuildProvider.IsEureka ? Job.Spools : 1), - Copies = (BuildProvider.IsEureka ? Job.NumberOfUnits * Job.Spools : Job.NumberOfUnits) + NumberSpools = (BuildProvider.IsEureka ? Job.NumberOfSpools : 1), + Copies = (BuildProvider.IsEureka ? Job.NumberOfUnits * Job.NumberOfSpools : Job.NumberOfUnits) }; Dictionary<string, SegmentsGroupModel> guidToGroup = new Dictionary<string, SegmentsGroupModel>(); if (Job.Version < 2) @@ -781,6 +780,7 @@ namespace Tango.PPC.Jobs.ViewModels var handler = await PrintingManager.Print(Job, _db, printConfig); RaisePropertyChanged(nameof(CanEdit)); + DropResumeCommand.RaiseCanExecuteChanged(); if (!BuildProvider.IsEureka) { @@ -1607,6 +1607,7 @@ namespace Tango.PPC.Jobs.ViewModels { Job.SpoolType = _spoolTypes.FirstOrDefault(x => x.Code == (int)BL.Enumerations.SpoolTypes.StandardSpool); } + Job.NumberOfSpools = JobModel.NumberSpools; var oldSegments = Job.Segments.ToList(); @@ -1786,6 +1787,10 @@ namespace Tango.PPC.Jobs.ViewModels private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) { RaisePropertyChanged(nameof(CanEdit)); + InvokeUI( () => + { + DropResumeCommand.RaiseCanExecuteChanged(); + }); } private void MachineOperator_PrintingEnded(object sender, Integration.Operation.PrintingEventArgs e) @@ -1796,6 +1801,10 @@ namespace Tango.PPC.Jobs.ViewModels } RaisePropertyChanged(nameof(CanEdit)); + InvokeUI(() => + { + DropResumeCommand.RaiseCanExecuteChanged(); + }); } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs index e5e41b382..5f005385e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs @@ -185,6 +185,16 @@ namespace Tango.PPC.Jobs.ViewModels set { _collectionFilter = value; RaisePropertyChangedAuto(); } } + private bool _selectAll; + + public bool SelectAll + { + get { return _selectAll; } + set { _selectAll = value; + RaisePropertyChangedAuto();} + } + + #endregion @@ -230,6 +240,8 @@ namespace Tango.PPC.Jobs.ViewModels /// </summary> public RelayCommand MoveToListJobsCommand { get; set; } + public RelayCommand SelectAllJobsCommand { get; set; } + #endregion #region Constructors @@ -257,6 +269,7 @@ namespace Tango.PPC.Jobs.ViewModels CloneJobsCommand = new RelayCommand(() => CloneJobs(SelectedJobs)); ExportJobCommand = new RelayCommand(ExportJob); MoveToListJobsCommand = new RelayCommand(() => MoveToListJobs(SelectedJobs)); + SelectAllJobsCommand = new RelayCommand(SelectAllJobs); RegisterForMessage<JobRemovedMessage>(HandleJobRemovedMessage); RegisterForMessage<JobSavedMessage>(HandleJobSavedMessage); @@ -421,6 +434,12 @@ namespace Tango.PPC.Jobs.ViewModels IsMultiSelecting = false; } + private void SelectAllJobs() + { + SelectAll = !SelectAll; + } + + /// <summary> /// Adds a new job. /// </summary> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml index d348b2cc7..adf8c22d5 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml @@ -962,7 +962,7 @@ </Grid.RowDefinitions> <Grid Grid.Row="0"> <DockPanel x:Name="ColorPropertiesPanel" VerticalAlignment="Top" > - <StackPanel x:Name="AdvansedOptions" DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Top" Margin="0 5 18 0" Height="55" HorizontalAlignment="Right" Width="Auto" Visibility="{Binding ShowAdvanced, Converter={StaticResource BooleanToVisibilityConverter}}"> + <StackPanel x:Name="AdvansedOptions" DockPanel.Dock="Right" Orientation="Horizontal" Margin="0 5 18 0" Height="55" HorizontalAlignment="Right" Width="Auto" VerticalAlignment="Center"> <TextBlock FontSize="20" VerticalAlignment="Center" >Advanced Options</TextBlock> <touch:TouchToggleSlider Style="{StaticResource TangoToggleButtonGreenAccent}" Height="28" CornerRadius="14" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="10 0 0 0" Width="54" IsChecked="{Binding IsBasicMode, Converter={StaticResource BooleanInverseConverter}, Mode=TwoWay}"></touch:TouchToggleSlider> </StackPanel> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml index d3fdedde5..ec080ebed 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml @@ -35,6 +35,8 @@ <sharedConverters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" /> <converters:JobsCategoryToVisibilityConverter x:Key="JobsCategoryToVisibilityConverter" /> <converters:JobsCategoryToOpacityConverter x:Key="JobsCategoryToOpacityConverter" /> + + <BitmapImage x:Key="SelectAll" UriSource="../Images/JobView/select_all.png" /> </ResourceDictionary> </UserControl.Resources> @@ -94,6 +96,22 @@ <touch:TouchIconButton Command="{Binding ClearSelectionCommand}" Visibility="{Binding IsMultiSelecting,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 0 30 0" Padding="20" Icon="Close" Width="50" Height="50" Style="{StaticResource TangoRoundTouchIconButton}"> </touch:TouchIconButton> + <!--<touch:TouchIconButton Command="{Binding SelectAllJobsCommand}" Margin="0 0 30 0" Padding="20" Icon="CheckboxMultipleMarkedOutline" Style="{StaticResource TangoRoundTouchIconButton}">>--> + <touch:TouchButton x:Name="SelectAllButton" Command="{Binding SelectAllJobsCommand}" Margin="0 0 30 0" EnableDropShadow="False"> + <touch:TouchButton.Style> + <Style TargetType="touch:TouchButton" > + <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter> + <Setter Property="RenderOptions.EdgeMode" Value="Unspecified"></Setter> + <Setter Property="RenderOptions.BitmapScalingMode" Value="Fant"></Setter> + <Setter Property="CornerRadius" Value="50"></Setter> + <Setter Property="RippleCentered" Value="True"></Setter> + <Setter Property="RippleFactor" Value="2"></Setter> + <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"></Setter> + </Style> + </touch:TouchButton.Style> + <Image Source="{StaticResource SelectAll}" Width="24" Height="24"></Image> + </touch:TouchButton> + <!--</touch:TouchIconButton>--> <touch:TouchIconButton Command="{Binding MoveToListJobsCommand}" Margin="0 0 30 0" Padding="20" > <touch:TouchIconButton.Style> <Style TargetType="touch:TouchIconButton" BasedOn="{StaticResource TangoRoundTouchIconButton}"> @@ -205,7 +223,7 @@ <Grid Grid.Row="1" x:Name="moveGrid"> <touch:TouchLoadingPanel IsLoading="{Binding IsLoadingJobs}" Visibility="{Binding SelectedCategory,Converter={StaticResource JobsCategoryToVisibilityConverter},ConverterParameter='Draft'}"> - <touch:LightTouchDataGrid CollectionFilter="{Binding CollectionFilter}" AnimateSorting="False" RenderOptions.EdgeMode="Unspecified" Style="{StaticResource TangoJobsGrid}" x:Name="dataGridJobs" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" OnDragAndDropCommand="{Binding JobDragedDroppedCommand}" ItemsSource="{Binding DraftJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10"> + <touch:LightTouchDataGrid CollectionFilter="{Binding CollectionFilter}" AnimateSorting="False" RenderOptions.EdgeMode="Unspecified" Style="{StaticResource TangoJobsGrid}" x:Name="dataGridJobs" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" OnDragAndDropCommand="{Binding JobDragedDroppedCommand}" ItemsSource="{Binding DraftJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10" SelectAll="{Binding SelectAll,Mode=TwoWay}"> <touch:LightTouchDataGrid.Columns> <!--<touch:LightTouchDataGridColumn Width="90"> <touch:LightTouchDataGridColumn.Header> @@ -267,7 +285,7 @@ <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="#,0.0" TargetNullValue='0' FallbackValue='0' Mode="OneWay"> <Binding Path="LengthIncludingNumberOfUnits" Mode="OneWay"/> <Binding Path="DataContext.BuildProvider.IsEureka" Mode="OneWay" RelativeSource="{RelativeSource AncestorType=UserControl}"/> - <Binding Path="Spools" Mode="OneWay"/> + <Binding Path="NumberOfSpools" Mode="OneWay"/> </MultiBinding> </TextBlock.Text> </TextBlock> @@ -336,7 +354,7 @@ </touch:TouchLoadingPanel> <touch:TouchLoadingPanel IsLoading="{Binding IsLoadingJobs}" Visibility="{Binding SelectedCategory,Converter={StaticResource JobsCategoryToVisibilityConverter},ConverterParameter='History'}"> - <touch:LightTouchDataGrid CollectionFilter="{Binding CollectionFilter}" AnimateSorting="False" EnableDragAndDrop="False" RenderOptions.EdgeMode="Unspecified" x:Name="dataGridJobsHistory" Style="{StaticResource TangoJobsGrid}" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" ItemsSource="{Binding HistoryJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10"> + <touch:LightTouchDataGrid CollectionFilter="{Binding CollectionFilter}" AnimateSorting="False" EnableDragAndDrop="False" RenderOptions.EdgeMode="Unspecified" x:Name="dataGridJobsHistory" Style="{StaticResource TangoJobsGrid}" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" ItemsSource="{Binding HistoryJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10" SelectAll="{Binding SelectAll,Mode=TwoWay}"> <touch:LightTouchDataGrid.Columns> <touch:LightTouchDataGridColumn Width="50"> <touch:LightTouchDataGridColumn.Header> @@ -390,7 +408,7 @@ <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="0.0" TargetNullValue='0' FallbackValue='0'> <Binding Path="LengthIncludingNumberOfUnits" Mode="OneWay"/> <Binding Path="DataContext.BuildProvider.IsEureka" Mode="OneWay" RelativeSource="{RelativeSource AncestorType=UserControl}"/> - <Binding Path="Spools" Mode="OneWay"/> + <Binding Path="NumberOfSpools" Mode="OneWay"/> </MultiBinding> </TextBlock.Text> </TextBlock> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml index 764f044d0..7de2818f8 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml @@ -457,15 +457,10 @@ <DockPanel Margin="0 20 0 0" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> <TextBlock VerticalAlignment="Center">Min limit dL (Fine Tuning)</TextBlock> - <touch:TouchNumericTextBox Minimum="0" Maximum="10" KeyboardContainer="{Binding ElementName=Container}" Value="{Binding Settings.FineTuningMinLimitdL}" Margin="0 0 100 0" DockPanel.Dock="Right" HorizontalAlignment="Right" Width="90" HasDecimalPoint="True"></touch:TouchNumericTextBox> + <touch:TouchNumericTextBox Minimum="0" Maximum="10" KeyboardContainer="{Binding ElementName=Container}" Value="{Binding Settings.FineTuningMinLimitdL}" Margin="0 0 100 0" DockPanel.Dock="Right" HorizontalAlignment="Right" Width="90" HasDecimalPoint="True" ></touch:TouchNumericTextBox> </DockPanel> - <DockPanel Margin="0 20 0 0" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> - <TextBlock VerticalAlignment="Center">Show advanced options (Segments & Gradients) in the Job Editor</TextBlock> - <touch:TouchToggleSlider IsChecked="{Binding Settings.ShowAdvancedOptions}" Margin="0 0 100 0" DockPanel.Dock="Right" Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Width="90"></touch:TouchToggleSlider> - </DockPanel> - - <DockPanel Margin="0 20 0 0"> + <DockPanel Margin="0 20 0 10"> <touch:TouchIcon VerticalAlignment="Top" Icon="InformationOutline" Foreground="{StaticResource TangoGrayTextBrush}"></touch:TouchIcon> <TextBlock Margin="10 0 0 0" VerticalAlignment="Top" TextWrapping="Wrap" FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoGrayTextBrush}"> Please restart the application for advanced settings to take effect. diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs index ed7784b2b..b3cb5673b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs @@ -201,9 +201,9 @@ namespace Tango.PPC.Storage.ViewModels public override Task<bool> OnNavigateBackRequest() { - String path = Settings.StorageRootPath != null ? Settings.StorageRootPath : StorageProvider.Drive.RootDirectory.FullName; - - if (_allow_exit || CurrentPath == path) + if (_allow_exit || + (Settings.StorageRootPath != null && Settings.StorageRootPath == CurrentPath) + || (StorageProvider.Drive != null && StorageProvider.Drive.RootDirectory != null && CurrentPath == StorageProvider.Drive.RootDirectory.FullName)) { return Task.FromResult(true); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs index acb84191b..03215553b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs @@ -361,11 +361,6 @@ namespace Tango.PPC.Common public double FineTuningMinLimitdL { get; set; } /// <summary> - /// Gets or sets a value indicating whether [show advanced options]. - /// </summary> - public bool ShowAdvancedOptions { get; set; } - - /// <summary> /// Gets or sets a value indicating whether to force full screen mode on TwineX4. /// </summary> public bool ForceTouchMode { get; set; } @@ -455,7 +450,6 @@ namespace Tango.PPC.Common ScreenSaverStartDuration = 5; EnableScreenSaver = true; EnableRemoteJobUpload = true; - ShowAdvancedOptions = false; } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs index 377d02d81..f43405085 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs @@ -15,11 +15,12 @@ namespace Tango.PPC.UI.Converters { try { - if (values.Count() == 2) + if (values.Count() == 3) { double length = System.Convert.ToDouble(values[0]); bool forOneSpool = System.Convert.ToBoolean(values[1]); - var totalBy4Spools = (double)length*4;// spools ; + int number_of_spools = System.Convert.ToInt16(values[2]); + var totalBy4Spools = (double)length* number_of_spools; if (forOneSpool) { return (double)totalBy4Spools / 4; @@ -27,14 +28,15 @@ namespace Tango.PPC.UI.Converters return totalBy4Spools; } - if (values.Count() == 3) + if (values.Count() == 4) { double length = System.Convert.ToDouble(values[0]); bool forOneSpool = System.Convert.ToBoolean(values[1]); double currentProgresslength = System.Convert.ToDouble(values[2]) ; + int number_of_spools = System.Convert.ToInt16(values[3]); - var totalBy4Spools = (double)length * 4; - var currentProgressBy4Spools = (double)currentProgresslength * 4 ; + var totalBy4Spools = (double)length * number_of_spools; + var currentProgressBy4Spools = (double)currentProgresslength * number_of_spools; int coeff = (int)currentProgressBy4Spools / (int)totalBy4Spools; var progressCurrent = (coeff == 0 || coeff == 1) ? currentProgressBy4Spools : currentProgressBy4Spools % (coeff * totalBy4Spools);//show for progress diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs index d0cc8284e..66303ab27 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs @@ -14,11 +14,11 @@ namespace Tango.PPC.UI.Converters { try { - if (values.Count() == 1)//may be added count of spools + if (values.Count() == 2)//may be added count of spools { int CurrentUnit = System.Convert.ToInt16(values[0]); - - var totalBy4Spools = (double)CurrentUnit * 4;// spools ; + int number_of_spools = System.Convert.ToInt16(values[1]); + var totalBy4Spools = (double)CurrentUnit * number_of_spools; return totalBy4Spools.ToString(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs index f451fe0d9..7ffb1e8a7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs @@ -16,12 +16,13 @@ namespace Tango.PPC.UI.Converters { try { - if (values.Count() == 3) + if (values.Count() == 4) { double length = System.Convert.ToDouble(values[0]); bool forOneSpool = System.Convert.ToBoolean(values[1]); double coef = System.Convert.ToDouble(values[2]); - var totalBy4Spools = (double)length * 4;// spools ; + int number_of_spools = System.Convert.ToInt16(values[3]); + var totalBy4Spools = (double)length * number_of_spools; var weight = ((double)totalBy4Spools * coef) / (1000);//(g) if (forOneSpool) @@ -31,15 +32,16 @@ namespace Tango.PPC.UI.Converters return weight; } - if (values.Count() == 4) + if (values.Count() == 5) { double length = System.Convert.ToDouble(values[0]); bool forOneSpool = System.Convert.ToBoolean(values[1]); double currentProgresslength = System.Convert.ToDouble(values[2]); double coef = System.Convert.ToDouble(values[3]); + int number_of_spools = System.Convert.ToInt16(values[4]); - var totalBy4Spools = (double)length * 4; - var currentProgressBy4Spools = (double)currentProgresslength * 4; + var totalBy4Spools = (double)length * number_of_spools; + var currentProgressBy4Spools = (double)currentProgresslength * number_of_spools; int coeff = (int)currentProgressBy4Spools / (int)totalBy4Spools; var progressCurrent = (coeff == 0 || coeff == 1) ? currentProgressBy4Spools : currentProgressBy4Spools % (coeff * totalBy4Spools);//show for progress diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateDB.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateDB.png Binary files differnew file mode 100644 index 000000000..519f570fc --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateDB.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateVersion.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateVersion.png Binary files differnew file mode 100644 index 000000000..5510f1006 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateVersion.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index a0fba3632..8f65f225b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -646,6 +646,8 @@ <Resource Include="Images\Overview Icons\temperature.png" /> <Resource Include="Images\screw.png" /> <Resource Include="Images\Menu\AppPower_image.png" /> + <Resource Include="Images\Menu\updateDB.png" /> + <Resource Include="Images\Menu\updateVersion.png" /> <Content Include="Intro.wmv" /> <Content Include="Manifests\release.xml" /> <Content Include="Manifests\debug.xml" /> @@ -991,7 +993,7 @@ if $(ConfigurationName) == Eureka copy /Y "$(ProjectDir)Intro.wmv" "$(TargetDir) </PropertyGroup> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> <Import Project="..\..\packages\WPFMediaKit.2.2.0\build\WPFMediaKit.targets" Condition="Exists('..\..\packages\WPFMediaKit.2.2.0\build\WPFMediaKit.targets')" /> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index 17b676499..56314414a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -14,8 +14,10 @@ using Tango.Integration.Operation; using Tango.PMR.IFS; using Tango.PPC.Common; using Tango.PPC.Common.Connection; +using Tango.PPC.Common.MachineUpdate; using Tango.PPC.Common.Modules; using Tango.PPC.Common.Navigation; +using Tango.PPC.Common.Web; using Tango.PPC.UI.Dialogs; using Tango.PPC.UI.Views; using Tango.PPC.UI.ViewsContracts; @@ -39,6 +41,9 @@ namespace Tango.PPC.UI.ViewModels [TangoInject] public IPPCModuleLoader ModuleLoader { get; set; } + [TangoInject] + public IMachineUpdateManager MachineUpdateManager { get; set; } + #region Classes public class CartridgeModel : ExtendedObject @@ -230,6 +235,26 @@ namespace Tango.PPC.UI.ViewModels set { _currentDateTime = value; RaisePropertyChangedAuto(); } } + private bool _enableDBUpdate; + /// <summary> + /// Gets or sets a value indicating whether to automatically check for new application updates. + /// </summary> + public bool EnableDBUpdate + { + get { return _enableDBUpdate; } + set { _enableDBUpdate = value; RaisePropertyChangedAuto(); } + } + + private bool _enableVersionUpdate; + /// <summary> + /// Gets or sets a value indicating whether to automatically check for new application updates. + /// </summary> + public bool EnableVersionUpdate + { + get { return _enableVersionUpdate; } + set { _enableVersionUpdate = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -327,6 +352,8 @@ namespace Tango.PPC.UI.ViewModels _date_timer.Interval = TimeSpan.FromSeconds(1); _date_timer.Tick += _date_timer_Tick; _date_timer.Start(); + + _enableDBUpdate = _enableVersionUpdate = false; } #endregion @@ -564,6 +591,22 @@ namespace Tango.PPC.UI.ViewModels MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged; } + private void MachineUpdateManager_UpdateAvailable(object sender, CheckForUpdateResponse e) + { + EnableVersionUpdate = false; + EnableDBUpdate = false; + + if(e.IsUpdateAvailable) + { + EnableVersionUpdate = true; + return; + } + else if (e.IsDatabaseUpdateAvailable) + { + EnableDBUpdate = true; + } + } + private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e) { if (Cartridges == null) @@ -618,6 +661,7 @@ namespace Tango.PPC.UI.ViewModels { base.OnApplicationReady(); MachineProvider.MachineOperator.StatusChanged += MachineOperator_StatusChanged; + MachineUpdateManager.UpdateAvailable += MachineUpdateManager_UpdateAvailable; } private void MachineOperator_StatusChanged(object sender, MachineStatuses e) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml index 049f2268d..62538d9d6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -119,7 +119,9 @@ <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="10 0" Height="45" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding UpdateCommand}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> <Image Source="/Images/Menu/update.png" VerticalAlignment="Center" Width="20" Height="20"></Image> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoDataGridHeaderFontSize}" FontWeight="Light">Update</TextBlock> + <TextBlock VerticalAlignment="Center" Margin="20 0 20 0" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoDataGridHeaderFontSize}" FontWeight="Light">Update</TextBlock> + <Image Margin="30 0 0 0" Source="/Images/Menu/updateDB.png" VerticalAlignment="Center" Width="16" Height="16" HorizontalAlignment="Right" Visibility="{Binding EnableDBUpdate, Converter={StaticResource BooleanToVisibilityConverter}}" SnapsToDevicePixels="True"></Image> + <Image Margin="30 0 0 0" Source="/Images/Menu/updateVersion.png" VerticalAlignment="Center" Width="16" Height="16" HorizontalAlignment="Right" Visibility="{Binding EnableVersionUpdate, Converter={StaticResource BooleanToVisibilityConverter}}" SnapsToDevicePixels="True"></Image> </StackPanel> </touch:TouchButton> </Border> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml index 3664e3997..1196a2c0e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -177,7 +177,7 @@ </Border.Style> <Grid> <Grid.RowDefinitions> - <RowDefinition Height="1.4*"/> + <RowDefinition Height="Auto"/> <RowDefinition Height="1*"/> </Grid.RowDefinitions> @@ -196,16 +196,16 @@ </UniformGrid> </Grid> - <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="25 0" Opacity="0.3" StrokeThickness="1" Stroke="{StaticResource TangoDividerBrush}" /> + <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="25 0" Opacity="0.3" StrokeThickness="2" Stroke="{StaticResource TangoDividerBrush}" /> <Grid Grid.Row="1"> <Grid.ColumnDefinitions> <ColumnDefinition Width="188*"/> <ColumnDefinition Width="261*"/> </Grid.ColumnDefinitions> - <Image Source="/Images/power-tablet.png" Margin="30" /> + <Image Source="/Images/power-tablet.png" Margin="30" VerticalAlignment="Center" /> - <touch:TouchButton Command="{Binding RestartApplicationCommand}" Grid.Column="1" Style="{StaticResource PowerButton}">Restart</touch:TouchButton> + <touch:TouchButton Command="{Binding RestartApplicationCommand}" Grid.Column="1" Style="{StaticResource PowerButton}" VerticalAlignment="Center">Restart</touch:TouchButton> </Grid> </Grid> </Border> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 0436cdab6..f9338b813 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -558,7 +558,7 @@ <Image Source="../Images/Job Issues/spools.png" Stretch="None" VerticalAlignment="Top"/> <StackPanel Orientation="Vertical" Margin="15 0 0 0"> <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}">Spools</TextBlock> - <TextBlock Text="{Binding Job.Spools, TargetNullValue='-', FallbackValue='-'}" FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"></TextBlock> + <TextBlock Text="{Binding Job.NumberOfSpools, TargetNullValue='-', FallbackValue='-'}" FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"></TextBlock> </StackPanel> </StackPanel> </UniformGrid> @@ -650,6 +650,7 @@ <Binding Path="RunningJobStatus.TotalProgressMinusSettingUp" /> <Binding Path="IsSpoolView"/> <Binding Path="RunningJobStatus.ProgressMinusSettingUp" /> + <Binding Path="Job.NumberOfSpools"/> </MultiBinding> </TextBlock.Text> </TextBlock> @@ -659,6 +660,7 @@ <MultiBinding Converter="{StaticResource ProgressLengthSpoolConverter}" StringFormat="#,0" TargetNullValue='-' FallbackValue='0' Mode="OneWay"> <Binding Path="RunningJobStatus.TotalProgressMinusSettingUp"/> <Binding Path="IsSpoolView"/> + <Binding Path="Job.NumberOfSpools"/> </MultiBinding> </TextBlock.Text> </TextBlock> @@ -673,6 +675,7 @@ <Binding Path="IsSpoolView"/> <Binding Path="RunningJobStatus.ProgressMinusSettingUp" /> <Binding Path="Job.GramPerLength" Mode="OneWay"/> + <Binding Path="Job.NumberOfSpools"/> </MultiBinding> </TextBlock.Text> </TextBlock> @@ -683,6 +686,7 @@ <Binding Path="RunningJobStatus.TotalProgressMinusSettingUp"/> <Binding Path="IsSpoolView"/> <Binding Path="Job.GramPerLength" Mode="OneWay"/> + <Binding Path="Job.NumberOfSpools"/> </MultiBinding> </TextBlock.Text> </TextBlock> @@ -792,7 +796,7 @@ <TextBlock.Text> <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="#,0" TargetNullValue='-' FallbackValue='-' Mode="OneWay"> <Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/> - <Binding Path="Job.Spools" Mode="OneWay"/> + <Binding Path="Job.NumberOfSpools" Mode="OneWay"/> </MultiBinding> </TextBlock.Text> </TextBlock> @@ -807,7 +811,7 @@ <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" TargetNullValue='-' FallbackValue='-' Mode="OneWay"> <Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/> <Binding Path="Job.GramPerLength" Mode="OneWay"/> - <Binding Path="Job.Spools" Mode="OneWay"/> + <Binding Path="Job.NumberOfSpools" Mode="OneWay"/> </MultiBinding> </TextBlock.Text> </TextBlock> @@ -830,6 +834,7 @@ <Setter.Value> <MultiBinding Converter="{StaticResource ProgressUnitSpoolConverter}" TargetNullValue='-' FallbackValue='-' > <Binding Path="RunningJobStatus.CurrentUnit" Mode="OneWay"/> + <Binding Path="Job.NumberOfSpools" Mode="OneWay"/> </MultiBinding> </Setter.Value> </Setter> @@ -1019,7 +1024,7 @@ <TextBlock.Text> <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="#,0.##" TargetNullValue='-' FallbackValue='-' Mode="OneWay"> <Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/> - <Binding Path="Job.Spools" Mode="OneWay"/> + <Binding Path="Job.NumberOfSpools" Mode="OneWay"/> </MultiBinding> </TextBlock.Text> </TextBlock> diff --git a/Software/Visual_Studio/Tango.BL/DTO/JobDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/JobDTOBase.cs index c5e13a569..feb789ffe 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/JobDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/JobDTOBase.cs @@ -309,5 +309,13 @@ namespace Tango.BL.DTO get; set; } + /// <summary> + /// number of spools + /// </summary> + public Int32 NumberOfSpools + { + get; set; + } + } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index 29f7e1054..328d74f0c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -99,9 +99,9 @@ namespace Tango.BL.Entities { get { - if (Spools >= 4) + if (NumberOfSpools >= 4) { - return LengthIncludingNumberOfUnits * Spools; + return LengthIncludingNumberOfUnits * NumberOfSpools; } return LengthIncludingNumberOfUnits; @@ -129,9 +129,9 @@ namespace Tango.BL.Entities { get { - if (Spools >= 4) + if (NumberOfSpools >= 4) { - return WeightIncludingNumberOfUnits * Spools; + return WeightIncludingNumberOfUnits * NumberOfSpools; } return WeightIncludingNumberOfUnits; @@ -144,9 +144,9 @@ namespace Tango.BL.Entities { get { - if (Spools >= 4) + if (NumberOfSpools >= 4) { - return NumberOfUnits * Spools; + return NumberOfUnits * NumberOfSpools; } return NumberOfUnits; } @@ -218,14 +218,7 @@ namespace Tango.BL.Entities RaisePropertyChangedAuto(); } } - - [NotMapped] - [JsonIgnore] - public int Spools - { - get { return 4; }//headunits? - } - + /// <summary> /// Gets or sets the effective segments. /// </summary> diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs b/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs index f37848b5e..83912de98 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs @@ -83,6 +83,8 @@ namespace Tango.BL.Entities public event EventHandler<Int32> VersionChanged; + public event EventHandler<Int32> NumberOfSpoolsChanged; + public event EventHandler<ColorCatalog> ColorCatalogChanged; public event EventHandler<ColorSpace> ColorSpaceChanged; @@ -1079,6 +1081,33 @@ namespace Tango.BL.Entities } } + protected Int32 _numberofspools; + + /// <summary> + /// Gets or sets the jobbase number of spools. + /// </summary> + + [Column("NUMBER_OF_SPOOLS")] + + public Int32 NumberOfSpools + { + get + { + return _numberofspools; + } + + set + { + if (_numberofspools != value) + { + _numberofspools = value; + + OnNumberOfSpoolsChanged(value); + + } + } + } + protected ColorCatalog _colorcatalog; /// <summary> @@ -1638,6 +1667,15 @@ namespace Tango.BL.Entities } /// <summary> + /// Called when the NumberOfSpools has changed. + /// </summary> + protected virtual void OnNumberOfSpoolsChanged(Int32 numberofspools) + { + NumberOfSpoolsChanged?.Invoke(this, numberofspools); + RaisePropertyChanged(nameof(NumberOfSpools)); + } + + /// <summary> /// Called when the ColorCatalog has changed. /// </summary> protected virtual void OnColorCatalogChanged(ColorCatalog colorcatalog) diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs index b45dbe3b3..7dd8b2b61 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs @@ -60,6 +60,7 @@ namespace Tango.DAL.Remote.DB public bool IS_SYNCHRONIZED { get; set; } public int SOURCE { get; set; } public int VERSION { get; set; } + public int NUMBER_OF_SPOOLS { get; set; } public virtual COLOR_CATALOGS COLOR_CATALOGS { get; set; } public virtual COLOR_SPACES COLOR_SPACES { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index 049c4a131..0a3fa8bd7 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -838,6 +838,7 @@ <Property Name="IS_SYNCHRONIZED" Type="bit" Nullable="false" /> <Property Name="SOURCE" Type="int" Nullable="false" /> <Property Name="VERSION" Type="int" Nullable="false" /> + <Property Name="NUMBER_OF_SPOOLS" Type="int" Nullable="false" /> </EntityType> <EntityType Name="LINEAR_MASS_DENSITY_UNITS"> <Key> @@ -6490,6 +6491,7 @@ <Property Name="IS_SYNCHRONIZED" Type="Boolean" Nullable="false" /> <Property Name="SOURCE" Type="Int32" Nullable="false" /> <Property Name="VERSION" Type="Int32" Nullable="false" /> + <Property Name="NUMBER_OF_SPOOLS" Type="Int32" Nullable="false" /> <NavigationProperty Name="COLOR_CATALOGS" Relationship="RemoteModel.FK_JOBS_COLOR_CATALOGS" FromRole="JOB" ToRole="COLOR_CATALOGS" /> <NavigationProperty Name="COLOR_SPACES" Relationship="RemoteModel.FK_JOBS_COLOR_SPACES" FromRole="JOB" ToRole="COLOR_SPACES" /> <NavigationProperty Name="CUSTOMER" Relationship="RemoteModel.FK_JOBS_CUSTOMERS" FromRole="JOB" ToRole="CUSTOMER" /> @@ -9941,6 +9943,7 @@ <EntitySetMapping Name="JOBS"> <EntityTypeMapping TypeName="RemoteModel.JOB"> <MappingFragment StoreEntitySet="JOBS"> + <ScalarProperty Name="NUMBER_OF_SPOOLS" ColumnName="NUMBER_OF_SPOOLS" /> <ScalarProperty Name="VERSION" ColumnName="VERSION" /> <ScalarProperty Name="SOURCE" ColumnName="SOURCE" /> <ScalarProperty Name="IS_SYNCHRONIZED" ColumnName="IS_SYNCHRONIZED" /> diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index f21f85e35..8ab83d696 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,102 +5,102 @@ <!-- Diagram content (shape and connector positions) --> <edmx:Diagrams> <Diagram DiagramId="f9ae01d708754bbd997add25a4bacc79" Name="Diagram1" ZoomLevel="58"> - <EntityTypeShape EntityType="RemoteModel.ACTION_LOGS" Width="1.5" PointX="11.25" PointY="17.875" /> - <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="1.5" PointY="59.125" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="4.5" PointY="76.5" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="66" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="4.5" PointY="79.375" /> - <EntityTypeShape EntityType="RemoteModel.BIT_TYPES" Width="1.5" PointX="0.75" PointY="1.75" /> - <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="18" PointY="21.75" /> - <EntityTypeShape EntityType="RemoteModel.BTSR_APPLICATION_TYPES" Width="1.5" PointX="0.75" PointY="14.625" /> - <EntityTypeShape EntityType="RemoteModel.BTSR_YARN_TYPES" Width="1.5" PointX="0.75" PointY="29.25" /> - <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="7.75" PointY="40.625" /> - <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="8.25" PointY="29.25" /> - <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="0.75" PointY="20.875" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS" Width="1.5" PointX="1.5" PointY="6.125" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_GROUPS" Width="1.5" PointX="3.75" PointY="6.625" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS" Width="1.5" PointX="6" PointY="5.375" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS_RECIPES" Width="1.5" PointX="8.25" PointY="21.25" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_PROCESS_INK_UPTAKE" Width="1.5" PointX="2.75" PointY="1.75" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="9" PointY="6.875" /> - <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="6.75" PointY="71.75" /> - <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="1.5" PointY="55.25" /> - <EntityTypeShape EntityType="RemoteModel.CUSTOMER" Width="1.5" PointX="9" PointY="17.75" /> - <EntityTypeShape EntityType="RemoteModel.DATA_STORE_ITEMS" Width="1.5" PointX="11.25" PointY="82.25" /> - <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="5.5" PointY="44.875" /> - <EntityTypeShape EntityType="RemoteModel.DISPENSER" Width="1.5" PointX="7.75" PointY="44.375" /> - <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="68.875" /> - <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="9" PointY="97.625" /> - <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="11.75" /> - <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="35.875" /> - <EntityTypeShape EntityType="RemoteModel.FSE_VERSIONS" Width="1.5" PointX="11.25" PointY="7.125" /> - <EntityTypeShape EntityType="RemoteModel.GBD" Width="1.5" PointX="0.75" PointY="25.625" /> - <EntityTypeShape EntityType="RemoteModel.GLOBAL_DATA_STORE_ITEMS" Width="1.5" PointX="4.75" PointY="1.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWER_TYPES" Width="1.5" PointX="4.5" PointY="82.625" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWERS" Width="1.5" PointX="6.75" PointY="77.25" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSOR_TYPES" Width="1.5" PointX="9.5" PointY="107.625" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSORS" Width="1.5" PointX="11.75" PointY="78.25" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCER_TYPES" Width="1.5" PointX="10.5" PointY="62.625" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCERS" Width="1.5" PointX="12.75" PointY="64.5" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTOR_TYPES" Width="1.5" PointX="12.5" PointY="86.5" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTORS" Width="1.5" PointX="14.75" PointY="70.25" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROL_TYPES" Width="1.5" PointX="9.5" PointY="103.625" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROLS" Width="1.5" PointX="11.75" PointY="70.625" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSOR_TYPES" Width="1.5" PointX="4.5" PointY="62.625" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSORS" Width="1.5" PointX="6.75" PointY="67.25" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="71.875" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDER_TYPES" Width="1.5" PointX="7.5" PointY="86.625" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDERS" Width="1.5" PointX="9.75" PointY="66.375" /> - <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="7.75" PointY="93.875" /> - <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="10" PointY="50.75" /> - <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="13.75" PointY="5.75" /> - <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="11.25" PointY="21.625" /> - <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="44.75" /> - <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="6" PointY="29.875" /> - <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="8.25" PointY="25.5" /> - <EntityTypeShape EntityType="RemoteModel.LUB" Width="1.5" PointX="0.75" PointY="32.5" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_PROTOTYPES" Width="1.5" PointX="2.75" PointY="15.75" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_STUDIO_VERSIONS" Width="1.5" PointX="11.25" PointY="10.75" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="6.75" PointY="82.375" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="9" PointY="70" /> - <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="11.25" PointY="39" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="41.875" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="38.75" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="18" /> - <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="7.75" PointY="90.5" /> - <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="0.75" PointY="50.25" /> - <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="12" PointY="56.25" /> - <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="49.5" /> - <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="55.75" /> - <EntityTypeShape EntityType="RemoteModel.PUBLISHED_PROCEDURE_PROJECTS" Width="1.5" PointX="13.75" PointY="2" /> - <EntityTypeShape EntityType="RemoteModel.PUBLISHED_PROCEDURE_PROJECTS_VERSIONS" Width="1.5" PointX="16" PointY="2.125" /> - <EntityTypeShape EntityType="RemoteModel.RML_EXTENSION_TEST_WASHING_RESULTS" Width="1.5" PointX="5" PointY="12" /> - <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="3" PointY="19.25" /> - <EntityTypeShape EntityType="RemoteModel.RMLS_SPOOLS" Width="1.5" PointX="5.25" PointY="25" /> - <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="9" PointY="37.125" /> - <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="14.25" PointY="37.25" /> - <EntityTypeShape EntityType="RemoteModel.RUBBING_RESULTS" Width="1.5" PointX="5.75" PointY="15.75" /> - <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="15.75" PointY="25.25" /> - <EntityTypeShape EntityType="RemoteModel.SEGMENTS_GROUPS" Width="1.5" PointX="13.5" PointY="25.625" /> - <EntityTypeShape EntityType="RemoteModel.SITE" Width="1.5" PointX="3" PointY="50.375" /> - <EntityTypeShape EntityType="RemoteModel.SITES_CATALOGS" Width="1.5" PointX="5.25" PointY="34.5" /> - <EntityTypeShape EntityType="RemoteModel.SITES_RMLS" Width="1.5" PointX="5.25" PointY="21.625" /> - <EntityTypeShape EntityType="RemoteModel.SITES_SPOOL_TYPES" Width="1.5" PointX="11.25" PointY="33.625" /> - <EntityTypeShape EntityType="RemoteModel.SPOOL_TYPES" Width="1.5" PointX="9" PointY="10.375" /> - <EntityTypeShape EntityType="RemoteModel.SPOOL" Width="1.5" PointX="11.25" PointY="43.875" /> - <EntityTypeShape EntityType="RemoteModel.sysdiagram" Width="1.5" PointX="15.75" PointY="5.75" /> - <EntityTypeShape EntityType="RemoteModel.TANGO_UPDATES" Width="1.5" PointX="15.75" PointY="8.75" /> - <EntityTypeShape EntityType="RemoteModel.TANGO_VERSIONS" Width="1.5" PointX="14.25" PointY="41" /> - <EntityTypeShape EntityType="RemoteModel.TECH_CONTROLLERS" Width="1.5" PointX="15.75" PointY="13.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_DISPENSERS" Width="1.5" PointX="13.75" PointY="17.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_HEATERS" Width="1.5" PointX="15.75" PointY="17.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_IOS" Width="1.5" PointX="17.75" PointY="5.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="17.75" PointY="10.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="17.75" PointY="15.75" /> - <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="9" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="11.25" PointY="2.25" /> - <EntityTypeShape EntityType="RemoteModel.WASHING_TEST_MATERIALS" Width="1.5" PointX="2.75" PointY="12.5" /> - <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="9" PointY="33.875" /> + <EntityTypeShape EntityType="RemoteModel.ACTION_LOGS" Width="1.5" PointX="11.25" PointY="17.5" /> + <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="1.5" PointY="0.75" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="4.5" PointY="76.75" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="69.25" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="4.5" PointY="79.75" /> + <EntityTypeShape EntityType="RemoteModel.BIT_TYPES" Width="1.5" PointX="5.75" PointY="6.125" /> + <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="18" PointY="22.25" /> + <EntityTypeShape EntityType="RemoteModel.BTSR_APPLICATION_TYPES" Width="1.5" PointX="0.75" PointY="35.5" /> + <EntityTypeShape EntityType="RemoteModel.BTSR_YARN_TYPES" Width="1.5" PointX="0.75" PointY="41.75" /> + <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="7.75" PointY="46.75" /> + <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="5.25" PointY="29.75" /> + <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="0.75" PointY="18.125" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS" Width="1.5" PointX="1.5" PointY="59.625" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_GROUPS" Width="1.5" PointX="0.75" PointY="54.125" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS" Width="1.5" PointX="3" PointY="52.875" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS_RECIPES" Width="1.5" PointX="5.25" PointY="25.75" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_PROCESS_INK_UPTAKE" Width="1.5" PointX="7.75" PointY="6.125" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="9" PointY="41.875" /> + <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="6.75" PointY="72" /> + <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="1.5" PointY="48.875" /> + <EntityTypeShape EntityType="RemoteModel.CUSTOMER" Width="1.5" PointX="9" PointY="10" /> + <EntityTypeShape EntityType="RemoteModel.DATA_STORE_ITEMS" Width="1.5" PointX="11.25" PointY="82.5" /> + <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="5.5" PointY="90.5" /> + <EntityTypeShape EntityType="RemoteModel.DISPENSER" Width="1.5" PointX="7.75" PointY="90" /> + <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="66.25" /> + <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="9" PointY="36" /> + <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="29.75" /> + <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="12" /> + <EntityTypeShape EntityType="RemoteModel.FSE_VERSIONS" Width="1.5" PointX="11.25" PointY="10.75" /> + <EntityTypeShape EntityType="RemoteModel.GBD" Width="1.5" PointX="0.75" PointY="21.375" /> + <EntityTypeShape EntityType="RemoteModel.GLOBAL_DATA_STORE_ITEMS" Width="1.5" PointX="2.75" PointY="14.125" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWER_TYPES" Width="1.5" PointX="4.5" PointY="62.875" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWERS" Width="1.5" PointX="6.75" PointY="67.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSOR_TYPES" Width="1.5" PointX="4.5" PointY="82.875" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSORS" Width="1.5" PointX="6.75" PointY="77.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCER_TYPES" Width="1.5" PointX="9.5" PointY="97.875" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCERS" Width="1.5" PointX="11.75" PointY="71.875" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTOR_TYPES" Width="1.5" PointX="12.5" PointY="59.75" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTORS" Width="1.5" PointX="14.75" PointY="69.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROL_TYPES" Width="1.5" PointX="12.5" PointY="63.875" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROLS" Width="1.5" PointX="14.75" PointY="62" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSOR_TYPES" Width="1.5" PointX="9.5" PointY="101.875" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSORS" Width="1.5" PointX="11.75" PointY="77.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="72.125" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDER_TYPES" Width="1.5" PointX="9.5" PointY="66.875" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDERS" Width="1.5" PointX="11.75" PointY="67.75" /> + <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="7.75" PointY="94.25" /> + <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="10" PointY="53.125" /> + <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="16.75" PointY="2.125" /> + <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="11.25" PointY="22" /> + <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="26.25" /> + <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="6" PointY="34.375" /> + <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="8.25" PointY="26" /> + <EntityTypeShape EntityType="RemoteModel.LUB" Width="1.5" PointX="0.75" PointY="45.125" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_PROTOTYPES" Width="1.5" PointX="13.75" PointY="7.125" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_STUDIO_VERSIONS" Width="1.5" PointX="11.25" PointY="34.25" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="6.75" PointY="82.625" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="9" PointY="70.25" /> + <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="11.25" PointY="45.375" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="38.875" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="15" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="32.625" /> + <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="7.75" PointY="86.625" /> + <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="0.75" PointY="5.75" /> + <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="12" PointY="38.625" /> + <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="50.125" /> + <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="56.375" /> + <EntityTypeShape EntityType="RemoteModel.PUBLISHED_PROCEDURE_PROJECTS" Width="1.5" PointX="2.75" PointY="10.375" /> + <EntityTypeShape EntityType="RemoteModel.PUBLISHED_PROCEDURE_PROJECTS_VERSIONS" Width="1.5" PointX="5" PointY="10.625" /> + <EntityTypeShape EntityType="RemoteModel.RML_EXTENSION_TEST_WASHING_RESULTS" Width="1.5" PointX="8" PointY="2.375" /> + <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="3" PointY="19.75" /> + <EntityTypeShape EntityType="RemoteModel.RMLS_SPOOLS" Width="1.5" PointX="8.25" PointY="21.5" /> + <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="12" PointY="3.5" /> + <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="14.25" PointY="3.625" /> + <EntityTypeShape EntityType="RemoteModel.RUBBING_RESULTS" Width="1.5" PointX="16.75" PointY="13.125" /> + <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="15.75" PointY="25.75" /> + <EntityTypeShape EntityType="RemoteModel.SEGMENTS_GROUPS" Width="1.5" PointX="13.5" PointY="26.125" /> + <EntityTypeShape EntityType="RemoteModel.SITE" Width="1.5" PointX="3" PointY="5.875" /> + <EntityTypeShape EntityType="RemoteModel.SITES_CATALOGS" Width="1.5" PointX="5.25" PointY="39.375" /> + <EntityTypeShape EntityType="RemoteModel.SITES_RMLS" Width="1.5" PointX="5.25" PointY="22.125" /> + <EntityTypeShape EntityType="RemoteModel.SITES_SPOOL_TYPES" Width="1.5" PointX="11.25" PointY="7.125" /> + <EntityTypeShape EntityType="RemoteModel.SPOOL_TYPES" Width="1.5" PointX="6" PointY="16" /> + <EntityTypeShape EntityType="RemoteModel.SPOOL" Width="1.5" PointX="12.25" PointY="49.875" /> + <EntityTypeShape EntityType="RemoteModel.sysdiagram" Width="1.5" PointX="13.75" PointY="11.125" /> + <EntityTypeShape EntityType="RemoteModel.TANGO_UPDATES" Width="1.5" PointX="13.75" PointY="18.125" /> + <EntityTypeShape EntityType="RemoteModel.TANGO_VERSIONS" Width="1.5" PointX="14.25" PointY="45.25" /> + <EntityTypeShape EntityType="RemoteModel.TECH_CONTROLLERS" Width="1.5" PointX="16.75" PointY="17.125" /> + <EntityTypeShape EntityType="RemoteModel.TECH_DISPENSERS" Width="1.5" PointX="18.75" PointY="2.125" /> + <EntityTypeShape EntityType="RemoteModel.TECH_HEATERS" Width="1.5" PointX="18.75" PointY="5.125" /> + <EntityTypeShape EntityType="RemoteModel.TECH_IOS" Width="1.5" PointX="18.75" PointY="8.125" /> + <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="18.75" PointY="13.125" /> + <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="18.75" PointY="18.125" /> + <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="9" PointY="13.125" /> + <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="14.25" PointY="14.625" /> + <EntityTypeShape EntityType="RemoteModel.WASHING_TEST_MATERIALS" Width="1.5" PointX="5.75" PointY="2.875" /> + <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="9" PointY="30.125" /> <AssociationConnector Association="RemoteModel.FK_ACTION_LOGS_USERS" /> <AssociationConnector Association="RemoteModel.FK_ORGANIZATIONS_ADDRESSES" /> <AssociationConnector Association="RemoteModel.FK_USERS_ADDRESSES" /> diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index ea45fbedd..bacce5f5e 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -847,7 +847,7 @@ namespace Tango.Emulations.Emulators double firstUnitStartPosition = request.Message.FirstUnitStartPosition; bool addedResume = firstUnitStartPosition <= 0; - bool bIsResumeProcess = firstUnitStartPosition > 0; + //bool bIsResumeProcess = firstUnitStartPosition > 0; for (int i = 0; i < units; i++) { @@ -892,7 +892,7 @@ namespace Tango.Emulations.Emulators addedResume = true; progress = firstUnitStartPosition; } - //LogManager.Log($" Emulator Progress = {progress}, units = {units}"); + //LogManager.Log($" EMULATOR PROGRESS Progress = {progress}, units = {units}"); double currentPosition = 0; double nextStopPosition = unit_length; diff --git a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs index 5d62f4269..630bda866 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs @@ -371,32 +371,33 @@ namespace Tango.Integration.Operation { LogManager.Log($"Invalid job progress received '{s.Progress}' while last progress was '{_last_progress}'."); } - + _last_progress = s.Progress; - + List<Segment> unit_segments = new List<Segment>(); Status.Progress = s.Progress; Status.RemainingTime = Status.TotalTime - Job.TranslateProgressToTime(Status.Progress, ProcessParameters); Status.RemainingProgress = Status.TotalProgress - Status.Progress; - if (s.Progress < Status.SettingUpTotalProgress || Status.SettingUpProgress < Status.SettingUpTotalProgress) + if((s.Progress < Status.SettingUpTotalProgress) || (Status.SettingUpProgress < Status.SettingUpTotalProgress)) { Status.SettingUpProgress = Math.Min(s.Progress, this.Status.SettingUpTotalProgress); Status.IsSettingUp = true; + //LogManager.Log($" Status.IsSettingUp = true , Status.SettingUpProgress = {Status.SettingUpProgress}' Status.SettingUpTotalProgress = {Status.SettingUpTotalProgress}."); } - if (s.Progress >= Status.SettingUpTotalProgress) + if (s.Progress >= ProcessParameters.DryerBufferLengthMeters)//Status.SettingUpTotalProgress) { if (Status.IsSettingUp && Status.Progress > 0) { Status.IsSettingUp = false; + //LogManager.Log($" Status.IsSettingUp = false , Status.SettingUpProgress = {Status.SettingUpProgress}'."); } if (ResumeConfig != null && ResumeConfig.GlobalStartPosition > 0) { Status.ProgressMinusSettingUp = s.Progress - ProcessParameters.DryerBufferLengthMeters; - //LogManager.Log($" Status.ProgressMinusSettingUp {Status.ProgressMinusSettingUp} progress = {s.Progress}"); - + //LogManager.Log($" JOB HANDLER Status.ProgressMinusSettingUp {Status.ProgressMinusSettingUp} progress = {s.Progress}"); } else { @@ -434,7 +435,7 @@ namespace Tango.Integration.Operation if (!Status.IsSettingUp && s.Progress <= previousUnitsLengthWithoutThis + unitLength + ProcessParameters.DryerBufferLengthMeters) { currentUnitProgress = s.Progress - previousUnitsLengthWithoutThis - ProcessParameters.DryerBufferLengthMeters; - //LogManager.Log($"currentUnitProgress before ={currentUnitProgress} progress = {s.Progress}"); + //LogManager.Log($" JOB HANDLER currentUnitProgress before ={currentUnitProgress} progress = {s.Progress}"); break; } } @@ -452,7 +453,7 @@ namespace Tango.Integration.Operation Status.CurrentUnit = currentUnit; Status.CurrentUnitProgress = currentUnitProgress; - //LogManager.Log($"CurrentUnit {Status.CurrentUnit} currentUnitProgress {Status.CurrentUnitProgress} "); + //LogManager.Log($" JOB HANDLER CurrentUnit {Status.CurrentUnit} currentUnitProgress {Status.CurrentUnitProgress} "); Status.RemainingUnits = this.Job.NumberOfUnits - this.Status.CurrentUnit; diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index df320527e..a33ee3165 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -3254,10 +3254,10 @@ namespace Tango.Integration.Operation } double resumePreProgress = 0; - + if (config.ResumeConfig != null) { - resumePreProgress = config.ResumeConfig.GlobalStartPosition - processParameters.DryerBufferLengthMeters; + resumePreProgress = config.ResumeConfig.GlobalStartPosition - config.ResumeConfig.FirstUnitStartPosition;//- processParameters.DryerBufferLengthMeters; request.FirstUnitStartPosition = config.ResumeConfig.FirstUnitStartPosition; //LogManager.Log($" resumePreProgress = {resumePreProgress}, GlobalStartPosition {config.ResumeConfig.GlobalStartPosition} FirstUnitStartPosition {request.FirstUnitStartPosition}"); request.JobTicket.Length = (request.JobTicket.Length / Math.Max(request.JobTicket.NumberOfUnits, 1)) * (int)Math.Max(config.ResumeConfig.RemainingUnits, 1); @@ -3268,8 +3268,11 @@ namespace Tango.Integration.Operation { if (!completed) { - response.Message.Status.Progress += resumePreProgress; - + if(resumePreProgress > 0 ) + { + response.Message.Status.Progress += resumePreProgress;//LogManager.Log($" MACHINE OPERATOR Added Progress = {response.Message.Status.Progress}"); + } + handler.RaiseStatusReceived(response.Message.Status); _last_job_status = handler.Status; diff --git a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs index 4ec74caf8..838f68211 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs @@ -168,6 +168,15 @@ namespace Tango.Touch.Controls public static readonly DependencyProperty CollectionFilterProperty = DependencyProperty.Register("CollectionFilter", typeof(ICollectionFilter), typeof(LightTouchDataGrid), new PropertyMetadata(null, (d, e) => (d as LightTouchDataGrid).OnCollectionFilterChanged())); + public bool SelectAll + { + get { return (bool)GetValue(SelectAllProperty); } + set { SetValue(SelectAllProperty, value); } + } + + // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc... + public static readonly DependencyProperty SelectAllProperty = + DependencyProperty.Register("SelectAll", typeof(bool), typeof(LightTouchDataGrid), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, (d, e) => (d as LightTouchDataGrid).OnSelectedAllChanged())); #endregion #region Commands @@ -412,6 +421,27 @@ namespace Tango.Touch.Controls } } + private void OnSelectedAllChanged() + { + if (IsMultiSelecting) + { + if (SelectAll) + { + foreach (var row in GetRows()) + { + row.IsSelected = true; + + } + UpdateSelectedItems(); + } + else + { + ClearSelectedItems(); + } + } + } + + #endregion #region Command Handlers @@ -527,7 +557,6 @@ namespace Tango.Touch.Controls CollectionFilter.FilterChanged += CollectionFilter_FilterChanged; } } - #endregion #region Public Methods |
