diff --git a/TBF/BenchControl/MettlerToledo/Multi/BalanceCfg.cs b/TBF/BenchControl/MettlerToledo/Multi/BalanceCfg.cs index 0fac460a4..b450b0791 100644 --- a/TBF/BenchControl/MettlerToledo/Multi/BalanceCfg.cs +++ b/TBF/BenchControl/MettlerToledo/Multi/BalanceCfg.cs @@ -103,7 +103,7 @@ namespace TBF.BenchControl.MettlerToledo.Multi Capacity = 200.0f; Resolution = 0.001f; Empty = 20.0f; - Format = "F3"; + Format = "F3"; DrainTimeSec = 180; ComPortNr = 3; diff --git a/TBF/BenchControl/MettlerToledo/Standard/BalanceCfg.cs b/TBF/BenchControl/MettlerToledo/Standard/BalanceCfg.cs index 5093781e2..e56dbe589 100644 --- a/TBF/BenchControl/MettlerToledo/Standard/BalanceCfg.cs +++ b/TBF/BenchControl/MettlerToledo/Standard/BalanceCfg.cs @@ -35,6 +35,10 @@ namespace TBF.BenchControl.MettlerToledo.Standard private float empty; 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; public string DrainValve { get { return drainValve; } set { drainValve = value; } } @@ -103,7 +107,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard Handshake = System.IO.Ports.Handshake.XOnXOff; Capacity = 200.0f; Empty = 20.0f; - Format = "F3"; + EmptyUp = 2.0f; + Format = "F3"; DrainValve = "VB1"; DrainTimeSec = 180; BuoyancyTemp = 20.0f; @@ -119,8 +124,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard 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}", - Name, Capacity, Empty, Format, DrainTimeSec, ComPortNr, BaudRate, DataBits, Parity, StopBits, Handshake); + 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, EmptyUp, DrainValve, DrainTimeSec, ComPortNr, BaudRate, DataBits, Parity, StopBits, Handshake); } } } diff --git a/TBF/BenchControl/MettlerToledo/Standard/BalanceCfgCtrl.Designer.cs b/TBF/BenchControl/MettlerToledo/Standard/BalanceCfgCtrl.Designer.cs index 3e5edcf60..d3681635d 100644 --- a/TBF/BenchControl/MettlerToledo/Standard/BalanceCfgCtrl.Designer.cs +++ b/TBF/BenchControl/MettlerToledo/Standard/BalanceCfgCtrl.Designer.cs @@ -31,317 +31,349 @@ namespace TBF.BenchControl.MettlerToledo.Standard /// private void InitializeComponent() { - this.handshakeComboBox = new System.Windows.Forms.ComboBox(); - this.stopBitsComboBox = new System.Windows.Forms.ComboBox(); - this.parityComboBox = new System.Windows.Forms.ComboBox(); - this.nameTextBox = new System.Windows.Forms.TextBox(); - this.nameLabel = new System.Windows.Forms.Label(); - this.classNameLabel = new System.Windows.Forms.Label(); - this.handshakeLabel = new System.Windows.Forms.Label(); - this.stopBitsLabel = new System.Windows.Forms.Label(); - this.dataBitsTextBox = new System.Windows.Forms.TextBox(); - this.dataBitsLabel = new System.Windows.Forms.Label(); - this.partityLabel = new System.Windows.Forms.Label(); - this.baudRateTextBox = new System.Windows.Forms.TextBox(); - this.baudRateLabel = new System.Windows.Forms.Label(); - this.comPortNrTextBox = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.capacityLabel = new System.Windows.Forms.Label(); - this.capacityTextBox = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.emptyTextBox = new System.Windows.Forms.TextBox(); - this.emptyLabel = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.drainTimeTextBox = new System.Windows.Forms.TextBox(); - this.label5 = new System.Windows.Forms.Label(); - this.formatTextBox = new System.Windows.Forms.TextBox(); - this.formatLabel = new System.Windows.Forms.Label(); - this.drainValveComboBox = new System.Windows.Forms.ComboBox(); - this.drainingValveLabel = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // handshakeComboBox - // - this.handshakeComboBox.Enabled = false; - this.handshakeComboBox.FormattingEnabled = true; - this.handshakeComboBox.Location = new System.Drawing.Point(236, 222); - this.handshakeComboBox.Name = "handshakeComboBox"; - this.handshakeComboBox.Size = new System.Drawing.Size(43, 21); - this.handshakeComboBox.TabIndex = 27; - // - // stopBitsComboBox - // - this.stopBitsComboBox.Enabled = false; - this.stopBitsComboBox.FormattingEnabled = true; - this.stopBitsComboBox.Location = new System.Drawing.Point(236, 200); - this.stopBitsComboBox.Name = "stopBitsComboBox"; - this.stopBitsComboBox.Size = new System.Drawing.Size(43, 21); - this.stopBitsComboBox.TabIndex = 25; - // - // parityComboBox - // - this.parityComboBox.Enabled = false; - this.parityComboBox.FormattingEnabled = true; - this.parityComboBox.Location = new System.Drawing.Point(100, 222); - this.parityComboBox.Name = "parityComboBox"; - this.parityComboBox.Size = new System.Drawing.Size(43, 21); - this.parityComboBox.TabIndex = 21; - // - // nameTextBox - // - this.nameTextBox.Enabled = false; - this.nameTextBox.Location = new System.Drawing.Point(137, 27); - this.nameTextBox.Name = "nameTextBox"; - this.nameTextBox.Size = new System.Drawing.Size(142, 20); - this.nameTextBox.TabIndex = 2; - // - // nameLabel - // - this.nameLabel.AutoSize = true; - this.nameLabel.Location = new System.Drawing.Point(26, 30); - this.nameLabel.Name = "nameLabel"; - this.nameLabel.Size = new System.Drawing.Size(35, 13); - this.nameLabel.TabIndex = 1; - this.nameLabel.Text = "Name"; - // - // classNameLabel - // - this.classNameLabel.AutoSize = true; - this.classNameLabel.Location = new System.Drawing.Point(134, 9); - this.classNameLabel.Name = "classNameLabel"; - this.classNameLabel.Size = new System.Drawing.Size(89, 13); - this.classNameLabel.TabIndex = 0; - this.classNameLabel.Text = "ComponentName"; - // - // handshakeLabel - // - this.handshakeLabel.AutoSize = true; - this.handshakeLabel.Location = new System.Drawing.Point(162, 225); - this.handshakeLabel.Name = "handshakeLabel"; - this.handshakeLabel.Size = new System.Drawing.Size(62, 13); - this.handshakeLabel.TabIndex = 26; - this.handshakeLabel.Text = "Handshake"; - // - // stopBitsLabel - // - this.stopBitsLabel.AutoSize = true; - this.stopBitsLabel.Location = new System.Drawing.Point(162, 203); - this.stopBitsLabel.Name = "stopBitsLabel"; - this.stopBitsLabel.Size = new System.Drawing.Size(49, 13); - this.stopBitsLabel.TabIndex = 24; - this.stopBitsLabel.Text = "Stop Bits"; - // - // dataBitsTextBox - // - this.dataBitsTextBox.Enabled = false; - this.dataBitsTextBox.Location = new System.Drawing.Point(236, 178); - this.dataBitsTextBox.Name = "dataBitsTextBox"; - this.dataBitsTextBox.Size = new System.Drawing.Size(43, 20); - this.dataBitsTextBox.TabIndex = 23; - // - // dataBitsLabel - // - this.dataBitsLabel.AutoSize = true; - this.dataBitsLabel.Location = new System.Drawing.Point(162, 181); - this.dataBitsLabel.Name = "dataBitsLabel"; - this.dataBitsLabel.Size = new System.Drawing.Size(50, 13); - this.dataBitsLabel.TabIndex = 22; - this.dataBitsLabel.Text = "Data Bits"; - // - // partityLabel - // - this.partityLabel.AutoSize = true; - this.partityLabel.Location = new System.Drawing.Point(26, 225); - this.partityLabel.Name = "partityLabel"; - this.partityLabel.Size = new System.Drawing.Size(33, 13); - this.partityLabel.TabIndex = 20; - this.partityLabel.Text = "Parity"; - // - // baudRateTextBox - // - this.baudRateTextBox.Enabled = false; - this.baudRateTextBox.Location = new System.Drawing.Point(100, 200); - this.baudRateTextBox.Name = "baudRateTextBox"; - this.baudRateTextBox.Size = new System.Drawing.Size(43, 20); - this.baudRateTextBox.TabIndex = 19; - // - // baudRateLabel - // - this.baudRateLabel.AutoSize = true; - this.baudRateLabel.Location = new System.Drawing.Point(26, 203); - this.baudRateLabel.Name = "baudRateLabel"; - this.baudRateLabel.Size = new System.Drawing.Size(53, 13); - this.baudRateLabel.TabIndex = 18; - this.baudRateLabel.Text = "Baud rate"; - // - // comPortNrTextBox - // - this.comPortNrTextBox.Enabled = false; - this.comPortNrTextBox.Location = new System.Drawing.Point(100, 178); - this.comPortNrTextBox.Name = "comPortNrTextBox"; - this.comPortNrTextBox.Size = new System.Drawing.Size(43, 20); - this.comPortNrTextBox.TabIndex = 17; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(26, 181); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 13); - this.label1.TabIndex = 16; - this.label1.Text = "Serial port #:"; - // - // capacityLabel - // - this.capacityLabel.AutoSize = true; - this.capacityLabel.Location = new System.Drawing.Point(26, 82); - this.capacityLabel.Name = "capacityLabel"; - this.capacityLabel.Size = new System.Drawing.Size(75, 13); - this.capacityLabel.TabIndex = 5; - this.capacityLabel.Text = "Tank capacity"; - // - // capacityTextBox - // - this.capacityTextBox.Enabled = false; - this.capacityTextBox.Location = new System.Drawing.Point(137, 79); - this.capacityTextBox.Name = "capacityTextBox"; - this.capacityTextBox.Size = new System.Drawing.Size(43, 20); - this.capacityTextBox.TabIndex = 6; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(186, 82); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(19, 13); - this.label2.TabIndex = 7; - this.label2.Text = "kg"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(186, 104); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(19, 13); - this.label3.TabIndex = 10; - this.label3.Text = "kg"; - // - // emptyTextBox - // - this.emptyTextBox.Enabled = false; - this.emptyTextBox.Location = new System.Drawing.Point(137, 101); - this.emptyTextBox.Name = "emptyTextBox"; - this.emptyTextBox.Size = new System.Drawing.Size(43, 20); - this.emptyTextBox.TabIndex = 9; - // - // emptyLabel - // - this.emptyLabel.AutoSize = true; - this.emptyLabel.Location = new System.Drawing.Point(26, 104); - this.emptyLabel.Name = "emptyLabel"; - this.emptyLabel.Size = new System.Drawing.Size(109, 13); - this.emptyLabel.TabIndex = 8; - this.emptyLabel.Text = "Tank empty threshold"; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(186, 149); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(24, 13); - this.label4.TabIndex = 15; - this.label4.Text = "sec"; - // - // drainTimeTextBox - // - this.drainTimeTextBox.Enabled = false; - this.drainTimeTextBox.Location = new System.Drawing.Point(137, 146); - this.drainTimeTextBox.Name = "drainTimeTextBox"; - this.drainTimeTextBox.Size = new System.Drawing.Size(43, 20); - this.drainTimeTextBox.TabIndex = 14; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(26, 149); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(54, 13); - this.label5.TabIndex = 13; - this.label5.Text = "Drain time"; - // - // formatTextBox - // - this.formatTextBox.Enabled = false; - this.formatTextBox.Location = new System.Drawing.Point(137, 49); - this.formatTextBox.Name = "formatTextBox"; - this.formatTextBox.Size = new System.Drawing.Size(43, 20); - this.formatTextBox.TabIndex = 4; - // - // formatLabel - // - this.formatLabel.AutoSize = true; - this.formatLabel.Location = new System.Drawing.Point(26, 52); - this.formatLabel.Name = "formatLabel"; - this.formatLabel.Size = new System.Drawing.Size(76, 13); - this.formatLabel.TabIndex = 3; - this.formatLabel.Text = "Decimal points"; - // - // drainValveComboBox - // - this.drainValveComboBox.Enabled = false; - this.drainValveComboBox.FormattingEnabled = true; - this.drainValveComboBox.Location = new System.Drawing.Point(137, 123); - this.drainValveComboBox.Name = "drainValveComboBox"; - this.drainValveComboBox.Size = new System.Drawing.Size(143, 21); - this.drainValveComboBox.TabIndex = 12; - // - // drainingValveLabel - // - this.drainingValveLabel.AutoSize = true; - this.drainingValveLabel.Location = new System.Drawing.Point(26, 126); - this.drainingValveLabel.Name = "drainingValveLabel"; - this.drainingValveLabel.Size = new System.Drawing.Size(61, 13); - this.drainingValveLabel.TabIndex = 11; - this.drainingValveLabel.Text = "Drain valve"; - // - // BalanceCfgCtrl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - 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(300, 250); - this.Load += new System.EventHandler(this.BalanceCfgCtrl_Load); - this.ResumeLayout(false); - this.PerformLayout(); + this.handshakeComboBox = new System.Windows.Forms.ComboBox(); + this.stopBitsComboBox = new System.Windows.Forms.ComboBox(); + this.parityComboBox = new System.Windows.Forms.ComboBox(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.handshakeLabel = new System.Windows.Forms.Label(); + this.stopBitsLabel = new System.Windows.Forms.Label(); + this.dataBitsTextBox = new System.Windows.Forms.TextBox(); + this.dataBitsLabel = new System.Windows.Forms.Label(); + this.partityLabel = new System.Windows.Forms.Label(); + this.baudRateTextBox = new System.Windows.Forms.TextBox(); + this.baudRateLabel = new System.Windows.Forms.Label(); + this.comPortNrTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.capacityLabel = new System.Windows.Forms.Label(); + this.capacityTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.emptyTextBox = new System.Windows.Forms.TextBox(); + this.emptyLabel = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.drainTimeTextBox = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.formatTextBox = new System.Windows.Forms.TextBox(); + this.formatLabel = new System.Windows.Forms.Label(); + this.drainValveComboBox = new System.Windows.Forms.ComboBox(); + this.drainingValveLabel = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.emptyUpTextBox = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // handshakeComboBox + // + this.handshakeComboBox.Enabled = false; + this.handshakeComboBox.FormattingEnabled = true; + this.handshakeComboBox.Location = new System.Drawing.Point(236, 222); + this.handshakeComboBox.Name = "handshakeComboBox"; + this.handshakeComboBox.Size = new System.Drawing.Size(43, 21); + this.handshakeComboBox.TabIndex = 29; + // + // stopBitsComboBox + // + this.stopBitsComboBox.Enabled = false; + this.stopBitsComboBox.FormattingEnabled = true; + this.stopBitsComboBox.Location = new System.Drawing.Point(236, 200); + this.stopBitsComboBox.Name = "stopBitsComboBox"; + this.stopBitsComboBox.Size = new System.Drawing.Size(43, 21); + this.stopBitsComboBox.TabIndex = 27; + // + // parityComboBox + // + this.parityComboBox.Enabled = false; + this.parityComboBox.FormattingEnabled = true; + this.parityComboBox.Location = new System.Drawing.Point(100, 222); + this.parityComboBox.Name = "parityComboBox"; + this.parityComboBox.Size = new System.Drawing.Size(43, 21); + this.parityComboBox.TabIndex = 23; + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(137, 27); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(142, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(26, 30); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(134, 9); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(89, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComponentName"; + // + // handshakeLabel + // + this.handshakeLabel.AutoSize = true; + this.handshakeLabel.Location = new System.Drawing.Point(162, 225); + this.handshakeLabel.Name = "handshakeLabel"; + this.handshakeLabel.Size = new System.Drawing.Size(62, 13); + this.handshakeLabel.TabIndex = 28; + this.handshakeLabel.Text = "Handshake"; + // + // stopBitsLabel + // + this.stopBitsLabel.AutoSize = true; + this.stopBitsLabel.Location = new System.Drawing.Point(162, 203); + this.stopBitsLabel.Name = "stopBitsLabel"; + this.stopBitsLabel.Size = new System.Drawing.Size(49, 13); + this.stopBitsLabel.TabIndex = 26; + this.stopBitsLabel.Text = "Stop Bits"; + // + // dataBitsTextBox + // + this.dataBitsTextBox.Enabled = false; + this.dataBitsTextBox.Location = new System.Drawing.Point(236, 178); + this.dataBitsTextBox.Name = "dataBitsTextBox"; + this.dataBitsTextBox.Size = new System.Drawing.Size(43, 20); + this.dataBitsTextBox.TabIndex = 25; + // + // dataBitsLabel + // + this.dataBitsLabel.AutoSize = true; + this.dataBitsLabel.Location = new System.Drawing.Point(162, 181); + this.dataBitsLabel.Name = "dataBitsLabel"; + this.dataBitsLabel.Size = new System.Drawing.Size(50, 13); + this.dataBitsLabel.TabIndex = 24; + this.dataBitsLabel.Text = "Data Bits"; + // + // partityLabel + // + this.partityLabel.AutoSize = true; + this.partityLabel.Location = new System.Drawing.Point(26, 225); + this.partityLabel.Name = "partityLabel"; + this.partityLabel.Size = new System.Drawing.Size(33, 13); + this.partityLabel.TabIndex = 22; + this.partityLabel.Text = "Parity"; + // + // baudRateTextBox + // + this.baudRateTextBox.Enabled = false; + this.baudRateTextBox.Location = new System.Drawing.Point(100, 200); + this.baudRateTextBox.Name = "baudRateTextBox"; + this.baudRateTextBox.Size = new System.Drawing.Size(43, 20); + this.baudRateTextBox.TabIndex = 21; + // + // baudRateLabel + // + this.baudRateLabel.AutoSize = true; + this.baudRateLabel.Location = new System.Drawing.Point(26, 203); + this.baudRateLabel.Name = "baudRateLabel"; + this.baudRateLabel.Size = new System.Drawing.Size(53, 13); + this.baudRateLabel.TabIndex = 20; + this.baudRateLabel.Text = "Baud rate"; + // + // comPortNrTextBox + // + this.comPortNrTextBox.Enabled = false; + this.comPortNrTextBox.Location = new System.Drawing.Point(100, 178); + this.comPortNrTextBox.Name = "comPortNrTextBox"; + this.comPortNrTextBox.Size = new System.Drawing.Size(43, 20); + this.comPortNrTextBox.TabIndex = 19; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(26, 181); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(67, 13); + this.label1.TabIndex = 18; + this.label1.Text = "Serial port #:"; + // + // capacityLabel + // + this.capacityLabel.AutoSize = true; + this.capacityLabel.Location = new System.Drawing.Point(26, 82); + this.capacityLabel.Name = "capacityLabel"; + this.capacityLabel.Size = new System.Drawing.Size(75, 13); + this.capacityLabel.TabIndex = 5; + this.capacityLabel.Text = "Tank capacity"; + // + // capacityTextBox + // + this.capacityTextBox.Enabled = false; + this.capacityTextBox.Location = new System.Drawing.Point(137, 79); + this.capacityTextBox.Name = "capacityTextBox"; + this.capacityTextBox.Size = new System.Drawing.Size(43, 20); + this.capacityTextBox.TabIndex = 6; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(186, 82); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(19, 13); + this.label2.TabIndex = 7; + this.label2.Text = "kg"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(186, 104); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(19, 13); + this.label3.TabIndex = 10; + this.label3.Text = "kg"; + // + // emptyTextBox + // + this.emptyTextBox.Enabled = false; + this.emptyTextBox.Location = new System.Drawing.Point(137, 101); + this.emptyTextBox.Name = "emptyTextBox"; + this.emptyTextBox.Size = new System.Drawing.Size(43, 20); + this.emptyTextBox.TabIndex = 9; + // + // emptyLabel + // + this.emptyLabel.AutoSize = true; + this.emptyLabel.Location = new System.Drawing.Point(26, 104); + this.emptyLabel.Name = "emptyLabel"; + this.emptyLabel.Size = new System.Drawing.Size(109, 13); + this.emptyLabel.TabIndex = 8; + this.emptyLabel.Text = "Tank empty threshold"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(186, 149); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(24, 13); + this.label4.TabIndex = 17; + this.label4.Text = "sec"; + // + // drainTimeTextBox + // + this.drainTimeTextBox.Enabled = false; + this.drainTimeTextBox.Location = new System.Drawing.Point(137, 146); + this.drainTimeTextBox.Name = "drainTimeTextBox"; + this.drainTimeTextBox.Size = new System.Drawing.Size(43, 20); + this.drainTimeTextBox.TabIndex = 16; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(26, 149); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(54, 13); + this.label5.TabIndex = 15; + this.label5.Text = "Drain time"; + // + // formatTextBox + // + this.formatTextBox.Enabled = false; + this.formatTextBox.Location = new System.Drawing.Point(137, 49); + this.formatTextBox.Name = "formatTextBox"; + this.formatTextBox.Size = new System.Drawing.Size(43, 20); + this.formatTextBox.TabIndex = 4; + // + // formatLabel + // + this.formatLabel.AutoSize = true; + this.formatLabel.Location = new System.Drawing.Point(26, 52); + this.formatLabel.Name = "formatLabel"; + this.formatLabel.Size = new System.Drawing.Size(76, 13); + this.formatLabel.TabIndex = 3; + this.formatLabel.Text = "Decimal points"; + // + // drainValveComboBox + // + this.drainValveComboBox.Enabled = false; + this.drainValveComboBox.FormattingEnabled = true; + this.drainValveComboBox.Location = new System.Drawing.Point(137, 123); + this.drainValveComboBox.Name = "drainValveComboBox"; + this.drainValveComboBox.Size = new System.Drawing.Size(143, 21); + this.drainValveComboBox.TabIndex = 14; + // + // drainingValveLabel + // + this.drainingValveLabel.AutoSize = true; + this.drainingValveLabel.Location = new System.Drawing.Point(26, 126); + this.drainingValveLabel.Name = "drainingValveLabel"; + this.drainingValveLabel.Size = new System.Drawing.Size(61, 13); + this.drainingValveLabel.TabIndex = 13; + this.drainingValveLabel.Text = "Drain valve"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(285, 104); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(19, 13); + this.label6.TabIndex = 12; + this.label6.Text = "kg"; + // + // emptyUpTextBox + // + this.emptyUpTextBox.Enabled = false; + this.emptyUpTextBox.Location = new System.Drawing.Point(236, 101); + this.emptyUpTextBox.Name = "emptyUpTextBox"; + this.emptyUpTextBox.Size = new System.Drawing.Size(43, 20); + this.emptyUpTextBox.TabIndex = 11; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(225, 87); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(83, 13); + this.label7.TabIndex = 30; + this.label7.Text = "not draining (up)"; + // + // BalanceCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.emptyUpTextBox); + 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.ComboBox drainValveComboBox; private System.Windows.Forms.Label drainingValveLabel; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox emptyUpTextBox; + private System.Windows.Forms.Label label7; } } diff --git a/TBF/BenchControl/MettlerToledo/Standard/BalanceCfgCtrl.cs b/TBF/BenchControl/MettlerToledo/Standard/BalanceCfgCtrl.cs index c87a121ec..261b9ac16 100644 --- a/TBF/BenchControl/MettlerToledo/Standard/BalanceCfgCtrl.cs +++ b/TBF/BenchControl/MettlerToledo/Standard/BalanceCfgCtrl.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2017 Sensus Metering Systems +/// Copyright (c) 2013-2018 Sensus Slovensko a.s. /// using System; using System.Globalization; @@ -128,7 +128,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard nameTextBox.Text = config.Name; capacityTextBox.Text = config.Capacity.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(); drainValveComboBox.Text = string.IsNullOrEmpty(config.DrainValve) ? "---" : config.DrainValve; @@ -145,7 +146,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard nameTextBox.Enabled = true; capacityTextBox.Enabled = true; emptyTextBox.Enabled = true; - formatTextBox.Enabled = true; + emptyUpTextBox.Enabled = true; + formatTextBox.Enabled = true; drainTimeTextBox.Enabled = true; drainValveComboBox.Enabled = true; @@ -188,7 +190,12 @@ namespace TBF.BenchControl.MettlerToledo.Standard flags |= CfgUpdateFlags.Error; 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; 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.Capacity = Utils.ParseUFloat(capacityTextBox.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.DrainValve = drainValveComboBox.Text.Equals("---") ? string.Empty : drainValveComboBox.Text; diff --git a/TBF/BenchControl/MettlerToledo/Standard/BalanceDev.cs b/TBF/BenchControl/MettlerToledo/Standard/BalanceDev.cs index 6db28b6fa..3f79a8453 100644 --- a/TBF/BenchControl/MettlerToledo/Standard/BalanceDev.cs +++ b/TBF/BenchControl/MettlerToledo/Standard/BalanceDev.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2017 Sensus Metering Systems +/// Copyright (c) 2013-2018 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; @@ -123,12 +123,12 @@ namespace TBF.BenchControl.MettlerToledo.Standard public override bool IsEmpty() { - return (this.mass <= balanceCfg.Empty); + return DrainValve.State ? (mass <= balanceCfg.Empty) : (mass <= balanceCfg.EmptyUp); } public bool IsEmpty(double mass) { - return (mass <= balanceCfg.Empty); + return DrainValve.State ? (mass <= balanceCfg.Empty) : (mass <= balanceCfg.EmptyUp); } public void ZeroWhenStable() diff --git a/TBF/ComponentsManagerDlg.cs b/TBF/ComponentsManagerDlg.cs index bbb2d62e4..699b22212 100644 --- a/TBF/ComponentsManagerDlg.cs +++ b/TBF/ComponentsManagerDlg.cs @@ -642,23 +642,27 @@ namespace TBF (cfg as BenchControl.Elde.PressureMeter.PressureMeterCfg).Idx0 = zeroBasedIdx; 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) { (cfg as IChildComponentCfg).ParentName = "CB"; (cfg as BenchControl.Elde.RegulValve.RegulValveCfg).Idx1 = zeroBasedIdx + 1; 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) { (cfg as IChildComponentCfg).ParentName = "CB"; return true; } + else if (cfg is BenchControl.TestMethods.iPerlCommunication.iPerlHead.IperlHeadCfg) + { + return true; + } else if (cfg is BenchControl.WaterMeters.WaterMeter.WaterMeterCfg) { return true;