| ofs | hex dump | ascii |
|---|
| 0000 | ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 48 00 48 00 00 ff e1 05 96 45 78 69 66 00 00 49 49 | ......JFIF.....H.H......Exif..II |
| 0020 | 2a 00 08 00 00 00 0b 00 0e 01 02 00 20 00 00 00 92 00 00 00 0f 01 02 00 10 00 00 00 b2 00 00 00 | *............................... |
| 0040 | 10 01 02 00 09 00 00 00 c2 00 00 00 12 01 03 00 01 00 00 00 01 00 00 00 1a 01 05 00 01 00 00 00 | ................................ |
| 0060 | cc 00 00 00 1b 01 05 00 01 00 00 00 d4 00 00 00 28 01 03 00 01 00 00 00 02 00 00 00 31 01 02 00 | ................(...........1... |
| 0080 | 0b 00 00 00 dc 00 00 00 32 01 02 00 14 00 00 00 e8 00 00 00 13 02 03 00 01 00 00 00 02 00 00 00 | ........2....................... |
| 00a0 | 69 87 04 00 01 00 00 00 fc 00 00 00 00 00 00 00 4d 49 4e 4f 4c 54 41 20 44 49 47 49 54 41 4c 20 | i...............MINOLTA.DIGITAL. |
| 00c0 | 43 41 4d 45 52 41 20 20 20 20 20 20 20 20 20 00 4d 49 4e 4f 4c 54 41 20 43 4f 2e 2c 4c 54 44 00 | CAMERA..........MINOLTA.CO.,LTD. |
| 00e0 | 44 69 4d 41 47 45 20 58 00 00 48 00 00 00 01 00 00 00 48 00 00 00 01 00 00 00 47 49 4d 50 20 32 | DiMAGE.X..H.......H.......GIMP.2 |
| 0100 | 2e 38 2e 32 00 00 32 30 31 35 3a 30 38 3a 32 32 20 31 38 3a 33 37 3a 30 36 00 18 00 9a 82 05 00 | .8.2..2015:08:22.18:37:06....... |
| 0120 | 01 00 00 00 22 02 00 00 9d 82 05 00 01 00 00 00 2a 02 00 00 22 88 03 00 01 00 00 00 02 00 00 00 | ...."...........*..."........... |
| 0140 | 27 88 03 00 01 00 00 00 64 00 00 00 00 90 07 00 04 00 00 00 30 32 31 30 03 90 02 00 14 00 00 00 | '.......d...........0210........ |
| 0160 | 32 02 00 00 04 90 02 00 14 00 00 00 46 02 00 00 01 91 07 00 04 00 00 00 01 02 03 00 02 91 05 00 | 2...........F................... |
| 0180 | 01 00 00 00 5a 02 00 00 04 92 0a 00 01 00 00 00 62 02 00 00 05 92 05 00 01 00 00 00 6a 02 00 00 | ....Z...........b...........j... |
| 01a0 | 07 92 03 00 01 00 00 00 05 00 00 00 08 92 03 00 01 00 00 00 00 00 00 00 09 92 03 00 01 00 00 00 | ................................ |
| 01c0 | 00 00 00 00 0a 92 05 00 01 00 00 00 72 02 00 00 7c 92 07 00 78 02 00 00 7a 02 00 00 86 92 07 00 | ............r...|...x...z....... |
| 01e0 | 7d 00 00 00 f2 04 00 00 00 a0 07 00 04 00 00 00 30 31 30 30 01 a0 03 00 01 00 00 00 01 00 00 00 | }...............0100............ |
| 0200 | 02 a0 04 00 01 00 00 00 ea 00 00 00 03 a0 04 00 01 00 00 00 4a 00 00 00 05 a0 04 00 01 00 00 00 | ....................J........... |
| 0220 | 70 05 00 00 00 a3 07 00 01 00 00 00 03 00 00 00 01 a3 07 00 01 00 00 00 01 00 00 00 00 00 00 00 | p............................... |
| 0240 | 0a 00 00 00 65 02 00 00 1c 00 00 00 0a 00 00 00 32 30 30 32 3a 30 38 3a 31 32 20 31 35 3a 31 30 | ....e...........2002:08:12.15:10 |
| 0260 | 3a 33 33 00 32 30 30 32 3a 30 38 3a 31 32 20 31 35 3a 31 30 3a 33 33 00 04 00 00 00 01 00 00 00 | :33.2002:08:12.15:10:33......... |
| 0280 | 00 00 00 00 0a 00 00 00 1e 00 00 00 0a 00 00 00 3c 00 00 00 0a 00 00 00 1a 00 00 00 07 00 04 00 | ................<............... |
| 02a0 | 00 00 4d 4c 54 30 00 02 04 00 03 00 00 00 d2 04 00 00 01 02 03 00 01 00 00 00 03 00 00 00 02 02 | ..MLT0.......................... |
| 02c0 | 03 00 01 00 00 00 00 00 00 00 03 02 03 00 01 00 00 00 00 00 00 00 04 02 05 00 01 00 00 00 de 04 | ................................ |
| 02e0 | 00 00 0e 02 03 00 01 00 00 00 00 00 00 00 0f 02 03 00 01 00 00 00 00 00 00 00 10 02 03 00 01 00 | ................................ |
| 0300 | 00 00 00 00 00 00 11 02 03 00 01 00 00 00 00 00 00 00 12 02 03 00 01 00 00 00 00 00 00 00 13 02 | ................................ |
| 0320 | 03 00 01 00 00 00 00 00 00 00 14 02 03 00 01 00 00 00 00 00 00 00 15 02 03 00 01 00 00 00 00 00 | ................................ |
| 0340 | 00 00 16 02 03 00 01 00 00 00 00 00 00 00 17 02 03 00 01 00 00 00 00 00 00 00 18 02 03 00 01 00 | ................................ |
| 0360 | 00 00 00 00 00 00 19 02 03 00 01 00 00 00 00 00 00 00 1a 02 03 00 01 00 00 00 00 00 00 00 1b 02 | ................................ |
| 0380 | 03 00 01 00 00 00 00 00 00 00 1c 02 03 00 01 00 00 00 00 00 00 00 1d 02 03 00 01 00 00 00 00 00 | ................................ |
| 03a0 | 00 00 1e 02 03 00 01 00 00 00 00 00 00 00 1f 02 03 00 01 00 00 00 00 00 00 00 00 0e 07 00 28 00 | ..............................(. |
| 03c0 | 00 00 e6 04 00 00 00 0f 07 00 fe 00 00 00 0e 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 03e0 | 00 00 00 00 00 00 64 00 00 00 50 72 69 6e 74 49 4d 00 30 31 30 30 00 00 04 00 01 00 16 00 16 00 | ......d...PrintIM.0100.......... |
| 0400 | 02 00 01 00 00 00 00 01 01 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0420 | 00 00 3a c1 31 00 00 00 00 00 3f 8f 00 00 26 d6 00 00 3f 8f 00 00 26 d6 00 00 00 00 06 0e 00 00 | ..:.1.....?...&...?...&......... |
| 0440 | 0b fa 00 1d 07 9b 05 65 00 00 00 00 00 00 00 00 00 00 00 c7 11 00 00 00 26 31 08 00 00 00 00 00 | .......e................&1...... |
| 0460 | 10 00 00 00 00 00 00 00 42 0d 30 00 40 00 11 74 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ........B.0.@..t................ |
| 0480 | 00 00 3f ad ff f0 60 00 00 00 11 00 00 c7 10 35 00 00 00 00 99 99 99 99 19 61 12 31 75 78 89 8a | ..?...`........5.........a.1ux.. |
| 04a0 | 0e 13 18 14 12 10 16 12 00 00 00 85 00 0c 00 06 01 00 80 53 00 01 03 84 00 00 00 0f 6a d5 fe 6b | ...................S........j..k |
| 04c0 | 0e 71 09 63 0e 81 23 5b 00 64 00 d2 0c 17 0d 06 ff ff ff ff 01 02 10 40 00 02 00 ff 00 40 00 40 | .q.c..#[.d.............@.....@.@ |
| 04e0 | 00 00 00 10 00 00 00 00 11 11 11 11 02 02 5f 19 00 60 01 00 17 19 00 08 00 00 00 00 00 00 ed 9a | .............._..`.............. |
| 0500 | 0e 81 0a 00 18 1b 18 1a 19 1a 17 1d 87 65 43 21 41 53 43 49 49 00 00 00 20 20 20 20 20 20 20 20 | .............eC!ASCII........... |
| 0520 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
| 0540 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
| 0560 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
| 0580 | 20 20 20 20 20 20 20 20 20 20 20 20 20 00 02 00 01 00 02 00 04 00 00 00 52 39 38 00 02 00 07 00 | .......using RealTimeGraphX.DataPoints;
using RealTimeGraphX.WPF;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;
using System.Xml.Serialization;
using Tango.BL.Entities;
using Tango.Core.Commands;
using Tango.MachineStudio.Technician.Editors;
using Tango.MachineStudio.Technician.Helpers;
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 DispatcherTimer _timer;
private DateTime _recording_start_time;
public event Action RecordingStarted;
public event Action RecordingStopped;
private TechMonitor _techMonitor;
/// <summary>
/// Gets or sets the db tech monitor.
/// </summary>
[XmlIgnore]
public TechMonitor TechMonitor
{
get { return _techMonitor; }
set
{
TechMonitor old = _techMonitor;
_techMonitor = value;
RaisePropertyChangedAuto();
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 { 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.
/// </summary>
public double Min
{
get { return _min; }
set
{
_min = value; RaisePropertyChangedAuto();
SetEditorSettings();
}
}
private double _max;
/// <summary>
/// Gets or sets the maximum graph value.
/// </summary>
public double Max
{
get { return _max; }
set
{
_max = value; RaisePropertyChangedAuto();
SetEditorSettings();
}
}
private bool _useAutoRange;
/// <summary>
/// Gets or sets a value indicating whether [use automatic range].
/// </summary>
public bool UseAutoRange
{
get { return _useAutoRange; }
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;
/// <summary>
/// Gets or sets a value indicating whether this instance is paused.
/// </summary>
[XmlIgnore]
public bool IsPaused
{
get { return _isPaused; }
set
{
_isPaused = value; RaisePropertyChangedAuto();
SetEditorSettings();
}
}
private bool _isRecording;
/// <summary>
/// Gets or sets a value indicating whether this instance is recording.
/// </summary>
[XmlIgnore]
public bool IsRecording
{
get { return _isRecording; }
set { _isRecording = value; RaisePropertyChangedAuto(); }
}
private TimeSpan _recordingTime;
[XmlIgnore]
public TimeSpan RecordingTime
{
get { return _recordingTime; }
set { _recordingTime = value; RaisePropertyChangedAuto(); }
}
[XmlIgnore]
public RelayCommand ClearCommand { get; set; }
[XmlIgnore]
public RelayCommand ToggleRecordingCommand { get; set; }
/// <summary>
/// Gets or sets the reset minimum maximum to default command.
/// </summary>
[XmlIgnore]
public RelayCommand ResetMinMaxToDefaultCommand { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="MultiGraphItem"/> class.
/// </summary>
public MultiGraphItem() : base()
{
_useAutoRange = true;
DecimalPlaces = 1;
_duration = 10;
_timer = new DispatcherTimer();
_timer.Tick += _timer_Tick;
_timer.Interval = TimeSpan.FromSeconds(1);
Max = 100;
Name = "Multi Channel Graph";
Description = "Multi channel real-time graph";
Image = ResourceHelper.GetImageFromResources("Images/multi-graph.png");
ClearCommand = new RelayCommand(() =>
{
if (Editor != null)
{
Editor.InnerGraph.Controller.Clear();
}
});
ToggleRecordingCommand = new RelayCommand(ToggleRecording);
ResetMinMaxToDefaultCommand = new RelayCommand(() =>
{
if (TechMonitor != null)
{
Min = TechMonitor.Min;
Max = TechMonitor.Max;
}
});
}
private void SetEditorSettings()
{
if (Editor != null)
{
var controller = Editor.InnerGraph.Controller as WpfGraphController<TimeSpanDataPoint,DoubleDataPoint>;
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)
{
Min = TechMonitor.Min;
Max = TechMonitor.Max;
}
}
private void _timer_Tick(object sender, EventArgs e)
{
RecordingTime = DateTime.Now - _recording_start_time;
}
private void ToggleRecording()
{
if (!IsRecording)
{
RecordingStarted?.Invoke();
}
else
{
RecordingStopped?.Invoke();
}
}
public void StartRecording()
{
_recording_start_time = DateTime.Now;
IsRecording = true;
_timer.Start();
}
public void StopRecording()
{
_timer.Stop();
IsRecording = false;
RecordingTime = TimeSpan.FromSeconds(0);
}
/// <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;
cloned.TechMonitor = TechMonitor;
cloned.Min = Min;
cloned.Max = Max;
cloned.UseAutoRange = UseAutoRange;
cloned.Duration = Duration;
cloned.DecimalPlaces = DecimalPlaces;
return cloned;
}
}
}
|