diff options
| author | Roy Ben-Shabat <Roy.mail.net@gmail.com> | 2023-07-16 12:09:56 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy.mail.net@gmail.com> | 2023-07-16 12:09:56 +0300 |
| commit | ac39b49638cb1b2f3602f51c7f5a1cde7e0df673 (patch) | |
| tree | d3c6cdf0fa913cc07cbfc8c9cf8c065d1bce0dae /Software/Visual_Studio/PPC | |
| parent | 48fe4a21077ae4ec4b78e1b3fd76934a20b58dda (diff) | |
| parent | a353bf2a5fae2eb8d81c342a5c5dce0e3de2b086 (diff) | |
| download | Tango-ac39b49638cb1b2f3602f51c7f5a1cde7e0df673.tar.gz Tango-ac39b49638cb1b2f3602f51c7f5a1cde7e0df673.zip | |
Merge branch 'eureka' of https://twinetfs.visualstudio.com/Tango/_git/Tango into eureka
Diffstat (limited to 'Software/Visual_Studio/PPC')
39 files changed, 1143 insertions, 144 deletions
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 0e72c6aa0..99b78d7ec 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 @@ -548,7 +548,18 @@ <TextBlock FontSize="{StaticResource TangoSmallFontSize}" FontWeight="SemiBold" Margin="10 0 0 -5" HorizontalAlignment="Left" >Correction</TextBlock> <Border Grid.Row="1" Height="220" Margin="0 10 0 0" CornerRadius="0 0 0 0" BorderThickness="0" BorderBrush="{StaticResource TangoGrayBrush}" Background="{Binding VisualCorrectionModel.ManualColorBrush}" > - <UniformGrid Rows="3" Columns="1" VerticalAlignment="Bottom" Background="Transparent"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="1*"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + <StackPanel Grid.Row="0" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding VisualCorrectionModel.IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}"> + <Image Margin="30 0 24 0" Stretch="Fill" Width="47" Height="43" RenderOptions.BitmapScalingMode="Fant" Source="../Images/ColorSelection/Exclamation.png" HorizontalAlignment="Center"></Image> + <!--<Border Margin=" 0 10 0 0" MinWidth="115" Height="31" Background="{StaticResource TangoDarkForegroundBrush}" CornerRadius="2"> + <TextBlock Margin="10 0" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoSmallFontSize}" FontWeight="SemiBold" Text="This color is not supported." ></TextBlock> + </Border>--> + </StackPanel> + <UniformGrid Grid.Row="1" Rows="3" Columns="1" VerticalAlignment="Bottom" Background="Transparent"> <TextBlock FontWeight="Medium" Margin="10 10 0 0" VerticalAlignment="Center" Foreground="{Binding VisualCorrectionModel.ManualColorBrush, Converter={StaticResource ColorContrastConverter}}" FontSize="{StaticResource TangoSmallFontSize}"> <Run Text="L:" ></Run> <Run Text="{Binding VisualCorrectionModel.L, StringFormat={}{0:F2}}"></Run> @@ -562,7 +573,8 @@ <Run Text="{Binding VisualCorrectionModel.B, StringFormat={}{0:F2}}"></Run> </TextBlock> </UniformGrid> - </Border> + </Grid> + </Border> </StackPanel> <StackPanel Orientation="Vertical" Grid.Column="2" Grid.Row="1" Margin="0 10 0 0" Visibility="{Binding IsTargetVisible, Converter={StaticResource BooleanToVisibilityConverter}, Mode=TwoWay}"> <TextBlock FontSize="{StaticResource TangoSmallFontSize}" FontWeight="SemiBold" Margin="10 0 0 -5" HorizontalAlignment="Left" >Target</TextBlock> 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 e473fa420..b9149b81f 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 @@ -1319,6 +1319,7 @@ namespace Tango.PPC.Jobs.Dialogs ActiveLogModel.VectorCorrectionL = VisualCorrectionModel.L; ActiveLogModel.VectorCorrectionA = VisualCorrectionModel.A; ActiveLogModel.VectorCorrectionB = VisualCorrectionModel.B; + VisualCorrectionModel.IsOutOfGamut = IsOutOfGammot(); TestCommand.RaiseCanExecuteChanged(); ByPassTestCommand.RaiseCanExecuteChanged(); @@ -1333,6 +1334,7 @@ namespace Tango.PPC.Jobs.Dialogs ActiveLogModel.VectorCorrectionL = VisualCorrectionModel.L; ActiveLogModel.VectorCorrectionA = VisualCorrectionModel.A; ActiveLogModel.VectorCorrectionB = VisualCorrectionModel.B; + VisualCorrectionModel.IsOutOfGamut = IsOutOfGammot(); TestCommand.RaiseCanExecuteChanged(); ByPassTestCommand.RaiseCanExecuteChanged(); } @@ -1347,10 +1349,25 @@ namespace Tango.PPC.Jobs.Dialogs ActiveLogModel.VectorCorrectionL = VisualCorrectionModel.L; ActiveLogModel.VectorCorrectionA = VisualCorrectionModel.A; ActiveLogModel.VectorCorrectionB = VisualCorrectionModel.B; + VisualCorrectionModel.IsOutOfGamut = IsOutOfGammot(); TestCommand.RaiseCanExecuteChanged(); ByPassTestCommand.RaiseCanExecuteChanged(); } + private bool IsOutOfGammot() + { + BrushStopModel.ColorSpace = ColorSpaces.LAB; + BrushStopModel.PreventPropertyUpdate = true; + BrushStopModel.L = ActiveLogModel.VectorCorrectionL; + BrushStopModel.A = ActiveLogModel.VectorCorrectionA; + BrushStopModel.B = ActiveLogModel.VectorCorrectionB; + BrushStopModel.PreventPropertyUpdate = false; + BrushStopModel.IsOutputOfGamut(ColorSpaces.LAB); + + return BrushStopModel.IsOutOfGamut; + + } + #endregion #region Job 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 d415dbb79..5464aa5ed 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 @@ -1796,6 +1796,25 @@ namespace Tango.PPC.Jobs.Models } } + public void IsOutputOfGamut(ColorSpaces colorSpace) + { + try + { + BrushStop stop = CreateBrushStop(colorSpace); + Configuration configuration = SegmentModel.Job.Machine.Configuration; + Rml rml = SegmentModel.Job.Rml; + IsOutOfGamut = _converter.IsOutOfGamut(stop, configuration, rml); + } + catch (Exception ex) + { + LogManager.Log(ex, "An error occurred while trying to test IsOutputOfGammut from conversion engine." + ex); + BestMatchColor = Color.FromRgb((byte)Red, (byte)Green, (byte)Blue); + } + finally + { + IsBusy = false; + } + } #endregion } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/VisualOffsetModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/VisualOffsetModel.cs index a0b6156a3..74651992e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/VisualOffsetModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/VisualOffsetModel.cs @@ -237,7 +237,24 @@ namespace Tango.PPC.Jobs.Models return new SolidColorBrush() { Color = Color.FromRgb((byte)rgb.R, (byte)rgb.G, (byte)rgb.B) }; } } - + + private bool _isOutOfGamut; + /// <summary> + /// Gets or sets a value indicating whether this instance is out of gamut. + /// </summary> + public bool IsOutOfGamut + { + get { return _isOutOfGamut; } + set + { + if (_isOutOfGamut != value) + { + _isOutOfGamut = value; + RaisePropertyChangedAuto(); + } + } + } + #endregion public VisualOffsetModel() @@ -248,7 +265,9 @@ namespace Tango.PPC.Jobs.Models MaxChroma = new VisualLCHOffset(TypeColorCorrection.Chroma, 1); MinHue = new VisualLCHOffset(TypeColorCorrection.Hue, -1); MaxHue = new VisualLCHOffset(TypeColorCorrection.Hue, 1); - + IsOutOfGamut = false; + + } public void InitLAB(double l, double a, double b, double c, double h) @@ -292,6 +311,7 @@ namespace Tango.PPC.Jobs.Models B = b; C = last_LCH.C; H = last_LCH.h; + IsOutOfGamut = 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 613200c02..fa8fc0b9d 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 @@ -258,7 +258,7 @@ <Border Margin="20 0 0 0" BorderThickness="1" Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Visibility="{Binding ElementName=segmentsGrid, Path=DataContext.IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <touch:TouchNumericTextBox Margin="20 0 0 0" Width="192" FocusSelectionMode="SelectAll" HorizontalAlignment="Left" HideUnderline="True" VerticalAlignment="Center" Value="{Binding Length, UpdateSourceTrigger=LostFocus}" VerticalContentAlignment="Center" - StringFormat="0.0" AutoCalculateJogStep="False" + StringFormat="N1" AutoCalculateJogStep="False" HasDecimalPoint="True" Minimum="1" Maximum="1000000" KeyboardContainer="{Binding ElementName=Container}" FontSize="18" ValueChangedEnd="Length_ValueChanged" @@ -1029,7 +1029,7 @@ <Border Margin="140 0 0 0" BorderThickness="1" Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Visibility="{Binding ElementName=segmentsGrid, Path=DataContext.IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <touch:TouchNumericTextBox Margin="20 0 0 0" Width="192" FocusSelectionMode="SelectAll" HorizontalAlignment="Left" HideUnderline="True" VerticalAlignment="Center" Value="{Binding Length, UpdateSourceTrigger=LostFocus}" VerticalContentAlignment="Center" - StringFormat="0.0" AutoCalculateJogStep="False" + StringFormat='#,0.0' AutoCalculateJogStep="False" HasDecimalPoint="True" Minimum="1" Maximum="1000000" KeyboardContainer="{Binding ElementName=Container}" FontSize="18" ValueChangedEnd="Length_ValueChanged" @@ -1039,7 +1039,7 @@ <Border Margin="140 0 0 0" BorderThickness="1" Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Visibility="{Binding ElementName=segmentsGrid, Path=DataContext.IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}"> <touch:TouchNumericTextBox Margin="20 0 0 0" Width="192" FocusSelectionMode="SelectAll" HorizontalAlignment="Left" HideUnderline="True" VerticalAlignment="Center" Value="{Binding Weight, UpdateSourceTrigger=LostFocus}" VerticalContentAlignment="Center" - StringFormat="0.0" AutoCalculateJogStep="False" + StringFormat="#,0.0" AutoCalculateJogStep="False" HasDecimalPoint="True" Minimum="0" Maximum="100000" KeyboardContainer="{Binding ElementName=Container}" FontSize="18" RippleBrush="Transparent"/> @@ -1192,19 +1192,19 @@ <Border Grid.Row="2" Margin="0 0 0 0" BorderThickness="0"> <touch:TouchExpander x:Name="summaryExpander" IsExpanded="{Binding IsSummaryOpened, Mode=TwoWay}" Grid.Row="3" Margin="15 0 15 0 " FontSize="{StaticResource TangoTitleFontSize}" BorderThickness="0" Style="{StaticResource TouchRoundedExpander}" CornerRadius="20 20 0 0" Padding="10" IsTabStop="False" > <touch:TouchExpander.Header> - <DockPanel Height="84"> + <DockPanel Height="80"> <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0" VerticalAlignment="Center" > <StackPanel Orientation="Horizontal" Visibility="{Binding IsSummaryOpened, Converter={StaticResource BooleanToVisibilityInverseConverter}, Mode=TwoWay}"> <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <Run Text="Copy:" FontWeight="Normal"></Run> - <Run Text="{Binding JobModel.Length,Mode=OneWay,StringFormat=0.##}" FontWeight="DemiBold"/> + <Run Text="{Binding JobModel.Length,Mode=OneWay,StringFormat='#,0.##'}" FontWeight="DemiBold"/> <Run Text="m" FontWeight="DemiBold"></Run> </TextBlock> <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}"> <Run Text="Copy:" FontWeight="Normal"></Run> <Run FontWeight="DemiBold"> <Run.Text> - <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="0.##" > + <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" > <Binding Path="JobModel.Length" Mode="OneWay"/> <Binding Path="JobModel.GramPerLength" Mode="OneWay"/> </MultiBinding> @@ -1214,14 +1214,14 @@ </TextBlock> <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <Run Text="Total:" FontWeight="Normal"></Run> - <Run Text="{Binding JobModel.LengthIncludingNumberOfUnitsAndSpools,Mode=OneWay, StringFormat=0.##}" FontWeight="Bold"/> + <Run Text="{Binding JobModel.LengthIncludingNumberOfUnitsAndSpools,Mode=OneWay, StringFormat='#,0.##'}" FontWeight="Bold"/> <Run Text="m" FontWeight="Bold"></Run> </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> - <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="0.##" > + <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" > <Binding Path="JobModel.LengthIncludingNumberOfUnitsAndSpools" Mode="OneWay"/> <Binding Path="JobModel.GramPerLength" Mode="OneWay"/> </MultiBinding> @@ -1258,14 +1258,14 @@ <TextBlock Text="Total:" FontWeight="Bold" FontSize="{StaticResource TangoTitleFontSize}" ></TextBlock> <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <Run Text="Copy:" FontWeight="Normal"></Run> - <Run Text="{Binding JobModel.Length,Mode=OneWay,StringFormat=0.##}" FontWeight="Bold"/> + <Run Text="{Binding JobModel.Length,Mode=OneWay,StringFormat='#,0.##'}" FontWeight="Bold"/> <Run Text="m" FontWeight="Bold"></Run> </TextBlock> <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}"> <Run Text="Copy:" FontWeight="Normal"></Run> <Run FontWeight="Bold"> <Run.Text> - <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="0.##" > + <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" > <Binding Path="JobModel.Length" Mode="OneWay"/> <Binding Path="JobModel.GramPerLength" Mode="OneWay"/> </MultiBinding> @@ -1279,14 +1279,14 @@ </TextBlock> <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <Run Text="Total:" FontWeight="Normal"></Run> - <Run Text="{Binding JobModel.LengthIncludingNumberOfUnitsAndSpools,Mode=OneWay, StringFormat=0.##}" FontWeight="Bold"/> + <Run Text="{Binding JobModel.LengthIncludingNumberOfUnitsAndSpools,Mode=OneWay, StringFormat='#,0.##'}" FontWeight="Bold"/> <Run Text="m" FontWeight="Bold"></Run> </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.##" > + <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" > <Binding Path="JobModel.LengthIncludingNumberOfUnitsAndSpools" Mode="OneWay"/> <Binding Path="JobModel.GramPerLength" Mode="OneWay"/> </MultiBinding> @@ -1307,14 +1307,14 @@ </TextBlock> <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <Run Text="Total:" FontWeight="Normal"></Run> - <Run Text="{Binding JobModel.LengthIncludingNumberOfUnits,Mode=OneWay, StringFormat=0.##}" FontWeight="Bold"/> + <Run Text="{Binding JobModel.LengthIncludingNumberOfUnits,Mode=OneWay, StringFormat='#,0.##'}" FontWeight="Bold"/> <Run Text="m" FontWeight="Bold"></Run> </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.##" > + <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" > <Binding Path="JobModel.LengthIncludingNumberOfUnits" Mode="OneWay"/> <Binding Path="JobModel.GramPerLength" Mode="OneWay"/> </MultiBinding> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml index 0e9e6d617..d3fdedde5 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml @@ -264,7 +264,7 @@ <DataTemplate> <TextBlock IsHitTestVisible="False"> <TextBlock.Text> - <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="0.0" TargetNullValue='0' FallbackValue='0' Mode="OneWay"> + <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="#,0.0" TargetNullValue='0' FallbackValue='0' Mode="OneWay"> <Binding Path="LengthIncludingNumberOfUnits" Mode="OneWay"/> <Binding Path="DataContext.BuildProvider.IsEureka" Mode="OneWay" RelativeSource="{RelativeSource AncestorType=UserControl}"/> <Binding Path="Spools" Mode="OneWay"/> 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 9b22fcdb5..a76096725 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 @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -108,10 +109,27 @@ namespace Tango.PPC.Storage.ViewModels _allow_exit = false; _selectedItem = null; - if (StorageProvider.IsConnected && StorageProvider.Drive != null) + if (BuildProvider.IsEureka) + { + if (Settings.StorageRootPath == null) + { + Settings.StorageRootPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "Storage"); + Directory.CreateDirectory(Settings.StorageRootPath); + } + } + + if ((StorageProvider.IsConnected && StorageProvider.Drive != null) || Settings.StorageRootPath != null) { CurrentPath = null; - CurrentPath = StorageProvider.Drive.RootDirectory.FullName; + + if (Settings.StorageRootPath != null && Directory.Exists(Settings.StorageRootPath)) + { + CurrentPath = Settings.StorageRootPath; + } + else + { + CurrentPath = StorageProvider.Drive.RootDirectory.FullName; + } if (Request.Intent == StorageNavigationIntent.SaveFile) { @@ -143,13 +161,16 @@ namespace Tango.PPC.Storage.ViewModels /// <param name="e">The drive info.</param> private void StorageProvider_StorageConnected(object sender, System.IO.DriveInfo e) { - InvokeUI(async () => + if (!BuildProvider.IsEureka) { - if (await NotificationProvider.ShowQuestion("Storage device inserted. Do you want to browse?")) + InvokeUI(async () => { - await NavigationManager.NavigateTo<StorageModule>(); - } - }); + if (await NotificationProvider.ShowQuestion("Storage device inserted. Do you want to browse?")) + { + await NavigationManager.NavigateTo<StorageModule>(); + } + }); + } } /// <summary> @@ -159,21 +180,26 @@ namespace Tango.PPC.Storage.ViewModels /// <param name="e">The drive info.</param> private void StorageProvider_StorageDisconnected(object sender, System.IO.DriveInfo e) { - InvokeUI(async () => + if (!BuildProvider.IsEureka) { - if (IsVisible) + InvokeUI(async () => { - _allow_exit = true; - await NotificationProvider.ShowError("Storage device disconnected."); - await NavigationManager.NavigateBack(); - CurrentPath = null; - } - }); + if (IsVisible) + { + _allow_exit = true; + await NotificationProvider.ShowError("Storage device disconnected."); + await NavigationManager.NavigateBack(); + CurrentPath = null; + } + }); + } } public override Task<bool> OnNavigateBackRequest() { - if (_allow_exit || CurrentPath == StorageProvider.Drive.RootDirectory.FullName) + String path = Settings.StorageRootPath != null ? Settings.StorageRootPath : StorageProvider.Drive.RootDirectory.FullName; + + if (_allow_exit || CurrentPath == path) { return Task.FromResult(true); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs index 93fde75a5..9e15abbe0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs @@ -265,16 +265,25 @@ namespace Tango.PPC.Common.Connection { LogManager.Log("Application in demo mode!"); - var emulator_channel_name = "emulator-" + Guid.NewGuid().ToString(); + if (settings.EmulatorMode == EmulatorMode.InMemory) + { + var emulator_channel_name = "emulator-" + Guid.NewGuid().ToString(); + LogManager.Log("Starting embedded emulator..."); + MachineEmulator emulator = new MachineEmulator(new BasicTransporter(new MemoryTransportAdapter(emulator_channel_name))); + await emulator.Start(); - LogManager.Log("Starting embedded emulator..."); - MachineEmulator emulator = new MachineEmulator(new BasicTransporter(new MemoryTransportAdapter(emulator_channel_name))); - await emulator.Start(); + LogManager.Log("Emulator started. Connecting to emulator..."); - LogManager.Log("Emulator started. Connecting to emulator..."); + MemoryTransportAdapter adapter = new MemoryTransportAdapter(emulator_channel_name); + MachineOperator.Adapter = adapter; + } + else + { + LogManager.Log("Connecting to external emulator over TCP..."); + TcpTransportAdapter adapter = new TcpTransportAdapter("127.0.0.1", 30000); + MachineOperator.Adapter = adapter; + } - MemoryTransportAdapter adapter = new MemoryTransportAdapter(emulator_channel_name); - MachineOperator.Adapter = adapter; MachineOperator.JobHandlingMode = JobHandlerModes.SettingUp; LogManager.Log("Connecting machine operator..."); await MachineOperator.Connect(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs index a897c806c..0d64da83e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs @@ -261,8 +261,6 @@ namespace Tango.PPC.Common.MachineSetup if (_buildProvider.IsEureka) { setup_response.SetupActivation = false; - setup_response.SetupFirmware = false; - setup_response.SetupFPGA = false; setup_response.SetupUWF = false; setup_response.SetupRemoteAssistance = false; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs index 64ca496f7..47ffe6f19 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs @@ -661,12 +661,6 @@ namespace Tango.PPC.Common.MachineUpdate /// <exception cref="System.InvalidProgramException">Database tango does not exists.</exception> public async Task<MachineUpdateResult> Update(bool setupFirmware, bool setupFPGA) { - if (_buildProvider.IsEureka) - { - setupFirmware = false; - setupFPGA = false; - } - _updateStartDate = DateTime.UtcNow; _logs.Clear(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs index 41e103ca0..acb84191b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs @@ -16,6 +16,12 @@ using Tango.Web; namespace Tango.PPC.Common { + public enum EmulatorMode + { + InMemory, + ExternalTCP, + } + /// <summary> /// Represents the main PPC settings. /// </summary> @@ -365,6 +371,16 @@ namespace Tango.PPC.Common public bool ForceTouchMode { get; set; } /// <summary> + /// Gets or sets the emulator mode. + /// </summary> + public EmulatorMode EmulatorMode { get; set; } + + /// <summary> + /// Gets or sets the storage root path. + /// </summary> + public String StorageRootPath { get; set; } + + /// <summary> /// Gets the machine service address. /// </summary> /// <returns></returns> @@ -378,6 +394,7 @@ namespace Tango.PPC.Common /// </summary> public PPCSettings() { + EmulatorMode = EmulatorMode.InMemory; LubricationLevels = new List<RmlLubricationLevel>(); JobUploadStrategy = JobUploadStrategy.JobDescriptionFile; FineTuningTrialLengthMeters = 200; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml index bdcf675e3..38a5b91b2 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml @@ -20,6 +20,7 @@ <ResourceDictionary Source="Resources/Colors.xaml"></ResourceDictionary> <ResourceDictionary Source="Resources/Fonts.xaml"></ResourceDictionary> <ResourceDictionary Source="Resources/Styles.xaml"></ResourceDictionary> + <ResourceDictionary Source="Resources/Graphs.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs index e478dba77..4dab04327 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs @@ -3,12 +3,14 @@ using System.Collections.Generic; using System.Configuration; using System.Data; using System.Diagnostics; +using System.Globalization; using System.IO; using System.Linq; using System.Net; using System.Threading; using System.Threading.Tasks; using System.Windows; +using System.Windows.Markup; using Tango.BL; using Tango.Core; using Tango.Core.DI; @@ -52,9 +54,21 @@ namespace Tango.PPC.UI { Debugger.Launch(); } - StartupArgs = e.Args; + //Set culture info. + /* var enUSCulture = new CultureInfo("en-US") + { NumberFormat = { NumberDecimalSeparator = "." } }; + + Thread.CurrentThread.CurrentCulture = enUSCulture; + Thread.CurrentThread.CurrentUICulture = enUSCulture; + CultureInfo.DefaultThreadCurrentCulture = enUSCulture; + CultureInfo.DefaultThreadCurrentUICulture = enUSCulture; + + FrameworkElement.LanguageProperty.OverrideMetadata( + typeof(FrameworkElement), + new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));*/ + //LogManager.RegisterLogger(new ConsoleLogger("Tango PPC Debug")); LogManager.RegisterLogger(new FileLogger() { 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 39c032145..4c39bded0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml @@ -4,12 +4,14 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:converters="clr-namespace:Tango.PPC.UI.Converters" xmlns:local="clr-namespace:Tango.PPC.UI.Controls" xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" mc:Ignorable="d" + Name="RunningJobViewerEurekaContr" d:DesignHeight="60" d:DesignWidth="500" Height="38" d:DataContext="{d:DesignInstance Type=local:RunningJobViewerEureka, IsDesignTimeCreatable=False}"> <UserControl.Resources> - + <converters:DoubleWidthConverter x:Key="DoubleWidthConverter" /> </UserControl.Resources> <Grid> <touch:SliderContentControl x:Name="slider_control" ThumbColor="{StaticResource TangoPrimaryAccentColor}" @@ -19,7 +21,7 @@ Minimum="{Binding RelativeSource={RelativeSource AncestorType=local:RunningJobViewerEureka}, Path=MinimumValue}" Maximum="{Binding RelativeSource={RelativeSource AncestorType=local:RunningJobViewerEureka}, Path=MaximumValue}" - MouseDown="SliderContentControl_MouseDown" TouchDown="SliderContentControl_TouchDown"> + MouseDown="SliderContentControl_MouseDown" TouchDown="SliderContentControl_TouchDown" SizeChanged="Slider_control_SizeChanged" > <Border x:Name="brush_border" ClipToBounds="False" CornerRadius="7" Margin="0 0 0 0" Background="{StaticResource TangoLightForegroundBrush}"> @@ -34,7 +36,9 @@ </RectangleGeometry> </Border.Clip> <Grid> - <ItemsControl ClipToBounds="False" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=local:RunningJobViewerEureka},Path=RunningJobStatus.CurrentUnitSegments, Delay=100}"> + <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> @@ -45,7 +49,7 @@ <Grid> <Grid.Width> <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="RunningJobStatus.CurrentUnitTotalProgress"></Binding> + <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> @@ -55,7 +59,8 @@ </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> - + </Border> + </Canvas> <Rectangle Stroke="{StaticResource TangoGrayBrush}" StrokeThickness="1" StrokeDashArray="5 5 5 5" RadiusX="7" RadiusY="7" /> </Grid> </Border> 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 29efaad72..95fe5cd10 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 @@ -1,5 +1,8 @@ using System; +using System.Collections; using System.Collections.Generic; +using System.Collections.Specialized; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -22,6 +25,24 @@ namespace Tango.PPC.UI.Controls /// </summary> public partial class RunningJobViewerEureka : UserControl { + List<Segment> _segments; + + + + private double _prevOffset; + private double _addOffset; + private int _prevUnit; + + private double _controlWidth; + + public double ControlWidth + { + get { return _controlWidth; } + set { + _controlWidth = value;//for debug + } + } + /// <summary> /// Maybe not necessary! /// </summary> @@ -43,7 +64,7 @@ namespace Tango.PPC.UI.Controls } public static readonly DependencyProperty DisplayMarkersProperty = DependencyProperty.Register("DisplayMarkers", typeof(bool), typeof(RunningJobViewerEureka), new PropertyMetadata(true)); - + /// <summary> /// Gets or sets the job. /// </summary> @@ -53,7 +74,40 @@ namespace Tango.PPC.UI.Controls set { SetValue(JobProperty, value); } } public static readonly DependencyProperty JobProperty = - DependencyProperty.Register("Job", typeof(Job), typeof(RunningJobViewerEureka), new PropertyMetadata(null)); + DependencyProperty.Register("Job", typeof(Job), typeof(RunningJobViewerEureka), new PropertyMetadata(null, (d, e) => (d as RunningJobViewerEureka).OnUpdateJob())); + + private void OnUpdateJob() + { + if(Job != null) + { + _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)); + //} + _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 + IsHasMultipleColorsSegments = true; + } + else + IsHasMultipleColorsSegments = false; + + SegmentsItemsControl.ItemsSource = _segments; + SegmentsItemsControl.InvalidateVisual(); + + _prevOffset = _addOffset = 0.0; + _prevUnit = 0; + ItemsBorder.SetValue(Canvas.LeftProperty, 0.0); + ItemsBorder.InvalidateVisual(); + } + } /// <summary> /// Gets or sets the running job status. @@ -121,7 +175,19 @@ namespace Tango.PPC.UI.Controls // Using a DependencyProperty as the backing store for ThumbHeight. This enables animation, styling, binding, etc... public static readonly DependencyProperty ThumbHeightProperty = DependencyProperty.Register("ThumbHeight", typeof(double), typeof(RunningJobViewerEureka), new FrameworkPropertyMetadata(0.0)); + + public bool IsHasMultipleColorsSegments + { + get { return (bool)GetValue(IsHasMultipleColorsSegmentsProperty); } + set { SetValue(IsHasMultipleColorsSegmentsProperty, value); } + } + + // Using a DependencyProperty as the backing store for IsHasMultipleColorsSegments. This enables animation, styling, binding, etc... + public static readonly DependencyProperty IsHasMultipleColorsSegmentsProperty = + DependencyProperty.Register("IsHasMultipleColorsSegments", typeof(bool), typeof(RunningJobViewerEureka), new PropertyMetadata(false)); + + /// <summary> /// Initializes a new instance of the <see cref="RunningJobViewerEureka"/> class. /// </summary> @@ -139,11 +205,49 @@ namespace Tango.PPC.UI.Controls { e.Handled = true; } + private void OnSliderValueChanged() { if(slider_control != null) + { slider_control.Value = SliderValue; + if(RunningJobStatus != null && RunningJobStatus.IsSettingUp == false && IsHasMultipleColorsSegments && ColorCanvas != null && ControlWidth > 0) + { + double progress = RunningJobStatus.CurrentUnitProgress; + double total = RunningJobStatus.CurrentUnitTotalProgress; + + int currentUnit = RunningJobStatus.CurrentUnit; + int totalUnits = Job.NumberOfUnits; + + double simpleoffset = ((progress / total) * ControlWidth) ; + + double multiplier = (((double)(totalUnits - 1)) / (double)totalUnits); + double offset = simpleoffset * multiplier; + + if(_prevUnit < currentUnit) + { + _addOffset = _prevOffset; + } + + offset += _addOffset; + + if (offset >= ControlWidth) + { + offset -= ControlWidth;//round + } + _prevOffset = offset; + _prevUnit = currentUnit; + + ItemsBorder.SetValue(Canvas.LeftProperty, (-1) * offset); + ItemsBorder.InvalidateVisual(); + } + } + } + + private void Slider_control_SizeChanged(object sender, SizeChangedEventArgs e) + { + ControlWidth = e.NewSize.Width; } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/DoubleWidthConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/DoubleWidthConverter.cs new file mode 100644 index 000000000..3ddcc5f3c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/DoubleWidthConverter.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 DoubleWidthConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + double length = System.Convert.ToDouble(value); + return length * 2; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/StatisticTabToVisibilityConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/StatisticTabToVisibilityConverter.cs new file mode 100644 index 000000000..06c75a999 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/StatisticTabToVisibilityConverter.cs @@ -0,0 +1,28 @@ +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 static Tango.PPC.UI.ViewModels.MachineStatusViewVM; + +namespace Tango.PPC.UI.Converters +{ + public class StatisticTabToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + StatisticTab selected = (StatisticTab)Enum.Parse(typeof(StatisticTab), parameter.ToString()); + StatisticTab statTab = (StatisticTab)value; + + return statTab.Equals(selected) ? Visibility.Visible : Visibility.Hidden; + } + + 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/PowerEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml index f5b1116c0..3ef594046 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml @@ -6,7 +6,7 @@ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs" mc:Ignorable="d" - Width="500" Height="462" + Width="500" Height="625" Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="500" d:DataContext="{d:DesignInstance Type=local:PowerEurekaViewVM, IsDesignTimeCreatable=False}"> <UserControl.Resources> @@ -36,17 +36,27 @@ <touch:TouchIconButton DockPanel.Dock="Right" VerticalAlignment="Center" Height="25" Width="25" Command="{Binding CloseCommand}" Foreground="{StaticResource TangoDarkForegroundBrush}" RippleBrush="{StaticResource TangoRippleDarkBrush}" Icon="Close" HorizontalAlignment="Right" /> <TextBlock FontSize="{StaticResource TangoButtonFontSize}" FontWeight="SemiBold" HorizontalAlignment="Center"> Power</TextBlock> </DockPanel> - <Grid HorizontalAlignment="Center" Width="470" VerticalAlignment="Top" Margin="0 20 0 0"> - <Image Source="../Images/Menu/Power_image.png" Stretch="UniformToFill" VerticalAlignment="Center" HorizontalAlignment="Left" Height="50" Width="120"/> - <touch:TouchButton Margin="0" Command="{Binding TurnOffCommand}" HorizontalAlignment="Center"> Turn off</touch:TouchButton> - </Grid> - <touch:TouchButton Margin="0 35 0 0" Content="Stand By" Command="{Binding StandByCommand}" ></touch:TouchButton> - <touch:TouchButton Margin="0 35 0 0" Command="{Binding RestartCommand}">Restart</touch:TouchButton> + <UniformGrid Rows="3" > + <Grid VerticalAlignment="Top" Margin="0 30 0 0"> + <Image Source="../Images/Menu/AppPower_image.png" Stretch="UniformToFill" HorizontalAlignment="Left" Width="120" VerticalAlignment="Center" Margin="0 0 0 0"/> + <touch:TouchButton Margin="0" Command="{Binding MinimizeCommand}">Minimize</touch:TouchButton> + </Grid> + <touch:TouchButton Margin="0 35 0 0" Command="{Binding RestartTabletCommand}">Restart UI</touch:TouchButton> + <touch:TouchButton Margin="0 35 0 0" Command="{Binding CloseAppCommand}">Close</touch:TouchButton> + </UniformGrid> + <Border Height="2" Width="380" Background="{StaticResource TangoLightBorderBrush}" VerticalAlignment="Bottom" Margin="0 36 0 0" CornerRadius="2"></Border> - <Grid Margin="0 43 0 43" VerticalAlignment="Bottom"> - <Image Source="../Images/Menu/restart_t.png" Stretch="UniformToFill" HorizontalAlignment="Left" Width="30" VerticalAlignment="Center" Margin="46 0 0 0"/> - <touch:TouchButton Margin="0" Command="{Binding RestartTabletCommand}">Restart</touch:TouchButton> - </Grid> + + <UniformGrid Rows="3"> + <Grid HorizontalAlignment="Center" Width="470" VerticalAlignment="Top" Margin="0 30 0 0"> + <Image Source="../Images/Menu/Power_image.png" Stretch="UniformToFill" VerticalAlignment="Center" HorizontalAlignment="Left" Height="50" Width="120"/> + <touch:TouchButton Margin="0" Command="{Binding StandByCommand}" HorizontalAlignment="Center">Power Save</touch:TouchButton> + </Grid> + <touch:TouchButton Margin="0 35 0 0" Command="{Binding RestartCommand}">Restart FW</touch:TouchButton> + <touch:TouchButton Margin="0 35 0 0" Content="Turn Off" Command="{Binding TurnOffCommand}" ></touch:TouchButton> + + </UniformGrid> + </StackPanel> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaViewVM.cs index 2dc8f7b6e..292c4b2d6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaViewVM.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows; using Tango.Core.Commands; using Tango.SharedUI; @@ -10,7 +11,7 @@ namespace Tango.PPC.UI.Dialogs { public class PowerEurekaViewVM : DialogViewVM { - public enum PowerActionEnum { TurnOff, StandBy, Restart, RestartT }; + public enum PowerActionEnum { TurnOff, StandBy, Restart, RestartT, CloseApp }; private PowerActionEnum _powerAction; @@ -26,6 +27,8 @@ namespace Tango.PPC.UI.Dialogs public RelayCommand StandByCommand { get; set;} public RelayCommand RestartCommand { get; set; } public RelayCommand RestartTabletCommand { get; set; } + public RelayCommand MinimizeCommand { get; set; } + public RelayCommand CloseAppCommand { get; set; } public PowerEurekaViewVM() @@ -35,6 +38,19 @@ namespace Tango.PPC.UI.Dialogs StandByCommand = new RelayCommand(OnStandBy); RestartCommand = new RelayCommand(OnRestart); RestartTabletCommand = new RelayCommand(OnRestartTablet); + MinimizeCommand = new RelayCommand(OnMinimize); + CloseAppCommand = new RelayCommand(OnCloseApp); + } + + private void OnCloseApp(object obj) + { + PowerAction = PowerActionEnum.CloseApp; + base.Accept(); + } + + private void OnMinimize(object obj) + { + Application.Current.MainWindow.WindowState = WindowState.Minimized; } private void OnRestartTablet(object obj) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/GraphHelper.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/GraphHelper.cs new file mode 100644 index 000000000..d06ed042a --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/GraphHelper.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Media; + +namespace Tango.PPC.UI.Graphs +{ + public static class GraphHelper + { + public enum GraphColor + { + White, + Red, + Yellow, + Green, + Orange + } + + public static Color GetGraphColor(GraphColor graphColor) + { + return (Color)Application.Current.Resources[$"Tango_RealTimeGraph_{graphColor.ToString()}"]; + } + + public static Brush GetGraphBrush(GraphColor graphColor) + { + return new SolidColorBrush(GetGraphColor(graphColor)); + } + + public static Color GetGraphStrokeColor() + { + return (Color)Application.Current.Resources["Tango_RealTimeGraph_ForegroundColor"]; + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.cs new file mode 100644 index 000000000..7e653f351 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.cs @@ -0,0 +1,159 @@ +using RealTimeGraphX; +using System; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; + +namespace Tango.PPC.UI.Graphs +{ + public class RealTimeGraph : Control + { + /// <summary> + /// Gets or sets the graph controller. + /// </summary> + public IGraphController Controller + { + get { return (IGraphController)GetValue(ControllerProperty); } + set { SetValue(ControllerProperty, value); } + } + public static readonly DependencyProperty ControllerProperty = + DependencyProperty.Register("Controller", typeof(IGraphController), typeof(RealTimeGraph), new PropertyMetadata(null)); + + + /// <summary> + /// Gets or sets the string format of the y-axis. + /// </summary> + public String StringFormat + { + get { return (String)GetValue(StringFormatProperty); } + set { SetValue(StringFormatProperty, value); } + } + public static readonly DependencyProperty StringFormatProperty = + DependencyProperty.Register("StringFormat", typeof(String), typeof(RealTimeGraph), new PropertyMetadata("0.0")); + + + /// <summary> + /// Gets or sets the display name. + /// </summary> + public String DisplayName + { + get { return (String)GetValue(DisplayNameProperty); } + set { SetValue(DisplayNameProperty, value); } + } + public static readonly DependencyProperty DisplayNameProperty = + DependencyProperty.Register("DisplayName", typeof(String), typeof(RealTimeGraph), new PropertyMetadata(null)); + + + /// <summary> + /// Gets or sets the display units. + /// </summary> + public String DisplayUnits + { + get { return (String)GetValue(DisplayUnitsProperty); } + set { SetValue(DisplayUnitsProperty, value); } + } + public static readonly DependencyProperty DisplayUnitsProperty = + DependencyProperty.Register("DisplayUnits", typeof(String), typeof(RealTimeGraph), new PropertyMetadata(null)); + + /// <summary> + /// Gets or sets the graph label visibility. + /// </summary> + public Visibility GraphLabelVisibility + { + get { return (Visibility)GetValue(GraphLabelVisibilityProperty); } + set { SetValue(GraphLabelVisibilityProperty, value); } + } + public static readonly DependencyProperty GraphLabelVisibilityProperty = + DependencyProperty.Register("GraphLabelVisibility", typeof(Visibility), typeof(RealTimeGraph), new PropertyMetadata(Visibility.Visible)); + + + /// <summary> + /// Gets or sets the vertical ticks. + /// </summary> + public int VerticalTicks + { + get { return (int)GetValue(VerticalTicksProperty); } + set { SetValue(VerticalTicksProperty, value); } + } + public static readonly DependencyProperty VerticalTicksProperty = + DependencyProperty.Register("VerticalTicks", typeof(int), typeof(RealTimeGraph), new PropertyMetadata(10)); + + + /// <summary> + /// Gets or sets the horizontal ticks. + /// </summary> + public int HorizontalTicks + { + get { return (int)GetValue(HorizontalTicksProperty); } + set { SetValue(HorizontalTicksProperty, value); } + } + public static readonly DependencyProperty HorizontalTicksProperty = + DependencyProperty.Register("HorizontalTicks", typeof(int), typeof(RealTimeGraph), new PropertyMetadata(10)); + + public Brush GridLinesBrush + { + get { return (Brush)GetValue(GridLinesBrushProperty); } + set { SetValue(GridLinesBrushProperty, value); } + } + public static readonly DependencyProperty GridLinesBrushProperty = + DependencyProperty.Register("GridLinesBrush", typeof(Brush), typeof(RealTimeGraph), new PropertyMetadata(null)); + + public Visibility HorizontalAxisVisibility + { + get { return (Visibility)GetValue(HorizontalAxisVisibilityProperty); } + set { SetValue(HorizontalAxisVisibilityProperty, value); } + } + public static readonly DependencyProperty HorizontalAxisVisibilityProperty = + DependencyProperty.Register("HorizontalAxisVisibility", typeof(Visibility), typeof(RealTimeGraph), new PropertyMetadata(Visibility.Visible)); + + public double AxisLabelAngle + { + get { return (double)GetValue(AxisLabelAngleProperty); } + set { SetValue(AxisLabelAngleProperty, value); } + } + + // Using a DependencyProperty as the backing store for AxisLabelAngle. This enables animation, styling, binding, etc... + public static readonly DependencyProperty AxisLabelAngleProperty = + DependencyProperty.Register("AxisLabelAngle", typeof(double), typeof(RealTimeGraph), new PropertyMetadata(-30.0)); + + public Visibility VerticalAxisVisibility + { + get { return (Visibility)GetValue(VerticalAxisVisibilityProperty); } + set { SetValue(VerticalAxisVisibilityProperty, value); } + } + public static readonly DependencyProperty VerticalAxisVisibilityProperty = + DependencyProperty.Register("VerticalAxisVisibility", typeof(Visibility), typeof(RealTimeGraph), new PropertyMetadata(Visibility.Visible)); + + public Visibility CurrentValueVisibility + { + get { return (Visibility)GetValue(CurrentValueVisibilityProperty); } + set { SetValue(CurrentValueVisibilityProperty, value); } + } + public static readonly DependencyProperty CurrentValueVisibilityProperty = + DependencyProperty.Register("CurrentValueVisibility", typeof(Visibility), typeof(RealTimeGraph), new PropertyMetadata(Visibility.Collapsed)); + + public double CurrentValueFontSize + { + get { return (double)GetValue(CurrentValueFontSizeProperty); } + set { SetValue(CurrentValueFontSizeProperty, value); } + } + public static readonly DependencyProperty CurrentValueFontSizeProperty = + DependencyProperty.Register("CurrentValueFontSize", typeof(double), typeof(RealTimeGraph), new PropertyMetadata(25.0)); + + public Thickness CurrentValueMargin + { + get { return (Thickness)GetValue(CurrentValueMarginProperty); } + set { SetValue(CurrentValueMarginProperty, value); } + } + public static readonly DependencyProperty CurrentValueMarginProperty = + DependencyProperty.Register("CurrentValueMargin", typeof(Thickness), typeof(RealTimeGraph), new PropertyMetadata(new Thickness(20))); + + /// <summary> + /// Initializes the <see cref="RealTimeGraph"/> class. + /// </summary> + static RealTimeGraph() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(RealTimeGraph), new FrameworkPropertyMetadata(typeof(RealTimeGraph))); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.xaml new file mode 100644 index 000000000..6d50c4969 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.xaml @@ -0,0 +1,106 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:realTimeGraphX="clr-namespace:RealTimeGraphX.WPF;assembly=RealTimeGraphX.WPF" + xmlns:local="clr-namespace:Tango.PPC.UI.Graphs"> + + <BitmapImage x:Key="PPC_Screw" UriSource="../Images/screw.png" /> + + <Style TargetType="{x:Type local:RealTimeGraph}"> + <Setter Property="BorderThickness" Value="1"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource Tango_RealTimeGraph_OuterBorderBrush}"></Setter> + <Setter Property="Padding" Value="20 20 30 20"></Setter> + <Setter Property="FontSize" Value="11"></Setter> + <Setter Property="Foreground" Value="{StaticResource Tango_RealTimeGraph_ForegroundBrush}"></Setter> + <Setter Property="Background" Value="{StaticResource Tango_RealTimeGraph_BackgroundBrush}"></Setter> + <Setter Property="GridLinesBrush" Value="{StaticResource Tango_RealTimeGraph_GridLinesBrush}"></Setter> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type local:RealTimeGraph}"> + <Grid> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="5" + Padding="{TemplateBinding Padding}"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="1*"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + + <Grid Grid.Column="1"> + <realTimeGraphX:WpfGraphGridLines Controller="{TemplateBinding Controller}" Foreground="{TemplateBinding GridLinesBrush}" /> + <realTimeGraphX:WpfGraphSurface x:Name="surface" Controller="{TemplateBinding Controller}" BorderThickness="1 0 0 1" BorderBrush="{StaticResource Tango_RealTimeGraph_InnerBorderBrush}" /> + </Grid> + + <realTimeGraphX:WpfGraphAxisControl Width="70" Visibility="{TemplateBinding VerticalAxisVisibility}" Orientation="Vertical" Controller="{TemplateBinding Controller}" StringFormat="{TemplateBinding StringFormat}" Ticks="{TemplateBinding VerticalTicks}" /> + <realTimeGraphX:WpfGraphAxisControl Height="35" Visibility="{TemplateBinding HorizontalAxisVisibility}" Orientation="Horizontal" Controller="{TemplateBinding Controller}" Grid.Column="1" Grid.Row="1" Ticks="{TemplateBinding HorizontalTicks}" StringFormat="hh\:mm\:ss"/> + </Grid> + </Border> + <Image HorizontalAlignment="Left" VerticalAlignment="Top" Margin="8" Source="{StaticResource PPC_Screw}" RenderOptions.BitmapScalingMode="Fant" Width="10" Height="10" /> + <Image HorizontalAlignment="Right" VerticalAlignment="Top" Margin="8" Source="{StaticResource PPC_Screw}" RenderOptions.BitmapScalingMode="Fant" Width="10" Height="10" /> + + <Image HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="8" Source="{StaticResource PPC_Screw}" RenderOptions.BitmapScalingMode="Fant" Width="10" Height="10" /> + <Image HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="8" Source="{StaticResource PPC_Screw}" RenderOptions.BitmapScalingMode="Fant" Width="10" Height="10" /> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type local:RealTimeGraph}" x:Key="PPC_RealTimeGraph_Flat"> + <Setter Property="BorderThickness" Value="1"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource Tango_RealTimeGraph_OuterBorderBrush}"></Setter> + <Setter Property="Padding" Value="0"></Setter> + <Setter Property="FontSize" Value="11"></Setter> + <Setter Property="Foreground" Value="{StaticResource Tango_RealTimeGraph_ForegroundBrush}"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="GridLinesBrush" Value="{StaticResource Tango_RealTimeGraph_GridLinesBrush}"></Setter> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type local:RealTimeGraph}"> + <Grid> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Padding="{TemplateBinding Padding}"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="1*"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + + <Grid Grid.Column="1" ClipToBounds="True"> + <realTimeGraphX:WpfGraphGridLines Controller="{TemplateBinding Controller}" Foreground="{TemplateBinding GridLinesBrush}" Rows="5" Columns="0"/> + <realTimeGraphX:WpfGraphSurface Margin="-2 0 0 0" x:Name="surface" Controller="{TemplateBinding Controller}" BorderThickness="0 0 0 0" BorderBrush="{StaticResource Tango_RealTimeGraph_InnerBorderBrush}" /> + </Grid> + + <realTimeGraphX:WpfGraphAxisControl Width="30" Visibility="{TemplateBinding VerticalAxisVisibility}" Orientation="Vertical" Controller="{TemplateBinding Controller}" StringFormat="{TemplateBinding StringFormat}" Ticks="{TemplateBinding VerticalTicks}" /> + <realTimeGraphX:WpfGraphAxisControl Height="38" Visibility="{TemplateBinding HorizontalAxisVisibility}" Orientation="Horizontal" Controller="{TemplateBinding Controller}" Grid.Column="1" Grid.Row="1" Ticks="{TemplateBinding HorizontalTicks}" StringFormat="hh\:mm" AxisLabelAngle="{TemplateBinding AxisLabelAngle}"/> + </Grid> + </Border> + + <Viewbox IsHitTestVisible="False" Stretch="Uniform" Margin="{TemplateBinding CurrentValueMargin}" Visibility="{TemplateBinding CurrentValueVisibility}"> + <Grid Width="200" Height="200"> + <!--<Ellipse Stroke="#38FFFFFF" StrokeThickness="20" />--> + + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> + <TextBlock Opacity="0.8" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="SemiBold" FontSize="{TemplateBinding CurrentValueFontSize}" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=Controller.DataSeriesCollection[0].CurrentValue}"></TextBlock> + </StackPanel> + </Grid> + </Viewbox> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/AppPower_image.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/AppPower_image.png Binary files differnew file mode 100644 index 000000000..e81b56d37 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/AppPower_image.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/motor.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/motor.png Binary files differnew file mode 100644 index 000000000..8401a8e30 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/motor.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pr_data.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pr_data.png Binary files differnew file mode 100644 index 000000000..ebd02a99b --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pr_data.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pressure.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pressure.png Binary files differnew file mode 100644 index 000000000..12ade5d92 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pressure.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/temperature.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/temperature.png Binary files differnew file mode 100644 index 000000000..de9b042c4 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/temperature.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/screw.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/screw.png Binary files differnew file mode 100644 index 000000000..46a8134fe --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/screw.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewItem.cs index ded7e33e8..42f6bd180 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewItem.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewItem.cs @@ -17,6 +17,13 @@ namespace Tango.PPC.UI.Models set { _displayValue = value; RaisePropertyChangedAuto(); } } + private String _displayMaxValue; + public String DisplayMaxValue + { + get { return _displayMaxValue; } + set { _displayMaxValue = value; RaisePropertyChangedAuto(); } + } + private String _status; public String Status { @@ -53,6 +60,7 @@ namespace Tango.PPC.UI.Models DisplayValue = "--"; Value = 0; MaxValue = 100; + DisplayMaxValue = ""; } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs index faddc5c54..beba47246 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs @@ -110,15 +110,17 @@ namespace Tango.PPC.UI.Models { item.Status = "Heating Up"; item.Color = Colors.Orange; - item.DisplayValue = $"{state.CurrentValue.ToString("N1")} / {state.SetPoint}"; + item.DisplayValue = $"{state.CurrentValue.ToString("N1")}"; + item.DisplayMaxValue = $"/{state.SetPoint}"; item.MaxValue = state.SetPoint; item.Value = state.CurrentValue; } - else if (state.SetPoint == 0 || (state.CurrentValue >= (state.SetPoint - 10) || state.CurrentValue <= (state.SetPoint + 10))) + else if (state.SetPoint == 0 || (state.CurrentValue >= (state.SetPoint - 10) && state.CurrentValue <= (state.SetPoint + 10))) { item.Status = "Operational"; item.Color = Colors.Green; item.DisplayValue = $" {state.SetPoint}"; + item.DisplayMaxValue = ""; if(state.SetPoint == 0 && state.CurrentValue == 0) { item.MaxValue = 10; @@ -133,7 +135,8 @@ namespace Tango.PPC.UI.Models { item.Status = "Over-temperature"; item.Color = Colors.Red; - item.DisplayValue = $"{state.CurrentValue.ToString("N1")} / {state.SetPoint}"; + item.DisplayValue = $"{state.CurrentValue.ToString("N1")}"; + item.DisplayMaxValue = $"/{state.SetPoint}"; item.MaxValue = state.SetPoint; item.Value = state.CurrentValue > state.SetPoint? state.SetPoint : state.CurrentValue; } @@ -142,6 +145,7 @@ namespace Tango.PPC.UI.Models item.Color = Colors.Gray; item.MaxValue = 100; item.Value = 0; + item.DisplayMaxValue = ""; } } } @@ -205,8 +209,6 @@ namespace Tango.PPC.UI.Models Lubricant.DisplayValue = "None"; Lubricant.Color = Colors.Gray; } - - } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Graphs.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Graphs.xaml new file mode 100644 index 000000000..67047cf1f --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Graphs.xaml @@ -0,0 +1,8 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.PPC.UI.Resources"> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="pack://application:,,,/Tango.PPC.UI;component/Graphs/RealTimeGraph.xaml" /> + </ResourceDictionary.MergedDictionaries> + +</ResourceDictionary>
\ No newline at end of file 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 a3ec9667f..e364c530c 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 @@ -168,6 +168,7 @@ <Compile Include="Converters\AppBarItemConverter.cs" /> <Compile Include="Converters\CollectionToCountConverter.cs" /> <Compile Include="Converters\ComapareModulNameConverter.cs" /> + <Compile Include="Converters\DoubleWidthConverter.cs" /> <Compile Include="Converters\ItemBaseConverter.cs" /> <Compile Include="Converters\LengthToWeightConverter.cs" /> <Compile Include="Converters\LengthWithSpoolsConverter.cs" /> @@ -176,6 +177,7 @@ <Compile Include="Converters\ProgressLengthSpoolConverter.cs" /> <Compile Include="Converters\ProgressUnitSpoolConverter.cs" /> <Compile Include="Converters\ProgressWeightSpoolConverter.cs" /> + <Compile Include="Converters\StatisticTabToVisibilityConverter.cs" /> <Compile Include="Dialogs\BitResultsView.xaml.cs"> <DependentUpon>BitResultsView.xaml</DependentUpon> </Compile> @@ -236,6 +238,8 @@ </Compile> <Compile Include="Dialogs\FirmwareUpgradeFromFileViewVM.cs" /> <Compile Include="Dialogs\UpdateFromFileViewVM.cs" /> + <Compile Include="Graphs\GraphHelper.cs" /> + <Compile Include="Graphs\RealTimeGraph.cs" /> <Compile Include="Helpers\DpiHelper.cs" /> <Compile Include="InternalModule.cs" /> <Compile Include="Models\MachineOverviewErrorStates.cs" /> @@ -409,6 +413,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Graphs\RealTimeGraph.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="MainWindow.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -433,6 +441,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Resources\Graphs.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Resources\Styles.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -627,6 +639,12 @@ <Resource Include="Images\Overview Icons\Feeder4.png" /> <Resource Include="Manifests\eureka_debug.xml" /> <Resource Include="Images\Overview Icons\JericanRemoved.png" /> + <Resource Include="Images\Overview Icons\motor.png" /> + <Resource Include="Images\Overview Icons\pressure.png" /> + <Resource Include="Images\Overview Icons\pr_data.png" /> + <Resource Include="Images\Overview Icons\temperature.png" /> + <Resource Include="Images\screw.png" /> + <Resource Include="Images\Menu\AppPower_image.png" /> <Content Include="Intro.wmv" /> <Content Include="Manifests\release.xml" /> <Content Include="Manifests\debug.xml" /> @@ -648,6 +666,14 @@ <None Include="App.config" /> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\..\SideChains\RealTimeGraphX-master\RealTimeGraphX.WPF\RealTimeGraphX.WPF.csproj"> + <Project>{6b9774f7-960d-438e-ad81-c6b9be328d50}</Project> + <Name>RealTimeGraphX.WPF</Name> + </ProjectReference> + <ProjectReference Include="..\..\SideChains\RealTimeGraphX-master\RealTimeGraphX\RealTimeGraphX.csproj"> + <Project>{f13a489c-80ee-4cd0-bdd4-92d959215646}</Project> + <Name>RealTimeGraphX</Name> + </ProjectReference> <ProjectReference Include="..\..\Tango.AnimatedGif\Tango.AnimatedGif.csproj"> <Project>{d129789c-3096-4d0b-8dd7-fe24a4df4b21}</Project> <Name>Tango.AnimatedGif</Name> @@ -964,7 +990,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/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index f40a89f42..17b676499 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -361,6 +361,9 @@ namespace Tango.PPC.UI.ViewModels if (MachineProvider.MachineOperator.Status != MachineStatuses.Disconnected) ResetMachine(); return; + case PowerEurekaViewVM.PowerActionEnum.CloseApp: + CloseApplication(); + return; default: return; } @@ -455,6 +458,14 @@ namespace Tango.PPC.UI.ViewModels } } + private async void CloseApplication() + { + if (await NotificationProvider.ShowQuestion("Are you sure you want to close the application?")) + { + ApplicationManager.ShutDown(); + } + } + /// <summary> /// Powers off the machine. /// </summary> 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 68c0f1867..653c2368f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -20,11 +20,27 @@ using System.Timers; using System.Windows.Threading; using System.Diagnostics; using Tango.PMR.Printing; +using System.ComponentModel; +using RealTimeGraphX.WPF; +using RealTimeGraphX.DataPoints; +using Tango.PPC.UI.Graphs; namespace Tango.PPC.UI.ViewModels { public class MachineStatusViewVM : PPCViewModel { + public enum StatisticTab + { + [Description("Production Data")] + Productiondata = 0, + [Description("Temperature")] + Temperature = 1, + [Description("Pressure")] + Pressure = 2, + [Description("Motor")] + Motor = 3 + } + #region Properties [TangoInject] @@ -186,6 +202,13 @@ namespace Tango.PPC.UI.ViewModels set { _midTankLevels = value; RaisePropertyChangedAuto(); } } + private JerricanLevelModel _midTankLubLevel; + public JerricanLevelModel MidTankLubLevel + { + get { return _midTankLubLevel; } + set { _midTankLubLevel = value; RaisePropertyChangedAuto(); } + } + public MachineOverviewModel OverviewModel { get; set; } private bool _isDisplayJobOutline; @@ -210,6 +233,81 @@ namespace Tango.PPC.UI.ViewModels public MachineOverviewErrorStates MachineErrorStates { get; set; } + private bool _isExpandedNotificatios; + + public bool IsExpandedNotifications + { + get { return _isExpandedNotificatios; } + set { + _isExpandedNotificatios = value; + RaisePropertyChangedAuto();} + } + + private int _selectedStatisticTabIndex; + /// <summary> + /// Gets or sets the index of the selected category. + /// </summary> + public int SelectedStatisticTabIndex + { + get { return _selectedStatisticTabIndex; } + set + { + if (_selectedStatisticTabIndex != value) + { + _selectedStatisticTabIndex = value; + RaisePropertyChangedAuto(); + switch (_selectedStatisticTabIndex) + { + case 0: + { + SelectedStatisticTab = StatisticTab.Productiondata; + break; + } + case 1: + { + SelectedStatisticTab = StatisticTab.Temperature; + break; + } + case 2: + { + SelectedStatisticTab = StatisticTab.Pressure; + break; + } + case 3: + { + SelectedStatisticTab = StatisticTab.Motor; + break; + } + } + } + } + } + + private StatisticTab _selectedStatisticTab; + /// <summary> + /// Gets or sets the selected category. + /// </summary> + /// + public StatisticTab SelectedStatisticTab + { + get + { + return _selectedStatisticTab; + } + set + { + if (_selectedStatisticTab != value) + { + _selectedStatisticTab = value; + RaisePropertyChangedAuto(); + } + _selectedStatisticTabIndex = _selectedStatisticTab.ToInt32(); + RaisePropertyChanged(nameof(SelectedStatisticTabIndex)); + } + } + + public WpfGraphController<DateTimeDataPoint, DoubleDataPoint> JobController { get; set; } + #endregion #region Commands @@ -258,17 +356,31 @@ namespace Tango.PPC.UI.ViewModels OverviewModel = new MachineOverviewModel(); MachineErrorStates = new MachineOverviewErrorStates(); + + IsExpandedNotifications = false; + SelectedStatisticTabIndex = 0; + + JobController = CreateController(CreateSeries("Total", GraphHelper.GraphColor.Green)); } public override void OnApplicationReady() { base.OnApplicationReady(); + EventLogger.EventReceived += EventLogger_EventReceived; - MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure || x.MidTankType.Type == MidTankTypes.LubricantMidTank).OrderBy(x => x.PackIndex).Select(x => new JerricanLevelModel() + MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure ).OrderBy(x => x.PackIndex).Select(x => new JerricanLevelModel() { Max = x.MidTankType.LiterCapacity, IDSPack = x, - }).OrderBy(y => y.IDSPack.LiquidType.PreferredIndex).ToList(); + }).OrderBy(y => y.IDSPack.LiquidType.Type).ToList(); + var LubLevel = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.Type == MidTankTypes.LubricantMidTank).FirstOrDefault(); + + MidTankLubLevel = new JerricanLevelModel(); + if(LubLevel != null) + { + MidTankLubLevel.Max = LubLevel.MidTankType.LiterCapacity; + MidTankLubLevel.IDSPack = LubLevel; + }; MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; @@ -276,7 +388,18 @@ namespace Tango.PPC.UI.ViewModels #region Events - private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) + private void EventLogger_EventReceived(object sender, MachinesEvent ev) + { + InvokeUI(() => + { + if (ev.Category == EventTypeCategories.Error || ev.Category == EventTypeCategories.Critical) + { + IsExpandedNotifications = true; + } + }); + } + + private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) { UpdateMidTankLevels(status); UpdateMachineStatusErrors(status); @@ -287,7 +410,15 @@ namespace Tango.PPC.UI.ViewModels { foreach (var item in status.IDSPacksLevels) { - var model = MidTankLevels.SingleOrDefault(x => x.IDSPack.PackIndex == item.Index); + JerricanLevelModel model = null; + if (item.Index == 8)//lub + { + model = MidTankLubLevel; + + } + else { + model = MidTankLevels.SingleOrDefault(x => x.IDSPack.PackIndex == item.Index); + } if (model != null) { @@ -440,17 +571,17 @@ namespace Tango.PPC.UI.ViewModels IsDyeingProcess = (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null); if (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null) { - var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex); + 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 (_handler.JobTicket.Segments.Count > 0) { JobBrushStop = _handler.JobTicket.Segments[Job.OrderedSegments.IndexOf(segment)].BrushStops.First(); - } - - CurrentBrushStop = segment.FirstBrushStop; + } } + CurrentBrushStop = RunningJobStatus.CurrentSegment.FirstBrushStop; } } @@ -565,6 +696,35 @@ namespace Tango.PPC.UI.ViewModels } } + private WpfGraphController<DateTimeDataPoint, DoubleDataPoint> CreateController(params WpfGraphDataSeries[] seriesCollection) + { + var controller = new WpfGraphController<DateTimeDataPoint, DoubleDataPoint>(); + + foreach (var series in seriesCollection) + { + controller.DataSeriesCollection.Add(series); + } + + controller.Range.AutoY = true; + controller.Range.MaximumY = 100; + controller.Range.MinimumY = 0; + controller.Range.MaximumX = new DateTime(0).AddMinutes(30); + + controller.RefreshRate = TimeSpan.FromMilliseconds(300000);//5 min + + return controller; + } + + private WpfGraphDataSeries CreateSeries(String name, GraphHelper.GraphColor fill) + { + WpfGraphDataSeries series = new WpfGraphDataSeries(); + series.Name = name; + series.Fill = GraphHelper.GetGraphBrush(fill); + series.StrokeThickness = 1; + series.Stroke = GraphHelper.GetGraphStrokeColor(); + return series; + } + #endregion } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml index 84d1108f2..049f2268d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -61,7 +61,7 @@ Foreground="{StaticResource TangoLightForegroundBrush}" Background="{StaticResource TangoMidAccentBrush}" CornerRadius="18" Margin="0 8 0 8"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> - <touch:TouchIcon Icon="ArrowLeft" Background="Transparent" Width="30" BorderThickness="0"> + <touch:TouchIcon Icon="ArrowLeft" Background="Transparent" Width="30" BorderThickness="0" HorizontalAlignment="Center" Margin="-8 0 0 0"> <touch:TouchIcon.Style> <Style TargetType="touch:TouchIcon" BasedOn="{StaticResource {x:Type touch:TouchIcon}}"> <Style.Triggers> @@ -72,7 +72,7 @@ </Style> </touch:TouchIcon.Style> </touch:TouchIcon> - <TextBlock Background="Transparent" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalAlignment="Center" Foreground="{StaticResource TangoLightForegroundBrush}" Margin="0 0 0 0" >Back</TextBlock> + <TextBlock HorizontalAlignment="Center" Background="Transparent" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalAlignment="Center" Foreground="{StaticResource TangoLightForegroundBrush}" Margin="5 0 0 0" >Back</TextBlock> </StackPanel> </touch:TouchButton> @@ -85,7 +85,7 @@ <touch:TouchButton Height="45" Margin="0 0 0 0" Padding="10 0" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ModuleNavigationCommand}" CommandParameter="{Binding Name}" > <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> <Image VerticalAlignment="Center" Source="{Binding Image}" Width="20" Height="20"></Image> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Text="{Binding Name}" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="Light"></TextBlock> + <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Text="{Binding Name}" FontSize="{StaticResource TangoDataGridHeaderFontSize}" FontWeight="Light"></TextBlock> </StackPanel> <touch:TouchButton.Style> <Style TargetType="touch:TouchButton" BasedOn="{StaticResource TangoFlatButton}" > @@ -119,7 +119,7 @@ <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="10 0" Height="45" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding UpdateCommand}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> <Image Source="/Images/Menu/update.png" VerticalAlignment="Center" Width="20" Height="20"></Image> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="Light">Update</TextBlock> + <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoDataGridHeaderFontSize}" FontWeight="Light">Update</TextBlock> </StackPanel> </touch:TouchButton> </Border> @@ -129,7 +129,7 @@ <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="10 0" Height="45" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding PowerCommand}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> <Image Source="/Images/menu/power.png" VerticalAlignment="Center" Width="20" Height="20" ></Image> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="Light">Power</TextBlock> + <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoDataGridHeaderFontSize}" FontWeight="Light">Power</TextBlock> </StackPanel> </touch:TouchButton> </Border> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 996b54d13..5f5612fb6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -12,6 +12,7 @@ xmlns:localConverters="clr-namespace:Tango.PPC.UI.Converters" xmlns:global="clr-namespace:Tango.PPC.UI" xmlns:models="clr-namespace:Tango.PPC.UI.Models" + xmlns:graphs="clr-namespace:Tango.PPC.UI.Graphs" xmlns:local="clr-namespace:Tango.PPC.UI.Views" mc:Ignorable="d" d:DesignHeight="1280" d:DesignWidth="932" d:DataContext="{d:DesignInstance Type=vm:MachineStatusViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineStatusViewVM}"> @@ -25,6 +26,7 @@ <localConverters:LiquidTypeToBrushConverter x:Key="LiquidTypeToBrushConverter"/> <localConverters:MidTankLevelToElementRectConverter x:Key="MidTankLevelToElementRectConverter"/> <localConverters:ProgressUnitSpoolConverter x:Key="ProgressUnitSpoolConverter"/> + <localConverters:StatisticTabToVisibilityConverter x:Key="StatisticTabToVisibilityConverter"/> <Style x:Key="LinkRoundButtonStyle" TargetType="{x:Type touch:TouchButton}"> <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter> @@ -162,11 +164,90 @@ </Path> </Grid> - <UniformGrid Rows="4" Columns="1" Margin="0 15 0 15" HorizontalAlignment="Center"> - <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle> - <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle> - <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle> - <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle> + <UniformGrid Rows="4" Columns="1" Margin="0 12 0 12" HorizontalAlignment="Center"> + <Rectangle Width="6" Height="2" Fill="{StaticResource TangoKeyboardKeyDarkBrush}"></Rectangle> + <Rectangle Width="6" Height="2" Fill="{StaticResource TangoKeyboardKeyDarkBrush}"></Rectangle> + <Rectangle Width="6" Height="2" Fill="{StaticResource TangoKeyboardKeyDarkBrush}"></Rectangle> + <Rectangle Width="6" Height="2" Fill="{StaticResource TangoKeyboardKeyDarkBrush}"></Rectangle> + </UniformGrid> + <Image Stretch="Fill" VerticalAlignment="Top" Margin="0 4 0 0"> + <Image.Style> + <Style TargetType="{x:Type Image}" > + <Setter Property="Source" Value="{x:Null}"/> + <Setter Property="Image.Width" Value="24"/> + <Setter Property="Image.Height" Value="24"/> + <Style.Triggers> + <DataTrigger Binding="{Binding IsMidTankLow}" Value="True"> + <Setter Property="Source" Value="../Images/Overview Icons/Warning.png"/> + </DataTrigger> + <DataTrigger Binding="{Binding FillingTimeoutError}" Value="True"> + <Setter Property="Source" Value="../Images/Overview Icons/Error.png"/> + <Setter Property="Image.Width" Value="21"/> + <Setter Property="Image.Height" Value="26"/> + </DataTrigger> + <DataTrigger Binding="{Binding MidTankEmpty}" Value="True"> + <Setter Property="Source" Value="../Images/Overview Icons/Error.png"/> + <Setter Property="Image.Width" Value="21"/> + <Setter Property="Image.Height" Value="26"/> + </DataTrigger> + <DataTrigger Binding="{Binding MidTankRefillPumpActive}" Value="True" > + <Setter Property="Source" Value="../Images/Overview Icons/UpdateInk.png"/> + </DataTrigger> + <DataTrigger Binding="{Binding JerricanPresent}" Value="False" > + <Setter Property="Source" Value="../Images/Overview Icons/JericanRemoved.png"/> + </DataTrigger> + </Style.Triggers> + </Style> + </Image.Style> + </Image> + </Grid> + </DockPanel> + </DataTemplate> + + <DataTemplate x:Key="LubLiquidBox" DataType="{x:Type models:JerricanLevelModel}"> + <DockPanel> + <TextBlock DockPanel.Dock="Bottom" Text="Lub" HorizontalAlignment="Center" Margin="0 8 0 0"></TextBlock> + <Grid Height="15" DockPanel.Dock="Top"> + <TextBlock DockPanel.Dock="Top" Height="15" VerticalAlignment="Top" TextAlignment="Center" Visibility="{Binding HasRemainingTimeoutError,Converter={StaticResource BooleanToVisibilityConverter}}" Text="{Binding RemainingTimeoutError, StringFormat='{}{0:hh}:{0:mm}m', FallbackValue=00:00}" HorizontalAlignment="Center" FontSize="{StaticResource TangoSmallFontSizeBar}" ></TextBlock> + </Grid> + <Grid > + <Grid ClipToBounds="True" HorizontalAlignment="Center"> + <Path Fill="{Binding Path=IDSPack.LiquidType, Converter={StaticResource LiquidTypeToBrushConverter}}" StrokeThickness="1.5" > + <Path.Resources> + <sys:Double x:Key="RectWidth">30</sys:Double> + <sys:Double x:Key="RectHeight">88</sys:Double> + </Path.Resources> + <Path.Data> + <CombinedGeometry GeometryCombineMode="Intersect"> + <CombinedGeometry.Geometry1> + <StaticResource ResourceKey="InkContainerPath"/> + </CombinedGeometry.Geometry1> + <CombinedGeometry.Geometry2> + <!--Rect="1,30 30,88"--> + <RectangleGeometry > + <RectangleGeometry.Rect> + <MultiBinding Converter="{StaticResource MidTankLevelToElementRectConverter}"> + <Binding Source="{StaticResource RectHeight}"/> + <Binding Source="{StaticResource RectWidth}"/> + <Binding Path="Level" /> + <Binding Path="IDSPack.MidTankType.LiterCapacity" /> + </MultiBinding> + </RectangleGeometry.Rect> + </RectangleGeometry> + </CombinedGeometry.Geometry2> + </CombinedGeometry> + </Path.Data> + + </Path> + <Path Stroke="{StaticResource TangoTextWatermarkBrush}" Fill="Transparent" StrokeThickness="1" Data="{StaticResource InkContainerPath}"> + + </Path> + </Grid> + <UniformGrid Rows="4" Columns="1" Margin="0 12 0 12" HorizontalAlignment="Center"> + <Rectangle Width="6" Height="2" Fill="{StaticResource TangoKeyboardKeyDarkBrush}"></Rectangle> + <Rectangle Width="6" Height="2" Fill="{StaticResource TangoKeyboardKeyDarkBrush}"></Rectangle> + <Rectangle Width="6" Height="2" Fill="{StaticResource TangoKeyboardKeyDarkBrush}"></Rectangle> + <Rectangle Width="6" Height="2" Fill="{StaticResource TangoKeyboardKeyDarkBrush}"></Rectangle> </UniformGrid> <Image Stretch="Fill" VerticalAlignment="Top" Margin="0 4 0 0"> <Image.Style> @@ -236,11 +317,11 @@ </Path> <Path Stroke="{StaticResource TangoTextWatermarkBrush}" Fill="Transparent" StrokeThickness="1" Data="{StaticResource InkContainerPath}"/> </Grid> - <UniformGrid Rows="4" Columns="1" Margin="0 15 0 15" HorizontalAlignment="Center"> - <Rectangle Stroke="{StaticResource TangoTextWatermarkBrush}" Width="10" Height="2" ></Rectangle> - <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle> - <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle> - <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle> + <UniformGrid Rows="4" Columns="1" Margin="0 12 0 12" HorizontalAlignment="Center"> + <Rectangle Fill="{StaticResource TangoKeyboardKeyDarkBrush}" Width="6" Height="2" ></Rectangle> + <Rectangle Width="6" Height="2" Fill="{StaticResource TangoKeyboardKeyDarkBrush}"></Rectangle> + <Rectangle Width="6" Height="2" Fill="{StaticResource TangoKeyboardKeyDarkBrush}"></Rectangle> + <Rectangle Width="6" Height="2" Fill="{StaticResource TangoKeyboardKeyDarkBrush}"></Rectangle> </UniformGrid> </Grid> </DockPanel> @@ -267,6 +348,10 @@ </Border> </DataTemplate> + <Style x:Key="DynamicResolutionGraph" TargetType="graphs:RealTimeGraph" BasedOn="{StaticResource {x:Type graphs:RealTimeGraph}}"> + <Setter Property="VerticalTicks" Value="5"></Setter> + </Style> + </UserControl.Resources> <Grid Width="998" Height="1123"> <Grid > @@ -396,10 +481,10 @@ <TextBlock FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"> <TextBlock.Style> <Style TargetType="{x:Type TextBlock}"> - <Setter Property="Text" Value="{Binding Job.LengthIncludingNumberOfUnitsAndSpools, TargetNullValue='-', FallbackValue='-', StringFormat=0.##}" /> + <Setter Property="Text" Value="{Binding Job.LengthIncludingNumberOfUnitsAndSpools, TargetNullValue='-', FallbackValue='-', StringFormat='#,0.##'}" /> <Style.Triggers> <DataTrigger Binding="{Binding IsSpoolView}" Value="True"> - <Setter Property="Text" Value="{Binding Job.LengthIncludingNumberOfUnits, TargetNullValue='-', FallbackValue='-', StringFormat=0.##}" /> + <Setter Property="Text" Value="{Binding Job.LengthIncludingNumberOfUnits, TargetNullValue='-', FallbackValue='-', StringFormat='#,0.##'}" /> </DataTrigger> </Style.Triggers> </Style> @@ -414,10 +499,10 @@ <TextBlock FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"> <TextBlock.Style> <Style TargetType="{x:Type TextBlock}"> - <Setter Property="Text" Value="{Binding Job.WeightIncludingNumberOfUnitsAndSpools, TargetNullValue='-', FallbackValue='-', StringFormat=0.##}" /> + <Setter Property="Text" Value="{Binding Job.WeightIncludingNumberOfUnitsAndSpools, TargetNullValue='-', FallbackValue='-', StringFormat='#,0.##'}" /> <Style.Triggers> <DataTrigger Binding="{Binding IsSpoolView}" Value="True"> - <Setter Property="Text" Value="{Binding Job.WeightIncludingNumberOfUnits, TargetNullValue='-', FallbackValue='-', StringFormat=0.##}" /> + <Setter Property="Text" Value="{Binding Job.WeightIncludingNumberOfUnits, TargetNullValue='-', FallbackValue='-', StringFormat='#,0.##'}" /> </DataTrigger> </Style.Triggers> </Style> @@ -432,10 +517,10 @@ <TextBlock FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"> <TextBlock.Style> <Style TargetType="{x:Type TextBlock}"> - <Setter Property="Text" Value="{Binding Job.NumberOfUnitsMultipliedBySpools, TargetNullValue='-', FallbackValue='-', StringFormat=0.##}" /> + <Setter Property="Text" Value="{Binding Job.NumberOfUnitsMultipliedBySpools, TargetNullValue='-', FallbackValue='-', StringFormat='#,0.##'}" /> <Style.Triggers> <DataTrigger Binding="{Binding IsSpoolView}" Value="True"> - <Setter Property="Text" Value="{Binding Job.NumberOfUnits, TargetNullValue='-', FallbackValue='-', StringFormat=0.##}" /> + <Setter Property="Text" Value="{Binding Job.NumberOfUnits, TargetNullValue='-', FallbackValue='-', StringFormat='#,0.#'}" /> </DataTrigger> </Style.Triggers> </Style> @@ -522,7 +607,7 @@ <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"> - <StackPanel Visibility="{Binding RunningJobStatus.IsSettingUp, TargetNullValue=true, Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <StackPanel Visibility="{Binding RunningJobStatus.IsSettingUp, Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> <Image Source="../Images/JobProgressView/drop.png" Stretch="None" VerticalAlignment="Center" /> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> @@ -535,7 +620,7 @@ <StackPanel Orientation="Horizontal" Margin="0 15 0 0" HorizontalAlignment="Center" Visibility="{Binding IsWeghtView, Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <TextBlock FontSize="{StaticResource TangoLargeInfoFontSize}" VerticalAlignment="Center"> <TextBlock.Text> - <MultiBinding Converter="{StaticResource ProgressLengthSpoolConverter}" StringFormat="0.0" TargetNullValue='-' FallbackValue='0' Mode="OneWay"> + <MultiBinding Converter="{StaticResource ProgressLengthSpoolConverter}" StringFormat="#,0." TargetNullValue='-' FallbackValue='0' Mode="OneWay"> <Binding Path="RunningJobStatus.TotalProgressMinusSettingUp" /> <Binding Path="IsSpoolView"/> <Binding Path="RunningJobStatus.ProgressMinusSettingUp" /> @@ -545,7 +630,7 @@ <TextBlock FontSize="{StaticResource TangoLargeInfoFontSize}" VerticalAlignment="Center" Text="/"></TextBlock> <TextBlock FontSize="{StaticResource TangoTitleFontSize}" VerticalAlignment="Center"> <TextBlock.Text> - <MultiBinding Converter="{StaticResource ProgressLengthSpoolConverter}" StringFormat="0" TargetNullValue='-' FallbackValue='0' Mode="OneWay"> + <MultiBinding Converter="{StaticResource ProgressLengthSpoolConverter}" StringFormat="#,0" TargetNullValue='-' FallbackValue='0' Mode="OneWay"> <Binding Path="RunningJobStatus.TotalProgressMinusSettingUp"/> <Binding Path="IsSpoolView"/> </MultiBinding> @@ -557,7 +642,7 @@ <StackPanel Orientation="Horizontal" Margin="0 10 0 0" HorizontalAlignment="Center" Visibility="{Binding IsWeghtView, Converter={StaticResource BooleanToVisibilityConverter}}"> <TextBlock FontSize="{StaticResource TangoLargeInfoFontSize}" VerticalAlignment="Center"> <TextBlock.Text> - <MultiBinding Converter="{StaticResource ProgressWeightSpoolConverter}" StringFormat="0.00" TargetNullValue='-' FallbackValue='0'> + <MultiBinding Converter="{StaticResource ProgressWeightSpoolConverter}" StringFormat="#,0.00" TargetNullValue='-' FallbackValue='0'> <Binding Path="RunningJobStatus.TotalProgressMinusSettingUp" /> <Binding Path="IsSpoolView"/> <Binding Path="RunningJobStatus.ProgressMinusSettingUp" /> @@ -568,7 +653,7 @@ <TextBlock FontSize="{StaticResource TangoLargeInfoFontSize}" VerticalAlignment="Center" Text="/"></TextBlock> <TextBlock FontSize="{StaticResource TangoTitleFontSize}" VerticalAlignment="Center"> <TextBlock.Text> - <MultiBinding Converter="{StaticResource ProgressWeightSpoolConverter}" StringFormat="0.#" TargetNullValue='-' FallbackValue='0' > + <MultiBinding Converter="{StaticResource ProgressWeightSpoolConverter}" StringFormat="#,0.#" TargetNullValue='-' FallbackValue='0' > <Binding Path="RunningJobStatus.TotalProgressMinusSettingUp"/> <Binding Path="IsSpoolView"/> <Binding Path="Job.GramPerLength" Mode="OneWay"/> @@ -659,7 +744,7 @@ <TextBlock x:Name="ProgressLength" VerticalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}">Job Length (m)</TextBlock> <TextBlock FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"> <TextBlock.Text> - <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="0.##" TargetNullValue='-' FallbackValue='-' Mode="OneWay"> + <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="#,0" TargetNullValue='-' FallbackValue='-' Mode="OneWay"> <Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/> <Binding Path="Job.Spools" Mode="OneWay"/> </MultiBinding> @@ -673,7 +758,7 @@ <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}">Job Weight (g)</TextBlock> <TextBlock FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"> <TextBlock.Text> - <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="0.##" TargetNullValue='-' FallbackValue='-' Mode="OneWay"> + <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" TargetNullValue='-' FallbackValue='-' Mode="OneWay"> <Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/> <Binding Path="Job.GramPerLength" Mode="OneWay"/> <Binding Path="Job.Spools" Mode="OneWay"/> @@ -886,7 +971,7 @@ <Image Margin="0 2 0 0" Source="../Images/Job Issues/job_length.png" Stretch="Uniform" VerticalAlignment="Top" HorizontalAlignment="Left" Width="Auto" Height="32" /> <TextBlock Margin="20 5 0 0" Width="Auto" FontWeight="SemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalAlignment="Top"> <TextBlock.Text> - <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="0.##" TargetNullValue='-' FallbackValue='-' Mode="OneWay"> + <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="#,0.##" TargetNullValue='-' FallbackValue='-' Mode="OneWay"> <Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/> <Binding Path="Job.Spools" Mode="OneWay"/> </MultiBinding> @@ -904,7 +989,7 @@ <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Column="2" Margin="0 0 0 0"> <Image Margin="0 2 0 0" Source="../Images/Job Issues/ttime_left.png" Stretch="Uniform" VerticalAlignment="Top" Height="32"/> - <TextBlock Margin="15 10 0 0" FontWeight="Light" FontSize="{StaticResource TangoComboBoxItemFontSize}" HorizontalAlignment="Center"> + <TextBlock Margin="15 5 0 0" FontWeight="Light" FontSize="{StaticResource TangoComboBoxItemFontSize}" HorizontalAlignment="Center"> <Run Text="{Binding RunningJobStatus.RemainingTime,Converter={StaticResource TimeSpanToTwoDigitsTimeConverter},FallbackValue=5}"></Run> <Run FontSize="16" Text="{Binding RunningJobStatus.RemainingTime,Converter={StaticResource TimeSpanToLabelConverter},FallbackValue=min}"></Run> @@ -942,12 +1027,15 @@ <SolidColorBrush Color="{Binding DryerZone3.Color}"/> </touch:TouchArcProgress.Foreground> </touch:TouchArcProgress> - <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="Bold" Text="{Binding DryerZone3.DisplayValue}"> - <TextBlock.Foreground> - <SolidColorBrush Color="{Binding DryerZone3.Color}"/> - </TextBlock.Foreground> + <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}" FontWeight="Bold" > + <Run Text="{Binding DryerZone3.DisplayValue}"> + <Run.Foreground> + <SolidColorBrush Color="{Binding DryerZone3.Color}"/> + </Run.Foreground> + </Run> + <Run Text="{Binding DryerZone3.DisplayMaxValue}" ></Run> </TextBlock> - <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoComboBoxItemFontSize}" >ºC</TextBlock> + <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoDefaultFontSize}" >ºC</TextBlock> </Grid> <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Dryer Zone 3</TextBlock> @@ -960,12 +1048,12 @@ <SolidColorBrush Color="{Binding DryerAir.Color}"/> </touch:TouchArcProgress.Foreground> </touch:TouchArcProgress> - <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Text="{Binding DryerAir.DisplayValue}"> + <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}" FontWeight="SemiBold" Text="{Binding DryerAir.DisplayValue}"> <TextBlock.Foreground> <SolidColorBrush Color="{Binding DryerAir.Color}"/> </TextBlock.Foreground> </TextBlock> - <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Text="ºC" > + <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoDefaultFontSize}" FontWeight="SemiBold" Text="ºC" > </TextBlock> </Grid> <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Dryer Air</TextBlock> @@ -977,12 +1065,15 @@ <SolidColorBrush Color="{Binding Tunnel.Color}"/> </touch:TouchArcProgress.Foreground> </touch:TouchArcProgress> - <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Text="{Binding Tunnel.DisplayValue}"> - <TextBlock.Foreground> - <SolidColorBrush Color="{Binding Tunnel.Color}"/> - </TextBlock.Foreground> + <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}" FontWeight="SemiBold" > + <Run Text="{Binding Tunnel.DisplayValue}"> + <Run.Foreground> + <SolidColorBrush Color="{Binding Tunnel.Color}"/> + </Run.Foreground> + </Run> + <Run Text="{Binding Tunnel.DisplayMaxValue}" ></Run> </TextBlock> - <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Text="ºC"></TextBlock> + <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoDefaultFontSize}" FontWeight="SemiBold" Text="ºC"></TextBlock> </Grid> <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Tunnel</TextBlock> @@ -994,12 +1085,12 @@ <SolidColorBrush Color="{Binding PumpsPressure.Color}"/> </touch:TouchArcProgress.Foreground> </touch:TouchArcProgress> - <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Text="{Binding PumpsPressure.DisplayValue}"> + <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}" FontWeight="SemiBold" Text="{Binding PumpsPressure.DisplayValue}"> <TextBlock.Foreground> <SolidColorBrush Color="{Binding PumpsPressure.Color}"/> </TextBlock.Foreground> </TextBlock> - <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Text="Bar"></TextBlock> + <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoDefaultFontSize}" FontWeight="SemiBold" Text="Bar"></TextBlock> </Grid> <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Pumps pressure</TextBlock> @@ -1011,12 +1102,12 @@ <SolidColorBrush Color="{Binding Lubricant.Color}"/> </touch:TouchArcProgress.Foreground> </touch:TouchArcProgress> - <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Text="{Binding Lubricant.DisplayValue, StringFormat=0.## }"> + <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}" FontWeight="SemiBold" Text="{Binding Lubricant.DisplayValue, StringFormat=0.## }"> <TextBlock.Foreground> <SolidColorBrush Color="{Binding Lubricant.Color}"/> </TextBlock.Foreground> </TextBlock> - <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Text="mVolts"></TextBlock> + <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoDefaultFontSize}" FontWeight="SemiBold" Text="mVolts"></TextBlock> </Grid> <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Lubricant</TextBlock> @@ -1089,7 +1180,7 @@ <TextBlock Margin="12 0 0 0 " VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}">Waste</TextBlock> </StackPanel> <StackPanel Orientation="Horizontal" Margin="-25 24 0 0"> - <Rectangle Height="88" Width="2" Fill="{StaticResource TangoColumnDividerBrush}" VerticalAlignment="Top" Margin="-15 15 0 0"/> + <Rectangle Height="88" Width="2" Fill="{StaticResource TangoTextWatermarkBrush}" VerticalAlignment="Top" Margin="-15 15 0 0"/> <ContentControl Margin="20 0 0 0" ContentTemplate="{StaticResource WasteBox}" Content="{Binding}" IsTabStop="False"/> </StackPanel> @@ -1107,9 +1198,10 @@ </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ItemsControl> - - <!--<Rectangle Height="88" Width="2" Fill="{StaticResource TangoColumnDividerBrush}" VerticalAlignment="Top" Margin="12 15 0 0"/> - <ContentControl Margin="45 0 0 0" ContentTemplate="{StaticResource LubBox}" Content="{Binding}" IsTabStop="False"/>--> + <StackPanel Orientation="Horizontal" Margin="40 0 0 0"> + <Rectangle Height="88" Width="2" Fill="{StaticResource TangoTextWatermarkBrush}" VerticalAlignment="Top" Margin="-15 15 0 0"/> + <ContentControl Margin="30 0 0 0" ContentTemplate="{StaticResource LubLiquidBox}" Content="{Binding MidTankLubLevel}" IsTabStop="False"/> + </StackPanel> </StackPanel> </StackPanel> </DockPanel> @@ -1117,11 +1209,69 @@ </StackPanel> <Border VerticalAlignment="Bottom" Height="2" Background="{StaticResource TangoLightBorderBrush}" Margin="0 0 0 0" CornerRadius="2"></Border> </Grid> + <Grid Grid.Row="3" x:Name="StatRealGraph" Margin="0 8 0 0"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="186"></ColumnDefinition> + <ColumnDefinition Width="32"></ColumnDefinition> + <ColumnDefinition Width="1*"></ColumnDefinition> + </Grid.ColumnDefinitions> + + <touch:TouchNavigationLinks BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 0" x:Name="navigationSTLinks" HorizontalContentAlignment="Left" + SelectedIndex="{Binding SelectedStatisticTabIndex,Mode=TwoWay}" VerticalAlignment="Bottom" Margin="0,10,0,20" Padding="0 0 0 0" + FontSize="{StaticResource TangoNavigationLinksFontSize}" LineThickness="0" PreviewTouchDown="NavigationSTLinks_PreviewTouchDown" PreviewMouseDown="NavigationSTLinks_PreviewMouseDown"> + + <DockPanel HorizontalAlignment="Stretch"> + <Image DockPanel.Dock="Left" Source="../Images/Overview Icons/pr_data.png" Stretch="UniformToFill" VerticalAlignment="Top" HorizontalAlignment="Left" Width="32" Height="32"/> + <TextBlock HorizontalAlignment="Left" Margin="12 0 0 0" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center">Production Data</TextBlock> + </DockPanel> + <DockPanel HorizontalAlignment="Stretch" IsEnabled="False" Margin="0 12 0 0"> + <Image DockPanel.Dock="Left" Source="../Images/Overview Icons/temperature.png" Stretch="UniformToFill" VerticalAlignment="Top" HorizontalAlignment="Left" Width="32" Height="32"/> + <TextBlock HorizontalAlignment="Left" Margin="12 0 0 0" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center" Foreground="{StaticResource TangoDisabledForegroundBrush}">Temperature</TextBlock> + </DockPanel> + <DockPanel HorizontalAlignment="Stretch" IsEnabled="False"> + <Image DockPanel.Dock="Left" Source="../Images/Overview Icons/pressure.png" Stretch="UniformToFill" VerticalAlignment="Top" HorizontalAlignment="Left" Width="32" Height="32"/> + <TextBlock HorizontalAlignment="Left" Margin="12 0 0 0" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center" Foreground="{StaticResource TangoDisabledForegroundBrush}">Pressure</TextBlock> + </DockPanel> + <DockPanel HorizontalAlignment="Stretch" IsEnabled="False" > + <Image DockPanel.Dock="Left" Source="../Images/Overview Icons/motor.png" Stretch="UniformToFill" VerticalAlignment="Top" HorizontalAlignment="Left" Width="32" Height="32"/> + <TextBlock HorizontalAlignment="Left" Margin="12 0 0 0" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center" Foreground="{StaticResource TangoDisabledForegroundBrush}">Motor</TextBlock> + </DockPanel> + <touch:TouchNavigationLinks.Style> + <Style TargetType="{x:Type touch:TouchNavigationLinks}"> + <Setter Property="ItemsPanel"> + <Setter.Value> + <ItemsPanelTemplate> + <UniformGrid Rows="4" /> + </ItemsPanelTemplate> + </Setter.Value> + </Setter> + </Style> + </touch:TouchNavigationLinks.Style> + + </touch:TouchNavigationLinks> + <Grid Grid.Column="1" Margin="0 40 0 0"> + <Rectangle Width="20" Height="2" Fill="{StaticResource TangoBlackInkBrush}" VerticalAlignment="Top" Margin="0 0 0 0" ></Rectangle> + <!--<Rectangle Width="2" Height="138" Margin="20 0 0 0" Fill="{StaticResource TangoBlackInkBrush}" VerticalAlignment="Top" ></Rectangle>--> + <Rectangle Margin="20 0 0 0" VerticalAlignment="Top" Fill="{StaticResource TangoBlackInkBrush}" Height="2" Width="138" HorizontalAlignment="Stretch"> + <Rectangle.LayoutTransform> + <TransformGroup> + <RotateTransform Angle="90"/> + </TransformGroup> + </Rectangle.LayoutTransform> + </Rectangle> + </Grid> + <Grid Grid.Column="2" x:Name="StatGrid" Margin="0,30,0.4,0"> + <Grid Visibility="{Binding SelectedStatisticTab,Converter={StaticResource StatisticTabToVisibilityConverter},ConverterParameter='Productiondata'}"> + <graphs:RealTimeGraph Style="{StaticResource PPC_RealTimeGraph_Flat}" Controller="{Binding JobController}" Background="Transparent" StringFormat="0" GridLinesBrush="{StaticResource Tango_RealTimeGraph_ForegroundBrush}" BorderBrush="Transparent" + VerticalAxisVisibility="Visible" HorizontalAxisVisibility="Visible" VerticalTicks =" 5" AxisLabelAngle="0.0"/> + </Grid> + </Grid> + </Grid> </Grid> </Grid> </Grid> - <Grid VerticalAlignment="Bottom" Grid.ColumnSpan="2" Margin="10 0 1 0"> - <touch:TouchExpander x:Name="Notifications" Style="{StaticResource TouchRoundedExpander}" IsTabStop="False" KeyboardNavigation.TabNavigation ="None" BorderThickness="0" IsExpanded="false" CornerRadius="20 20 0 0" > + <Grid VerticalAlignment="Bottom" Grid.ColumnSpan="2" Margin="10 0 10 0"> + <touch:TouchExpander x:Name="Notifications" Style="{StaticResource TouchRoundedExpander}" IsTabStop="False" KeyboardNavigation.TabNavigation ="None" BorderThickness="0" CornerRadius="20 20 0 0" Margin="0 0 0 -1" IsExpanded="{Binding IsExpandedNotifications, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"> <touch:TouchExpander.Header> <DockPanel > <touch:TouchButton Margin="0 0 20 0" Content="Clear All" DockPanel.Dock="Right" Width="120" Height="38" HorizontalAlignment="Right" VerticalAlignment="Center" EnableDropShadow="False" Background="Transparent" BorderThickness="1" CornerRadius="19" BorderBrush="{StaticResource TangoPrimaryAccentBrush}" Foreground="{StaticResource TangoPrimaryAccentBrush}" Command="{Binding ClearAllNotificationsCommand}" Visibility="{Binding NotificationProvider.HasNotificationItems, Converter={StaticResource BooleanToVisibilityConverter}}" > @@ -1164,13 +1314,13 @@ </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> - <Grid HorizontalAlignment="Stretch" Width="1220" Height="62"> + <Grid HorizontalAlignment="Stretch" Height="60"> <Border BorderThickness="1" Margin="-1 0 0 0" BorderBrush="{StaticResource TangoDividerBrush}"> <Grid HorizontalAlignment="Stretch" > <Grid.ColumnDefinitions> <ColumnDefinition Width="56"/> <ColumnDefinition Width="1*"/> - <ColumnDefinition Width="56"/> + <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <touch:TouchIcon Margin="24 0 0 0" DockPanel.Dock="Left" Height="32" Grid.Column="0"> <touch:TouchIcon.Style> @@ -1201,10 +1351,12 @@ </Style> </touch:TouchIcon.Style> </touch:TouchIcon> - <StackPanel Margin="15 3 20 3" VerticalAlignment="Center" Grid.Column="1"> - <TextBlock Text="{Binding Message}" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Foreground="Black" VerticalAlignment="Center" ></TextBlock> - <TextBlock Margin="0 5 0 0" Foreground="{StaticResource TangoDarkForegroundBrush}" Text="{Binding ExpandedMessage}" FontSize="{StaticResource TangoSmallFontSize}" TextWrapping="Wrap" VerticalAlignment="Center" /> + + <StackPanel Margin="15 3 10 5" VerticalAlignment="Center" Grid.Column="1"> + <TextBlock Text="{Binding Message}" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Foreground="Black" VerticalAlignment="Top" ></TextBlock> + <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoDarkForegroundBrush}" Text="{Binding ExpandedMessage}" FontSize="{StaticResource TangoSmallFontSize}" TextWrapping="NoWrap" VerticalAlignment="Center" HorizontalAlignment="Left" TextTrimming="CharacterEllipsis"/> </StackPanel> + <Grid Grid.Column="2" Width="40" HorizontalAlignment="Right" VerticalAlignment="Stretch" Visibility="{Binding CanClose,Converter={StaticResource BooleanToVisibilityConverter}}"> <Grid Margin="0 0 20 0" HorizontalAlignment="Right" VerticalAlignment="Center" Width="14" Height="14"> <touch:TouchIcon Icon="Close" Foreground="Black" /> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml.cs index 2ee98bc2b..e49e062b7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml.cs @@ -57,5 +57,15 @@ namespace Tango.PPC.UI.Views { _timer.Stop(); } + + private void NavigationSTLinks_PreviewTouchDown(object sender, TouchEventArgs e) + { + e.Handled = true; + } + + private void NavigationSTLinks_PreviewMouseDown(object sender, MouseButtonEventArgs e) + { + e.Handled = true; + } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml index 22952a827..b08aab298 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml @@ -11,7 +11,14 @@ d:DesignHeight="1280" d:DesignWidth="800" Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:PowerOffViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.PowerOffViewVM}"> <Grid> <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> - <touch:TouchGifAnimation Source="/Images/power_off_2.gif" EnableAnimation="{Binding IsVisible}" HorizontalAlignment="Center" /> + <TextBlock FontSize="{StaticResource TangoTitleFontSize}" HorizontalAlignment="Center" Margin="0 50 0 0" Text="{Binding Status.Message}" TextTrimming="CharacterEllipsis"/> + + <Grid Margin="0 30 0 0"> + <touch:TouchGifAnimation Source="/Images/power_off_2.gif" EnableAnimation="{Binding IsVisible}" HorizontalAlignment="Center" /> + <TextBlock FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="DemiBold" HorizontalAlignment="Center" Margin="0 50 0 0"> + <Run Text="{Binding Status.ProgressPercentage, TargetNullValue=0}"/>% + </TextBlock> + </Grid> <TextBlock HorizontalAlignment="Center" Margin="0 60 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Machine is turning Off</TextBlock> <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayTextBrush}">Do not unplug machine while turning off</TextBlock> <touch:TouchButton Command="{Binding AbortCommand}" Style="{StaticResource TangoHollowButton}" Margin="0 100 0 0" HorizontalAlignment="Center" Width="200" Height="50">ABORT</touch:TouchButton> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index d72e75011..efc5f8179 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> + <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />--> </requestedPrivileges> </security> </trustInfo> |
