aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/binary.png
blob: 24b399f96250e225d4a59f6668a253df5966e009 (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 06 00 00 00 aa 69 71 .PNG........IHDR...@...@......iq
0020 de 00 00 00 04 73 42 49 54 08 08 08 08 7c 08 64 88 00 00 00 09 70 48 59 73 00 00 01 bb 00 00 01 .....sBIT....|.d.....pHYs.......
0040 bb 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 ..:.......tEXtSoftware.www.inksc
0060 61 70 65 2e 6f 72 67 9b ee 3c 1a 00 00 07 f0 49 44 41 54 78 da ed 9b 79 6c 14 55 1c c7 1f e2 81 ape.org..<.....IDATx...yl.U.....
0080 82 02 11 50 40 11 34 a8 89 8a 57 14 25 41 31 b4 45 0d 22 c6 ab 41 43 90 d6 5a ba b3 ed f6 e4 88 ...P@.4...W.%A1.E."..AC..Z......
00a0 c4 b5 33 c3 61 bc c0 44 6d 14 10 81 a2 0d 42 15 4a 69 69 29 d2 03 4a 0f 01 ad dd ee d1 42 cb b6 ..3.a..Dm.....B.Jii)..J......B..
00c0 d3 56 5a 50 10 b9 fa fc bd 99 37 bb c3 b0 33 b6 9d 5d d7 e2 fe f1 4b 77 7e b3 ef cd fb 7e 76 e6 .VZP......7...3..]....Kw~....~v.
00e0 f7 be ef ed 16 61 8c d1 ff 39 50 08 40 08 40 08 40 08 40 08 80 66 a0 7e 7e be 60 bf 00 08 e8 e7 .....a...9P.@.@.@.@..f.~~.`.....
0100 5f 00 45 53 06 e1 b2 b0 0f 71 69 84 13 97 86 ff 05 51 01 c7 b3 8d 5c e4 44 5b cb 33 9d 6d ee 92 _.ES.....qi......Q....\.D[.3.m..
0120 e3 6d ee 53 10 8d 10 ab fe 68 69 19 de db fe 16 1c 3a 32 34 b1 4e c8 48 aa 13 0e 43 fc 99 6c 13 .m.S.....hi......:24.N.H...C..l.
0140 ca 92 6c c2 0c e3 00 f2 22 06 82 e0 5a 08 ec 23 3e e8 9d 78 b7 19 04 63 1f 21 b4 b7 37 8e ea 69 ..l....."...Z..#>..x...c.!..7..i
0160 7f a6 da a3 37 82 d8 23 20 1c ab 23 d1 de 92 6a 0c 40 59 d8 7b 1a e2 49 74 e1 b2 88 49 3d e9 fc ....7..#...#...j.@Y.{..It...I=..
0180 b8 20 8c 03 a1 a7 35 00 40 34 67 f5 74 c0 49 75 2d 6b 7d 89 a7 71 36 c1 e6 be cb 00 80 f0 1a 1d ......5.@4g.t.Iu-k}..q6.........
01a0 00 78 dd d7 af 1c 40 73 53 76 74 37 16 66 6e 2e d7 16 ef c6 bf 09 4d a7 fb 47 a7 ed 40 51 a9 b9 .x....@sSvt7.fn.......M..G..@Q..
01c0 dd 8d 84 1a f7 49 1d 00 38 d9 2e 98 7b 0f a0 34 fc 84 1e 80 b5 6b 5f c5 30 88 6e c7 c2 8d 9b b1 .....I..8...{..4.....k_.0.n.....
01e0 1e 00 12 43 98 b7 bb dd df 95 b1 8b 70 92 ad 05 eb 01 48 b2 b7 2e 37 00 20 6c 8f 1e 80 7d d9 cf ...C........p.....H...7..l...}..
0200 af 40 51 69 33 bb 1b ab 0a 76 2d d6 13 7f 4c 68 72 a3 e8 94 e7 7b 12 16 5b 8b 4b 0f 40 a2 5d 98 .@Qi3....v-...Lhr....{..[.K.@.].
0220 65 04 c0 8b 3a 00 da 60 66 18 d1 a3 67 b6 a1 61 00 08 ad d5 02 d0 d9 7e 34 b9 a7 35 20 d1 de 1a e...:..`f...g..a.......~4..5....
0240 ab 03 c0 99 72 50 18 68 6c 1a 2c 0d 63 41 ec 05 95 f8 56 5c 32 ed a9 de cc 02 1d ad 4d 13 a0 d8 ....rP.hl.,.cA....V\2.......M...
0260 39 7d 00 58 0d e7 af e8 4d 9f 20 f4 13 1f e2 0
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;
        }
    }
}