diff options
| author | Roy <Roy.mail.net@gmail.com> | 2022-11-15 11:14:01 +0200 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2022-11-15 11:14:01 +0200 |
| commit | 59052dd593c0d3d4eb2bf6c579e44c06daf7a038 (patch) | |
| tree | d39dd9289e16d897e82efe8be4c48509c4895cbb /Software/Visual_Studio | |
| parent | 81b37f187ad6823bb27ce132782301fb0bbd0c75 (diff) | |
| download | Tango-59052dd593c0d3d4eb2bf6c579e44c06daf7a038.tar.gz Tango-59052dd593c0d3d4eb2bf6c579e44c06daf7a038.zip | |
Job runs extended info.
Diffstat (limited to 'Software/Visual_Studio')
30 files changed, 719 insertions, 138 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Dialogs/JobRunExtendedInfoView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Dialogs/JobRunExtendedInfoView.xaml new file mode 100644 index 000000000..00052b311 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Dialogs/JobRunExtendedInfoView.xaml @@ -0,0 +1,89 @@ +<UserControl x:Class="Tango.FSE.Statistics.Dialogs.JobRunExtendedInfoView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" + xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:local="clr-namespace:Tango.FSE.Statistics.Dialogs" + xmlns:ms="clr-namespace:Tango.MachineStudio.Developer.Controls" + mc:Ignorable="d" + Width="800" Height="500" d:DataContext="{d:DesignInstance Type=local:JobRunExtendedInfoViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + <Grid> + <DockPanel Margin="10"> + <StackPanel DockPanel.Dock="Top" Orientation="Horizontal"> + <Image Source="Images/cmyk.png" Width="42" Height="42" VerticalAlignment="Center" RenderOptions.BitmapScalingMode="Fant" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="{StaticResource FSE_LargeFontSize}"> + <Run>Job Run</Run> + <Run>'</Run><Run Text="{Binding ExtendedInfo.JobRunID}"></Run><Run>'</Run> + <Run>Extended Information</Run> + </TextBlock> + </StackPanel> + <Grid Margin="0 10 0 0"> + <controls:FSETabControl TabsWidth="600"> + <Grid Tag="Job Outline"> + <Border CornerRadius="10" Background="{StaticResource FSE_PrimaryBackgroundBrush}" Padding="10" BorderThickness="1" BorderBrush="{StaticResource FSE_BorderBrush}"> + <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"> + <ms:JobOutlineControl HorizontalAlignment="Left" DrawMainTitle="False" DataContext="{Binding ExtendedInfo.JobTicket}" /> + </ScrollViewer> + </Border> + </Grid> + <Grid Tag="Machine Status"> + <UniformGrid Rows="2"> + <DockPanel Margin="0 2"> + <TextBlock Width="45" Margin="0 5 0 0">START:</TextBlock> + <TextBox FontSize="{StaticResource FSE_SmallFontSize}" VerticalScrollBarVisibility="Auto" Text="{Binding ExtendedInfo.StartMachineStatus,Converter={StaticResource ObjectToJsonConverter}}" Style="{StaticResource FSE_Rounded_Corners_TextBox_Multiline}" IsReadOnly="True"/> + </DockPanel> + <DockPanel Margin="0 2"> + <TextBlock Width="45" Margin="0 5 0 0">END:</TextBlock> + <TextBox FontSize="{StaticResource FSE_SmallFontSize}" VerticalScrollBarVisibility="Auto" Text="{Binding ExtendedInfo.EndMachineStatus,Converter={StaticResource ObjectToJsonConverter}}" Style="{StaticResource FSE_Rounded_Corners_TextBox_Multiline}" IsReadOnly="True"/> + </DockPanel> + </UniformGrid> + </Grid> + <Grid Tag="Events"> + <Border CornerRadius="10" Background="{StaticResource FSE_PrimaryBackgroundBrush}" Padding="10" BorderThickness="1" BorderBrush="{StaticResource FSE_BorderBrush}"> + <!--<ListBox Background="Transparent" HorizontalContentAlignment="Stretch" ItemsSource="{Binding Events}"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Grid Margin="0 10"> + <DockPanel> + <material:PackIcon Width="24" Height="24" Style="{StaticResource FSE_LogIcon}" /> + <StackPanel Margin="10 0 0 0"> + <DockPanel VerticalAlignment="Center"> + <TextBlock FontSize="{StaticResource FSE_SmallFontSize}" DockPanel.Dock="Right" Text="{Binding DateTime,Converter={StaticResource DateTimeUtcToLocalDateTime},StringFormat='HH:mm:ss'}" ToolTip="{Binding DateTime,Converter={StaticResource DateTimeUtcHumanizeConverter}}"></TextBlock> + <TextBlock Text="{Binding EventType,Converter={StaticResource EventTypeTitleConverter}}"></TextBlock> + </DockPanel> + <Rectangle Margin="0 5 0 5" DockPanel.Dock="Top" VerticalAlignment="Bottom" StrokeThickness="1"> + <Rectangle.Stroke> + <LinearGradientBrush StartPoint="0,0" EndPoint="1,0"> + <GradientStop Offset="0" Color="{StaticResource FSE_BorderColor}" /> + <GradientStop Offset="1" Color="Transparent" /> + </LinearGradientBrush> + </Rectangle.Stroke> + </Rectangle> + + <DockPanel TextElement.FontSize="{StaticResource FSE_SmallFontSize}" TextElement.Foreground="{StaticResource FSE_GrayBrush}"> + <TextBlock DockPanel.Dock="Right"><Run>#</Run><Run Text="{Binding EventType.Code}"></Run></TextBlock> + <TextBlock Text="{Binding EventType,Converter={StaticResource EventTypeTechnicalDescriptionConverter}}" Margin="0 0 10 0" TextWrapping="Wrap"></TextBlock> + </DockPanel> + <StackPanel Margin="0 5 0 0" TextElement.FontSize="{StaticResource FSE_SmallerFontSize}" TextElement.Foreground="{StaticResource FSE_GrayBrush}"> + <TextBlock TextWrapping="Wrap" Margin="0 2 0 0" Text="{Binding Description}"></TextBlock> + </StackPanel> + </StackPanel> + </DockPanel> + </Grid> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ListBox>--> + </Border> + </Grid> + </controls:FSETabControl> + </Grid> + </DockPanel> + + <StackPanel HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="22" Margin="40 0 0 -45" Orientation="Horizontal"> + <controls:TextIconButton Command="{Binding ExportCsvCommand}" Style="{StaticResource FSE_TextIconButton_Flat_Accent}" FontSize="{StaticResource FSE_SmallFontSize}" Icon="FileCsv" Height="19" ToolTip="Export the job ticket dispensers information to csv file">Export Job Ticket</controls:TextIconButton> + <controls:TextIconButton Command="{Binding ExportJsonCommand}" Style="{StaticResource FSE_TextIconButton_Flat_Accent}" FontSize="{StaticResource FSE_SmallFontSize}" Margin="20 0 0 0" Icon="Json" Height="19" ToolTip="Export the entire extended information to a json formated file">Export All</controls:TextIconButton> + </StackPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Dialogs/JobRunExtendedInfoView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Dialogs/JobRunExtendedInfoView.xaml.cs new file mode 100644 index 000000000..7a44d16fd --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Dialogs/JobRunExtendedInfoView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.FSE.Statistics.Dialogs +{ + /// <summary> + /// Interaction logic for JobRunExtendedInfoView.xaml + /// </summary> + public partial class JobRunExtendedInfoView : UserControl + { + public JobRunExtendedInfoView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Dialogs/JobRunExtendedInfoViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Dialogs/JobRunExtendedInfoViewVM.cs new file mode 100644 index 000000000..c60f3f102 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Dialogs/JobRunExtendedInfoViewVM.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.Core.Commands; +using Tango.FSE.Common; +using Tango.PPC.Shared.Statistics; + +namespace Tango.FSE.Statistics.Dialogs +{ + public class JobRunExtendedInfoViewVM : FSEDialogViewVM + { + public enum JobRunExtendedInfoDialogResult + { + Unspecified, + ExportCSV, + ExportJson, + } + + public JobRunExtendedInfo ExtendedInfo { get; set; } + + public JobRunExtendedInfoDialogResult Result { get; set; } + + public RelayCommand ExportCsvCommand { get; set; } + public RelayCommand ExportJsonCommand { get; set; } + + public List<MachinesEvent> Events + { + get { return ExtendedInfo.Events.Select(x => x.ToObservable()).ToList(); } + } + + public JobRunExtendedInfoViewVM() + { + AutoMode = true; + CancelText = null; + CanCancel = false; + OKText = "CLOSE"; + + ExportCsvCommand = new RelayCommand(ExportCsv); + ExportJsonCommand = new RelayCommand(ExportJson); + } + + private void ExportJson() + { + Result = JobRunExtendedInfoDialogResult.ExportJson; + Accept(); + } + + private void ExportCsv() + { + Result = JobRunExtendedInfoDialogResult.ExportCSV; + Accept(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/JobTicketCsvModel.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/JobTicketCsvModel.cs new file mode 100644 index 000000000..84c547a04 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/JobTicketCsvModel.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.Statistics.Models +{ + public class JobTicketCsvModel + { + public String JobName { get; set; } + public String SegmentIndex { get; set; } + public String StopIndex { get; set; } + public String DispenserIndex { get; set; } + public String LiquidType { get; set; } + public String Volume { get; set; } + public String NanoliterPerCM { get; set; } + public String NanoliterPerSec { get; set; } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs index b4cb29e7e..152bcfd82 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs @@ -14,6 +14,7 @@ namespace Tango.FSE.Statistics.Models { public class StopModel : PresentationBrushStop { + public int Index { get; set; } public JobRunDTO JobRun { get; set; } public PresentationJob Job { get; set; } public PresentationSegment Segment { get; set; } @@ -21,7 +22,8 @@ namespace Tango.FSE.Statistics.Models public int SegmentIndex { get; set; } public String ThreadName { get; set; } public RelayCommand<StopModel> ShowFailedMessageCommand { get; set; } - public ProcessParametersTable ProcessParameters { get; set; } + public RelayCommand<StopModel> ShowExtendedInfoCommand { get; set; } + public JobRunExtendedInfo ExtendedInfo { get; set; } public bool IsAdvancedMode { get; set; } public String Input diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Tango.FSE.Statistics.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Tango.FSE.Statistics.csproj index f4209111c..6e9f14e1a 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Tango.FSE.Statistics.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Tango.FSE.Statistics.csproj @@ -84,7 +84,15 @@ <Reference Include="PresentationFramework" /> </ItemGroup> <ItemGroup> + <Compile Include="..\..\..\MachineStudio\Modules\Tango.MachineStudio.Developer\Controls\JobOutlineControl.cs"> + <Link>Controls\JobOutlineControl.cs</Link> + </Compile> + <Compile Include="Dialogs\JobRunExtendedInfoView.xaml.cs"> + <DependentUpon>JobRunExtendedInfoView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\JobRunExtendedInfoViewVM.cs" /> <Compile Include="Models\CsvModel.cs" /> + <Compile Include="Models\JobTicketCsvModel.cs" /> <Compile Include="Models\LiquidQuantityModel.cs" /> <Compile Include="Models\StatsModel.cs" /> <Compile Include="Models\StopModel.cs" /> @@ -179,6 +187,10 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> + <Page Include="Dialogs\JobRunExtendedInfoView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Themes\Generic.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs index c85a411e3..5fd5ea910 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Data.Entity; using System.Diagnostics; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -12,12 +13,14 @@ using Tango.BL.DTO; using Tango.BL.Entities; using Tango.BL.Enumerations; using Tango.Core.Commands; +using Tango.Core.ExtensionMethods; using Tango.CSV; using Tango.FSE.Common; using Tango.FSE.Common.AutoComplete; using Tango.FSE.Common.Navigation; using Tango.FSE.Common.Notifications; using Tango.FSE.Common.Statistics; +using Tango.FSE.Statistics.Dialogs; using Tango.FSE.Statistics.Models; using Tango.PPC.Shared.Statistics; using Tango.SharedUI.Components; @@ -27,8 +30,6 @@ namespace Tango.FSE.Statistics.ViewModels { public class MainViewVM : FSEViewModel { - private List<ProcessParametersTable> _processTables; - private DateTime _startSelectedDate; public DateTime StartSelectedDate { @@ -157,6 +158,8 @@ namespace Tango.FSE.Statistics.ViewModels public RelayCommand<StopModel> ShowFailedMessageCommand { get; set; } + public RelayCommand<StopModel> ShowExtendedInfoCommand { get; set; } + public RelayCommand ExportToCsvCommand { get; set; } @@ -164,8 +167,6 @@ namespace Tango.FSE.Statistics.ViewModels { IsSettingsBarOpened = true; - _processTables = new List<ProcessParametersTable>(); - JobRunSelectedStatuses = new SelectedObjectCollection<JobRunStatus>(new ObservableCollection<JobRunStatus>() { JobRunStatus.Aborted, @@ -200,6 +201,7 @@ namespace Tango.FSE.Statistics.ViewModels Stats = new StatsModel(); ShowFailedMessageCommand = new RelayCommand<StopModel>(ShowJobRunFailedMessage); + ShowExtendedInfoCommand = new RelayCommand<StopModel>(ShowJobRunExtendedInfo); ExportToCsvCommand = new RelayCommand(ExportToCSV, () => IsResultsAvailable); } @@ -226,24 +228,12 @@ namespace Tango.FSE.Statistics.ViewModels }); } - public async override void OnApplicationReady() + public override void OnApplicationReady() { base.OnApplicationReady(); MachineProvider.MachineConnected += MachineProvider_MachineConnected; MachineProvider.MachineDisconnected += MachineProvider_MachineDisconnected; - - try - { - using (ObservablesContext db = ObservablesContext.CreateDefault()) - { - _processTables = await db.ProcessParametersTables.ToListAsync(); - } - } - catch (Exception ex) - { - LogManager.Log(ex, "Error loading process parameters tables for statistics."); - } } private void MachineProvider_MachineDisconnected(object sender, Common.Connection.MachineDisconnectedEventArgs e) @@ -303,7 +293,6 @@ namespace Tango.FSE.Statistics.ViewModels foreach (var job in model.StatisticsResult.JobRuns.OrderByDescending(x => x.JobRun.StartDate)) { var rmlName = FiltersData.Rmls.FirstOrDefault(x => x.Guid == job.JobRun.RmlGuid)?.Name; - var processTable = _processTables.FirstOrDefault(x => x.Guid == job.JobRun.ProcessParametersTableGuid); jobIndex++; @@ -312,11 +301,11 @@ namespace Tango.FSE.Statistics.ViewModels foreach (var jobStop in jobSegment.Stops) { StopModel stop = new StopModel(); + stop.Index = jobSegment.Stops.IndexOf(jobStop) + 1; stop.JobIndex = jobIndex; stop.SegmentIndex = job.Job.Segments.IndexOf(jobSegment) + 1; stop.ThreadName = rmlName; - stop.ProcessParameters = processTable; - stop.IsAdvancedMode = !BuildProvider.IsTwineStudio && CurrentUser.HasRole(Roles.FSETwineTechnician); + stop.IsAdvancedMode = !BuildProvider.IsTwineStudio && CurrentUser.HasRole(Roles.FSEAdvancedTechnician); stop.ColorSpace = jobStop.ColorSpace; @@ -348,6 +337,7 @@ namespace Tango.FSE.Statistics.ViewModels stop.BestMatchB = jobStop.BestMatchB; stop.ShowFailedMessageCommand = ShowFailedMessageCommand; + stop.ShowExtendedInfoCommand = ShowExtendedInfoCommand; stops.Add(stop); } @@ -439,6 +429,72 @@ namespace Tango.FSE.Statistics.ViewModels await NotificationProvider.ShowError($"Job Failure Message:\n{stop.JobRun.FailedMessage}"); } + private async void ShowJobRunExtendedInfo(StopModel stop) + { + if (stop.ExtendedInfo == null) + { + try + { + using (var task = NotificationProvider.PushTaskItem($"Retrieving extended job run ({stop.JobRun.ID}) information...", false)) + { + await Task.Delay(1000); + stop.ExtendedInfo = await StatisticsProvider.GetJobRunExtendedInfo(stop.JobRun.ID); + } + } + catch (Exception ex) + { + await NotificationProvider.ShowError($"Could not retrieve extended job run information.\n{ex.Message}"); + return; + } + } + + var vm = await NotificationProvider.ShowDialog<JobRunExtendedInfoViewVM>(new JobRunExtendedInfoViewVM() { ExtendedInfo = stop.ExtendedInfo }); + if (vm.Result == JobRunExtendedInfoViewVM.JobRunExtendedInfoDialogResult.ExportJson) + { + var result = await StorageProvider.SaveFile("Export job run extended information", "JSON Files|*.json", $"JobRun_{stop.JobRun.JobName}_{stop.JobRun.ID}_extended.json", ".json"); + if (result) + { + File.WriteAllText(result.SelectedItem, vm.ExtendedInfo.ToJsonString()); + + NotificationProvider.PushSnackbarItem(MessageType.Success, "Job Run Extended Information Export", true, "Export completed successfully.\nTap to open the file.", null, null, async () => + { + await StorageProvider.ShowInExplorer(result.SelectedItem); + }); + } + } + else if (vm.Result == JobRunExtendedInfoViewVM.JobRunExtendedInfoDialogResult.ExportCSV) + { + var result = await StorageProvider.SaveFile("Export job run job ticket", "CSV Files|*.csv", $"JobRun_{stop.JobRun.JobName}_{stop.JobRun.ID}_ticket.csv", ".csv"); + if (result) + { + var dispensers = vm.ExtendedInfo.JobTicket.Segments.SelectMany(x => x.BrushStops).SelectMany(x => x.Dispensers).Select(x => new JobTicketCsvModel() + { + DispenserIndex = x.Index.ToString(), + JobName = stop.JobRun.JobName, + LiquidType = x.DispenserLiquidType.ToString(), + NanoliterPerCM = x.NanoliterPerCentimeter.ToString(), + NanoliterPerSec = x.NanolitterPerSecond.ToString(), + SegmentIndex = stop.SegmentIndex.ToString(), + StopIndex = stop.Index.ToString(), + Volume = x.Volume.ToString(), + }).ToList(); + + using (CsvFile<JobTicketCsvModel> csvFile = new CsvFile<JobTicketCsvModel>(new CsvDestination(result.SelectedItem))) + { + foreach (var dispenser in dispensers) + { + csvFile.Append(dispenser); + } + } + + NotificationProvider.PushSnackbarItem(MessageType.Success, "Job Run Ticket Export", true, "Export completed successfully.\nTap to open the file.", null, null, async () => + { + await StorageProvider.ShowInExplorer(result.SelectedItem); + }); + } + } + } + private async void ExportToCSV() { var result = await StorageProvider.SaveFile("Export To CSV File", "CSV Files|*.csv", $"{MachineProvider.Machine.SerialNumber}_JobRuns_{DateTime.Now.ToFileName()}.csv", ".csv"); diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Views/MainView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Views/MainView.xaml index 099ab57f9..07f7048f0 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Views/MainView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Views/MainView.xaml @@ -115,27 +115,7 @@ <Run Text="{Binding JobRun.CeVersion,TargetNullValue='N/A'}"></Run> </TextBlock> - <controls:ToggleIconButton x:Name="toggleProcess" CheckedIcon="ArrowDown" UncheckedIcon="Settings" Width="14" Background="Transparent" Foreground="{StaticResource FSE_GrayBrush}" UncheckedForeground="{StaticResource FSE_GrayBrush}" Height="14" Cursor="Hand" Margin="5 0 0 0" /> - - <Popup AllowsTransparency="True" PlacementTarget="{Binding ElementName=toggleProcess}" StaysOpen="False" Placement="Bottom" IsOpen="{Binding ElementName=toggleProcess,Path=IsChecked,Mode=TwoWay}"> - <Border Background="{StaticResource FSE_PrimaryBackgroundLighterBrush}" Padding="5" CornerRadius="5"> - <Grid> - <StackPanel> - <TextBlock FontWeight="Bold" FontStyle="Italic" TextDecorations="Underline">Process Parameters</TextBlock> - <ItemsControl Margin="0 5 0 0" ItemsSource="{Binding ProcessParameters.Parameters}" FontSize="{StaticResource FSE_SmallerFontSize}"> - <ItemsControl.ItemTemplate> - <DataTemplate> - <TextBlock> - <Run Text="{Binding Name}" FontWeight="SemiBold"></Run>: - <Run Text="{Binding Value}"></Run> - </TextBlock> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </StackPanel> - </Grid> - </Border> - </Popup> + <Button Command="{Binding ShowExtendedInfoCommand}" CommandParameter="{Binding}" Background="Transparent" Style="{StaticResource FSE_FlatButton_ForegroundAccentHover}" Foreground="{StaticResource FSE_PrimaryAccentBrush}" FontSize="{StaticResource FSE_SmallerFontSize}" Height="Auto" Padding="0" Cursor="Hand" Margin="0 0 0 0">More info...</Button> </StackPanel> </Grid> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/TextIconButton.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/TextIconButton.xaml index eb8d823f7..20228582c 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/TextIconButton.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/TextIconButton.xaml @@ -9,7 +9,7 @@ <DataTemplate> <DockPanel> <material:PackIcon Margin="-5 0 0 0" Width="Auto" Height="Auto" Kind="{Binding RelativeSource={RelativeSource AncestorType=local:TextIconButton},Path=Icon}" VerticalAlignment="Center" /> - <Label VerticalAlignment="Center" Content="{Binding}"></Label> + <Label TextElement.Foreground="{Binding RelativeSource={RelativeSource AncestorType=local:TextIconButton},Path=Foreground}" VerticalAlignment="Center" Content="{Binding}"></Label> </DockPanel> </DataTemplate> </Setter.Value> @@ -22,7 +22,24 @@ <DataTemplate> <DockPanel> <material:PackIcon Margin="-5 0 0 0" Width="Auto" Height="Auto" Kind="{Binding RelativeSource={RelativeSource AncestorType=local:TextIconButton},Path=Icon}" VerticalAlignment="Center" /> - <Label VerticalAlignment="Center" Content="{Binding}"></Label> + <Label TextElement.Foreground="{Binding RelativeSource={RelativeSource AncestorType=local:TextIconButton},Path=Foreground}" VerticalAlignment="Center" Content="{Binding}"></Label> + </DockPanel> + </DataTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="FSE_TextIconButton_Flat_Accent" TargetType="{x:Type local:TextIconButton}" BasedOn="{StaticResource FSE_FlatButton_ForegroundAccentHover}"> + <Setter Property="BorderThickness" Value="0"></Setter> + <Setter Property="Padding" Value="0"></Setter> + <Setter Property="material:ShadowAssist.ShadowDepth" Value="Depth0"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + <DockPanel> + <material:PackIcon Margin="-5 0 0 0" Width="Auto" Height="Auto" Kind="{Binding RelativeSource={RelativeSource AncestorType=local:TextIconButton},Path=Icon}" VerticalAlignment="Center" /> + <Label TextElement.Foreground="{Binding RelativeSource={RelativeSource AncestorType=local:TextIconButton},Path=Foreground}" VerticalAlignment="Center" Content="{Binding}"></Label> </DockPanel> </DataTemplate> </Setter.Value> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/ObjectToJsonConverter.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/ObjectToJsonConverter.cs new file mode 100644 index 000000000..84a1721f5 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/ObjectToJsonConverter.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; +using Tango.Core.ExtensionMethods; + +namespace Tango.FSE.Common.Converters +{ + public class ObjectToJsonConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return value?.ToJsonString(); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml index d6bf2376e..adf193cd6 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml @@ -58,4 +58,5 @@ <localConverters:DisplayMemberPathToStringConverter x:Key="DisplayMemberPathToStringConverter" /> <localConverters:LiquidTypeToColorConverter x:Key="LiquidTypeToColorConverter" /> <localConverters:NanolitersToLitersConverter x:Key="NanolitersToLitersConverter" /> + <localConverters:ObjectToJsonConverter x:Key="ObjectToJsonConverter" /> </ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Statistics/IStatisticsProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Statistics/IStatisticsProvider.cs index 66f9f53a3..e171228c7 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Statistics/IStatisticsProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Statistics/IStatisticsProvider.cs @@ -11,5 +11,6 @@ namespace Tango.FSE.Common.Statistics { Task<RequiredFiltersData> GetRequiredFiltersData(); Task<StatisticsModel> GetStatistics(Filters filters); + Task<JobRunExtendedInfo> GetJobRunExtendedInfo(int jobRunID); } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj index 6dea217cb..60d8b8df8 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj @@ -216,6 +216,7 @@ <Compile Include="Converters\LiquidTypeToColorConverter.cs" /> <Compile Include="Converters\LiquidTypeToShortNameConverter.cs" /> <Compile Include="Converters\NanolitersToLitersConverter.cs" /> + <Compile Include="Converters\ObjectToJsonConverter.cs" /> <Compile Include="Converters\TimeSpanHumanizeConverter.cs" /> <Compile Include="Converters\TotalDyeTimeConverter.cs" /> <Compile Include="Converters\TotalMetersConverter.cs" /> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Statistics/DefaultStatisticsProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Statistics/DefaultStatisticsProvider.cs index 56e5907dd..a130bbccd 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Statistics/DefaultStatisticsProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Statistics/DefaultStatisticsProvider.cs @@ -58,5 +58,19 @@ namespace Tango.FSE.UI.Statistics throw LogManager.Log(ex, "Error retrieving remote machine statistics data."); } } + + public async Task<JobRunExtendedInfo> GetJobRunExtendedInfo(int jobRunID) + { + try + { + LogManager.Log($"Retrieving extended job run ({jobRunID}) information..."); + var response = await MachineProvider.MachineOperator.SendGenericRequest<GetJobRunExtendedInfoRequest, GetJobRunExtendedInfoResponse>(new GetJobRunExtendedInfoRequest() { JobRunID = jobRunID }); + return response.ExtendedInfo; + } + catch (Exception ex) + { + throw LogManager.Log(ex, $"Error getting job run extended info for job run '{jobRunID}'."); + } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/JobOutlineControl.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/JobOutlineControl.cs index 86d83ac10..98f999574 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/JobOutlineControl.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/JobOutlineControl.cs @@ -18,6 +18,9 @@ namespace Tango.MachineStudio.Developer.Controls public class JobOutlineControl : Control { #region members + + public bool DrawMainTitle { get; set; } = true; + private Size _sizeControl = new Size(0, 0); ScrollViewer _parentScrollViewer = null; public struct LevelOffset @@ -88,8 +91,12 @@ namespace Tango.MachineStudio.Developer.Controls } _sizeControl = new Size(); _sizeControl.Height += 10; - DrawHeaderText(drawingContext, "JOB OUTLINE", 30, LevelOffset.level_0); - _sizeControl.Height += HEADER_FONT_HEIGHT; + + if (DrawMainTitle) + { + DrawHeaderText(drawingContext, "JOB OUTLINE", 30, LevelOffset.level_0); + _sizeControl.Height += HEADER_FONT_HEIGHT; + } _sizeControl.Height += 20; DrawHeaderText(drawingContext, "BASIC", 17, LevelOffset.level_0); 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 18c0f6202..2b3bc2a99 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs @@ -22,6 +22,7 @@ using Tango.Transport; using System.Threading; using Tango.Core.ExtensionMethods; using System.IO.Ports; +using Tango.Integration.JobRuns; namespace Tango.PPC.Common.Connection { @@ -121,6 +122,8 @@ namespace Tango.PPC.Common.Connection MachineOperator.EmergencyNotificationProvider.IsEnabled = settings.EnableEmergencyNotifications; MachineOperator.EnableJobLiquidQuantityValidation = settings.EnableJobLiquidQuantityValidation; + + (MachineOperator.JobRunsLogger as BasicJobRunsLogger).CreateJobRunsFiles = true; } private void MachineOperator_StatusChanged(object sender, MachineStatuses status) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs index 00381377d..7eee23925 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs @@ -1,6 +1,8 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Data.Entity; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -11,6 +13,7 @@ using Tango.BL.Enumerations; using Tango.Core; using Tango.Core.DI; using Tango.Integration.ExternalBridge; +using Tango.Integration.JobRuns; using Tango.PPC.Common.Connection; using Tango.PPC.Common.ExternalBridge; using Tango.PPC.Shared.Statistics; @@ -189,9 +192,30 @@ namespace Tango.PPC.Common.Statistics await receiver.SendGenericResponse(response, token); } - public void OnReceiverDisconnected(ExternalBridgeReceiver receiver) + [ExternalBridgeRequestHandlerMethod(typeof(GetJobRunExtendedInfoRequest), RequestHandlerLoggingMode.LogRequestName)] + public async Task OnGetJobRunExtendedInfoRequest(GetJobRunExtendedInfoRequest request, String token, ExternalBridgeReceiver receiver) { + this.ThrowIfDisabled(); + + var response = new GetJobRunExtendedInfoResponse(); + + String filePath = Path.Combine((_machineProvider.MachineOperator.JobRunsLogger as BasicJobRunsLogger).JobRunsFolder, $"{request.JobRunID}.run"); + String json = File.ReadAllText(filePath); + + JobRunInfo info = JsonConvert.DeserializeObject<JobRunInfo>(json); + + response.ExtendedInfo.JobRunID = info.JobRunID; + response.ExtendedInfo.JobTicket = info.JobTicket; + response.ExtendedInfo.Events = info.Events; + response.ExtendedInfo.StartMachineStatus = info.StartMachineStatus; + response.ExtendedInfo.EndMachineStatus = info.EndMachineStatus; + await receiver.SendGenericResponse(response, token); + } + + public void OnReceiverDisconnected(ExternalBridgeReceiver receiver) + { + } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetJobRunExtendedInfoRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetJobRunExtendedInfoRequest.cs new file mode 100644 index 000000000..78e908c04 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetJobRunExtendedInfoRequest.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Statistics +{ + public class GetJobRunExtendedInfoRequest + { + public int JobRunID { get; set; } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetJobRunExtendedInfoResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetJobRunExtendedInfoResponse.cs new file mode 100644 index 000000000..da702c745 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetJobRunExtendedInfoResponse.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Statistics +{ + public class GetJobRunExtendedInfoResponse + { + public JobRunExtendedInfo ExtendedInfo { get; set; } + + public GetJobRunExtendedInfoResponse() + { + ExtendedInfo = new JobRunExtendedInfo(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/JobRunComposition.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/JobRunComposition.cs index a6d0f52d4..c18d56693 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/JobRunComposition.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/JobRunComposition.cs @@ -11,11 +11,9 @@ namespace Tango.PPC.Shared.Statistics { public JobRunDTO JobRun { get; set; } public PresentationJob Job { get; set; } - public List<MachinesEventDTO> Events { get; set; } public JobRunComposition() { - Events = new List<MachinesEventDTO>(); Job = new PresentationJob(); } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/JobRunExtendedInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/JobRunExtendedInfo.cs new file mode 100644 index 000000000..78d7325e1 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/JobRunExtendedInfo.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.DTO; +using Tango.PMR.MachineStatus; +using Tango.PMR.Printing; + +namespace Tango.PPC.Shared.Statistics +{ + public class JobRunExtendedInfo + { + public int JobRunID { get; set; } + public JobTicket JobTicket { get; set; } + public MachineStatus StartMachineStatus { get; set; } + public MachineStatus EndMachineStatus { get; set; } + public List<MachinesEventDTO> Events { get; set; } + + public JobRunExtendedInfo() + { + Events = new List<MachinesEventDTO>(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj index 5b66527aa..188da58f8 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj @@ -122,11 +122,14 @@ <Compile Include="SQL\RemoteSqlDataSet.cs" /> <Compile Include="SQL\RemoteSqlRow.cs" /> <Compile Include="Statistics\Filters.cs" /> + <Compile Include="Statistics\GetJobRunExtendedInfoRequest.cs" /> + <Compile Include="Statistics\GetJobRunExtendedInfoResponse.cs" /> <Compile Include="Statistics\GetStatisticsRequest.cs" /> <Compile Include="Statistics\GetStatisticsRequiredFiltersRequest.cs" /> <Compile Include="Statistics\GetStatisticsRequiredFiltersResponse.cs" /> <Compile Include="Statistics\GetStatisticsResponse.cs" /> <Compile Include="Statistics\JobRunComposition.cs" /> + <Compile Include="Statistics\JobRunExtendedInfo.cs" /> <Compile Include="Statistics\PresentationLiquidVolume.cs" /> <Compile Include="Statistics\RequiredFiltersData.cs" /> <Compile Include="Statistics\PresentationBrushStop.cs" /> diff --git a/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs index becb51888..999f0dcf8 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs @@ -142,6 +142,22 @@ namespace Tango.BL.DTO } /// <summary> + /// job logical length + /// </summary> + public Double JobLogicalLength + { + get; set; + } + + /// <summary> + /// number of units + /// </summary> + public Int32 NumberOfUnits + { + get; set; + } + + /// <summary> /// is gradient /// </summary> public Boolean IsGradient diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs index dc625f6f3..abfe9d321 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs @@ -49,6 +49,10 @@ namespace Tango.BL.Entities public event EventHandler<Double> JobLengthChanged; + public event EventHandler<Double> JobLogicalLengthChanged; + + public event EventHandler<Int32> NumberOfUnitsChanged; + public event EventHandler<Boolean> IsGradientChanged; public event EventHandler<Int32> GradientResolutionCmChanged; @@ -488,6 +492,60 @@ namespace Tango.BL.Entities } } + protected Double _joblogicallength; + + /// <summary> + /// Gets or sets the jobrunbase job logical length. + /// </summary> + + [Column("JOB_LOGICAL_LENGTH")] + + public Double JobLogicalLength + { + get + { + return _joblogicallength; + } + + set + { + if (_joblogicallength != value) + { + _joblogicallength = value; + + OnJobLogicalLengthChanged(value); + + } + } + } + + protected Int32 _numberofunits; + + /// <summary> + /// Gets or sets the jobrunbase number of units. + /// </summary> + + [Column("NUMBER_OF_UNITS")] + + public Int32 NumberOfUnits + { + get + { + return _numberofunits; + } + + set + { + if (_numberofunits != value) + { + _numberofunits = value; + + OnNumberOfUnitsChanged(value); + + } + } + } + protected Boolean _isgradient; /// <summary> @@ -1153,6 +1211,24 @@ namespace Tango.BL.Entities } /// <summary> + /// Called when the JobLogicalLength has changed. + /// </summary> + protected virtual void OnJobLogicalLengthChanged(Double joblogicallength) + { + JobLogicalLengthChanged?.Invoke(this, joblogicallength); + RaisePropertyChanged(nameof(JobLogicalLength)); + } + + /// <summary> + /// Called when the NumberOfUnits has changed. + /// </summary> + protected virtual void OnNumberOfUnitsChanged(Int32 numberofunits) + { + NumberOfUnitsChanged?.Invoke(this, numberofunits); + RaisePropertyChanged(nameof(NumberOfUnits)); + } + + /// <summary> /// Called when the IsGradient has changed. /// </summary> protected virtual void OnIsGradientChanged(Boolean isgradient) diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs index 8bc648d88..5ed87ecd8 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs @@ -32,6 +32,8 @@ namespace Tango.DAL.Remote.DB public System.DateTime END_DATE { get; set; } public int STATUS { get; set; } public double JOB_LENGTH { get; set; } + public double JOB_LOGICAL_LENGTH { get; set; } + public int NUMBER_OF_UNITS { get; set; } public bool IS_GRADIENT { get; set; } public int GRADIENT_RESOLUTION_CM { get; set; } public string LIQUID_QUANTITY_STRING { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index 0e16606a7..f27945995 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -767,6 +767,8 @@ <Property Name="END_DATE" Type="datetime2" Precision="3" Nullable="false" /> <Property Name="STATUS" Type="int" Nullable="false" /> <Property Name="JOB_LENGTH" Type="float" Nullable="false" /> + <Property Name="JOB_LOGICAL_LENGTH" Type="float" Nullable="false" /> + <Property Name="NUMBER_OF_UNITS" Type="int" Nullable="false" /> <Property Name="IS_GRADIENT" Type="bit" Nullable="false" /> <Property Name="GRADIENT_RESOLUTION_CM" Type="int" Nullable="false" /> <Property Name="LIQUID_QUANTITY_STRING" Type="nvarchar(max)" /> @@ -6377,6 +6379,8 @@ <Property Name="END_DATE" Type="DateTime" Nullable="false" Precision="3" /> <Property Name="STATUS" Type="Int32" Nullable="false" /> <Property Name="JOB_LENGTH" Type="Double" Nullable="false" /> + <Property Name="JOB_LOGICAL_LENGTH" Type="Double" Nullable="false" /> + <Property Name="NUMBER_OF_UNITS" Type="Int32" Nullable="false" /> <Property Name="IS_GRADIENT" Type="Boolean" Nullable="false" /> <Property Name="GRADIENT_RESOLUTION_CM" Type="Int32" Nullable="false" /> <Property Name="LIQUID_QUANTITY_STRING" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" /> @@ -9827,6 +9831,8 @@ <ScalarProperty Name="LIQUID_QUANTITY_STRING" ColumnName="LIQUID_QUANTITY_STRING" /> <ScalarProperty Name="GRADIENT_RESOLUTION_CM" ColumnName="GRADIENT_RESOLUTION_CM" /> <ScalarProperty Name="IS_GRADIENT" ColumnName="IS_GRADIENT" /> + <ScalarProperty Name="NUMBER_OF_UNITS" ColumnName="NUMBER_OF_UNITS" /> + <ScalarProperty Name="JOB_LOGICAL_LENGTH" ColumnName="JOB_LOGICAL_LENGTH" /> <ScalarProperty Name="JOB_LENGTH" ColumnName="JOB_LENGTH" /> <ScalarProperty Name="STATUS" ColumnName="STATUS" /> <ScalarProperty Name="END_DATE" ColumnName="END_DATE" /> diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index 4c2849008..7841c367b 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,102 +5,102 @@ <!-- Diagram content (shape and connector positions) --> <edmx:Diagrams> <Diagram DiagramId="f9ae01d708754bbd997add25a4bacc79" Name="Diagram1" ZoomLevel="87"> - <EntityTypeShape EntityType="RemoteModel.ACTION_LOGS" Width="1.5" PointX="11.25" PointY="33.75" /> - <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="1.5" PointY="58.375" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="1.5" PointY="72.5" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="82.625" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="1.5" PointY="75.5" /> - <EntityTypeShape EntityType="RemoteModel.BIT_TYPES" Width="1.5" PointX="0.75" PointY="0.75" /> + <EntityTypeShape EntityType="RemoteModel.ACTION_LOGS" Width="1.5" PointX="11.25" PointY="35.875" /> + <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="1.5" PointY="81.5" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="1.5" PointY="67.5" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="64.625" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="1.5" PointY="70.5" /> + <EntityTypeShape EntityType="RemoteModel.BIT_TYPES" Width="1.5" PointX="8.75" PointY="8.75" /> <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="18" PointY="17.125" /> - <EntityTypeShape EntityType="RemoteModel.BTSR_APPLICATION_TYPES" Width="1.5" PointX="0.75" PointY="16.25" /> - <EntityTypeShape EntityType="RemoteModel.BTSR_YARN_TYPES" Width="1.5" PointX="0.75" PointY="10" /> - <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="9" PointY="62.25" /> - <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="8.25" PointY="15.625" /> - <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="0.75" PointY="33.25" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS" Width="1.5" PointX="9" PointY="40" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_GROUPS" Width="1.5" PointX="13.5" PointY="16" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS" Width="1.5" PointX="15.75" PointY="14.75" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS_RECIPES" Width="1.5" PointX="5.25" PointY="24.625" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_PROCESS_INK_UPTAKE" Width="1.5" PointX="2.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="9" PointY="25.125" /> - <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="3.75" PointY="75.125" /> - <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="1.5" PointY="62.375" /> - <EntityTypeShape EntityType="RemoteModel.CUSTOMER" Width="1.5" PointX="9" PointY="9.875" /> + <EntityTypeShape EntityType="RemoteModel.BTSR_APPLICATION_TYPES" Width="1.5" PointX="0.75" PointY="21" /> + <EntityTypeShape EntityType="RemoteModel.BTSR_YARN_TYPES" Width="1.5" PointX="0.75" PointY="36.5" /> + <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="6" PointY="43.125" /> + <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="8.25" PointY="20.75" /> + <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="0.75" PointY="39.875" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS" Width="1.5" PointX="1.5" PointY="1.5" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_GROUPS" Width="1.5" PointX="3.75" PointY="2" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS" Width="1.5" PointX="6" PointY="0.75" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS_RECIPES" Width="1.5" PointX="8.25" PointY="16.625" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_PROCESS_INK_UPTAKE" Width="1.5" PointX="10.75" PointY="8.75" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="9" PointY="28" /> + <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="3.75" PointY="67.25" /> + <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="1.5" PointY="77.625" /> + <EntityTypeShape EntityType="RemoteModel.CUSTOMER" Width="1.5" PointX="9" PointY="12.75" /> <EntityTypeShape EntityType="RemoteModel.DATA_STORE_ITEMS" Width="1.5" PointX="8.25" PointY="78.375" /> - <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="6.75" PointY="58.5" /> - <EntityTypeShape EntityType="RemoteModel.DISPENSER" Width="1.5" PointX="9" PointY="57.875" /> - <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="69.625" /> - <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="9" PointY="87.375" /> + <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="3.75" PointY="36.125" /> + <EntityTypeShape EntityType="RemoteModel.DISPENSER" Width="1.5" PointX="6" PointY="35.5" /> + <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="61.625" /> + <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="9" PointY="83.125" /> <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="27.375" /> - <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="7" /> - <EntityTypeShape EntityType="RemoteModel.FSE_VERSIONS" Width="1.5" PointX="11.25" PointY="43.375" /> - <EntityTypeShape EntityType="RemoteModel.GBD" Width="1.5" PointX="0.75" PointY="39.875" /> - <EntityTypeShape EntityType="RemoteModel.GLOBAL_DATA_STORE_ITEMS" Width="1.5" PointX="2.75" PointY="4.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWER_TYPES" Width="1.5" PointX="1.5" PointY="86" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWERS" Width="1.5" PointX="3.75" PointY="70.5" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSOR_TYPES" Width="1.5" PointX="7.5" PointY="97" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSORS" Width="1.5" PointX="9.75" PointY="82.625" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCER_TYPES" Width="1.5" PointX="1.5" PointY="90" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCERS" Width="1.5" PointX="3.75" PointY="80.875" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTOR_TYPES" Width="1.5" PointX="9.5" PointY="66.875" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTORS" Width="1.5" PointX="11.75" PointY="68.625" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROL_TYPES" Width="1.5" PointX="6.5" PointY="63" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROLS" Width="1.5" PointX="8.75" PointY="71" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSOR_TYPES" Width="1.5" PointX="4.5" PointY="87" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSORS" Width="1.5" PointX="6.75" PointY="82.625" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="78.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDER_TYPES" Width="1.5" PointX="8.5" PointY="93" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDERS" Width="1.5" PointX="10.75" PointY="78.75" /> - <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="9" PointY="2.125" /> - <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="11.25" PointY="38.375" /> - <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="19.75" PointY="0.75" /> + <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="7.125" /> + <EntityTypeShape EntityType="RemoteModel.FSE_VERSIONS" Width="1.5" PointX="11.25" PointY="29.125" /> + <EntityTypeShape EntityType="RemoteModel.GBD" Width="1.5" PointX="0.75" PointY="33.25" /> + <EntityTypeShape EntityType="RemoteModel.GLOBAL_DATA_STORE_ITEMS" Width="1.5" PointX="12.75" PointY="8.75" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWER_TYPES" Width="1.5" PointX="8.5" PointY="93" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWERS" Width="1.5" PointX="10.75" PointY="77.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSOR_TYPES" Width="1.5" PointX="9.5" PointY="60" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSORS" Width="1.5" PointX="11.75" PointY="67.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCER_TYPES" Width="1.5" PointX="9.5" PointY="89" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCERS" Width="1.5" PointX="11.75" PointY="71.875" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTOR_TYPES" Width="1.5" PointX="6.5" PointY="62.875" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTORS" Width="1.5" PointX="8.75" PointY="63.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROL_TYPES" Width="1.5" PointX="11.5" PointY="82" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROLS" Width="1.5" PointX="13.75" PointY="78" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSOR_TYPES" Width="1.5" PointX="1.5" PointY="86" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSORS" Width="1.5" PointX="3.75" PointY="73.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="73.375" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDER_TYPES" Width="1.5" PointX="6.5" PointY="83" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDERS" Width="1.5" PointX="8.75" PointY="73.75" /> + <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="6" PointY="32" /> + <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="8.25" PointY="37.875" /> + <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="14.75" PointY="0.75" /> <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="11.25" PointY="17" /> - <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="30.375" /> - <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="6" PointY="1.625" /> - <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="5.25" PointY="16.875" /> - <EntityTypeShape EntityType="RemoteModel.LUB" Width="1.5" PointX="0.75" PointY="36.625" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_PROTOTYPES" Width="1.5" PointX="4.75" PointY="6.75" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_STUDIO_VERSIONS" Width="1.5" PointX="11.25" PointY="47.125" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="3.75" PointY="66.25" /> + <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="24.5" /> + <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="6" PointY="6.75" /> + <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="5.25" PointY="24.875" /> + <EntityTypeShape EntityType="RemoteModel.LUB" Width="1.5" PointX="0.75" PointY="13" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_PROTOTYPES" Width="1.5" PointX="13.75" PointY="12.75" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_STUDIO_VERSIONS" Width="1.5" PointX="11.25" PointY="39.625" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="3.75" PointY="58.375" /> <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="6" PointY="66.25" /> - <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="11.25" PointY="55.75" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="24.5" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="21" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="13.25" /> - <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="9" PointY="44.375" /> - <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="3.75" PointY="60.25" /> - <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="12" PointY="8.5" /> + <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="11.25" PointY="52.5" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="10.125" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="16.375" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="30.25" /> + <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="6" PointY="39.75" /> + <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="3.75" PointY="79.625" /> + <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="12" PointY="57" /> <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="48.125" /> <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="51.125" /> - <EntityTypeShape EntityType="RemoteModel.PUBLISHED_PROCEDURE_PROJECTS" Width="1.5" PointX="14.75" PointY="5" /> - <EntityTypeShape EntityType="RemoteModel.PUBLISHED_PROCEDURE_PROJECTS_VERSIONS" Width="1.5" PointX="17" PointY="5.125" /> - <EntityTypeShape EntityType="RemoteModel.RML_EXTENSION_TEST_WASHING_RESULTS" Width="1.5" PointX="14" PointY="1" /> + <EntityTypeShape EntityType="RemoteModel.PUBLISHED_PROCEDURE_PROJECTS" Width="1.5" PointX="8.75" PointY="5" /> + <EntityTypeShape EntityType="RemoteModel.PUBLISHED_PROCEDURE_PROJECTS_VERSIONS" Width="1.5" PointX="11" PointY="5.25" /> + <EntityTypeShape EntityType="RemoteModel.RML_EXTENSION_TEST_WASHING_RESULTS" Width="1.5" PointX="11" PointY="1" /> <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="3" PointY="14.625" /> - <EntityTypeShape EntityType="RemoteModel.RMLS_SPOOLS" Width="1.5" PointX="8.25" PointY="20.375" /> - <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="12" PointY="12.375" /> - <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="14.25" PointY="11.5" /> - <EntityTypeShape EntityType="RemoteModel.RUBBING_RESULTS" Width="1.5" PointX="5.75" PointY="9.75" /> - <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="15.75" PointY="20.625" /> + <EntityTypeShape EntityType="RemoteModel.RMLS_SPOOLS" Width="1.5" PointX="5.25" PointY="16.375" /> + <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="12" PointY="48.875" /> + <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="14.25" PointY="49" /> + <EntityTypeShape EntityType="RemoteModel.RUBBING_RESULTS" Width="1.5" PointX="15.75" PointY="10.75" /> + <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="15.75" PointY="20.75" /> <EntityTypeShape EntityType="RemoteModel.SEGMENTS_GROUPS" Width="1.5" PointX="13.5" PointY="21" /> - <EntityTypeShape EntityType="RemoteModel.SITE" Width="1.5" PointX="3" PointY="10.75" /> - <EntityTypeShape EntityType="RemoteModel.SITES_CATALOGS" Width="1.5" PointX="11.25" PointY="29" /> - <EntityTypeShape EntityType="RemoteModel.SITES_RMLS" Width="1.5" PointX="5.25" PointY="21" /> - <EntityTypeShape EntityType="RemoteModel.SITES_SPOOL_TYPES" Width="1.5" PointX="14.25" PointY="24.875" /> - <EntityTypeShape EntityType="RemoteModel.SPOOL_TYPES" Width="1.5" PointX="9" PointY="28.625" /> - <EntityTypeShape EntityType="RemoteModel.SPOOL" Width="1.5" PointX="11.25" PointY="51.125" /> - <EntityTypeShape EntityType="RemoteModel.sysdiagram" Width="1.5" PointX="11.75" PointY="4.75" /> + <EntityTypeShape EntityType="RemoteModel.SITE" Width="1.5" PointX="3" PointY="30.75" /> + <EntityTypeShape EntityType="RemoteModel.SITES_CATALOGS" Width="1.5" PointX="5.25" PointY="12.5" /> + <EntityTypeShape EntityType="RemoteModel.SITES_RMLS" Width="1.5" PointX="5.25" PointY="21.125" /> + <EntityTypeShape EntityType="RemoteModel.SITES_SPOOL_TYPES" Width="1.5" PointX="11.25" PointY="13.125" /> + <EntityTypeShape EntityType="RemoteModel.SPOOL_TYPES" Width="1.5" PointX="3" PointY="9" /> + <EntityTypeShape EntityType="RemoteModel.SPOOL" Width="1.5" PointX="8.25" PointY="43.25" /> + <EntityTypeShape EntityType="RemoteModel.sysdiagram" Width="1.5" PointX="13.75" PointY="15.75" /> <EntityTypeShape EntityType="RemoteModel.TANGO_UPDATES" Width="1.5" PointX="16.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TANGO_VERSIONS" Width="1.5" PointX="14.25" PointY="49.625" /> - <EntityTypeShape EntityType="RemoteModel.TECH_CONTROLLERS" Width="1.5" PointX="16.75" PointY="8.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_DISPENSERS" Width="1.5" PointX="17.75" PointY="12.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_HEATERS" Width="1.5" PointX="19.75" PointY="10.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_IOS" Width="1.5" PointX="20.75" PointY="13.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="20.75" PointY="18.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="21.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="9" PointY="34" /> - <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="14.25" PointY="35.5" /> - <EntityTypeShape EntityType="RemoteModel.WASHING_TEST_MATERIALS" Width="1.5" PointX="11.75" PointY="1.5" /> - <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="9" PointY="6" /> + <EntityTypeShape EntityType="RemoteModel.TANGO_VERSIONS" Width="1.5" PointX="11.25" PointY="44.375" /> + <EntityTypeShape EntityType="RemoteModel.TECH_CONTROLLERS" Width="1.5" PointX="16.75" PointY="5.75" /> + <EntityTypeShape EntityType="RemoteModel.TECH_DISPENSERS" Width="1.5" PointX="17.75" PointY="9.75" /> + <EntityTypeShape EntityType="RemoteModel.TECH_HEATERS" Width="1.5" PointX="17.75" PointY="12.75" /> + <EntityTypeShape EntityType="RemoteModel.TECH_IOS" Width="1.5" PointX="18.75" PointY="0.75" /> + <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="19.75" PointY="5.75" /> + <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="19.75" PointY="10.75" /> + <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="9" PointY="31.5" /> + <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="14.25" PointY="33" /> + <EntityTypeShape EntityType="RemoteModel.WASHING_TEST_MATERIALS" Width="1.5" PointX="8.75" PointY="1.5" /> + <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="9" PointY="24.875" /> <AssociationConnector Association="RemoteModel.FK_ACTION_LOGS_USERS" /> <AssociationConnector Association="RemoteModel.FK_ORGANIZATIONS_ADDRESSES" /> <AssociationConnector Association="RemoteModel.FK_USERS_ADDRESSES" /> diff --git a/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs b/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs index 60b2efa9b..38fc472bc 100644 --- a/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs +++ b/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs @@ -1,16 +1,21 @@ using System; using System.Collections.Generic; +using System.Diagnostics; +using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; using Tango.BL; using Tango.BL.Builders; +using Tango.BL.DTO; using Tango.BL.Entities; using Tango.BL.Enumerations; using Tango.Core; using Tango.Core.ExtensionMethods; using Tango.Integration.Operation; +using Tango.PMR.MachineStatus; +using Tango.PMR.Printing; namespace Tango.Integration.JobRuns { @@ -22,6 +27,9 @@ namespace Tango.Integration.JobRuns { private Job _job; private Machine _defaultMachine; + private List<MachinesEvent> _currentJobEvents; + private MachineStatus _startMachineStatus; + private JobTicket _jobTicket; #region Properties @@ -45,6 +53,16 @@ namespace Tango.Integration.JobRuns /// </summary> public JobSource JobSource { get; set; } + /// <summary> + /// Gets or sets a value indicating whether create job run files with job ticket information and more. + /// </summary> + public bool CreateJobRunsFiles { get; set; } + + /// <summary> + /// Gets or sets the job runs files folder. + /// </summary> + public String JobRunsFolder { get; set; } + #endregion #region Constructors @@ -78,6 +96,21 @@ namespace Tango.Integration.JobRuns MachineOperator.PrintingFailed -= Machine_PrintingFailed; MachineOperator.PrintingFailed += Machine_PrintingFailed; MachineOperator.HeadCleaningEnded += MachineOperator_HeadCleaningEnded; + MachineOperator.MachineEventsStateProvider.EventsReceived -= MachineEventsStateProvider_EventsReceived; + MachineOperator.MachineEventsStateProvider.EventsReceived += MachineEventsStateProvider_EventsReceived; + + _currentJobEvents = new List<MachinesEvent>(); + + JobRunsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), + "Twine", "Tango", "JobRuns Extended Info"); + } + + private void MachineEventsStateProvider_EventsReceived(object sender, IEnumerable<MachinesEvent> events) + { + foreach (var item in events.ToList()) + { + _currentJobEvents.Add(item); + } } private bool ShouldLog() @@ -113,8 +146,9 @@ namespace Tango.Integration.JobRuns run.MachineGuid = _job.MachineGuid; run.JobRunStatus = status; run.EndPosition = e.JobHandler.Status.Progress; - //run.JobLength = _job.LengthIncludingNumberOfUnits; //Should I use this or the below ?? + run.NumberOfUnits = _job.NumberOfUnits; run.JobLength = e.JobHandler.Status.TotalProgress; + run.JobLogicalLength = e.Job.Length; run.LiquidQuantities = e.LiquidQuantities; run.IsGradient = _job.Segments.Any(x => x.BrushStops.Count > 1); run.GradientResolutionCm = MachineOperator.GradientGenerationConfiguration.ResolutionCM; @@ -187,6 +221,30 @@ namespace Tango.Integration.JobRuns LogManager.Log($"Inserting job run for '{run.JobName}'...\n{run.ToJsonString(nameof(JobRun.JobString), nameof(JobRun.LiquidQuantityString))}"); db.SaveChanges(); + + if (CreateJobRunsFiles) + { + try + { + Directory.CreateDirectory(JobRunsFolder); + + JobRunInfo jobRunInfo = new JobRunInfo(); + jobRunInfo.JobRunID = run.ID; + jobRunInfo.JobTicket = _jobTicket; + jobRunInfo.Events = _currentJobEvents.Select(x => MachinesEventDTO.FromObservable(x)).ToList(); + jobRunInfo.StartMachineStatus = _startMachineStatus; + jobRunInfo.EndMachineStatus = MachineOperator.MachineStatus?.Clone(); + + String json = jobRunInfo.ToJsonString(); + File.WriteAllText(Path.Combine(JobRunsFolder, $"{run.ID}.run"), json); + + LogManager.Log($"JobRun extended info file '{run.ID}' created."); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error creating job run extended info file."); + } + } } } catch (Exception ex) @@ -337,6 +395,9 @@ namespace Tango.Integration.JobRuns private async void Machine_PrintingStarted(object sender, PrintingEventArgs e) { _job = e.Job; + _currentJobEvents = new List<MachinesEvent>(); + _startMachineStatus = MachineOperator.MachineStatus?.Clone(); + _jobTicket = e.JobHandler.JobTicket; if (_job.Designation == JobDesignations.FineTuning) return; diff --git a/Software/Visual_Studio/Tango.Integration/JobRuns/JobRunInfo.cs b/Software/Visual_Studio/Tango.Integration/JobRuns/JobRunInfo.cs new file mode 100644 index 000000000..ae2172ec2 --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/JobRuns/JobRunInfo.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.DTO; +using Tango.BL.Entities; +using Tango.PMR.MachineStatus; +using Tango.PMR.Printing; + +namespace Tango.Integration.JobRuns +{ + public class JobRunInfo + { + public int JobRunID { get; set; } + public JobTicket JobTicket { get; set; } + public MachineStatus StartMachineStatus { get; set; } + public MachineStatus EndMachineStatus { get; set; } + public List<MachinesEventDTO> Events { get; set; } + + public JobRunInfo() + { + Events = new List<MachinesEventDTO>(); + } + } +} diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj index 7769a0433..2834989a7 100644 --- a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj +++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj @@ -111,6 +111,7 @@ <Compile Include="IntegrationSettings.cs" /> <Compile Include="JobRuns\BasicJobRunsLogger.cs" /> <Compile Include="JobRuns\IJobRunsLogger.cs" /> + <Compile Include="JobRuns\JobRunInfo.cs" /> <Compile Include="Logging\EmbeddedLogFileParser.cs" /> <Compile Include="Operation\AdditionalJobConfiguration.cs" /> <Compile Include="Operation\BitResultComposition.cs" /> @@ -223,7 +224,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <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> </Project>
\ No newline at end of file |
