diff options
5 files changed, 236 insertions, 28 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 & 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> diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 31a7bfcdb..01a32b2b7 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -172,20 +172,21 @@ namespace Tango.Emulations.Emulators } for (int i = 0; i < 4; i++) { - if( i == 2) + if (i == 2) { MachineStatus.WindersInError.Add(false); MachineStatus.DancersInError.Add(true); MachineStatus.BtsrsInError.Add(true); } - else { + 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>(); @@ -228,7 +229,7 @@ namespace Tango.Emulations.Emulators }); } var tunnel = _heater_states.FirstOrDefault(x => x.HeaterType == HeaterType.ETunnelHeater); - if(tunnel != null) + if (tunnel != null) { tunnel.IsRampingUp = true; tunnel.CurrentValue = 108.5; @@ -526,6 +527,9 @@ namespace Tango.Emulations.Emulators case MessageType.InitiateInkFillingRequest: HandleInitiateInkFillingRequest(MessageFactory.ParseTangoMessageFromContainer<InitiateInkFillingRequest>(container)); break; + case MessageType.GetVersionDescriptorsRequest: + HandleGetVersionDescriptorsRequest(MessageFactory.ParseTangoMessageFromContainer<GetVersionDescriptorsRequest>(container)); + break; } } @@ -840,9 +844,16 @@ namespace Tango.Emulations.Emulators double dryerLength = _machineType == MachineType.Ts1800 ? (job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE + ProcessParametersTable.DRYER_TO_SPOOL_LENGTH_METERS) : job.ProcessParameters.DryerBufferLength; //TODO Handle First Unit Length Decrease In Emulator! + double firstUnitStartPosition = request.Message.FirstUnitStartPosition; for (int i = 0; i < units; i++) { + //double unit_length = job.Length; + + if (i == 0 && firstUnitStartPosition > 0) + { + unit_length = unit_length - firstUnitStartPosition; + } while (progress < unit_length + (i == units - 1 ? dryerLength : 0) && !_cancelJob) { @@ -1928,6 +1939,22 @@ namespace Tango.Emulations.Emulators await Transporter.SendResponse<InitiateInkFillingResponse>(new InitiateInkFillingResponse(), request.Container.Token); } + private async void HandleGetVersionDescriptorsRequest(TangoMessage<GetVersionDescriptorsRequest> request) + { + GetVersionDescriptorsResponse response = new GetVersionDescriptorsResponse(); + + foreach (var destination in Enum.GetValues(typeof(PMR.FirmwareUpgrade.VersionFileDestination)).Cast<PMR.FirmwareUpgrade.VersionFileDestination>().ToList()) + { + VersionFileDescriptor result = new VersionFileDescriptor(); + result.Destination = destination; + result.Version = "123456VP"; + + + response.Descriptors.Add(result); + } + await Transporter.SendResponse<GetVersionDescriptorsResponse>(response, request.Container.Token); + } + #endregion #region Public Methods |
