diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-16 12:17:10 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-16 12:17:10 +0200 |
| commit | 0fda2ba3ff49bdc1ffc6833f658e2164af187008 (patch) | |
| tree | 6f3a24d0671ebda50debb8511ab40e0bda0a0df0 /Software/Visual_Studio/SideChains/RealTimeGraphEx/Models/RealTimeGraphColumnsCollection.cs | |
| parent | 28103646681686bf1b58275d5dbccb92d2b26f9f (diff) | |
| download | Tango-0fda2ba3ff49bdc1ffc6833f658e2164af187008.tar.gz Tango-0fda2ba3ff49bdc1ffc6833f658e2164af187008.zip | |
Embedded RealTimeGraphEx library to solution.
Added graphs to technician view.
Implemented simple sensors data test using Machine Emulator.
Diffstat (limited to 'Software/Visual_Studio/SideChains/RealTimeGraphEx/Models/RealTimeGraphColumnsCollection.cs')
| -rw-r--r-- | Software/Visual_Studio/SideChains/RealTimeGraphEx/Models/RealTimeGraphColumnsCollection.cs | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphEx/Models/RealTimeGraphColumnsCollection.cs b/Software/Visual_Studio/SideChains/RealTimeGraphEx/Models/RealTimeGraphColumnsCollection.cs new file mode 100644 index 000000000..f2fb28170 --- /dev/null +++ b/Software/Visual_Studio/SideChains/RealTimeGraphEx/Models/RealTimeGraphColumnsCollection.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RealTimeGraphEx.Models +{ + public class RealTimeGraphColumnsCollection + { + public List<RealTimeGraphExColumn> Columns { get; set; } + public List<double> ActualValues { get; set; } + + public int TotalColumns + { + get { return Columns.Count; } + } + + public RealTimeGraphColumnsCollection() + { + Columns = new List<RealTimeGraphExColumn>(); + ActualValues = new List<double>(); + } + + public void Add(RealTimeGraphExColumn rec, int actualValue) + { + Columns.Add(rec); + ActualValues.Add(actualValue); + } + + public void Add(int x, int y, int width, int bottom, int actualValue) + { + Add(new RealTimeGraphExColumn(x, y, width, bottom), actualValue); + } + + public void RemoveFromStart(int count) + { + lock (Columns) + { + Columns.RemoveRange(0, count); + + double offSet = Columns[0].X; + + for (int i = 0; i < Columns.Count; i++) + { + Columns[i].X = (int)(Columns[i].X - offSet); + Columns[i].Right = (int)(Columns[i].Right - offSet); + } + } + } + + public void Replace(int x, int y, int right, int bottom, int actualValue, int index) + { + var p = new RealTimeGraphExColumn(x, y, right, bottom); + Columns.RemoveAt(index); + Columns.Insert(index, p); + ActualValues.RemoveAt(index); + ActualValues.Insert(index, actualValue); + } + + public void ClearColumns() + { + Columns.Clear(); + ActualValues.Clear(); + } + } +} |
