From 46cc618300181f82210a18f8c0c19f16accc963e Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Thu, 9 Feb 2017 14:25:41 +0100 Subject: [PATCH] TankSelector component added --- DeviceTest/DeviceTestDlg.cs | 48 +++++- .../BenchControl/Modbus/QuidoRS/QuidoRS.cs | 2 +- .../Modbus/QuidoRS/QuidoRSCfgCtrl.cs | 2 +- .../Modbus/QuidoRS/QuidoRSCfgCtrl.designer.cs | 2 +- .../Modbus/QuidoRS/TankSelector/Factory.cs | 26 +++ .../QuidoRS/TankSelector/TankSelector.cs | 120 +++++++++++++ .../QuidoRS/TankSelector/TankSelectorCfg.cs | 42 +++++ .../TankSelector/TankSelectorCfgCtrl.cs | 127 ++++++++++++++ .../TankSelectorCfgCtrl.designer.cs | 159 ++++++++++++++++++ .../TankSelector/TankSelectorCfgCtrl.resx | 120 +++++++++++++ .../BenchControl/TbfComponents.cs | 1 + TestBenchFramework/TBF.csproj | 12 ++ 12 files changed, 655 insertions(+), 6 deletions(-) create mode 100644 TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/Factory.cs create mode 100644 TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelector.cs create mode 100644 TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfg.cs create mode 100644 TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfgCtrl.cs create mode 100644 TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfgCtrl.designer.cs create mode 100644 TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfgCtrl.resx diff --git a/DeviceTest/DeviceTestDlg.cs b/DeviceTest/DeviceTestDlg.cs index 47c5f09db..4d17f6f37 100644 --- a/DeviceTest/DeviceTestDlg.cs +++ b/DeviceTest/DeviceTestDlg.cs @@ -261,7 +261,14 @@ namespace DeviceTest if (className == "Keithley.TempMeter") radioButton1.Text = "ReadPressureOp"; else if (className == "Network.Camera.CLP1611") radioButton1.Text = "Livestream"; else if (className == "Network.Camera.Roi") radioButton1.Text = "RoiDetection"; - else radioButton1.Text = "spare"; + else if (className == "TankSelector") + { + radioButton1.Text = "SelectTank 1"; + radioButton2.Text = "SelectTank 2"; + radioButton3.Text = "SelectTank 3"; + radioButton4.Text = "SelectTank -"; + } + else radioButton1.Text = "spare"; } /// void UpdateOperations2(string className) @@ -269,7 +276,14 @@ namespace DeviceTest if (className == "Keithley.TempMeter") radioButton21.Text = "ReadPressureOp"; else if (className == "Network.Camera.CLP1611") radioButton21.Text = "Livestream"; else if (className == "Network.Camera.Roi") radioButton21.Text = "RoiDetection"; - else radioButton21.Text = "spare"; + else if (className == "TankSelector") + { + radioButton21.Text = "SelectTank 1"; + radioButton22.Text = "SelectTank 2"; + radioButton23.Text = "SelectTank 3"; + radioButton24.Text = "SelectTank -"; + } + else radioButton21.Text = "spare"; } /// void UpdateOperations3(string className) @@ -277,7 +291,14 @@ namespace DeviceTest if (className == "Keithley.TempMeter") radioButton31.Text = "ReadPressureOp"; else if (className == "Network.Camera.CLP1611") radioButton31.Text = "Livestream"; else if (className == "Network.Camera.Roi") radioButton31.Text = "RoiDetection"; - else radioButton31.Text = "spare"; + else if (className == "TankSelector") + { + radioButton31.Text = "SelectTank 1"; + radioButton32.Text = "SelectTank 2"; + radioButton33.Text = "SelectTank 3"; + radioButton34.Text = "SelectTank -"; + } + else radioButton31.Text = "spare"; } @@ -616,6 +637,13 @@ namespace DeviceTest { operation1 = (tbfComponent1forOp as TBF.BenchControl.Network.Camera.Roi.Roi).RoiDetectionOp(); } + else if (tbfComponent1forOp is TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector) + { + operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector).SelectTankOp(1); + operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector).SelectTankOp(2); + operation3 = (tbfComponent1forOp as TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector).SelectTankOp(3); + operation4 = (tbfComponent1forOp as TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector).SelectTankOp(0); + } if (tbfComponent2forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter) @@ -631,6 +659,13 @@ namespace DeviceTest { operation21 = (tbfComponent2forOp as TBF.BenchControl.Network.Camera.Roi.Roi).RoiDetectionOp(); } + else if (tbfComponent2forOp is TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector) + { + operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector).SelectTankOp(1); + //operation22 = (tbfComponent2forOp as TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector).SelectTankOp(2); + //operation23 = (tbfComponent2forOp as TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector).SelectTankOp(3); + //operation24 = (tbfComponent2forOp as TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector).SelectTankOp(0); + } if (tbfComponent3forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter) @@ -646,6 +681,13 @@ namespace DeviceTest { operation31 = (tbfComponent3forOp as TBF.BenchControl.Network.Camera.Roi.Roi).RoiDetectionOp(); } + else if (tbfComponent3forOp is TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector) + { + operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector).SelectTankOp(1); + operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector).SelectTankOp(2); + operation33 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector).SelectTankOp(3); + operation34 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.TankSelector.TankSelector).SelectTankOp(0); + } while (workerThreadRunning) diff --git a/TestBenchFramework/BenchControl/Modbus/QuidoRS/QuidoRS.cs b/TestBenchFramework/BenchControl/Modbus/QuidoRS/QuidoRS.cs index 18728712f..3e96e86c0 100644 --- a/TestBenchFramework/BenchControl/Modbus/QuidoRS/QuidoRS.cs +++ b/TestBenchFramework/BenchControl/Modbus/QuidoRS/QuidoRS.cs @@ -12,7 +12,7 @@ namespace TBF.BenchControl.Modbus.QuidoRS public class QuidoRS : ComponentBase, IDevice { private static readonly ILog log = LogManager.GetLogger(typeof(QuidoRS)); - public override string ToString() { return string.Format("PressureMeter({0})", Cfg.ToString(1)); } + public override string ToString() { return string.Format("QuidoRS({0})", Cfg.ToString(1)); } readonly QuidoRSCfg quidoRSCfg; readonly GenericDevices.IModbus modbus; diff --git a/TestBenchFramework/BenchControl/Modbus/QuidoRS/QuidoRSCfgCtrl.cs b/TestBenchFramework/BenchControl/Modbus/QuidoRS/QuidoRSCfgCtrl.cs index 7c4038f81..3fb19f955 100644 --- a/TestBenchFramework/BenchControl/Modbus/QuidoRS/QuidoRSCfgCtrl.cs +++ b/TestBenchFramework/BenchControl/Modbus/QuidoRS/QuidoRSCfgCtrl.cs @@ -32,7 +32,7 @@ namespace TBF.BenchControl.Modbus.QuidoRS InitializeComponent(); } - private void PressureMeterCfgCtrl_Load(object sender, EventArgs e) + private void QuidoRSCfgCtrl_Load(object sender, EventArgs e) { parent = ParentForm as ComponentParametersDlg; if (parent == null) return; diff --git a/TestBenchFramework/BenchControl/Modbus/QuidoRS/QuidoRSCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/Modbus/QuidoRS/QuidoRSCfgCtrl.designer.cs index e1740d9d5..4341769b1 100644 --- a/TestBenchFramework/BenchControl/Modbus/QuidoRS/QuidoRSCfgCtrl.designer.cs +++ b/TestBenchFramework/BenchControl/Modbus/QuidoRS/QuidoRSCfgCtrl.designer.cs @@ -114,7 +114,7 @@ namespace TBF.BenchControl.Modbus.QuidoRS this.Controls.Add(this.componentNameLabel); this.Name = "ComponentCfgCtrl"; this.Size = new System.Drawing.Size(300, 200); - this.Load += new System.EventHandler(this.PressureMeterCfgCtrl_Load); + this.Load += new System.EventHandler(this.QuidoRSCfgCtrl_Load); this.ResumeLayout(false); this.PerformLayout(); diff --git a/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/Factory.cs b/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/Factory.cs new file mode 100644 index 000000000..b63d7693a --- /dev/null +++ b/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/Factory.cs @@ -0,0 +1,26 @@ +/// +/// Copyright (c) 2017 Sensus Metering Systems +/// +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Modbus.QuidoRS.TankSelector +{ + public class Factory : IComponentFactory + { + public string ClassName { get { return "TankSelector"; } } + + public void ResetStaticProperties() { TankSelector.ResetStaticProperties(); } + + public IComponent DummyComponent() { return new TankSelector(); } + + public IComponent GetComponent(IComponentCfg cfg, IList components) { return new TankSelector(cfg, components); } + + public IComponentCfg DefaultConfig() { return new TankSelectorCfg(this); } + + public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component) + { + return ComponentCfgBase.CreateFromDbEntity(typeof(TankSelectorCfg), component, this); + } + } +} diff --git a/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelector.cs b/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelector.cs new file mode 100644 index 000000000..6f830a54b --- /dev/null +++ b/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelector.cs @@ -0,0 +1,120 @@ +/// +/// Copyright (c) 2017 Sensus Metering Systems +/// +using System; +using System.Collections.Generic; +using log4net; +using TBF.BenchControl.Generic; +using TBF.Boxes; + +namespace TBF.BenchControl.Modbus.QuidoRS.TankSelector +{ + public class TankSelector : ComponentBase, IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(TankSelector)); + public override string ToString() { return string.Format("TankSelector({0})", Cfg.ToString(1)); } + + readonly TankSelectorCfg tankSelectorCfg; + readonly QuidoRS quidoRS; + + + public enum CurrentOp + { + None, + SelectTank, + } + + CurrentOp currentOp; + + + public TankSelector() + { + } + + public TankSelector(Generic.IComponentCfg cfg, IList components) + : base(cfg) + { + tankSelectorCfg = cfg as TankSelectorCfg; + + quidoRS = (QuidoRS)TbfComponents.FindComponent(cfg.ParentName, components); + if (quidoRS == null) throw new Exception("Cannot find " + Name + " parent"); + + log.Debug(this.ToString()); + } + + /// + /// Set outputs of QuidoRS board + /// + /// output value + public void SetOutputs(uint outputs) + { + quidoRS.SetOutputs((ushort)outputs); + } + + + /// + /// Events: SetOpututsDone, Error + /// + /// Reference to a variable for the pressure in Bar + /// SetOutputsOp instance reference casted to IOperaton + //public IOperation SetOutputsOp(ushort outValue) + //{ + // return new SetOutputsOp(this, outValue); + //} + + /// + /// Events: pressureDone, Error + /// + /// Reference to a variable for the pressure in Bar + /// Event returned when SetOutput is done + /// SetOutputsOp instance reference casted to IOperaton + //public IOperation ReadPressureOp(ushort outValue, Event setOutputsDone) + //{ + // return new SetOutputsOp(this, outValue, setOutputsDone); + //} + + int tankNo; + /// + public IOperation SelectTankOp(int tankNo) + { + if (currentOp != CurrentOp.None) + { + throw new Exception("Cannot start operation 'SelectTankOp'"); + } + this.tankNo = tankNo; + currentOp = CurrentOp.SelectTank; + return this; + } + + /// Start this operation + public void Start() + { + switch (currentOp) + { + case CurrentOp.SelectTank: + SetOutputs((tankNo==1) ? 1u : ((tankNo==2) ? 2u : ((tankNo==3) ? 3u : 0))); + break; + default: + break; + } + } + + /// Run this operation + public Event Run() + { + switch (currentOp) + { + case CurrentOp.SelectTank: + return Event.Done; + default: + return Event.Done; + } + } + + /// Stop this operation + public void Stop() + { + currentOp = CurrentOp.None; + } + } +} diff --git a/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfg.cs b/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfg.cs new file mode 100644 index 000000000..9d6ab96ff --- /dev/null +++ b/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfg.cs @@ -0,0 +1,42 @@ +/// +/// Copyright (c) 2017 Sensus Metering Systems +/// +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Modbus.QuidoRS.TankSelector +{ + public class TankSelectorCfg : ComponentCfgBase, Generic.IChildComponentCfg + { + public IComponentCfgCtrl GetControl() { return new TankSelectorCfgCtrl(); } + + /// + /// Serialized parameters + /// + public string ControlBoard; + + /// Private parameterless constructor invoked by all other (public) constructors + TankSelectorCfg() + { + Name = "TankSelector"; + ParentName = "QuidoRS"; + } + + public TankSelectorCfg(IComponentFactory factory) + : this() + { + this.Factory = factory; + } + + public string ToString(int i) + { + return string.Format("Name={0}, Parent={1}, CtrlBrd={2}", + Name, + (string.IsNullOrEmpty(ParentName) ? "-" : ParentName), + (string.IsNullOrEmpty(ControlBoard) ? "-" : ControlBoard)); + } + } +} diff --git a/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfgCtrl.cs b/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfgCtrl.cs new file mode 100644 index 000000000..aec5d4a45 --- /dev/null +++ b/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfgCtrl.cs @@ -0,0 +1,127 @@ +/// +/// Copyright (c) 2017 Sensus Metering Systems +/// +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Modbus.QuidoRS.TankSelector +{ + public partial class TankSelectorCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(TankSelectorCfgCtrl)); + + ComponentParametersDlg parent; + + public bool ShowMore { get { return false; } } + + TankSelectorCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as TankSelectorCfg; + Redraw(); + } + } + + public TankSelectorCfgCtrl() + { + InitializeComponent(); + } + + private void TankSelectorCfgCtrl_Load(object sender, EventArgs e) + { + parent = ParentForm as ComponentParametersDlg; + if (parent == null) return; + controlBoardComboBox.Items.Add("---"); + if (parent.TbfComponents != null) + { + foreach (var cmpnt in parent.TbfComponents) + { + if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Modbus.QuidoRS.Factory) + { + parentNameComboBox.Items.Add(cmpnt.Name); + } + if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.ControlBoardFactory) + { + controlBoardComboBox.Items.Add(cmpnt.Name); + } + } + } + + Redraw(); + } + + public void Closing() + { + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + componentNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; + controlBoardComboBox.Text = string.IsNullOrEmpty(config.ControlBoard) ? "---" : config.ControlBoard; + modbusAddressTextBox.Text = "1"; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + parentNameComboBox.Enabled = true; + controlBoardComboBox.Enabled = true; + modbusAddressTextBox.Enabled = true; + } + + public CfgUpdateFlags VerifyCfg(ref string message) + { + CfgUpdateFlags flags = CfgUpdateFlags.None; + + int dummy; + if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text)) + { + flags |= CfgUpdateFlags.Error; + message += Environment.NewLine + "Invalid 'Parent name'"; + } + if (!controlBoardComboBox.Items.Contains(controlBoardComboBox.Text)) + { + flags |= CfgUpdateFlags.Error; + message += Environment.NewLine + "Invalid 'Control board'"; + } + if (!int.TryParse(modbusAddressTextBox.Text, out dummy) || dummy < 0 || dummy > 255) + { + flags |= CfgUpdateFlags.Error; + message += Environment.NewLine + "'Modbus Address' should be between 0 and 255"; + } + return flags; + } + + public CfgUpdateFlags UpdateCfg() + { + CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd; + + if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; + config.ControlBoard = controlBoardComboBox.Text.Equals("---") ? string.Empty : controlBoardComboBox.Text; + + return flags; + } + + private void modbusAddressLabel_Click(object sender, EventArgs e) + { + + } + + private void modbusAddressTextBox_TextChanged(object sender, EventArgs e) + { + + } + } +} diff --git a/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfgCtrl.designer.cs new file mode 100644 index 000000000..8cf56f3af --- /dev/null +++ b/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfgCtrl.designer.cs @@ -0,0 +1,159 @@ +/// +/// Copyright (c) 2017 Sensus Metering Systems +/// +namespace TBF.BenchControl.Modbus.QuidoRS.TankSelector +{ + partial class TankSelectorCfgCtrl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.parentNameLabel = new System.Windows.Forms.Label(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.componentNameLabel = new System.Windows.Forms.Label(); + this.modbusAddressLabel = new System.Windows.Forms.Label(); + this.modbusAddressTextBox = new System.Windows.Forms.TextBox(); + this.parentNameComboBox = new System.Windows.Forms.ComboBox(); + this.controlBoardComboBox = new System.Windows.Forms.ComboBox(); + this.controlBoardLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // parentNameLabel + // + this.parentNameLabel.AutoSize = true; + this.parentNameLabel.Location = new System.Drawing.Point(28, 81); + this.parentNameLabel.Name = "parentNameLabel"; + this.parentNameLabel.Size = new System.Drawing.Size(67, 13); + this.parentNameLabel.TabIndex = 3; + this.parentNameLabel.Text = "Parent name"; + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(138, 52); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(28, 55); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // componentNameLabel + // + this.componentNameLabel.AutoSize = true; + this.componentNameLabel.Location = new System.Drawing.Point(135, 28); + this.componentNameLabel.Name = "componentNameLabel"; + this.componentNameLabel.Size = new System.Drawing.Size(83, 13); + this.componentNameLabel.TabIndex = 0; + this.componentNameLabel.Text = "ComonentName"; + // + // modbusAddressLabel + // + this.modbusAddressLabel.AutoSize = true; + this.modbusAddressLabel.Location = new System.Drawing.Point(28, 135); + this.modbusAddressLabel.Name = "modbusAddressLabel"; + this.modbusAddressLabel.Size = new System.Drawing.Size(38, 13); + this.modbusAddressLabel.TabIndex = 7; + this.modbusAddressLabel.Text = "TODO"; + this.modbusAddressLabel.Click += new System.EventHandler(this.modbusAddressLabel_Click); + // + // modbusAddressTextBox + // + this.modbusAddressTextBox.Enabled = false; + this.modbusAddressTextBox.Location = new System.Drawing.Point(138, 132); + this.modbusAddressTextBox.Name = "modbusAddressTextBox"; + this.modbusAddressTextBox.Size = new System.Drawing.Size(46, 20); + this.modbusAddressTextBox.TabIndex = 8; + this.modbusAddressTextBox.TextChanged += new System.EventHandler(this.modbusAddressTextBox_TextChanged); + // + // parentNameComboBox + // + this.parentNameComboBox.Enabled = false; + this.parentNameComboBox.FormattingEnabled = true; + this.parentNameComboBox.Location = new System.Drawing.Point(138, 78); + this.parentNameComboBox.Name = "parentNameComboBox"; + this.parentNameComboBox.Size = new System.Drawing.Size(130, 21); + this.parentNameComboBox.TabIndex = 4; + // + // controlBoardComboBox + // + this.controlBoardComboBox.Enabled = false; + this.controlBoardComboBox.FormattingEnabled = true; + this.controlBoardComboBox.Location = new System.Drawing.Point(138, 105); + this.controlBoardComboBox.Name = "controlBoardComboBox"; + this.controlBoardComboBox.Size = new System.Drawing.Size(130, 21); + this.controlBoardComboBox.TabIndex = 6; + // + // controlBoardLabel + // + this.controlBoardLabel.AutoSize = true; + this.controlBoardLabel.Location = new System.Drawing.Point(28, 108); + this.controlBoardLabel.Name = "controlBoardLabel"; + this.controlBoardLabel.Size = new System.Drawing.Size(70, 13); + this.controlBoardLabel.TabIndex = 5; + this.controlBoardLabel.Text = "Control board"; + // + // TankSelectorCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.controlBoardComboBox); + this.Controls.Add(this.controlBoardLabel); + this.Controls.Add(this.parentNameComboBox); + this.Controls.Add(this.modbusAddressTextBox); + this.Controls.Add(this.modbusAddressLabel); + this.Controls.Add(this.parentNameLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.componentNameLabel); + this.Name = "TankSelectorCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.TankSelectorCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label parentNameLabel; + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label componentNameLabel; + private System.Windows.Forms.Label modbusAddressLabel; + private System.Windows.Forms.TextBox modbusAddressTextBox; + private System.Windows.Forms.ComboBox parentNameComboBox; + private System.Windows.Forms.ComboBox controlBoardComboBox; + private System.Windows.Forms.Label controlBoardLabel; + } +} diff --git a/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfgCtrl.resx b/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Modbus/QuidoRS/TankSelector/TankSelectorCfgCtrl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/BenchControl/TbfComponents.cs b/TestBenchFramework/BenchControl/TbfComponents.cs index 34be564cf..6ddc121ed 100644 --- a/TestBenchFramework/BenchControl/TbfComponents.cs +++ b/TestBenchFramework/BenchControl/TbfComponents.cs @@ -93,6 +93,7 @@ namespace TBF.BenchControl Factories.Add(new ResultsPrinters.Cevak.PrinterFactory()); Factories.Add(new ResultsPrinters.Munich.PrinterFactory()); Factories.Add(new DB.SensusOracle.DatabaseFactory()); + Factories.Add(new Modbus.QuidoRS.TankSelector.Factory()); /// TankSelector Factories.Add(new Elde.TempMeter.TempMeterFactory()); Factories.Add(new Elde.TempMeterInternal.TempMeterFactory()); Factories.Add(new Elde.Valve.ValveFactory()); diff --git a/TestBenchFramework/TBF.csproj b/TestBenchFramework/TBF.csproj index 7c2a469b9..4395ae964 100644 --- a/TestBenchFramework/TBF.csproj +++ b/TestBenchFramework/TBF.csproj @@ -516,6 +516,15 @@ + + + + + UserControl + + + TankSelectorCfgCtrl.cs + @@ -1874,6 +1883,9 @@ QuidoRSCfgCtrl.cs + + TankSelectorCfgCtrl.cs + NetadapterCfgCtrl.cs