using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; using System.Xml.Serialization; using Tango.SharedUI.Helpers; namespace Tango.MachineStudio.Technician.TechItems { /// /// Represents a thread motion controller item. /// /// [TechItem(9)] public class ThreadMotionItem : TechItem { /// /// Occurs when the user has pressed/released on of the item actions. /// public event EventHandler ActionExecuted; private double _speed; /// /// Gets or sets the motor speed. /// public double Speed { get { return _speed; } set { _speed = value; RaisePropertyChangedAuto(); } } /// /// Initializes a new instance of the class. /// public ThreadMotionItem() : base() { Name = "Thread Motion"; Description = "Thread Motion Controller"; Image = ResourceHelper.GetImageFromResources("Images/thread.png"); TechName = Name; Color = Colors.White; } /// /// Initializes a new instance of the class. /// /// Does not matter. public ThreadMotionItem(object dummyConstructor) : this() { } /// /// Clones this instance. /// /// public override TechItem Clone() { ThreadMotionItem cloned = base.Clone() as ThreadMotionItem; cloned.Speed = Speed; return cloned; } /// /// Raises the event with the specified action. /// /// The action. public void RaiseAction(MotorActionType action) { ActionExecuted?.Invoke(this, action); } } }