aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/function.png
blob: 92ccdbf4bbd9bada42aeca9ccbeb058b1f445958 (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 40 00 00 00 40 08 03 00 00 00 9d b7 81 .PNG........IHDR...@...@........
0020 ec 00 00 00 03 73 42 49 54 08 08 08 db e1 4f e0 00 00 00 09 70 48 59 73 00 00 01 bb 00 00 01 bb .....sBIT.....O.....pHYs........
0040 01 3a ec e3 e2 00 00 00 19 74 45 58 74 53 6f 66 74 77 61 72 65 00 77 77 77 2e 69 6e 6b 73 63 61 .:.......tEXtSoftware.www.inksca
0060 70 65 2e 6f 72 67 9b ee 3c 1a 00 00 02 85 50 4c 54 45 ff ff ff ff 00 00 ff 00 00 ff 80 00 ff 40 pe.org..<.....PLTE.............@
0080 40 ff 80 00 ff 66 33 ff 49 24 ff 55 1c e6 4d 33 ff 4d 33 ff 55 2b ff 4e 27 ff 55 22 ff 5a 2d f1 @....f3.I$.U..M3.M3.U+.N'.U".Z-.
00a0 47 1c ff 55 2b ff 51 28 f3 51 23 f4 59 2c f4 55 2b f5 52 29 f6 55 26 f6 52 24 f7 55 2b f7 52 29 G..U+.Q(.Q#.Y,.U+.R).U&.R$.U+.R)
00c0 f8 55 2b f8 53 29 eb 51 28 f9 57 25 f9 55 2b ee 51 29 f9 51 29 f9 53 27 fa 53 2a fa 55 28 ec 4d .U+.S).Q(.W%.U+.Q).Q).S'.S*.U(.M
00e0 26 fa 52 26 fa 53 2a fa 52 29 fb 55 26 fb 54 2a fb 52 29 f8 53 29 e9 49 28 f8 55 27 f8 54 26 f8 &.R&.S*.R).U&.T*.R).S).I(.U'.T&.
0100 53 29 f8 55 29 f8 53 28 f8 55 27 f9 54 27 f9 54 28 f0 4e 27 f9 54 27 f9 53 27 f9 54 29 f9 55 28 S).U).S(.U'.T'.T(.N'.T'.S'.T).U(
0120 f9 54 27 ee 4e 27 fa 55 29 fa 54 29 fa 53 28 fa 55 28 f0 4f 28 fa 54 28 fa 53 27 fa 54 29 f8 53 .T'.N'.U).T).S(.U(.O(.T(.S'.T).S
0140 29 f8 53 27 f8 54 29 f8 55 28 f8 54 28 f8 55 27 f9 54 29 f9 54 29 f9 55 28 f9 54 28 f9 54 27 f9 ).S'.T).U(.T(.U'.T).T).U(.T(.T'.
0160 54 28 ed 4e 28 f9 54 28 f9 53 28 f9 54 27 f9 54 29 f9 53 29 f9 54 28 f9 53 28 f9 54 27 eb 4c 29 T(.N(.T(.S(.T'.T).S).T(.S(.T'.L)
0180 f9 53 29 ed 4d 27 ef 4c 27 fa 53 29 fa 54 28 ee 4c 28 ef 4e 28 f8 54 27 ec 4d 27 f8 54 29 f8 54 .S).M'.L'.S).T(.L(.N(.T'.M'.T).T
01a0 28 f8 54 27 f8 53 27 f9 54 28 f9 53 28 f9 53 27 f9 54 29 f9 53 28 ed 4b 28 ed 4b 27 f9 54 29 f9 (.T'.S'.T(.S(.S'.T).S(.K(.K'.T).
01c0 54 29 f9 54 28 ed 4d 28 f9 54 28 f9 55 27 f9 54 28 f9 55 28 f9 54 28 f9 54 28 ed 4c 29 f9 54 29 T).T(.M(.T(.U'.T(.U(.T(.T(.L).T)
01e0 fa 54 28 fa 54 27 fa 54 28 fa 55 28 f8 55 28 f7 54 27 f8 55 28 f9 54 28 ec 4c 28 ec 4b 29 f9 54 .T(.T'.T(.U(.U(.T'.U(.T(.L(.K).T
0200 29 f9 55 28 eb 4b 29 f9 54 27 f9 55 28 f9 54 28 f9 54 28 ea 4a 28 f9 54 28 f9 54 28 f9 53 29 f9 ).U(.K).T'.U(.T(.T(.J(.T(.T(.S).
0220 54 28 f9 53 28 f6 52 28 f9 54 28 ea 4a 29 f9 53 27 f9 54 28 f9 54 28 f9 54 28 ea 4a 28 f9 54 28 T(.S(.R(.T(.J).S'.T(.T(.T(.J(.T(
0240 f9 54 28 e9 4a 29 ea 4a 28 f8 54 28 f8 54 28 ea 4b 28 f9 54 28 f9 54 28 ea 4a 28 f9 54 28 f9 54 .T(.J).J(.T(.T(.K(.T(.T(.J(.T(.T
0260 27 e9
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using System.Xml.Serialization;
using Tango.BL.Entities;
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
        {
            get { return _techMonitor; }
            set { _techMonitor = value; RaisePropertyChangedAuto(); TechName = _techMonitor != null ? _techMonitor.Description : null; ItemGuid = value != null ? value.Guid : null; }
        }

        private double _value;
        /// <summary>
        /// Gets or sets the current value.
        /// </summary>
        [XmlIgnore]
        public double Value
        {
            get { return _value; }
            set { _value = value; RaisePropertyChanged(nameof(Value)); LastUpdateTime = DateTime.Now; }
        }

        private int _updateInterval;
        /// <summary>
        /// Gets or sets the minimum update interval.
        /// </summary>
        public int UpdateInterval
        {
            get { return _updateInterval; }
            set { _updateInterval = value; RaisePropertyChangedAuto(); }
        }

        private int _ledCount;
        /// <summary>
        /// Gets or sets the amount of LED's.
        /// </summary>
        public int LedCount
        {
            get { return _ledCount; }
            set { _ledCount = value; RaisePropertyChangedAuto(); }
        }

        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";
            Description = "VU Meter monitor";
            Image = ResourceHelper.GetImageFromResources("Images/volume.png");
            LastUpdateTime = DateTime.Now;
            UpdateInterval = 10;
            LedCount = 14;
            TicksCount = 14;
            TickPlacement = TickPlacement.BottomRight;
            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;
            cloned.TechMonitor = TechMonitor;
            cloned.UpdateInterval = UpdateInterval;
            cloned.LedCount = LedCount;
            cloned.TicksCount = TicksCount;
            return cloned;
        }
    }
}