aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-11-13 09:37:40 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-11-13 09:37:40 +0200
commit996422d12e0a40aa408757989232f0225dc29a28 (patch)
tree2b0cc51b925a35c8959e0cc0571c61558a6a9447 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems
parentfc1f93d66a43c5d304eeb32238cc186d14598c84 (diff)
downloadTango-996422d12e0a40aa408757989232f0225dc29a28.tar.gz
Tango-996422d12e0a40aa408757989232f0225dc29a28.zip
Fixed issue with CSV monitor recorder.
Machine Studio v3.5.65
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorRecorderItem.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorRecorderItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorRecorderItem.cs
index e2b62092d..321d87632 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorRecorderItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorRecorderItem.cs
@@ -29,6 +29,8 @@ namespace Tango.MachineStudio.Technician.TechItems
[XmlIgnore]
public SelectedObjectCollection<TechMonitor> Monitors { get; set; }
+ public List<String> SelectedMonitorsGuids { get; set; }
+
private bool _isRecording;
/// <summary>
/// Gets or sets a value indicating whether this instance is recording.
@@ -75,7 +77,10 @@ namespace Tango.MachineStudio.Technician.TechItems
_timer.Tick += _timer_Tick;
_timer.Interval = TimeSpan.FromSeconds(1);
+ SelectedMonitorsGuids = new List<string>();
+
Monitors = new SelectedObjectCollection<TechMonitor>(Adapter.TechMonitors.ToObservableCollection(), new ObservableCollection<TechMonitor>());
+ Monitors.SelectionChanged += Monitors_SelectionChanged;
Name = "CSV Recorder";
Description = "Record multiple monitors to a CSV file";
Image = ResourceHelper.GetImageFromResources("Images/csv.png");
@@ -85,6 +90,11 @@ namespace Tango.MachineStudio.Technician.TechItems
TogglePauseCommand = new RelayCommand(() => { IsPaused = !IsPaused; });
}
+ private void Monitors_SelectionChanged(object sender, EventArgs e)
+ {
+ SelectedMonitorsGuids = GetSelectedMonitors().Select(x => x.Guid).ToList();
+ }
+
public MonitorRecorderItem(object dummy) : this()
{
@@ -127,5 +137,18 @@ namespace Tango.MachineStudio.Technician.TechItems
{
return Monitors.SynchedSource.ToList();
}
+
+ public void SetSelectedMonitors(IEnumerable<TechMonitor> monitors)
+ {
+ foreach (var monitor in monitors.ToList())
+ {
+ var item = Monitors.ToList().SingleOrDefault(x => x.Data == monitor);
+
+ if (item != null)
+ {
+ item.IsSelected = true;
+ }
+ }
+ }
}
}