MettlerToledo.Standard : EmptyUp parameter added, used in IsEmpty(.), etc.

This commit is contained in:
Milan Hanajik 2018-05-29 13:37:04 +02:00
parent dd851fb344
commit 7e2781148e
6 changed files with 381 additions and 329 deletions

View File

@ -103,7 +103,7 @@ namespace TBF.BenchControl.MettlerToledo.Multi
Capacity = 200.0f; Capacity = 200.0f;
Resolution = 0.001f; Resolution = 0.001f;
Empty = 20.0f; Empty = 20.0f;
Format = "F3"; Format = "F3";
DrainTimeSec = 180; DrainTimeSec = 180;
ComPortNr = 3; ComPortNr = 3;

View File

@ -35,6 +35,10 @@ namespace TBF.BenchControl.MettlerToledo.Standard
private float empty; private float empty;
public float Empty { get { return empty; } set { empty = value; } } public float Empty { get { return empty; } set { empty = value; } }
/// Mass threshold for 'Tank is empty' in 'kg' (or volume in 'l') when the drain valve is not open
private float emptyUp;
public float EmptyUp { get { return emptyUp; } set { emptyUp = value; } }
private string drainValve; private string drainValve;
public string DrainValve { get { return drainValve; } set { drainValve = value; } } public string DrainValve { get { return drainValve; } set { drainValve = value; } }
@ -103,7 +107,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard
Handshake = System.IO.Ports.Handshake.XOnXOff; Handshake = System.IO.Ports.Handshake.XOnXOff;
Capacity = 200.0f; Capacity = 200.0f;
Empty = 20.0f; Empty = 20.0f;
Format = "F3"; EmptyUp = 2.0f;
Format = "F3";
DrainValve = "VB1"; DrainValve = "VB1";
DrainTimeSec = 180; DrainTimeSec = 180;
BuoyancyTemp = 20.0f; BuoyancyTemp = 20.0f;
@ -119,8 +124,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard
public string ToString(int i) public string ToString(int i)
{ {
return string.Format("Name={0}, {1}kg, empty={2}kg, fmt.={3}, drainTm={4}s, Com{5}, {6}Bd, {7}-bits, parity={8}, stopBits={9}, {10}", return string.Format("Name={0}, {1}kg, empty={2}kg, emptyUp={3}kg, drainVlv={4}, drainTm={5}s, Com{6}, {7}Bd, {8}-bits, parity={9}, stopBits={10}, {11}",
Name, Capacity, Empty, Format, DrainTimeSec, ComPortNr, BaudRate, DataBits, Parity, StopBits, Handshake); Name, Capacity, Empty, EmptyUp, DrainValve, DrainTimeSec, ComPortNr, BaudRate, DataBits, Parity, StopBits, Handshake);
} }
} }
} }

View File

@ -31,317 +31,349 @@ namespace TBF.BenchControl.MettlerToledo.Standard
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.handshakeComboBox = new System.Windows.Forms.ComboBox(); this.handshakeComboBox = new System.Windows.Forms.ComboBox();
this.stopBitsComboBox = new System.Windows.Forms.ComboBox(); this.stopBitsComboBox = new System.Windows.Forms.ComboBox();
this.parityComboBox = new System.Windows.Forms.ComboBox(); this.parityComboBox = new System.Windows.Forms.ComboBox();
this.nameTextBox = new System.Windows.Forms.TextBox(); this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label(); this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label(); this.classNameLabel = new System.Windows.Forms.Label();
this.handshakeLabel = new System.Windows.Forms.Label(); this.handshakeLabel = new System.Windows.Forms.Label();
this.stopBitsLabel = new System.Windows.Forms.Label(); this.stopBitsLabel = new System.Windows.Forms.Label();
this.dataBitsTextBox = new System.Windows.Forms.TextBox(); this.dataBitsTextBox = new System.Windows.Forms.TextBox();
this.dataBitsLabel = new System.Windows.Forms.Label(); this.dataBitsLabel = new System.Windows.Forms.Label();
this.partityLabel = new System.Windows.Forms.Label(); this.partityLabel = new System.Windows.Forms.Label();
this.baudRateTextBox = new System.Windows.Forms.TextBox(); this.baudRateTextBox = new System.Windows.Forms.TextBox();
this.baudRateLabel = new System.Windows.Forms.Label(); this.baudRateLabel = new System.Windows.Forms.Label();
this.comPortNrTextBox = new System.Windows.Forms.TextBox(); this.comPortNrTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.capacityLabel = new System.Windows.Forms.Label(); this.capacityLabel = new System.Windows.Forms.Label();
this.capacityTextBox = new System.Windows.Forms.TextBox(); this.capacityTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.emptyTextBox = new System.Windows.Forms.TextBox(); this.emptyTextBox = new System.Windows.Forms.TextBox();
this.emptyLabel = new System.Windows.Forms.Label(); this.emptyLabel = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.drainTimeTextBox = new System.Windows.Forms.TextBox(); this.drainTimeTextBox = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.formatTextBox = new System.Windows.Forms.TextBox(); this.formatTextBox = new System.Windows.Forms.TextBox();
this.formatLabel = new System.Windows.Forms.Label(); this.formatLabel = new System.Windows.Forms.Label();
this.drainValveComboBox = new System.Windows.Forms.ComboBox(); this.drainValveComboBox = new System.Windows.Forms.ComboBox();
this.drainingValveLabel = new System.Windows.Forms.Label(); this.drainingValveLabel = new System.Windows.Forms.Label();
this.SuspendLayout(); this.label6 = new System.Windows.Forms.Label();
// this.emptyUpTextBox = new System.Windows.Forms.TextBox();
// handshakeComboBox this.label7 = new System.Windows.Forms.Label();
// this.SuspendLayout();
this.handshakeComboBox.Enabled = false; //
this.handshakeComboBox.FormattingEnabled = true; // handshakeComboBox
this.handshakeComboBox.Location = new System.Drawing.Point(236, 222); //
this.handshakeComboBox.Name = "handshakeComboBox"; this.handshakeComboBox.Enabled = false;
this.handshakeComboBox.Size = new System.Drawing.Size(43, 21); this.handshakeComboBox.FormattingEnabled = true;
this.handshakeComboBox.TabIndex = 27; this.handshakeComboBox.Location = new System.Drawing.Point(236, 222);
// this.handshakeComboBox.Name = "handshakeComboBox";
// stopBitsComboBox this.handshakeComboBox.Size = new System.Drawing.Size(43, 21);
// this.handshakeComboBox.TabIndex = 29;
this.stopBitsComboBox.Enabled = false; //
this.stopBitsComboBox.FormattingEnabled = true; // stopBitsComboBox
this.stopBitsComboBox.Location = new System.Drawing.Point(236, 200); //
this.stopBitsComboBox.Name = "stopBitsComboBox"; this.stopBitsComboBox.Enabled = false;
this.stopBitsComboBox.Size = new System.Drawing.Size(43, 21); this.stopBitsComboBox.FormattingEnabled = true;
this.stopBitsComboBox.TabIndex = 25; this.stopBitsComboBox.Location = new System.Drawing.Point(236, 200);
// this.stopBitsComboBox.Name = "stopBitsComboBox";
// parityComboBox this.stopBitsComboBox.Size = new System.Drawing.Size(43, 21);
// this.stopBitsComboBox.TabIndex = 27;
this.parityComboBox.Enabled = false; //
this.parityComboBox.FormattingEnabled = true; // parityComboBox
this.parityComboBox.Location = new System.Drawing.Point(100, 222); //
this.parityComboBox.Name = "parityComboBox"; this.parityComboBox.Enabled = false;
this.parityComboBox.Size = new System.Drawing.Size(43, 21); this.parityComboBox.FormattingEnabled = true;
this.parityComboBox.TabIndex = 21; this.parityComboBox.Location = new System.Drawing.Point(100, 222);
// this.parityComboBox.Name = "parityComboBox";
// nameTextBox this.parityComboBox.Size = new System.Drawing.Size(43, 21);
// this.parityComboBox.TabIndex = 23;
this.nameTextBox.Enabled = false; //
this.nameTextBox.Location = new System.Drawing.Point(137, 27); // nameTextBox
this.nameTextBox.Name = "nameTextBox"; //
this.nameTextBox.Size = new System.Drawing.Size(142, 20); this.nameTextBox.Enabled = false;
this.nameTextBox.TabIndex = 2; this.nameTextBox.Location = new System.Drawing.Point(137, 27);
// this.nameTextBox.Name = "nameTextBox";
// nameLabel this.nameTextBox.Size = new System.Drawing.Size(142, 20);
// this.nameTextBox.TabIndex = 2;
this.nameLabel.AutoSize = true; //
this.nameLabel.Location = new System.Drawing.Point(26, 30); // nameLabel
this.nameLabel.Name = "nameLabel"; //
this.nameLabel.Size = new System.Drawing.Size(35, 13); this.nameLabel.AutoSize = true;
this.nameLabel.TabIndex = 1; this.nameLabel.Location = new System.Drawing.Point(26, 30);
this.nameLabel.Text = "Name"; this.nameLabel.Name = "nameLabel";
// this.nameLabel.Size = new System.Drawing.Size(35, 13);
// classNameLabel this.nameLabel.TabIndex = 1;
// this.nameLabel.Text = "Name";
this.classNameLabel.AutoSize = true; //
this.classNameLabel.Location = new System.Drawing.Point(134, 9); // classNameLabel
this.classNameLabel.Name = "classNameLabel"; //
this.classNameLabel.Size = new System.Drawing.Size(89, 13); this.classNameLabel.AutoSize = true;
this.classNameLabel.TabIndex = 0; this.classNameLabel.Location = new System.Drawing.Point(134, 9);
this.classNameLabel.Text = "ComponentName"; this.classNameLabel.Name = "classNameLabel";
// this.classNameLabel.Size = new System.Drawing.Size(89, 13);
// handshakeLabel this.classNameLabel.TabIndex = 0;
// this.classNameLabel.Text = "ComponentName";
this.handshakeLabel.AutoSize = true; //
this.handshakeLabel.Location = new System.Drawing.Point(162, 225); // handshakeLabel
this.handshakeLabel.Name = "handshakeLabel"; //
this.handshakeLabel.Size = new System.Drawing.Size(62, 13); this.handshakeLabel.AutoSize = true;
this.handshakeLabel.TabIndex = 26; this.handshakeLabel.Location = new System.Drawing.Point(162, 225);
this.handshakeLabel.Text = "Handshake"; this.handshakeLabel.Name = "handshakeLabel";
// this.handshakeLabel.Size = new System.Drawing.Size(62, 13);
// stopBitsLabel this.handshakeLabel.TabIndex = 28;
// this.handshakeLabel.Text = "Handshake";
this.stopBitsLabel.AutoSize = true; //
this.stopBitsLabel.Location = new System.Drawing.Point(162, 203); // stopBitsLabel
this.stopBitsLabel.Name = "stopBitsLabel"; //
this.stopBitsLabel.Size = new System.Drawing.Size(49, 13); this.stopBitsLabel.AutoSize = true;
this.stopBitsLabel.TabIndex = 24; this.stopBitsLabel.Location = new System.Drawing.Point(162, 203);
this.stopBitsLabel.Text = "Stop Bits"; this.stopBitsLabel.Name = "stopBitsLabel";
// this.stopBitsLabel.Size = new System.Drawing.Size(49, 13);
// dataBitsTextBox this.stopBitsLabel.TabIndex = 26;
// this.stopBitsLabel.Text = "Stop Bits";
this.dataBitsTextBox.Enabled = false; //
this.dataBitsTextBox.Location = new System.Drawing.Point(236, 178); // dataBitsTextBox
this.dataBitsTextBox.Name = "dataBitsTextBox"; //
this.dataBitsTextBox.Size = new System.Drawing.Size(43, 20); this.dataBitsTextBox.Enabled = false;
this.dataBitsTextBox.TabIndex = 23; this.dataBitsTextBox.Location = new System.Drawing.Point(236, 178);
// this.dataBitsTextBox.Name = "dataBitsTextBox";
// dataBitsLabel this.dataBitsTextBox.Size = new System.Drawing.Size(43, 20);
// this.dataBitsTextBox.TabIndex = 25;
this.dataBitsLabel.AutoSize = true; //
this.dataBitsLabel.Location = new System.Drawing.Point(162, 181); // dataBitsLabel
this.dataBitsLabel.Name = "dataBitsLabel"; //
this.dataBitsLabel.Size = new System.Drawing.Size(50, 13); this.dataBitsLabel.AutoSize = true;
this.dataBitsLabel.TabIndex = 22; this.dataBitsLabel.Location = new System.Drawing.Point(162, 181);
this.dataBitsLabel.Text = "Data Bits"; this.dataBitsLabel.Name = "dataBitsLabel";
// this.dataBitsLabel.Size = new System.Drawing.Size(50, 13);
// partityLabel this.dataBitsLabel.TabIndex = 24;
// this.dataBitsLabel.Text = "Data Bits";
this.partityLabel.AutoSize = true; //
this.partityLabel.Location = new System.Drawing.Point(26, 225); // partityLabel
this.partityLabel.Name = "partityLabel"; //
this.partityLabel.Size = new System.Drawing.Size(33, 13); this.partityLabel.AutoSize = true;
this.partityLabel.TabIndex = 20; this.partityLabel.Location = new System.Drawing.Point(26, 225);
this.partityLabel.Text = "Parity"; this.partityLabel.Name = "partityLabel";
// this.partityLabel.Size = new System.Drawing.Size(33, 13);
// baudRateTextBox this.partityLabel.TabIndex = 22;
// this.partityLabel.Text = "Parity";
this.baudRateTextBox.Enabled = false; //
this.baudRateTextBox.Location = new System.Drawing.Point(100, 200); // baudRateTextBox
this.baudRateTextBox.Name = "baudRateTextBox"; //
this.baudRateTextBox.Size = new System.Drawing.Size(43, 20); this.baudRateTextBox.Enabled = false;
this.baudRateTextBox.TabIndex = 19; this.baudRateTextBox.Location = new System.Drawing.Point(100, 200);
// this.baudRateTextBox.Name = "baudRateTextBox";
// baudRateLabel this.baudRateTextBox.Size = new System.Drawing.Size(43, 20);
// this.baudRateTextBox.TabIndex = 21;
this.baudRateLabel.AutoSize = true; //
this.baudRateLabel.Location = new System.Drawing.Point(26, 203); // baudRateLabel
this.baudRateLabel.Name = "baudRateLabel"; //
this.baudRateLabel.Size = new System.Drawing.Size(53, 13); this.baudRateLabel.AutoSize = true;
this.baudRateLabel.TabIndex = 18; this.baudRateLabel.Location = new System.Drawing.Point(26, 203);
this.baudRateLabel.Text = "Baud rate"; this.baudRateLabel.Name = "baudRateLabel";
// this.baudRateLabel.Size = new System.Drawing.Size(53, 13);
// comPortNrTextBox this.baudRateLabel.TabIndex = 20;
// this.baudRateLabel.Text = "Baud rate";
this.comPortNrTextBox.Enabled = false; //
this.comPortNrTextBox.Location = new System.Drawing.Point(100, 178); // comPortNrTextBox
this.comPortNrTextBox.Name = "comPortNrTextBox"; //
this.comPortNrTextBox.Size = new System.Drawing.Size(43, 20); this.comPortNrTextBox.Enabled = false;
this.comPortNrTextBox.TabIndex = 17; this.comPortNrTextBox.Location = new System.Drawing.Point(100, 178);
// this.comPortNrTextBox.Name = "comPortNrTextBox";
// label1 this.comPortNrTextBox.Size = new System.Drawing.Size(43, 20);
// this.comPortNrTextBox.TabIndex = 19;
this.label1.AutoSize = true; //
this.label1.Location = new System.Drawing.Point(26, 181); // label1
this.label1.Name = "label1"; //
this.label1.Size = new System.Drawing.Size(67, 13); this.label1.AutoSize = true;
this.label1.TabIndex = 16; this.label1.Location = new System.Drawing.Point(26, 181);
this.label1.Text = "Serial port #:"; this.label1.Name = "label1";
// this.label1.Size = new System.Drawing.Size(67, 13);
// capacityLabel this.label1.TabIndex = 18;
// this.label1.Text = "Serial port #:";
this.capacityLabel.AutoSize = true; //
this.capacityLabel.Location = new System.Drawing.Point(26, 82); // capacityLabel
this.capacityLabel.Name = "capacityLabel"; //
this.capacityLabel.Size = new System.Drawing.Size(75, 13); this.capacityLabel.AutoSize = true;
this.capacityLabel.TabIndex = 5; this.capacityLabel.Location = new System.Drawing.Point(26, 82);
this.capacityLabel.Text = "Tank capacity"; this.capacityLabel.Name = "capacityLabel";
// this.capacityLabel.Size = new System.Drawing.Size(75, 13);
// capacityTextBox this.capacityLabel.TabIndex = 5;
// this.capacityLabel.Text = "Tank capacity";
this.capacityTextBox.Enabled = false; //
this.capacityTextBox.Location = new System.Drawing.Point(137, 79); // capacityTextBox
this.capacityTextBox.Name = "capacityTextBox"; //
this.capacityTextBox.Size = new System.Drawing.Size(43, 20); this.capacityTextBox.Enabled = false;
this.capacityTextBox.TabIndex = 6; this.capacityTextBox.Location = new System.Drawing.Point(137, 79);
// this.capacityTextBox.Name = "capacityTextBox";
// label2 this.capacityTextBox.Size = new System.Drawing.Size(43, 20);
// this.capacityTextBox.TabIndex = 6;
this.label2.AutoSize = true; //
this.label2.Location = new System.Drawing.Point(186, 82); // label2
this.label2.Name = "label2"; //
this.label2.Size = new System.Drawing.Size(19, 13); this.label2.AutoSize = true;
this.label2.TabIndex = 7; this.label2.Location = new System.Drawing.Point(186, 82);
this.label2.Text = "kg"; this.label2.Name = "label2";
// this.label2.Size = new System.Drawing.Size(19, 13);
// label3 this.label2.TabIndex = 7;
// this.label2.Text = "kg";
this.label3.AutoSize = true; //
this.label3.Location = new System.Drawing.Point(186, 104); // label3
this.label3.Name = "label3"; //
this.label3.Size = new System.Drawing.Size(19, 13); this.label3.AutoSize = true;
this.label3.TabIndex = 10; this.label3.Location = new System.Drawing.Point(186, 104);
this.label3.Text = "kg"; this.label3.Name = "label3";
// this.label3.Size = new System.Drawing.Size(19, 13);
// emptyTextBox this.label3.TabIndex = 10;
// this.label3.Text = "kg";
this.emptyTextBox.Enabled = false; //
this.emptyTextBox.Location = new System.Drawing.Point(137, 101); // emptyTextBox
this.emptyTextBox.Name = "emptyTextBox"; //
this.emptyTextBox.Size = new System.Drawing.Size(43, 20); this.emptyTextBox.Enabled = false;
this.emptyTextBox.TabIndex = 9; this.emptyTextBox.Location = new System.Drawing.Point(137, 101);
// this.emptyTextBox.Name = "emptyTextBox";
// emptyLabel this.emptyTextBox.Size = new System.Drawing.Size(43, 20);
// this.emptyTextBox.TabIndex = 9;
this.emptyLabel.AutoSize = true; //
this.emptyLabel.Location = new System.Drawing.Point(26, 104); // emptyLabel
this.emptyLabel.Name = "emptyLabel"; //
this.emptyLabel.Size = new System.Drawing.Size(109, 13); this.emptyLabel.AutoSize = true;
this.emptyLabel.TabIndex = 8; this.emptyLabel.Location = new System.Drawing.Point(26, 104);
this.emptyLabel.Text = "Tank empty threshold"; this.emptyLabel.Name = "emptyLabel";
// this.emptyLabel.Size = new System.Drawing.Size(109, 13);
// label4 this.emptyLabel.TabIndex = 8;
// this.emptyLabel.Text = "Tank empty threshold";
this.label4.AutoSize = true; //
this.label4.Location = new System.Drawing.Point(186, 149); // label4
this.label4.Name = "label4"; //
this.label4.Size = new System.Drawing.Size(24, 13); this.label4.AutoSize = true;
this.label4.TabIndex = 15; this.label4.Location = new System.Drawing.Point(186, 149);
this.label4.Text = "sec"; this.label4.Name = "label4";
// this.label4.Size = new System.Drawing.Size(24, 13);
// drainTimeTextBox this.label4.TabIndex = 17;
// this.label4.Text = "sec";
this.drainTimeTextBox.Enabled = false; //
this.drainTimeTextBox.Location = new System.Drawing.Point(137, 146); // drainTimeTextBox
this.drainTimeTextBox.Name = "drainTimeTextBox"; //
this.drainTimeTextBox.Size = new System.Drawing.Size(43, 20); this.drainTimeTextBox.Enabled = false;
this.drainTimeTextBox.TabIndex = 14; this.drainTimeTextBox.Location = new System.Drawing.Point(137, 146);
// this.drainTimeTextBox.Name = "drainTimeTextBox";
// label5 this.drainTimeTextBox.Size = new System.Drawing.Size(43, 20);
// this.drainTimeTextBox.TabIndex = 16;
this.label5.AutoSize = true; //
this.label5.Location = new System.Drawing.Point(26, 149); // label5
this.label5.Name = "label5"; //
this.label5.Size = new System.Drawing.Size(54, 13); this.label5.AutoSize = true;
this.label5.TabIndex = 13; this.label5.Location = new System.Drawing.Point(26, 149);
this.label5.Text = "Drain time"; this.label5.Name = "label5";
// this.label5.Size = new System.Drawing.Size(54, 13);
// formatTextBox this.label5.TabIndex = 15;
// this.label5.Text = "Drain time";
this.formatTextBox.Enabled = false; //
this.formatTextBox.Location = new System.Drawing.Point(137, 49); // formatTextBox
this.formatTextBox.Name = "formatTextBox"; //
this.formatTextBox.Size = new System.Drawing.Size(43, 20); this.formatTextBox.Enabled = false;
this.formatTextBox.TabIndex = 4; this.formatTextBox.Location = new System.Drawing.Point(137, 49);
// this.formatTextBox.Name = "formatTextBox";
// formatLabel this.formatTextBox.Size = new System.Drawing.Size(43, 20);
// this.formatTextBox.TabIndex = 4;
this.formatLabel.AutoSize = true; //
this.formatLabel.Location = new System.Drawing.Point(26, 52); // formatLabel
this.formatLabel.Name = "formatLabel"; //
this.formatLabel.Size = new System.Drawing.Size(76, 13); this.formatLabel.AutoSize = true;
this.formatLabel.TabIndex = 3; this.formatLabel.Location = new System.Drawing.Point(26, 52);
this.formatLabel.Text = "Decimal points"; this.formatLabel.Name = "formatLabel";
// this.formatLabel.Size = new System.Drawing.Size(76, 13);
// drainValveComboBox this.formatLabel.TabIndex = 3;
// this.formatLabel.Text = "Decimal points";
this.drainValveComboBox.Enabled = false; //
this.drainValveComboBox.FormattingEnabled = true; // drainValveComboBox
this.drainValveComboBox.Location = new System.Drawing.Point(137, 123); //
this.drainValveComboBox.Name = "drainValveComboBox"; this.drainValveComboBox.Enabled = false;
this.drainValveComboBox.Size = new System.Drawing.Size(143, 21); this.drainValveComboBox.FormattingEnabled = true;
this.drainValveComboBox.TabIndex = 12; this.drainValveComboBox.Location = new System.Drawing.Point(137, 123);
// this.drainValveComboBox.Name = "drainValveComboBox";
// drainingValveLabel this.drainValveComboBox.Size = new System.Drawing.Size(143, 21);
// this.drainValveComboBox.TabIndex = 14;
this.drainingValveLabel.AutoSize = true; //
this.drainingValveLabel.Location = new System.Drawing.Point(26, 126); // drainingValveLabel
this.drainingValveLabel.Name = "drainingValveLabel"; //
this.drainingValveLabel.Size = new System.Drawing.Size(61, 13); this.drainingValveLabel.AutoSize = true;
this.drainingValveLabel.TabIndex = 11; this.drainingValveLabel.Location = new System.Drawing.Point(26, 126);
this.drainingValveLabel.Text = "Drain valve"; this.drainingValveLabel.Name = "drainingValveLabel";
// this.drainingValveLabel.Size = new System.Drawing.Size(61, 13);
// BalanceCfgCtrl this.drainingValveLabel.TabIndex = 13;
// this.drainingValveLabel.Text = "Drain valve";
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; // label6
this.Controls.Add(this.drainValveComboBox); //
this.Controls.Add(this.drainingValveLabel); this.label6.AutoSize = true;
this.Controls.Add(this.formatTextBox); this.label6.Location = new System.Drawing.Point(285, 104);
this.Controls.Add(this.formatLabel); this.label6.Name = "label6";
this.Controls.Add(this.label4); this.label6.Size = new System.Drawing.Size(19, 13);
this.Controls.Add(this.drainTimeTextBox); this.label6.TabIndex = 12;
this.Controls.Add(this.label5); this.label6.Text = "kg";
this.Controls.Add(this.label3); //
this.Controls.Add(this.emptyTextBox); // emptyUpTextBox
this.Controls.Add(this.emptyLabel); //
this.Controls.Add(this.label2); this.emptyUpTextBox.Enabled = false;
this.Controls.Add(this.capacityTextBox); this.emptyUpTextBox.Location = new System.Drawing.Point(236, 101);
this.Controls.Add(this.capacityLabel); this.emptyUpTextBox.Name = "emptyUpTextBox";
this.Controls.Add(this.handshakeComboBox); this.emptyUpTextBox.Size = new System.Drawing.Size(43, 20);
this.Controls.Add(this.stopBitsComboBox); this.emptyUpTextBox.TabIndex = 11;
this.Controls.Add(this.parityComboBox); //
this.Controls.Add(this.nameTextBox); // label7
this.Controls.Add(this.nameLabel); //
this.Controls.Add(this.classNameLabel); this.label7.AutoSize = true;
this.Controls.Add(this.handshakeLabel); this.label7.Location = new System.Drawing.Point(225, 87);
this.Controls.Add(this.stopBitsLabel); this.label7.Name = "label7";
this.Controls.Add(this.dataBitsTextBox); this.label7.Size = new System.Drawing.Size(83, 13);
this.Controls.Add(this.dataBitsLabel); this.label7.TabIndex = 30;
this.Controls.Add(this.partityLabel); this.label7.Text = "not draining (up)";
this.Controls.Add(this.baudRateTextBox); //
this.Controls.Add(this.baudRateLabel); // BalanceCfgCtrl
this.Controls.Add(this.comPortNrTextBox); //
this.Controls.Add(this.label1); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.Name = "BalanceCfgCtrl"; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Size = new System.Drawing.Size(300, 250); this.Controls.Add(this.label7);
this.Load += new System.EventHandler(this.BalanceCfgCtrl_Load); this.Controls.Add(this.label6);
this.ResumeLayout(false); this.Controls.Add(this.emptyUpTextBox);
this.PerformLayout(); this.Controls.Add(this.drainValveComboBox);
this.Controls.Add(this.drainingValveLabel);
this.Controls.Add(this.formatTextBox);
this.Controls.Add(this.formatLabel);
this.Controls.Add(this.label4);
this.Controls.Add(this.drainTimeTextBox);
this.Controls.Add(this.label5);
this.Controls.Add(this.label3);
this.Controls.Add(this.emptyTextBox);
this.Controls.Add(this.emptyLabel);
this.Controls.Add(this.label2);
this.Controls.Add(this.capacityTextBox);
this.Controls.Add(this.capacityLabel);
this.Controls.Add(this.handshakeComboBox);
this.Controls.Add(this.stopBitsComboBox);
this.Controls.Add(this.parityComboBox);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Controls.Add(this.handshakeLabel);
this.Controls.Add(this.stopBitsLabel);
this.Controls.Add(this.dataBitsTextBox);
this.Controls.Add(this.dataBitsLabel);
this.Controls.Add(this.partityLabel);
this.Controls.Add(this.baudRateTextBox);
this.Controls.Add(this.baudRateLabel);
this.Controls.Add(this.comPortNrTextBox);
this.Controls.Add(this.label1);
this.Name = "BalanceCfgCtrl";
this.Size = new System.Drawing.Size(327, 250);
this.Load += new System.EventHandler(this.BalanceCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
} }
@ -375,5 +407,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard
private System.Windows.Forms.Label formatLabel; private System.Windows.Forms.Label formatLabel;
private System.Windows.Forms.ComboBox drainValveComboBox; private System.Windows.Forms.ComboBox drainValveComboBox;
private System.Windows.Forms.Label drainingValveLabel; private System.Windows.Forms.Label drainingValveLabel;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox emptyUpTextBox;
private System.Windows.Forms.Label label7;
} }
} }

View File

@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2013-2017 Sensus Metering Systems /// Copyright (c) 2013-2018 Sensus Slovensko a.s.
/// ///
using System; using System;
using System.Globalization; using System.Globalization;
@ -128,7 +128,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard
nameTextBox.Text = config.Name; nameTextBox.Text = config.Name;
capacityTextBox.Text = config.Capacity.ToString(); capacityTextBox.Text = config.Capacity.ToString();
emptyTextBox.Text = config.Empty.ToString(); emptyTextBox.Text = config.Empty.ToString();
formatTextBox.Text = (config.Format.Length > 1) ? config.Format.Substring(1) : config.Format; emptyUpTextBox.Text = config.EmptyUp.ToString();
formatTextBox.Text = (config.Format.Length > 1) ? config.Format.Substring(1) : config.Format;
drainTimeTextBox.Text = config.DrainTimeSec.ToString(); drainTimeTextBox.Text = config.DrainTimeSec.ToString();
drainValveComboBox.Text = string.IsNullOrEmpty(config.DrainValve) ? "---" : config.DrainValve; drainValveComboBox.Text = string.IsNullOrEmpty(config.DrainValve) ? "---" : config.DrainValve;
@ -145,7 +146,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard
nameTextBox.Enabled = true; nameTextBox.Enabled = true;
capacityTextBox.Enabled = true; capacityTextBox.Enabled = true;
emptyTextBox.Enabled = true; emptyTextBox.Enabled = true;
formatTextBox.Enabled = true; emptyUpTextBox.Enabled = true;
formatTextBox.Enabled = true;
drainTimeTextBox.Enabled = true; drainTimeTextBox.Enabled = true;
drainValveComboBox.Enabled = true; drainValveComboBox.Enabled = true;
@ -188,7 +190,12 @@ namespace TBF.BenchControl.MettlerToledo.Standard
flags |= CfgUpdateFlags.Error; flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Tank Empty' is not valid"; message += Environment.NewLine + "'Tank Empty' is not valid";
} }
if (!int.TryParse(formatTextBox.Text, out dummy) || dummy < 0 || dummy > 9) if (!Utils.TryParseUFloat(emptyUpTextBox.Text, out mass) || mass <= 0)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Tank Empty Up' is not valid";
}
if (!int.TryParse(formatTextBox.Text, out dummy) || dummy < 0 || dummy > 9)
{ {
flags |= CfgUpdateFlags.Error; flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Decimal points' should be between 0 and 9"; message += Environment.NewLine + "'Decimal points' should be between 0 and 9";
@ -216,7 +223,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard
config.Name = nameTextBox.Text; config.Name = nameTextBox.Text;
config.Capacity = Utils.ParseUFloat(capacityTextBox.Text); config.Capacity = Utils.ParseUFloat(capacityTextBox.Text);
config.Empty = Utils.ParseUFloat(emptyTextBox.Text); config.Empty = Utils.ParseUFloat(emptyTextBox.Text);
config.Format = "F" + formatTextBox.Text; config.EmptyUp = Utils.ParseUFloat(emptyUpTextBox.Text);
config.Format = "F" + formatTextBox.Text;
config.DrainTimeSec = int.Parse(drainTimeTextBox.Text); config.DrainTimeSec = int.Parse(drainTimeTextBox.Text);
config.DrainValve = drainValveComboBox.Text.Equals("---") ? string.Empty : drainValveComboBox.Text; config.DrainValve = drainValveComboBox.Text.Equals("---") ? string.Empty : drainValveComboBox.Text;

View File

@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2013-2017 Sensus Metering Systems /// Copyright (c) 2013-2018 Sensus Slovensko a.s.
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -123,12 +123,12 @@ namespace TBF.BenchControl.MettlerToledo.Standard
public override bool IsEmpty() public override bool IsEmpty()
{ {
return (this.mass <= balanceCfg.Empty); return DrainValve.State ? (mass <= balanceCfg.Empty) : (mass <= balanceCfg.EmptyUp);
} }
public bool IsEmpty(double mass) public bool IsEmpty(double mass)
{ {
return (mass <= balanceCfg.Empty); return DrainValve.State ? (mass <= balanceCfg.Empty) : (mass <= balanceCfg.EmptyUp);
} }
public void ZeroWhenStable() public void ZeroWhenStable()

View File

@ -642,23 +642,27 @@ namespace TBF
(cfg as BenchControl.Elde.PressureMeter.PressureMeterCfg).Idx0 = zeroBasedIdx; (cfg as BenchControl.Elde.PressureMeter.PressureMeterCfg).Idx0 = zeroBasedIdx;
return true; return true;
} }
else if (cfg is BenchControl.Elde.RegisterReader.RegisterReaderCfg)
{
(cfg as IChildComponentCfg).ParentName = "CB";
(cfg as BenchControl.Elde.RegisterReader.RegisterReaderCfg).Position = zeroBasedIdx + 1;
return true;
}
else if (cfg is BenchControl.Elde.RegulValve.RegulValveCfg) else if (cfg is BenchControl.Elde.RegulValve.RegulValveCfg)
{ {
(cfg as IChildComponentCfg).ParentName = "CB"; (cfg as IChildComponentCfg).ParentName = "CB";
(cfg as BenchControl.Elde.RegulValve.RegulValveCfg).Idx1 = zeroBasedIdx + 1; (cfg as BenchControl.Elde.RegulValve.RegulValveCfg).Idx1 = zeroBasedIdx + 1;
return true; return true;
} }
else if (cfg is BenchControl.Elde.RegisterReader.RegisterReaderCfg)
{
(cfg as IChildComponentCfg).ParentName = "CB";
(cfg as BenchControl.Elde.RegisterReader.RegisterReaderCfg).Position = zeroBasedIdx + 1;
return true;
}
else if (cfg is BenchControl.Elde.FixedStartRegisterReader.RegisterReaderCfg) else if (cfg is BenchControl.Elde.FixedStartRegisterReader.RegisterReaderCfg)
{ {
(cfg as IChildComponentCfg).ParentName = "CB"; (cfg as IChildComponentCfg).ParentName = "CB";
return true; return true;
} }
else if (cfg is BenchControl.TestMethods.iPerlCommunication.iPerlHead.IperlHeadCfg)
{
return true;
}
else if (cfg is BenchControl.WaterMeters.WaterMeter.WaterMeterCfg) else if (cfg is BenchControl.WaterMeters.WaterMeter.WaterMeterCfg)
{ {
return true; return true;