diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-17 15:54:30 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-17 15:54:30 +0300 |
| commit | 11aff2c52535254745dd521322b2b7f46ae16123 (patch) | |
| tree | e122666e3f2203fb0f2f5f5024b20aa2fe77aade /Software/Visual_Studio/PPC/Modules | |
| parent | 67fbfd4810548b363ea2e3a1a0454408020df42f (diff) | |
| download | Tango-11aff2c52535254745dd521322b2b7f46ae16123.tar.gz Tango-11aff2c52535254745dd521322b2b7f46ae16123.zip | |
PPC. Added General Information dialog. Changes in System Technion for Eureka.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs | 28 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml | 186 |
2 files changed, 212 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs index 452907366..e3f695514 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs @@ -15,6 +15,7 @@ using Tango.PPC.Common.OS; using Tango.Settings; using System.Data.Entity; using Tango.PPC.Common.UWF; +using Tango.BL.Entities; namespace Tango.PPC.Technician.ViewModels { @@ -74,6 +75,14 @@ namespace Tango.PPC.Technician.ViewModels set { _totalDyeMeters = value; RaisePropertyChangedAuto(); } } + public Site CurrentSite { get; set; } + + public String SiteName + { + get { return CurrentSite == null? "" : CurrentSite.Name; } + } + + public RelayCommand ResetDeviceCommand { get; set; } public RelayCommand RestartCommand { get; set; } @@ -181,6 +190,8 @@ namespace Tango.PPC.Technician.ViewModels _statsTimer.Interval = 2000; _statsTimer.Elapsed += _statsTimer_Elapsed; _statsTimer.Start(); + + InitSite(); } private void _statsTimer_Elapsed(object sender, ElapsedEventArgs e) @@ -299,5 +310,22 @@ namespace Tango.PPC.Technician.ViewModels TotalDyeMeters = "error!"; } } + + public async void InitSite() + { + if (CurrentSite == null) + { + var machine = MachineProvider.Machine; + if (machine != null && !String.IsNullOrEmpty(machine.SiteGuid)) + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var site = (await db.Sites.Where(x => x.Guid == machine.SiteGuid).ToListAsync()).FirstOrDefault(); + CurrentSite = site; + RaisePropertyChanged( nameof(SiteName)); + } + } + } + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml index fc0f734ff..8ef29bb7e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml @@ -110,7 +110,7 @@ </touch:TouchButton> </StackPanel> - <FlowDocumentScrollViewer VerticalScrollBarVisibility="Disabled"> + <FlowDocumentScrollViewer VerticalScrollBarVisibility="Disabled" Visibility="{Binding BuildProvider.IsEureka, Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <FlowDocument> <Table CellSpacing="0" FontFamily="{StaticResource TangoFlexoFontFamily}"> <Table.Resources> @@ -174,7 +174,7 @@ </TableCell> </TableRow> - <TableRow> + <TableRow > <TableCell> <Paragraph> <TextBlock>FPGA 1:</TextBlock> @@ -320,6 +320,188 @@ </Table> </FlowDocument> </FlowDocumentScrollViewer> + <FlowDocumentScrollViewer VerticalScrollBarVisibility="Disabled" Visibility="{Binding BuildProvider.IsEureka, Converter={StaticResource BooleanToVisibilityConverter}}"> + <FlowDocument> + <Table CellSpacing="0" FontFamily="{StaticResource TangoFlexoFontFamily}"> + <Table.Resources> + <Style TargetType="{x:Type TableRowGroup}"> + <Setter Property="FontSize" Value="{StaticResource TangoDefaultFontSize}"/> + </Style> + + <Style TargetType="TableCell"> + <Setter Property="BorderThickness" Value="0 0 0 1"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource TangoGrayBrush}"></Setter> + <Setter Property="Padding" Value="5"></Setter> + </Style> + </Table.Resources> + <Table.Columns> + <TableColumn Width="160" /> + <TableColumn /> + <TableColumn /> + </Table.Columns> + + <TableRowGroup> + + <TableRow> + <TableCell> + <Paragraph> + <TextBlock>Environment:</TextBlock> + </Paragraph> + </TableCell> + + <TableCell> + <Paragraph> + <TextBlock Text="{Binding Settings.DeploymentSlot,Converter={StaticResource EnumToDescriptionConverter},Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/> + </Paragraph> + </TableCell> + </TableRow> + + <TableRow> + <TableCell> + <Paragraph> + <TextBlock>Application Version:</TextBlock> + </Paragraph> + </TableCell> + + <TableCell> + <Paragraph> + <TextBlock Text="{Binding ApplicationManager.VersionAndTag,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/> + </Paragraph> + </TableCell> + </TableRow> + + <TableRow> + <TableCell> + <Paragraph> + <TextBlock>Site:</TextBlock> + </Paragraph> + </TableCell> + + <TableCell> + <Paragraph> + <TextBlock Text="{Binding SiteName,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/> + </Paragraph> + </TableCell> + </TableRow> + + <TableRow> + <TableCell> + <Paragraph> + <TextBlock>Machine S/N:</TextBlock> + </Paragraph> + </TableCell> + + <TableCell> + <Paragraph> + <TextBlock Text="{Binding MachineProvider.Machine.SerialNumber,Mode=OneWay,IsAsync=True,FallbackValue='0000'}"/> + </Paragraph> + </TableCell> + </TableRow> + + <TableRow> + <TableCell> + <Paragraph> + <TextBlock>Firmware Version:</TextBlock> + </Paragraph> + </TableCell> + + <TableCell> + <Paragraph> + <TextBlock Text="{Binding MachineProvider.MachineOperator.DeviceInformation.Version,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/> + </Paragraph> + </TableCell> + </TableRow> + + <TableRow> + <TableCell> + <Paragraph> + <TextBlock>CPU:</TextBlock> + </Paragraph> + </TableCell> + + <TableCell> + <Paragraph> + <TextBlock> + <Run Text="{Binding CPU,Mode=OneWay,StringFormat='0',FallbackValue=0}"></Run> + <Run>%</Run> + </TextBlock> + </Paragraph> + </TableCell> + </TableRow> + + <TableRow> + <TableCell> + <Paragraph> + <TextBlock>RAM:</TextBlock> + </Paragraph> + </TableCell> + + <TableCell> + <Paragraph> + <TextBlock Text="{Binding RAM,Mode=OneWay,FallbackValue=0,Converter={StaticResource ByteArrayToFileSizeConverter},StringFormat='0'}"></TextBlock> + </Paragraph> + </TableCell> + </TableRow> + + <TableRow> + <TableCell> + <Paragraph> + <TextBlock>Up Time:</TextBlock> + </Paragraph> + </TableCell> + + <TableCell> + <Paragraph> + <TextBlock Text="{Binding UpTime,Mode=OneWay,StringFormat=hh\\:mm\\:ss,FallbackValue='00:00:00'}"></TextBlock> + </Paragraph> + </TableCell> + </TableRow> + + <TableRow> + <TableCell> + <Paragraph> + <TextBlock>IP Address:</TextBlock> + </Paragraph> + </TableCell> + + <TableCell> + <Paragraph> + <TextBlock Text="{Binding IPAddress,Mode=OneWay,FallbackValue=0}"></TextBlock> + </Paragraph> + </TableCell> + </TableRow> + + <TableRow> + <TableCell> + <Paragraph> + <TextBlock>Total Dye Time:</TextBlock> + </Paragraph> + </TableCell> + + <TableCell> + <Paragraph> + <TextBlock Text="{Binding TotalDyeTime,Mode=OneWay,FallbackValue=0}"></TextBlock> + </Paragraph> + </TableCell> + </TableRow> + + <TableRow> + <TableCell> + <Paragraph> + <TextBlock>Total Dye Meters:</TextBlock> + </Paragraph> + </TableCell> + + <TableCell> + <Paragraph> + <TextBlock Text="{Binding TotalDyeMeters,Mode=OneWay,FallbackValue=0}"></TextBlock> + </Paragraph> + </TableCell> + </TableRow> + </TableRowGroup> + </Table> + </FlowDocument> + </FlowDocumentScrollViewer> </DockPanel> </touch:LightTouchScrollViewer> </Grid> |
