Support for FC protocol for Danfoss-VLT2800 and associated valve added - control part
This commit is contained in:
@@ -103,6 +103,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
||||
classNameLabel.Text = config.Factory.ClassName;
|
||||
nameTextBox.Text = config.Name;
|
||||
delayTextBox.Text = config.Delay.ToString();
|
||||
bitPositionTextBox.Text = config.BitPosition.ToString();
|
||||
protocolComboBox.Text = config.Protocol.ToString();
|
||||
busAddressTextBox.Text = config.BusAddress.ToString();
|
||||
comPortNrTextBox.Text = config.ComPortNr.ToString();
|
||||
@@ -116,6 +117,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
||||
{
|
||||
nameTextBox.Enabled = true;
|
||||
delayTextBox.Enabled = true;
|
||||
bitPositionTextBox.Enabled = true;
|
||||
protocolComboBox.Enabled = true;
|
||||
busAddressTextBox.Enabled = true;
|
||||
comPortNrTextBox.Enabled = true;
|
||||
@@ -133,6 +135,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
||||
|
||||
config.Name = nameTextBox.Text;
|
||||
config.Delay = int.Parse(delayTextBox.Text);
|
||||
config.BitPosition = int.Parse(bitPositionTextBox.Text);
|
||||
config.Protocol = protocolComboBox.Text.Equals(PumpProtocol.Modbus.ToString()) ? PumpProtocol.Modbus : PumpProtocol.FC;
|
||||
config.BusAddress = int.Parse(busAddressTextBox.Text);
|
||||
config.ComPortNr = int.Parse(comPortNrTextBox.Text);
|
||||
@@ -155,6 +158,12 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
||||
message += Environment.NewLine + "'Delay' is not valid";
|
||||
}
|
||||
|
||||
if (!int.TryParse(bitPositionTextBox.Text, out dummy) || dummy < 0 || dummy >= 64)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Bit Position' should be between 0 and 63";
|
||||
}
|
||||
|
||||
if (!protocolComboBox.Items.Contains(protocolComboBox.Text))
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
|
||||
Reference in New Issue
Block a user