(1) Network.Comet.Ambient clean-up, (2) Output.DB.SaveFlowmeterCorrections bug fix, ver. 2.18.822
This commit is contained in:
parent
95a3d7def6
commit
fc8bf749a4
@ -22,7 +22,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
public override string ToString() { return string.Format("Ambient({0})", Cfg.ToString(1)); }
|
||||
|
||||
readonly AmbientCfg myCfg;
|
||||
readonly GenericDevices.INetworkAdapter netAdapter;
|
||||
readonly IPAddress ipAddress;
|
||||
readonly int tcpPort;
|
||||
|
||||
@ -65,9 +64,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
myCfg = cfg as AmbientCfg;
|
||||
if (myCfg == null) throw new ArgumentNullException("No configuration");
|
||||
|
||||
netAdapter = TbfComponents.FindComponent(cfg.ParentName, components) as GenericDevices.INetworkAdapter;
|
||||
if (netAdapter == null) throw new ArgumentNullException("No network adapter");
|
||||
|
||||
ipAddress = IPAddress.Parse(myCfg.IPAddress);
|
||||
tcpPort = myCfg.TcpPort;
|
||||
|
||||
@ -94,7 +90,7 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
state = State.Idle;
|
||||
msrmntState = MsrmntState.Busy;
|
||||
|
||||
log.FatalFormat("IP Address={0}, device {1}", netAdapter.IPAddress, this.ToString());
|
||||
log.FatalFormat("Initialization successful: {0}", this.ToString());
|
||||
}
|
||||
|
||||
/// <summary>Run this device</summary>
|
||||
|
||||
@ -8,7 +8,7 @@ using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
{
|
||||
public class AmbientCfg : ComponentCfgBase, IChildComponentCfg
|
||||
public class AmbientCfg : ComponentCfgBase, IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AmbientCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
@ -30,7 +30,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
{
|
||||
this.Name = name;
|
||||
this.Factory = factory;
|
||||
ParentName = string.Empty;
|
||||
IPAddress = "192.168.0.123";
|
||||
TcpPort = 502;
|
||||
SerialNr = string.Empty;
|
||||
@ -38,7 +37,7 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, Parent={1}, IP={2}, Port={3}, s/n={4}", Name, ParentName, IPAddress, TcpPort, SerialNr);
|
||||
return string.Format("Name={0}, IP={1}, Port={2}, s/n={3}", Name, IPAddress, TcpPort, SerialNr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,8 +36,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
this.classNameLabel = new System.Windows.Forms.Label();
|
||||
this.serialNrTextBox = new System.Windows.Forms.TextBox();
|
||||
this.serialNrLabel = new System.Windows.Forms.Label();
|
||||
this.parentNameComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.parentNameLabel = new System.Windows.Forms.Label();
|
||||
this.ipAddressLabel = new System.Windows.Forms.Label();
|
||||
this.ipAddressTextBox = new System.Windows.Forms.TextBox();
|
||||
this.tcpPortTextBox = new System.Windows.Forms.TextBox();
|
||||
@ -73,7 +71,7 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
// serialNrTextBox
|
||||
//
|
||||
this.serialNrTextBox.Enabled = false;
|
||||
this.serialNrTextBox.Location = new System.Drawing.Point(140, 148);
|
||||
this.serialNrTextBox.Location = new System.Drawing.Point(140, 121);
|
||||
this.serialNrTextBox.Name = "serialNrTextBox";
|
||||
this.serialNrTextBox.Size = new System.Drawing.Size(130, 20);
|
||||
this.serialNrTextBox.TabIndex = 10;
|
||||
@ -81,34 +79,16 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
// serialNrLabel
|
||||
//
|
||||
this.serialNrLabel.AutoSize = true;
|
||||
this.serialNrLabel.Location = new System.Drawing.Point(36, 151);
|
||||
this.serialNrLabel.Location = new System.Drawing.Point(36, 124);
|
||||
this.serialNrLabel.Name = "serialNrLabel";
|
||||
this.serialNrLabel.Size = new System.Drawing.Size(71, 13);
|
||||
this.serialNrLabel.TabIndex = 9;
|
||||
this.serialNrLabel.Text = "Serial number";
|
||||
//
|
||||
// parentNameComboBox
|
||||
//
|
||||
this.parentNameComboBox.Enabled = false;
|
||||
this.parentNameComboBox.FormattingEnabled = true;
|
||||
this.parentNameComboBox.Location = new System.Drawing.Point(140, 69);
|
||||
this.parentNameComboBox.Name = "parentNameComboBox";
|
||||
this.parentNameComboBox.Size = new System.Drawing.Size(130, 21);
|
||||
this.parentNameComboBox.TabIndex = 4;
|
||||
//
|
||||
// parentNameLabel
|
||||
//
|
||||
this.parentNameLabel.AutoSize = true;
|
||||
this.parentNameLabel.Location = new System.Drawing.Point(36, 72);
|
||||
this.parentNameLabel.Name = "parentNameLabel";
|
||||
this.parentNameLabel.Size = new System.Drawing.Size(67, 13);
|
||||
this.parentNameLabel.TabIndex = 3;
|
||||
this.parentNameLabel.Text = "Parent name";
|
||||
//
|
||||
// ipAddressLabel
|
||||
//
|
||||
this.ipAddressLabel.AutoSize = true;
|
||||
this.ipAddressLabel.Location = new System.Drawing.Point(36, 99);
|
||||
this.ipAddressLabel.Location = new System.Drawing.Point(36, 72);
|
||||
this.ipAddressLabel.Name = "ipAddressLabel";
|
||||
this.ipAddressLabel.Size = new System.Drawing.Size(58, 13);
|
||||
this.ipAddressLabel.TabIndex = 5;
|
||||
@ -117,7 +97,7 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
// ipAddressTextBox
|
||||
//
|
||||
this.ipAddressTextBox.Enabled = false;
|
||||
this.ipAddressTextBox.Location = new System.Drawing.Point(140, 96);
|
||||
this.ipAddressTextBox.Location = new System.Drawing.Point(140, 69);
|
||||
this.ipAddressTextBox.Name = "ipAddressTextBox";
|
||||
this.ipAddressTextBox.Size = new System.Drawing.Size(130, 20);
|
||||
this.ipAddressTextBox.TabIndex = 6;
|
||||
@ -125,7 +105,7 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
// tcpPortTextBox
|
||||
//
|
||||
this.tcpPortTextBox.Enabled = false;
|
||||
this.tcpPortTextBox.Location = new System.Drawing.Point(140, 122);
|
||||
this.tcpPortTextBox.Location = new System.Drawing.Point(140, 95);
|
||||
this.tcpPortTextBox.Name = "tcpPortTextBox";
|
||||
this.tcpPortTextBox.Size = new System.Drawing.Size(130, 20);
|
||||
this.tcpPortTextBox.TabIndex = 8;
|
||||
@ -133,7 +113,7 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
// tcpPortLabel
|
||||
//
|
||||
this.tcpPortLabel.AutoSize = true;
|
||||
this.tcpPortLabel.Location = new System.Drawing.Point(36, 125);
|
||||
this.tcpPortLabel.Location = new System.Drawing.Point(36, 98);
|
||||
this.tcpPortLabel.Name = "tcpPortLabel";
|
||||
this.tcpPortLabel.Size = new System.Drawing.Size(65, 13);
|
||||
this.tcpPortLabel.TabIndex = 7;
|
||||
@ -150,8 +130,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
this.Controls.Add(this.ipAddressLabel);
|
||||
this.Controls.Add(this.serialNrTextBox);
|
||||
this.Controls.Add(this.serialNrLabel);
|
||||
this.Controls.Add(this.parentNameComboBox);
|
||||
this.Controls.Add(this.parentNameLabel);
|
||||
this.Controls.Add(this.nameTextBox);
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
@ -170,8 +148,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
private System.Windows.Forms.Label classNameLabel;
|
||||
private System.Windows.Forms.TextBox serialNrTextBox;
|
||||
private System.Windows.Forms.Label serialNrLabel;
|
||||
private System.Windows.Forms.ComboBox parentNameComboBox;
|
||||
private System.Windows.Forms.Label parentNameLabel;
|
||||
private System.Windows.Forms.Label ipAddressLabel;
|
||||
private System.Windows.Forms.TextBox ipAddressTextBox;
|
||||
private System.Windows.Forms.TextBox tcpPortTextBox;
|
||||
|
||||
@ -14,8 +14,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(AmbientCfgCtrl));
|
||||
|
||||
ComponentParametersDlg parent;
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
AmbientCfg config;
|
||||
@ -37,29 +35,12 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
private void AbbientCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
parent = ParentForm as ComponentParametersDlg;
|
||||
if (parent == null) return;
|
||||
|
||||
if (parent.TbfComponents != null)
|
||||
{
|
||||
parentNameComboBox.Items.Add("---");
|
||||
foreach (var cmpnt in parent.TbfComponents)
|
||||
{
|
||||
if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is TBF.BenchControl.Network.Adapter.Factory)
|
||||
{
|
||||
parentNameComboBox.Items.Add(cmpnt.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Redraw();
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
nameLabel.Text = Strings.Name;
|
||||
parentNameLabel.Text = Strings.Parent_name;
|
||||
serialNrLabel.Text = Strings.Serial_Number;
|
||||
}
|
||||
|
||||
@ -73,7 +54,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
|
||||
classNameLabel.Text = config.Factory.ClassName;
|
||||
nameTextBox.Text = config.Name;
|
||||
parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName;
|
||||
ipAddressTextBox.Text = config.IPAddress != null ? config.IPAddress.ToString() : "192.168.0.123";
|
||||
tcpPortTextBox.Text = config.TcpPort.ToString();
|
||||
serialNrTextBox.Text = config.SerialNr.ToString();
|
||||
@ -82,7 +62,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
public void Unlock()
|
||||
{
|
||||
nameTextBox.Enabled = true;
|
||||
parentNameComboBox.Enabled = true;
|
||||
ipAddressTextBox.Enabled = true;
|
||||
tcpPortTextBox.Enabled = true;
|
||||
serialNrTextBox.Enabled = true;
|
||||
@ -92,12 +71,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
|
||||
if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text))
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + string.Format(Strings.Invalid_0, parentNameLabel.Text);
|
||||
}
|
||||
|
||||
IPAddress ip;
|
||||
if (!IPAddress.TryParse(ipAddressTextBox.Text, out ip))
|
||||
{
|
||||
@ -121,16 +94,12 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
|
||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
|
||||
string newParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text;
|
||||
|
||||
if (config.Name != nameTextBox.Text ||
|
||||
config.ParentName != newParentName ||
|
||||
config.IPAddress != ipAddressTextBox.Text ||
|
||||
config.TcpPort.ToString() != tcpPortTextBox.Text ||
|
||||
config.SerialNr != serialNrTextBox.Text)
|
||||
{
|
||||
config.Name = nameTextBox.Text;
|
||||
config.ParentName = newParentName;
|
||||
config.IPAddress = ipAddressTextBox.Text;
|
||||
config.TcpPort = int.Parse(tcpPortTextBox.Text);
|
||||
config.SerialNr = serialNrTextBox.Text;
|
||||
|
||||
@ -80,7 +80,8 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
|
||||
{
|
||||
float testTempLimLo = tr.TempLimLo();
|
||||
float testTempLimHi = tr.TempLimHi();
|
||||
if (tr.Components.Flowmeter == flowmeterName && tr.Evaluate() && testTempLimLo >= tempRngLo && testTempLimHi <= tempRngHi)
|
||||
if (tr.TestDone && tr.Components != null && tr.Components.Flowmeter == flowmeterName && tr.Evaluate() && testTempLimLo >= tempRngLo
|
||||
&& testTempLimHi <= tempRngHi)
|
||||
{
|
||||
double correction = BenchControl.Formulas.CorrectionFromError(tr.FlowMean, tr.ErrorMaster);
|
||||
rslt.Add(new MeasurementCorrection { RangeIx = rngIx, Measurement = tr.FlowMean, Correction = (float)correction });
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.18.821.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.821.0")]
|
||||
[assembly: AssemblyVersion("2.18.822.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.822.0")]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user