CameraUICmd and CameraUICmdEventArgs added ti UiBridge
This commit is contained in:
parent
75f72cb04e
commit
4cc9715f57
@ -36,6 +36,10 @@ namespace TBF.Screens
|
|||||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||||
this.minusButton = new System.Windows.Forms.Button();
|
this.minusButton = new System.Windows.Forms.Button();
|
||||||
this.plusButton = new System.Windows.Forms.Button();
|
this.plusButton = new System.Windows.Forms.Button();
|
||||||
|
this.liveButton = new System.Windows.Forms.Button();
|
||||||
|
this.stopButton = new System.Windows.Forms.Button();
|
||||||
|
this.grabButton = new System.Windows.Forms.Button();
|
||||||
|
this.saveImageButton = new System.Windows.Forms.Button();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||||
this.splitContainer1.Panel1.SuspendLayout();
|
this.splitContainer1.Panel1.SuspendLayout();
|
||||||
this.splitContainer1.Panel2.SuspendLayout();
|
this.splitContainer1.Panel2.SuspendLayout();
|
||||||
@ -63,6 +67,10 @@ namespace TBF.Screens
|
|||||||
// splitContainer1.Panel2
|
// splitContainer1.Panel2
|
||||||
//
|
//
|
||||||
this.splitContainer1.Panel2.BackColor = System.Drawing.SystemColors.ControlLight;
|
this.splitContainer1.Panel2.BackColor = System.Drawing.SystemColors.ControlLight;
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.saveImageButton);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.grabButton);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.stopButton);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.liveButton);
|
||||||
this.splitContainer1.Panel2.Controls.Add(this.minusButton);
|
this.splitContainer1.Panel2.Controls.Add(this.minusButton);
|
||||||
this.splitContainer1.Panel2.Controls.Add(this.plusButton);
|
this.splitContainer1.Panel2.Controls.Add(this.plusButton);
|
||||||
//
|
//
|
||||||
@ -80,6 +88,34 @@ namespace TBF.Screens
|
|||||||
this.plusButton.UseVisualStyleBackColor = true;
|
this.plusButton.UseVisualStyleBackColor = true;
|
||||||
this.plusButton.Click += new System.EventHandler(this.plusButton_Click);
|
this.plusButton.Click += new System.EventHandler(this.plusButton_Click);
|
||||||
//
|
//
|
||||||
|
// liveButton
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.liveButton, "liveButton");
|
||||||
|
this.liveButton.Name = "liveButton";
|
||||||
|
this.liveButton.UseVisualStyleBackColor = true;
|
||||||
|
this.liveButton.Click += new System.EventHandler(this.liveButton_Click);
|
||||||
|
//
|
||||||
|
// stopButton
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.stopButton, "stopButton");
|
||||||
|
this.stopButton.Name = "stopButton";
|
||||||
|
this.stopButton.UseVisualStyleBackColor = true;
|
||||||
|
this.stopButton.Click += new System.EventHandler(this.stopButton_Click);
|
||||||
|
//
|
||||||
|
// grabButton
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.grabButton, "grabButton");
|
||||||
|
this.grabButton.Name = "grabButton";
|
||||||
|
this.grabButton.UseVisualStyleBackColor = true;
|
||||||
|
this.grabButton.Click += new System.EventHandler(this.grabButton_Click);
|
||||||
|
//
|
||||||
|
// saveImageButton
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.saveImageButton, "saveImageButton");
|
||||||
|
this.saveImageButton.Name = "saveImageButton";
|
||||||
|
this.saveImageButton.UseVisualStyleBackColor = true;
|
||||||
|
this.saveImageButton.Click += new System.EventHandler(this.saveImageButton_Click);
|
||||||
|
//
|
||||||
// PicturesTabPageCtrl
|
// PicturesTabPageCtrl
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this, "$this");
|
resources.ApplyResources(this, "$this");
|
||||||
@ -101,5 +137,9 @@ namespace TBF.Screens
|
|||||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||||
private System.Windows.Forms.Button minusButton;
|
private System.Windows.Forms.Button minusButton;
|
||||||
private System.Windows.Forms.Button plusButton;
|
private System.Windows.Forms.Button plusButton;
|
||||||
|
private System.Windows.Forms.Button grabButton;
|
||||||
|
private System.Windows.Forms.Button stopButton;
|
||||||
|
private System.Windows.Forms.Button liveButton;
|
||||||
|
private System.Windows.Forms.Button saveImageButton;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
/// Copyright (c) 2017 Sensus Metering Systems
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -8,6 +8,8 @@ using log4net;
|
|||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
using TBF.Resources;
|
using TBF.Resources;
|
||||||
using TBF.UiBridge;
|
using TBF.UiBridge;
|
||||||
|
using TBF.BenchControl;
|
||||||
|
using TBF.BenchControl.Network.Camera.CLP1611;
|
||||||
|
|
||||||
namespace TBF.Screens
|
namespace TBF.Screens
|
||||||
{
|
{
|
||||||
@ -139,5 +141,26 @@ namespace TBF.Screens
|
|||||||
picturesFlowLayoutPanel.Controls.Add(ctrl);
|
picturesFlowLayoutPanel.Controls.Add(ctrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
private void grabButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Bridge.OnCameraUICmd(this, new CameraUICmdEventArgs(CameraUICmd.Grab, -1));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void liveButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Bridge.OnCameraUICmd(this, new CameraUICmdEventArgs(CameraUICmd.Live, -1));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void stopButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Bridge.OnCameraUICmd(this, new CameraUICmdEventArgs(CameraUICmd.Stop, -1));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void saveImageButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Bridge.OnCameraUICmd(this, new CameraUICmdEventArgs(CameraUICmd.SaveImage, -1));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -130,7 +130,7 @@
|
|||||||
<value>0, 0</value>
|
<value>0, 0</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="picturesFlowLayoutPanel.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="picturesFlowLayoutPanel.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>1009, 689</value>
|
<value>1007, 689</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="picturesFlowLayoutPanel.TabIndex" type="System.Int32, mscorlib">
|
<data name="picturesFlowLayoutPanel.TabIndex" type="System.Int32, mscorlib">
|
||||||
<value>0</value>
|
<value>0</value>
|
||||||
@ -165,14 +165,134 @@
|
|||||||
<data name=">>splitContainer1.Panel1.ZOrder" xml:space="preserve">
|
<data name=">>splitContainer1.Panel1.ZOrder" xml:space="preserve">
|
||||||
<value>0</value>
|
<value>0</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="saveImageButton.Font" type="System.Drawing.Font, System.Drawing">
|
||||||
|
<value>Arial, 8.25pt, style=Bold</value>
|
||||||
|
</data>
|
||||||
|
<data name="saveImageButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||||
|
<value>NoControl</value>
|
||||||
|
</data>
|
||||||
|
<data name="saveImageButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>1, 189</value>
|
||||||
|
</data>
|
||||||
|
<data name="saveImageButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>23, 23</value>
|
||||||
|
</data>
|
||||||
|
<data name="saveImageButton.TabIndex" type="System.Int32, mscorlib">
|
||||||
|
<value>5</value>
|
||||||
|
</data>
|
||||||
|
<data name="saveImageButton.Text" xml:space="preserve">
|
||||||
|
<value>S</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>saveImageButton.Name" xml:space="preserve">
|
||||||
|
<value>saveImageButton</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>saveImageButton.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=">>saveImageButton.Parent" xml:space="preserve">
|
||||||
|
<value>splitContainer1.Panel2</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>saveImageButton.ZOrder" xml:space="preserve">
|
||||||
|
<value>0</value>
|
||||||
|
</data>
|
||||||
|
<data name="grabButton.Font" type="System.Drawing.Font, System.Drawing">
|
||||||
|
<value>Arial, 8.25pt, style=Bold</value>
|
||||||
|
</data>
|
||||||
|
<data name="grabButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||||
|
<value>NoControl</value>
|
||||||
|
</data>
|
||||||
|
<data name="grabButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>1, 102</value>
|
||||||
|
</data>
|
||||||
|
<data name="grabButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>23, 23</value>
|
||||||
|
</data>
|
||||||
|
<data name="grabButton.TabIndex" type="System.Int32, mscorlib">
|
||||||
|
<value>4</value>
|
||||||
|
</data>
|
||||||
|
<data name="grabButton.Text" xml:space="preserve">
|
||||||
|
<value>o</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>grabButton.Name" xml:space="preserve">
|
||||||
|
<value>grabButton</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>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=">>grabButton.Parent" xml:space="preserve">
|
||||||
|
<value>splitContainer1.Panel2</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>grabButton.ZOrder" xml:space="preserve">
|
||||||
|
<value>1</value>
|
||||||
|
</data>
|
||||||
|
<data name="stopButton.Font" type="System.Drawing.Font, System.Drawing">
|
||||||
|
<value>Arial, 8.25pt</value>
|
||||||
|
</data>
|
||||||
|
<data name="stopButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||||
|
<value>NoControl</value>
|
||||||
|
</data>
|
||||||
|
<data name="stopButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>1, 160</value>
|
||||||
|
</data>
|
||||||
|
<data name="stopButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>23, 23</value>
|
||||||
|
</data>
|
||||||
|
<data name="stopButton.TabIndex" type="System.Int32, mscorlib">
|
||||||
|
<value>3</value>
|
||||||
|
</data>
|
||||||
|
<data name="stopButton.Text" xml:space="preserve">
|
||||||
|
<value>■</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>stopButton.Name" xml:space="preserve">
|
||||||
|
<value>stopButton</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>stopButton.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=">>stopButton.Parent" xml:space="preserve">
|
||||||
|
<value>splitContainer1.Panel2</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>stopButton.ZOrder" xml:space="preserve">
|
||||||
|
<value>2</value>
|
||||||
|
</data>
|
||||||
|
<data name="liveButton.Font" type="System.Drawing.Font, System.Drawing">
|
||||||
|
<value>Arial, 8.25pt</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>1, 131</value>
|
||||||
|
</data>
|
||||||
|
<data name="liveButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>23, 23</value>
|
||||||
|
</data>
|
||||||
|
<data name="liveButton.TabIndex" type="System.Int32, mscorlib">
|
||||||
|
<value>2</value>
|
||||||
|
</data>
|
||||||
|
<data name="liveButton.Text" xml:space="preserve">
|
||||||
|
<value>►</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>liveButton.Name" xml:space="preserve">
|
||||||
|
<value>liveButton</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>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=">>liveButton.Parent" xml:space="preserve">
|
||||||
|
<value>splitContainer1.Panel2</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>liveButton.ZOrder" xml:space="preserve">
|
||||||
|
<value>3</value>
|
||||||
|
</data>
|
||||||
<data name="minusButton.Font" type="System.Drawing.Font, System.Drawing">
|
<data name="minusButton.Font" type="System.Drawing.Font, System.Drawing">
|
||||||
<value>Microsoft Sans Serif, 8.25pt, style=Bold</value>
|
<value>Arial, 8.25pt</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="minusButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
<data name="minusButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||||
<value>NoControl</value>
|
<value>NoControl</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="minusButton.Location" type="System.Drawing.Point, System.Drawing">
|
<data name="minusButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
<value>0, 33</value>
|
<value>1, 33</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="minusButton.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="minusButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>23, 23</value>
|
<value>23, 23</value>
|
||||||
@ -193,13 +313,13 @@
|
|||||||
<value>splitContainer1.Panel2</value>
|
<value>splitContainer1.Panel2</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>minusButton.ZOrder" xml:space="preserve">
|
<data name=">>minusButton.ZOrder" xml:space="preserve">
|
||||||
<value>0</value>
|
<value>4</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="plusButton.Font" type="System.Drawing.Font, System.Drawing">
|
<data name="plusButton.Font" type="System.Drawing.Font, System.Drawing">
|
||||||
<value>Microsoft Sans Serif, 8.25pt, style=Bold</value>
|
<value>Arial, 8.25pt</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="plusButton.Location" type="System.Drawing.Point, System.Drawing">
|
<data name="plusButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
<value>0, 7</value>
|
<value>1, 7</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="plusButton.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="plusButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>23, 23</value>
|
<value>23, 23</value>
|
||||||
@ -220,7 +340,7 @@
|
|||||||
<value>splitContainer1.Panel2</value>
|
<value>splitContainer1.Panel2</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>plusButton.ZOrder" xml:space="preserve">
|
<data name=">>plusButton.ZOrder" xml:space="preserve">
|
||||||
<value>1</value>
|
<value>5</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>splitContainer1.Panel2.Name" xml:space="preserve">
|
<data name=">>splitContainer1.Panel2.Name" xml:space="preserve">
|
||||||
<value>splitContainer1.Panel2</value>
|
<value>splitContainer1.Panel2</value>
|
||||||
@ -241,7 +361,7 @@
|
|||||||
<value>1033, 689</value>
|
<value>1033, 689</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="splitContainer1.SplitterDistance" type="System.Int32, mscorlib">
|
<data name="splitContainer1.SplitterDistance" type="System.Int32, mscorlib">
|
||||||
<value>1009</value>
|
<value>1007</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="splitContainer1.SplitterWidth" type="System.Int32, mscorlib">
|
<data name="splitContainer1.SplitterWidth" type="System.Int32, mscorlib">
|
||||||
<value>1</value>
|
<value>1</value>
|
||||||
|
|||||||
@ -1711,6 +1711,7 @@
|
|||||||
<Compile Include="UiBridge\Bridge.cs" />
|
<Compile Include="UiBridge\Bridge.cs" />
|
||||||
<Compile Include="UiBridge\ButtonsEtcEventArgs.cs" />
|
<Compile Include="UiBridge\ButtonsEtcEventArgs.cs" />
|
||||||
<Compile Include="UiBridge\CameraInfoEventArgs.cs" />
|
<Compile Include="UiBridge\CameraInfoEventArgs.cs" />
|
||||||
|
<Compile Include="UiBridge\CameraUICmdEventArgs.cs" />
|
||||||
<Compile Include="UiBridge\EmergencyStopEventArgs.cs" />
|
<Compile Include="UiBridge\EmergencyStopEventArgs.cs" />
|
||||||
<Compile Include="UiBridge\Enums.cs" />
|
<Compile Include="UiBridge\Enums.cs" />
|
||||||
<Compile Include="UiBridge\ImageEventArgs.cs" />
|
<Compile Include="UiBridge\ImageEventArgs.cs" />
|
||||||
|
|||||||
@ -142,29 +142,6 @@ namespace TBF.UiBridge
|
|||||||
public static event EventHandler<ProcedureCompletedEventArgs> ProcedureCompletedHandler;
|
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>
|
|
||||||
public static void OnImage(int cameraIdx, System.Drawing.Image image)
|
|
||||||
{
|
|
||||||
if (ImageHandler == null) return;
|
|
||||||
try { ImageHandler(null, new ImageEventArgs(cameraIdx, image)); }
|
|
||||||
catch (Exception e) { log.Error("ImageHandler(...) failed", e); }
|
|
||||||
}
|
|
||||||
public static event EventHandler<ImageEventArgs> ImageHandler;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called from the state machine when there is and information to be logged.
|
/// Called from the state machine when there is and information to be logged.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -247,5 +224,40 @@ namespace TBF.UiBridge
|
|||||||
catch (Exception e) { log.Error("CloseQandAFormHandler(...) failed", e); }
|
catch (Exception e) { log.Error("CloseQandAFormHandler(...) failed", e); }
|
||||||
}
|
}
|
||||||
public static event EventHandler<EventArgs> CloseQandAFormHandler;
|
public static event EventHandler<EventArgs> CloseQandAFormHandler;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called from the state machine when a procedure is selected and UI needs to be updated.
|
||||||
|
/// </summary>
|
||||||
|
public static void OnCameraUICmd(object sender, CameraUICmdEventArgs data)
|
||||||
|
{
|
||||||
|
if (CameraUICmdHandler == null) return;
|
||||||
|
try { CameraUICmdHandler(sender, data); }
|
||||||
|
catch (Exception e) { log.Error("CameraUICmdHandler(...) failed", e); }
|
||||||
|
}
|
||||||
|
public static event EventHandler<CameraUICmdEventArgs> CameraUICmdHandler;
|
||||||
|
|
||||||
|
/// <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>
|
||||||
|
public static void OnImage(int cameraIdx, System.Drawing.Image image)
|
||||||
|
{
|
||||||
|
if (ImageHandler == null) return;
|
||||||
|
try { ImageHandler(null, new ImageEventArgs(cameraIdx, image)); }
|
||||||
|
catch (Exception e) { log.Error("ImageHandler(...) failed", e); }
|
||||||
|
}
|
||||||
|
public static event EventHandler<ImageEventArgs> ImageHandler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
28
TestBenchFramework/UiBridge/CameraUICmdEventArgs.cs
Normal file
28
TestBenchFramework/UiBridge/CameraUICmdEventArgs.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2017 Sensus Metering Systems
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace TBF.UiBridge
|
||||||
|
{
|
||||||
|
public enum CameraUICmd
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
Grab,
|
||||||
|
Live,
|
||||||
|
Stop,
|
||||||
|
SaveImage,
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CameraUICmdEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public CameraUICmd CameraUICmd;
|
||||||
|
public int CameraIdx; /// 0-based camera index/identifier. -1 = all cameras
|
||||||
|
|
||||||
|
public CameraUICmdEventArgs(CameraUICmd cameraUICmd, int cameraIdx)
|
||||||
|
{
|
||||||
|
CameraUICmd = cameraUICmd;
|
||||||
|
CameraIdx = cameraIdx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,7 +8,7 @@ namespace TBF.UiBridge
|
|||||||
{
|
{
|
||||||
public class ImageEventArgs : EventArgs
|
public class ImageEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
public int CameraIdx;
|
public int CameraIdx; /// 0-based camera index/identifier
|
||||||
public Image Image;
|
public Image Image;
|
||||||
|
|
||||||
public ImageEventArgs(int cameraIdx, Image image)
|
public ImageEventArgs(int cameraIdx, Image image)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user