Network.Camera.CLP1611.LiveStreamOp added, ver. 2.12.470
This commit is contained in:
@@ -17,6 +17,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
public bool DisplayTerminal;
|
||||
public bool UseTestImages;
|
||||
public int TestImagesCount;
|
||||
public string VlcExePath;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
CameraCfg() { }
|
||||
@@ -30,6 +31,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
HardwareAddress = 1;
|
||||
UseTestImages = false;
|
||||
TestImagesCount = 0;
|
||||
VlcExePath = "C:\\Program Files (x86)\\VideoLAN\\VLC\\";
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
|
||||
@@ -66,6 +66,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
displayTerminalCheckBox.Checked = config.DisplayTerminal;
|
||||
useTestImagesCheckBox.Checked = config.UseTestImages;
|
||||
testImagesCountTextBox.Text = config.TestImagesCount.ToString();
|
||||
vlcExePathTextBox.Text = config.VlcExePath;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
@@ -76,6 +77,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
displayTerminalCheckBox.Enabled = true;
|
||||
useTestImagesCheckBox.Enabled = true;
|
||||
testImagesCountTextBox.Enabled = true;
|
||||
vlcExePathTextBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
@@ -93,6 +95,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
{
|
||||
config.TestImagesCount = int.Parse(testImagesCountTextBox.Text);
|
||||
}
|
||||
config.VlcExePath = vlcExePathTextBox.Text;
|
||||
|
||||
return flags;
|
||||
}
|
||||
@@ -118,6 +121,12 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Images count' should be between 1 and 50";
|
||||
}
|
||||
if (!System.IO.Directory.Exists(vlcExePathTextBox.Text))
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'vlc.exe path' is not correct";
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
|
||||
+24
-1
@@ -42,6 +42,8 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
this.useTestImagesCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.testImagesCountTextBox = new System.Windows.Forms.TextBox();
|
||||
this.testImagesCountLabel = new System.Windows.Forms.Label();
|
||||
this.vlcExePathTextBox = new System.Windows.Forms.TextBox();
|
||||
this.vlcExePathLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// hwAddressTextBox
|
||||
@@ -144,10 +146,29 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
this.testImagesCountLabel.TabIndex = 15;
|
||||
this.testImagesCountLabel.Text = "Images count";
|
||||
//
|
||||
// vlcExePathTextBox
|
||||
//
|
||||
this.vlcExePathTextBox.Enabled = false;
|
||||
this.vlcExePathTextBox.Location = new System.Drawing.Point(122, 198);
|
||||
this.vlcExePathTextBox.Name = "vlcExePathTextBox";
|
||||
this.vlcExePathTextBox.Size = new System.Drawing.Size(277, 20);
|
||||
this.vlcExePathTextBox.TabIndex = 18;
|
||||
//
|
||||
// vlcExePathLabel
|
||||
//
|
||||
this.vlcExePathLabel.AutoSize = true;
|
||||
this.vlcExePathLabel.Location = new System.Drawing.Point(36, 201);
|
||||
this.vlcExePathLabel.Name = "vlcExePathLabel";
|
||||
this.vlcExePathLabel.Size = new System.Drawing.Size(65, 13);
|
||||
this.vlcExePathLabel.TabIndex = 17;
|
||||
this.vlcExePathLabel.Text = "vlc.exe path";
|
||||
//
|
||||
// CameraCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.vlcExePathTextBox);
|
||||
this.Controls.Add(this.vlcExePathLabel);
|
||||
this.Controls.Add(this.testImagesCountTextBox);
|
||||
this.Controls.Add(this.testImagesCountLabel);
|
||||
this.Controls.Add(this.useTestImagesCheckBox);
|
||||
@@ -160,7 +181,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
this.Name = "CameraCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(300, 200);
|
||||
this.Size = new System.Drawing.Size(402, 254);
|
||||
this.Load += new System.EventHandler(this.PumpCfgCtrl_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
@@ -180,5 +201,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
private System.Windows.Forms.CheckBox useTestImagesCheckBox;
|
||||
private System.Windows.Forms.TextBox testImagesCountTextBox;
|
||||
private System.Windows.Forms.Label testImagesCountLabel;
|
||||
private System.Windows.Forms.TextBox vlcExePathTextBox;
|
||||
private System.Windows.Forms.Label vlcExePathLabel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using TBF.BenchControl.Network.Telnet;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using TBF.BenchControl.Network.Telnet;
|
||||
|
||||
namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
{
|
||||
@@ -36,6 +38,12 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
telnet.Enqueue(new Telnet.Command(Telnet.CmdAction.SEND_STRING, command));
|
||||
liveStreamCommandSent = true;
|
||||
}
|
||||
|
||||
Process process = new Process();
|
||||
process.StartInfo = new ProcessStartInfo("CMD.exe");
|
||||
process.StartInfo.Arguments = string.Format("/C \"{0}\" rtsp://{1}:8554/", System.IO.Path.Combine(camera.CameraCfg.VlcExePath, "vlc.exe"), camera.IPAddress); ;
|
||||
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
process.Start();
|
||||
}
|
||||
return Event.None;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace TBF.BenchControl
|
||||
Factories.Add(new TestMethods.FlyingStartMassCollection.Compound.Factory());
|
||||
Factories.Add(new TestMethods.FlyingStartMassCollection.HeatMeters.Factory());
|
||||
Factories.Add(new TestMethods.LeakTest.TestMethodFactory());
|
||||
Factories.Add(new TestMethods.LiveStream.Factory());
|
||||
Factories.Add(new TestMethods.OuterLoop.Start.Factory());
|
||||
Factories.Add(new TestMethods.OuterLoop.End.Factory());
|
||||
Factories.Add(new TestMethods.PMaxTest.TestMethodFactory());
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.LiveStream
|
||||
{
|
||||
public class Cfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public IComponentCfgCtrl GetControl() { return new CfgCtrl(); }
|
||||
|
||||
|
||||
public bool HiResolution;
|
||||
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
Cfg() {}
|
||||
|
||||
public Cfg(IComponentFactory factory, string name)
|
||||
: this()
|
||||
{
|
||||
this.Factory = factory;
|
||||
Name = name;
|
||||
ParentName = string.Empty;
|
||||
HiResolution = false;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, HiResolution={1}", Name, HiResolution ? Strings.yes : Strings.no);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.LiveStream
|
||||
{
|
||||
public partial class CfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(CfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
Cfg config;
|
||||
public IComponentCfg Config
|
||||
{
|
||||
get { return config as IComponentCfg; }
|
||||
set
|
||||
{
|
||||
config = value as Cfg;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
|
||||
public CfgCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
Redraw();
|
||||
}
|
||||
|
||||
public void Closing()
|
||||
{
|
||||
}
|
||||
|
||||
void Redraw()
|
||||
{
|
||||
if (config == null) return; /// Control was not loaded, settings were not changed
|
||||
classNameLabel.Text = config.Factory.ClassName;
|
||||
nameTextBox.Text = config.Name;
|
||||
hiResolutionCheckBox.Checked = config.HiResolution;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
nameTextBox.Enabled = true;
|
||||
hiResolutionCheckBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
return CfgUpdateFlags.None;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
|
||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
|
||||
if (config.Name != nameTextBox.Text)
|
||||
{
|
||||
config.Name = nameTextBox.Text;
|
||||
flags |= (CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||
}
|
||||
|
||||
if (config.HiResolution != hiResolutionCheckBox.Checked)
|
||||
{
|
||||
config.HiResolution = hiResolutionCheckBox.Checked;
|
||||
flags |= (CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.TestMethods.LiveStream
|
||||
{
|
||||
partial class CfgCtrl
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
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.hiResolutionCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(134, 69);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
|
||||
this.nameTextBox.TabIndex = 7;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(24, 72);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 6;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
//
|
||||
this.classNameLabel.AutoSize = true;
|
||||
this.classNameLabel.Location = new System.Drawing.Point(131, 43);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
||||
this.classNameLabel.TabIndex = 5;
|
||||
this.classNameLabel.Text = "ComonentName";
|
||||
//
|
||||
// hiResolutionCheckBox
|
||||
//
|
||||
this.hiResolutionCheckBox.AutoSize = true;
|
||||
this.hiResolutionCheckBox.Enabled = false;
|
||||
this.hiResolutionCheckBox.Location = new System.Drawing.Point(134, 104);
|
||||
this.hiResolutionCheckBox.Name = "hiResolutionCheckBox";
|
||||
this.hiResolutionCheckBox.Size = new System.Drawing.Size(96, 17);
|
||||
this.hiResolutionCheckBox.TabIndex = 8;
|
||||
this.hiResolutionCheckBox.Text = "High resolution";
|
||||
this.hiResolutionCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// CfgCtrl
|
||||
//
|
||||
this.Controls.Add(this.hiResolutionCheckBox);
|
||||
this.Controls.Add(this.nameTextBox);
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
this.Name = "CfgCtrl";
|
||||
this.Size = new System.Drawing.Size(300, 240);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox nameTextBox;
|
||||
private System.Windows.Forms.Label nameLabel;
|
||||
private System.Windows.Forms.Label classNameLabel;
|
||||
private System.Windows.Forms.CheckBox hiResolutionCheckBox;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,39 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.LiveStream
|
||||
{
|
||||
public class Component : ComponentBase, GenericDevices.ITestMethod
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||
public override string ToString() { return string.Format("TestMethods.LiveStream({0})", Cfg.ToString(1)); }
|
||||
|
||||
public bool Evaluate(Test test) { return false; }
|
||||
public bool Publish(Test test) { return false; }
|
||||
public bool CanTest(MetersKind meters) { return true; }
|
||||
|
||||
Cfg cfg;
|
||||
|
||||
public Component()
|
||||
{
|
||||
}
|
||||
|
||||
public Component(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
log.Debug(this.ToString());
|
||||
this.cfg = cfg as Cfg;
|
||||
}
|
||||
|
||||
public IList<Event> Execute(Test test, bool bdummy, int idummy)
|
||||
{
|
||||
return (new LiveStreamSeq()).Execute(test, cfg.HiResolution);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.LiveStream
|
||||
{
|
||||
public class Factory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
|
||||
|
||||
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new Component(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new Cfg(this, this.GetType().Namespace.Substring(29)); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(typeof(Cfg), component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.UiBridge;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.LiveStream
|
||||
{
|
||||
public class LiveStreamSeq : Sequences.SequenceBase
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(LiveStreamSeq));
|
||||
|
||||
|
||||
public IList<Event> Execute(Test test, bool hiResolution)
|
||||
{
|
||||
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
||||
Event retVal = Event.Done;
|
||||
|
||||
/// Operations
|
||||
checkUiOp = new Operations.CheckUIOp(true);
|
||||
|
||||
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
|
||||
IList<IOperation> liveStreamOps = new List<IOperation>();
|
||||
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
if (rr is GenericDevices.IRoi)
|
||||
{
|
||||
GenericDevices.ICamera camera = (rr as GenericDevices.IRoi).Camera;
|
||||
if (!cameras.Contains(camera))
|
||||
{
|
||||
cameras.Add(camera);
|
||||
liveStreamOps.Add(camera.LiveStreamOp(hiResolution));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TestProgressEventArgs.SetEstimatedTimes(new int[] { 60, 0, 0, 0, 0, 60, 0 });
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.JustStarted));
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, "Live image");
|
||||
//------------------------------------------------
|
||||
State.Create("LiveStreamSeq : Live image")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(liveStreamOps)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.Test));
|
||||
|
||||
if (e.Contains(Event.Error))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (TestAndLogUiCmdStop(test,e))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (true);
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.Completed));
|
||||
|
||||
/// Create a list with one item 'retVal' (default is Event.Done) and return it
|
||||
IList<Event> retList = new List<Event>(1);
|
||||
retList.Add(retVal);
|
||||
return retList;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,14 +16,14 @@ namespace TBF.BenchControl.TestMethods.RoiDetection
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
RoiDetectionCfg()
|
||||
{
|
||||
Name = "RoiDetection";
|
||||
ParentName = string.Empty;
|
||||
}
|
||||
|
||||
public RoiDetectionCfg(IComponentFactory factory)
|
||||
public RoiDetectionCfg(IComponentFactory factory, string name)
|
||||
: this()
|
||||
{
|
||||
this.Factory = factory;
|
||||
Name = name;
|
||||
ParentName = string.Empty;
|
||||
this.Factory = factory;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace TBF.BenchControl.TestMethods.RoiDetection
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new RoiDetection(cfg); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new RoiDetectionCfg(this); }
|
||||
public IComponentCfg DefaultConfig() { return new RoiDetectionCfg(this, this.GetType().Namespace.Substring(29)); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.12.468.1")]
|
||||
[assembly: AssemblyFileVersion("2.12.468.1")]
|
||||
[assembly: AssemblyVersion("2.12.470.1")]
|
||||
[assembly: AssemblyFileVersion("2.12.470.1")]
|
||||
|
||||
@@ -781,6 +781,16 @@
|
||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\TestMethods\iPerlCommunication\TestMethodFactory.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\LiveStream\Component.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\LiveStream\Cfg.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\LiveStream\CfgCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\TestMethods\LiveStream\CfgCtrl.designer.cs">
|
||||
<DependentUpon>CfgCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\TestMethods\LiveStream\Factory.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\LiveStream\LiveStreamSeq.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\OuterLoop\End\Component.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\OuterLoop\End\Factory.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\OuterLoop\Start\Component.cs" />
|
||||
@@ -1980,6 +1990,9 @@
|
||||
<EmbeddedResource Include="BenchControl\TestMethods\Endurance\CycleDlg.ru.resx">
|
||||
<DependentUpon>CycleDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="BenchControl\TestMethods\LiveStream\CfgCtrl.resx">
|
||||
<DependentUpon>CfgCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="BenchControl\TestMethods\RoiDetection\RoiDetectionCfgCtrl.resx">
|
||||
<DependentUpon>RoiDetectionCfgCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
Reference in New Issue
Block a user