aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-07-25 14:18:41 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-07-25 14:18:41 +0300
commitabbfd75f45b636c3976f6769bbdc4615d88b16f8 (patch)
tree0acc58b5e10bd7dc6d5f28c37d38f7ce283a5b7f /Software/Visual_Studio/PPC
parent13012a106aac961eaba844b2f525287a0e021b2d (diff)
downloadTango-abbfd75f45b636c3976f6769bbdc4615d88b16f8.tar.gz
Tango-abbfd75f45b636c3976f6769bbdc4615d88b16f8.zip
Added FirmwareVersion and arranged the about list
Related Work Items: #8638
Diffstat (limited to 'Software/Visual_Studio/PPC')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Resume/JobResumeDB.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml145
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs80
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
4 files changed, 205 insertions, 24 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Resume/JobResumeDB.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Resume/JobResumeDB.cs
index b2dcffcdd..28184eee1 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Resume/JobResumeDB.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Resume/JobResumeDB.cs
@@ -32,7 +32,7 @@ namespace Tango.PPC.Jobs.Resume
{
String dbFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "Job Resume v2");
Directory.CreateDirectory(dbFolder);
- _db = new LiteDatabase($"Filename={Path.Combine(dbFolder, "job_resume.db")}");
+ _db = new LiteDatabase($"Filename={Path.Combine(dbFolder, "job_resume.db")};connection=shared");
_collection = _db.GetCollection<JobResumeModel>("JobResume");
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml
index 8ae0f4354..fe9875009 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.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"
- Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="750" Height="700" d:DataContext="{d:DesignInstance Type=local:GeneralInformationViewVM, IsDesignTimeCreatable=False}">
+ Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="750" Height="1000" d:DataContext="{d:DesignInstance Type=local:GeneralInformationViewVM, IsDesignTimeCreatable=False}">
<Grid Margin="20">
<DockPanel>
@@ -16,11 +16,12 @@
<StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center">
<Image Source="../Images/logo.png" RenderOptions.BitmapScalingMode="Fant" Width="157" Height="51" Stretch="Uniform" HorizontalAlignment="Center" Margin="0 10 0 10"/>
- <TextBlock VerticalAlignment="Center" Margin="0 30 0 0" FontSize="{StaticResource TangoHeaderFontSize}">General Information</TextBlock>
+
</StackPanel>
- <Grid Margin="0 30 0 0">
- <FlowDocumentScrollViewer VerticalScrollBarVisibility="Disabled" >
+ <StackPanel Margin="0 20 0 0" Orientation="Vertical">
+ <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 30 0 0" FontSize="{StaticResource TangoDialogFontSize}">Machine information:</TextBlock>
+ <FlowDocumentScrollViewer VerticalScrollBarVisibility="Disabled" Margin="0 10 0 0">
<FlowDocument>
<Table CellSpacing="0" FontFamily="{StaticResource TangoFlexoFontFamily}">
<Table.Resources>
@@ -41,6 +42,32 @@
</Table.Columns>
<TableRowGroup>
+ <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>Site:</TextBlock>
+ </Paragraph>
+ </TableCell>
+
+ <TableCell>
+ <Paragraph>
+ <TextBlock Text="{Binding SiteName,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/>
+ </Paragraph>
+ </TableCell>
+ </TableRow>
<TableRow>
<TableCell>
@@ -55,31 +82,44 @@
</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>Application Version:</TextBlock>
+ <TextBlock>Up Time:</TextBlock>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
- <TextBlock Text="{Binding ApplicationManager.VersionAndTag,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/>
+ <TextBlock Text="{Binding UpTime,Mode=OneWay,StringFormat=hh\\:mm\\:ss,FallbackValue='00:00:00'}"></TextBlock>
</Paragraph>
</TableCell>
</TableRow>
+
<TableRow>
<TableCell>
<Paragraph>
- <TextBlock>Site:</TextBlock>
+ <TextBlock>Total Dye Time:</TextBlock>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
- <TextBlock Text="{Binding SiteName,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/>
+ <TextBlock Text="{Binding TotalDyeTime,Mode=OneWay,FallbackValue=0}"></TextBlock>
</Paragraph>
</TableCell>
</TableRow>
@@ -87,90 +127,153 @@
<TableRow>
<TableCell>
<Paragraph>
- <TextBlock>Machine S/N:</TextBlock>
+ <TextBlock>Total Dye Meters:</TextBlock>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
- <TextBlock Text="{Binding MachineProvider.Machine.SerialNumber,Mode=OneWay,IsAsync=True,FallbackValue='0000'}"/>
+ <TextBlock Text="{Binding TotalDyeMeters,Mode=OneWay,FallbackValue=0}"></TextBlock>
</Paragraph>
</TableCell>
</TableRow>
+ </TableRowGroup>
+ </Table>
+ </FlowDocument>
+ </FlowDocumentScrollViewer>
+ <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoDialogFontSize}">Installed Software &amp; Firmware:</TextBlock>
+ <FlowDocumentScrollViewer VerticalScrollBarVisibility="Disabled" Margin="0 10 0 0">
+ <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>Firmware Version:</TextBlock>
+ <TextBlock>Application Version:</TextBlock>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
- <TextBlock Text="{Binding MachineProvider.MachineOperator.DeviceInformation.Version,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/>
+ <TextBlock Text="{Binding ApplicationManager.VersionAndTag,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/>
</Paragraph>
</TableCell>
</TableRow>
<TableRow>
<TableCell>
<Paragraph>
- <TextBlock>Up Time:</TextBlock>
+ <TextBlock>Main Firmware:</TextBlock>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
- <TextBlock Text="{Binding UpTime,Mode=OneWay,StringFormat=hh\\:mm\\:ss,FallbackValue='00:00:00'}"></TextBlock>
+ <TextBlock Text="{Binding MachineProvider.MachineOperator.DeviceInformation.Version,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/>
</Paragraph>
</TableCell>
</TableRow>
+
<TableRow>
<TableCell>
<Paragraph>
- <TextBlock>IP Address:</TextBlock>
+ <TextBlock>Head Firmware:</TextBlock>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
- <TextBlock Text="{Binding IPAddress,Mode=OneWay,FallbackValue=0}"></TextBlock>
+ <TextBlock Text="{Binding HeadFirmware,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/>
</Paragraph>
</TableCell>
</TableRow>
+ <TableRow>
+ <TableCell>
+ <Paragraph>
+ <TextBlock>Dryer Firmware:</TextBlock>
+ </Paragraph>
+ </TableCell>
+ <TableCell>
+ <Paragraph>
+ <TextBlock Text="{Binding DryerFirmware,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/>
+ </Paragraph>
+ </TableCell>
+ </TableRow>
<TableRow>
<TableCell>
<Paragraph>
- <TextBlock>Total Dye Time:</TextBlock>
+ <TextBlock>Mid-tanks Firmware:</TextBlock>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
- <TextBlock Text="{Binding TotalDyeTime,Mode=OneWay,FallbackValue=0}"></TextBlock>
+ <TextBlock Text="{Binding MidtanksFirmware,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/>
</Paragraph>
</TableCell>
</TableRow>
+ <TableRow>
+ <TableCell>
+ <Paragraph>
+ <TextBlock>Lubricant Firmware:</TextBlock>
+ </Paragraph>
+ </TableCell>
+ <TableCell>
+ <Paragraph>
+ <TextBlock Text="{Binding LubricantFirmware,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/>
+ </Paragraph>
+ </TableCell>
+ </TableRow>
<TableRow>
<TableCell>
<Paragraph>
- <TextBlock>Total Dye Meters:</TextBlock>
+ <TextBlock>Dispensers Firmware:</TextBlock>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
- <TextBlock Text="{Binding TotalDyeMeters,Mode=OneWay,FallbackValue=0}"></TextBlock>
+ <TextBlock Text="{Binding DispensersFWFirmware,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/>
</Paragraph>
</TableCell>
</TableRow>
+ <TableRow>
+ <TableCell>
+ <Paragraph>
+ <TextBlock>Winders Firmware:</TextBlock>
+ </Paragraph>
+ </TableCell>
+ <TableCell>
+ <Paragraph>
+ <TextBlock Text="{Binding WindersFWFirmware,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/>
+ </Paragraph>
+ </TableCell>
+ </TableRow>
</TableRowGroup>
</Table>
</FlowDocument>
</FlowDocumentScrollViewer>
- </Grid>
+ </StackPanel>
</DockPanel>
</Grid>
</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs
index 7f810b2f3..1fd826af2 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs
@@ -23,7 +23,7 @@ using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
-
+using Tango.PMR.FirmwareUpgrade;
namespace Tango.PPC.UI.Dialogs
{
@@ -87,6 +87,53 @@ namespace Tango.PPC.UI.Dialogs
get { return _upTime; }
set { _upTime = value; RaisePropertyChangedAuto(); }
}
+ private string _headFirmware;
+
+ public string HeadFirmware
+ {
+ get { return _headFirmware; }
+ set { _headFirmware = value; RaisePropertyChangedAuto(); }
+ }
+
+ private string _dryerFirmware;
+
+ public string DryerFirmware
+ {
+ get { return _dryerFirmware; }
+ set { _dryerFirmware = value; RaisePropertyChangedAuto(); }
+ }
+
+ private string _MidtanksFirmware;
+
+ public string MidtanksFirmware
+ {
+ get { return _MidtanksFirmware; }
+ set { _MidtanksFirmware = value; RaisePropertyChangedAuto(); }
+ }
+
+ private string _lubricantFirmware;
+
+ public string LubricantFirmware
+ {
+ get { return _lubricantFirmware; }
+ set { _lubricantFirmware = value; RaisePropertyChangedAuto(); }
+ }
+
+ private string _dispensersFWFirmware;
+
+ public string DispensersFWFirmware
+ {
+ get { return _dispensersFWFirmware; }
+ set { _dispensersFWFirmware = value; RaisePropertyChangedAuto(); }
+ }
+
+ private string _windersFWFirmware;
+
+ public string WindersFWFirmware
+ {
+ get { return _windersFWFirmware; }
+ set { _windersFWFirmware = value; RaisePropertyChangedAuto(); }
+ }
public GeneralInformationViewVM( IMachineProvider provider, IPPCApplicationManager appManager)
{
@@ -98,6 +145,11 @@ namespace Tango.PPC.UI.Dialogs
InitTotalDyeProp();
UpTime = DateTime.Now - ApplicationManager.StartUpDate;
}
+ public override void OnShow()
+ {
+ base.OnShow();
+ GetFirmwareVersionDescriptors();
+ }
public async void InitSite()
{
@@ -157,6 +209,32 @@ namespace Tango.PPC.UI.Dialogs
TotalDyeMeters = "error!";
}
}
+
+ public async void GetFirmwareVersionDescriptors()
+ {
+ try
+ {
+ var descriptors = await MachineProvider.MachineOperator.GetFirmwareVersionDescriptors();
+
+ HeadFirmware = GetVersionByFileDescriptor(descriptors, VersionFileDestination.HeadCardSw);
+ DryerFirmware = GetVersionByFileDescriptor(descriptors, VersionFileDestination.DryerCardSw);
+ MidtanksFirmware = GetVersionByFileDescriptor(descriptors, VersionFileDestination.MidTankCardSw);
+ LubricantFirmware = GetVersionByFileDescriptor(descriptors, VersionFileDestination.LubricantCardSw);
+ DispensersFWFirmware = GetVersionByFileDescriptor(descriptors, VersionFileDestination.PumpCardSw);
+ WindersFWFirmware = GetVersionByFileDescriptor(descriptors, VersionFileDestination.WinderCardSw);
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "GetFirmwareVersionDescriptors");
+ }
+ }
+ private String GetVersionByFileDescriptor(List<VersionFileDescriptor> descriptors, VersionFileDestination dtype)
+ {
+ var descriptor = descriptors.Where(x => x.Destination == VersionFileDestination.HeadCardSw).FirstOrDefault();
+ return descriptor != null ? descriptor.Version : "";
+ }
+
+
}
}
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>