Mass values are printed out using format specified by Balance component parameters

This commit is contained in:
Milan Hanajik
2015-03-25 10:01:37 +01:00
parent 4342e7a8b2
commit a26c90f217
8 changed files with 338 additions and 286 deletions
@@ -26,7 +26,8 @@ namespace TBF.BenchControl.MettlerToledo
public Handshake Handshake;
public float Capacity; /// Max. water mass in 'kg' or volume in 'l'
public float Empty; /// 'Empty' water mass in 'kg' or volume in 'l'
public int EmptyTimeSec; /// s
public string Format;
public int EmptyTimeSec; /// s
/// Private parameterless constructor invoked by all other (public) constructors
BalanceCfg()
@@ -41,7 +42,8 @@ namespace TBF.BenchControl.MettlerToledo
Handshake = System.IO.Ports.Handshake.XOnXOff;
Capacity = 200.0f;
Empty = 20.0f;
EmptyTimeSec = 180;
Format = "F3";
EmptyTimeSec = 180;
}
public BalanceCfg(IComponentFactory factory)
@@ -52,8 +54,8 @@ namespace TBF.BenchControl.MettlerToledo
public string ToString(int i)
{
return string.Format("Name={0}, Com{1}, {2}Bd, {3}-bits, parity={4}, stopBits={5}, {6}, capacity={7}kg, empty={8}kg, emptyTime={9}s",
Name, ComPortNr, BaudRate, DataBits, Parity, StopBits, Handshake, Capacity, Empty, EmptyTimeSec);
return string.Format("Name={0}, {1}kg, empty={2}kg, fmt.={3}, emptyTm={4}s, Com{5}, {6}Bd, {7}-bits, parity={8}, stopBits={9}, {10}",
Name, Capacity, Empty, Format, EmptyTimeSec, ComPortNr, BaudRate, DataBits, Parity, StopBits, Handshake);
}
}
}