using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace IStation.WinFrmUI.Monitor
|
{
|
/// <summary>
|
/// 系数
|
/// </summary>
|
public class Coefficients
|
{
|
/// <summary>
|
/// 系数 A
|
/// </summary>
|
public double A { get; set; }
|
|
/// <summary>
|
/// 系数 B
|
/// </summary>
|
public double B { get; set; }
|
|
/// <summary>
|
/// 系数 C
|
/// </summary>
|
public double C { get; set; }
|
|
public eExpressionType ExpressionType { get; set; }
|
public enum eExpressionType
|
{
|
Binary = 0,
|
}
|
|
/// <summary>
|
/// 输出表达式
|
/// </summary>
|
public void OutExpression(double value, out string expression, out Dictionary<string, double> args)
|
{
|
expression = string.Empty;
|
args = new Dictionary<string, double>();
|
switch (ExpressionType)
|
{
|
case eExpressionType.Binary:
|
{
|
BinaryExpression(value, out expression, out args);
|
}
|
break;
|
default:
|
break;
|
}
|
}
|
|
/// <summary>
|
/// 二元表达式
|
/// </summary>
|
public void BinaryExpression(double value, out string expression, out Dictionary<string, double> args)
|
{
|
expression = $"value*a+b";
|
args = new Dictionary<string, double>()
|
{
|
{"value",value },
|
{"a",this.A},
|
{"b",this.B}
|
};
|
}
|
|
}
|
}
|