ErrorFlags and FlyingStartMassCollProlong : English units supported.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2018-2022 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.IO;
|
||||
@@ -8,6 +8,7 @@ using System.Xml.Serialization;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Rig.Sequences;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged.Single
|
||||
@@ -27,7 +28,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged.Single
|
||||
|
||||
string[] paramNames = new string[]
|
||||
{
|
||||
string.Format("{0} [l]", Strings.Volume_to_tank),
|
||||
string.Format("{0} [{1}]", Strings.Volume_to_tank, ProcessData.VolumeUnit.ToDescription()),
|
||||
};
|
||||
public override string ParamName(int i) { return paramNames[i]; }
|
||||
public override int ParamsCount() { return paramNames.Length; }
|
||||
@@ -36,17 +37,20 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged.Single
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: return VolumeToTank.ToString();
|
||||
case 0: return Units.ConvertTo(ProcessData.VolumeUnit, VolumeToTank).ToString();
|
||||
default: return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateParam(int i, string strValue)
|
||||
public CfgUpdateFlags UpdateParam(int i, string str)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: VolumeToTank = Utils.ParseUFloat(strValue); return CfgUpdateFlags.None;
|
||||
default: return CfgUpdateFlags.None;
|
||||
case 0:
|
||||
VolumeToTank = Units.ConvertFrom(ProcessData.VolumeUnit, Utils.ParseUFloat(str));
|
||||
return CfgUpdateFlags.None;
|
||||
default:
|
||||
return CfgUpdateFlags.None;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +62,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged.Single
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
if (Utils.TryParseUFloat(strValue, out volumeToTank) && volumeToTank >= 0.1f) return true;
|
||||
if (Utils.TryParseUFloat(strValue, out volumeToTank) && volumeToTank > float.Epsilon) return true;
|
||||
break;
|
||||
default:
|
||||
message = "Invalid index";
|
||||
|
||||
Reference in New Issue
Block a user