diff --git a/Results/Resources/Headpic.png b/Results/Resources/Headpic.png index 003fb997c..9a764174d 100644 Binary files a/Results/Resources/Headpic.png and b/Results/Resources/Headpic.png differ diff --git a/ResultsBrowser/Properties/AssemblyInfo.cs b/ResultsBrowser/Properties/AssemblyInfo.cs index b0ab1ffa8..24d7f20b3 100644 --- a/ResultsBrowser/Properties/AssemblyInfo.cs +++ b/ResultsBrowser/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.12.393.0")] -[assembly: AssemblyFileVersion("2.12.393.0")] +[assembly: AssemblyVersion("2.12.437.0")] +[assembly: AssemblyFileVersion("2.12.437.0")] diff --git a/TestBenchFramework/BenchControl/Events.cs b/TestBenchFramework/BenchControl/Events.cs index 32e2c8e10..f8abeeafd 100644 --- a/TestBenchFramework/BenchControl/Events.cs +++ b/TestBenchFramework/BenchControl/Events.cs @@ -32,7 +32,7 @@ namespace TBF.BenchControl public enum CfgChangeCmd { None, - CfgChange, /// COnfiguation change + CfgChange, /// Configuation change ValveOpen, /// Open a valve ValveClose, /// Close a valve RVOpenStep, /// Open a regulation valve (RV only) diff --git a/TestBenchFramework/BenchControl/Network/Adapter/NetadapterCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/Network/Adapter/NetadapterCfgCtrl.designer.cs index ca2758497..14d6c9eb9 100644 --- a/TestBenchFramework/BenchControl/Network/Adapter/NetadapterCfgCtrl.designer.cs +++ b/TestBenchFramework/BenchControl/Network/Adapter/NetadapterCfgCtrl.designer.cs @@ -31,103 +31,104 @@ namespace TBF.BenchControl.Network.Adapter /// private void InitializeComponent() { - this.nameTextBox = new System.Windows.Forms.TextBox(); - this.nameLabel = new System.Windows.Forms.Label(); - this.classNameLabel = new System.Windows.Forms.Label(); - this.adapterLabel = new System.Windows.Forms.Label(); - this.adapterComboBox = new System.Windows.Forms.ComboBox(); - this.tftpEnabledCheckBox = new System.Windows.Forms.CheckBox(); - this.tftpDirectoryLabel = new System.Windows.Forms.Label(); - this.tftpDirectoryTextBox = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // nameTextBox - // - this.nameTextBox.Enabled = false; - this.nameTextBox.Location = new System.Drawing.Point(101, 50); - this.nameTextBox.Name = "nameTextBox"; - this.nameTextBox.Size = new System.Drawing.Size(114, 20); - this.nameTextBox.TabIndex = 5; - // - // nameLabel - // - this.nameLabel.AutoSize = true; - this.nameLabel.Location = new System.Drawing.Point(9, 53); - this.nameLabel.Name = "nameLabel"; - this.nameLabel.Size = new System.Drawing.Size(35, 13); - this.nameLabel.TabIndex = 4; - this.nameLabel.Text = "Name"; - // - // classNameLabel - // - this.classNameLabel.AutoSize = true; - this.classNameLabel.Location = new System.Drawing.Point(98, 24); - this.classNameLabel.Name = "classNameLabel"; - this.classNameLabel.Size = new System.Drawing.Size(83, 13); - this.classNameLabel.TabIndex = 3; - this.classNameLabel.Text = "ComonentName"; - // - // adapterLabel - // - this.adapterLabel.AutoSize = true; - this.adapterLabel.Location = new System.Drawing.Point(9, 80); - this.adapterLabel.Name = "adapterLabel"; - this.adapterLabel.Size = new System.Drawing.Size(44, 13); - this.adapterLabel.TabIndex = 6; - this.adapterLabel.Text = "Adapter"; - // - // adapterComboBox - // - this.adapterComboBox.Location = new System.Drawing.Point(101, 77); - this.adapterComboBox.Name = "adapterComboBox"; - this.adapterComboBox.Size = new System.Drawing.Size(333, 21); - this.adapterComboBox.TabIndex = 7; - // - // tftpEnabledCheckBox - // - this.tftpEnabledCheckBox.AutoSize = true; - this.tftpEnabledCheckBox.Enabled = false; - this.tftpEnabledCheckBox.Location = new System.Drawing.Point(101, 115); - this.tftpEnabledCheckBox.Name = "tftpEnabledCheckBox"; - this.tftpEnabledCheckBox.Size = new System.Drawing.Size(121, 17); - this.tftpEnabledCheckBox.TabIndex = 12; - this.tftpEnabledCheckBox.Text = "Enable TFTP server"; - this.tftpEnabledCheckBox.UseVisualStyleBackColor = true; - // - // tftpDirectoryLabel - // - this.tftpDirectoryLabel.AutoSize = true; - this.tftpDirectoryLabel.Location = new System.Drawing.Point(9, 144); - this.tftpDirectoryLabel.Name = "tftpDirectoryLabel"; - this.tftpDirectoryLabel.Size = new System.Drawing.Size(79, 13); - this.tftpDirectoryLabel.TabIndex = 13; - this.tftpDirectoryLabel.Text = "TFTP Directory"; - // - // tftpDirectoryTextBox - // - this.tftpDirectoryTextBox.Enabled = false; - this.tftpDirectoryTextBox.Location = new System.Drawing.Point(101, 141); - this.tftpDirectoryTextBox.Name = "tftpDirectoryTextBox"; - this.tftpDirectoryTextBox.Size = new System.Drawing.Size(333, 20); - this.tftpDirectoryTextBox.TabIndex = 14; - // - // NetadapterCfgCtrl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.tftpDirectoryTextBox); - this.Controls.Add(this.tftpDirectoryLabel); - this.Controls.Add(this.tftpEnabledCheckBox); - this.Controls.Add(this.adapterComboBox); - this.Controls.Add(this.adapterLabel); - this.Controls.Add(this.nameTextBox); - this.Controls.Add(this.nameLabel); - this.Controls.Add(this.classNameLabel); - this.Name = "NetadapterCfgCtrl"; - this.Size = new System.Drawing.Size(450, 300); - this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); - this.ResumeLayout(false); - this.PerformLayout(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.adapterLabel = new System.Windows.Forms.Label(); + this.adapterComboBox = new System.Windows.Forms.ComboBox(); + this.tftpEnabledCheckBox = new System.Windows.Forms.CheckBox(); + this.tftpDirectoryLabel = new System.Windows.Forms.Label(); + this.tftpDirectoryTextBox = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(101, 50); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(114, 20); + this.nameTextBox.TabIndex = 5; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(9, 53); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 4; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(98, 24); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ComonentName"; + // + // adapterLabel + // + this.adapterLabel.AutoSize = true; + this.adapterLabel.Location = new System.Drawing.Point(9, 80); + this.adapterLabel.Name = "adapterLabel"; + this.adapterLabel.Size = new System.Drawing.Size(44, 13); + this.adapterLabel.TabIndex = 6; + this.adapterLabel.Text = "Adapter"; + // + // adapterComboBox + // + this.adapterComboBox.Enabled = false; + this.adapterComboBox.Location = new System.Drawing.Point(101, 77); + this.adapterComboBox.Name = "adapterComboBox"; + this.adapterComboBox.Size = new System.Drawing.Size(333, 21); + this.adapterComboBox.TabIndex = 7; + // + // tftpEnabledCheckBox + // + this.tftpEnabledCheckBox.AutoSize = true; + this.tftpEnabledCheckBox.Enabled = false; + this.tftpEnabledCheckBox.Location = new System.Drawing.Point(101, 115); + this.tftpEnabledCheckBox.Name = "tftpEnabledCheckBox"; + this.tftpEnabledCheckBox.Size = new System.Drawing.Size(121, 17); + this.tftpEnabledCheckBox.TabIndex = 12; + this.tftpEnabledCheckBox.Text = "Enable TFTP server"; + this.tftpEnabledCheckBox.UseVisualStyleBackColor = true; + // + // tftpDirectoryLabel + // + this.tftpDirectoryLabel.AutoSize = true; + this.tftpDirectoryLabel.Location = new System.Drawing.Point(9, 144); + this.tftpDirectoryLabel.Name = "tftpDirectoryLabel"; + this.tftpDirectoryLabel.Size = new System.Drawing.Size(79, 13); + this.tftpDirectoryLabel.TabIndex = 13; + this.tftpDirectoryLabel.Text = "TFTP Directory"; + // + // tftpDirectoryTextBox + // + this.tftpDirectoryTextBox.Enabled = false; + this.tftpDirectoryTextBox.Location = new System.Drawing.Point(101, 141); + this.tftpDirectoryTextBox.Name = "tftpDirectoryTextBox"; + this.tftpDirectoryTextBox.Size = new System.Drawing.Size(333, 20); + this.tftpDirectoryTextBox.TabIndex = 14; + // + // NetadapterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.tftpDirectoryTextBox); + this.Controls.Add(this.tftpDirectoryLabel); + this.Controls.Add(this.tftpEnabledCheckBox); + this.Controls.Add(this.adapterComboBox); + this.Controls.Add(this.adapterLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "NetadapterCfgCtrl"; + this.Size = new System.Drawing.Size(450, 300); + this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/TestBenchFramework/BenchControl/Network/Camera/Roi/Roi.cs b/TestBenchFramework/BenchControl/Network/Camera/Roi/Roi.cs index 4c18b5ff5..3b7699338 100644 --- a/TestBenchFramework/BenchControl/Network/Camera/Roi/Roi.cs +++ b/TestBenchFramework/BenchControl/Network/Camera/Roi/Roi.cs @@ -23,9 +23,10 @@ namespace TBF.BenchControl.Network.Camera.Roi readonly RoiCfg roiCfg; public readonly CLP1611.Camera NetCamera; - public readonly Telnet.TelnetClient Telnet; public readonly Roi PreviousRoi; + public Telnet.TelnetClient Telnet; + /// /// ICamera interface functions /// @@ -46,8 +47,8 @@ namespace TBF.BenchControl.Network.Camera.Roi /// public bool Detected { - get { return Detected; } - set { Detected = value; } + get { return detected; } + set { detected = value; } } bool detected; /// @@ -67,21 +68,49 @@ namespace TBF.BenchControl.Network.Camera.Roi { roiCfg = cfg as RoiCfg; NetCamera = TbfComponents.FindComponent(cfg.ParentName, components) as CLP1611.Camera; - if (NetCamera != null) Telnet = NetCamera.Telnet; PreviousRoi = TbfComponents.FindComponent(roiCfg.PreviousRoi, components) as Roi; detected = false; RoiX = new Boxes.IntBox(); RoiY = new Boxes.IntBox(); - RoiWid = new Boxes.IntBox(); - RoiHgh = new Boxes.IntBox(); + RoiWid = new Boxes.IntBox(); + RoiHgh = new Boxes.IntBox(); Clear(); log.Debug(this.ToString()); } + + #region Configuration Change Handling + + public static void OnCfgChange(object sender, CfgChangeArgs args) + { + if (CfgChangeHandler == null) return; + try { CfgChangeHandler(sender, args); } + catch (Exception e) { log.Error("CfgChangeHandler(...) failed", e); } + } + + public static event EventHandler CfgChangeHandler; + + public override void StartChangeHandler() + { + CfgChangeHandler += delegate(object sender, CfgChangeArgs args) + { + RoiCfg tmpcfg = args.Cfg as RoiCfg; + if (tmpcfg != null && tmpcfg.Name.Equals(Name)) + { + if (args.Command == CfgChangeCmd.CfgChange) + { + roiCfg.RoiParams = tmpcfg.RoiParams; + } + } + }; + } + + #endregion Configuration Change Handling + public void Clear() { wmPulses = 0; @@ -93,9 +122,10 @@ namespace TBF.BenchControl.Network.Camera.Roi public IOperation RoiDetectionOp() { - if (NetCamera != null && Telnet != null) + if (NetCamera != null && NetCamera.Telnet != null) { - return new RoiDetectionOp(this, roiCfg.Args, RoiX, RoiY, RoiWid, RoiHgh); + Telnet = NetCamera.Telnet; + return new RoiDetectionOp(this, roiCfg.RoiParams, RoiX, RoiY, RoiWid, RoiHgh); } else { diff --git a/TestBenchFramework/BenchControl/Network/Camera/Roi/RoiCfg.cs b/TestBenchFramework/BenchControl/Network/Camera/Roi/RoiCfg.cs index 001d751f7..bbbaf2fa9 100644 --- a/TestBenchFramework/BenchControl/Network/Camera/Roi/RoiCfg.cs +++ b/TestBenchFramework/BenchControl/Network/Camera/Roi/RoiCfg.cs @@ -15,7 +15,7 @@ namespace TBF.BenchControl.Network.Camera.Roi /// Serialized parameters /// public string PreviousRoi; - public string Args; + public string RoiParams; /// Procedure parameters [XmlIgnore] @@ -40,12 +40,12 @@ namespace TBF.BenchControl.Network.Camera.Roi Name = name; Factory = factory; ParentName = "Camera"; - Args = string.Empty; + RoiParams = string.Empty; } public string ToString(int i) { - return string.Format("Name={0}, Parent={1}, Args={2}", Name, ParentName, Args); + return string.Format("Name={0}, Parent={1}, Params={2}", Name, ParentName, RoiParams); } } } diff --git a/TestBenchFramework/BenchControl/Network/Camera/Roi/RoiCfgCtrl.cs b/TestBenchFramework/BenchControl/Network/Camera/Roi/RoiCfgCtrl.cs index 362529c4a..e687d5cc4 100644 --- a/TestBenchFramework/BenchControl/Network/Camera/Roi/RoiCfgCtrl.cs +++ b/TestBenchFramework/BenchControl/Network/Camera/Roi/RoiCfgCtrl.cs @@ -68,7 +68,7 @@ namespace TBF.BenchControl.Network.Camera.Roi nameTextBox.Text = config.Name; parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; previousRoiComboBox.Text = string.IsNullOrEmpty(config.PreviousRoi) ? "---" : config.PreviousRoi; - argsTextBox.Text = config.Args; + argsTextBox.Text = config.RoiParams; } public void Unlock() @@ -81,14 +81,36 @@ namespace TBF.BenchControl.Network.Camera.Roi public CfgUpdateFlags UpdateCfg() { - CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd; + CfgUpdateFlags flags = CfgUpdateFlags.None; 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.PreviousRoi = previousRoiComboBox.Text.Equals("---") ? string.Empty : previousRoiComboBox.Text; - config.Args = argsTextBox.Text; + if (config.Name != nameTextBox.Text) + { + config.Name = nameTextBox.Text; + flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange); + } + + string newParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; + if (config.ParentName != newParentName) + { + config.ParentName = newParentName; + flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange); + } + + string newPreviousRoi = previousRoiComboBox.Text.Equals("---") ? string.Empty : previousRoiComboBox.Text; + if (config.PreviousRoi != newPreviousRoi) + { + config.PreviousRoi = newPreviousRoi; + flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange); + } + + if (config.RoiParams != argsTextBox.Text) + { + config.RoiParams = argsTextBox.Text; + flags |= CfgUpdateFlags.AnyChange; + Roi.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config)); + } return flags; } @@ -111,5 +133,21 @@ namespace TBF.BenchControl.Network.Camera.Roi return flags; } - } + + #region Configuration Change Handling + + public static void OnCmdResponse(object sender, CmdResponseArgs args) + { + if (CmdResponseHandler == null) return; + try { CmdResponseHandler(sender, args); } + catch (Exception e) { log.Error("CmdResponseHandler(...) failed", e); } + } + + public static event EventHandler CmdResponseHandler; + + public void StartResponseHandler() { } + public void StopResponseHandler() { } + + #endregion Configuration Change Handling + } } diff --git a/TestBenchFramework/BenchControl/Network/Camera/Roi/RoiDetectionOp.cs b/TestBenchFramework/BenchControl/Network/Camera/Roi/RoiDetectionOp.cs index 502889940..f085c343b 100644 --- a/TestBenchFramework/BenchControl/Network/Camera/Roi/RoiDetectionOp.cs +++ b/TestBenchFramework/BenchControl/Network/Camera/Roi/RoiDetectionOp.cs @@ -17,10 +17,10 @@ namespace TBF.BenchControl.Network.Camera.Roi bool failed; bool previousFailed; - Boxes.IntBox oroiX; - Boxes.IntBox oroiY; - Boxes.IntBox oroiWid; - Boxes.IntBox oroiHgh; + Boxes.IntBox roiX; + Boxes.IntBox roiY; + Boxes.IntBox roiWid; + Boxes.IntBox roiHgh; /// Wid and Hgh are usefull when masking @@ -28,17 +28,17 @@ namespace TBF.BenchControl.Network.Camera.Roi /// Events: Event.None or Event.Error /// /// CLP1611.Camera reference - public RoiDetectionOp(Roi roi, string args, Boxes.IntBox oroiX, Boxes.IntBox oroiY, - Boxes.IntBox oroiWid, Boxes.IntBox oroiHgh) + public RoiDetectionOp(Roi roi, string args, Boxes.IntBox roiX, Boxes.IntBox roiY, + Boxes.IntBox roiWid, Boxes.IntBox roiHgh) { this.roi = roi; this.camera = roi.NetCamera; this.telnet = roi.Telnet; this.args = args; - this.oroiX = oroiX; - this.oroiY = oroiY; - this.oroiWid = oroiWid; - this.oroiHgh = oroiHgh; + this.roiX = roiX; + this.roiY = roiY; + this.roiWid = roiWid; + this.roiHgh = roiHgh; roiDetectionCommandSent = false; @@ -123,10 +123,10 @@ namespace TBF.BenchControl.Network.Camera.Roi } else { - oroiX.Val = x; - oroiY.Val = y; - oroiWid.Val = w; - oroiHgh.Val = h; + roiX.Val = x; + roiY.Val = y; + roiWid.Val = w; + roiHgh.Val = h; passed = true; return Event.RoiDetectionPassed; diff --git a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs index 1eb233f00..95a77ab74 100644 --- a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs +++ b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs @@ -124,7 +124,7 @@ namespace TBF.BenchControl.Sequences //-------------------------------------------------------------------------------------------- IntBox remainingTime = new IntBox(); - State startNew = State.Create("MainSeq : Emptying tanks, Starting cameras") + State startNew = State.Create("MainSeq : Emptying tanks") .AddOperation(checkUiOp); IList allEmptyingValves = new List(); if (StateMachine.EmptyTankValve1 != null) allEmptyingValves.Add(StateMachine.EmptyTankValve1); diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs index 58eebe5eb..dd18966d8 100644 --- a/TestBenchFramework/Properties/AssemblyInfo.cs +++ b/TestBenchFramework/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.12.436.1")] -[assembly: AssemblyFileVersion("2.12.436.1")] +[assembly: AssemblyVersion("2.12.437.1")] +[assembly: AssemblyFileVersion("2.12.437.1")] diff --git a/TestBenchFramework/Resources/Headpic.png b/TestBenchFramework/Resources/Headpic.png index 003fb997c..9a764174d 100644 Binary files a/TestBenchFramework/Resources/Headpic.png and b/TestBenchFramework/Resources/Headpic.png differ diff --git a/packages/ControlBoard/Munich/ControlComponent3Munich.dll b/packages/ControlBoard/Munich/ControlComponent3Munich.dll index 098024fce..75eb8675d 100644 Binary files a/packages/ControlBoard/Munich/ControlComponent3Munich.dll and b/packages/ControlBoard/Munich/ControlComponent3Munich.dll differ