diff options
| author | Roy Ben-Shabat <Roy.mail.net@gmail.com> | 2023-10-26 08:57:49 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy.mail.net@gmail.com> | 2023-10-26 08:57:49 +0300 |
| commit | 0e25d9d077bdca2a93c2eb24a723a4fd0a3ea620 (patch) | |
| tree | 17bd3e8da10ab4bceaee8dc22e76706d0b2c6598 /Software/Visual_Studio/PPC | |
| parent | cbde37e91134e36e4001418756e7bb6611022441 (diff) | |
| parent | bf7234e0757a53129bd4991d3db30b03ff5049b3 (diff) | |
| download | Tango-0e25d9d077bdca2a93c2eb24a723a4fd0a3ea620.tar.gz Tango-0e25d9d077bdca2a93c2eb24a723a4fd0a3ea620.zip | |
Merge branch 'software' of https://twinetfs.visualstudio.com/Tango/_git/Tango into software
Diffstat (limited to 'Software/Visual_Studio/PPC')
46 files changed, 1075 insertions, 162 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Images/backup-restoreX4.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Images/backup-restoreX4.png Binary files differnew file mode 100644 index 000000000..65ebb2b1d --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Images/backup-restoreX4.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Tango.PPC.BackupRestore.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Tango.PPC.BackupRestore.csproj index 99ac13ae4..b3fbdd624 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Tango.PPC.BackupRestore.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Tango.PPC.BackupRestore.csproj @@ -237,6 +237,9 @@ <ItemGroup> <Resource Include="Images\restore.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\backup-restorex4.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/MainView.xaml index 0caabd0e1..9aac37f7b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/MainView.xaml @@ -15,7 +15,18 @@ <DockPanel> <Grid DockPanel.Dock="Top"> <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0 20 0 0"> - <Image Source="/Images/backup-restore.png" Stretch="Fill" Width="700" /> + <Image Stretch="Fill" Width="700" > + <Image.Style> + <Style TargetType="{x:Type Image}"> + <Setter Property="Source" Value="../Images/backup-restorex4.png"/> + <Style.Triggers> + <DataTrigger Binding="{Binding BuildProvider.IsEureka}" Value="false"> + <Setter Property="Source" Value="/Images/backup-restore.png"/> + </DataTrigger> + </Style.Triggers> + </Style> + </Image.Style> + </Image> </StackPanel> </Grid> 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/Dialogs/JobCreationView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/JobCreationView.xaml index f018acf97..0224ab766 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/JobCreationView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/JobCreationView.xaml @@ -128,11 +128,11 @@ </Border> </DockPanel>--> <DockPanel Margin="0 50 0 0" HorizontalAlignment="Stretch"> - <TextBlock HorizontalAlignment="Left" Margin="0 10 0 0" FontSize="{StaticResource TangoDialogFontSize}" Width="155" > + <TextBlock HorizontalAlignment="Left" Margin="0 10 0 0" FontSize="{StaticResource TangoDialogFontSize}" Width="166" > <Run Text="White Gap"></Run> - <Run Text="[m]" FontWeight="SemiBold"></Run> + <Run Text="[m]" FontWeight="SemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"></Run> </TextBlock> - <Border Margin="49 0 0 0" BorderThickness="1" Height="44" CornerRadius="22" BorderBrush="{StaticResource TangoMidAccentBrush}"> + <Border Margin="38 0 0 0" BorderThickness="1" Height="44" CornerRadius="22" BorderBrush="{StaticResource TangoMidAccentBrush}"> <touch:TouchNumericTextBox Margin="20 0 0 10" FontSize="{StaticResource TangoComboBoxItemFontSize}" Value="{Binding WhiteGap, Mode=TwoWay}" IsEnabled="True" HorizontalAlignment="Left" MinWidth="250" VerticalAlignment="Center" FocusSelectionMode="SelectAll" KeyboardNavigation.TabIndex="2"></touch:TouchNumericTextBox> </Border> </DockPanel > @@ -142,7 +142,7 @@ <Run Text="Use Flat Spool"></Run> </TextBlock> - <touch:TouchToggleSlider IsChecked="{Binding UseFlatSpool,Mode=TwoWay}" Style="{StaticResource TangoToggleButtonGrayAccent}" Margin="49 0 0 0" HorizontalAlignment="Left" Width="90" /> + <touch:TouchToggleSlider IsChecked="{Binding UseFlatSpool,Mode=TwoWay}" Style="{StaticResource TangoToggleButtonGrayAccent}" Margin="49 0 0 0" HorizontalAlignment="Left" Width="90" Height="42"/> </DockPanel> </StackPanel> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Images/JobProgressView/input.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Images/JobProgressView/input.png Binary files differnew file mode 100644 index 000000000..77dbab1c9 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Images/JobProgressView/input.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Images/JobProgressView/output.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Images/JobProgressView/output.png Binary files differnew file mode 100644 index 000000000..53b317042 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Images/JobProgressView/output.png 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..35569d74f 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); @@ -362,7 +362,6 @@ namespace Tango.PPC.Jobs.Models _numberSpools = value; RaisePropertyChangedAuto(); OnNumberOfSpoolsChanged(); - RaisePropertyChanged(nameof(Copies)); OnUpdateLengthhWeight(); } } @@ -897,7 +896,13 @@ namespace Tango.PPC.Jobs.Models private void OnEnableInterSegmentChanged() { + if(EnableInterSegment == false && InterSegmentLength > 0) + { + _intersegmentlength = 0; + RaisePropertyChanged(nameof(InterSegmentLength)); + } _groupingSegments.ToList().ForEach(x => x.EnableInterSegment = EnableInterSegment); + OnLengthChanged(); UpdateEffectiveSegments(); } @@ -1097,8 +1102,9 @@ namespace Tango.PPC.Jobs.Models // NumberOfUnits = (int)maxRep; //} } - RaisePropertyChanged(nameof(Length)); + OnUpdateLengthhWeight(); + RaisePropertyChanged(nameof(Length)); } RaisePropertyChanged(nameof(GetEstimatedDuration)); @@ -1131,16 +1137,20 @@ 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() { - if(NumberSpools > 0) + if(NumberSpools >= 4) { int coeff = (int)(Copies + NumberSpools -1) / NumberSpools; - Copies = coeff * NumberSpools; + _copies = coeff * NumberSpools; + RaisePropertyChanged(nameof(Copies)); } } 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..405f87b28 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,6 +752,13 @@ <ItemGroup> <Resource Include="Images\ColorSelection\SearchImage.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\JobView\select_all.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\JobProgressView\input.png" /> + <Resource Include="Images\JobProgressView\output.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobProgressViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobProgressViewVM.cs index 8756a6a57..b879831b9 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobProgressViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobProgressViewVM.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.BL.Entities; +using Tango.BL.Enumerations; using Tango.Core.Commands; using Tango.Integration.Operation; using Tango.Logging; @@ -37,7 +38,12 @@ namespace Tango.PPC.Jobs.ViewModels public Job Job { get { return _job; } - set { _job = value; RaisePropertyChangedAuto(); } + set { _job = value; + if(_job == null) + { + IsDyeingProcess = false; + } + RaisePropertyChangedAuto(); } } private RunningJobStatus _runningJobStatus; @@ -47,7 +53,14 @@ namespace Tango.PPC.Jobs.ViewModels public RunningJobStatus RunningJobStatus { get { return _runningJobStatus; } - set { _runningJobStatus = value; RaisePropertyChangedAuto(); } + set { + _runningJobStatus = value; + if(_runningJobStatus == null) + { + IsDyeingProcess = false; + } + RaisePropertyChangedAuto(); + } } private bool _isDisplayJobOutline; @@ -70,6 +83,73 @@ namespace Tango.PPC.Jobs.ViewModels set { _jobOutlineTicket = value; RaisePropertyChangedAuto(); } } + private bool _isDyeingProcess; + + public bool IsDyeingProcess + { + get { return _isDyeingProcess; } + set + { + if (_isDyeingProcess != value) + { + _isDyeingProcess = value; + RaisePropertyChangedAuto(); + } + } + } + + private BrushStop _currentBrushStop; + public BrushStop CurrentBrushStop + { + get { return _currentBrushStop; } + set + { + // if (_currentBrushStop != value) + { + _currentBrushStop = value; + OnUpdateCurrentBrush(); + RaisePropertyChangedAuto(); + } + } + } + + public JobBrushStop JobBrushStop { get; set; } + + public double CyanOutput + { + get { return GetVolumeLiquidType(LiquidTypes.Cyan); } + } + + public double MagentaOutput + { + get { return GetVolumeLiquidType(LiquidTypes.Magenta); } + } + + public double YellowOutput + { + get { return GetVolumeLiquidType(LiquidTypes.Yellow); } + } + + public double BlackOutput + { + get { return GetVolumeLiquidType(LiquidTypes.Black); } + } + + public double LightCyanOutput + { + get { return GetVolumeLiquidType(LiquidTypes.LightCyan); } + } + + public double LightMagentaOutput + { + get { return GetVolumeLiquidType(LiquidTypes.LightMagenta); } + } + + public double LightYellowOutput + { + get { return GetVolumeLiquidType(LiquidTypes.LightYellow); } + } + #endregion #region Commands @@ -123,6 +203,31 @@ namespace Tango.PPC.Jobs.ViewModels NavigationManager.ClearHistoryExcept<JobsView>(); } + protected void OnUpdateCurrentBrush() + { + RaisePropertyChanged(nameof(CyanOutput)); + RaisePropertyChanged(nameof(LightCyanOutput)); + RaisePropertyChanged(nameof(MagentaOutput)); + RaisePropertyChanged(nameof(LightMagentaOutput)); + RaisePropertyChanged(nameof(YellowOutput)); + RaisePropertyChanged(nameof(LightYellowOutput)); + RaisePropertyChanged(nameof(BlackOutput)); + } + + private double GetVolumeLiquidType(LiquidTypes liquidType) + { + if (JobBrushStop != null && JobBrushStop.Dispensers != null && JobBrushStop.Dispensers.Count > 0) + { + var lt = JobBrushStop.Dispensers.FirstOrDefault(x => x.DispenserLiquidType == (DispenserLiquidType)liquidType); + + if (lt != null) + { + return Math.Round(lt.Volume, 2); + } + } + return 0; + } + #endregion #region Override Methods @@ -160,6 +265,7 @@ namespace Tango.PPC.Jobs.ViewModels if (_handler != null) { _handler.Cancel(); + IsDyeingProcess = false; } } @@ -228,6 +334,7 @@ namespace Tango.PPC.Jobs.ViewModels _handler.SpoolChangeRequired -= JobHandler_SpoolChangeRequired; _handler.Stopped -= JobHandler_Stopped; _handler.CanCancelChanged -= JobHandler_CanCancelChanged; + IsDyeingProcess = false; } } @@ -241,6 +348,42 @@ namespace Tango.PPC.Jobs.ViewModels InvokeUI(() => { RunningJobStatus = e; + IsDyeingProcess = (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null); + if (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null) + { + if (_runningJobStatus.CurrentSegment.IsInterSegment) + { + CurrentBrushStop = _runningJobStatus.CurrentSegment.BrushStops.FirstOrDefault(); + JobBrushStop = null; + } + else + { + var realsegmIndex = 1; + if (Job.EnableInterSegment && Job.InterSegmentLength > 0) + { + int segmentIndex = _runningJobStatus.CurrentSegment.SegmentIndex - (Job.EffectiveSegments.Count * RunningJobStatus.CurrentUnit); + if (RunningJobStatus.CurrentUnit > 0) + { + segmentIndex -= RunningJobStatus.CurrentUnit;// inter segment between units + } + realsegmIndex = (int)(segmentIndex / 2) + 1; + } + else + { + realsegmIndex = Math.Max(_runningJobStatus.CurrentSegment.SegmentIndex - (Job.Segments.Count * RunningJobStatus.CurrentUnit), 0); + } + + var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == realsegmIndex); + if (segment != null) + { + if (_handler.JobTicket.Segments.Count > 0) + { + JobBrushStop = _handler.JobTicket.Segments[Job.OrderedSegments.IndexOf(segment)].BrushStops.First(); + } + } + CurrentBrushStop = RunningJobStatus.CurrentSegment.FirstBrushStop; + } + } }); } 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..2ffa84992 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. @@ -247,6 +258,7 @@ namespace Tango.PPC.Jobs.ViewModels SetOrDiscardAll(); return; } + JobModel.EnableInterSegment = false; } _isBasicMode = value; RaisePropertyChangedAuto(); @@ -280,19 +292,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 +435,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 +522,7 @@ namespace Tango.PPC.Jobs.ViewModels } RaisePropertyChanged(nameof(CanEdit)); + DropResumeCommand.RaiseCanExecuteChanged(); Job.NameChanged -= Job_NameChanged; Job.NameChanged += Job_NameChanged; @@ -547,7 +548,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 +582,6 @@ namespace Tango.PPC.Jobs.ViewModels IsFullMode = true; DyeCommand.RaiseCanExecuteChanged(); - ShowAdvanced = Settings.ShowAdvancedOptions; } catch (Exception ex) { @@ -633,8 +633,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 +781,7 @@ namespace Tango.PPC.Jobs.ViewModels var handler = await PrintingManager.Print(Job, _db, printConfig); RaisePropertyChanged(nameof(CanEdit)); + DropResumeCommand.RaiseCanExecuteChanged(); if (!BuildProvider.IsEureka) { @@ -1607,6 +1608,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 +1788,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 +1802,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/JobProgressView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobProgressView.xaml index a91d5676b..89b69a316 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobProgressView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobProgressView.xaml @@ -7,6 +7,7 @@ xmlns:controls="clr-namespace:Tango.PPC.Jobs.Controls" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:converters="clr-namespace:Tango.PPC.Jobs.Converters" + xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:global="clr-namespace:Tango.PPC.Jobs" xmlns:local="clr-namespace:Tango.PPC.Jobs.Views" mc:Ignorable="d" @@ -14,6 +15,105 @@ <UserControl.Resources> <converters:JobProgressToPositionConverter x:Key="JobProgressToPositionConverter" /> + + <Style x:Key="SliderGreyTextStyle" TargetType="TextBlock"> + <Setter Property="FontSize" Value="{StaticResource TangoDefaultFontSize}"></Setter> + <Setter Property="VerticalAlignment" Value="Center"></Setter> + <Setter Property="HorizontalAlignment" Value="Center"></Setter> + </Style> + + <DataTemplate x:Key="CMYK_Template" DataType="{x:Type entities:BrushStop}"> + <UniformGrid Rows="1" Columns="4" Height="Auto" MinWidth="180" HorizontalAlignment="Left"> + <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> + <Border Width="50" Height="50" Background="Cyan" CornerRadius="16" HorizontalAlignment="Left" > + <TextBlock Margin="0 0 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Cyan, StringFormat=0.##}" VerticalAlignment="Center"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0" Text="C" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Center"/> + </StackPanel> + <StackPanel Orientation="Vertical" Margin="0 0 0 0" Width="50"> + <Border Width="50" Height="50" Background="Magenta" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Magenta, StringFormat=0.##}" VerticalAlignment="Center" ></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0" Text="M" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Center"/> + </StackPanel> + <StackPanel Orientation="Vertical" Margin="10 0 0 0" Width="50"> + <Border Width="50" Height="50" Background="Yellow" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Yellow, StringFormat=0.##}" VerticalAlignment="Center" ></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0" Text="Y" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Center"/> + </StackPanel> + <StackPanel Orientation="Vertical" Margin="10 0 0 0" Width="50"> + <Border Width="50" Height="50" Background="Black" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Black, StringFormat=0.##}" VerticalAlignment="Center" Foreground="{StaticResource TangoLightForegroundBrush}"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0" Text="K" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Center"/> + </StackPanel> + </UniformGrid> + </DataTemplate> + + <DataTemplate x:Key="RGB_Template" DataType="{x:Type entities:BrushStop}"> + <UniformGrid Rows="1" Columns="3" Height="Auto" > + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Red" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Red}" VerticalAlignment="Center"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0" Text="R" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center" HorizontalAlignment="Center"/> + + </StackPanel> + <StackPanel Orientation="Vertical" Margin="4 0 0 0" Width="50"> + <Border Width="50" Height="50" Background="Green" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Green}" VerticalAlignment="Center"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0" Text="G" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center" HorizontalAlignment="Center"/> + + </StackPanel> + <StackPanel Orientation="Vertical" Margin="4 0 0 0" Width="50"> + <Border Width="50" Height="50" Background="Blue" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Blue}" VerticalAlignment="Center" Foreground="{StaticResource TangoLightForegroundBrush}"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0" Text="B" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center" HorizontalAlignment="Center"/> + + </StackPanel> + </UniformGrid> + </DataTemplate> + + <DataTemplate x:Key="LAB_Template" DataType="{x:Type entities:BrushStop}"> + <UniformGrid Rows="1" Columns="3" Height="Auto" MinWidth="180" HorizontalAlignment="Left"> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Gray" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding L, StringFormat=0.##}" VerticalAlignment="Center"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " Text="L" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Center"/> + + </StackPanel> + <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left" Margin="5 0 0 0"> + <Border Width="50" Height="50" Background="red" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding A, StringFormat=0.##}" VerticalAlignment="Center"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " Text="a" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Center"/> + </StackPanel> + <StackPanel Orientation="Vertical" Margin="10 0 0 0" Width="50"> + <Border Width="50" Height="50" Background="Blue" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0" HorizontalAlignment="Center" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding B, StringFormat=0.##}" Foreground="{StaticResource TangoLightForegroundBrush}" VerticalAlignment="Center"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " Text="b" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Center"/> + </StackPanel> + </UniformGrid> + </DataTemplate> + + <DataTemplate x:Key="CATALOG_Template" DataType="{x:Type entities:BrushStop}"> + <UniformGrid Rows="1" Columns="2" Height="Auto" MinWidth="180"> + <StackPanel Orientation="Vertical" Margin="0 0 0 0"> + <TextBlock Text="Catalog:" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center"/> + <TextBlock Margin="0 10 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding ColorCatalog.Name}" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Left"></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Margin="10 0 0 0"> + <TextBlock Text="Color:" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center"/> + <TextBlock Margin="0 10 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding ColorCatalogsItem.Name}" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Left" ></TextBlock> + </StackPanel> + </UniformGrid> + </DataTemplate> + </UserControl.Resources> <Grid> @@ -119,7 +219,7 @@ </StackPanel> </Grid> - <Grid Margin="0 150 0 0"> + <Grid Margin="0 70 0 0"> <StackPanel MaxWidth="600"> <Canvas Height="80" Margin="0"> <StackPanel> @@ -206,8 +306,175 @@ </Grid> </StackPanel> </Grid> + <Grid Margin="0 30 0 0"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="1*"/> + <ColumnDefinition Width="2*"/> + </Grid.ColumnDefinitions> + <StackPanel Orientation="Vertical"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/JobProgressView/input.png" Stretch="None" VerticalAlignment="Top" HorizontalAlignment="Left"/> + <TextBlock VerticalAlignment="Center" Margin="15 0 0 0" FontSize="{StaticResource TangoDefaultFontSize}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Text" Value="Input"/> + <Style.Triggers> + <DataTrigger Binding="{Binding CurrentBrushStop.ColorSpace.Name, Converter={StaticResource EnumToDescriptionConverter}}" Value="Volume"> + <Setter Property="Text" Value="Input ( % )"/> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + </StackPanel> + <UniformGrid Margin="0 20 0 0" Rows="1" Columns="3" Height="Auto" MinWidth="190" HorizontalAlignment="Left" Visibility="{Binding IsDyeingProcess,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " Text="L" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center"/> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50" > + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " Text="a" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center"/> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " Text="b" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center"/> + </StackPanel> + </UniformGrid> + <Grid Visibility="{Binding IsDyeingProcess,Converter={StaticResource BooleanToVisibilityConverter}}"> + <ContentControl x:Name="leftBrushValues" HorizontalAlignment="Left" Content="{Binding CurrentBrushStop}" Width="Auto" Height="Auto" Margin="0 20 0 0"> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate/> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding CurrentBrushStop.ColorSpace.Name, Converter={StaticResource EnumToDescriptionConverter}}" Value="RGB"> + <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding CurrentBrushStop.ColorSpace.Name, Converter={StaticResource EnumToDescriptionConverter}}" Value="Volume"> + <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding CurrentBrushStop.ColorSpace.Name}" Value="LAB"> + <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding CurrentBrushStop.ColorSpace.Name, Converter={StaticResource EnumToDescriptionConverter}}" Value="Catalog"> + <Setter Property="ContentTemplate" Value="{StaticResource CATALOG_Template}" /> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </Grid> + </StackPanel> + <StackPanel Orientation="Vertical" Grid.Column="1" Margin="60 0 0 0"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/JobProgressView/output.png" Stretch="None" VerticalAlignment="Top" HorizontalAlignment="Left" Height="Auto" ClipToBounds="True"/> + <TextBlock VerticalAlignment="Center" Margin="15 0 0 0" FontSize="{StaticResource TangoDefaultFontSize}" >Output ( % ) </TextBlock> + </StackPanel> + <UniformGrid Margin="0 20 0 0" Rows="1" Columns="7" Height="Auto" Width="435" HorizontalAlignment="Left" Visibility="{Binding IsDyeingProcess,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Text="0" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Border> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="C" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Text="0" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Border> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="M" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Text="0" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Border> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="Y" HorizontalAlignment="Center" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Text="0" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Border> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="K" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Text="0" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Border> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Text="0" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Border> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Text="0" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Border> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + </StackPanel> + + </UniformGrid> + <UniformGrid Columns="7" Rows="1" Margin="0 20 0 0" Width="440" HorizontalAlignment="Left" Visibility="{Binding IsDyeingProcess,Converter={StaticResource BooleanToVisibilityConverter}}"> + <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left" > + <Border Width="50" Height="50" Background="Cyan" CornerRadius="16" HorizontalAlignment="Left" VerticalAlignment="Center"> + <TextBlock Margin="0 0 0 0 " HorizontalAlignment="Center" Text="{Binding CyanOutput}" VerticalAlignment="Center"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">C</TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> + <Border Width="50" Height="50" Background="LightCyan" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0 " HorizontalAlignment="Center" Text="{Binding LightCyanOutput}" VerticalAlignment="Center"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">LC</TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> + <Border Width="50" Height="50" Background="Magenta" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0 " HorizontalAlignment="Center" Text="{Binding MagentaOutput}" VerticalAlignment="Center"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">M</TextBlock> + </StackPanel> + + <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> + <Border Width="50" Height="50" Background="LightPink" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0 " HorizontalAlignment="Center" Text="{Binding LightMagentaOutput}" VerticalAlignment="Center"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">LM</TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> + <Border Width="50" Height="50" Background="Yellow" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0 " HorizontalAlignment="Center" Text="{Binding YellowOutput}" VerticalAlignment="Center"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">Y</TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> + <Border Width="50" Height="50" Background="LightYellow" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0 " HorizontalAlignment="Center" Text="{Binding LightYellowOutput}" VerticalAlignment="Center"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">LY</TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> + <Border Width="50" Height="50" Background="Black" CornerRadius="16" HorizontalAlignment="Left"> + <TextBlock Margin="0 0 0 0 " HorizontalAlignment="Center" Text="{Binding BlackOutput}" VerticalAlignment="Center" Foreground="{StaticResource TangoLightForegroundBrush}"></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">K</TextBlock> + </StackPanel> + </UniformGrid> + </StackPanel> + + </Grid> - <touch:TouchButton Margin="0 100 0 0" Command="{Binding GoToJobCommand}" Style="{StaticResource TangoLinkButton}" Height="60" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding RunningJobStatus.IsCompleted,Converter={StaticResource BooleanToVisibilityConverter}}"> + <touch:TouchButton Margin="0 5 0 20" Command="{Binding GoToJobCommand}" Style="{StaticResource TangoLinkButton}" Height="60" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding RunningJobStatus.IsCompleted,Converter={StaticResource BooleanToVisibilityConverter}}"> Go to job </touch:TouchButton> </StackPanel> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobSummeryView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobSummeryView.xaml index a013cd7f9..6eb51d16f 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobSummeryView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobSummeryView.xaml @@ -11,6 +11,14 @@ xmlns:local="clr-namespace:Tango.PPC.Jobs.Views" mc:Ignorable="d" d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:JobSummeryViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.JobSummeryViewVM}"> + + <UserControl.Resources> + <Style x:Key="SliderGreyTextStyle" TargetType="TextBlock"> + <Setter Property="FontSize" Value="{StaticResource TangoDefaultFontSize}"></Setter> + <Setter Property="VerticalAlignment" Value="Center"></Setter> + <Setter Property="HorizontalAlignment" Value="Center"></Setter> + </Style> + </UserControl.Resources> <Grid Background="White"> <Grid.RowDefinitions> @@ -51,7 +59,8 @@ <Grid.RowDefinitions> <RowDefinition Height="60*"/> <RowDefinition Height="400*"/> - <RowDefinition Height="300*"/> + <RowDefinition Height="180*"/> + <RowDefinition Height="170"/> </Grid.RowDefinitions> <TextBlock FontSize="{StaticResource TangoHeaderFontSize}" Text="{Binding Job.Name}" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap"></TextBlock> @@ -103,7 +112,92 @@ </StackPanel> <controls:JobSummeryViewer Height="60" Job="{Binding Job}" VerticalAlignment="Center" Margin="20 0" Grid.Row="2" /> + <Grid Margin="0 0 0 20" Grid.Row="3"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="1*"/> + <ColumnDefinition Width="2.5*"/> + </Grid.ColumnDefinitions> + <StackPanel Orientation="Vertical"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/JobProgressView/input.png" Stretch="None" VerticalAlignment="Top" HorizontalAlignment="Left"/> + <TextBlock VerticalAlignment="Center" Margin="15 0 0 0" FontSize="{StaticResource TangoDefaultFontSize}">Input</TextBlock> + </StackPanel> + <UniformGrid Margin="0 20 0 0" Rows="1" Columns="3" Height="Auto" MinWidth="190" HorizontalAlignment="Left" > + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " Text="L" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center"/> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50" > + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " Text="a" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center"/> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + </Border> + <TextBlock Margin="0 10 0 0 " Text="b" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center"/> + </StackPanel> + </UniformGrid> + </StackPanel> + <StackPanel Orientation="Vertical" Grid.Column="1" Margin="60 0 0 0"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/JobProgressView/output.png" Stretch="None" VerticalAlignment="Top" HorizontalAlignment="Left" Height="Auto"/> + <TextBlock VerticalAlignment="Center" Margin="15 0 0 0" FontSize="{StaticResource TangoDefaultFontSize}" >Output ( % )</TextBlock> + </StackPanel> + <UniformGrid Margin="0 20 0 0" Rows="1" Columns="7" Height="Auto" Width="435" HorizontalAlignment="Left" > + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Text="0" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Border> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="C" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Text="0" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Border> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="M" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Text="0" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Border> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="Y" HorizontalAlignment="Center" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Text="0" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Border> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="K" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Text="0" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Border> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Text="0" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Border> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"> + <TextBlock Margin="0 0 0 0 " Text="0" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Border> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + + </StackPanel> + </UniformGrid> + </StackPanel> + </Grid> + </Grid> + </DockPanel> </Border> </Grid> 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.Maintenance/Images/Guides/machine-image-X4.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/machine-image-X4.png Binary files differnew file mode 100644 index 000000000..5a6095e4c --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/machine-image-X4.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj index bebdd63c7..6ede5f25b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj @@ -323,10 +323,13 @@ <ItemGroup> <Resource Include="Images\thread_loading.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\Guides\machine-image-X4.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs index a8af047fc..2279b8bb5 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs @@ -34,36 +34,36 @@ namespace Tango.PPC.Maintenance.ViewModels { public enum Boards { - [Description("Main")] - Main = 1, + //[Description("Main")] + //Main = 1, [Description("Heads")] - Heads = 2, + Heads = 1, [Description("Dryer")] - Dryer = 3, + Dryer = 2, [Description("Mid tanks")] - Midtanks = 4, + Midtanks = 3, [Description("Lubricant")] - Lubricant = 5, + Lubricant = 4, [Description("Dispenser 1")] - Dispenser_1 = 6, + Dispenser_1 = 5, [Description("Dispenser 2")] - Dispenser_2 = 7, + Dispenser_2 = 6, [Description("Dispenser 3")] - Dispenser_3 = 8, + Dispenser_3 = 7, [Description("Dispenser 4")] - Dispenser_4 = 9, - [Description("Dispenser 5")] - Dispenser_5 = 10, - [Description("Dispenser 6")] - Dispenser_6 = 11, + Dispenser_4 = 8, + //[Description("Dispenser 5")] + //Dispenser_5 = 9, + //[Description("Dispenser 6")] + //Dispenser_6 = 10, [Description("Winder 1")] - Winder_1 = 12, + Winder_1 = 11, [Description("Winder 2")] - Winder_2 = 13, + Winder_2 = 12, [Description("Winder 3")] - Winder_3 = 14, + Winder_3 = 13, [Description("Winder 4")] - Winder_4 = 15, + Winder_4 = 14, } public class WasteStateModel : ExtendedObject diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/EurekaMaintenanceView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/EurekaMaintenanceView.xaml index faef8be1a..0b30d697e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/EurekaMaintenanceView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/EurekaMaintenanceView.xaml @@ -132,7 +132,7 @@ <touch:TouchDropShadowBorder Margin="0 0 0 0" Padding="0" MinHeight="216"> <StackPanel Orientation="Vertical"> <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="30 0 30 0" Height="116"> - <TextBlock VerticalAlignment="Center" Text="Reset Specific Board:" FontSize="{StaticResource TangoExpanderHeaderFontSize}" Width="210"></TextBlock> + <TextBlock VerticalAlignment="Center" Text="Reset Specific Board:" FontSize="{StaticResource TangoExpanderHeaderFontSize}" Width="240"></TextBlock> <Border Margin="55 0 0 0" x:Name="emborder" BorderThickness="1 1 1 1" Height="50" CornerRadius="25" BorderBrush="{StaticResource TangoMidAccentBrush}"> <touch:TouchComboBox Margin="20 0 10 0" ItemsSource="{Binding ListBoards}" SelectedItem="{Binding SelecteadBoard,Mode=TwoWay}" Focusable="False" KeyboardNavigation.TabNavigation ="None" Width="260" DisplayMemberPath=""> <touch:TouchComboBox.ItemTemplate> @@ -152,7 +152,7 @@ </StackPanel> <StackPanel Orientation="Horizontal" Margin="30 0 30 0" Height="100"> - <TextBlock VerticalAlignment="Center" Text="Machine Heaters:" FontSize="{StaticResource TangoExpanderHeaderFontSize}" Width="210"></TextBlock> + <TextBlock VerticalAlignment="Center" Text="Machine Heaters:" FontSize="{StaticResource TangoExpanderHeaderFontSize}" Width="240"></TextBlock> <touch:TouchToggleSlider IsChecked="{Binding EnableHeaters}" Margin="55 0 0 0" HorizontalAlignment="Right" Width="90"> <touch:TouchToggleSlider.Style> <Style TargetType="touch:TouchToggleSlider" BasedOn="{StaticResource TangoToggleButtonGrayAccent}"> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Power/Images/machine-X4.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Power/Images/machine-X4.png Binary files differnew file mode 100644 index 000000000..25e4697fd --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Power/Images/machine-X4.png 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/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs index e3f695514..143cfe875 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs @@ -16,6 +16,7 @@ using Tango.Settings; using System.Data.Entity; using Tango.PPC.Common.UWF; using Tango.BL.Entities; +using Tango.PPC.Common.Build; namespace Tango.PPC.Technician.ViewModels { @@ -134,25 +135,33 @@ namespace Tango.PPC.Technician.ViewModels { Settings.ApplicationState = ApplicationStates.FactoryRestore; Settings.Save(); - try - { - NotificationProvider.SetGlobalBusyMessage("Disabling write filter protection..."); - await _uwf.Disable(); - await Task.Delay(2000); - NotificationProvider.ReleaseGlobalBusyMessage(); - await NavigationManager.NavigateTo(Common.Navigation.NavigationView.RestartingSystemView); - await Task.Delay(4000); - _os.Restart(); - } - catch (Exception ex) + + if (BuildProvider.BuildType == BuildType.TS1800) { - LogManager.Log(ex, "Error executing factory reset."); - NotificationProvider.ReleaseGlobalBusyMessage(); - await NotificationProvider.ShowError($"Error executing factory reset.\n{ex.FlattenMessage()}"); + try + { + NotificationProvider.SetGlobalBusyMessage("Disabling write filter protection..."); + await _uwf.Disable(); + await Task.Delay(2000); + NotificationProvider.ReleaseGlobalBusyMessage(); + await NavigationManager.NavigateTo(Common.Navigation.NavigationView.RestartingSystemView); + await Task.Delay(4000); + _os.Restart(); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error executing factory reset."); + NotificationProvider.ReleaseGlobalBusyMessage(); + await NotificationProvider.ShowError($"Error executing factory reset.\n{ex.FlattenMessage()}"); + } + finally + { + NotificationProvider.ReleaseGlobalBusyMessage(); + } } - finally + else { - NotificationProvider.ReleaseGlobalBusyMessage(); + ApplicationManager.Restart(); } } } 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..3dd91806d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs @@ -15,33 +15,35 @@ 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; + return (double)totalBy4Spools / number_of_spools; } 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 if (forOneSpool) { - return (double)progressCurrent / 4; + return (double)progressCurrent / number_of_spools; } return progressCurrent; 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..f93e34c7d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs @@ -16,37 +16,39 @@ 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) { - return (double)weight / 4; + return (double)weight / number_of_spools; } 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 var weight = ((double)progressCurrent * coef) / (1000);//(g) if (forOneSpool) { - return (double)weight / 4; + return (double)weight / number_of_spools; } return weight; 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/Images/machine-X4.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-X4.png Binary files differnew file mode 100644 index 000000000..25e4697fd --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-X4.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-image-X4.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-image-X4.png Binary files differnew file mode 100644 index 000000000..5a6095e4c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-image-X4.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..a63c0fca2 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,10 @@ <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" /> + <Resource Include="Images\machine-X4.png" /> + <Resource Include="Images\machine-image-X4.png" /> <Content Include="Intro.wmv" /> <Content Include="Manifests\release.xml" /> <Content Include="Manifests\debug.xml" /> 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/EmergencyView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/EmergencyView.xaml index f2b018bfa..e4f55915c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/EmergencyView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/EmergencyView.xaml @@ -20,7 +20,18 @@ <TextBlock Margin="0 8 0 0" FontSize="{StaticResource TangoTitleFontSize}">2. Release the emergency button.</TextBlock> <TextBlock Margin="0 8 0 0" FontSize="{StaticResource TangoTitleFontSize}">3. Press the power button to power up the system.</TextBlock> - <Image Source="../Images/machine-image.png" Width="500" HorizontalAlignment="Left" Margin="0 150 0 0" /> + <Image Width="500" HorizontalAlignment="Left" Margin="0 150 0 0" > + <Image.Style> + <Style TargetType="{x:Type Image}"> + <Setter Property="Source" Value="../Images/machine-image.png"/> + <Style.Triggers> + <DataTrigger Binding="{Binding BuildProvider.IsEureka}" Value="true"> + <Setter Property="Source" Value="../Images/machine-image-X4.png"/> + </DataTrigger> + </Style.Triggers> + </Style> + </Image.Style> + </Image> </StackPanel> </DockPanel> </Grid> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/ExternalBridgeView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/ExternalBridgeView.xaml index fddd15fe7..7276d7d4c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/ExternalBridgeView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/ExternalBridgeView.xaml @@ -18,7 +18,18 @@ <localControls:MachineStatusControl Margin="0 0 0 -1" VerticalAlignment="Center" DataContext="{Binding MachineProvider.MachineOperator}" /> </Grid> <Grid HorizontalAlignment="Center" Margin="0 20 0 0"> - <Image Source="/Images/machine.png" Stretch="None" RenderOptions.BitmapScalingMode="Fant"></Image> + <Image Stretch="None" RenderOptions.BitmapScalingMode="Fant"> + <Image.Style> + <Style TargetType="{x:Type Image}"> + <Setter Property="Source" Value="/Images/machine.png"/> + <Style.Triggers> + <DataTrigger Binding="{Binding BuildProvider.IsEureka}" Value="true"> + <Setter Property="Source" Value="/Images/machine-X4.png"/> + </DataTrigger> + </Style.Triggers> + </Style> + </Image.Style> + </Image> <touch:TouchIcon Icon="Wifi" Foreground="{StaticResource TangoGreenBrush}" Width="30" Height="30" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 40 45"> <touch:TouchIcon.Style> <Style TargetType="touch:TouchIcon"> 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..ada513879 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -129,7 +129,7 @@ <DockPanel> <TextBlock DockPanel.Dock="Bottom" Text="{Binding IDSPack.LiquidType.ShortName}" HorizontalAlignment="Center" Margin="0 8 0 0"></TextBlock> <Grid Height="15" DockPanel.Dock="Top"> - <TextBlock DockPanel.Dock="Top" Height="15" VerticalAlignment="Top" TextAlignment="Center" Visibility="{Binding HasRemainingTimeoutError,Converter={StaticResource BooleanToVisibilityConverter}}" Text="{Binding RemainingTimeoutError, StringFormat='{}{0:hh}:{0:mm}m', FallbackValue=00:00}" HorizontalAlignment="Center" FontSize="{StaticResource TangoSmallFontSizeBar}" ></TextBlock> + <TextBlock DockPanel.Dock="Top" Height="15" VerticalAlignment="Top" TextAlignment="Center" Visibility="{Binding HasRemainingTimeoutError,Converter={StaticResource BooleanToVisibilityConverter}}" Text="{Binding RemainingTimeoutError, StringFormat='{}{0:hh}:{0:mm}h', FallbackValue=00:00}" HorizontalAlignment="Center" FontSize="{StaticResource TangoSmallFontSizeBar}" ></TextBlock> </Grid> <Grid > <Grid ClipToBounds="True" HorizontalAlignment="Center"> @@ -208,7 +208,7 @@ <DockPanel> <TextBlock DockPanel.Dock="Bottom" Text="Lub" HorizontalAlignment="Center" Margin="0 8 0 0"></TextBlock> <Grid Height="15" DockPanel.Dock="Top"> - <TextBlock DockPanel.Dock="Top" Height="15" VerticalAlignment="Top" TextAlignment="Center" Visibility="{Binding HasRemainingTimeoutError,Converter={StaticResource BooleanToVisibilityConverter}}" Text="{Binding RemainingTimeoutError, StringFormat='{}{0:hh}:{0:mm}m', FallbackValue=00:00}" HorizontalAlignment="Center" FontSize="{StaticResource TangoSmallFontSizeBar}" ></TextBlock> + <TextBlock DockPanel.Dock="Top" Height="15" VerticalAlignment="Top" TextAlignment="Center" Visibility="{Binding HasRemainingTimeoutError,Converter={StaticResource BooleanToVisibilityConverter}}" Text="{Binding RemainingTimeoutError, StringFormat='{}{0:hh}:{0:mm}h', FallbackValue=00:00}" HorizontalAlignment="Center" FontSize="{StaticResource TangoSmallFontSizeBar}" ></TextBlock> </Grid> <Grid > <Grid ClipToBounds="True" HorizontalAlignment="Center"> @@ -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> @@ -1172,7 +1177,7 @@ </ItemsControl.ItemsPanel> </ItemsControl> </Border> - <TextBlock HorizontalAlignment="Center" Margin="0 4 0 0" FontWeight="Thin">Winder</TextBlock> + <TextBlock HorizontalAlignment="Center" Margin="0 4 0 0" FontWeight="Thin">Winder BTSR</TextBlock> </StackPanel> <StackPanel Orientation="Vertical"> <Border Height="171" Width="95" VerticalAlignment="Center" CornerRadius="0" BorderThickness="0" BorderBrush="{StaticResource TangoBlackInkBrush}"> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingSystemView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingSystemView.xaml index dd4d2f5d5..abc2ce9c5 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingSystemView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingSystemView.xaml @@ -12,7 +12,18 @@ <Grid> <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <Grid Margin="0 100 0 0"> - <Image Source="/Images/machine.png" Stretch="Uniform" Width="250" RenderOptions.BitmapScalingMode="Fant"></Image> + <Image Stretch="Uniform" Width="250" RenderOptions.BitmapScalingMode="Fant"> + <Image.Style> + <Style TargetType="{x:Type Image}"> + <Setter Property="Source" Value="/Images/machine.png"/> + <Style.Triggers> + <DataTrigger Binding="{Binding BuildProvider.IsEureka}" Value="true"> + <Setter Property="Source" Value="/Images/machine-X4.png"/> + </DataTrigger> + </Style.Triggers> + </Style> + </Image.Style> + </Image> <touch:TouchBusyIndicator Foreground="{StaticResource TangoGrayBrush}" Width="350" Height="350" IsIndeterminate="{Binding IsVisible}" /> </Grid> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingView.xaml index 41017f629..9e7abdca2 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingView.xaml @@ -14,7 +14,18 @@ <Grid> <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <Grid Margin="0 100 0 0"> - <Image Source="/Images/machine.png" Stretch="Uniform" Width="250" RenderOptions.BitmapScalingMode="Fant"></Image> + <Image Stretch="Uniform" Width="250" RenderOptions.BitmapScalingMode="Fant"> + <Image.Style> + <Style TargetType="{x:Type Image}"> + <Setter Property="Source" Value="/Images/machine.png"/> + <Style.Triggers> + <DataTrigger Binding="{Binding BuildProvider.IsEureka}" Value="true"> + <Setter Property="Source" Value="/Images/machine-X4.png"/> + </DataTrigger> + </Style.Triggers> + </Style> + </Image.Style> + </Image> <touch:TouchBusyIndicator Foreground="{StaticResource TangoGrayBrush}" Width="350" Height="350" IsIndeterminate="{Binding IsVisible}" /> </Grid> |
