diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-18 12:02:21 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-18 12:02:21 +0300 |
| commit | ead5472228247e3a3f3da2ba213815ee4d8e2e26 (patch) | |
| tree | de0bd04eece09fa895a21cf394efdbe26ba91692 /Software/Visual_Studio | |
| parent | 8e77a83a73410f388b3a879c3082eb7bf6064657 (diff) | |
| download | Tango-ead5472228247e3a3f3da2ba213815ee4d8e2e26.tar.gz Tango-ead5472228247e3a3f3da2ba213815ee4d8e2e26.zip | |
Bugs in Overview: Copies in Progress run (*4) and if job completed - length ( was 0).
Diffstat (limited to 'Software/Visual_Studio')
4 files changed, 51 insertions, 3 deletions
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 3be7a8818..377d02d81 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs @@ -37,7 +37,7 @@ namespace Tango.PPC.UI.Converters var currentProgressBy4Spools = (double)currentProgresslength * 4 ; int coeff = (int)currentProgressBy4Spools / (int)totalBy4Spools; - var progressCurrent = coeff == 0 ? currentProgressBy4Spools : currentProgressBy4Spools % (coeff * totalBy4Spools);//show for progress + var progressCurrent = (coeff == 0 || coeff == 1) ? currentProgressBy4Spools : currentProgressBy4Spools % (coeff * totalBy4Spools);//show for progress if (forOneSpool) { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs new file mode 100644 index 000000000..054ccd3df --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs @@ -0,0 +1,40 @@ +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 ProgressUnitSpoolConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + try + { + if (values.Count() == 1)//may be added count of spools + { + int CurrentUnit = System.Convert.ToInt16(values[0]); + CurrentUnit +=1; + var totalBy4Spools = (double)CurrentUnit * 4;// spools ; + + return totalBy4Spools.ToString(); + + } + + return "-"; + } + catch + { + return "-"; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} 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 e02dba00e..51600b0e8 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\LiquidTypeToBrushConverter.cs" /> <Compile Include="Converters\MidTankLevelToElementRectConverter.cs" /> <Compile Include="Converters\ProgressLengthSpoolConverter.cs" /> + <Compile Include="Converters\ProgressUnitSpoolConverter.cs" /> <Compile Include="Converters\ProgressWeightSpoolConverter.cs" /> <Compile Include="Dialogs\BitResultsView.xaml.cs"> <DependentUpon>BitResultsView.xaml</DependentUpon> @@ -961,7 +962,7 @@ if $(ConfigurationName) == Eureka copy /Y "$(ProjectDir)Intro.wmv" "$(TargetDir) </PropertyGroup> <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> <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/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index d9b37ac85..666fffe72 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -24,6 +24,7 @@ <localConverters:ProgressWeightSpoolConverter x:Key="ProgressWeightSpoolConverter"/> <localConverters:LiquidTypeToBrushConverter x:Key="LiquidTypeToBrushConverter"/> <localConverters:MidTankLevelToElementRectConverter x:Key="MidTankLevelToElementRectConverter"/> + <localConverters:ProgressUnitSpoolConverter x:Key="ProgressUnitSpoolConverter"/> <Style x:Key="LinkRoundButtonStyle" TargetType="{x:Type touch:TouchButton}"> <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter> @@ -635,7 +636,13 @@ <Image Source="../Images/Job Issues/job_copies.png" Stretch="None" VerticalAlignment="Top"/> <StackPanel Orientation="Vertical" Margin="15 0 0 0"> <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}">Copies</TextBlock> - <TextBlock Text="{Binding RunningJobStatus.CurrentUnit,TargetNullValue='-', FallbackValue='-'}" FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"></TextBlock> + <TextBlock FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"> + <TextBlock.Text> + <MultiBinding Converter="{StaticResource ProgressUnitSpoolConverter}" TargetNullValue='-' FallbackValue='-' > + <Binding Path="RunningJobStatus.CurrentUnit" Mode="OneWay"/> + </MultiBinding> + </TextBlock.Text> + </TextBlock> </StackPanel> </StackPanel> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> |
