Scale capacity, etc. : float --> double

This commit is contained in:
Milan Hanajik
2022-04-26 16:53:10 +02:00
parent d6880fc1b7
commit 43ce2552a2
4 changed files with 23 additions and 23 deletions
+2 -2
View File
@@ -9,12 +9,12 @@ namespace TBF.Rig.GenericDevices
/// <summary>
/// Max. mass of water in 'kg' or volume in 'l'
/// </summary>
float Capacity { get; }
double Capacity { get; }
/// <summary>
/// 'Empty' water mass in 'kg' or volume in 'l'
/// </summary>
float Empty { get; }
double Empty { get; }
/// <summary>
/// Time in [s] to drain the tank completely
+6 -6
View File
@@ -37,9 +37,9 @@ namespace TBF.Rig.MettlerToledo.Standard
public StopBits StopBits;
public Handshake Handshake;
public float Capacity { get; set; } /// Max. water mass in 'kg' or volume in 'l'
public float Empty { get; set; } /// Mass threshold for 'Tank is empty' in 'kg' (or volume in 'l')
public float EmptyUp { get; set; } /// Mass threshold for 'Tank is empty' in 'kg' (or volume in 'l') when the drain valve is not open
public double Capacity { get; set; } /// Max. water mass in 'kg' or volume in 'l'
public double Empty { get; set; } /// Mass threshold for 'Tank is empty' in 'kg' (or volume in 'l')
public double EmptyUp { get; set; } /// Mass threshold for 'Tank is empty' in 'kg' (or volume in 'l') when the drain valve is not open
public string Evaporation { get; set; }
public string DrainValve { get; set; }
public int DrainTimeSec { get; set; }
@@ -104,9 +104,9 @@ namespace TBF.Rig.MettlerToledo.Standard
DataBits = 7;
StopBits = System.IO.Ports.StopBits.One;
Handshake = System.IO.Ports.Handshake.XOnXOff;
Capacity = 200.0f;
Empty = 20.0f;
EmptyUp = 2.0f;
Capacity = 200.0;
Empty = 20.0;
EmptyUp = 2.0;
DrainValve = "VB1";
DrainTimeSec = 180;
BuoyancyTemp = 20.0f;
+11 -11
View File
@@ -46,9 +46,9 @@ namespace TBF.Rig.Scales.MettlerToledo
public StopBits StopBits;
public Handshake Handshake;
public Protocol Protocol;
public float Capacity { get; set; } /// Max. water mass in 'kg' or volume in 'l'
public float Empty { get; set; } /// Mass threshold for 'Tank is empty' in 'kg' (or volume in 'l')
public float EmptyUp { get; set; } /// Mass threshold for 'Tank is empty' in 'kg' (or volume in 'l') when the drain valve is not open
public double Capacity { get; set; } /// Max. water mass in 'kg' or volume in 'l'
public double Empty { get; set; } /// Mass threshold for 'Tank is empty' in 'kg' (or volume in 'l')
public double EmptyUp { get; set; } /// Mass threshold for 'Tank is empty' in 'kg' (or volume in 'l') when the drain valve is not open
public string Evaporation { get; set; }
public string DrainValve { get; set; }
public int DrainTimeSec { get; set; }
@@ -121,9 +121,9 @@ namespace TBF.Rig.Scales.MettlerToledo
StopBits = System.IO.Ports.StopBits.One;
Handshake = System.IO.Ports.Handshake.None;
Protocol = Protocol.SICS;
Capacity = 200.0f;
Empty = 20.0f;
EmptyUp = 2.0f;
Capacity = 200.0;
Empty = 20.0;
EmptyUp = 2.0;
DrainValve = "VB1";
DrainTimeSec = 180;
ActionAfter1stDraining = ActionA1D.Zero;
@@ -234,9 +234,9 @@ namespace TBF.Rig.Scales.MettlerToledo
case 4: StopBits = TBF.Utils.GetStopBits(str); return CfgUpdateFlags.RestartRqrd;
case 5: Handshake = TBF.Utils.GetHandshake(str); return CfgUpdateFlags.RestartRqrd;
case 6: Protocol = (str == Protocol.SICS.ToString()) ? Protocol.SICS : Protocol.ID1; return CfgUpdateFlags.RestartRqrd;
case 7: Capacity = Utils.ParseUFloat(str); return CfgUpdateFlags.RestartRqrd;
case 8: Empty = Utils.ParseUFloat(str); return CfgUpdateFlags.RestartRqrd;
case 9: EmptyUp = Utils.ParseUFloat(str); return CfgUpdateFlags.RestartRqrd;
case 7: Capacity = Utils.ParseUDouble(str); return CfgUpdateFlags.RestartRqrd;
case 8: Empty = Utils.ParseUDouble(str); return CfgUpdateFlags.RestartRqrd;
case 9: EmptyUp = Utils.ParseUDouble(str); return CfgUpdateFlags.RestartRqrd;
case 10: DrainValve = str; return CfgUpdateFlags.RestartRqrd;
case 11: DrainTimeSec = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 12:
@@ -253,7 +253,7 @@ namespace TBF.Rig.Scales.MettlerToledo
{
message = string.Empty;
int idummy;
float fdummy;
double ddummy;
switch (i)
{
@@ -274,7 +274,7 @@ namespace TBF.Rig.Scales.MettlerToledo
case 7: /// Capacity
case 8: /// Empty
case 9: /// EmptyUp
if (Utils.TryParseUFloat(strValue, out fdummy)) return true;
if (Utils.TryParseUDouble(strValue, out ddummy)) return true;
break;
case 13: /// Evaporation
return true;
@@ -21,12 +21,12 @@ namespace TBF.Rig.Various.TankWithLevelMsrmnt
///
/// Max. water mass in 'kg' or volume in 'l'
private float capacity;
public float Capacity { get { return capacity; } set { capacity = value; } }
private double capacity;
public double Capacity { get { return capacity; } set { capacity = value; } }
/// Mass threshold for 'Tank is empty' in 'kg' (or volume in 'l')
private float empty;
public float Empty { get { return empty; } set { empty = value; } }
private double empty;
public double Empty { get { return empty; } set { empty = value; } }
private string drainValve;
public string DrainValve { get { return drainValve; } set { drainValve = value; } }