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-10-10 16:55:44 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-10-10 16:55:44 +0300
commit79eb19cbd10785a7dbc972bc0b26817932237419 (patch)
treee36176fc94ce6f26efc89b006d7e6faf7e4398cb /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems
parentdf9197240ba5a643ce1599f36b7e3dd34aad6a60 (diff)
downloadTango-79eb19cbd10785a7dbc972bc0b26817932237419.tar.gz
Tango-79eb19cbd10785a7dbc972bc0b26817932237419.zip
Sign-out works !
Fixed issue where color conversion was busy while not in research module but research module in job view. Added new RealTimeGraphX !
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs84
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs97
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs2
3 files changed, 150 insertions, 33 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs
index a935ee5a6..377738d09 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs
@@ -1,4 +1,5 @@
-using System;
+using RealTimeGraphX.DataPoints;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -41,24 +42,38 @@ namespace Tango.MachineStudio.Technician.TechItems
_techMonitor = value;
RaisePropertyChangedAuto();
- if (_techMonitor != old && Editor != null)
- {
- Editor.InnerGraph.InnerGraph.MaxPoints = GraphsHelper.GetMaxPoints(TechMonitor.PointsPerFrame);
- Editor.InnerGraph.InvalidateGraph();
- }
-
ItemGuid = value != null ? value.Guid : null;
TechName = _techMonitor != null ? _techMonitor.Description : null;
}
}
+ private MultiGraphElementEditor _editor;
/// <summary>
/// Gets or sets the item editor.
/// </summary>
[XmlIgnore]
- public MultiGraphElementEditor Editor { get; set; }
+ public MultiGraphElementEditor Editor
+ {
+ get { return _editor; }
+ set
+ {
+ _editor = value;
+ SetEditorSettings();
+ }
+ }
+ private int _duration;
+ public int Duration
+ {
+ get { return _duration; }
+ set
+ {
+ _duration = value;
+ RaisePropertyChangedAuto();
+ SetEditorSettings();
+ }
+ }
private double _min;
/// <summary>
/// Gets or sets the minimum graph value.
@@ -66,7 +81,11 @@ namespace Tango.MachineStudio.Technician.TechItems
public double Min
{
get { return _min; }
- set { _min = value; RaisePropertyChangedAuto(); }
+ set
+ {
+ _min = value; RaisePropertyChangedAuto();
+ SetEditorSettings();
+ }
}
private double _max;
@@ -76,7 +95,11 @@ namespace Tango.MachineStudio.Technician.TechItems
public double Max
{
get { return _max; }
- set { _max = value; RaisePropertyChangedAuto(); }
+ set
+ {
+ _max = value; RaisePropertyChangedAuto();
+ SetEditorSettings();
+ }
}
private bool _useAutoRange;
@@ -86,7 +109,21 @@ namespace Tango.MachineStudio.Technician.TechItems
public bool UseAutoRange
{
get { return _useAutoRange; }
- set { _useAutoRange = value; RaisePropertyChangedAuto(); }
+ set
+ {
+ _useAutoRange = value; RaisePropertyChangedAuto();
+ SetEditorSettings();
+ }
+ }
+
+ private int _decimalPlaces;
+ /// <summary>
+ /// Gets or sets the decimal places of y-axis.
+ /// </summary>
+ public int DecimalPlaces
+ {
+ get { return _decimalPlaces; }
+ set { _decimalPlaces = value; RaisePropertyChangedAuto(); }
}
private bool _isPaused;
@@ -100,11 +137,7 @@ namespace Tango.MachineStudio.Technician.TechItems
set
{
_isPaused = value; RaisePropertyChangedAuto();
-
- if (Editor != null)
- {
- Editor.InnerGraph.Controller.IsPaused = _isPaused;
- }
+ SetEditorSettings();
}
}
@@ -144,6 +177,9 @@ namespace Tango.MachineStudio.Technician.TechItems
/// </summary>
public MultiGraphItem() : base()
{
+ _useAutoRange = true;
+ DecimalPlaces = 1;
+ _duration = 10;
_timer = new DispatcherTimer();
_timer.Tick += _timer_Tick;
_timer.Interval = TimeSpan.FromSeconds(1);
@@ -173,6 +209,20 @@ namespace Tango.MachineStudio.Technician.TechItems
});
}
+ private void SetEditorSettings()
+ {
+ if (Editor != null)
+ {
+ var controller = Editor.InnerGraph.Controller;
+
+ controller.Range.MaximumX = new TimeSpanDataPoint(TimeSpan.FromSeconds(_duration));
+ controller.Range.MinimumY = new DoubleDataPoint(_min);
+ controller.Range.MaximumY = new DoubleDataPoint(_max);
+ controller.Range.AutoY = _useAutoRange;
+ controller.IsPaused = _isPaused;
+ }
+ }
+
private void OnTechMonitorChanged()
{
if (TechMonitor != null)
@@ -233,6 +283,8 @@ namespace Tango.MachineStudio.Technician.TechItems
cloned.Min = Min;
cloned.Max = Max;
cloned.UseAutoRange = UseAutoRange;
+ cloned.Duration = Duration;
+ cloned.DecimalPlaces = DecimalPlaces;
return cloned;
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs
index 87d971233..808dadb68 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs
@@ -1,6 +1,8 @@
-using System;
+using RealTimeGraphX.DataPoints;
+using System;
using System.Collections.Generic;
using System.Linq;
+using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
@@ -42,12 +44,6 @@ namespace Tango.MachineStudio.Technician.TechItems
_techMonitor = value;
RaisePropertyChangedAuto();
- if (_techMonitor != old && Editor != null)
- {
- Editor.InnerGraph.InnerGraph.MaxPoints = GraphsHelper.GetMaxPoints(TechMonitor.PointsPerFrame);
- Editor.InnerGraph.InvalidateGraph();
- }
-
ItemGuid = value != null ? value.Guid : null;
TechName = _techMonitor != null ? _techMonitor.Description : null;
@@ -55,11 +51,32 @@ namespace Tango.MachineStudio.Technician.TechItems
}
}
+ private SingleGraphElementEditor _editor;
/// <summary>
/// Gets or sets the item editor.
/// </summary>
[XmlIgnore]
- public SingleGraphElementEditor Editor { get; set; }
+ public SingleGraphElementEditor Editor
+ {
+ get { return _editor; }
+ set
+ {
+ _editor = value;
+ SetEditorSettings();
+ }
+ }
+
+ private int _duration;
+ public int Duration
+ {
+ get { return _duration; }
+ set
+ {
+ _duration = value;
+ RaisePropertyChangedAuto();
+ SetEditorSettings();
+ }
+ }
private double _min;
/// <summary>
@@ -68,7 +85,11 @@ namespace Tango.MachineStudio.Technician.TechItems
public double Min
{
get { return _min; }
- set { _min = value; RaisePropertyChangedAuto(); }
+ set
+ {
+ _min = value; RaisePropertyChangedAuto();
+ SetEditorSettings();
+ }
}
private double _max;
@@ -78,7 +99,11 @@ namespace Tango.MachineStudio.Technician.TechItems
public double Max
{
get { return _max; }
- set { _max = value; RaisePropertyChangedAuto(); }
+ set
+ {
+ _max = value; RaisePropertyChangedAuto();
+ SetEditorSettings();
+ }
}
private bool _useAutoRange;
@@ -88,7 +113,21 @@ namespace Tango.MachineStudio.Technician.TechItems
public bool UseAutoRange
{
get { return _useAutoRange; }
- set { _useAutoRange = value; RaisePropertyChangedAuto(); }
+ set
+ {
+ _useAutoRange = value; RaisePropertyChangedAuto();
+ SetEditorSettings();
+ }
+ }
+
+ private int _decimalPlaces;
+ /// <summary>
+ /// Gets or sets the decimal places of y-axis.
+ /// </summary>
+ public int DecimalPlaces
+ {
+ get { return _decimalPlaces; }
+ set { _decimalPlaces = value; RaisePropertyChangedAuto(); }
}
private bool _isPaused;
@@ -102,11 +141,7 @@ namespace Tango.MachineStudio.Technician.TechItems
set
{
_isPaused = value; RaisePropertyChangedAuto();
-
- if (Editor != null)
- {
- Editor.InnerGraph.Controller.IsPaused = _isPaused;
- }
+ SetEditorSettings();
}
}
@@ -146,6 +181,9 @@ namespace Tango.MachineStudio.Technician.TechItems
/// </summary>
public SingleGraphItem() : base()
{
+ _useAutoRange = true;
+ DecimalPlaces = 1;
+ _duration = 10;
_timer = new DispatcherTimer();
_timer.Tick += _timer_Tick;
_timer.Interval = TimeSpan.FromSeconds(1);
@@ -175,6 +213,21 @@ namespace Tango.MachineStudio.Technician.TechItems
});
}
+ private void SetEditorSettings()
+ {
+ if (Editor != null)
+ {
+ var controller = Editor.InnerGraph.Controller;
+
+ controller.Range.MaximumX = new TimeSpanDataPoint(TimeSpan.FromSeconds(_duration));
+ controller.Range.MinimumY = new DoubleDataPoint(_min);
+ controller.Range.MaximumY = new DoubleDataPoint(_max);
+ controller.Range.AutoY = _useAutoRange;
+ controller.IsPaused = _isPaused;
+ controller.DataSeriesCollection[0].Stroke = Color;
+ }
+ }
+
private void _timer_Tick(object sender, EventArgs e)
{
RecordingTime = DateTime.Now - _recording_start_time;
@@ -235,7 +288,19 @@ namespace Tango.MachineStudio.Technician.TechItems
cloned.Min = Min;
cloned.Max = Max;
cloned.UseAutoRange = UseAutoRange;
+ cloned.Duration = Duration;
+ cloned.DecimalPlaces = DecimalPlaces;
return cloned;
}
+
+ protected override void RaisePropertyChanged(string propName)
+ {
+ base.RaisePropertyChanged(propName);
+
+ if (propName == nameof(Color))
+ {
+ SetEditorSettings();
+ }
+ }
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs
index 6fa00ae0a..54fbc8175 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs
@@ -181,7 +181,7 @@ namespace Tango.MachineStudio.Technician.TechItems
set
{
_color = value;
- RaisePropertyChangedAuto();
+ RaisePropertyChanged(nameof(Color));
_colorNumber = ColorHelper.ColorToInteger(value);
}
}