Skip to content

Commit f67bfac

Browse files
author
linzhijun
committed
fix
1 parent 8d4897a commit f67bfac

File tree

5 files changed

+672
-292
lines changed

5 files changed

+672
-292
lines changed

csharp/ToolGood.Algorithm.Fast/AlgorithmEngine.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,47 @@
1010
namespace ToolGood.Algorithm
1111
{
1212
/// <summary>
13-
///
13+
///
1414
/// </summary>
1515
public class AlgorithmEngine
1616
{
1717
internal int ExcelIndex = 1;
18+
1819
/// <summary>
1920
/// 使用 本地时间, 影响 时间截转化
2021
/// </summary>
2122
public bool UseLocalTime = true;
23+
2224
/// <summary>
2325
/// 长度单位
2426
/// </summary>
2527
public DistanceUnitType DistanceUnit = DistanceUnitType.M;
28+
2629
/// <summary>
2730
/// 面积单位
2831
/// </summary>
2932
public AreaUnitType AreaUnit = AreaUnitType.M2;
33+
3034
/// <summary>
3135
/// 体积单位
3236
/// </summary>
3337
public VolumeUnitType VolumeUnit = VolumeUnitType.M3;
38+
3439
/// <summary>
3540
/// 重量单位
3641
/// </summary>
3742
public MassUnitType MassUnit = MassUnitType.KG;
43+
3844
/// <summary>
3945
/// 最后一个错误
4046
/// </summary>
4147
public string LastError { get; private set; }
48+
4249
/// <summary>
4350
/// 使用EXCEL索引
4451
/// </summary>
4552
public bool UseExcelIndex { set { ExcelIndex = value ? 1 : 0; } }
53+
4654
/// <summary>
4755
/// 自定义参数 请重写此方法
4856
/// </summary>
@@ -52,6 +60,7 @@ public virtual Operand GetParameter(string parameter)
5260
{
5361
return Operand.Error($"Parameter [{parameter}] is missing.");
5462
}
63+
5564
/// <summary>
5665
/// 自定义函数 请重写此方法
5766
/// </summary>
@@ -102,6 +111,7 @@ public Operand Evaluate(FunctionBase function)
102111
{
103112
return function.Calculate(this);
104113
}
114+
105115
#endregion Parse Evaluate
106116

107117
#region TryEvaluate
@@ -431,7 +441,7 @@ public MyDate TryEvaluate_MyDate(string exp, MyDate def)
431441
}
432442
return def;
433443
}
434-
#endregion TryEvaluate
435444

445+
#endregion TryEvaluate
436446
}
437-
}
447+
}

csharp/ToolGood.Algorithm.Fast/AlgorithmEngineEx.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace ToolGood.Algorithm
1111
public class AlgorithmEngineEx : AlgorithmEngine
1212
{
1313
private readonly Dictionary<string, Operand> _tempdict;
14+
1415
/// <summary>
1516
/// 是否忽略大小写
1617
/// </summary>
@@ -318,4 +319,4 @@ public void AddParameterFromJson(string json)
318319

319320
#endregion Parameter
320321
}
321-
}
322+
}

0 commit comments

Comments
 (0)