From 0ccd711b0fdc4854204d8b25ef5fa0219286c8ad Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Wed, 27 Sep 2017 09:36:36 +0200 Subject: [PATCH] (1) CameraPictureCtrl modified, (2) LiveStreamSeq modified, (3) cleanup and more logging. --- .../Network/Camera/CLP1611/Camera.cs | 4 +- .../Network/Camera/CLP1611/LiveStreamOp.cs | 6 +- .../TestMethods/LiveStream/LiveStreamSeq.cs | 4 +- TestBenchFramework/Properties/AssemblyInfo.cs | 4 +- .../UiControls/CameraPictureCtrl.Designer.cs | 92 +++++++++++++------ .../UiControls/CameraPictureCtrl.cs | 19 +++- 6 files changed, 91 insertions(+), 38 deletions(-) diff --git a/TestBenchFramework/BenchControl/Network/Camera/CLP1611/Camera.cs b/TestBenchFramework/BenchControl/Network/Camera/CLP1611/Camera.cs index a8fc4eadd..b2c1c3657 100644 --- a/TestBenchFramework/BenchControl/Network/Camera/CLP1611/Camera.cs +++ b/TestBenchFramework/BenchControl/Network/Camera/CLP1611/Camera.cs @@ -189,7 +189,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611 if (cameraDetected) { - UiBridge.Bridge.OnCameraInfo(this.cameraIdx, string.Format("{0} s/n={1} IP={2} SD={3}", Name, CameraCfg.HardwareAddress, ipAddress, sdCardVer)); + UiBridge.Bridge.OnCameraInfo(this.cameraIdx, string.Format("{0} ver.{1} {2} s/n {3}", Name, sdCardVer, ipAddress, CameraCfg.HardwareAddress)); /// Open telnet clint and start the log-in process Telnet = new Telnet.TelnetClient(this, CameraCfg.Name, ClpUserName, ClpPassword, TelnetPrompt, TelnetSkipFirstLine, CameraCfg.DisplayTerminal); @@ -231,7 +231,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611 } else { - UiBridge.Bridge.OnCameraInfo(this.cameraIdx, string.Format("{0} s/n={1} was not detected!", Name, CameraCfg.HardwareAddress)); + UiBridge.Bridge.OnCameraInfo(this.cameraIdx, string.Format("{0} s/n {1} was not detected", Name, CameraCfg.HardwareAddress)); log.FatalFormat("'{0}' with address {1} not detected", Name, CameraCfg.HardwareAddress); } } diff --git a/TestBenchFramework/BenchControl/Network/Camera/CLP1611/LiveStreamOp.cs b/TestBenchFramework/BenchControl/Network/Camera/CLP1611/LiveStreamOp.cs index b155c3e49..e32650d0c 100644 --- a/TestBenchFramework/BenchControl/Network/Camera/CLP1611/LiveStreamOp.cs +++ b/TestBenchFramework/BenchControl/Network/Camera/CLP1611/LiveStreamOp.cs @@ -34,6 +34,8 @@ namespace TBF.BenchControl.Network.Camera.CLP1611 public Event Run() { + log.DebugFormat("Run(): telnet.State = {0}, liveStreamCommandSent = {1}", telnet.State, liveStreamCommandSent); + if (!liveStreamCommandSent) { if (telnet.State == TelnetClient.TelnetState.Inactive) @@ -48,7 +50,9 @@ namespace TBF.BenchControl.Network.Camera.CLP1611 public void Stop() { - if (liveStreamCommandSent) + log.DebugFormat("Stop(): telnet.State = {0}, liveStreamCommandSent = {1}", telnet.State, liveStreamCommandSent); + + if (liveStreamCommandSent) { telnet.Enqueue(new Telnet.Command(Telnet.CmdAction.SEND_COMMAND, Telnet.TelnetClient.CtrlCCommand)); log.WarnFormat("{0} IP={1} command=CTRL-C", camera.Name, camera.IPAddress); diff --git a/TestBenchFramework/BenchControl/TestMethods/LiveStream/LiveStreamSeq.cs b/TestBenchFramework/BenchControl/TestMethods/LiveStream/LiveStreamSeq.cs index fbfee4c1c..2920c2ea6 100644 --- a/TestBenchFramework/BenchControl/TestMethods/LiveStream/LiveStreamSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/LiveStream/LiveStreamSeq.cs @@ -26,9 +26,9 @@ namespace TBF.BenchControl.TestMethods.LiveStream foreach (var rr in sensPath.RegisterReaders) { - if (rr is GenericDevices.IRoi) + if (rr is GenericDevices.IRoiForFixedStart) { - GenericDevices.ICamera camera = (rr as GenericDevices.IRoi).Camera; + GenericDevices.ICamera camera = (rr as GenericDevices.IRoiForFixedStart).Camera; if (!cameras.Contains(camera)) { cameras.Add(camera); diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs index 3917c8dfc..dd98d3469 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.16.670.1")] -[assembly: AssemblyFileVersion("2.16.670.1")] +[assembly: AssemblyVersion("2.16.672.1")] +[assembly: AssemblyFileVersion("2.16.672.1")] diff --git a/TestBenchFramework/UiControls/CameraPictureCtrl.Designer.cs b/TestBenchFramework/UiControls/CameraPictureCtrl.Designer.cs index 7fee08b68..a8f44380d 100644 --- a/TestBenchFramework/UiControls/CameraPictureCtrl.Designer.cs +++ b/TestBenchFramework/UiControls/CameraPictureCtrl.Designer.cs @@ -31,63 +31,97 @@ namespace TBF.UiControls /// private void InitializeComponent() { - this.pictureBox = new System.Windows.Forms.PictureBox(); - this.groupBox = new System.Windows.Forms.GroupBox(); + this.captionLabel = new System.Windows.Forms.Label(); this.ledPictureBox = new System.Windows.Forms.PictureBox(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); - this.groupBox.SuspendLayout(); + this.pictureBox = new System.Windows.Forms.PictureBox(); + this.stopButton = new System.Windows.Forms.Button(); + this.saveButton = new System.Windows.Forms.Button(); + this.maxButton = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.ledPictureBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); this.SuspendLayout(); // + // captionLabel + // + this.captionLabel.AutoSize = true; + this.captionLabel.ForeColor = System.Drawing.Color.Black; + this.captionLabel.Location = new System.Drawing.Point(16, 4); + this.captionLabel.Name = "captionLabel"; + this.captionLabel.Size = new System.Drawing.Size(86, 13); + this.captionLabel.TabIndex = 6; + this.captionLabel.Text = "No info available"; + // + // ledPictureBox + // + this.ledPictureBox.Location = new System.Drawing.Point(2, 4); + this.ledPictureBox.Name = "ledPictureBox"; + this.ledPictureBox.Size = new System.Drawing.Size(12, 12); + this.ledPictureBox.TabIndex = 5; + this.ledPictureBox.TabStop = false; + // // pictureBox // - this.pictureBox.Location = new System.Drawing.Point(6, 19); + this.pictureBox.Location = new System.Drawing.Point(2, 20); this.pictureBox.Name = "pictureBox"; this.pictureBox.Size = new System.Drawing.Size(320, 240); this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox.TabIndex = 0; this.pictureBox.TabStop = false; // - // groupBox + // stopButton // - this.groupBox.BackColor = System.Drawing.SystemColors.ControlLight; - this.groupBox.Controls.Add(this.ledPictureBox); - this.groupBox.Controls.Add(this.pictureBox); - this.groupBox.ForeColor = System.Drawing.Color.Black; - this.groupBox.Location = new System.Drawing.Point(0, 0); - this.groupBox.Name = "groupBox"; - this.groupBox.Size = new System.Drawing.Size(332, 280); - this.groupBox.TabIndex = 1; - this.groupBox.TabStop = false; - this.groupBox.Text = "Camera "; + this.stopButton.Location = new System.Drawing.Point(249, 1); + this.stopButton.Name = "stopButton"; + this.stopButton.Size = new System.Drawing.Size(24, 18); + this.stopButton.TabIndex = 7; + this.stopButton.UseVisualStyleBackColor = true; + this.stopButton.Click += new System.EventHandler(this.stopButton_Click); // - // ledPictureBox + // saveButton // - this.ledPictureBox.Location = new System.Drawing.Point(6, 261); - this.ledPictureBox.Name = "ledPictureBox"; - this.ledPictureBox.Size = new System.Drawing.Size(15, 15); - this.ledPictureBox.TabIndex = 5; - this.ledPictureBox.TabStop = false; + this.saveButton.Location = new System.Drawing.Point(274, 1); + this.saveButton.Name = "saveButton"; + this.saveButton.Size = new System.Drawing.Size(24, 18); + this.saveButton.TabIndex = 8; + this.saveButton.UseVisualStyleBackColor = true; + this.saveButton.Click += new System.EventHandler(this.saveButton_Click); + // + // maxButton + // + this.maxButton.Location = new System.Drawing.Point(299, 1); + this.maxButton.Name = "maxButton"; + this.maxButton.Size = new System.Drawing.Size(24, 18); + this.maxButton.TabIndex = 9; + this.maxButton.UseVisualStyleBackColor = true; + this.maxButton.Click += new System.EventHandler(this.maxButton_Click); // // CameraPictureCtrl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.ButtonShadow; - this.Controls.Add(this.groupBox); + this.BackColor = System.Drawing.SystemColors.ControlLight; + this.Controls.Add(this.maxButton); + this.Controls.Add(this.saveButton); + this.Controls.Add(this.stopButton); + this.Controls.Add(this.pictureBox); + this.Controls.Add(this.captionLabel); + this.Controls.Add(this.ledPictureBox); this.Name = "CameraPictureCtrl"; - this.Size = new System.Drawing.Size(332, 280); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); - this.groupBox.ResumeLayout(false); + this.Size = new System.Drawing.Size(324, 262); ((System.ComponentModel.ISupportInitialize)(this.ledPictureBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.PictureBox pictureBox; - private System.Windows.Forms.GroupBox groupBox; private System.Windows.Forms.PictureBox ledPictureBox; + private System.Windows.Forms.Label captionLabel; + private System.Windows.Forms.PictureBox pictureBox; + private System.Windows.Forms.Button stopButton; + private System.Windows.Forms.Button saveButton; + private System.Windows.Forms.Button maxButton; } } diff --git a/TestBenchFramework/UiControls/CameraPictureCtrl.cs b/TestBenchFramework/UiControls/CameraPictureCtrl.cs index 54b07b6cf..6edaa800d 100644 --- a/TestBenchFramework/UiControls/CameraPictureCtrl.cs +++ b/TestBenchFramework/UiControls/CameraPictureCtrl.cs @@ -24,14 +24,14 @@ namespace TBF.UiControls public string Caption { - set { groupBox.Text = value; } + set { captionLabel.Text = value; } } public CameraPictureCtrl() { InitializeComponent(); - groupBox.Text = "No info available"; + captionLabel.Text = "No info available"; } public void UpdateLed(DateTime now) @@ -40,5 +40,20 @@ namespace TBF.UiControls ? SystemColors.Control : Color.Red; } + + private void stopButton_Click(object sender, EventArgs e) + { + + } + + private void saveButton_Click(object sender, EventArgs e) + { + + } + + private void maxButton_Click(object sender, EventArgs e) + { + + } } }