Camera info displayed in PicturesTabPage, PicturesTabPageCtrl and CameraPictureCtrl cleanup, ver. 2.16.669

This commit is contained in:
Milan Hanajik 2017-09-26 18:34:20 +02:00
parent 76dd46b30c
commit 9f467a23b4
12 changed files with 244 additions and 364 deletions

View File

@ -189,7 +189,9 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
if (cameraDetected)
{
/// Open telnet clint and start the log-in process
UiBridge.Bridge.OnCameraInfo(this.cameraIdx, string.Format("{0} s/n={1} IP={2} SD={3}", Name, CameraCfg.HardwareAddress, ipAddress, sdCardVer));
/// Open telnet clint and start the log-in process
Telnet = new Telnet.TelnetClient(this, CameraCfg.Name, ClpUserName, ClpPassword, TelnetPrompt, TelnetSkipFirstLine, CameraCfg.DisplayTerminal);
if (CameraCfg.DisplayTerminal)
@ -229,6 +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));
log.FatalFormat("'{0}' with address {1} not detected", Name, CameraCfg.HardwareAddress);
}
}

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.16.668.1")]
[assembly: AssemblyFileVersion("2.16.668.1")]
[assembly: AssemblyVersion("2.16.669.1")]
[assembly: AssemblyFileVersion("2.16.669.1")]

View File

@ -1671,15 +1671,6 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Focus.
/// </summary>
internal static string Focus {
get {
return ResourceManager.GetString("Focus", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Footer.
/// </summary>

View File

@ -1150,9 +1150,6 @@
<data name="ID" xml:space="preserve">
<value>ID</value>
</data>
<data name="Focus" xml:space="preserve">
<value>Focus</value>
</data>
<data name="Grab" xml:space="preserve">
<value>Grab</value>
</data>

View File

@ -31,131 +31,105 @@ namespace TBF.Screens
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PicturesTabPageCtrl));
this.logTextBox = new System.Windows.Forms.TextBox();
this.splitContainer = new System.Windows.Forms.SplitContainer();
this.focusButton = new System.Windows.Forms.Button();
this.liveButton = new System.Windows.Forms.Button();
this.grabButton = new System.Windows.Forms.Button();
this.configureButton = new System.Windows.Forms.Button();
this.cameraPictureCtrl6 = new TBF.UiControls.CameraPictureCtrl();
this.cameraPictureCtrl5 = new TBF.UiControls.CameraPictureCtrl();
this.cameraPictureCtrl4 = new TBF.UiControls.CameraPictureCtrl();
this.cameraPictureCtrl3 = new TBF.UiControls.CameraPictureCtrl();
this.cameraPictureCtrl2 = new TBF.UiControls.CameraPictureCtrl();
this.cameraPictureCtrl1 = new TBF.UiControls.CameraPictureCtrl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
this.splitContainer.Panel1.SuspendLayout();
this.splitContainer.Panel2.SuspendLayout();
this.splitContainer.SuspendLayout();
this.SuspendLayout();
//
// logTextBox
//
resources.ApplyResources(this.logTextBox, "logTextBox");
this.logTextBox.Name = "logTextBox";
//
// splitContainer
//
resources.ApplyResources(this.splitContainer, "splitContainer");
this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer.Name = "splitContainer";
//
// splitContainer.Panel1
//
this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Control;
this.splitContainer.Panel1.Controls.Add(this.focusButton);
this.splitContainer.Panel1.Controls.Add(this.liveButton);
this.splitContainer.Panel1.Controls.Add(this.grabButton);
this.splitContainer.Panel1.Controls.Add(this.configureButton);
//
// splitContainer.Panel2
//
this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl6);
this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl5);
this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl4);
this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl3);
this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl2);
this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl1);
//
// focusButton
//
resources.ApplyResources(this.focusButton, "focusButton");
this.focusButton.Name = "focusButton";
this.focusButton.UseVisualStyleBackColor = true;
this.focusButton.Click += new System.EventHandler(this.focusButton_Click);
//
// liveButton
//
resources.ApplyResources(this.liveButton, "liveButton");
this.liveButton.Name = "liveButton";
this.liveButton.UseVisualStyleBackColor = true;
this.liveButton.Click += new System.EventHandler(this.liveButton_Click);
//
// grabButton
//
resources.ApplyResources(this.grabButton, "grabButton");
this.grabButton.Name = "grabButton";
this.grabButton.UseVisualStyleBackColor = true;
this.grabButton.Click += new System.EventHandler(this.grabButton_Click);
//
// configureButton
//
resources.ApplyResources(this.configureButton, "configureButton");
this.configureButton.Name = "configureButton";
this.configureButton.UseVisualStyleBackColor = true;
this.configureButton.Click += new System.EventHandler(this.configureButton_Click);
//
// cameraPictureCtrl6
//
this.cameraPictureCtrl6.BackColor = System.Drawing.SystemColors.ButtonShadow;
resources.ApplyResources(this.cameraPictureCtrl6, "cameraPictureCtrl6");
this.cameraPictureCtrl6.Name = "cameraPictureCtrl6";
//
// cameraPictureCtrl5
//
this.cameraPictureCtrl5.BackColor = System.Drawing.SystemColors.ButtonShadow;
resources.ApplyResources(this.cameraPictureCtrl5, "cameraPictureCtrl5");
this.cameraPictureCtrl5.Name = "cameraPictureCtrl5";
//
// cameraPictureCtrl4
//
this.cameraPictureCtrl4.BackColor = System.Drawing.SystemColors.ButtonShadow;
resources.ApplyResources(this.cameraPictureCtrl4, "cameraPictureCtrl4");
this.cameraPictureCtrl4.Name = "cameraPictureCtrl4";
//
// cameraPictureCtrl3
//
this.cameraPictureCtrl3.BackColor = System.Drawing.SystemColors.ButtonShadow;
resources.ApplyResources(this.cameraPictureCtrl3, "cameraPictureCtrl3");
this.cameraPictureCtrl3.Name = "cameraPictureCtrl3";
//
// cameraPictureCtrl2
//
this.cameraPictureCtrl2.BackColor = System.Drawing.SystemColors.ButtonShadow;
resources.ApplyResources(this.cameraPictureCtrl2, "cameraPictureCtrl2");
this.cameraPictureCtrl2.Name = "cameraPictureCtrl2";
//
// cameraPictureCtrl1
//
this.cameraPictureCtrl1.BackColor = System.Drawing.SystemColors.ButtonShadow;
resources.ApplyResources(this.cameraPictureCtrl1, "cameraPictureCtrl1");
this.cameraPictureCtrl1.Name = "cameraPictureCtrl1";
//
// PicturesTabPageCtrl
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Silver;
this.Controls.Add(this.splitContainer);
this.Controls.Add(this.logTextBox);
this.Name = "PicturesTabPageCtrl";
this.splitContainer.Panel1.ResumeLayout(false);
this.splitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
this.splitContainer.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PicturesTabPageCtrl));
this.logTextBox = new System.Windows.Forms.TextBox();
this.splitContainer = new System.Windows.Forms.SplitContainer();
this.configureButton = new System.Windows.Forms.Button();
this.cameraPictureCtrl6 = new TBF.UiControls.CameraPictureCtrl();
this.cameraPictureCtrl5 = new TBF.UiControls.CameraPictureCtrl();
this.cameraPictureCtrl4 = new TBF.UiControls.CameraPictureCtrl();
this.cameraPictureCtrl3 = new TBF.UiControls.CameraPictureCtrl();
this.cameraPictureCtrl2 = new TBF.UiControls.CameraPictureCtrl();
this.cameraPictureCtrl1 = new TBF.UiControls.CameraPictureCtrl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
this.splitContainer.Panel1.SuspendLayout();
this.splitContainer.Panel2.SuspendLayout();
this.splitContainer.SuspendLayout();
this.SuspendLayout();
//
// logTextBox
//
resources.ApplyResources(this.logTextBox, "logTextBox");
this.logTextBox.Name = "logTextBox";
//
// splitContainer
//
resources.ApplyResources(this.splitContainer, "splitContainer");
this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer.Name = "splitContainer";
//
// splitContainer.Panel1
//
this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Control;
this.splitContainer.Panel1.Controls.Add(this.configureButton);
//
// splitContainer.Panel2
//
this.splitContainer.Panel2.BackColor = System.Drawing.SystemColors.Control;
this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl6);
this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl5);
this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl4);
this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl3);
this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl2);
this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl1);
//
// configureButton
//
resources.ApplyResources(this.configureButton, "configureButton");
this.configureButton.Name = "configureButton";
this.configureButton.UseVisualStyleBackColor = true;
this.configureButton.Click += new System.EventHandler(this.configureButton_Click);
//
// cameraPictureCtrl6
//
this.cameraPictureCtrl6.BackColor = System.Drawing.SystemColors.ButtonShadow;
resources.ApplyResources(this.cameraPictureCtrl6, "cameraPictureCtrl6");
this.cameraPictureCtrl6.Name = "cameraPictureCtrl6";
//
// cameraPictureCtrl5
//
this.cameraPictureCtrl5.BackColor = System.Drawing.SystemColors.ButtonShadow;
resources.ApplyResources(this.cameraPictureCtrl5, "cameraPictureCtrl5");
this.cameraPictureCtrl5.Name = "cameraPictureCtrl5";
//
// cameraPictureCtrl4
//
this.cameraPictureCtrl4.BackColor = System.Drawing.SystemColors.ButtonShadow;
resources.ApplyResources(this.cameraPictureCtrl4, "cameraPictureCtrl4");
this.cameraPictureCtrl4.Name = "cameraPictureCtrl4";
//
// cameraPictureCtrl3
//
this.cameraPictureCtrl3.BackColor = System.Drawing.SystemColors.ButtonShadow;
resources.ApplyResources(this.cameraPictureCtrl3, "cameraPictureCtrl3");
this.cameraPictureCtrl3.Name = "cameraPictureCtrl3";
//
// cameraPictureCtrl2
//
this.cameraPictureCtrl2.BackColor = System.Drawing.SystemColors.ButtonShadow;
resources.ApplyResources(this.cameraPictureCtrl2, "cameraPictureCtrl2");
this.cameraPictureCtrl2.Name = "cameraPictureCtrl2";
//
// cameraPictureCtrl1
//
this.cameraPictureCtrl1.BackColor = System.Drawing.SystemColors.ButtonShadow;
resources.ApplyResources(this.cameraPictureCtrl1, "cameraPictureCtrl1");
this.cameraPictureCtrl1.Name = "cameraPictureCtrl1";
//
// PicturesTabPageCtrl
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Silver;
this.Controls.Add(this.splitContainer);
this.Controls.Add(this.logTextBox);
this.Name = "PicturesTabPageCtrl";
this.splitContainer.Panel1.ResumeLayout(false);
this.splitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
this.splitContainer.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
@ -169,9 +143,6 @@ namespace TBF.Screens
private UiControls.CameraPictureCtrl cameraPictureCtrl4;
private UiControls.CameraPictureCtrl cameraPictureCtrl3;
private UiControls.CameraPictureCtrl cameraPictureCtrl2;
private UiControls.CameraPictureCtrl cameraPictureCtrl1;
private System.Windows.Forms.Button focusButton;
private System.Windows.Forms.Button liveButton;
private System.Windows.Forms.Button grabButton;
private UiControls.CameraPictureCtrl cameraPictureCtrl1;
}
}

View File

@ -16,59 +16,76 @@ namespace TBF.Screens
Localize();
System.Windows.Forms.Timer timer;
timer = new System.Windows.Forms.Timer();
timer.Tick += (s, e) => { TimerTick(); };
timer.Interval = 250;
timer.Start();
Bridge.ImageHandler += delegate(object sender, ImageEventArgs args)
{
if (InvokeRequired)
{
Invoke(new EventHandler<ImageEventArgs>(ShowImage), sender, args);
}
else
{
ShowImage(sender, args);
}
};
}
{
if (InvokeRequired)
Invoke(new EventHandler<ImageEventArgs>(ShowImage), sender, args);
else
ShowImage(sender, args);
};
Bridge.CameraInfoHandler += delegate(object sender, CameraInfoEventArgs args)
{
if (InvokeRequired)
Invoke(new EventHandler<CameraInfoEventArgs>(ShowInfo), sender, args);
else
ShowInfo(sender, args);
};
}
private void Localize()
{
configureButton.Text = Strings.Configure;
grabButton.Text = Strings.Grab;
liveButton.Text = Strings.Live;
focusButton.Text = Strings.Focus;
}
private void TimerTick()
{
DateTime now = DateTime.Now;
cameraPictureCtrl1.UpdateLed(now);
cameraPictureCtrl2.UpdateLed(now);
cameraPictureCtrl3.UpdateLed(now);
cameraPictureCtrl4.UpdateLed(now);
cameraPictureCtrl5.UpdateLed(now);
cameraPictureCtrl6.UpdateLed(now);
}
void ShowImage(object sender, ImageEventArgs args)
{
switch (args.CameraIdx)
{
case 0: cameraPictureCtrl1.PictureBox.Image = args.Image; break;
case 1: cameraPictureCtrl2.PictureBox.Image = args.Image; break;
case 2: cameraPictureCtrl3.PictureBox.Image = args.Image; break;
case 3: cameraPictureCtrl4.PictureBox.Image = args.Image; break;
case 4: cameraPictureCtrl5.PictureBox.Image = args.Image; break;
case 5: cameraPictureCtrl6.PictureBox.Image = args.Image; break;
case 0: cameraPictureCtrl1.Image = args.Image; break;
case 1: cameraPictureCtrl2.Image = args.Image; break;
case 2: cameraPictureCtrl3.Image = args.Image; break;
case 3: cameraPictureCtrl4.Image = args.Image; break;
case 4: cameraPictureCtrl5.Image = args.Image; break;
case 5: cameraPictureCtrl6.Image = args.Image; break;
default: break;
}
}
void ShowInfo(object sender, CameraInfoEventArgs args)
{
switch (args.CameraIdx)
{
case 0: cameraPictureCtrl1.Caption = args.Info; break;
case 1: cameraPictureCtrl2.Caption = args.Info; break;
case 2: cameraPictureCtrl3.Caption = args.Info; break;
case 3: cameraPictureCtrl4.Caption = args.Info; break;
case 4: cameraPictureCtrl5.Caption = args.Info; break;
case 5: cameraPictureCtrl6.Caption = args.Info; break;
default: break;
}
}
private void configureButton_Click(object sender, EventArgs e)
{
}
private void grabButton_Click(object sender, EventArgs e)
{
}
private void liveButton_Click(object sender, EventArgs e)
{
}
private void focusButton_Click(object sender, EventArgs e)
{
}
}
}

View File

@ -162,92 +162,14 @@
<data name="splitContainer.Orientation" type="System.Windows.Forms.Orientation, System.Windows.Forms">
<value>Horizontal</value>
</data>
<data name="focusButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<data name="configureButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="focusButton.Location" type="System.Drawing.Point, System.Drawing">
<value>386, 7</value>
</data>
<data name="focusButton.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 30</value>
</data>
<data name="focusButton.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="focusButton.Text" xml:space="preserve">
<value>Focus</value>
</data>
<data name="&gt;&gt;focusButton.Name" xml:space="preserve">
<value>focusButton</value>
</data>
<data name="&gt;&gt;focusButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;focusButton.Parent" xml:space="preserve">
<value>splitContainer.Panel1</value>
</data>
<data name="&gt;&gt;focusButton.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="liveButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="liveButton.Location" type="System.Drawing.Point, System.Drawing">
<value>280, 7</value>
</data>
<data name="liveButton.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 30</value>
</data>
<data name="liveButton.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="liveButton.Text" xml:space="preserve">
<value>Live</value>
</data>
<data name="&gt;&gt;liveButton.Name" xml:space="preserve">
<value>liveButton</value>
</data>
<data name="&gt;&gt;liveButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;liveButton.Parent" xml:space="preserve">
<value>splitContainer.Panel1</value>
</data>
<data name="&gt;&gt;liveButton.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="grabButton.Location" type="System.Drawing.Point, System.Drawing">
<value>174, 7</value>
</data>
<data name="grabButton.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 30</value>
</data>
<data name="grabButton.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="grabButton.Text" xml:space="preserve">
<value>Grab</value>
</data>
<data name="&gt;&gt;grabButton.Name" xml:space="preserve">
<value>grabButton</value>
</data>
<data name="&gt;&gt;grabButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;grabButton.Parent" xml:space="preserve">
<value>splitContainer.Panel1</value>
</data>
<data name="&gt;&gt;grabButton.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="configureButton.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="configureButton.Location" type="System.Drawing.Point, System.Drawing">
<value>20, 7</value>
<value>2, 5</value>
</data>
<data name="configureButton.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 30</value>
<value>100, 21</value>
</data>
<data name="configureButton.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
@ -255,9 +177,6 @@
<data name="configureButton.Text" xml:space="preserve">
<value>Configure</value>
</data>
<data name="configureButton.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;configureButton.Name" xml:space="preserve">
<value>configureButton</value>
</data>
@ -268,7 +187,7 @@
<value>splitContainer.Panel1</value>
</data>
<data name="&gt;&gt;configureButton.ZOrder" xml:space="preserve">
<value>3</value>
<value>0</value>
</data>
<data name="&gt;&gt;splitContainer.Panel1.Name" xml:space="preserve">
<value>splitContainer.Panel1</value>
@ -283,10 +202,10 @@
<value>0</value>
</data>
<data name="cameraPictureCtrl6.Location" type="System.Drawing.Point, System.Drawing">
<value>673, 323</value>
<value>667, 290</value>
</data>
<data name="cameraPictureCtrl6.Size" type="System.Drawing.Size, System.Drawing">
<value>334, 320</value>
<value>333, 288</value>
</data>
<data name="cameraPictureCtrl6.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
@ -295,7 +214,7 @@
<value>cameraPictureCtrl6</value>
</data>
<data name="&gt;&gt;cameraPictureCtrl6.Type" xml:space="preserve">
<value>TBF.UiControls.CameraPictureCtrl, TBF, Version=2.16.655.1, Culture=neutral, PublicKeyToken=null</value>
<value>TBF.UiControls.CameraPictureCtrl, TBF, Version=2.16.668.1, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;cameraPictureCtrl6.Parent" xml:space="preserve">
<value>splitContainer.Panel2</value>
@ -304,10 +223,10 @@
<value>0</value>
</data>
<data name="cameraPictureCtrl5.Location" type="System.Drawing.Point, System.Drawing">
<value>338, 323</value>
<value>335, 290</value>
</data>
<data name="cameraPictureCtrl5.Size" type="System.Drawing.Size, System.Drawing">
<value>334, 320</value>
<value>333, 288</value>
</data>
<data name="cameraPictureCtrl5.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
@ -316,7 +235,7 @@
<value>cameraPictureCtrl5</value>
</data>
<data name="&gt;&gt;cameraPictureCtrl5.Type" xml:space="preserve">
<value>TBF.UiControls.CameraPictureCtrl, TBF, Version=2.16.655.1, Culture=neutral, PublicKeyToken=null</value>
<value>TBF.UiControls.CameraPictureCtrl, TBF, Version=2.16.668.1, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;cameraPictureCtrl5.Parent" xml:space="preserve">
<value>splitContainer.Panel2</value>
@ -325,10 +244,10 @@
<value>1</value>
</data>
<data name="cameraPictureCtrl4.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 323</value>
<value>3, 290</value>
</data>
<data name="cameraPictureCtrl4.Size" type="System.Drawing.Size, System.Drawing">
<value>334, 320</value>
<value>333, 288</value>
</data>
<data name="cameraPictureCtrl4.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
@ -337,7 +256,7 @@
<value>cameraPictureCtrl4</value>
</data>
<data name="&gt;&gt;cameraPictureCtrl4.Type" xml:space="preserve">
<value>TBF.UiControls.CameraPictureCtrl, TBF, Version=2.16.655.1, Culture=neutral, PublicKeyToken=null</value>
<value>TBF.UiControls.CameraPictureCtrl, TBF, Version=2.16.668.1, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;cameraPictureCtrl4.Parent" xml:space="preserve">
<value>splitContainer.Panel2</value>
@ -346,10 +265,10 @@
<value>2</value>
</data>
<data name="cameraPictureCtrl3.Location" type="System.Drawing.Point, System.Drawing">
<value>673, 3</value>
<value>667, 3</value>
</data>
<data name="cameraPictureCtrl3.Size" type="System.Drawing.Size, System.Drawing">
<value>334, 320</value>
<value>333, 288</value>
</data>
<data name="cameraPictureCtrl3.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
@ -358,7 +277,7 @@
<value>cameraPictureCtrl3</value>
</data>
<data name="&gt;&gt;cameraPictureCtrl3.Type" xml:space="preserve">
<value>TBF.UiControls.CameraPictureCtrl, TBF, Version=2.16.655.1, Culture=neutral, PublicKeyToken=null</value>
<value>TBF.UiControls.CameraPictureCtrl, TBF, Version=2.16.668.1, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;cameraPictureCtrl3.Parent" xml:space="preserve">
<value>splitContainer.Panel2</value>
@ -367,10 +286,10 @@
<value>3</value>
</data>
<data name="cameraPictureCtrl2.Location" type="System.Drawing.Point, System.Drawing">
<value>338, 3</value>
<value>335, 3</value>
</data>
<data name="cameraPictureCtrl2.Size" type="System.Drawing.Size, System.Drawing">
<value>334, 320</value>
<value>333, 288</value>
</data>
<data name="cameraPictureCtrl2.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
@ -379,7 +298,7 @@
<value>cameraPictureCtrl2</value>
</data>
<data name="&gt;&gt;cameraPictureCtrl2.Type" xml:space="preserve">
<value>TBF.UiControls.CameraPictureCtrl, TBF, Version=2.16.655.1, Culture=neutral, PublicKeyToken=null</value>
<value>TBF.UiControls.CameraPictureCtrl, TBF, Version=2.16.668.1, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;cameraPictureCtrl2.Parent" xml:space="preserve">
<value>splitContainer.Panel2</value>
@ -391,7 +310,7 @@
<value>3, 3</value>
</data>
<data name="cameraPictureCtrl1.Size" type="System.Drawing.Size, System.Drawing">
<value>334, 320</value>
<value>333, 288</value>
</data>
<data name="cameraPictureCtrl1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -400,7 +319,7 @@
<value>cameraPictureCtrl1</value>
</data>
<data name="&gt;&gt;cameraPictureCtrl1.Type" xml:space="preserve">
<value>TBF.UiControls.CameraPictureCtrl, TBF, Version=2.16.655.1, Culture=neutral, PublicKeyToken=null</value>
<value>TBF.UiControls.CameraPictureCtrl, TBF, Version=2.16.668.1, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;cameraPictureCtrl1.Parent" xml:space="preserve">
<value>splitContainer.Panel2</value>
@ -424,7 +343,7 @@
<value>1033, 689</value>
</data>
<data name="splitContainer.SplitterDistance" type="System.Int32, mscorlib">
<value>42</value>
<value>30</value>
</data>
<data name="splitContainer.TabIndex" type="System.Int32, mscorlib">
<value>2</value>

View File

@ -1692,6 +1692,7 @@
<Compile Include="UiBridge\AdjustmentInProgressEventArgs.cs" />
<Compile Include="UiBridge\Bridge.cs" />
<Compile Include="UiBridge\ButtonsEtcEventArgs.cs" />
<Compile Include="UiBridge\CameraInfoEventArgs.cs" />
<Compile Include="UiBridge\EmergencyStopEventArgs.cs" />
<Compile Include="UiBridge\Enums.cs" />
<Compile Include="UiBridge\ImageEventArgs.cs" />

View File

@ -142,6 +142,17 @@ namespace TBF.UiBridge
public static event EventHandler<ProcedureCompletedEventArgs> ProcedureCompletedHandler;
/// <summary>
/// Called from a camera when camera state (shown as a caption in PicturesTabPage) changes
/// </summary>
public static void OnCameraInfo(int cameraIdx, string info)
{
if (CameraInfoHandler == null) return;
try { CameraInfoHandler(null, new CameraInfoEventArgs(cameraIdx, info)); }
catch (Exception e) { log.Error("CameraInfoHandler(...) failed", e); }
}
public static event EventHandler<CameraInfoEventArgs> CameraInfoHandler;
/// <summary>
/// Called from any RTP listener thread (e.g. MJpeg RTP listener thread)
/// </summary>

View File

@ -0,0 +1,22 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TBF.UiBridge
{
public class CameraInfoEventArgs : EventArgs
{
public int CameraIdx;
public string Info;
public CameraInfoEventArgs(int cameraIdx, string info)
{
this.CameraIdx = cameraIdx;
this.Info = info;
}
}
}

View File

@ -34,14 +34,9 @@ namespace TBF.UiControls
this.pictureBox = new System.Windows.Forms.PictureBox();
this.groupBox = new System.Windows.Forms.GroupBox();
this.ledPictureBox = new System.Windows.Forms.PictureBox();
this.trackBar = new System.Windows.Forms.TrackBar();
this.liveButton = new System.Windows.Forms.Button();
this.focusButton = new System.Windows.Forms.Button();
this.grabButton = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
this.groupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ledPictureBox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit();
this.SuspendLayout();
//
// pictureBox
@ -55,65 +50,25 @@ namespace TBF.UiControls
//
// groupBox
//
this.groupBox.BackColor = System.Drawing.SystemColors.Control;
this.groupBox.Controls.Add(this.ledPictureBox);
this.groupBox.Controls.Add(this.trackBar);
this.groupBox.Controls.Add(this.liveButton);
this.groupBox.Controls.Add(this.focusButton);
this.groupBox.Controls.Add(this.grabButton);
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, 315);
this.groupBox.Size = new System.Drawing.Size(332, 280);
this.groupBox.TabIndex = 1;
this.groupBox.TabStop = false;
this.groupBox.Text = "Camera ";
//
// ledPictureBox
//
this.ledPictureBox.Location = new System.Drawing.Point(6, 279);
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;
//
// trackBar
//
this.trackBar.Location = new System.Drawing.Point(200, 264);
this.trackBar.Name = "trackBar";
this.trackBar.Size = new System.Drawing.Size(126, 45);
this.trackBar.TabIndex = 4;
this.trackBar.Scroll += new System.EventHandler(this.trackBar_Scroll);
//
// liveButton
//
this.liveButton.Location = new System.Drawing.Point(81, 264);
this.liveButton.Name = "liveButton";
this.liveButton.Size = new System.Drawing.Size(56, 45);
this.liveButton.TabIndex = 3;
this.liveButton.Text = "Live";
this.liveButton.UseVisualStyleBackColor = true;
this.liveButton.Click += new System.EventHandler(this.liveButton_Click);
//
// focusButton
//
this.focusButton.Location = new System.Drawing.Point(138, 264);
this.focusButton.Name = "focusButton";
this.focusButton.Size = new System.Drawing.Size(56, 45);
this.focusButton.TabIndex = 2;
this.focusButton.Text = "Focus";
this.focusButton.UseVisualStyleBackColor = true;
this.focusButton.Click += new System.EventHandler(this.focusButton_Click);
//
// grabButton
//
this.grabButton.Location = new System.Drawing.Point(24, 264);
this.grabButton.Name = "grabButton";
this.grabButton.Size = new System.Drawing.Size(56, 45);
this.grabButton.TabIndex = 1;
this.grabButton.Text = "Grab";
this.grabButton.UseVisualStyleBackColor = true;
this.grabButton.Click += new System.EventHandler(this.grabButton_Click);
//
// CameraPictureCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -121,12 +76,10 @@ namespace TBF.UiControls
this.BackColor = System.Drawing.SystemColors.ButtonShadow;
this.Controls.Add(this.groupBox);
this.Name = "CameraPictureCtrl";
this.Size = new System.Drawing.Size(334, 320);
this.Size = new System.Drawing.Size(332, 280);
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
this.groupBox.ResumeLayout(false);
this.groupBox.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.ledPictureBox)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar)).EndInit();
this.ResumeLayout(false);
}
@ -134,11 +87,7 @@ namespace TBF.UiControls
#endregion
private System.Windows.Forms.PictureBox pictureBox;
private System.Windows.Forms.GroupBox groupBox;
private System.Windows.Forms.Button liveButton;
private System.Windows.Forms.Button focusButton;
private System.Windows.Forms.Button grabButton;
private System.Windows.Forms.PictureBox ledPictureBox;
private System.Windows.Forms.TrackBar trackBar;
private System.Windows.Forms.GroupBox groupBox;
private System.Windows.Forms.PictureBox ledPictureBox;
}
}

View File

@ -10,36 +10,35 @@ namespace TBF.UiControls
{
public partial class CameraPictureCtrl : UserControl
{
public PictureBox PictureBox { get { return pictureBox; } }
private DateTime imageTimeStamp;
public Image Image
{
set
{
pictureBox.Image = value;
imageTimeStamp = DateTime.Now;
ledPictureBox.BackColor = Color.Red;
}
}
public string Caption
{
set { groupBox.Text = value; }
}
public CameraPictureCtrl()
{
InitializeComponent();
groupBox.Text = Strings.Camera;
grabButton.Text = Strings.Grab;
liveButton.Text = Strings.Live;
focusButton.Text = Strings.Focus;
groupBox.Text = "No info available";
}
private void grabButton_Click(object sender, EventArgs e)
{
}
private void liveButton_Click(object sender, EventArgs e)
{
}
private void focusButton_Click(object sender, EventArgs e)
{
}
private void trackBar_Scroll(object sender, EventArgs e)
{
}
public void UpdateLed(DateTime now)
{
ledPictureBox.BackColor = (now - imageTimeStamp > TimeSpan.FromMilliseconds(500))
? SystemColors.Control
: Color.Red;
}
}
}