aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-02-14 11:47:21 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-14 11:47:21 +0200
commit7ed962c7206817556e790d048bca38e4e3caf249 (patch)
tree502518f28704c7180354d772cc148450b52d658d /Software/Visual_Studio/MachineStudio/Modules
parent94ac70f0eaf29fcca4ae3ff5552c52cad22df492 (diff)
downloadTango-7ed962c7206817556e790d048bca38e4e3caf249.tar.gz
Tango-7ed962c7206817556e790d048bca38e4e3caf249.zip
Added code comments for technician module.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DigitalInItem.cs21
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DigitalOutItem.cs27
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs62
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MeterItem.cs37
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorItem.cs27
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorActionType.cs3
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorGroupItem.cs76
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs62
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs21
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs21
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs47
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItemAttribute.cs11
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ThreadMotionItem.cs44
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs162
14 files changed, 538 insertions, 83 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DigitalInItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DigitalInItem.cs
index f6d09ae59..7f1548254 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DigitalInItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DigitalInItem.cs
@@ -10,10 +10,17 @@ using Tango.SharedUI.Helpers;
namespace Tango.MachineStudio.Technician.TechItems
{
+ /// <summary>
+ /// Represents a digital input pin item.
+ /// </summary>
+ /// <seealso cref="Tango.MachineStudio.Technician.TechItems.TechItem" />
[TechItem(0)]
public class DigitalInItem : TechItem
{
private TechIo _techIo;
+ /// <summary>
+ /// Gets or sets the DB tech item.
+ /// </summary>
[XmlIgnore]
public TechIo TechIo
{
@@ -22,6 +29,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private bool _value;
+ /// <summary>
+ /// Gets or sets whether the input is on.
+ /// </summary>
[XmlIgnore]
public bool Value
{
@@ -29,6 +39,9 @@ namespace Tango.MachineStudio.Technician.TechItems
set { _value = value; RaisePropertyChangedAuto(); }
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="DigitalInItem"/> class.
+ /// </summary>
public DigitalInItem() : base()
{
Name = "Digital In";
@@ -37,11 +50,19 @@ namespace Tango.MachineStudio.Technician.TechItems
Color = Colors.White;
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="DigitalInItem"/> class.
+ /// </summary>
+ /// <param name="techIo">The db tech.</param>
public DigitalInItem(TechIo techIo) : this()
{
TechIo = techIo;
}
+ /// <summary>
+ /// Clones this instance.
+ /// </summary>
+ /// <returns></returns>
public override TechItem Clone()
{
DigitalInItem cloned = base.Clone() as DigitalInItem;
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DigitalOutItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DigitalOutItem.cs
index ae8a0a023..2a0625c53 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DigitalOutItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DigitalOutItem.cs
@@ -10,12 +10,22 @@ using Tango.SharedUI.Helpers;
namespace Tango.MachineStudio.Technician.TechItems
{
+ /// <summary>
+ /// Represents a digital output pin item.
+ /// </summary>
+ /// <seealso cref="Tango.MachineStudio.Technician.TechItems.TechItem" />
[TechItem(1)]
public class DigitalOutItem : TechItem
{
+ /// <summary>
+ /// Occurs when the user has changed the current value.
+ /// </summary>
public event EventHandler<bool> ValueChanged;
private TechIo _techIo;
+ /// <summary>
+ /// Gets or sets the db tech item.
+ /// </summary>
[XmlIgnore]
public TechIo TechIo
{
@@ -24,6 +34,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private bool _value;
+ /// <summary>
+ /// Gets or sets a value indicating whether this <see cref="DigitalOutItem"/> is on.
+ /// </summary>
[XmlIgnore]
public bool Value
{
@@ -32,6 +45,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private bool _effectiveValue;
+ /// <summary>
+ /// Gets or sets the effective value received from the embedded device.
+ /// </summary>
[XmlIgnore]
public bool EffectiveValue
{
@@ -48,6 +64,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="DigitalOutItem"/> class.
+ /// </summary>
public DigitalOutItem() : base()
{
Name = "Digital Out";
@@ -56,11 +75,19 @@ namespace Tango.MachineStudio.Technician.TechItems
Color = Colors.White;
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="DigitalOutItem"/> class.
+ /// </summary>
+ /// <param name="techIo">The db tech item.</param>
public DigitalOutItem(TechIo techIo) : this()
{
TechIo = techIo;
}
+ /// <summary>
+ /// Clones this instance.
+ /// </summary>
+ /// <returns></returns>
public override TechItem Clone()
{
DigitalOutItem cloned = base.Clone() as DigitalOutItem;
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs
index 8bb72fc66..e2ab9931d 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs
@@ -11,13 +11,27 @@ using Tango.SharedUI.Helpers;
namespace Tango.MachineStudio.Technician.TechItems
{
+ /// <summary>
+ /// Represents a dispenser controller item.
+ /// </summary>
+ /// <seealso cref="Tango.MachineStudio.Technician.TechItems.TechItem" />
[TechItem(8)]
public class DispenserItem : TechItem
{
+ /// <summary>
+ /// Occurs when the user has pressed one of the action controllers.
+ /// </summary>
public event EventHandler<MotorActionType> ActionExecuted;
+
+ /// <summary>
+ /// Occurs when dispenser homing has completed.
+ /// </summary>
public event EventHandler HomingCompleted;
private TechDispenser _techDispenser;
+ /// <summary>
+ /// Gets or sets the db tech dispenser.
+ /// </summary>
[XmlIgnore]
public TechDispenser TechDispenser
{
@@ -26,6 +40,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private bool _isHoming;
+ /// <summary>
+ /// Gets or sets a value indicating whether the dispenser is currently homing.
+ /// </summary>
[XmlIgnore]
public bool IsHoming
{
@@ -38,7 +55,10 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private bool _isHomingCompleted;
-
+ /// <summary>
+ /// Gets or sets a value indicating whether the dispenser homing has completed.
+ /// </summary>
+ [XmlIgnore]
public bool IsHomingCompleted
{
get { return _isHomingCompleted; }
@@ -55,6 +75,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private double _homingProgress;
+ /// <summary>
+ /// Gets or sets the dispenser current homing progress.
+ /// </summary>
[XmlIgnore]
public double HomingProgress
{
@@ -67,6 +90,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private double _homingMaximumProgress;
+ /// <summary>
+ /// Gets or sets the homing maximum progress.
+ /// </summary>
[XmlIgnore]
public double HomingMaximumProgress
{
@@ -74,29 +100,19 @@ namespace Tango.MachineStudio.Technician.TechItems
set { _homingMaximumProgress = value; RaisePropertyChangedAuto(); }
}
- private bool _isForwardPressed;
- [XmlIgnore]
- public bool IsForwardPressed
- {
- get { return _isForwardPressed; }
- set { _isForwardPressed = value; RaisePropertyChangedAuto(); }
- }
-
- private bool _isBackwardPressed;
- [XmlIgnore]
- public bool IsBackwardPressed
- {
- get { return _isBackwardPressed; }
- set { _isBackwardPressed = value; RaisePropertyChangedAuto(); }
- }
-
private double _speed;
+ /// <summary>
+ /// Gets or sets the dispenser motor speed.
+ /// </summary>
public double Speed
{
get { return _speed; }
set { _speed = value; RaisePropertyChangedAuto(); }
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="DispenserItem"/> class.
+ /// </summary>
public DispenserItem() : base()
{
Name = "Dispenser";
@@ -105,11 +121,19 @@ namespace Tango.MachineStudio.Technician.TechItems
Color = Colors.White;
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="DispenserItem"/> class.
+ /// </summary>
+ /// <param name="techDispenser">The tech dispenser.</param>
public DispenserItem(TechDispenser techDispenser) : this()
{
TechDispenser = techDispenser;
}
+ /// <summary>
+ /// Clones this instance.
+ /// </summary>
+ /// <returns></returns>
public override TechItem Clone()
{
DispenserItem cloned = base.Clone() as DispenserItem;
@@ -117,6 +141,10 @@ namespace Tango.MachineStudio.Technician.TechItems
return cloned;
}
+ /// <summary>
+ /// Raises the <see cref="ActionExecuted"/> event with the specified action.
+ /// </summary>
+ /// <param name="action">The action.</param>
public void RaiseAction(MotorActionType action)
{
ActionExecuted?.Invoke(this, action);
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MeterItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MeterItem.cs
index d7f019fa9..ce90859b2 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MeterItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MeterItem.cs
@@ -11,10 +11,17 @@ using Tango.SharedUI.Helpers;
namespace Tango.MachineStudio.Technician.TechItems
{
+ /// <summary>
+ /// Represents an analog style VU meter item.
+ /// </summary>
+ /// <seealso cref="Tango.MachineStudio.Technician.TechItems.TechItem" />
[TechItem(3)]
public class MeterItem : TechItem
{
private TechMonitor _techMonitor;
+ /// <summary>
+ /// Gets or sets the db tech monitor.
+ /// </summary>
[XmlIgnore]
public TechMonitor TechMonitor
{
@@ -23,6 +30,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private double _value;
+ /// <summary>
+ /// Gets or sets the current value.
+ /// </summary>
[XmlIgnore]
public double Value
{
@@ -31,6 +41,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private int _updateInterval;
+ /// <summary>
+ /// Gets or sets the minimum update interval.
+ /// </summary>
public int UpdateInterval
{
get { return _updateInterval; }
@@ -38,6 +51,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private int _ledCount;
+ /// <summary>
+ /// Gets or sets the amount of LED's.
+ /// </summary>
public int LedCount
{
get { return _ledCount; }
@@ -45,23 +61,34 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private int _ticksCount;
+ /// <summary>
+ /// Gets or sets the amount of meter ticks.
+ /// </summary>
public int TicksCount
{
get { return _ticksCount; }
set { _ticksCount = value; RaisePropertyChangedAuto(); }
}
-
private TickPlacement _tickPlacement;
+ /// <summary>
+ /// Gets or sets the ticks placement.
+ /// </summary>
public TickPlacement TickPlacement
{
get { return _tickPlacement; }
set { _tickPlacement = value; RaisePropertyChangedAuto(); }
}
+ /// <summary>
+ /// Gets or sets the last update time.
+ /// </summary>
[XmlIgnore]
public DateTime LastUpdateTime { get; set; }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MeterItem"/> class.
+ /// </summary>
public MeterItem() : base()
{
Name = "VU Monitor";
@@ -75,11 +102,19 @@ namespace Tango.MachineStudio.Technician.TechItems
Color = Colors.DimGray;
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MeterItem"/> class.
+ /// </summary>
+ /// <param name="techMonitor">The db tech monitor.</param>
public MeterItem(TechMonitor techMonitor) : this()
{
TechMonitor = techMonitor;
}
+ /// <summary>
+ /// Clones this instance.
+ /// </summary>
+ /// <returns></returns>
public override TechItem Clone()
{
MeterItem cloned = base.Clone() as MeterItem;
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorItem.cs
index 987c6cc99..984cd5f78 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorItem.cs
@@ -10,10 +10,17 @@ using Tango.SharedUI.Helpers;
namespace Tango.MachineStudio.Technician.TechItems
{
+ /// <summary>
+ /// Represents an analog style integer monitor item.
+ /// </summary>
+ /// <seealso cref="Tango.MachineStudio.Technician.TechItems.TechItem" />
[TechItem(2)]
public class MonitorItem : TechItem
{
private TechMonitor _techMonitor;
+ /// <summary>
+ /// Gets or sets the db tech monitor.
+ /// </summary>
[XmlIgnore]
public TechMonitor TechMonitor
{
@@ -22,6 +29,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private double _value;
+ /// <summary>
+ /// Gets or sets the current value.
+ /// </summary>
[XmlIgnore]
public double Value
{
@@ -30,15 +40,24 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private int _updateInterval;
+ /// <summary>
+ /// Gets or sets the update interval.
+ /// </summary>
public int UpdateInterval
{
get { return _updateInterval; }
set { _updateInterval = value; RaisePropertyChangedAuto(); }
}
+ /// <summary>
+ /// Gets or sets the last update time.
+ /// </summary>
[XmlIgnore]
public DateTime LastUpdateTime { get; set; }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MonitorItem"/> class.
+ /// </summary>
public MonitorItem() : base()
{
Name = "Monitor";
@@ -49,11 +68,19 @@ namespace Tango.MachineStudio.Technician.TechItems
UpdateInterval = 10;
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MonitorItem"/> class.
+ /// </summary>
+ /// <param name="techMonitor">The db tech monitor.</param>
public MonitorItem(TechMonitor techMonitor) : this()
{
TechMonitor = techMonitor;
}
+ /// <summary>
+ /// Clones this instance.
+ /// </summary>
+ /// <returns></returns>
public override TechItem Clone()
{
MonitorItem cloned = base.Clone() as MonitorItem;
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorActionType.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorActionType.cs
index 319345926..57dabbbb2 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorActionType.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorActionType.cs
@@ -6,6 +6,9 @@ using System.Threading.Tasks;
namespace Tango.MachineStudio.Technician.TechItems
{
+ /// <summary>
+ /// Represents motor action types.
+ /// </summary>
public enum MotorActionType
{
ForwardPressed,
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorGroupItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorGroupItem.cs
index 551bf1f0a..143ce9c66 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorGroupItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorGroupItem.cs
@@ -12,13 +12,27 @@ using Tango.SharedUI.Helpers;
namespace Tango.MachineStudio.Technician.TechItems
{
+ /// <summary>
+ /// Represents a motors group item.
+ /// </summary>
+ /// <seealso cref="Tango.MachineStudio.Technician.TechItems.TechItem" />
[TechItem(7)]
public class MotorGroupItem : TechItem
{
+ /// <summary>
+ /// Occurs when the user has pressed/released on of the item actions.
+ /// </summary>
public event EventHandler<MotorActionType> ActionExecuted;
+
+ /// <summary>
+ /// Occurs when motor homing has completed.
+ /// </summary>
public event EventHandler HomingCompleted;
private SelectedObjectCollection<TechMotor> _selectedMotors;
+ /// <summary>
+ /// Gets or sets the selected db tech motors.
+ /// </summary>
[XmlIgnore]
public SelectedObjectCollection<TechMotor> SelectedMotors
{
@@ -27,6 +41,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private ObservableCollection<TechMotor> _techMotors;
+ /// <summary>
+ /// Gets or sets the available db tech motors.
+ /// </summary>
[XmlIgnore]
public ObservableCollection<TechMotor> TechMotors
{
@@ -34,6 +51,9 @@ namespace Tango.MachineStudio.Technician.TechItems
set { _techMotors = value; RaisePropertyChangedAuto(); SetSelectedMotors(); }
}
+ /// <summary>
+ /// Sets the selected motors.
+ /// </summary>
private void SetSelectedMotors()
{
if (TechMotors != null)
@@ -42,18 +62,25 @@ namespace Tango.MachineStudio.Technician.TechItems
}
}
+ /// <summary>
+ /// Gets or sets the selected tech items motors guids.
+ /// </summary>
public List<String> ItemsGuids { get; set; }
private String _groupName;
-
+ /// <summary>
+ /// Gets or sets the name of the group.
+ /// </summary>
public String GroupName
{
get { return _groupName; }
set { _groupName = value; RaisePropertyChangedAuto(); TechName = value; }
}
-
private bool _isHoming;
+ /// <summary>
+ /// Gets or sets a value indicating whether this motor group is currently homing.
+ /// </summary>
[XmlIgnore]
public bool IsHoming
{
@@ -66,7 +93,10 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private bool _isHomingCompleted;
-
+ /// <summary>
+ /// Gets or sets a value indicating whether this group homing has completed.
+ /// </summary>
+ [XmlIgnore]
public bool IsHomingCompleted
{
get { return _isHomingCompleted; }
@@ -83,6 +113,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private double _homingProgress;
+ /// <summary>
+ /// Gets or sets the current homing progress.
+ /// </summary>
[XmlIgnore]
public double HomingProgress
{
@@ -95,6 +128,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private double _homingMaximumProgress;
+ /// <summary>
+ /// Gets or sets the homing maximum progress.
+ /// </summary>
[XmlIgnore]
public double HomingMaximumProgress
{
@@ -102,29 +138,19 @@ namespace Tango.MachineStudio.Technician.TechItems
set { _homingMaximumProgress = value; RaisePropertyChangedAuto(); }
}
- private bool _isForwardPressed;
- [XmlIgnore]
- public bool IsForwardPressed
- {
- get { return _isForwardPressed; }
- set { _isForwardPressed = value; RaisePropertyChangedAuto(); }
- }
-
- private bool _isBackwardPressed;
- [XmlIgnore]
- public bool IsBackwardPressed
- {
- get { return _isBackwardPressed; }
- set { _isBackwardPressed = value; RaisePropertyChangedAuto(); }
- }
-
private double _speed;
+ /// <summary>
+ /// Gets or sets the motors speed.
+ /// </summary>
public double Speed
{
get { return _speed; }
set { _speed = value; RaisePropertyChangedAuto(); }
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MotorGroupItem"/> class.
+ /// </summary>
public MotorGroupItem() : base()
{
ItemsGuids = new List<string>();
@@ -136,11 +162,19 @@ namespace Tango.MachineStudio.Technician.TechItems
GroupName = "Motor Group";
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MotorGroupItem"/> class.
+ /// </summary>
+ /// <param name="dummyConstructor">does not matter.</param>
public MotorGroupItem(object dummyConstructor) : this()
{
}
+ /// <summary>
+ /// Clones this instance.
+ /// </summary>
+ /// <returns></returns>
public override TechItem Clone()
{
MotorGroupItem cloned = base.Clone() as MotorGroupItem;
@@ -151,6 +185,10 @@ namespace Tango.MachineStudio.Technician.TechItems
return cloned;
}
+ /// <summary>
+ /// Raises the <see cref="ActionExecuted"/> event with the specified action.
+ /// </summary>
+ /// <param name="action">The action.</param>
public void RaiseAction(MotorActionType action)
{
ActionExecuted?.Invoke(this, action);
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs
index ce668a464..2af7e6490 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs
@@ -11,13 +11,27 @@ using Tango.SharedUI.Helpers;
namespace Tango.MachineStudio.Technician.TechItems
{
+ /// <summary>
+ /// Represents a motor controller item.
+ /// </summary>
+ /// <seealso cref="Tango.MachineStudio.Technician.TechItems.TechItem" />
[TechItem(6)]
public class MotorItem : TechItem
{
+ /// <summary>
+ /// Occurs when the user has pressed/released on of the item actions.
+ /// </summary>
public event EventHandler<MotorActionType> ActionExecuted;
+
+ /// <summary>
+ /// Occurs when motor homing has completed.
+ /// </summary>
public event EventHandler HomingCompleted;
private TechMotor _techMotor;
+ /// <summary>
+ /// Gets or sets the db tech motor.
+ /// </summary>
[XmlIgnore]
public TechMotor TechMotor
{
@@ -26,6 +40,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private bool _isHoming;
+ /// <summary>
+ /// Gets or sets a value indicating whether the motor is currently homing.
+ /// </summary>
[XmlIgnore]
public bool IsHoming
{
@@ -38,7 +55,10 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private bool _isHomingCompleted;
-
+ /// <summary>
+ /// Gets or sets a value indicating whether the motor homing has completed.
+ /// </summary>
+ [XmlIgnore]
public bool IsHomingCompleted
{
get { return _isHomingCompleted; }
@@ -55,6 +75,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private double _homingProgress;
+ /// <summary>
+ /// Gets or sets the current homing progress.
+ /// </summary>
[XmlIgnore]
public double HomingProgress
{
@@ -67,6 +90,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private double _homingMaximumProgress;
+ /// <summary>
+ /// Gets or sets the homing maximum progress.
+ /// </summary>
[XmlIgnore]
public double HomingMaximumProgress
{
@@ -74,29 +100,19 @@ namespace Tango.MachineStudio.Technician.TechItems
set { _homingMaximumProgress = value; RaisePropertyChangedAuto(); }
}
- private bool _isForwardPressed;
- [XmlIgnore]
- public bool IsForwardPressed
- {
- get { return _isForwardPressed; }
- set { _isForwardPressed = value; RaisePropertyChangedAuto(); }
- }
-
- private bool _isBackwardPressed;
- [XmlIgnore]
- public bool IsBackwardPressed
- {
- get { return _isBackwardPressed; }
- set { _isBackwardPressed = value; RaisePropertyChangedAuto(); }
- }
-
private double _speed;
+ /// <summary>
+ /// Gets or sets the motor speed.
+ /// </summary>
public double Speed
{
get { return _speed; }
set { _speed = value; RaisePropertyChangedAuto(); }
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MotorItem"/> class.
+ /// </summary>
public MotorItem() : base()
{
Name = "Motor";
@@ -105,11 +121,19 @@ namespace Tango.MachineStudio.Technician.TechItems
Color = Colors.White;
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MotorItem"/> class.
+ /// </summary>
+ /// <param name="techMotor">The tech motor.</param>
public MotorItem(TechMotor techMotor) : this()
{
TechMotor = techMotor;
}
+ /// <summary>
+ /// Clones this instance.
+ /// </summary>
+ /// <returns></returns>
public override TechItem Clone()
{
MotorItem cloned = base.Clone() as MotorItem;
@@ -118,6 +142,10 @@ namespace Tango.MachineStudio.Technician.TechItems
return cloned;
}
+ /// <summary>
+ /// Raises the <see cref="ActionExecuted"/> event with the specified action.
+ /// </summary>
+ /// <param name="action">The action.</param>
public void RaiseAction(MotorActionType action)
{
ActionExecuted?.Invoke(this, action);
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 65ee521ef..f74a4b02c 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
@@ -10,10 +10,17 @@ using Tango.SharedUI.Helpers;
namespace Tango.MachineStudio.Technician.TechItems
{
+ /// <summary>
+ /// Represents a multi channel real-time graph item.
+ /// </summary>
+ /// <seealso cref="Tango.MachineStudio.Technician.TechItems.TechItem" />
[TechItem(5)]
public class MultiGraphItem : TechItem
{
private TechMonitor _techMonitor;
+ /// <summary>
+ /// Gets or sets the db tech monitor.
+ /// </summary>
[XmlIgnore]
public TechMonitor TechMonitor
{
@@ -37,9 +44,15 @@ namespace Tango.MachineStudio.Technician.TechItems
}
}
+ /// <summary>
+ /// Gets or sets the item editor.
+ /// </summary>
[XmlIgnore]
public MultiGraphElementEditor Editor { get; set; }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MultiGraphItem"/> class.
+ /// </summary>
public MultiGraphItem() : base()
{
Name = "Multi Channel Graph";
@@ -47,11 +60,19 @@ namespace Tango.MachineStudio.Technician.TechItems
Image = ResourceHelper.GetImageFromResources("Images/multi-graph.png");
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MultiGraphItem"/> class.
+ /// </summary>
+ /// <param name="techMonitor">The db tech monitor.</param>
public MultiGraphItem(TechMonitor techMonitor) : this()
{
TechMonitor = techMonitor;
}
+ /// <summary>
+ /// Clones this instance.
+ /// </summary>
+ /// <returns></returns>
public override TechItem Clone()
{
MultiGraphItem cloned = base.Clone() as MultiGraphItem;
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 9d44c6a33..9b19f0861 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
@@ -10,10 +10,17 @@ using Tango.SharedUI.Helpers;
namespace Tango.MachineStudio.Technician.TechItems
{
+ /// <summary>
+ /// Represents a single channel real-time graph item.
+ /// </summary>
+ /// <seealso cref="Tango.MachineStudio.Technician.TechItems.TechItem" />
[TechItem(4)]
public class SingleGraphItem : TechItem
{
private TechMonitor _techMonitor;
+ /// <summary>
+ /// Gets or sets the db tech monitor.
+ /// </summary>
[XmlIgnore]
public TechMonitor TechMonitor
{
@@ -36,9 +43,15 @@ namespace Tango.MachineStudio.Technician.TechItems
}
}
+ /// <summary>
+ /// Gets or sets the item editor.
+ /// </summary>
[XmlIgnore]
public SingleGraphElementEditor Editor { get; set; }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="SingleGraphItem"/> class.
+ /// </summary>
public SingleGraphItem() : base()
{
Name = "Single Channel Graph";
@@ -46,11 +59,19 @@ namespace Tango.MachineStudio.Technician.TechItems
Image = ResourceHelper.GetImageFromResources("Images/single-graph.png");
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="SingleGraphItem"/> class.
+ /// </summary>
+ /// <param name="techMonitor">The db tech monitor.</param>
public SingleGraphItem(TechMonitor techMonitor) : this()
{
TechMonitor = techMonitor;
}
+ /// <summary>
+ /// Clones this instance.
+ /// </summary>
+ /// <returns></returns>
public override TechItem Clone()
{
SingleGraphItem cloned = base.Clone() as SingleGraphItem;
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 a64cd7908..254c141b6 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
@@ -14,6 +14,10 @@ using System.Reflection;
namespace Tango.MachineStudio.Technician.TechItems
{
+ /// <summary>
+ /// Represents a tech item base class.
+ /// </summary>
+ /// <seealso cref="Tango.Core.ExtendedObject" />
[XmlInclude(typeof(DispenserItem))]
[XmlInclude(typeof(DigitalOutItem))]
[XmlInclude(typeof(MeterItem))]
@@ -26,6 +30,9 @@ namespace Tango.MachineStudio.Technician.TechItems
[XmlInclude(typeof(DigitalInItem))]
public abstract class TechItem : ExtendedObject
{
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TechItem"/> class.
+ /// </summary>
public TechItem()
{
ID = Guid.NewGuid().ToString();
@@ -35,6 +42,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private String _description;
+ /// <summary>
+ /// Gets or sets the description.
+ /// </summary>
[XmlIgnore]
public String Description
{
@@ -43,6 +53,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private BitmapSource _image;
+ /// <summary>
+ /// Gets or sets the image.
+ /// </summary>
[XmlIgnore]
public BitmapSource Image
{
@@ -50,6 +63,9 @@ namespace Tango.MachineStudio.Technician.TechItems
set { _image = value; RaisePropertyChangedAuto(); }
}
+ /// <summary>
+ /// Gets or sets the db adapter.
+ /// </summary>
[XmlIgnore]
public ObservablesEntitiesAdapter Adapter { get; set; }
@@ -126,6 +142,9 @@ namespace Tango.MachineStudio.Technician.TechItems
private String _techName;
+ /// <summary>
+ /// Gets or sets the tech item name.
+ /// </summary>
[XmlIgnore]
public String TechName
{
@@ -133,10 +152,15 @@ namespace Tango.MachineStudio.Technician.TechItems
set { _techName = value; RaisePropertyChangedAuto(); }
}
-
+ /// <summary>
+ /// Gets or sets the db tech item guid.
+ /// </summary>
public String ItemGuid { get; set; }
private Color _color;
+ /// <summary>
+ /// Gets or sets the item color.
+ /// </summary>
[XmlIgnore]
public Color Color
{
@@ -150,7 +174,9 @@ namespace Tango.MachineStudio.Technician.TechItems
}
private int _colorNumber;
-
+ /// <summary>
+ /// Gets or sets the color number (for XML serialization).
+ /// </summary>
public int ColorNumber
{
get { return _colorNumber; }
@@ -162,7 +188,10 @@ namespace Tango.MachineStudio.Technician.TechItems
}
}
-
+ /// <summary>
+ /// Clones this instance.
+ /// </summary>
+ /// <returns></returns>
public virtual TechItem Clone()
{
TechItem cloned = Activator.CreateInstance(this.GetType()) as TechItem;
@@ -175,6 +204,10 @@ namespace Tango.MachineStudio.Technician.TechItems
return cloned;
}
+ /// <summary>
+ /// Gets the available tech items.
+ /// </summary>
+ /// <returns></returns>
public static List<TechItem> GetAvailableTechItems()
{
List<TechItem> items = new List<TechItem>();
@@ -187,6 +220,10 @@ namespace Tango.MachineStudio.Technician.TechItems
return items;
}
+ /// <summary>
+ /// Sets the bounds.
+ /// </summary>
+ /// <param name="bounds">The bounds.</param>
public void SetBounds(Rect bounds)
{
Left = bounds.Left;
@@ -195,6 +232,10 @@ namespace Tango.MachineStudio.Technician.TechItems
Height = bounds.Height;
}
+ /// <summary>
+ /// Gets the bounds.
+ /// </summary>
+ /// <returns></returns>
public Rect GetBounds()
{
return new Rect(Left, Top, Width, Height);
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItemAttribute.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItemAttribute.cs
index cd6dfb1ea..fafd00954 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItemAttribute.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItemAttribute.cs
@@ -6,10 +6,21 @@ using System.Threading.Tasks;
namespace Tango.MachineStudio.Technician.TechItems
{
+ /// <summary>
+ /// Represents a tech item attribute
+ /// </summary>
+ /// <seealso cref="System.Attribute" />
public class TechItemAttribute : Attribute
{
+ /// <summary>
+ /// Gets or sets the item index.
+ /// </summary>
public int Index { get; set; }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TechItemAttribute"/> class.
+ /// </summary>
+ /// <param name="index">The index.</param>
public TechItemAttribute(int index)
{
Index = index;
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ThreadMotionItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ThreadMotionItem.cs
index 79ecf9372..a5789377f 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ThreadMotionItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ThreadMotionItem.cs
@@ -9,34 +9,31 @@ using Tango.SharedUI.Helpers;
namespace Tango.MachineStudio.Technician.TechItems
{
+ /// <summary>
+ /// Represents a thread motion controller item.
+ /// </summary>
+ /// <seealso cref="Tango.MachineStudio.Technician.TechItems.TechItem" />
[TechItem(9)]
public class ThreadMotionItem : TechItem
{
+ /// <summary>
+ /// Occurs when the user has pressed/released on of the item actions.
+ /// </summary>
public event EventHandler<MotorActionType> ActionExecuted;
- private bool _isForwardPressed;
- [XmlIgnore]
- public bool IsForwardPressed
- {
- get { return _isForwardPressed; }
- set { _isForwardPressed = value; RaisePropertyChangedAuto(); }
- }
-
- private bool _isBackwardPressed;
- [XmlIgnore]
- public bool IsBackwardPressed
- {
- get { return _isBackwardPressed; }
- set { _isBackwardPressed = value; RaisePropertyChangedAuto(); }
- }
-
private double _speed;
+ /// <summary>
+ /// Gets or sets the motor speed.
+ /// </summary>
public double Speed
{
get { return _speed; }
set { _speed = value; RaisePropertyChangedAuto(); }
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ThreadMotionItem"/> class.
+ /// </summary>
public ThreadMotionItem() : base()
{
Name = "Thread Motion";
@@ -46,17 +43,30 @@ namespace Tango.MachineStudio.Technician.TechItems
Color = Colors.White;
}
- public ThreadMotionItem(object dummyConst) : this()
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ThreadMotionItem"/> class.
+ /// </summary>
+ /// <param name="dummyConstructor">Does not matter.</param>
+ public ThreadMotionItem(object dummyConstructor) : this()
{
}
+ /// <summary>
+ /// Clones this instance.
+ /// </summary>
+ /// <returns></returns>
public override TechItem Clone()
{
ThreadMotionItem cloned = base.Clone() as ThreadMotionItem;
+ cloned.Speed = Speed;
return cloned;
}
+ /// <summary>
+ /// Raises the <see cref="ActionExecuted"/> event with the specified action.
+ /// </summary>
+ /// <param name="action">The action.</param>
public void RaiseAction(MotorActionType action)
{
ActionExecuted?.Invoke(this, action);
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs
index 2a55d12c6..6ccc1caa0 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs
@@ -29,6 +29,11 @@ using Tango.SharedUI;
namespace Tango.MachineStudio.Technician.ViewModels
{
+ /// <summary>
+ /// Represents the MachineTechView View Model.
+ /// </summary>
+ /// <seealso cref="Tango.SharedUI.ViewModel" />
+ /// <seealso cref="Tango.MachineStudio.Common.StudioApplication.IShutdownListener" />
public class MachineTechViewVM : ViewModel, IShutdownListener
{
private List<PropertyInfo> _diagnoticsDataProperties;
@@ -139,22 +144,42 @@ namespace Tango.MachineStudio.Technician.ViewModels
#region Commands
+ /// <summary>
+ /// Gets or sets the save as project command.
+ /// </summary>
public RelayCommand SaveAsProjectCommand { get; set; }
+ /// <summary>
+ /// Gets or sets the save project command.
+ /// </summary>
public RelayCommand SaveProjectCommand { get; set; }
+ /// <summary>
+ /// Gets or sets the open project command.
+ /// </summary>
public RelayCommand OpenProjectCommand { get; set; }
#endregion
#region Constructors
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MachineTechViewVM"/> class.
+ /// </summary>
+ /// <param name="applicationManager">The application manager.</param>
+ /// <param name="notificationProvider">The notification provider.</param>
[PreferredConstructor]
public MachineTechViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider) : this(applicationManager, notificationProvider, true)
{
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MachineTechViewVM"/> class.
+ /// </summary>
+ /// <param name="applicationManager">The application manager.</param>
+ /// <param name="notificationProvider">The notification provider.</param>
+ /// <param name="loadLastProject">if set to <c>true</c> [load last project].</param>
public MachineTechViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, bool loadLastProject)
{
_notification = notificationProvider;
@@ -215,6 +240,10 @@ namespace Tango.MachineStudio.Technician.ViewModels
#region Populate Diagnostics Data
+ /// <summary>
+ /// Populates the diagnostics data to the proper elements.
+ /// </summary>
+ /// <param name="data">The data.</param>
private void PopulateDiagnosticsData(PushDiagnosticsResponse data)
{
if (DateTime.Now > _lastDiagnosticsResponseUpdate.AddMilliseconds(MIN_DIAGNOSTICS_UPDATE_MILI))
@@ -240,7 +269,7 @@ namespace Tango.MachineStudio.Technician.ViewModels
if (prop != null)
{
- monitorItem.Value = GetLastMonitorValue(monitorItem.TechMonitor, prop.GetValue(data));
+ monitorItem.Value = GetDataLastValue(monitorItem.TechMonitor, prop.GetValue(data));
}
}
}
@@ -254,7 +283,7 @@ namespace Tango.MachineStudio.Technician.ViewModels
if (prop != null)
{
- meterItem.Value = GetLastMonitorValue(meterItem.TechMonitor, prop.GetValue(data));
+ meterItem.Value = GetDataLastValue(meterItem.TechMonitor, prop.GetValue(data));
}
}
}
@@ -270,7 +299,7 @@ namespace Tango.MachineStudio.Technician.ViewModels
if (_singleControllers.TryGetValue(graphItem, out controller))
{
- controller.PushData(GetSingleGraphValues(graphItem.TechMonitor, prop.GetValue(data)));
+ controller.PushData(GetDataArray(graphItem.TechMonitor, prop.GetValue(data)));
}
}
}
@@ -286,7 +315,7 @@ namespace Tango.MachineStudio.Technician.ViewModels
if (_multiControllers.TryGetValue(graphItem, out controller))
{
- controller.PushData(GetMultiGraphValues(graphItem.TechMonitor, prop.GetValue(data)));
+ controller.PushData(GetDataMatrix(graphItem.TechMonitor, prop.GetValue(data)));
}
}
}
@@ -320,7 +349,13 @@ namespace Tango.MachineStudio.Technician.ViewModels
#region Private Methods
- private double GetLastMonitorValue(TechMonitor monitor, object value)
+ /// <summary>
+ /// Gets the last data point from a protobuf repeated field.
+ /// </summary>
+ /// <param name="monitor">The monitor.</param>
+ /// <param name="value">The value.</param>
+ /// <returns></returns>
+ private double GetDataLastValue(TechMonitor monitor, object value)
{
if (!monitor.MultiChannel)
{
@@ -334,12 +369,24 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
}
- private List<double> GetSingleGraphValues(TechMonitor monitor, object value)
+ /// <summary>
+ /// Gets the data array from a protobuf repeated field.
+ /// </summary>
+ /// <param name="monitor">The monitor.</param>
+ /// <param name="value">The value.</param>
+ /// <returns></returns>
+ private List<double> GetDataArray(TechMonitor monitor, object value)
{
return (value as RepeatedField<double>).ToList();
}
- private List<List<double>> GetMultiGraphValues(TechMonitor monitor, object value)
+ /// <summary>
+ /// Gets the data matrix from a protobuf repeated field of <see cref="DoubleArray"/>.
+ /// </summary>
+ /// <param name="monitor">The monitor.</param>
+ /// <param name="value">The value.</param>
+ /// <returns></returns>
+ private List<List<double>> GetDataMatrix(TechMonitor monitor, object value)
{
DoubleArray[] arrayOfDoubles = Enumerable.ToArray(value as IEnumerable<DoubleArray>);
return arrayOfDoubles.Select(x => x.Data.ToList()).ToList();
@@ -349,6 +396,9 @@ namespace Tango.MachineStudio.Technician.ViewModels
#region Virtual Methods
+ /// <summary>
+ /// Called when the disable rendering has been changed
+ /// </summary>
protected virtual void OnDisableRenderingChanged()
{
foreach (var controller in _singleControllers)
@@ -366,11 +416,20 @@ namespace Tango.MachineStudio.Technician.ViewModels
#region Add/Remove Element
+ /// <summary>
+ /// Creates a new tech element by the specified bounds and the current selected element.
+ /// </summary>
+ /// <param name="bounds">The bounds.</param>
public void CreateElement(Rect bounds)
{
CreateElement(SelectedTechItem, bounds);
}
+ /// <summary>
+ /// Creates a new tech element by the specified tech item instance and bounds.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <param name="bounds">The bounds.</param>
private void CreateElement(TechItem item, Rect bounds)
{
if (item is MonitorItem)
@@ -422,6 +481,15 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
}
+ /// <summary>
+ /// Creates a new element by the specified editor type, tech item type, bounds and tech item constructor value.
+ /// </summary>
+ /// <typeparam name="Editor">The type of the editor.</typeparam>
+ /// <typeparam name="Tech">The type of the tech.</typeparam>
+ /// <typeparam name="Value">The type of the value.</typeparam>
+ /// <param name="bounds">The bounds.</param>
+ /// <param name="value">The value.</param>
+ /// <returns></returns>
private Editor CreateElement<Editor, Tech, Value>(Rect bounds, Value value) where Editor : IElementEditor where Tech : TechItem
{
TechItem item = Activator.CreateInstance(typeof(Tech), new object[] { value }) as TechItem;
@@ -430,6 +498,12 @@ namespace Tango.MachineStudio.Technician.ViewModels
return (Editor)editor;
}
+ /// <summary>
+ /// Creates a new element by the specified editor type and tech item instance.
+ /// </summary>
+ /// <typeparam name="Editor">The type of the editor.</typeparam>
+ /// <param name="item">The item.</param>
+ /// <returns></returns>
private Editor CreateElement<Editor>(TechItem item) where Editor : IElementEditor
{
IElementEditor editor = Activator.CreateInstance(typeof(Editor), new object[] { item, item.GetBounds() }) as IElementEditor;
@@ -437,6 +511,10 @@ namespace Tango.MachineStudio.Technician.ViewModels
return (Editor)editor;
}
+ /// <summary>
+ /// Adds a new tech item.
+ /// </summary>
+ /// <param name="item">The item.</param>
private void AddTechItem(TechItem item)
{
if (item is MonitorItem)
@@ -496,6 +574,10 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
}
+ /// <summary>
+ /// Called when elements have been removed
+ /// </summary>
+ /// <param name="elements">The elements.</param>
public void OnElementsRemoved(List<IElementEditor> elements)
{
//foreach (var element in elements)
@@ -513,6 +595,10 @@ namespace Tango.MachineStudio.Technician.ViewModels
//}
}
+ /// <summary>
+ /// Called when elements have been pasted
+ /// </summary>
+ /// <param name="elements">The elements.</param>
public void OnElementsPasted(List<IElementEditor> elements)
{
foreach (var element in elements)
@@ -585,6 +671,10 @@ namespace Tango.MachineStudio.Technician.ViewModels
#region Init Tech Items
+ /// <summary>
+ /// Initializes the motor item.
+ /// </summary>
+ /// <param name="item">The item.</param>
private void InitMotorItem(MotorItem item)
{
item.ActionExecuted += async (x, action) =>
@@ -655,6 +745,10 @@ namespace Tango.MachineStudio.Technician.ViewModels
};
}
+ /// <summary>
+ /// Initializes the dispenser item.
+ /// </summary>
+ /// <param name="item">The item.</param>
private void InitDispenserItem(DispenserItem item)
{
item.ActionExecuted += async (x, action) =>
@@ -725,6 +819,11 @@ namespace Tango.MachineStudio.Technician.ViewModels
};
}
+ /// <summary>
+ /// Initializes the single graph item.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <param name="editor">The editor.</param>
private void InitSingleGraphitem(SingleGraphItem item, SingleGraphElementEditor editor)
{
editor.InnerGraph.InnerGraph.MaxPoints = Common.Helpers.GraphsHelper.GetMaxPoints(item.TechMonitor.PointsPerFrame);
@@ -736,6 +835,11 @@ namespace Tango.MachineStudio.Technician.ViewModels
_singleControllers.Add(item, controller);
}
+ /// <summary>
+ /// Initializes the multi graph item.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <param name="editor">The editor.</param>
private void InitMultiGraphItem(MultiGraphItem item, MultiGraphElementEditor editor)
{
editor.InnerGraph.InnerGraph.MaxPoints = Common.Helpers.GraphsHelper.GetMaxPoints(item.TechMonitor.PointsPerFrame);
@@ -758,6 +862,10 @@ namespace Tango.MachineStudio.Technician.ViewModels
_multiControllers.Add(item, controller);
}
+ /// <summary>
+ /// Initializes the thread motion item.
+ /// </summary>
+ /// <param name="item">The item.</param>
private void InitThreadMotionItem(ThreadMotionItem item)
{
item.ActionExecuted += async (x, action) =>
@@ -783,6 +891,10 @@ namespace Tango.MachineStudio.Technician.ViewModels
};
}
+ /// <summary>
+ /// Initializes the motor group item.
+ /// </summary>
+ /// <param name="item">The item.</param>
private void InitMotorGroupItem(MotorGroupItem item)
{
item.ActionExecuted += async (x, action) =>
@@ -853,6 +965,10 @@ namespace Tango.MachineStudio.Technician.ViewModels
};
}
+ /// <summary>
+ /// Initializes the digital out item.
+ /// </summary>
+ /// <param name="item">The item.</param>
private void InitDigitalOutItem(DigitalOutItem item)
{
item.ValueChanged += async (x, value) =>
@@ -872,6 +988,9 @@ namespace Tango.MachineStudio.Technician.ViewModels
#region Public Methods
+ /// <summary>
+ /// Opens a file open dialog to select a project file.
+ /// </summary>
public void OpenProject()
{
OpenFileDialog dlg = new OpenFileDialog();
@@ -884,12 +1003,20 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
}
+ /// <summary>
+ /// Opens the specified project file path.
+ /// </summary>
+ /// <param name="fileName">File path.</param>
public void OpenProjectFile(String fileName)
{
LoadProject(MachineTechViewProject.Load(fileName));
_lastTechProjectFile = fileName;
}
+ /// <summary>
+ /// Loads the specified project.
+ /// </summary>
+ /// <param name="project">The project.</param>
public void LoadProject(MachineTechViewProject project)
{
using (_notification.PushTaskItem("Loading technician project file..."))
@@ -910,6 +1037,9 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
}
+ /// <summary>
+ /// Opens the file save dialog for selecting a project file target.
+ /// </summary>
private void SaveAsProject()
{
SaveFileDialog dlg = new SaveFileDialog();
@@ -922,16 +1052,23 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
}
+ /// <summary>
+ /// Saves the current project to the specified file path.
+ /// </summary>
+ /// <param name="fileName">Name of the file.</param>
private void SaveProjectFile(String fileName)
{
using (_notification.PushTaskItem("Saving technician project file..."))
{
- MachineTechViewProject project = CreateProjectFile();
+ MachineTechViewProject project = GenerateProjectFile();
project.Save(fileName);
_lastTechProjectFile = fileName;
}
}
+ /// <summary>
+ /// Saves the current opened project file. If not project file is opened will call <see cref="SaveAsProject"/>.
+ /// </summary>
private void SaveProject()
{
if (File.Exists(_lastTechProjectFile))
@@ -944,7 +1081,11 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
}
- private MachineTechViewProject CreateProjectFile()
+ /// <summary>
+ /// Generates a project file from the current element setup.
+ /// </summary>
+ /// <returns></returns>
+ private MachineTechViewProject GenerateProjectFile()
{
MachineTechViewProject project = new MachineTechViewProject();
@@ -967,6 +1108,9 @@ namespace Tango.MachineStudio.Technician.ViewModels
#region IShutdownListener
+ /// <summary>
+ /// Called when the application is about to terminate.
+ /// </summary>
public void OnShuttingDown()
{
InvokeUINow(() =>