2023-04-13 11:51:03 +08:00
|
|
|
|
/************************************************************************
|
|
|
|
|
*@file FrameworkLocal\UIClient\CenterViews\DataLogs\Core\SicFastLineDataSeries.cs
|
|
|
|
|
* @author Su Liang
|
|
|
|
|
* @Date 2022-08-02
|
|
|
|
|
*
|
|
|
|
|
* @copyright © Sicentury Inc.
|
|
|
|
|
*
|
|
|
|
|
* @brief Reconstructed to support rich functions.
|
|
|
|
|
*
|
|
|
|
|
* @details Cross-Thread operation allowed.
|
|
|
|
|
*
|
|
|
|
|
* *****************************************************************************/
|
|
|
|
|
|
|
|
|
|
using System;
|
2023-08-03 16:29:58 +08:00
|
|
|
|
using DocumentFormat.OpenXml.Office2013.Drawing.ChartStyle;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
using SciChart.Charting.Model.DataSeries;
|
|
|
|
|
|
|
|
|
|
namespace MECF.Framework.UI.Client.CenterViews.Core.Charting
|
|
|
|
|
{
|
|
|
|
|
public class SicFastLineDataSeries : XyDataSeries<DateTime, double>
|
|
|
|
|
{
|
2023-08-03 16:29:58 +08:00
|
|
|
|
|
|
|
|
|
#region Variables
|
|
|
|
|
|
|
|
|
|
private double _factor = 1.0;
|
|
|
|
|
private double _offset = 0.0;
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2023-04-13 11:51:03 +08:00
|
|
|
|
#region Properties
|
|
|
|
|
|
2023-08-03 16:29:58 +08:00
|
|
|
|
public double Factor
|
|
|
|
|
{
|
|
|
|
|
get => _factor;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_factor = value;
|
|
|
|
|
UpdateChartSeriesValue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public double Offset
|
|
|
|
|
{
|
|
|
|
|
get => _offset;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_offset = value;
|
|
|
|
|
UpdateChartSeriesValue();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Methods
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// /
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void UpdateChartSeriesValue()
|
|
|
|
|
{
|
|
|
|
|
using (SuspendUpdates())
|
|
|
|
|
{
|
|
|
|
|
for (var i = 0; i < Count; i++)
|
|
|
|
|
{
|
|
|
|
|
var y = (Metadata[i] as ParameterNodePoint)?.Value;
|
|
|
|
|
if (y == null)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
Update(i, (double)y * Factor + Offset);
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-13 11:51:03 +08:00
|
|
|
|
|
2023-08-03 16:29:58 +08:00
|
|
|
|
//var dataSeries = DataSeries as XyDataSeries<DateTime, double>;
|
|
|
|
|
//for (var index = 0; index < dataSeries.Count; ++index)
|
|
|
|
|
// dataSeries.Update(index, _queueRawData.ElementAt(index).Item2 * _dataFactor + _dataOffset);
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-04-13 11:51:03 +08:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|