diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-22 18:54:00 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-22 18:54:00 +0300 |
| commit | b981d43669a2cdcd9f7971e897ded9f1422f5b31 (patch) | |
| tree | b42b4dcf7a74788d0ae5388c96311a9ecb9c8047 /Software/Visual_Studio/FSE | |
| parent | 7b97669957c3de66ffbad0dba26db1396c679a48 (diff) | |
| download | Tango-b981d43669a2cdcd9f7971e897ded9f1422f5b31.tar.gz Tango-b981d43669a2cdcd9f7971e897ded9f1422f5b31.zip | |
FSE, update Job length for Eureka. GeneralInformation in PPC ( about) - added rows.
Related Work Items: #8423
Diffstat (limited to 'Software/Visual_Studio/FSE')
12 files changed, 150 insertions, 10 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs index 24ddc80bf..3d616f957 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs @@ -29,6 +29,7 @@ namespace Tango.FSE.Statistics.Models public JobRunExtendedInfo ExtendedInfo { get; set; } public bool IsAdvancedMode { get; set; } public VectorFineTuningRunModel FineTuningModel { get; set; } + public bool IsEureka { get; set; } public bool IsFineTuning { @@ -163,7 +164,18 @@ namespace Tango.FSE.Statistics.Models public String LogicalLength { - get { return JobRun.NumberOfUnits > 1 ? $"{JobRun.JobLogicalLength} x{JobRun.NumberOfUnits}" : JobRun.JobLogicalLength.ToString(); } + get { var length = IsEureka ? JobRun.JobLogicalLength * 4 : JobRun.JobLogicalLength; + return JobRun.NumberOfUnits > 1 ? $"{length} x{JobRun.NumberOfUnits}" : length.ToString(); } + } + + public double JobLength + { + get { return IsEureka ? JobRun.JobLength * 4 : JobRun.JobLength; } + } + + public double EndPosition + { + get { return IsEureka ? JobRun.EndPosition * 4 : JobRun.EndPosition; } } public String FineTuningMeasured diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs index d77b0b5a1..ae4444f06 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs @@ -422,6 +422,7 @@ namespace Tango.FSE.Statistics.ViewModels stop.ThreadName = rmlName; stop.IsAdvancedMode = !BuildProvider.IsTwineRSM && CurrentUser.HasRole(Roles.FSEAdvancedTechnician); stop.FineTuningModel = fineTuningModel; + stop.IsEureka = MachineProvider.MachineOperator.MachineType == MachineTypes.Eureka; if (fineTuningModel != null) { @@ -735,11 +736,11 @@ namespace Tango.FSE.Statistics.ViewModels model.JobName = stop.JobRun.JobName; model.JobKind = ((JobDesignations)stop.JobRun.JobDesignation).ToDescription(); model.Thread = stop.ThreadName; - model.Length = ((int)stop.JobRun.JobLogicalLength).ToString(); + model.Length = stop.LogicalLength; model.NumberOfUnits = stop.JobRun.NumberOfUnits.ToString(); model.StartTime = stop.JobRun.StartDate.ToLocalTime().ToString(); model.Duration = stop.Duration.ToStringUnlimitedHours(); - model.EndPosition = stop.JobRun.EndPosition.ToString(); + model.EndPosition = stop.EndPosition.ToString(); model.Status = ((JobRunStatus)stop.JobRun.Status).ToString(); model.SegmentIndex = stop.SegmentIndex.ToString(); model.Offset = stop.StartMeters.ToString(); diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Views/MainView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Views/MainView.xaml index 5f0ceaa5a..88b460ab1 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Views/MainView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Views/MainView.xaml @@ -138,13 +138,13 @@ <TextBlock> <Run>Actual Length:</Run> <LineBreak/> - <Run Text="{Binding Items[0].Items[0].JobRun.JobLength}"></Run> + <Run Text="{Binding Items[0].Items[0].JobLength, Mode=OneWay}"></Run> </TextBlock> </TextBlock.ToolTip> </TextBlock> <TextBlock Text="{Binding Items[0].Items[0].JobRun.StartDate,Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" VerticalAlignment="Center" Width="120"></TextBlock> <TextBlock Text="{Binding Items[0].Items[0].Duration,Mode=OneWay,Converter={StaticResource TotalDyeTimeConverter}}" VerticalAlignment="Center" Width="100"></TextBlock> - <TextBlock Text="{Binding Items[0].Items[0].JobRun.EndPosition,StringFormat=N1}" VerticalAlignment="Center" Width="80"></TextBlock> + <TextBlock Text="{Binding Items[0].Items[0].EndPosition,StringFormat=N1}" VerticalAlignment="Center" Width="80"></TextBlock> </StackPanel> <Grid Visibility="{Binding IsAdvancedMode,Converter={StaticResource BooleanToVisibilityConverter}}" DataContext="{Binding Items[0].Items[0]}" Width="250" Margin="0 0 50 5" HorizontalAlignment="Right" VerticalAlignment="Bottom"> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobRingProgress.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobRingProgress.xaml index d0121afa5..b683ae0d2 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobRingProgress.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobRingProgress.xaml @@ -5,9 +5,14 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:behaviors="clr-namespace:Tango.FSE.Common.Behaviors" xmlns:local="clr-namespace:Tango.FSE.Common.Controls" + xmlns:localConverters="clr-namespace:Tango.FSE.Common.Converters" xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="450" x:Name="control"> + <UserControl.Resources> + <localConverters:ProgressLengthSpoolConverter x:Key="ProgressLengthSpoolConverter"/> + </UserControl.Resources> + <Grid Opacity="0.7"> <Viewbox> <Grid> @@ -50,10 +55,31 @@ <TextBlock Margin="5 0 0 0" VerticalAlignment="Center">Completed</TextBlock> </StackPanel> - <TextBlock FontWeight="Light" FontSize="25" Margin="0 10 0 0" HorizontalAlignment="Center"> + <TextBlock FontWeight="Light" FontSize="25" Margin="0 10 0 0" HorizontalAlignment="Center" Visibility="Collapsed"> <Run Text="{Binding ElementName=control,Path=RunningJobStatus.ProgressMinusSettingUp,StringFormat=0,FallbackValue=0}"></Run><Run Text="/" /><Run Text="{Binding RunningJobStatus.TotalProgressMinusSettingUp,StringFormat=0,FallbackValue=0}"/> <Run FontSize="16">m</Run> </TextBlock> + <StackPanel Orientation="Horizontal" Margin="0 10 0 0" HorizontalAlignment="Center" Visibility="Visible"> + <TextBlock FontWeight="Light" FontSize="25" VerticalAlignment="Center" > + <TextBlock.Text> + <MultiBinding Converter="{StaticResource ProgressLengthSpoolConverter}" StringFormat="0.#" TargetNullValue='-' FallbackValue='0' Mode="OneWay"> + <Binding Path="RunningJobStatus.TotalProgressMinusSettingUp" /> + <Binding Path="IsEureka"/> + <Binding Path="RunningJobStatus.ProgressMinusSettingUp" /> + </MultiBinding> + </TextBlock.Text> + </TextBlock> + <TextBlock FontWeight="Light" FontSize="25" VerticalAlignment="Center" Text="/"></TextBlock> + <TextBlock FontWeight="Light" FontSize="25" VerticalAlignment="Center" > + <TextBlock.Text> + <MultiBinding Converter="{StaticResource ProgressLengthSpoolConverter}" StringFormat="0" TargetNullValue='-' FallbackValue='0' Mode="OneWay"> + <Binding Path="RunningJobStatus.TotalProgressMinusSettingUp"/> + <Binding Path="IsEureka"/> + </MultiBinding> + </TextBlock.Text> + </TextBlock> + <TextBlock FontWeight="Light" FontSize="25" VerticalAlignment="Center" Text=" m"></TextBlock> + </StackPanel> </StackPanel> <StackPanel Height="90" Visibility="{Binding ElementName=control,Path=RunningJobStatus.IsSettingUp,Converter={StaticResource BooleanToVisibilityConverter}}"> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobRingProgress.xaml.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobRingProgress.xaml.cs index 5e0f28419..d8374573c 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobRingProgress.xaml.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobRingProgress.xaml.cs @@ -40,8 +40,15 @@ namespace Tango.FSE.Common.Controls public static readonly DependencyProperty IsRunningProperty = DependencyProperty.Register("IsRunning", typeof(bool), typeof(RunningJobRingProgress), new PropertyMetadata(false)); + public bool IsEureka + { + get { return (bool)GetValue(IsEurekaProperty); } + set { SetValue(IsEurekaProperty, value); } + } + public static readonly DependencyProperty IsEurekaProperty = + DependencyProperty.Register("IsEureka", typeof(bool), typeof(RunningJobRingProgress), new PropertyMetadata(false)); - + public RunningJobRingProgress() { InitializeComponent(); diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobViewer.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobViewer.xaml index 2cd4fa7ad..faf5e072f 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobViewer.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobViewer.xaml @@ -6,9 +6,14 @@ xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:local="clr-namespace:Tango.FSE.Common.Controls" + xmlns:localConverters="clr-namespace:Tango.FSE.Common.Converters" mc:Ignorable="d" d:DesignHeight="120" d:DesignWidth="800"> + <UserControl.Resources> + <localConverters:ProgressLengthSpoolConverter x:Key="ProgressLengthSpoolConverter"/> + </UserControl.Resources> + <DockPanel> <Canvas Height="50" Margin="0" DockPanel.Dock="Top"> <StackPanel> @@ -132,7 +137,15 @@ </Style.Triggers> </Style> </TextBlock.Style> - <Run Text="{Binding LengthWithFactor,Mode=OneWay,StringFormat=N0}"></Run><Run Text="m"></Run> + <Run > + <Run.Text> + <MultiBinding Converter="{StaticResource ProgressLengthSpoolConverter}" StringFormat="N0" TargetNullValue=' ' FallbackValue='0' Mode="OneWay"> + <Binding Path="LengthWithFactor"/> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="IsEureka"/> + </MultiBinding> + </Run.Text> + </Run> + <Run Text="m"></Run> </TextBlock> </Grid> </DataTemplate> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobViewer.xaml.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobViewer.xaml.cs index 4a970ffda..459728264 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobViewer.xaml.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobViewer.xaml.cs @@ -55,6 +55,14 @@ namespace Tango.FSE.Common.Controls public static readonly DependencyProperty JobProperty = DependencyProperty.Register("Job", typeof(Job), typeof(RunningJobViewer), new PropertyMetadata(null)); + public bool IsEureka + { + get { return (bool)GetValue(IsEurekaProperty); } + set { SetValue(IsEurekaProperty, value); } + } + public static readonly DependencyProperty IsEurekaProperty = + DependencyProperty.Register("IsEureka", typeof(bool), typeof(RunningJobViewer), new PropertyMetadata(false)); + /// <summary> /// Gets or sets the running job status. /// </summary> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/ProgressLengthSpoolConverter.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/ProgressLengthSpoolConverter.cs new file mode 100644 index 000000000..10c20c171 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/ProgressLengthSpoolConverter.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; +using Tango.BL.Entities; + +namespace Tango.FSE.Common.Converters +{ + public class ProgressLengthSpoolConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + try + { + if (values.Count() == 2) + { + double length = System.Convert.ToDouble(values[0]); + bool isEureka = System.Convert.ToBoolean(values[1]); + int jobSpools = 1; + if (isEureka) + jobSpools = 4; + var totalBy4Spools = (double)length * jobSpools;// spools 4; + return totalBy4Spools; + + } + if (values.Count() == 3) + { + double length = System.Convert.ToDouble(values[0]); + var segment = values[1] as Segment; + bool isEureka = System.Convert.ToBoolean(values[1]); + int jobSpools = 1; + if (isEureka) + jobSpools = 4; + double currentProgresslength = System.Convert.ToDouble(values[2]); + + var totalBySpools = (double)length * jobSpools; + var currentProgressBySpools = (double)currentProgresslength * jobSpools; + + int coeff = (int)currentProgressBySpools / (int)totalBySpools; + var progressCurrent = (coeff == 0 || coeff == 1) ? currentProgressBySpools : currentProgressBySpools % (coeff * totalBySpools);//show for progress + + return progressCurrent; + } + return "-"; + } + catch + { + return "-"; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj index 82d62ff14..8ef3551d5 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj @@ -220,6 +220,7 @@ <Compile Include="Converters\LiquidTypeToShortNameConverter.cs" /> <Compile Include="Converters\NanolitersToLitersConverter.cs" /> <Compile Include="Converters\ObjectToJsonConverter.cs" /> + <Compile Include="Converters\ProgressLengthSpoolConverter.cs" /> <Compile Include="Converters\TimeSpanHumanizeConverter.cs" /> <Compile Include="Converters\TotalDyeTimeConverter.cs" /> <Compile Include="Converters\TotalMetersConverter.cs" /> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobProgressRingTileView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobProgressRingTileView.xaml index 62e7c4798..c021b0a15 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobProgressRingTileView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobProgressRingTileView.xaml @@ -9,6 +9,6 @@ mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:RemoteJobProgressRingTile, IsDesignTimeCreatable=False}"> <Grid Margin="30"> - <controls:RunningJobRingProgress RunningJobStatus="{Binding RunningJobStatus}" IsRunning="{Binding IsRunning}" /> + <controls:RunningJobRingProgress RunningJobStatus="{Binding RunningJobStatus}" IsRunning="{Binding IsRunning}" IsEureka ="{Binding IsEureka}" /> </Grid> </UserControl> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTile.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTile.cs index 650818c22..453a0892e 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTile.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTile.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Media; using Tango.BL.Entities; +using Tango.BL.Enumerations; using Tango.FSE.Common; using Tango.Integration.Operation; using Tango.PPC.Shared.Jobs; @@ -42,6 +43,15 @@ namespace Tango.FSE.UI.Tiles.RemoteJob set { _isRunning = value; RaisePropertyChangedAuto(); } } + private bool _isEureka; + + public bool IsEureka + { + get { return _isEureka; } + set { _isEureka = value; RaisePropertyChangedAuto(); } + } + + public RemoteJobTile() { Name = "Remote Job"; @@ -113,6 +123,7 @@ namespace Tango.FSE.UI.Tiles.RemoteJob Handler.StatusChanged += Handler_StatusChanged; Job = e.JobHandler.Job; IsRunning = true; + IsEureka = MachineProvider.MachineOperator.MachineType == MachineTypes.Eureka; } private void Handler_StatusChanged(object sender, RunningJobStatus status) diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTileView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTileView.xaml index ee05314ce..1323c9298 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTileView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTileView.xaml @@ -10,7 +10,7 @@ <Grid TextElement.Foreground="{StaticResource FSE_PrimaryAccentBrush}"> <Viewbox Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=ActualWidth}"> <Border Background="#292929" CornerRadius="10" VerticalAlignment="Bottom" Padding="20 0" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=ActualWidth}"> - <controls:RunningJobViewer IsRunning="{Binding IsRunning}" Job="{Binding Job}" RunningJobStatus="{Binding RunningJobStatus}" IsActive="True" Margin="30 10" Height="90" /> + <controls:RunningJobViewer IsRunning="{Binding IsRunning}" Job="{Binding Job}" RunningJobStatus="{Binding RunningJobStatus}" IsEureka="{Binding IsEureka}" IsActive="True" Margin="30 10" Height="90" /> </Border> </Viewbox> </Grid> |
