Support for FC protocol for Danfoss-VLT2800 and associated valve added - control part
This commit is contained in:
parent
abd636b137
commit
93fd6a4f42
@ -108,8 +108,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
|||||||
controlBoard = (Elde.ControlBoardDev)TbfComponents.FindComponent("CB", components); /// TODO: replace "CB"
|
controlBoard = (Elde.ControlBoardDev)TbfComponents.FindComponent("CB", components); /// TODO: replace "CB"
|
||||||
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
|
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
|
||||||
|
|
||||||
//bitPosition = pumpCfg.BitPosition;
|
bitPosition = pumpCfg.BitPosition;
|
||||||
bitPosition = 55; /// TODO: replace 55
|
|
||||||
Mask = (((ulong)1) << bitPosition);
|
Mask = (((ulong)1) << bitPosition);
|
||||||
|
|
||||||
log.Debug(this.ToString());
|
log.Debug(this.ToString());
|
||||||
@ -200,21 +199,35 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
|||||||
|
|
||||||
UInt16 serialComReference = (UInt16)(Int16)((float)0x4000 * powerArg / 100.0f + 0.5f);
|
UInt16 serialComReference = (UInt16)(Int16)((float)0x4000 * powerArg / 100.0f + 0.5f);
|
||||||
|
|
||||||
byte[] msg = new byte[13];
|
byte[] msg;
|
||||||
msg[0] = (byte)pumpCfg.BusAddress;
|
if (pumpCfg.Protocol == PumpProtocol.Modbus)
|
||||||
msg[1] = (byte)Function.ForceMultipleCoils;
|
{
|
||||||
msg[2] = 0; /// Data Hi
|
msg = new byte[13];
|
||||||
msg[3] = 0; /// Data Lo
|
msg[0] = (byte)pumpCfg.BusAddress;
|
||||||
msg[4] = 0; /// Nr. of coils Hi
|
msg[1] = (byte)Function.ForceMultipleCoils;
|
||||||
msg[5] = 0x20; /// Nr. of coils Lo
|
msg[2] = 0; /// Data Hi
|
||||||
msg[6] = 4; /// Byte count
|
msg[3] = 0; /// Data Lo
|
||||||
msg[7] = (byte)(controlWord & 0xFF); /// Control Word Lo
|
msg[4] = 0; /// Nr. of coils Hi
|
||||||
msg[8] = (byte)(controlWord >> 8); /// Control Word Hi
|
msg[5] = 0x20; /// Nr. of coils Lo
|
||||||
msg[9] = (byte)(serialComReference & 0xFF); /// Serial Com Reference Lo
|
msg[6] = 4; /// Byte count
|
||||||
msg[10] = (byte)(serialComReference >> 8); /// Serial Com Reference Hi
|
msg[7] = (byte)(controlWord & 0xFF); /// Control Word Lo
|
||||||
|
msg[8] = (byte)(controlWord >> 8); /// Control Word Hi
|
||||||
Telegram.UpdateTelegramCRC(msg);
|
msg[9] = (byte)(serialComReference & 0xFF); /// Serial Com Reference Lo
|
||||||
|
msg[10] = (byte)(serialComReference >> 8); /// Serial Com Reference Hi
|
||||||
|
Telegram.UpdateTelegramCRC(msg);
|
||||||
|
}
|
||||||
|
else /// if (pumpCfg.Protocol == PumpProtocol.FC)
|
||||||
|
{
|
||||||
|
msg = new byte[8];
|
||||||
|
msg[0] = 0x02; /// STX
|
||||||
|
msg[1] = 6; /// lenght (6 bytes following this one)
|
||||||
|
msg[2] = (byte)pumpCfg.BusAddress;
|
||||||
|
msg[3] = (byte)(controlWord >> 8); /// Control Word Hi
|
||||||
|
msg[4] = (byte)(controlWord & 0xFF); /// Control Word Lo
|
||||||
|
msg[5] = (byte)(serialComReference >> 8); /// Serial Com Reference Hi
|
||||||
|
msg[6] = (byte)(serialComReference & 0xFF); /// Serial Com Reference Lo
|
||||||
|
Telegram.UpdateTelegramChecksum(msg);
|
||||||
|
}
|
||||||
SendData(msg);
|
SendData(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,21 +248,35 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
|||||||
|
|
||||||
UInt16 serialComReference = 0;
|
UInt16 serialComReference = 0;
|
||||||
|
|
||||||
byte[] msg = new byte[13];
|
byte[] msg;
|
||||||
msg[0] = (byte)pumpCfg.BusAddress;
|
if (pumpCfg.Protocol == PumpProtocol.Modbus)
|
||||||
msg[1] = (byte)Function.ForceMultipleCoils;
|
{
|
||||||
msg[2] = 0; /// Data Hi
|
msg = new byte[13];
|
||||||
msg[3] = 0; /// Data Lo
|
msg[0] = (byte)pumpCfg.BusAddress;
|
||||||
msg[4] = 0; /// Nr. of coils Hi
|
msg[1] = (byte)Function.ForceMultipleCoils;
|
||||||
msg[5] = 0x20; /// Nr. of coils Lo
|
msg[2] = 0; /// Data Hi
|
||||||
msg[6] = 4; /// Byte count
|
msg[3] = 0; /// Data Lo
|
||||||
msg[7] = (byte)(controlWord & 0xFF); /// Control Word Lo
|
msg[4] = 0; /// Nr. of coils Hi
|
||||||
msg[8] = (byte)(controlWord >> 8); /// Control Word Hi
|
msg[5] = 0x20; /// Nr. of coils Lo
|
||||||
msg[9] = (byte)(serialComReference & 0xFF); /// Serial Com Reference Lo
|
msg[6] = 4; /// Byte count
|
||||||
msg[10] = (byte)(serialComReference >> 8); /// Serial Com Reference Hi
|
msg[7] = (byte)(controlWord & 0xFF); /// Control Word Lo
|
||||||
|
msg[8] = (byte)(controlWord >> 8); /// Control Word Hi
|
||||||
Telegram.UpdateTelegramCRC(msg);
|
msg[9] = (byte)(serialComReference & 0xFF); /// Serial Com Reference Lo
|
||||||
|
msg[10] = (byte)(serialComReference >> 8); /// Serial Com Reference Hi
|
||||||
|
Telegram.UpdateTelegramCRC(msg);
|
||||||
|
}
|
||||||
|
else /// if (pumpCfg.Protocol == PumpProtocol.FC)
|
||||||
|
{
|
||||||
|
msg = new byte[8];
|
||||||
|
msg[0] = 0x02; /// STX
|
||||||
|
msg[1] = 6; /// lenght (6 bytes following this one)
|
||||||
|
msg[2] = (byte)pumpCfg.BusAddress;
|
||||||
|
msg[3] = (byte)(controlWord >> 8); /// Control Word Hi
|
||||||
|
msg[4] = (byte)(controlWord & 0xFF); /// Control Word Lo
|
||||||
|
msg[5] = (byte)(serialComReference >> 8); /// Serial Com Reference Hi
|
||||||
|
msg[6] = (byte)(serialComReference & 0xFF); /// Serial Com Reference Lo
|
||||||
|
Telegram.UpdateTelegramChecksum(msg);
|
||||||
|
}
|
||||||
SendData(msg);
|
SendData(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
|||||||
///
|
///
|
||||||
public int Delay; // Delay of the pump function in [s] (affects the duration of transition sequence steps)
|
public int Delay; // Delay of the pump function in [s] (affects the duration of transition sequence steps)
|
||||||
public PumpProtocol Protocol; // Modbus or FC
|
public PumpProtocol Protocol; // Modbus or FC
|
||||||
|
public int BitPosition;
|
||||||
public int BusAddress; // Modbus or FC address in range 1..247 (Modbus) or 1..31 (FC)
|
public int BusAddress; // Modbus or FC address in range 1..247 (Modbus) or 1..31 (FC)
|
||||||
public int ComPortNr;
|
public int ComPortNr;
|
||||||
public int BaudRate;
|
public int BaudRate;
|
||||||
|
|||||||
@ -103,6 +103,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
|||||||
classNameLabel.Text = config.Factory.ClassName;
|
classNameLabel.Text = config.Factory.ClassName;
|
||||||
nameTextBox.Text = config.Name;
|
nameTextBox.Text = config.Name;
|
||||||
delayTextBox.Text = config.Delay.ToString();
|
delayTextBox.Text = config.Delay.ToString();
|
||||||
|
bitPositionTextBox.Text = config.BitPosition.ToString();
|
||||||
protocolComboBox.Text = config.Protocol.ToString();
|
protocolComboBox.Text = config.Protocol.ToString();
|
||||||
busAddressTextBox.Text = config.BusAddress.ToString();
|
busAddressTextBox.Text = config.BusAddress.ToString();
|
||||||
comPortNrTextBox.Text = config.ComPortNr.ToString();
|
comPortNrTextBox.Text = config.ComPortNr.ToString();
|
||||||
@ -116,6 +117,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
|||||||
{
|
{
|
||||||
nameTextBox.Enabled = true;
|
nameTextBox.Enabled = true;
|
||||||
delayTextBox.Enabled = true;
|
delayTextBox.Enabled = true;
|
||||||
|
bitPositionTextBox.Enabled = true;
|
||||||
protocolComboBox.Enabled = true;
|
protocolComboBox.Enabled = true;
|
||||||
busAddressTextBox.Enabled = true;
|
busAddressTextBox.Enabled = true;
|
||||||
comPortNrTextBox.Enabled = true;
|
comPortNrTextBox.Enabled = true;
|
||||||
@ -133,6 +135,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
|||||||
|
|
||||||
config.Name = nameTextBox.Text;
|
config.Name = nameTextBox.Text;
|
||||||
config.Delay = int.Parse(delayTextBox.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.Protocol = protocolComboBox.Text.Equals(PumpProtocol.Modbus.ToString()) ? PumpProtocol.Modbus : PumpProtocol.FC;
|
||||||
config.BusAddress = int.Parse(busAddressTextBox.Text);
|
config.BusAddress = int.Parse(busAddressTextBox.Text);
|
||||||
config.ComPortNr = int.Parse(comPortNrTextBox.Text);
|
config.ComPortNr = int.Parse(comPortNrTextBox.Text);
|
||||||
@ -155,6 +158,12 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
|||||||
message += Environment.NewLine + "'Delay' is not valid";
|
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))
|
if (!protocolComboBox.Items.Contains(protocolComboBox.Text))
|
||||||
{
|
{
|
||||||
flags |= CfgUpdateFlags.Error;
|
flags |= CfgUpdateFlags.Error;
|
||||||
|
|||||||
@ -47,12 +47,14 @@
|
|||||||
this.delayLabel = new System.Windows.Forms.Label();
|
this.delayLabel = new System.Windows.Forms.Label();
|
||||||
this.protocolLabel = new System.Windows.Forms.Label();
|
this.protocolLabel = new System.Windows.Forms.Label();
|
||||||
this.protocolComboBox = new System.Windows.Forms.ComboBox();
|
this.protocolComboBox = new System.Windows.Forms.ComboBox();
|
||||||
|
this.bitPositionTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.bitPositionLabel = new System.Windows.Forms.Label();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// comPortNrTextBox
|
// comPortNrTextBox
|
||||||
//
|
//
|
||||||
this.comPortNrTextBox.Enabled = false;
|
this.comPortNrTextBox.Enabled = false;
|
||||||
this.comPortNrTextBox.Location = new System.Drawing.Point(140, 125);
|
this.comPortNrTextBox.Location = new System.Drawing.Point(140, 129);
|
||||||
this.comPortNrTextBox.Name = "comPortNrTextBox";
|
this.comPortNrTextBox.Name = "comPortNrTextBox";
|
||||||
this.comPortNrTextBox.Size = new System.Drawing.Size(34, 20);
|
this.comPortNrTextBox.Size = new System.Drawing.Size(34, 20);
|
||||||
this.comPortNrTextBox.TabIndex = 6;
|
this.comPortNrTextBox.TabIndex = 6;
|
||||||
@ -60,7 +62,7 @@
|
|||||||
// label1
|
// label1
|
||||||
//
|
//
|
||||||
this.label1.AutoSize = true;
|
this.label1.AutoSize = true;
|
||||||
this.label1.Location = new System.Drawing.Point(29, 128);
|
this.label1.Location = new System.Drawing.Point(29, 132);
|
||||||
this.label1.Name = "label1";
|
this.label1.Name = "label1";
|
||||||
this.label1.Size = new System.Drawing.Size(98, 13);
|
this.label1.Size = new System.Drawing.Size(98, 13);
|
||||||
this.label1.TabIndex = 5;
|
this.label1.TabIndex = 5;
|
||||||
@ -69,7 +71,7 @@
|
|||||||
// baudRateLabel
|
// baudRateLabel
|
||||||
//
|
//
|
||||||
this.baudRateLabel.AutoSize = true;
|
this.baudRateLabel.AutoSize = true;
|
||||||
this.baudRateLabel.Location = new System.Drawing.Point(29, 150);
|
this.baudRateLabel.Location = new System.Drawing.Point(29, 153);
|
||||||
this.baudRateLabel.Name = "baudRateLabel";
|
this.baudRateLabel.Name = "baudRateLabel";
|
||||||
this.baudRateLabel.Size = new System.Drawing.Size(58, 13);
|
this.baudRateLabel.Size = new System.Drawing.Size(58, 13);
|
||||||
this.baudRateLabel.TabIndex = 7;
|
this.baudRateLabel.TabIndex = 7;
|
||||||
@ -78,7 +80,7 @@
|
|||||||
// baudRateTextBox
|
// baudRateTextBox
|
||||||
//
|
//
|
||||||
this.baudRateTextBox.Enabled = false;
|
this.baudRateTextBox.Enabled = false;
|
||||||
this.baudRateTextBox.Location = new System.Drawing.Point(140, 147);
|
this.baudRateTextBox.Location = new System.Drawing.Point(140, 150);
|
||||||
this.baudRateTextBox.Name = "baudRateTextBox";
|
this.baudRateTextBox.Name = "baudRateTextBox";
|
||||||
this.baudRateTextBox.Size = new System.Drawing.Size(130, 20);
|
this.baudRateTextBox.Size = new System.Drawing.Size(130, 20);
|
||||||
this.baudRateTextBox.TabIndex = 8;
|
this.baudRateTextBox.TabIndex = 8;
|
||||||
@ -86,7 +88,7 @@
|
|||||||
// partityLabel
|
// partityLabel
|
||||||
//
|
//
|
||||||
this.partityLabel.AutoSize = true;
|
this.partityLabel.AutoSize = true;
|
||||||
this.partityLabel.Location = new System.Drawing.Point(29, 172);
|
this.partityLabel.Location = new System.Drawing.Point(29, 174);
|
||||||
this.partityLabel.Name = "partityLabel";
|
this.partityLabel.Name = "partityLabel";
|
||||||
this.partityLabel.Size = new System.Drawing.Size(33, 13);
|
this.partityLabel.Size = new System.Drawing.Size(33, 13);
|
||||||
this.partityLabel.TabIndex = 9;
|
this.partityLabel.TabIndex = 9;
|
||||||
@ -95,7 +97,7 @@
|
|||||||
// dataBitsLabel
|
// dataBitsLabel
|
||||||
//
|
//
|
||||||
this.dataBitsLabel.AutoSize = true;
|
this.dataBitsLabel.AutoSize = true;
|
||||||
this.dataBitsLabel.Location = new System.Drawing.Point(29, 195);
|
this.dataBitsLabel.Location = new System.Drawing.Point(29, 196);
|
||||||
this.dataBitsLabel.Name = "dataBitsLabel";
|
this.dataBitsLabel.Name = "dataBitsLabel";
|
||||||
this.dataBitsLabel.Size = new System.Drawing.Size(50, 13);
|
this.dataBitsLabel.Size = new System.Drawing.Size(50, 13);
|
||||||
this.dataBitsLabel.TabIndex = 11;
|
this.dataBitsLabel.TabIndex = 11;
|
||||||
@ -104,7 +106,7 @@
|
|||||||
// dataBitsTextBox
|
// dataBitsTextBox
|
||||||
//
|
//
|
||||||
this.dataBitsTextBox.Enabled = false;
|
this.dataBitsTextBox.Enabled = false;
|
||||||
this.dataBitsTextBox.Location = new System.Drawing.Point(140, 192);
|
this.dataBitsTextBox.Location = new System.Drawing.Point(140, 193);
|
||||||
this.dataBitsTextBox.Name = "dataBitsTextBox";
|
this.dataBitsTextBox.Name = "dataBitsTextBox";
|
||||||
this.dataBitsTextBox.Size = new System.Drawing.Size(34, 20);
|
this.dataBitsTextBox.Size = new System.Drawing.Size(34, 20);
|
||||||
this.dataBitsTextBox.TabIndex = 12;
|
this.dataBitsTextBox.TabIndex = 12;
|
||||||
@ -121,7 +123,7 @@
|
|||||||
// busAddressLabel
|
// busAddressLabel
|
||||||
//
|
//
|
||||||
this.busAddressLabel.AutoSize = true;
|
this.busAddressLabel.AutoSize = true;
|
||||||
this.busAddressLabel.Location = new System.Drawing.Point(29, 95);
|
this.busAddressLabel.Location = new System.Drawing.Point(29, 110);
|
||||||
this.busAddressLabel.Name = "busAddressLabel";
|
this.busAddressLabel.Name = "busAddressLabel";
|
||||||
this.busAddressLabel.Size = new System.Drawing.Size(66, 13);
|
this.busAddressLabel.Size = new System.Drawing.Size(66, 13);
|
||||||
this.busAddressLabel.TabIndex = 3;
|
this.busAddressLabel.TabIndex = 3;
|
||||||
@ -130,7 +132,7 @@
|
|||||||
// nameTextBox
|
// nameTextBox
|
||||||
//
|
//
|
||||||
this.nameTextBox.Enabled = false;
|
this.nameTextBox.Enabled = false;
|
||||||
this.nameTextBox.Location = new System.Drawing.Point(140, 26);
|
this.nameTextBox.Location = new System.Drawing.Point(140, 23);
|
||||||
this.nameTextBox.Name = "nameTextBox";
|
this.nameTextBox.Name = "nameTextBox";
|
||||||
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
|
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
|
||||||
this.nameTextBox.TabIndex = 2;
|
this.nameTextBox.TabIndex = 2;
|
||||||
@ -138,7 +140,7 @@
|
|||||||
// nameLabel
|
// nameLabel
|
||||||
//
|
//
|
||||||
this.nameLabel.AutoSize = true;
|
this.nameLabel.AutoSize = true;
|
||||||
this.nameLabel.Location = new System.Drawing.Point(30, 29);
|
this.nameLabel.Location = new System.Drawing.Point(30, 26);
|
||||||
this.nameLabel.Name = "nameLabel";
|
this.nameLabel.Name = "nameLabel";
|
||||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||||
this.nameLabel.TabIndex = 1;
|
this.nameLabel.TabIndex = 1;
|
||||||
@ -147,7 +149,7 @@
|
|||||||
// classNameLabel
|
// classNameLabel
|
||||||
//
|
//
|
||||||
this.classNameLabel.AutoSize = true;
|
this.classNameLabel.AutoSize = true;
|
||||||
this.classNameLabel.Location = new System.Drawing.Point(137, 7);
|
this.classNameLabel.Location = new System.Drawing.Point(137, 5);
|
||||||
this.classNameLabel.Name = "classNameLabel";
|
this.classNameLabel.Name = "classNameLabel";
|
||||||
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
||||||
this.classNameLabel.TabIndex = 0;
|
this.classNameLabel.TabIndex = 0;
|
||||||
@ -157,7 +159,7 @@
|
|||||||
//
|
//
|
||||||
this.parityComboBox.Enabled = false;
|
this.parityComboBox.Enabled = false;
|
||||||
this.parityComboBox.FormattingEnabled = true;
|
this.parityComboBox.FormattingEnabled = true;
|
||||||
this.parityComboBox.Location = new System.Drawing.Point(140, 169);
|
this.parityComboBox.Location = new System.Drawing.Point(140, 171);
|
||||||
this.parityComboBox.Name = "parityComboBox";
|
this.parityComboBox.Name = "parityComboBox";
|
||||||
this.parityComboBox.Size = new System.Drawing.Size(130, 21);
|
this.parityComboBox.Size = new System.Drawing.Size(130, 21);
|
||||||
this.parityComboBox.TabIndex = 10;
|
this.parityComboBox.TabIndex = 10;
|
||||||
@ -174,7 +176,7 @@
|
|||||||
// busAddressTextBox
|
// busAddressTextBox
|
||||||
//
|
//
|
||||||
this.busAddressTextBox.Enabled = false;
|
this.busAddressTextBox.Enabled = false;
|
||||||
this.busAddressTextBox.Location = new System.Drawing.Point(140, 93);
|
this.busAddressTextBox.Location = new System.Drawing.Point(140, 108);
|
||||||
this.busAddressTextBox.Name = "busAddressTextBox";
|
this.busAddressTextBox.Name = "busAddressTextBox";
|
||||||
this.busAddressTextBox.Size = new System.Drawing.Size(34, 20);
|
this.busAddressTextBox.Size = new System.Drawing.Size(34, 20);
|
||||||
this.busAddressTextBox.TabIndex = 4;
|
this.busAddressTextBox.TabIndex = 4;
|
||||||
@ -182,7 +184,7 @@
|
|||||||
// delayTextBox
|
// delayTextBox
|
||||||
//
|
//
|
||||||
this.delayTextBox.Enabled = false;
|
this.delayTextBox.Enabled = false;
|
||||||
this.delayTextBox.Location = new System.Drawing.Point(140, 48);
|
this.delayTextBox.Location = new System.Drawing.Point(140, 44);
|
||||||
this.delayTextBox.Name = "delayTextBox";
|
this.delayTextBox.Name = "delayTextBox";
|
||||||
this.delayTextBox.Size = new System.Drawing.Size(34, 20);
|
this.delayTextBox.Size = new System.Drawing.Size(34, 20);
|
||||||
this.delayTextBox.TabIndex = 16;
|
this.delayTextBox.TabIndex = 16;
|
||||||
@ -190,7 +192,7 @@
|
|||||||
// delayLabel
|
// delayLabel
|
||||||
//
|
//
|
||||||
this.delayLabel.AutoSize = true;
|
this.delayLabel.AutoSize = true;
|
||||||
this.delayLabel.Location = new System.Drawing.Point(29, 50);
|
this.delayLabel.Location = new System.Drawing.Point(29, 46);
|
||||||
this.delayLabel.Name = "delayLabel";
|
this.delayLabel.Name = "delayLabel";
|
||||||
this.delayLabel.Size = new System.Drawing.Size(45, 13);
|
this.delayLabel.Size = new System.Drawing.Size(45, 13);
|
||||||
this.delayLabel.TabIndex = 15;
|
this.delayLabel.TabIndex = 15;
|
||||||
@ -199,7 +201,7 @@
|
|||||||
// protocolLabel
|
// protocolLabel
|
||||||
//
|
//
|
||||||
this.protocolLabel.AutoSize = true;
|
this.protocolLabel.AutoSize = true;
|
||||||
this.protocolLabel.Location = new System.Drawing.Point(29, 73);
|
this.protocolLabel.Location = new System.Drawing.Point(29, 89);
|
||||||
this.protocolLabel.Name = "protocolLabel";
|
this.protocolLabel.Name = "protocolLabel";
|
||||||
this.protocolLabel.Size = new System.Drawing.Size(46, 13);
|
this.protocolLabel.Size = new System.Drawing.Size(46, 13);
|
||||||
this.protocolLabel.TabIndex = 17;
|
this.protocolLabel.TabIndex = 17;
|
||||||
@ -209,16 +211,35 @@
|
|||||||
//
|
//
|
||||||
this.protocolComboBox.Enabled = false;
|
this.protocolComboBox.Enabled = false;
|
||||||
this.protocolComboBox.FormattingEnabled = true;
|
this.protocolComboBox.FormattingEnabled = true;
|
||||||
this.protocolComboBox.Location = new System.Drawing.Point(140, 70);
|
this.protocolComboBox.Location = new System.Drawing.Point(140, 86);
|
||||||
this.protocolComboBox.Name = "protocolComboBox";
|
this.protocolComboBox.Name = "protocolComboBox";
|
||||||
this.protocolComboBox.Size = new System.Drawing.Size(130, 21);
|
this.protocolComboBox.Size = new System.Drawing.Size(130, 21);
|
||||||
this.protocolComboBox.TabIndex = 18;
|
this.protocolComboBox.TabIndex = 18;
|
||||||
//
|
//
|
||||||
|
// bitPositionTextBox
|
||||||
|
//
|
||||||
|
this.bitPositionTextBox.Enabled = false;
|
||||||
|
this.bitPositionTextBox.Location = new System.Drawing.Point(140, 65);
|
||||||
|
this.bitPositionTextBox.Name = "bitPositionTextBox";
|
||||||
|
this.bitPositionTextBox.Size = new System.Drawing.Size(34, 20);
|
||||||
|
this.bitPositionTextBox.TabIndex = 20;
|
||||||
|
//
|
||||||
|
// bitPositionLabel
|
||||||
|
//
|
||||||
|
this.bitPositionLabel.AutoSize = true;
|
||||||
|
this.bitPositionLabel.Location = new System.Drawing.Point(30, 68);
|
||||||
|
this.bitPositionLabel.Name = "bitPositionLabel";
|
||||||
|
this.bitPositionLabel.Size = new System.Drawing.Size(89, 13);
|
||||||
|
this.bitPositionLabel.TabIndex = 19;
|
||||||
|
this.bitPositionLabel.Text = "Valve Bit Position";
|
||||||
|
//
|
||||||
// PumpCfgCtrl
|
// PumpCfgCtrl
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.BackColor = System.Drawing.SystemColors.Control;
|
this.BackColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.Controls.Add(this.bitPositionTextBox);
|
||||||
|
this.Controls.Add(this.bitPositionLabel);
|
||||||
this.Controls.Add(this.protocolComboBox);
|
this.Controls.Add(this.protocolComboBox);
|
||||||
this.Controls.Add(this.protocolLabel);
|
this.Controls.Add(this.protocolLabel);
|
||||||
this.Controls.Add(this.delayTextBox);
|
this.Controls.Add(this.delayTextBox);
|
||||||
@ -267,6 +288,8 @@
|
|||||||
private System.Windows.Forms.Label delayLabel;
|
private System.Windows.Forms.Label delayLabel;
|
||||||
private System.Windows.Forms.Label protocolLabel;
|
private System.Windows.Forms.Label protocolLabel;
|
||||||
private System.Windows.Forms.ComboBox protocolComboBox;
|
private System.Windows.Forms.ComboBox protocolComboBox;
|
||||||
|
private System.Windows.Forms.TextBox bitPositionTextBox;
|
||||||
|
private System.Windows.Forms.Label bitPositionLabel;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,10 +45,12 @@ namespace TBF.BenchControl.Elde.PumpTandem
|
|||||||
|
|
||||||
if (pump1 is Elde.Pump.Pump) { mask1 = (pump1 as Elde.Pump.Pump).Mask; }
|
if (pump1 is Elde.Pump.Pump) { mask1 = (pump1 as Elde.Pump.Pump).Mask; }
|
||||||
else if (pump1 is Elde.PumpWithFM.Pump) { mask1 = (pump1 as Elde.PumpWithFM.Pump).Mask; }
|
else if (pump1 is Elde.PumpWithFM.Pump) { mask1 = (pump1 as Elde.PumpWithFM.Pump).Mask; }
|
||||||
|
else if (pump1 is Danfoss.VLT2800.Pump) { mask1 = (pump1 as Danfoss.VLT2800.Pump).Mask; }
|
||||||
else { mask1 = 0; }
|
else { mask1 = 0; }
|
||||||
|
|
||||||
if (pump2 is Elde.Pump.Pump) { mask2 = (pump2 as Elde.Pump.Pump).Mask; }
|
if (pump2 is Elde.Pump.Pump) { mask2 = (pump2 as Elde.Pump.Pump).Mask; }
|
||||||
else if (pump2 is Elde.PumpWithFM.Pump) { mask2 = (pump2 as Elde.PumpWithFM.Pump).Mask; }
|
else if (pump2 is Elde.PumpWithFM.Pump) { mask2 = (pump2 as Elde.PumpWithFM.Pump).Mask; }
|
||||||
|
else if (pump2 is Danfoss.VLT2800.Pump) { mask2 = (pump2 as Danfoss.VLT2800.Pump).Mask; }
|
||||||
else { mask2 = 0; }
|
else { mask2 = 0; }
|
||||||
|
|
||||||
log.Debug(this.ToString());
|
log.Debug(this.ToString());
|
||||||
|
|||||||
@ -40,6 +40,7 @@ namespace TBF.BenchControl.Elde.PumpTandem
|
|||||||
{
|
{
|
||||||
if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.Pump.PumpFactory ||
|
if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.Pump.PumpFactory ||
|
||||||
TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.PumpWithFM.PumpFactory ||
|
TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.PumpWithFM.PumpFactory ||
|
||||||
|
TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Danfoss.VLT2800.PumpFactory ||
|
||||||
TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.PumpTandem.PumpFactory)
|
TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.PumpTandem.PumpFactory)
|
||||||
{
|
{
|
||||||
pump1ComboBox.Items.Add(cmpnt.Name);
|
pump1ComboBox.Items.Add(cmpnt.Name);
|
||||||
|
|||||||
@ -41,6 +41,7 @@ namespace TBF.BenchControl.Elde.Valve
|
|||||||
if (vlv is Valve && ((vlv as Valve).Mask & changed) == 0) continue;
|
if (vlv is Valve && ((vlv as Valve).Mask & changed) == 0) continue;
|
||||||
if (vlv is Pump.Pump && ((vlv as Pump.Pump).Mask & changed) == 0) continue;
|
if (vlv is Pump.Pump && ((vlv as Pump.Pump).Mask & changed) == 0) continue;
|
||||||
if (vlv is PumpWithFM.Pump && ((vlv as PumpWithFM.Pump).Mask & changed) == 0) continue;
|
if (vlv is PumpWithFM.Pump && ((vlv as PumpWithFM.Pump).Mask & changed) == 0) continue;
|
||||||
|
if (vlv is Danfoss.VLT2800.Pump && ((vlv as Danfoss.VLT2800.Pump).Mask & changed) == 0) continue;
|
||||||
|
|
||||||
if ((vlv != null) && (vlv.Delay > max)) max = vlv.Delay;
|
if ((vlv != null) && (vlv.Delay > max)) max = vlv.Delay;
|
||||||
}
|
}
|
||||||
@ -50,6 +51,7 @@ namespace TBF.BenchControl.Elde.Valve
|
|||||||
if (vlv is Valve && ((vlv as Valve).Mask & changed) == 0) continue;
|
if (vlv is Valve && ((vlv as Valve).Mask & changed) == 0) continue;
|
||||||
if (vlv is Pump.Pump && ((vlv as Pump.Pump).Mask & changed) == 0) continue;
|
if (vlv is Pump.Pump && ((vlv as Pump.Pump).Mask & changed) == 0) continue;
|
||||||
if (vlv is PumpWithFM.Pump && ((vlv as PumpWithFM.Pump).Mask & changed) == 0) continue;
|
if (vlv is PumpWithFM.Pump && ((vlv as PumpWithFM.Pump).Mask & changed) == 0) continue;
|
||||||
|
if (vlv is Danfoss.VLT2800.Pump && ((vlv as Danfoss.VLT2800.Pump).Mask & changed) == 0) continue;
|
||||||
|
|
||||||
if ((vlv != null) && (vlv.Delay > max)) max = vlv.Delay;
|
if ((vlv != null) && (vlv.Delay > max)) max = vlv.Delay;
|
||||||
}
|
}
|
||||||
@ -149,6 +151,7 @@ namespace TBF.BenchControl.Elde.Valve
|
|||||||
if (valve is Valve) point.MasksOpen |= (valve as Valve).Mask;
|
if (valve is Valve) point.MasksOpen |= (valve as Valve).Mask;
|
||||||
if (valve is Pump.Pump) point.MasksOpen |= (valve as Pump.Pump).Mask;
|
if (valve is Pump.Pump) point.MasksOpen |= (valve as Pump.Pump).Mask;
|
||||||
if (valve is PumpWithFM.Pump) point.MasksOpen |= (valve as PumpWithFM.Pump).Mask;
|
if (valve is PumpWithFM.Pump) point.MasksOpen |= (valve as PumpWithFM.Pump).Mask;
|
||||||
|
if (valve is Danfoss.VLT2800.Pump) point.MasksOpen |= (valve as Danfoss.VLT2800.Pump).Mask;
|
||||||
if (valve is PumpTandem.Pump) point.MasksOpen |= (valve as PumpTandem.Pump).Mask;
|
if (valve is PumpTandem.Pump) point.MasksOpen |= (valve as PumpTandem.Pump).Mask;
|
||||||
}
|
}
|
||||||
point.MasksClose = 0;
|
point.MasksClose = 0;
|
||||||
@ -157,6 +160,7 @@ namespace TBF.BenchControl.Elde.Valve
|
|||||||
if (valve is Valve) point.MasksClose |= (valve as Valve).Mask;
|
if (valve is Valve) point.MasksClose |= (valve as Valve).Mask;
|
||||||
if (valve is Pump.Pump) point.MasksClose |= (valve as Pump.Pump).Mask;
|
if (valve is Pump.Pump) point.MasksClose |= (valve as Pump.Pump).Mask;
|
||||||
if (valve is PumpWithFM.Pump) point.MasksClose |= (valve as PumpWithFM.Pump).Mask;
|
if (valve is PumpWithFM.Pump) point.MasksClose |= (valve as PumpWithFM.Pump).Mask;
|
||||||
|
if (valve is Danfoss.VLT2800.Pump) point.MasksClose |= (valve as Danfoss.VLT2800.Pump).Mask;
|
||||||
if (valve is PumpTandem.Pump) point.MasksClose |= (valve as PumpTandem.Pump).Mask;
|
if (valve is PumpTandem.Pump) point.MasksClose |= (valve as PumpTandem.Pump).Mask;
|
||||||
}
|
}
|
||||||
point.TimeSec += timeShift;
|
point.TimeSec += timeShift;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user