aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2022-11-15 19:18:09 +0200
committerRoy <Roy.mail.net@gmail.com>2022-11-15 19:18:09 +0200
commitba8c20b11ce7c94c7e81c4f23302ed97acbc6dcf (patch)
tree905fef9b7307e9f8e565c0c1ee63deb229501f89 /Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs
parent59052dd593c0d3d4eb2bf6c579e44c06daf7a038 (diff)
downloadTango-ba8c20b11ce7c94c7e81c4f23302ed97acbc6dcf.tar.gz
Tango-ba8c20b11ce7c94c7e81c4f23302ed97acbc6dcf.zip
Number of units/logical length on CSV and copy stop to clipboard.
Diffstat (limited to 'Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs')
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs33
1 files changed, 31 insertions, 2 deletions
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 5fd5ea910..c6dfa8c11 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
@@ -7,6 +7,7 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Windows;
using System.Windows.Data;
using Tango.BL;
using Tango.BL.DTO;
@@ -160,8 +161,9 @@ namespace Tango.FSE.Statistics.ViewModels
public RelayCommand<StopModel> ShowExtendedInfoCommand { get; set; }
- public RelayCommand ExportToCsvCommand { get; set; }
+ public RelayCommand<StopModel> CopyCommand { get; set; }
+ public RelayCommand ExportToCsvCommand { get; set; }
public MainViewVM()
{
@@ -202,6 +204,7 @@ namespace Tango.FSE.Statistics.ViewModels
ShowFailedMessageCommand = new RelayCommand<StopModel>(ShowJobRunFailedMessage);
ShowExtendedInfoCommand = new RelayCommand<StopModel>(ShowJobRunExtendedInfo);
+ CopyCommand = new RelayCommand<StopModel>(CopyStopToClipboard);
ExportToCsvCommand = new RelayCommand(ExportToCSV, () => IsResultsAvailable);
}
@@ -338,6 +341,7 @@ namespace Tango.FSE.Statistics.ViewModels
stop.ShowFailedMessageCommand = ShowFailedMessageCommand;
stop.ShowExtendedInfoCommand = ShowExtendedInfoCommand;
+ stop.CopyCommand = CopyCommand;
stops.Add(stop);
}
@@ -495,6 +499,29 @@ namespace Tango.FSE.Statistics.ViewModels
}
}
+ private void CopyStopToClipboard(StopModel stop)
+ {
+ String input = String.Empty;
+
+ switch (stop.ColorSpace)
+ {
+ case ColorSpaces.RGB:
+ input = $"{stop.Red}\t{stop.Green}\t{stop.Blue}";
+ break;
+ case ColorSpaces.LAB:
+ input = $"{stop.L}\t{stop.A}\t{stop.B}";
+ break;
+ case ColorSpaces.Catalog:
+ input = $"{stop.Catalog}\t{stop.CatalogItem}";
+ break;
+ case ColorSpaces.Volume:
+ input = $"{stop.Cyan}\t{stop.Magenta}\t{stop.Yellow}\t{stop.Black}";
+ break;
+ }
+
+ Clipboard.SetText($"{stop.ColorSpace}\t{input}\t{stop.CyanOutput}\t{stop.MagentaOutput}\t{stop.YellowOutput}\t{stop.BlackOutput}\t{stop.LightCyanOutput}\t{stop.LightMagentaOutput}\t{stop.LightYellowOutput}\t{stop.TransparentInkOutput}", TextDataFormat.Text);
+ }
+
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");
@@ -514,6 +541,7 @@ namespace Tango.FSE.Statistics.ViewModels
"Job Name",
"Thread",
"Length",
+ "Number Of Units",
"Start Time",
"Duration",
"End Position",
@@ -552,7 +580,8 @@ namespace Tango.FSE.Statistics.ViewModels
model.JobIndex = stop.JobIndex.ToString();
model.JobName = stop.JobRun.JobName;
model.Thread = stop.ThreadName;
- model.Length = ((int)stop.JobRun.JobLength).ToString();
+ model.Length = ((int)stop.JobRun.JobLogicalLength).ToString();
+ model.NumberOfUnits = stop.JobRun.NumberOfUnits.ToString();
model.StartTime = stop.JobRun.StartDate.ToLocalTime().ToString();
model.Duration = stop.Duration.ToStringUnlimitedHours();
model.EndPosition = stop.JobRun.EndPosition.ToString();