diff options
| author | Roy Ben Shabat <roy.mail.net@gmail.com> | 2025-10-03 01:55:11 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <roy.mail.net@gmail.com> | 2025-10-03 01:55:11 +0300 |
| commit | 2ce6afb909f34af7d78c20cfeb9f2d8311e91336 (patch) | |
| tree | 5a679973db7ee6446df1cde1690634b422ade35c /Software/Visual_Studio/SideChains/RealTimeGraphXNet/RealTimeGraphX/GraphRange.cs | |
| parent | 9c858b7b51be2eb5b2f515912d436224d7e6483c (diff) | |
| download | Tango-2ce6afb909f34af7d78c20cfeb9f2d8311e91336.tar.gz Tango-2ce6afb909f34af7d78c20cfeb9f2d8311e91336.zip | |
Changed RealTimeGraphX to .NET 4.6.1
Diffstat (limited to 'Software/Visual_Studio/SideChains/RealTimeGraphXNet/RealTimeGraphX/GraphRange.cs')
| -rw-r--r-- | Software/Visual_Studio/SideChains/RealTimeGraphXNet/RealTimeGraphX/GraphRange.cs | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphXNet/RealTimeGraphX/GraphRange.cs b/Software/Visual_Studio/SideChains/RealTimeGraphXNet/RealTimeGraphX/GraphRange.cs new file mode 100644 index 000000000..521f9f0b6 --- /dev/null +++ b/Software/Visual_Studio/SideChains/RealTimeGraphXNet/RealTimeGraphX/GraphRange.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RealTimeGraphX +{ + /// <summary> + /// Represents a graph x/y data points boundaries. + /// </summary> + public interface IGraphRange : IGraphComponent + { + /// <summary> + /// Gets or sets the maximum x value. + /// </summary> + GraphDataPoint MaximumX { get; set; } + + /// <summary> + /// Gets or sets the minimum x value. + /// </summary> + GraphDataPoint MinimumY { get; set; } + + /// <summary> + /// Gets or sets the maximum y value. + /// </summary> + GraphDataPoint MaximumY { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether to automatically adjust the graph <see cref="MaximumY"/> and <see cref="MinimumY"/> according to the current effective data points. + /// </summary> + bool AutoY { get; set; } + } + + /// <summary> + /// Represents a graph X/Y range boundaries. + /// </summary> + /// <typeparam name="XDataPoint">Type of x-axis data point.</typeparam> + /// <typeparam name="YDataPoint">Type of y-axis data point.</typeparam> + /// <seealso cref="RealTimeGraphX.GraphObject" /> + public class GraphRange<XDataPoint, YDataPoint> : GraphObject, IGraphRange where XDataPoint : GraphDataPoint where YDataPoint : GraphDataPoint + { + private XDataPoint _maximumX; + /// <summary> + /// Gets or sets the maximum x value. + /// </summary> + public XDataPoint MaximumX + { + get { return _maximumX; } + set { _maximumX = value; RaisePropertyChangedAuto(); } + } + + private YDataPoint _minimumY; + /// <summary> + /// Gets or sets the minimum x value. + /// </summary> + public YDataPoint MinimumY + { + get { return _minimumY; } + set { _minimumY = value; RaisePropertyChangedAuto(); } + } + + private YDataPoint _maximumY; + /// <summary> + /// Gets or sets the maximum y value. + /// </summary> + public YDataPoint MaximumY + { + get { return _maximumY; } + set { _maximumY = value; RaisePropertyChangedAuto(); } + } + + private bool _autoY; + /// <summary> + /// Gets or sets a value indicating whether to automatically adjust the graph <see cref="MaximumY"/> and <see cref="MinimumY"/> according to the current visible data points. + /// </summary> + public bool AutoY + { + get { return _autoY; } + set { _autoY = value; RaisePropertyChangedAuto(); } + } + + /// <summary> + /// Initializes a new instance of the <see cref="GraphRange{XDataPoint, YDataPoint}"/> class. + /// </summary> + public GraphRange() + { + MinimumY = GraphDataPointHelper.Init<YDataPoint>(); + MaximumX = GraphDataPointHelper.Init<XDataPoint>(); + MaximumY = GraphDataPointHelper.Init<YDataPoint>(); + } + + /// <summary> + /// Gets or sets the maximum x value. + /// </summary> + GraphDataPoint IGraphRange.MaximumX + { + get + { + return MaximumX; + } + set + { + MaximumX = (XDataPoint)value; + } + } + + /// <summary> + /// Gets or sets the minimum x value. + /// </summary> + GraphDataPoint IGraphRange.MinimumY + { + get + { + return MinimumY; + } + set + { + MinimumY = (YDataPoint)value; + } + } + + /// <summary> + /// Gets or sets the maximum y value. + /// </summary> + GraphDataPoint IGraphRange.MaximumY + { + get + { + return MaximumY; + } + set + { + MaximumY = (YDataPoint)value; + } + } + } +} |
