(1) Network.Comet.Ambient clean-up, (2) Output.DB.SaveFlowmeterCorrections bug fix, ver. 2.18.822
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user