diff options
| author | Roy <Roy.mail.net@gmail.com> | 2023-09-03 16:10:39 +0300 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2023-09-03 16:10:39 +0300 |
| commit | b271fe1c21172ed22a34b987a2cb9457b39ce8a3 (patch) | |
| tree | dc53a5a561a08874a3aeccbcb50f725b9b3f2507 /Software/Visual_Studio | |
| parent | 96f130f14b92ed55251a143a4ded92910dd398a1 (diff) | |
| parent | f5382442f379b35f301c5e0f6871f19c004a48af (diff) | |
| download | Tango-b271fe1c21172ed22a34b987a2cb9457b39ce8a3.tar.gz Tango-b271fe1c21172ed22a34b987a2cb9457b39ce8a3.zip | |
Merge branch 'eureka' of https://twinetfs.visualstudio.com/Tango/_git/Tango into eureka
Diffstat (limited to 'Software/Visual_Studio')
28 files changed, 715 insertions, 155 deletions
diff --git a/Software/Visual_Studio/Advanced Installer Projects/Eureka Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/Eureka Installer.aip index 1fa8a95a1..a0ee3bf70 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/Eureka Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/Eureka Installer.aip @@ -15,10 +15,10 @@ <ROW Property="CTRLS" Value="2"/> <ROW Property="ExtractFilesFirst" Value="1"/> <ROW Property="Manufacturer" Value="Twine Solutions LTD"/> - <ROW Property="ProductCode" Value="1033:{6EB25A1D-2D1C-4CDD-9868-A37C42DC831D} " Type="16"/> + <ROW Property="ProductCode" Value="1033:{9F0F61B8-72B3-4439-A090-6CF84FF9C642} " Type="16"/> <ROW Property="ProductLanguage" Value="1033"/> <ROW Property="ProductName" Value="Twine X4"/> - <ROW Property="ProductVersion" Value="2.0.12.0" Type="32" TargetFile="Tango.PPC.UI.exe"/> + <ROW Property="ProductVersion" Value="2.0.13.0" Type="32" TargetFile="Tango.PPC.UI.exe"/> <ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/> <ROW Property="UpgradeCode" Value="{4D8FDA03-F63E-4002-9A96-4BDE65B04355}"/> <ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/> @@ -680,7 +680,7 @@ <ROW Action="AI_DetectSoftware" Sequence="101"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.BuildComponent"> - <ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFolder="..\Build\Installers\Eureka" PackageFileName="TwineX4 Installer_v2.0.12" Languages="en" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" ExtUI="true" UseLargeSchema="true" ExeName="TwineX4 Installer_v2.0.12"/> + <ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFolder="..\Build\Installers\Eureka" PackageFileName="TwineX4 Installer_v2.0.13" Languages="en" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" ExtUI="true" UseLargeSchema="true" ExeName="TwineX4 Installer_v2.0.13"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.DictionaryComponent"> <ROW Path="<AI_DICTS>ui.ail"/> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/ObjectsConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/ObjectsConverter.cs new file mode 100644 index 000000000..c5585cc73 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/ObjectsConverter.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.PPC.Jobs.Converters +{ + public class ObjectsConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + return values.Clone(); + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} 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 d8b3d535b..e737a8f7a 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 @@ -25,6 +25,7 @@ </ResourceDictionary.MergedDictionaries> <converters:ColorTabToVisibilityConverter x:Key="ColorTabToVisibilityConverter" /> + <converters:ObjectsConverter x:Key="ObjectsConverter" /> <sharedConverters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> <sharedConverters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" /> <sharedConverters:BooleanInverseConverter x:Key="BooleanInverseConverter"/> @@ -268,12 +269,12 @@ <DockPanel Margin="40 0 20 20"> <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Visibility="{Binding EditColorsGroupMode , Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <TextBlock Text="{Binding Name}" Height="30" Margin="0 10 0 0" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="SemiBold" VerticalAlignment="Center" Foreground="{StaticResource TangoBlackInkBrush}" ></TextBlock> - <touch:TouchIconButton Margin="20 0 0 0" VerticalAlignment="Center" Foreground="{StaticResource TangoBlackInkBrush}" Height="16.5" Icon="PencilAltSolid" Command="{Binding DataContext.EditColorsLibraryCommand, ElementName=colorSelectionView}" CommandParameter="{Binding }" /> + <!--<touch:TouchIconButton Margin="20 0 0 0" VerticalAlignment="Center" Foreground="{StaticResource TangoBlackInkBrush}" Height="16.5" Icon="PencilAltSolid" Command="{Binding DataContext.EditColorsLibraryCommand, ElementName=colorSelectionView}" CommandParameter="{Binding }" />--> </StackPanel> <DockPanel DockPanel.Dock="Top" Visibility="{Binding EditColorsGroupMode , Converter={StaticResource BooleanToVisibilityConverter}}"> - <touch:TouchIconButton DockPanel.Dock="Right" Icon="TrashAltRegular" Width="16" Height="16.5" Margin="0 0 35 1" EnableDropShadow="False" Foreground="{StaticResource TangoBlackInkBrush}" Command="{Binding DataContext.DeleteGroupCommand , ElementName=colorSelectionView}" /> + <touch:TouchIconButton DockPanel.Dock="Right" Icon="TrashAltRegular" Width="16" Height="16.5" Margin="0 0 35 1" EnableDropShadow="False" Foreground="{StaticResource TangoBlackInkBrush}" Command="{Binding DataContext.DeleteGroupCommand , ElementName=colorSelectionView}" CommandParameter="{Binding DataContext,RelativeSource={RelativeSource Self}}"/> <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> - <touch:TouchTextBox MaxLength="20" Validation.ErrorTemplate="{StaticResource validationTemplate}" MinWidth="100" Margin="0 0 0 0" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="SemiBold" VerticalAlignment="Center" Foreground="{StaticResource TangoBlackInkBrush}" > + <touch:TouchTextBox MaxLength="20" Validation.ErrorTemplate="{StaticResource validationTemplate}" MinWidth="100" Margin="0 0 0 0" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="SemiBold" VerticalAlignment="Center" Foreground="{StaticResource TangoBlackInkBrush}" FocusSelectionMode="SelectAll" > <touch:TouchTextBox.Resources> <helpers:BindingProxy x:Key="proxy" Data="{Binding DataContext, ElementName=colorSelectionView}"/> </touch:TouchTextBox.Resources> @@ -289,7 +290,7 @@ </Binding> </touch:TouchTextBox.Text> </touch:TouchTextBox> - <touch:TouchIconButton Margin="20 0 0 0" VerticalAlignment="Center" Foreground="{StaticResource TangoPrimaryAccentBrush}" Height="16.5" Icon="PencilAltSolid" Command="{Binding DataContext.EditColorsLibraryCommand, ElementName=colorSelectionView}" CommandParameter="{Binding }" /> + <!--<touch:TouchIconButton Margin="20 0 0 0" VerticalAlignment="Center" Foreground="{StaticResource TangoPrimaryAccentBrush}" Height="16.5" Icon="PencilAltSolid" Command="{Binding DataContext.EditColorsLibraryCommand, ElementName=colorSelectionView}" CommandParameter="{Binding }" />--> </StackPanel> </DockPanel> <Rectangle DockPanel.Dock="Bottom" Margin="0 10 0 0" Height="1" Stroke="{StaticResource TangoDividerBrush}" VerticalAlignment="Bottom" /> @@ -310,15 +311,47 @@ <touch:TouchButton Width="68" Height="68" EnableDropShadow="False" Background="Transparent" BorderThickness="0" Command="{Binding DataContext.SelectColorCommand , ElementName=colorSelectionView}" CommandParameter="{Binding }" /> </Border> <Border Background="{Binding Brush}" Width="68" Height="68" CornerRadius="10" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" BorderThickness="2" HorizontalAlignment="Left" Visibility="{Binding DataContext.EditColorsGroupMode , ElementName=colorLibraryList, Converter={StaticResource BooleanToVisibilityConverter}}"> - <touch:TouchButton Width="68" Height="68" EnableDropShadow="False" Background="Transparent" BorderThickness="0" Command="{Binding DataContext.DeleteColorCommand , ElementName=colorSelectionView}" CommandParameter="{Binding }" > + <touch:TouchButton Width="68" Height="68" EnableDropShadow="False" Background="Transparent" BorderThickness="0" Command="{Binding DataContext.DeleteColorCommand , ElementName=colorSelectionView}" > <Border Height="26" Width="28" BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left"> <Image Stretch="Fill" RenderOptions.BitmapScalingMode="Fant" Source="../Images/ColorSelection/delete_color.png" VerticalAlignment="Center" HorizontalAlignment="Center"/> </Border> + <touch:TouchButton.CommandParameter> + <MultiBinding Converter="{StaticResource ObjectsConverter}"> + <Binding/> + <Binding Path="DataContext" ElementName="colorLibraryList"/> + </MultiBinding> + </touch:TouchButton.CommandParameter> </touch:TouchButton> </Border> <!--<Border Background="{Binding Color}" Width="65" Height="65" CornerRadius="6"></Border>--> - <TextBlock Grid.Row="1" Margin="3 12 0 10" MaxWidth="78" HorizontalAlignment="Left" TextAlignment="Left" Text="{Binding Name}" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" ToolTip="{Binding Name}" FontSize="{StaticResource TangoSmallFontSizeBar}" Visibility="{Binding DataContext.EditColorsGroupMode , ElementName=colorLibraryList , Converter={StaticResource BooleanToVisibilityInverseConverter}}"></TextBlock> - <touch:TouchTextBox MaxLength="24" Grid.Row="1" Margin="3 12 0 10" MaxWidth="78" Text="{Binding Name, UpdateSourceTrigger=LostFocus, Mode=TwoWay}" FontSize="{StaticResource TangoSmallFontSizeBar}" Visibility="{Binding DataContext.EditColorsGroupMode , ElementName=colorLibraryList, Converter={StaticResource BooleanToVisibilityConverter}}" HorizontalAlignment="Left" TextBlock.TextAlignment="Left"/> + <TextBlock Grid.Row="1" Margin="3 12 0 10" MaxWidth="78" HorizontalAlignment="Left" TextAlignment="Left" Text="{Binding Name}" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" ToolTip="{Binding Name}" FontSize="{StaticResource TangoSmallFontSizeBar}" Visibility="{Binding DataContext.EditColorsGroupMode , ElementName=colorLibraryList , Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Foreground" Value="{StaticResource TangoDarkForegroundBrush}" /> + <Setter Property="Background" Value="Transparent" /> + <Style.Triggers> + <DataTrigger Binding="{Binding IsSelected}" Value="True"> + <!--<Setter Property="Foreground" Value="{StaticResource TangoRedBrush}" />--> + <Setter Property="Background" Value="LightBlue"/> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + <touch:TouchTextBox MaxLength="24" Grid.Row="1" Margin="3 12 0 10" MaxWidth="78" Text="{Binding Name, UpdateSourceTrigger=LostFocus, Mode=TwoWay}" FontSize="{StaticResource TangoSmallFontSizeBar}" Visibility="{Binding DataContext.EditColorsGroupMode , ElementName=colorLibraryList, Converter={StaticResource BooleanToVisibilityConverter}}" HorizontalAlignment="Left" TextBlock.TextAlignment="Left" FocusSelectionMode="SelectAll"> + <touch:TouchTextBox.Style> + <Style TargetType="touch:TouchTextBox"> + <Setter Property="Foreground" Value="{StaticResource TangoDarkForegroundBrush}" /> + <Setter Property="Background" Value="Transparent" /> + <Style.Triggers> + <DataTrigger Binding="{Binding IsSelected}" Value="True"> + <!--<Setter Property="Foreground" Value="{StaticResource TangoRedBrush}" />--> + <Setter Property="Background" Value="LightBlue"/> + </DataTrigger> + </Style.Triggers> + </Style> + </touch:TouchTextBox.Style> + </touch:TouchTextBox> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> @@ -329,17 +362,21 @@ <DataTemplate x:Key="saveMyColorsDlg"> <Canvas Margin="200 50 100 0" Visibility="{Binding SaveMyColorMode, Mode=TwoWay, Converter={StaticResource BooleanToVisibilityConverter}}" > - <Border x:Name="SaveMyColorGroups" Width="280" Background="Transparent" Height="Auto" MinHeight="100" MaxHeight="450"> + <Border x:Name="SaveMyColorGroups" Width="380" Background="Transparent" Height="Auto" MinHeight="100" MaxHeight="550"> <Grid MinWidth="260" > <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="12" BorderThickness="0" MinHeight="100" Margin="0"> <Border.Effect> <DropShadowEffect Opacity="0.5" ShadowDepth="6" Color="Silver" BlurRadius="10" Direction="270"/> </Border.Effect> - <Grid> - <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="12" BorderThickness="0" Padding="10" MinHeight="100" Margin="0 20 0 0"> + <StackPanel Orientation="Vertical"> + <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="12" BorderThickness="0" Padding="10" MinHeight="100" Margin="0 10 0 0"> <StackPanel Orientation="Vertical"> + <StackPanel Orientation="Horizontal" Height="60" > + <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoButtonFontSize}" Margin="20 0 0 0" >Name: </TextBlock> + <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="320" ItemsSource="{Binding Libraries}" Style="{StaticResource ListBoxVerticalScroll}" + <ListBox HorizontalAlignment="Stretch" MaxHeight="220" ItemsSource="{Binding Libraries}" Style="{StaticResource ListBoxVerticalScroll}" ScrollViewer.VerticalScrollBarVisibility="Visible" > <ListBox.ItemsPanel> <ItemsPanelTemplate> @@ -367,10 +404,26 @@ </StackPanel> </StackPanel> </Border> - <Border BorderThickness="0" Width="Auto" Height="Auto" BorderBrush="{StaticResource TangoDividerBrush}" Margin="0 18 15 0" HorizontalAlignment="Right" VerticalAlignment="Top"> + <!--<Border BorderThickness="0" Width="Auto" Height="Auto" BorderBrush="{StaticResource TangoDividerBrush}" Margin="0 18 15 0" HorizontalAlignment="Right" VerticalAlignment="Top"> <touch:TouchImageButton Width="22" Height="15" Image="{StaticResource Close_SaveMyColor}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 0 0" EnableDropShadow="False" Background="Transparent" BorderThickness="0" Command="{Binding SaveMyColorsCommand}" Focusable="False"/> + </Border>--> + <Border BorderThickness="0" Width="Auto" Height="Auto" BorderBrush="{StaticResource TangoDividerBrush}" Margin="0 10 0 20" Padding="0" HorizontalAlignment="Center" VerticalAlignment="Bottom"> + <touch:TouchButton Width="100" Height="40" CornerRadius="20" Command="{Binding SaveMyColorsCommand}" TextElement.Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoButtonFontSize}" ShadowDepth="0" Content="OK"> + <touch:TouchButton.Style > + <Style TargetType="touch:TouchButton" > + <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> + <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"/> + <Style.Triggers> + <Trigger Property="IsEnabled" Value="False"> + <Setter Property="Foreground" Value="{StaticResource TangoDisabledForegroundBrush}"></Setter> + <Setter Property="Background" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </touch:TouchButton.Style> + </touch:TouchButton> </Border> - </Grid> + </StackPanel> </Border> </Grid> </Border> @@ -634,7 +687,7 @@ <DockPanel > <Grid DockPanel.Dock="Bottom" Height="137"> <Rectangle Height="1" Stroke="{StaticResource TangoDividerBrush}" HorizontalAlignment="Stretch"/> - <Grid Margin="48 50 0 0" > + <Grid Margin="48 30 0 0" > <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="1*"/> @@ -650,15 +703,30 @@ </Grid> </Grid> <DockPanel x:Name="headerPanel" Height="122" DockPanel.Dock="Top"> - <Rectangle DockPanel.Dock="Bottom" Margin="43 0 63 10" Height="1" Stroke="{StaticResource TangoDividerBrush}" VerticalAlignment="Bottom"/> + <Rectangle DockPanel.Dock="Bottom" Margin="43 0 63 0" Height="1" Stroke="{StaticResource TangoDividerBrush}" VerticalAlignment="Bottom"/> <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> - <Grid> + <StackPanel Orientation="Vertical" Margin="0"> + <DockPanel> + <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> + </touch:TouchButton> + <Grid DockPanel.Dock="Left" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="60 0 0 0" Width="280"> + <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> + </DockPanel> + </Grid> + </DockPanel> <ListBox x:Name="listLibraries" Grid.Row="1" Margin="10 0 10 60" ItemsSource="{Binding Libraries}" Style="{StaticResource ListBoxVerticalScroll}" - ScrollViewer.VerticalScrollBarVisibility="Visible" Width="560" ItemTemplate="{StaticResource ColorLibrary_Template}"> + ScrollViewer.VerticalScrollBarVisibility="Visible" Width="560" ItemTemplate="{StaticResource ColorLibrary_Template}" Height="580"> </ListBox> - </Grid> + </StackPanel> </DockPanel> </Grid> </Border> 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 7e5f73637..3146da179 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 @@ -7,6 +7,7 @@ using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Data; using Tango.BL.Entities; using Tango.BL.Enumerations; using Tango.ColorConversion; @@ -315,6 +316,8 @@ namespace Tango.PPC.Jobs.Dialogs } } + public ICollectionView ColorLibrariesView { get; private set; } + public Dictionary<ColorSpaces, List<FavoriteColor>> _colorSpaceToFavoriteColorDictionary; @@ -392,6 +395,16 @@ namespace Tango.PPC.Jobs.Dialogs } } + private String _searchColorText; + /// <summary> + /// Gets or sets the search filter. + /// </summary> + public String SearchColorText + { + get { return _searchColorText; } + set { _searchColorText = value; RaisePropertyChangedAuto(); OnSearchColorChanged(); } + } + private bool _isOpenVectorFineTuningDialog; public bool IsOpenVectorFineTuningDialog @@ -408,6 +421,24 @@ namespace Tango.PPC.Jobs.Dialogs get { return _vectorFineTuningDialogVM; } set { _vectorFineTuningDialogVM = value; RaisePropertyChangedAuto(); } } + + private String _myColorName; + + public String MyColorName + { + get { return _myColorName; } + set { _myColorName = value; + RaisePropertyChangedAuto();} + } + + private String _editColorButtonName; + + public String EditColorButtonName + { + get { return _editColorButtonName; } + set { _editColorButtonName = value; + RaisePropertyChangedAuto();} + } #endregion @@ -426,10 +457,11 @@ namespace Tango.PPC.Jobs.Dialogs public RelayCommand OpenMyColorsCommand { get; set; } public RelayCommand CloseMyColorsCommand { get; set; } public RelayCommand AddGroupCommand { get; set; } - public RelayCommand DeleteGroupCommand { get; set; } + public RelayCommand<ColorLibrary> DeleteGroupCommand { get; set; } public RelayCommand<FavoriteColor> SelectColorCommand { get; set; } public RelayCommand<ColorLibrary> EditColorsLibraryCommand { get; set; } - public RelayCommand<FavoriteColor> DeleteColorCommand { get; set; } + public RelayCommand EditColorsLibrariesCommand { get; set; } + public RelayCommand<object> DeleteColorCommand { get; set; } public RelayCommand VectorFineTuningCommand { get; set; } @@ -471,15 +503,16 @@ namespace Tango.PPC.Jobs.Dialogs SaveMyColorsCommand = new RelayCommand(SaveMyColors); OpenMyColorsCommand = new RelayCommand(() => { MyColorsMode = true; }); - CloseMyColorsCommand = new RelayCommand(() => { MyColorsMode = false; }); + CloseMyColorsCommand = new RelayCommand(() => { MyColorsMode = false; SearchColorText = "";}); SelectColorCommand = new RelayCommand<FavoriteColor>(SelectColor); AddGroupCommand = new RelayCommand(AddGroup); AddNewGroupCommand = new RelayCommand<string>(AddNewGroup); AddNewGroupAndColorCommand = new RelayCommand<string>(AddNewGroupAndColor); AddColorToLibraryCommand = new RelayCommand<ColorLibrary>(AddColorToLibrary); - DeleteGroupCommand = new RelayCommand(DeleteGroup); + DeleteGroupCommand = new RelayCommand<ColorLibrary>(DeleteGroup); EditColorsLibraryCommand = new RelayCommand<ColorLibrary>(EditColorsLibrary); - DeleteColorCommand = new RelayCommand<FavoriteColor>(DeleteColor); + EditColorsLibrariesCommand = new RelayCommand(EditColorsLibraries); + DeleteColorCommand = new RelayCommand<object>(DeleteColor); MyColorsMode = false; EditColorsGroupMode = false; SaveMyColorMode = false; @@ -497,6 +530,33 @@ namespace Tango.PPC.Jobs.Dialogs Libraries.CollectionChanged -= Libraries_CollectionChanged; Libraries.CollectionChanged += Libraries_CollectionChanged; + ColorLibrariesView = CollectionViewSource.GetDefaultView(Libraries); + ColorLibrariesView.SortDescriptions.Add(new SortDescription(nameof(ColorLibrary.Name), ListSortDirection.Ascending)); + ColorLibrariesView.Filter = new Predicate<object> (item => + { + var ColorLibraryItem = item as ColorLibrary; + + if (ColorLibraryItem != null) + { + if (String.IsNullOrEmpty(SearchColorText)) + { + ColorLibraryItem.ColorList.ToList().ForEach(x => x.IsSelected = false); + return true; + } + else + { + ColorLibraryItem.ColorList.ToList().ForEach( x=> x.IsSelected = x.Name.ToLower().StartsWith(SearchColorText.ToLower())); + + if(ColorLibraryItem.ColorList.ToList().Any(x=>x.Name.ToLower().StartsWith(SearchColorText.ToLower()))) + return true; + return (ColorLibraryItem.Name.ToLower().StartsWith(SearchColorText.ToLower())); + } + } + else + { + return true; + } + }); base.OnShow(); SegmentIndex = DialogEditObject.SelectedSegment.SegmentIndex; @@ -555,7 +615,7 @@ namespace Tango.PPC.Jobs.Dialogs SelectedBrushStop.ColorChanged += OnBrushColorChanged; CheckIsSelectedColorInLibrary(); SelectedBrushStop.ConvertColor();//test OOG - } + } @@ -667,6 +727,14 @@ namespace Tango.PPC.Jobs.Dialogs } } + private void OnSearchColorChanged() + { + if (ColorLibrariesView != null) + { + ColorLibrariesView.Refresh(); + } + } + private double GetMaxCMYKValueOrDefault(LiquidTypes type) { @@ -771,6 +839,7 @@ namespace Tango.PPC.Jobs.Dialogs var favoriteColor = colors.FirstOrDefault(item => item.Color == SelectedBrushStop.Color); if (favoriteColor != null) { + MyColorName = favoriteColor.Name; foreach (var library in Libraries) { if(library.IsColorExist(favoriteColor)) @@ -782,6 +851,7 @@ namespace Tango.PPC.Jobs.Dialogs } } } + } } catch( Exception ex) @@ -796,6 +866,15 @@ namespace Tango.PPC.Jobs.Dialogs else { SaveMyColorMode = !SaveMyColorMode; + String colorName = "MyColor"; + 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; } IsBusy = false; @@ -885,7 +964,7 @@ namespace Tango.PPC.Jobs.Dialogs newcolor.Brightness = SelectedBrushStop.Brightness; newcolor.RmlGuid = SelectedBrushStop.SegmentModel.Job.Rml.Guid; int index = obj.ColorList.Count() + 1; - newcolor.Name = String.Format($"Color{index}");//String.Format("#{0:X2}{1:X2}{2:X2}", newcolor.Red, newcolor.Green, newcolor.Blue); + newcolor.Name = MyColorName;//String.Format($"Color{index}");//String.Format("#{0:X2}{1:X2}{2:X2}", newcolor.Red, newcolor.Green, newcolor.Blue); obj.AddToLibrary(newcolor); @@ -963,22 +1042,62 @@ namespace Tango.PPC.Jobs.Dialogs } } - private void DeleteColor(FavoriteColor favoriteColor) + private void EditColorsLibraries() { - if (favoriteColor != null && SelectedColorLibrary != null) + if (EditColorsGroupMode) { - SelectedColorLibrary.RemoveFromLibrary(favoriteColor); - LoadLibraryDictionary(); + //SelectedColorLibrary.EditColorsGroupMode = false; + EditColorsGroupMode = false; + EditColorButtonName = "EDIT"; + foreach (var library in Libraries) + { + library.EditColorsGroupMode = false; + } + //save all + } + else + { + EditColorsGroupMode = true; + EditColorButtonName = "SAVE"; + foreach (var library in Libraries) + { + library.EditColorsGroupMode = true; + } + + //SelectedColorLibrary = library;SelectedColorLibrary + //SelectedColorLibrary.EditColorsGroupMode = true; } } - private void DeleteGroup() + private void DeleteColor(object parameter) + { + var values = parameter as object[]; + if (values != null && values.Count() == 2) + { + var favoriteColor = values[0] as FavoriteColor; + var colorlibrary = values[1] as ColorLibrary; + if (favoriteColor != null && colorlibrary != null) + { + colorlibrary.RemoveFromLibrary(favoriteColor); + LoadLibraryDictionary(); + } + } + + } + + private void DeleteGroup(ColorLibrary library) { - if (SelectedColorLibrary != null) + //if (SelectedColorLibrary != null) + //{ + // //message + // Libraries.Remove(SelectedColorLibrary); + // SelectedColorLibrary.Delete(); + //} + if (library != null) { //message - Libraries.Remove(SelectedColorLibrary); - SelectedColorLibrary.Delete(); + Libraries.Remove(library); + library.Delete(); } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml index 99b78d7ec..2e3732eff 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml @@ -231,7 +231,7 @@ <Run Text="{Binding TrialNumber, Mode=OneWay}" Foreground="{StaticResource TangoGrayTextBrush}"></Run> </TextBlock> </StackPanel> - + <Grid Grid.Row="1" HorizontalAlignment="Stretch" Grid.RowSpan="2" > <touch:TouchNavigationLinks Grid.Row="1" BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 3" x:Name="navigationCSTLinks" SelectionChanged="TouchNavigationLinks_SelectionChanged" HorizontalContentAlignment="Center" SelectedIndex="{Binding SelectedTabIndex,Mode=TwoWay}" VerticalAlignment="Bottom" Margin="0,0,0,30" Padding="40 0 40 0" FontSize="{StaticResource TangoNavigationLinksFontSize}" Grid.RowSpan="2" PreviewMouseDown="NavigationCSTLinks_PreviewMouseDown" PreviewTouchDown="NavigationCSTLinks_PreviewTouchDown" > @@ -262,6 +262,11 @@ </touch:TouchNavigationLinks.Style> </touch:TouchNavigationLinks> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 20 20" > + <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="{StaticResource TangoButtonFontSize}">Length:</TextBlock> + <touch:TouchNumericTextBox Margin="20 0 20 5" Width="80" Height="40" HorizontalAlignment="Stretch" BorderThickness="0.8" Minimum="60" Maximum="999" Value="{Binding FineTuningTrialLengthMeters, Mode=TwoWay}" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="Normal" BorderBrush="{StaticResource TangoDividerBrush}" HideUnderline="True" HasDecimalPoint="False" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/> + </StackPanel> + </Grid> <Grid Grid.Row="3" Margin="40 0 20 0"> <Grid Visibility="{Binding IsManualFineTuning, Converter={StaticResource BooleanToVisibilityInverseConverter}}" Margin="0 0 24 0" x:Name="Automatic"> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs index b9149b81f..e6094d0d7 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs @@ -716,7 +716,20 @@ namespace Tango.PPC.Jobs.Dialogs } } } - + + private int _fineTuningTrialLengthMeters; + + public int FineTuningTrialLengthMeters + { + get { return _fineTuningTrialLengthMeters; } + set + { + _fineTuningTrialLengthMeters = value; + RaisePropertyChangedAuto(); + OnUpdateSettingineTuningTrialLengthMeters(); + } + } + #endregion #region Commands @@ -757,6 +770,9 @@ namespace Tango.PPC.Jobs.Dialogs IsManualFineTuning = false; IsOnlyManual = false; VisualCorrectionModel = new VisualOffsetModel(); + + var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); + FineTuningTrialLengthMeters = settings.FineTuningTrialLengthMeters; } /// <summary> @@ -818,6 +834,12 @@ namespace Tango.PPC.Jobs.Dialogs TargetB = brushstop.B; TargetA = brushstop.A; BrushStopModel.ConvertColorToVolume(); + if (BrushStopModel.Black > 0 && BrushStopModel.Black < 0.5) + { + BrushStopModel.PreventPropertyUpdate = true; + BrushStopModel.Black = 0; + BrushStopModel.PreventPropertyUpdate = false; + } BrushStopModel.ColorSpace = ColorSpaces.LAB; IsOnlyManual = false; } @@ -828,6 +850,7 @@ namespace Tango.PPC.Jobs.Dialogs Magenta = BrushStopModel.Magenta; Yellow = BrushStopModel.Yellow; Black = BrushStopModel.Black; + MeasuredL = MeasuredB = MeasuredA = null; TestColor = null; @@ -1368,6 +1391,16 @@ namespace Tango.PPC.Jobs.Dialogs } + private void OnUpdateSettingineTuningTrialLengthMeters() + { + if (FineTuningTrialLengthMeters != 0) + { + var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); + settings.FineTuningTrialLengthMeters = FineTuningTrialLengthMeters; + settings.Save(); + } + } + #endregion #region Job @@ -1437,7 +1470,7 @@ namespace Tango.PPC.Jobs.Dialogs } BrushStopModel.ColorSpace = ColorSpaces.LAB; } - var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); + // var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); using (ObservablesContext db = ObservablesContext.CreateDefault()) { @@ -1457,7 +1490,7 @@ namespace Tango.PPC.Jobs.Dialogs Segment segment = new Segment(); segment.Name = "VFT Segment"; - segment.Length = settings.FineTuningTrialLengthMeters; + segment.Length = FineTuningTrialLengthMeters;//settings.FineTuningTrialLengthMeters; segment.Job = job; segment.JobGuid = job.Guid; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/BrushStopModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/BrushStopModel.cs index 5464aa5ed..ffec3cfa1 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/BrushStopModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/BrushStopModel.cs @@ -1,23 +1,18 @@ -using System; -using ColorMine.ColorSpaces; +using ColorMine.ColorSpaces; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.Entities; -using Tango.SharedUI; using System.Windows.Media; +using Tango.BL.Dispensing; +using Tango.BL.Entities; using Tango.BL.Enumerations; -using Tango.Core.Threading; using Tango.ColorConversion; -using System.Reflection; -using Tango.BL.Dispensing; -using Tango.BL; -using Tango.Core.ExtensionMethods; -using Newtonsoft.Json; -using Tango.Settings; -using Tango.PPC.Common; +using Tango.Core.Threading; using Tango.PMR.ColorLab; +using Tango.PPC.Common; +using Tango.Settings; +using Tango.SharedUI; namespace Tango.PPC.Jobs.Models { @@ -1558,6 +1553,10 @@ namespace Tango.PPC.Jobs.Models _yellow = (output.SingleCoordinates.OutputLiquids.SingleOrDefault(x => x.LiquidType == PMR.ColorLab.LiquidType.Yellow).Volume); _magenta = (output.SingleCoordinates.OutputLiquids.SingleOrDefault(x => x.LiquidType == PMR.ColorLab.LiquidType.Magenta).Volume); _black = (output.SingleCoordinates.OutputLiquids.SingleOrDefault(x => x.LiquidType == PMR.ColorLab.LiquidType.Black).Volume); + if(_black > 0 && _black < 0.5)//bug 7959 0.001 < K% < 0.5 ==> reset the K to 0. + { + _black = 0; + } IsOutOfGamut = output.OutOfGamut; if(IsOutOfGamut) { @@ -1728,7 +1727,17 @@ namespace Tango.PPC.Jobs.Models Configuration configuration = SegmentModel.Job.Machine.Configuration; Rml rml = SegmentModel.Job.Rml; + bool bChangedVersion = false; + if (stop.BrushColorSpace == BL.Enumerations.ColorSpaces.Volume && rml.ColorConversionVersion == 6) + { + rml.ColorConversionVersion = 5; + bChangedVersion = true; + } var output = _converter.Convert(stop, configuration, rml, false, false, false); + if (bChangedVersion) + { + rml.ColorConversionVersion = 6; + } //output.SingleCoordinates.OutputLiquids.SingleOrDefault(x => x.LiquidType == PMR.ColorLab.LiquidType.Cyan).Volume; if (stop.BrushColorSpace == BL.Enumerations.ColorSpaces.Volume) 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 43d41539e..00c8293bd 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 @@ -91,6 +91,17 @@ namespace Tango.PPC.Jobs.Models get { return new SolidColorBrush(Color); } } + [BsonIgnore] + private bool _isSelected; + [BsonIgnore] + public bool IsSelected + { + get { return _isSelected; } + set { _isSelected = value; + RaisePropertyChangedAuto();} + } + + #endregion public FavoriteColor() @@ -104,6 +115,7 @@ namespace Tango.PPC.Jobs.Models Cyan = Magenta = Yellow = Black = 0; Color = Colors.White; ColorSpace = ColorSpaces.Volume; + IsSelected = false; } } } 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 8267fd3aa..d8a71fc78 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 @@ -130,8 +130,7 @@ namespace Tango.PPC.Jobs.Models { _numberofunits = value; RaisePropertyChangedAuto(); - RaisePropertyChanged(nameof(LengthIncludingNumberOfUnits)); - RaisePropertyChanged(nameof(LengthIncludingNumberOfUnitsAndSpools)); + OnUpdateLengthhWeight(); RaisePropertyChanged(nameof(GetEstimatedDuration)); } } @@ -226,6 +225,8 @@ namespace Tango.PPC.Jobs.Models _rml = value; RaisePropertyChangedAuto(); RaisePropertyChanged( nameof(GetEstimatedDuration)); + RaisePropertyChanged(nameof(GramPerLength)); + OnUpdateLengthhWeight(); } } } @@ -362,8 +363,7 @@ namespace Tango.PPC.Jobs.Models RaisePropertyChangedAuto(); OnNumberOfSpoolsChanged(); RaisePropertyChanged(nameof(Copies)); - RaisePropertyChanged(nameof(LengthIncludingNumberOfUnits)); - RaisePropertyChanged(nameof(LengthIncludingNumberOfUnitsAndSpools)); + OnUpdateLengthhWeight(); } } } @@ -391,8 +391,7 @@ namespace Tango.PPC.Jobs.Models _copies = coeff * NumberSpools; } NumberOfUnits = (int)_copies / NumberSpools; - RaisePropertyChanged(nameof(LengthIncludingNumberOfUnits)); - RaisePropertyChanged(nameof(LengthIncludingNumberOfUnitsAndSpools)); + OnUpdateLengthhWeight(); } else _copies = value; @@ -688,7 +687,35 @@ namespace Tango.PPC.Jobs.Models return 0d; } } - + + [JsonIgnore] + public double WeightIncludingNumberOfUnits + { + get + { + if (Rml == null) + return 0; + + var gramPerlength = Rml.GetGramPer1000mLength; + var weight = (LengthIncludingNumberOfUnits * gramPerlength) / (1000);//(g) + return weight; + } + } + + [JsonIgnore] + public double WeightIncludingNumberOfUnitsAndSpools + { + get + { + if (NumberSpools >= 4) + { + return WeightIncludingNumberOfUnits * NumberSpools; + } + + return WeightIncludingNumberOfUnits; + } + } + #endregion #region constructors @@ -1071,13 +1098,20 @@ namespace Tango.PPC.Jobs.Models //} } RaisePropertyChanged(nameof(Length)); - RaisePropertyChanged(nameof(LengthIncludingNumberOfUnits)); - RaisePropertyChanged(nameof(LengthIncludingNumberOfUnitsAndSpools)); + OnUpdateLengthhWeight(); } RaisePropertyChanged(nameof(GetEstimatedDuration)); } + private void OnUpdateLengthhWeight() + { + RaisePropertyChanged(nameof(LengthIncludingNumberOfUnits)); + RaisePropertyChanged(nameof(LengthIncludingNumberOfUnitsAndSpools)); + RaisePropertyChanged(nameof(WeightIncludingNumberOfUnits)); + RaisePropertyChanged(nameof(WeightIncludingNumberOfUnitsAndSpools)); + } + private void OnSelectAllChanged() { if (Segments != null ) 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 a55f1c91e..5ec7c3f39 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 @@ -242,6 +242,7 @@ <Compile Include="Converters\LengthToWeightConverter.cs" /> <Compile Include="Converters\LengthWithSpoolsConverter.cs" /> <Compile Include="Converters\MarginOffsetSliderConverter .cs" /> + <Compile Include="Converters\ObjectsConverter.cs" /> <Compile Include="Converters\RoundDoubleConverter.cs" /> <Compile Include="Converters\TimeSpanToHoursConverter.cs" /> <Compile Include="Dialogs\AddSegmentWarningDialog.xaml.cs"> @@ -756,7 +757,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs index 46898210e..9d8ae1555 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 @@ -101,7 +101,13 @@ namespace Tango.PPC.Jobs.ViewModels public bool CanEdit { - get { return (!MachineProvider.MachineOperator.IsPrinting || MachineProvider.MachineOperator.RunningJob == null || MachineProvider.MachineOperator.RunningJob.Guid != Job.Guid) && !HasResumeModel; } + get { + return Job != null && + (!MachineProvider.MachineOperator.IsPrinting + || MachineProvider.MachineOperator.RunningJob == null + || MachineProvider.MachineOperator.RunningJob.Guid != Job.Guid) + && !HasResumeModel; + } } private ICollectionView _segmentsCollectionView; @@ -768,6 +774,8 @@ namespace Tango.PPC.Jobs.ViewModels printConfig.FirstUnitStartPosition = ResumeModel.FirstUnitStartPosition; printConfig.GlobalStartPosition = ResumeModel.GlobalStartPosition; printConfig.RemainingUnits = ResumeModel.RemainingUnits; + //LogManager.Log($"!!!!! Start Job resume : FirstUnitStartPosition = {ResumeModel.FirstUnitStartPosition} GlobalStartPosition = {ResumeModel.GlobalStartPosition} RemainingUnits = {ResumeModel.RemainingUnits}", LogCategory.Debug); + } var handler = await PrintingManager.Print(Job, _db, printConfig); @@ -1545,6 +1553,8 @@ namespace Tango.PPC.Jobs.ViewModels JobModel.Segments.Clear(); JobModel.Segments.Add(firstSegment); JobModel.GroupingSegments.Add(firstSegment); + JobModel.EnableInterSegment = false; + JobModel.InterSegmentLength = 0; if (firstSegment.IsGradient) { BrushStopModel firstbrush = firstSegment.FirstBrushStop; @@ -1801,7 +1811,7 @@ namespace Tango.PPC.Jobs.ViewModels { if (!e.JobHandler.Status.IsCompleted) { - if (e.JobHandler.JobStatus.Progress <= 0) return; + if (e.JobHandler.JobStatus.Progress <= e.JobHandler.ProcessParameters.DryerBufferLengthMeters) return; var model = JobResumeDB.Default.Get(e.Job.Guid); bool insert = false; 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 811bd5c9a..d6163506f 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 @@ -1219,13 +1219,13 @@ </TextBlock> <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}"> <Run Text="Total:" FontWeight="Normal"></Run> - <Run FontWeight="Bold"> - <Run.Text> + <Run FontWeight="Bold" Text="{Binding JobModel.WeightIncludingNumberOfUnitsAndSpools, StringFormat='#,0.##', Mode=OneWay}"> + <!--<Run.Text > <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" > - <Binding Path="JobModel.LengthIncludingNumberOfUnitsAndSpools" Mode="OneWay"/> - <Binding Path="JobModel.GramPerLength" Mode="OneWay"/> + <Binding Path="JobModel.LengthIncludingNumberOfUnitsAndSpools" /> + <Binding Path="JobModel.GramPerLength" /> </MultiBinding> - </Run.Text> + </Run.Text>--> </Run> <Run Text="g" FontWeight="Bold"></Run> </TextBlock> @@ -1284,13 +1284,13 @@ </TextBlock> <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}"> <Run Text="Total:" FontWeight="Normal"></Run> - <Run FontWeight="Bold"> - <Run.Text> + <Run FontWeight="Bold" Text="{Binding JobModel.WeightIncludingNumberOfUnitsAndSpools, StringFormat='#,0.##', Mode=OneWay}"> + <!--<Run.Text> <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" > - <Binding Path="JobModel.LengthIncludingNumberOfUnitsAndSpools" Mode="OneWay"/> - <Binding Path="JobModel.GramPerLength" Mode="OneWay"/> + <Binding Path="JobModel.LengthIncludingNumberOfUnitsAndSpools" /> + <Binding Path="JobModel.GramPerLength" /> </MultiBinding> - </Run.Text> + </Run.Text>--> </Run> <Run Text="g" FontWeight="Bold"></Run> </TextBlock> @@ -1312,14 +1312,7 @@ </TextBlock> <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}"> <Run Text="Total:" FontWeight="Normal"></Run> - <Run FontWeight="Bold"> - <Run.Text> - <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" > - <Binding Path="JobModel.LengthIncludingNumberOfUnits" Mode="OneWay"/> - <Binding Path="JobModel.GramPerLength" Mode="OneWay"/> - </MultiBinding> - </Run.Text> - </Run> + <Run FontWeight="Bold" Text="{Binding JobModel.WeightIncludingNumberOfUnits, Mode=OneWay, StringFormat='#,0.##'}"/> <Run Text="g" FontWeight="Bold"></Run> </TextBlock> </UniformGrid> 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 ec8801dc1..a91d5676b 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 @@ -102,6 +102,7 @@ <Image Source="../Images/JobProgressView/drop.png" Stretch="None" /> <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Getting Ready...</TextBlock> </StackPanel> + <TextBlock Margin="40 20 40 0" FontSize="{StaticResource TangoSmallFontSize}" FontWeight="Light" Text="{Binding RunningJobStatus.Message, FallbackValue='', TargetNullValue='', Converter={StaticResource StringEllipsisConverter},ConverterParameter='76'}" TextWrapping="Wrap" MaxWidth="310" HorizontalAlignment="Center" TextAlignment="Center" Height="42"></TextBlock> </StackPanel> <Rectangle Margin="0 10 0 0" Width="250" Stroke="{StaticResource TangoDividerBrush}" /> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Tango.PPC.Storage.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Tango.PPC.Storage.csproj index e541c472b..3ed0be501 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Tango.PPC.Storage.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Tango.PPC.Storage.csproj @@ -40,6 +40,7 @@ <Reference Include="System" /> <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Data" /> + <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> <Reference Include="Microsoft.CSharp" /> <Reference Include="System.Core" /> 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 db30c01b1..ed7784b2b 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 @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Forms; using Tango.Core.Commands; using Tango.Explorer; using Tango.PPC.Common; @@ -79,6 +80,8 @@ namespace Tango.PPC.Storage.ViewModels public RelayCommand OpenCommand { get; set; } + public RelayCommand OpenDirectoryCommand { get; set; } + public MainViewVM() { SelectedItems = new ObservableCollection<ExplorerFileItem>(); @@ -86,6 +89,7 @@ namespace Tango.PPC.Storage.ViewModels SaveCommand = new RelayCommand(OnSaveCommand, (x) => !String.IsNullOrWhiteSpace(FileName) || Request.Intent == StorageNavigationIntent.SaveFiles); Request = new StorageNavigationRequest() { Intent = StorageNavigationIntent.LoadFiles }; OpenCommand = new RelayCommand(OnOpenCommand, () => Request.Intent == StorageNavigationIntent.LoadFiles); + OpenDirectoryCommand = new RelayCommand(OnOpenFileDialogCommand); } public override void OnApplicationStarted() @@ -269,5 +273,29 @@ namespace Tango.PPC.Storage.ViewModels RaisePropertyChanged(nameof(FileName)); } } + + private void OnOpenFileDialogCommand() + { + if(Directory.Exists(CurrentPath) ) + { + Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog + { + InitialDirectory = CurrentPath, + Title = "Browse Job Files", + + CheckFileExists = true, + CheckPathExists = true, + + DefaultExt = "job", + Filter = "job files (*.job)|*.job", + ReadOnlyChecked = true, + ShowReadOnly = true + }; + if (openFileDialog.ShowDialog().Value) + { + StorageProvider.SubmitFileSelection(new List<ExplorerFileItem>() { ExplorerFileItem.LoadFromPath(openFileDialog.FileName) }); + } + } + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml index c57735a7b..ff1183495 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml @@ -28,7 +28,12 @@ <Border.Effect> <DropShadowEffect Color="Silver" ShadowDepth="0" BlurRadius="20" Opacity="1" /> </Border.Effect> - <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Storage</TextBlock> + <StackPanel Orientation="Horizontal"> + <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Storage</TextBlock> + <touch:TouchButton Command="{Binding OpenDirectoryCommand}" Style="{StaticResource TangoLinkButton}"> + <TextBlock Margin="20 1 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}" Text="{Binding CurrentPath}" Foreground="{StaticResource TangoPrimaryAccentBrush}" TextWrapping="Wrap"></TextBlock> + </touch:TouchButton> + </StackPanel> </Border> <Grid Margin="10" Grid.Row="1"> <DockPanel> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml index 4c39bded0..dfbd47514 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml @@ -12,6 +12,7 @@ d:DesignHeight="60" d:DesignWidth="500" Height="38" d:DataContext="{d:DesignInstance Type=local:RunningJobViewerEureka, IsDesignTimeCreatable=False}"> <UserControl.Resources> <converters:DoubleWidthConverter x:Key="DoubleWidthConverter" /> + <converters:ProgressBorderWidthConverter x:Key="ProgressBorderWidthConverter" /> </UserControl.Resources> <Grid> <touch:SliderContentControl x:Name="slider_control" ThumbColor="{StaticResource TangoPrimaryAccentColor}" @@ -37,28 +38,59 @@ </Border.Clip> <Grid> <Canvas x:Name="ColorCanvas" Width="{Binding ElementName=slider_control, Path=ActualWidth}" Height="{Binding ElementName=slider_control, Path=ActualHeight}" ClipToBounds="True" > - <Border x:Name="ItemsBorder" ClipToBounds="False" Margin="0 0 0 0" Height="{Binding ElementName=slider_control, Path=ActualHeight}" Width="{Binding ElementName=brush_border, Path=ActualWidth, Converter={StaticResource DoubleWidthConverter}}" > - <ItemsControl x:Name="SegmentsItemsControl" ClipToBounds="False" > - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> + <Border x:Name="ItemsBorder" ClipToBounds="False" Margin="0 0 0 0" Height="{Binding ElementName=slider_control, Path=ActualHeight}" > + <Grid ClipToBounds="False" HorizontalAlignment="Stretch" > + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> <Grid> - <Grid.Width> - <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="RunningJobStatus.CurrentUnitTotalProgress" Converter="{StaticResource DoubleWidthConverter}"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> - <Binding Path="LengthWithFactor"></Binding> - </MultiBinding> - </Grid.Width> - <Rectangle Fill="{Binding SegmentBrush}"></Rectangle> + <ItemsControl HorizontalAlignment="Left" x:Name="SegmentsItemsControl" Width="{Binding ElementName=brush_border, Path=ActualWidth, Converter={StaticResource DoubleWidthConverter}}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Horizontal" ></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Grid> + <Grid.Width> + <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> + <Binding RelativeSource="{RelativeSource AncestorType=local:RunningJobViewerEureka}" Path="JobUnitLength" Converter="{StaticResource DoubleWidthConverter}"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> + <Binding Path="LengthWithFactor"></Binding> + </MultiBinding> + </Grid.Width> + <Rectangle Fill="{Binding SegmentBrush}"></Rectangle> + </Grid> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> </Grid> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> + <Grid Grid.Column="1"> + <ItemsControl x:Name="LastSegmentsItemsControl" HorizontalAlignment="Right" Margin="0 0 0 0" Width="{Binding ElementName=brush_border, Path=ActualWidth}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Horizontal" ></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Grid> + <Grid.Width> + <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="RunningJobStatus.CurrentUnitTotalProgress" ></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> + <Binding Path="LengthWithFactor"></Binding> + </MultiBinding> + </Grid.Width> + <Rectangle Fill="{Binding SegmentBrush}"></Rectangle> + </Grid> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </Grid> + </Grid> </Border> </Canvas> <Rectangle Stroke="{StaticResource TangoGrayBrush}" StrokeThickness="1" StrokeDashArray="5 5 5 5" RadiusX="7" RadiusY="7" /> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs index 95fe5cd10..60c5a0346 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs @@ -17,6 +17,7 @@ using System.Windows.Navigation; using System.Windows.Shapes; using Tango.BL.Entities; using Tango.Integration.Operation; +using Tango.Logging; namespace Tango.PPC.UI.Controls { @@ -26,9 +27,9 @@ namespace Tango.PPC.UI.Controls public partial class RunningJobViewerEureka : UserControl { List<Segment> _segments; + List<Segment> _lastsegments; + - - private double _prevOffset; private double _addOffset; private int _prevUnit; @@ -80,27 +81,36 @@ namespace Tango.PPC.UI.Controls { if(Job != null) { + JobUnitLength = Job.Length; _segments = Job.EffectiveSegments.ToList(); if (Job.NumberOfUnits > 1 && _segments.Count > 0 && (_segments.Count > 1 || _segments[0].BrushStops.Count > 1)) { - //if (Job.EnableInterSegment && Job.InterSegmentLength > 0) - //{ - // _segments.Add(Job.CreateInterSegment(Job.InterSegmentLength)); - //} + if (Job.EnableInterSegment && Job.InterSegmentLength > 0) + { + _segments.Add(Job.CreateInterSegment(Job.InterSegmentLength)); + } _segments.AddRange(Job.EffectiveSegments.ToList()); - //if (Job.EnableInterSegment && Job.InterSegmentLength > 0) - //{ - // _segments.Add(Job.CreateInterSegment(Job.InterSegmentLength)); - //}//without check if last segment and last unit + if(Job.NumberOfUnits > 2 && Job.EnableInterSegment && Job.InterSegmentLength > 0) + { + _segments.Add(Job.CreateInterSegment(Job.InterSegmentLength)); + JobUnitLength += Job.InterSegmentLength; + //_segments.AddRange(Job.EffectiveSegments.ToList());//third set to use in end printing without intersegment + } + _lastsegments = Job.EffectiveSegments.ToList();; + IsHasMultipleColorsSegments = true; } else + { IsHasMultipleColorsSegments = false; + } SegmentsItemsControl.ItemsSource = _segments; SegmentsItemsControl.InvalidateVisual(); + LastSegmentsItemsControl.ItemsSource = _lastsegments; + LastSegmentsItemsControl.InvalidateVisual(); _prevOffset = _addOffset = 0.0; _prevUnit = 0; @@ -188,6 +198,20 @@ namespace Tango.PPC.UI.Controls DependencyProperty.Register("IsHasMultipleColorsSegments", typeof(bool), typeof(RunningJobViewerEureka), new PropertyMetadata(false)); + + public double JobUnitLength + { + get { return (double)GetValue(JobUnitLengthProperty); } + set { SetValue(JobUnitLengthProperty, value); } + } + + // Using a DependencyProperty as the backing store for JobUnitLength. This enables animation, styling, binding, etc... + public static readonly DependencyProperty JobUnitLengthProperty = + DependencyProperty.Register("JobUnitLength", typeof(double), typeof(RunningJobViewerEureka), new FrameworkPropertyMetadata(0.0)); + + + + /// <summary> /// Initializes a new instance of the <see cref="RunningJobViewerEureka"/> class. /// </summary> @@ -212,14 +236,14 @@ namespace Tango.PPC.UI.Controls if(slider_control != null) { slider_control.Value = SliderValue; - if(RunningJobStatus != null && RunningJobStatus.IsSettingUp == false && IsHasMultipleColorsSegments && ColorCanvas != null && ControlWidth > 0) + if(RunningJobStatus != null && RunningJobStatus.IsSettingUp == false && IsHasMultipleColorsSegments && ColorCanvas != null && ControlWidth > 0 && RunningJobStatus.CurrentUnitProgress > 0.01 && RunningJobStatus.CurrentUnitTotalProgress > 0) { double progress = RunningJobStatus.CurrentUnitProgress; double total = RunningJobStatus.CurrentUnitTotalProgress; int currentUnit = RunningJobStatus.CurrentUnit; - int totalUnits = Job.NumberOfUnits; - + int totalUnits = RunningJobStatus.RemainingUnits + RunningJobStatus.CurrentUnit;//Job.NumberOfUnits; + double simpleoffset = ((progress / total) * ControlWidth) ; double multiplier = (((double)(totalUnits - 1)) / (double)totalUnits); @@ -227,15 +251,25 @@ namespace Tango.PPC.UI.Controls if(_prevUnit < currentUnit) { + if(_prevOffset == 0)//resume + { + _prevOffset = ControlWidth * (1-multiplier) * currentUnit; + } _addOffset = _prevOffset; } - + // Debug.WriteLine($"OnSliderValueChanged Offset: '{offset}' CurrentUnitProgress = {RunningJobStatus.CurrentUnitProgress} progress= {progress} currentUnit = {currentUnit}, total:{total}"); offset += _addOffset; - if (offset >= ControlWidth) + if (offset >= ControlWidth && currentUnit < (Job.NumberOfUnits - 2)) { - offset -= ControlWidth;//round + offset -= ControlWidth;//round + // Debug.WriteLine($"OnSliderValueChanged round!!! offset: '{offset}' currentUnit = {currentUnit}, total:{total}"); } + + //if(currentUnit == (Job.NumberOfUnits - 1)) + //{ + // Debug.WriteLine($"OnSliderValueChanged offset: '{offset}' currentUnit = {currentUnit}. ControlWidth = {ControlWidth} total:{total}"); + //} _prevOffset = offset; _prevUnit = currentUnit; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressBorderWidthConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressBorderWidthConverter.cs new file mode 100644 index 000000000..3345798eb --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressBorderWidthConverter.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.PPC.UI.Converters +{ + public class ProgressBorderWidthConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + double length = System.Convert.ToDouble(value); + return length * 3; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml index fe9875009..85d905841 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml @@ -23,7 +23,7 @@ <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 30 0 0" FontSize="{StaticResource TangoDialogFontSize}">Machine information:</TextBlock> <FlowDocumentScrollViewer VerticalScrollBarVisibility="Disabled" Margin="0 10 0 0"> <FlowDocument> - <Table CellSpacing="0" FontFamily="{StaticResource TangoFlexoFontFamily}"> + <Table CellSpacing="2" FontFamily="{StaticResource TangoFlexoFontFamily}"> <Table.Resources> <Style TargetType="{x:Type TableRowGroup}"> <Setter Property="FontSize" Value="{StaticResource TangoDefaultFontSize}"/> @@ -36,7 +36,7 @@ </Style> </Table.Resources> <Table.Columns> - <TableColumn Width="160" /> + <TableColumn Width="165" /> <TableColumn /> <TableColumn /> </Table.Columns> @@ -145,7 +145,7 @@ <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoDialogFontSize}">Installed Software & Firmware:</TextBlock> <FlowDocumentScrollViewer VerticalScrollBarVisibility="Disabled" Margin="0 10 0 0"> <FlowDocument> - <Table CellSpacing="0" FontFamily="{StaticResource TangoFlexoFontFamily}"> + <Table CellSpacing="2" FontFamily="{StaticResource TangoFlexoFontFamily}"> <Table.Resources> <Style TargetType="{x:Type TableRowGroup}"> <Setter Property="FontSize" Value="{StaticResource TangoDefaultFontSize}"/> @@ -158,7 +158,7 @@ </Style> </Table.Resources> <Table.Columns> - <TableColumn Width="160" /> + <TableColumn Width="165" /> <TableColumn /> <TableColumn /> </Table.Columns> @@ -246,7 +246,7 @@ <TableRow> <TableCell> <Paragraph> - <TextBlock>Dispensers Firmware:</TextBlock> + <TextBlock Text="Dispensers Firmware:"></TextBlock> </Paragraph> </TableCell> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs index 10f417edc..575d19efa 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs @@ -109,7 +109,7 @@ namespace Tango.PPC.UI.Printing job.SpoolType = spoolType; - if (printConfig.GlobalStartPosition > 0) + if (printConfig != null && printConfig.GlobalStartPosition > 0) { config.ResumeConfig = new AdditionalJobConfiguration.ResumeConfiguration(); config.ResumeConfig.FirstUnitStartPosition = printConfig.FirstUnitStartPosition; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs index 219146a4e..1e5b4ba89 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs @@ -8,4 +8,4 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango PPC Application")] -[assembly: AssemblyVersion("2.0.12.0")] +[assembly: AssemblyVersion("2.0.13.0")] 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 e364c530c..705c042c5 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 @@ -174,6 +174,7 @@ <Compile Include="Converters\LengthWithSpoolsConverter.cs" /> <Compile Include="Converters\LiquidTypeToBrushConverter.cs" /> <Compile Include="Converters\MidTankLevelToElementRectConverter.cs" /> + <Compile Include="Converters\ProgressBorderWidthConverter.cs" /> <Compile Include="Converters\ProgressLengthSpoolConverter.cs" /> <Compile Include="Converters\ProgressUnitSpoolConverter.cs" /> <Compile Include="Converters\ProgressWeightSpoolConverter.cs" /> @@ -990,7 +991,7 @@ if $(ConfigurationName) == Eureka copy /Y "$(ProjectDir)Intro.wmv" "$(TargetDir) </PropertyGroup> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> <Import Project="..\..\packages\WPFMediaKit.2.2.0\build\WPFMediaKit.targets" Condition="Exists('..\..\packages\WPFMediaKit.2.2.0\build\WPFMediaKit.targets')" /> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs index 684b9bd8c..131476c9e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -24,6 +24,9 @@ using System.ComponentModel; using RealTimeGraphX.WPF; using RealTimeGraphX.DataPoints; using Tango.PPC.UI.Graphs; +using Tango.BL; +using System.Data.Entity; +using System.Windows.Media; namespace Tango.PPC.UI.ViewModels { @@ -41,6 +44,25 @@ namespace Tango.PPC.UI.ViewModels Motor = 3 } + public class TimeToDyeValueItem + { + public DateTime startTime; + public DateTime endTime; + public double totalValue; + }; + + public class TimeToDyeValueCollection + { + public DateTime StartTime { get; set;} + public List<TimeToDyeValueItem> items; + public TimeToDyeValueCollection() + { + items = new List<TimeToDyeValueItem>(); + } + }; + + private DispatcherTimer _productiondata_timer; + #region Properties [TangoInject] @@ -184,7 +206,7 @@ namespace Tango.PPC.UI.ViewModels { get { return GetVolumeLiquidType(LiquidTypes.LightYellow); } } - + //public double TransparentInkOutput //{ // get { return GetVolumeLiquidType(LiquidTypes.TransparentInk); } @@ -344,7 +366,10 @@ namespace Tango.PPC.UI.ViewModels public MachineStatusViewVM() { - + _productiondata_timer = new DispatcherTimer(); + _productiondata_timer.Interval = TimeSpan.FromMinutes(10); + _productiondata_timer.Tick += _productiondata_timer_Tick; + StopCommand = new RelayCommand(StopJob, () => CanStopped()); AbortCommand = new RelayCommand(AbortJob, () => CanStopped()); @@ -355,7 +380,7 @@ namespace Tango.PPC.UI.ViewModels ClearJobCommand = new RelayCommand(ClearJob, () => CanStopped()); - GoToJobCommand = new RelayCommand(GoToJob, () => IsEnableGoToJob()); + GoToJobCommand = new RelayCommand(GoToJob, () => IsEnableGoToJob()); JobStatusViewCommand = new RelayCommand(JobStatusView); OverviewViewCommand = new RelayCommand(OverviewView); ClearAllNotificationsCommand = new RelayCommand(ClearAllNotifications); @@ -397,6 +422,12 @@ namespace Tango.PPC.UI.ViewModels MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; + DateTime dateTime = DateTime.Now; + DateTime onedayEarlier = dateTime.AddDays(-1); + + GetCollectionDyePropByStartTime(onedayEarlier); + + _productiondata_timer.Start(); } #region Events @@ -520,6 +551,10 @@ namespace Tango.PPC.UI.ViewModels //} } + private void _productiondata_timer_Tick(object sender, EventArgs e) + { + var CurrentDateTime = DateTime.Now; + } #endregion #region printing @@ -584,17 +619,38 @@ namespace Tango.PPC.UI.ViewModels IsDyeingProcess = (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null); if (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null) { - var currentSegmentIndex = Math.Max(_runningJobStatus.CurrentSegment.SegmentIndex - (Job.Segments.Count * RunningJobStatus.CurrentUnit), 0); - var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == currentSegmentIndex); - // var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex); - if (segment != null) + if(_runningJobStatus.CurrentSegment.IsInterSegment) { - if (_handler.JobTicket.Segments.Count > 0) + CurrentBrushStop = _runningJobStatus.CurrentSegment.BrushStops.FirstOrDefault(); + JobBrushStop = null; + } + else + { + var realsegmIndex = 1; + if (Job.EnableInterSegment && Job.InterSegmentLength > 0) { - JobBrushStop = _handler.JobTicket.Segments[Job.OrderedSegments.IndexOf(segment)].BrushStops.First(); - } + 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; } - CurrentBrushStop = RunningJobStatus.CurrentSegment.FirstBrushStop; } } @@ -728,6 +784,12 @@ namespace Tango.PPC.UI.ViewModels IsDisplayJobOutline = true; } } + + #endregion + + #region graph + + public TimeToDyeValueCollection graphDyeingValuesCollection = new TimeToDyeValueCollection(); private WpfGraphController<DateTimeDataPoint, DoubleDataPoint> CreateController(params WpfGraphDataSeries[] seriesCollection) { @@ -750,7 +812,10 @@ namespace Tango.PPC.UI.ViewModels private WpfGraphDataSeries CreateSeries(String name, GraphHelper.GraphColor fill) { - WpfGraphDataSeries series = new WpfGraphDataSeries(); + WpfGraphDataSeries series = new WpfGraphDataSeries() + { + Stroke = Colors.DodgerBlue, + }; series.Name = name; series.Fill = GraphHelper.GetGraphBrush(fill); series.StrokeThickness = 1; @@ -758,6 +823,33 @@ namespace Tango.PPC.UI.ViewModels return series; } + public async void GetCollectionDyePropByStartTime(DateTime starttime) + { + try + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var jobRuns = await db.JobRuns.Where(x => x.StartDate >= starttime).Select(x => new { x.StartDate, x.EndDate, x.EndPosition }).OrderBy(y => y.StartDate).ToListAsync(); + double allvalues = 0; + graphDyeingValuesCollection.StartTime = starttime; + for ( int i = 0; i < jobRuns.Count; i++) + { + JobController.PushData(jobRuns[i].StartDate, allvalues); + if (i > 0) + { + allvalues += jobRuns[i-1].EndPosition; + } + graphDyeingValuesCollection.items.Add( new TimeToDyeValueItem(){ startTime = jobRuns[i].StartDate, endTime = jobRuns[i].EndDate, totalValue = allvalues }); + JobController.PushData(jobRuns[i].EndDate, allvalues); + } + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error loading machine counters."); + + } + } #endregion } } 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 686638870..8f2b49f9e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -446,7 +446,7 @@ <DockPanel> <touch:TouchButton Command="{Binding GoToJobCommand}" DockPanel.Dock="Right" VerticalAlignment="Top" Style="{StaticResource TangoLinkButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}"> <StackPanel Orientation="Vertical"> - <TextBlock Margin="5 0 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Bottom" Text="Go To Job"> + <TextBlock Margin="5 0 0 0" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Bottom" Text="Go To Job"> <TextBlock.Style> <Style TargetType="{x:Type TextBlock}"> <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> @@ -474,7 +474,7 @@ </touch:TouchButton> <touch:TouchButton DockPanel.Dock="Right" Visibility="{Binding ApplicationManager.IsInTechnicianMode,Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Top" Margin="0 0 20 0" Command="{Binding DisplayJobOutlineCommand}" Style="{StaticResource TangoLinkButton}" FontSize="{StaticResource TangoTitleFontSize}"> <StackPanel Orientation="Vertical"> - <TextBlock Margin="5 0 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Bottom">Display Job Outline</TextBlock> + <TextBlock Margin="5 0 0 0" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Bottom">Display Job Outline</TextBlock> <Rectangle Height="3" Fill="{StaticResource TangoPrimaryAccentBrush}" VerticalAlignment="Bottom" Margin="0 2 0 0"></Rectangle> </StackPanel> </touch:TouchButton> diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 9464b37ec..61d069847 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -847,13 +847,15 @@ namespace Tango.Emulations.Emulators double firstUnitStartPosition = request.Message.FirstUnitStartPosition; bool addedResume = firstUnitStartPosition <= 0; + bool bIsResumeProcess = firstUnitStartPosition > 0; for (int i = 0; i < units; i++) { - while (progress < unit_length + (i == units - 1 ? dryerLength : 0) && !_cancelJob) - { - var status = new PMR.Printing.JobStatus(); - status.Progress = progress; + // while (progress < unit_length + (!bIsResumeProcess && i == units - 1 ? dryerLength : 0) && !_cancelJob) + while (progress < unit_length + ( i == units - 1 ? dryerLength : 0) && !_cancelJob) + { + var status = new PMR.Printing.JobStatus(); + status.Progress = progress; if (!message_sent) { @@ -890,6 +892,7 @@ namespace Tango.Emulations.Emulators addedResume = true; progress = firstUnitStartPosition; } + //LogManager.Log($" Emulator Progress = {progress}, units = {units}"); double currentPosition = 0; double nextStopPosition = unit_length; diff --git a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs index 4579ff08c..5d62f4269 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs @@ -9,6 +9,7 @@ using Tango.BL.Enumerations; using Tango.Core; using Tango.Logging; using Tango.PMR.Printing; +using static Tango.Integration.Operation.AdditionalJobConfiguration; namespace Tango.Integration.Operation { @@ -139,6 +140,8 @@ namespace Tango.Integration.Operation /// </summary> public JobTicket JobTicket { get; private set; } + public ResumeConfiguration ResumeConfig { get; private set; } + #endregion #region Constructors @@ -155,13 +158,14 @@ namespace Tango.Integration.Operation /// Initializes a new instance of the <see cref="JobHandler"/> class. /// </summary> /// <param name="cancelAction">The cancel action.</param> - public JobHandler(Action cancelAction, Job job, JobTicket jobTicket, ProcessParametersTable processParameters, JobHandlerModes mode) : this() + public JobHandler(Action cancelAction, Job job, JobTicket jobTicket, ProcessParametersTable processParameters, JobHandlerModes mode, ResumeConfiguration resumeConfig = null) : this() { _mode = mode; ProcessParameters = processParameters; Job = job; JobTicket = jobTicket; + ResumeConfig = resumeConfig; foreach (var s in Job.Segments) { @@ -187,6 +191,11 @@ namespace Tango.Integration.Operation Status.RemainingProgress = Status.TotalProgress; Status.CurrentUnitSegments = _effectiveSegments.ToList(); Status.SettingUpTotalProgress = processParameters.DryerBufferLengthMeters; + if (resumeConfig != null && resumeConfig.GlobalStartPosition > 0) + { + Status.SettingUpTotalProgress = resumeConfig.GlobalStartPosition; + Status.CurrentUnitProgress = ResumeConfig.FirstUnitStartPosition; + } Status.TotalProgressMinusSettingUp = Job.LengthIncludingNumberOfUnits; Status.IsSettingUp = true; @@ -332,7 +341,7 @@ namespace Tango.Integration.Operation protected virtual void InvalidateJobProgress(JobStatus s) { JobStatus = s; - + if (_last_progress != s.Progress) { if (s.Progress <= PROGRESS_REPORT_RANGE_METERS || s.Progress >= Status.TotalProgress - PROGRESS_REPORT_RANGE_METERS) @@ -383,7 +392,16 @@ namespace Tango.Integration.Operation Status.IsSettingUp = false; } - Status.ProgressMinusSettingUp = s.Progress - this.Status.SettingUpTotalProgress; + if (ResumeConfig != null && ResumeConfig.GlobalStartPosition > 0) + { + Status.ProgressMinusSettingUp = s.Progress - ProcessParameters.DryerBufferLengthMeters; + //LogManager.Log($" Status.ProgressMinusSettingUp {Status.ProgressMinusSettingUp} progress = {s.Progress}"); + + } + else + { + Status.ProgressMinusSettingUp = s.Progress - this.Status.SettingUpTotalProgress; + } } int units = (int)Math.Max(Job.NumberOfUnits, 1); @@ -411,6 +429,15 @@ namespace Tango.Integration.Operation break; } } + else if(ResumeConfig != null && ResumeConfig.GlobalStartPosition > 0) + { + if (!Status.IsSettingUp && s.Progress <= previousUnitsLengthWithoutThis + unitLength + ProcessParameters.DryerBufferLengthMeters) + { + currentUnitProgress = s.Progress - previousUnitsLengthWithoutThis - ProcessParameters.DryerBufferLengthMeters; + //LogManager.Log($"currentUnitProgress before ={currentUnitProgress} progress = {s.Progress}"); + break; + } + } else if (s.Progress <= previousUnitsLengthWithoutThis + unitLength + Status.SettingUpProgress) { if (!Status.IsSettingUp) @@ -425,6 +452,7 @@ namespace Tango.Integration.Operation Status.CurrentUnit = currentUnit; Status.CurrentUnitProgress = currentUnitProgress; + //LogManager.Log($"CurrentUnit {Status.CurrentUnit} currentUnitProgress {Status.CurrentUnitProgress} "); Status.RemainingUnits = this.Job.NumberOfUnits - this.Status.CurrentUnit; @@ -444,7 +472,7 @@ namespace Tango.Integration.Operation { Status.Message = s.Message; } - + _lastStatusMessage = s.Message; @@ -527,7 +555,7 @@ namespace Tango.Integration.Operation Status.CurrentSegment = segment; } } - + //if (Status.Progress >= previousSegmentsLengthWithThis) if (Status.ProgressMinusSettingUp >= previousSegmentsLengthWithThis) { diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index d159b20bc..07d2c9881 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -2596,6 +2596,8 @@ namespace Tango.Integration.Operation /// <returns></returns> public Task<JobHandler> Print(Job job, ProcessParametersTable processParameters, AdditionalJobConfiguration config = null) { + //processParameters.DryerBufferLength = 10; //TODO: REMOVE !!! + return Task.Factory.StartNew(() => { if (config == null) config = new AdditionalJobConfiguration(); @@ -2916,7 +2918,7 @@ namespace Tango.Integration.Operation handler.CanCancel = true; LogManager.Log(ex, "Failed to cancel job."); } - }, clonedJob, ticket, processParameters, JobHandlingMode); + }, clonedJob, ticket, processParameters, JobHandlingMode, config.ResumeConfig); handler.StatusChanged += (x, s) => { @@ -3252,8 +3254,10 @@ namespace Tango.Integration.Operation if (config.ResumeConfig != null) { - resumePreProgress = config.ResumeConfig.GlobalStartPosition - request.FirstUnitStartPosition; + resumePreProgress = config.ResumeConfig.GlobalStartPosition - processParameters.DryerBufferLengthMeters; request.FirstUnitStartPosition = config.ResumeConfig.FirstUnitStartPosition; + //LogManager.Log($" resumePreProgress = {resumePreProgress}, GlobalStartPosition {config.ResumeConfig.GlobalStartPosition} FirstUnitStartPosition {request.FirstUnitStartPosition}"); + request.JobTicket.Length = (request.JobTicket.Length / Math.Max(request.JobTicket.NumberOfUnits, 1)) * (int)Math.Max(config.ResumeConfig.RemainingUnits, 1); request.JobTicket.NumberOfUnits = (uint)Math.Max(config.ResumeConfig.RemainingUnits, 1); } @@ -3262,7 +3266,7 @@ namespace Tango.Integration.Operation if (!completed) { response.Message.Status.Progress += resumePreProgress; - + handler.RaiseStatusReceived(response.Message.Status); _last_job_status = handler.Status; |
