diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-23 16:49:49 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-23 16:49:49 +0300 |
| commit | bc94c84ee20ea01618241e8a4d32c2a77b4084cc (patch) | |
| tree | 10761eb1d3474c45af6894bdc535b09f6f8e4197 /Software | |
| parent | 304735006580cb2f6728bedeb3393dbefc2e14f5 (diff) | |
| download | Tango-bc94c84ee20ea01618241e8a4d32c2a77b4084cc.tar.gz Tango-bc94c84ee20ea01618241e8a4d32c2a77b4084cc.zip | |
Added data processing of BtsrsInError, DancersInError, WindersInError in GUI.
Diffstat (limited to 'Software')
8 files changed, 165 insertions, 53 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Error.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Error.png Binary files differindex b9138f444..a5a178bdb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Error.png +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Error.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Normal.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Normal.png Binary files differindex a562e9228..8ddeecbe0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Normal.png +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Normal.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorItem.cs new file mode 100644 index 000000000..3925a1752 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorItem.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.PPC.UI.Models +{ + public class MachineOverviewErrorItem : ExtendedObject + { + private bool _isErrorState; + + public bool IsErrorState + { + get { return _isErrorState; } + set { _isErrorState = value; RaisePropertyChangedAuto();} + } + + public MachineOverviewErrorItem() + { + IsErrorState = false; + } + + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs new file mode 100644 index 000000000..d293c4418 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.PPC.UI.Models +{ + public class MachineOverviewErrorStates : ExtendedObject + { + public ObservableCollection<MachineOverviewErrorItem> Winders { get; set; } + + public ObservableCollection<MachineOverviewErrorItem> Dancers { get; set; } + + public ObservableCollection<MachineOverviewErrorItem> BTSRs { get; set; } + + public MachineOverviewErrorStates() + { + Winders = new ObservableCollection<MachineOverviewErrorItem>(); + Dancers = new ObservableCollection<MachineOverviewErrorItem>(); + BTSRs = new ObservableCollection<MachineOverviewErrorItem>(); + for ( int i = 0; i < 4 ; i++) + { + Winders.Add( new MachineOverviewErrorItem()); + Dancers.Add(new MachineOverviewErrorItem()); + BTSRs.Add(new MachineOverviewErrorItem()); + } + } + + public void UpdateWinders(List<bool> updates) + { + UpdateCollection(Winders, updates); + } + public void UpdateDancers(List<bool> updates) + { + UpdateCollection(Dancers, updates); + } + public void UpdateBTSRs(List<bool> updates) + { + UpdateCollection(BTSRs, updates); + } + + private void UpdateCollection(ObservableCollection<MachineOverviewErrorItem> collection, List<bool> updates ) + { + if (collection.Count == updates.Count) + { + for (int i = 0; i < collection.Count; i++) + { + collection[i].IsErrorState = updates[i]; + } + } + } + } +} 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 51600b0e8..a3ec9667f 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 @@ -238,9 +238,11 @@ <Compile Include="Dialogs\UpdateFromFileViewVM.cs" /> <Compile Include="Helpers\DpiHelper.cs" /> <Compile Include="InternalModule.cs" /> + <Compile Include="Models\MachineOverviewErrorStates.cs" /> <Compile Include="Models\MachineOverviewItem.cs" /> <Compile Include="Models\MachineOverviewModel.cs" /> <Compile Include="Models\JerricanLevelModel.cs" /> + <Compile Include="Models\MachineOverviewErrorItem.cs" /> <Compile Include="Modules\DefaultPPCModuleLoader.cs" /> <Compile Include="Navigation\EurekaNavigationManager.cs" /> <Compile Include="Navigation\DefaultNavigationManager.cs" /> @@ -962,7 +964,7 @@ if $(ConfigurationName) == Eureka copy /Y "$(ProjectDir)Intro.wmv" "$(TargetDir) </PropertyGroup> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> <Import Project="..\..\packages\WPFMediaKit.2.2.0\build\WPFMediaKit.targets" Condition="Exists('..\..\packages\WPFMediaKit.2.2.0\build\WPFMediaKit.targets')" /> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs index 828047ccf..1182ba50e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -206,7 +206,9 @@ namespace Tango.PPC.UI.ViewModels get { return _jobOutlineTicket; } set { _jobOutlineTicket = value; RaisePropertyChangedAuto(); } } - + + public MachineOverviewErrorStates MachineErrorStates { get; set; } + #endregion #region Commands @@ -254,6 +256,7 @@ namespace Tango.PPC.UI.ViewModels IsWeghtView = false; OverviewModel = new MachineOverviewModel(); + MachineErrorStates = new MachineOverviewErrorStates(); } public override void OnApplicationReady() @@ -275,6 +278,7 @@ namespace Tango.PPC.UI.ViewModels private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) { UpdateMidTankLevels(status); + UpdateMachineStatusErrors(status); } private void UpdateMidTankLevels(MachineStatus status) { @@ -348,6 +352,16 @@ namespace Tango.PPC.UI.ViewModels } } + private void UpdateMachineStatusErrors(MachineStatus status) + { + var windersInError = status.WindersInError.ToList();// to test + MachineErrorStates.UpdateWinders(windersInError); + var dansersInError = status.DancersInError.ToList(); + MachineErrorStates.UpdateDancers(dansersInError); + var btsrsInErrors = status.BtsrsInError.ToList(); + MachineErrorStates.UpdateBTSRs(btsrsInErrors); + } + private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e) { //foreach (var cartridge in e.Status.CartridgesStatuses.Where(x => x.Cartridge.Slot != CartridgeSlot.Ink)) 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 666fffe72..b6bda0892 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -168,19 +168,25 @@ <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle> <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle> </UniformGrid> - <Image Stretch="Fill" VerticalAlignment="Top" Width="24" Height="24" Margin="0 4 0 0"> + <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"/> @@ -240,6 +246,27 @@ </DockPanel> </DataTemplate> + <DataTemplate x:Key="ErrorState" DataType="{x:Type models:MachineOverviewErrorItem}"> + <Border Margin="0"> + <Image Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Center" > + <Image.Style> + <Style> + <Setter Property="Image.Width" Value="24"/> + <Setter Property="Image.Height" Value="24"/> + <Setter Property="Image.Source" Value="../Images/Overview Icons/Normal.png"/> + <Style.Triggers> + <DataTrigger Binding="{Binding IsErrorState}" Value="True"> + <Setter Property="Image.Source" Value="../Images/Overview Icons/Error.png"/> + <Setter Property="Image.Width" Value="21"/> + <Setter Property="Image.Height" Value="26"/> + </DataTrigger> + </Style.Triggers> + </Style> + </Image.Style> + </Image> + </Border> + </DataTemplate> + </UserControl.Resources> <Grid Width="960" Height="1080"> <Grid > @@ -963,43 +990,25 @@ <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> <StackPanel Orientation="Vertical"> <Border Height="184" Width="83" VerticalAlignment="Center" CornerRadius="2 0 0 2" BorderThickness="0" BorderBrush="{StaticResource TangoBlackInkBrush}"> - <UniformGrid Columns="1" Rows="4" Margin="24"> - <Image Stretch="Fill" Width="24" Height="24" Source="../Images/Overview Icons/Normal.png" HorizontalAlignment="Center" > - <!--<Image.Style> - <Style> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.BTSR}}" Value="True"> - <Setter Property="Image.Source" Value="../Images/Overview Icons/Error.png"/> - </DataTrigger> - </Style.Triggers> - </Style> - </Image.Style>--> - </Image> - <Image Stretch="Fill" Width="24" Height="24" Source="../Images/Overview Icons/Normal.png" HorizontalAlignment="Center" ></Image> - <Image Stretch="Fill" Width="24" Height="24" Source="../Images/Overview Icons/Normal.png" HorizontalAlignment="Center" ></Image> - <Image Stretch="Fill" Width="24" Height="24" Source="../Images/Overview Icons/Normal.png" HorizontalAlignment="Center" ></Image> - </UniformGrid> + <ItemsControl Margin="0 21 0 9" ItemsSource="{Binding MachineErrorStates.Winders}" ItemTemplate="{StaticResource ErrorState}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="1" Rows="4" IsItemsHost="True" VerticalAlignment="Stretch"></UniformGrid> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + </ItemsControl> </Border> <TextBlock HorizontalAlignment="Center" Margin="0 4 0 0" FontWeight="Thin">Winder</TextBlock> </StackPanel> <StackPanel Orientation="Vertical"> - <Border Height="171" Width="95" VerticalAlignment="Center" CornerRadius="0" BorderThickness="0" BorderBrush="{StaticResource TangoBlackInkBrush}"> - <UniformGrid Columns="1" Rows="4" Margin="0 21 0 9" VerticalAlignment="Stretch"> - <Image Stretch="Fill" Width="24" Height="24" Source="../Images/Overview Icons/Normal.png" HorizontalAlignment="Center" > - <!--<Image.Style> - <Style> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.BTSR}}" Value="True"> - <Setter Property="Image.Source" Value="../Images/Overview Icons/Error.png"/> - </DataTrigger> - </Style.Triggers> - </Style> - </Image.Style>--> - </Image> - <Image Stretch="Fill" Width="24" Height="24" Source="../Images/Overview Icons/Normal.png" HorizontalAlignment="Center" ></Image> - <Image Stretch="Fill" Width="24" Height="24" Source="../Images/Overview Icons/Normal.png" HorizontalAlignment="Center" ></Image> - <Image Stretch="Fill" Width="24" Height="24" Source="../Images/Overview Icons/Normal.png" HorizontalAlignment="Center" ></Image> - </UniformGrid> + <Border Height="171" Width="95" VerticalAlignment="Center" CornerRadius="0" BorderThickness="0" BorderBrush="{StaticResource TangoBlackInkBrush}"> + <ItemsControl Margin="0 21 0 9" ItemsSource="{Binding MachineErrorStates.Dancers}" ItemTemplate="{StaticResource ErrorState}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="1" Rows="4" IsItemsHost="True" VerticalAlignment="Stretch"></UniformGrid> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + </ItemsControl> </Border> <TextBlock HorizontalAlignment="Center" Margin="14 18 14 14" FontWeight="Thin">Dancer</TextBlock> </StackPanel> @@ -1007,22 +1016,13 @@ <StackPanel Orientation="Vertical" Margin="274 0 0 0"> <Border Height="171" Width="95" VerticalAlignment="Center" CornerRadius="0" BorderThickness="0" BorderBrush="{StaticResource TangoBlackInkBrush}"> - <UniformGrid Columns="1" Rows="4" Margin="0 21 0 9" VerticalAlignment="Stretch"> - <Image Stretch="Fill" Width="24" Height="24" Source="../Images/Overview Icons/Normal.png" HorizontalAlignment="Center" > - <!--<Image.Style> - <Style> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.BTSR}}" Value="True"> - <Setter Property="Image.Source" Value="../Images/Overview Icons/Error.png"/> - </DataTrigger> - </Style.Triggers> - </Style> - </Image.Style>--> - </Image> - <Image Stretch="Fill" Width="24" Height="24" Source="../Images/Overview Icons/Normal.png" HorizontalAlignment="Center" ></Image> - <Image Stretch="Fill" Width="24" Height="24" Source="../Images/Overview Icons/Normal.png" HorizontalAlignment="Center" ></Image> - <Image Stretch="Fill" Width="24" Height="24" Source="../Images/Overview Icons/Normal.png" HorizontalAlignment="Center" ></Image> - </UniformGrid> + <ItemsControl Margin="0 21 0 9" ItemsSource="{Binding MachineErrorStates.BTSRs}" ItemTemplate="{StaticResource ErrorState}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="1" Rows="4" IsItemsHost="True" VerticalAlignment="Stretch"></UniformGrid> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + </ItemsControl> </Border> <TextBlock HorizontalAlignment="Center" Margin="0 18 0 0" FontWeight="Thin">BTSR</TextBlock> </StackPanel> diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 3543b8b3a..0e00bee3e 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -170,8 +170,22 @@ namespace Tango.Emulations.Emulators MidTankLevel = 2.5, }); } + for (int i = 0; i < 4; i++) + { + if( i == 2) + { + MachineStatus.WindersInError.Add(false); + MachineStatus.DancersInError.Add(true); + MachineStatus.BtsrsInError.Add(true); + } + else { + MachineStatus.WindersInError.Add(false); + MachineStatus.DancersInError.Add(false); + MachineStatus.BtsrsInError.Add(false); + } + } - EventsStates = MachineEventState.GetAllEventsStates(); + EventsStates = MachineEventState.GetAllEventsStates(); _valveStates = new List<ValveState>(); _blower_states = new List<SetBlowerStateRequest>(); |
