iPerlAdjustment removed from the project.
This commit is contained in:
@@ -43,8 +43,7 @@ namespace TBF.BenchControl
|
|||||||
Factories.Add(new Ambient.Greco.Factory());
|
Factories.Add(new Ambient.Greco.Factory());
|
||||||
Factories.Add(new Cameras.IdcCamera.IdcCameraFactory());
|
Factories.Add(new Cameras.IdcCamera.IdcCameraFactory());
|
||||||
Factories.Add(new WaterMeters.iPerl.WaterMeterFactory()); /// iPerl
|
Factories.Add(new WaterMeters.iPerl.WaterMeterFactory()); /// iPerl
|
||||||
Factories.Add(new TestMethods.iPerlAdjustment.TestMethodFactory()); /// iPerlAdjustment
|
Factories.Add(new TestMethods.iPerlCommunication.TestMethodFactory()); /// iPerlCommunication
|
||||||
Factories.Add(new TestMethods.iPerlCommunication.TestMethodFactory()); /// iPerlCommunication
|
|
||||||
Factories.Add(new TestMethods.LeakTest.TestMethodFactory());
|
Factories.Add(new TestMethods.LeakTest.TestMethodFactory());
|
||||||
Factories.Add(new MettlerToledo.Standard.BalanceFactory()); /// MettlerToledo Balance
|
Factories.Add(new MettlerToledo.Standard.BalanceFactory()); /// MettlerToledo Balance
|
||||||
Factories.Add(new MettlerToledo.Standard.BalanceNewFactory()); /// MettlerToledoBalanceSN
|
Factories.Add(new MettlerToledo.Standard.BalanceNewFactory()); /// MettlerToledoBalanceSN
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
///
|
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
||||||
///
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using log4net;
|
|
||||||
using TBF.BenchControl;
|
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.iPerlAdjustment
|
|
||||||
{
|
|
||||||
public class TestMethod : ComponentBase, GenericDevices.ITestMethod
|
|
||||||
{
|
|
||||||
private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod));
|
|
||||||
public override string ToString() { return string.Format("TestMethods.Adjustment({0})", Cfg.ToString(1)); }
|
|
||||||
|
|
||||||
public bool Evaluate { get { return false; } }
|
|
||||||
public bool Publish { get { return false; } }
|
|
||||||
public bool CanTest(Entities.MetersKind meters) { return meters == Entities.MetersKind.Single; }
|
|
||||||
|
|
||||||
public TestMethod()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public TestMethod(TestMethodCfg cfg)
|
|
||||||
: base(cfg)
|
|
||||||
{
|
|
||||||
log.Debug(this.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public IList<Event> Execute(Entities.Test test)
|
|
||||||
{
|
|
||||||
return (new iPerlAdjustmentSeq()).Execute(test);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
///
|
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
||||||
///
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Xml.Serialization;
|
|
||||||
using TBF.BenchControl.Generic;
|
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.iPerlAdjustment
|
|
||||||
{
|
|
||||||
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
|
|
||||||
{
|
|
||||||
public IComponent GetComponent(IList<IComponent> components) { return new TestMethod(this); }
|
|
||||||
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
|
|
||||||
|
|
||||||
/// Private parameterless constructor invoked by all other (public) constructors
|
|
||||||
TestMethodCfg()
|
|
||||||
{
|
|
||||||
Name = "Adjustment";
|
|
||||||
ParentName = string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TestMethodCfg(IComponentFactory factory)
|
|
||||||
: this()
|
|
||||||
{
|
|
||||||
this.Factory = factory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ToString(int i)
|
|
||||||
{
|
|
||||||
return string.Format("Name={0}", Name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
///
|
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
||||||
///
|
|
||||||
using System;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using log4net;
|
|
||||||
using TBF.BenchControl.Generic;
|
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.iPerlAdjustment
|
|
||||||
{
|
|
||||||
public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl
|
|
||||||
{
|
|
||||||
static readonly ILog log = LogManager.GetLogger(typeof(TestMethodCfgCtrl));
|
|
||||||
|
|
||||||
public bool ShowMore { get { return false; } }
|
|
||||||
|
|
||||||
TestMethodCfg config;
|
|
||||||
public IComponentCfg Config
|
|
||||||
{
|
|
||||||
get { return config as IComponentCfg; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
config = value as TestMethodCfg;
|
|
||||||
Redraw();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public TestMethodCfgCtrl()
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Unlock()
|
|
||||||
{
|
|
||||||
nameTextBox.Enabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
|
||||||
{
|
|
||||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
|
||||||
return flags;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CfgUpdateFlags UpdateCfg()
|
|
||||||
{
|
|
||||||
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
|
|
||||||
|
|
||||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
|
||||||
|
|
||||||
config.Name = nameTextBox.Text;
|
|
||||||
|
|
||||||
return flags;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-86
@@ -1,86 +0,0 @@
|
|||||||
///
|
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
||||||
///
|
|
||||||
namespace TBF.BenchControl.TestMethods.iPerlAdjustment
|
|
||||||
{
|
|
||||||
partial class TestMethodCfgCtrl
|
|
||||||
{
|
|
||||||
/// <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.SuspendLayout();
|
|
||||||
//
|
|
||||||
// nameTextBox
|
|
||||||
//
|
|
||||||
this.nameTextBox.Enabled = false;
|
|
||||||
this.nameTextBox.Location = new System.Drawing.Point(137, 57);
|
|
||||||
this.nameTextBox.Name = "nameTextBox";
|
|
||||||
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
|
|
||||||
this.nameTextBox.TabIndex = 5;
|
|
||||||
//
|
|
||||||
// nameLabel
|
|
||||||
//
|
|
||||||
this.nameLabel.AutoSize = true;
|
|
||||||
this.nameLabel.Location = new System.Drawing.Point(27, 60);
|
|
||||||
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(134, 33);
|
|
||||||
this.classNameLabel.Name = "classNameLabel";
|
|
||||||
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
|
||||||
this.classNameLabel.TabIndex = 3;
|
|
||||||
this.classNameLabel.Text = "ComonentName";
|
|
||||||
//
|
|
||||||
// BasicPrinterCfgCtrl
|
|
||||||
//
|
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
|
||||||
this.Controls.Add(this.nameTextBox);
|
|
||||||
this.Controls.Add(this.nameLabel);
|
|
||||||
this.Controls.Add(this.classNameLabel);
|
|
||||||
this.Name = "BasicPrinterCfgCtrl";
|
|
||||||
this.Size = new System.Drawing.Size(300, 200);
|
|
||||||
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
|
|
||||||
this.ResumeLayout(false);
|
|
||||||
this.PerformLayout();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private System.Windows.Forms.TextBox nameTextBox;
|
|
||||||
private System.Windows.Forms.Label nameLabel;
|
|
||||||
private System.Windows.Forms.Label classNameLabel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
<?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>
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
///
|
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
||||||
///
|
|
||||||
using TBF.BenchControl.Generic;
|
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.iPerlAdjustment
|
|
||||||
{
|
|
||||||
public class TestMethodFactory : IComponentFactory
|
|
||||||
{
|
|
||||||
public string ClassName { get { return "iPerlAdjustment"; } }
|
|
||||||
|
|
||||||
public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); }
|
|
||||||
|
|
||||||
public IComponent DummyComponent() { return new TestMethod(); }
|
|
||||||
|
|
||||||
public IComponentCfg DefaultConfig() { return new TestMethodCfg(this); }
|
|
||||||
|
|
||||||
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
|
|
||||||
{
|
|
||||||
return ComponentCfgBase.CreateFromDbEntity(typeof(TestMethodCfg), component, this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,428 +0,0 @@
|
|||||||
///
|
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
||||||
///
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using log4net;
|
|
||||||
using TBF.Resources;
|
|
||||||
using TBF.BenchControl.WaterMeters.iPerl;
|
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.iPerlAdjustment
|
|
||||||
{
|
|
||||||
public partial class iPerlAdjustmentForm : Form, GenericDevices.IHasCompleted
|
|
||||||
{
|
|
||||||
private static readonly ILog log = LogManager.GetLogger(typeof(iPerlAdjustmentForm));
|
|
||||||
|
|
||||||
|
|
||||||
[DllImport("libRfid.dll", EntryPoint = "getDllVersion")]
|
|
||||||
public static extern unsafe int getDllVersion();
|
|
||||||
|
|
||||||
[DllImport("libRfid.dll", EntryPoint = "openPort")]
|
|
||||||
static extern unsafe int openPort(uint comPort);
|
|
||||||
|
|
||||||
[DllImport("libRfid.dll", EntryPoint = "closePort")]
|
|
||||||
static extern unsafe int closePort();
|
|
||||||
|
|
||||||
[DllImport("libRfid.dll", EntryPoint = "readRequestPort")]
|
|
||||||
static extern unsafe int readRequestPort(MessageID messageId, int offset, int lenght, byte* ptr, int timeout_ms);
|
|
||||||
|
|
||||||
[DllImport("libRfid.dll", EntryPoint = "writeRequestPort")]
|
|
||||||
static extern unsafe int writeRequestPort(MessageID messageId, int offset, int lenght, byte* ptr, int timeout_ms);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Wrapper function with safe interface adn unsafe body
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Value returned by readRequestPort(...)</returns>
|
|
||||||
public unsafe int ReadRequestPort(MessageID messageID, int offset, int lenght, out byte[] buffer, int timeout)
|
|
||||||
{
|
|
||||||
byte[] buf = new byte[1000];
|
|
||||||
int retv;
|
|
||||||
|
|
||||||
fixed (byte* pBuf = buf)
|
|
||||||
{
|
|
||||||
retv = readRequestPort(messageID, offset, lenght, pBuf, timeout);
|
|
||||||
|
|
||||||
buffer = new byte[lenght];
|
|
||||||
for (int i = 0; i < lenght; i++) buffer[i] = buf[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return retv;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Wrapper function with safe interface adn unsafe body
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Value returned by writeRequestPort(...)</returns>
|
|
||||||
public unsafe int WriteRequestPort(MessageID messageID, int offset, int lenght, byte[] buffer, int timeout)
|
|
||||||
{
|
|
||||||
int retv;
|
|
||||||
fixed (byte* pBuf = buffer)
|
|
||||||
{
|
|
||||||
retv = writeRequestPort(messageID, offset, lenght, pBuf, timeout);
|
|
||||||
}
|
|
||||||
return retv;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Set to 'true' when the form closes
|
|
||||||
public bool Completed { get { return completed; } }
|
|
||||||
bool completed;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary> Number of text boxes for serial numbers </summary>
|
|
||||||
public readonly int WaterMetersCount;
|
|
||||||
|
|
||||||
readonly bool[] disabled;
|
|
||||||
|
|
||||||
Entities.TestResult tr;
|
|
||||||
|
|
||||||
int textBoxesCount;
|
|
||||||
|
|
||||||
Label[] labels;
|
|
||||||
TextBox[] errors;
|
|
||||||
IList<WaterMeter> WaterMeters;
|
|
||||||
|
|
||||||
|
|
||||||
Modbus.QuidoRS.QuidoRS quido;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary> Parameterless constructor for 3 watermeters </summary>
|
|
||||||
public iPerlAdjustmentForm()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
textBoxesCount = 48;
|
|
||||||
|
|
||||||
labels = new Label[48]
|
|
||||||
{
|
|
||||||
wmErrorLabel1, wmErrorLabel2, wmErrorLabel3, wmErrorLabel4, wmErrorLabel5,
|
|
||||||
wmErrorLabel6, wmErrorLabel7, wmErrorLabel8, wmErrorLabel9, wmErrorLabel10,
|
|
||||||
wmErrorLabel11, wmErrorLabel12, wmErrorLabel13, wmErrorLabel14, wmErrorLabel15,
|
|
||||||
wmErrorLabel16, wmErrorLabel17, wmErrorLabel18, wmErrorLabel19, wmErrorLabel20,
|
|
||||||
wmErrorLabel21, wmErrorLabel22, wmErrorLabel23, wmErrorLabel24, wmErrorLabel25,
|
|
||||||
wmErrorLabel26, wmErrorLabel27, wmErrorLabel28, wmErrorLabel29, wmErrorLabel30,
|
|
||||||
wmErrorLabel31, wmErrorLabel32, wmErrorLabel33, wmErrorLabel34, wmErrorLabel35,
|
|
||||||
wmErrorLabel36, wmErrorLabel37, wmErrorLabel38, wmErrorLabel39, wmErrorLabel40,
|
|
||||||
wmErrorLabel41, wmErrorLabel42, wmErrorLabel43, wmErrorLabel44, wmErrorLabel45,
|
|
||||||
wmErrorLabel46, wmErrorLabel47, wmErrorLabel48,
|
|
||||||
};
|
|
||||||
errors = new TextBox[48]
|
|
||||||
{
|
|
||||||
wmErrorTextBox1, wmErrorTextBox2, wmErrorTextBox3, wmErrorTextBox4, wmErrorTextBox5,
|
|
||||||
wmErrorTextBox6, wmErrorTextBox7, wmErrorTextBox8, wmErrorTextBox9, wmErrorTextBox10,
|
|
||||||
wmErrorTextBox11, wmErrorTextBox12, wmErrorTextBox13, wmErrorTextBox14, wmErrorTextBox15,
|
|
||||||
wmErrorTextBox16, wmErrorTextBox17, wmErrorTextBox18, wmErrorTextBox19, wmErrorTextBox20,
|
|
||||||
wmErrorTextBox21, wmErrorTextBox22, wmErrorTextBox23, wmErrorTextBox24, wmErrorTextBox25,
|
|
||||||
wmErrorTextBox26, wmErrorTextBox27, wmErrorTextBox28, wmErrorTextBox29, wmErrorTextBox30,
|
|
||||||
wmErrorTextBox31, wmErrorTextBox32, wmErrorTextBox33, wmErrorTextBox34, wmErrorTextBox35,
|
|
||||||
wmErrorTextBox36, wmErrorTextBox37, wmErrorTextBox38, wmErrorTextBox39, wmErrorTextBox40,
|
|
||||||
wmErrorTextBox41, wmErrorTextBox42, wmErrorTextBox43, wmErrorTextBox44, wmErrorTextBox45,
|
|
||||||
wmErrorTextBox46, wmErrorTextBox47, wmErrorTextBox48,
|
|
||||||
};
|
|
||||||
|
|
||||||
//rects = new Rectangle[48];
|
|
||||||
//for (int i = 0; i < 48; i++)
|
|
||||||
//{
|
|
||||||
// int row = i % 12;
|
|
||||||
// int col = i / 12;
|
|
||||||
// rects[i] = new Rectangle(350 + col * 557, 25 + row * 47, 230, 37);
|
|
||||||
//}
|
|
||||||
|
|
||||||
completed = false;
|
|
||||||
tr = null;
|
|
||||||
|
|
||||||
/// Attach to 'AdjustmentInProgress' handler
|
|
||||||
UiBridge.Bridge.AdjustmentInProgressHandler += delegate(object sender, UiBridge.AdjustmentInProgressEventArgs args)
|
|
||||||
{
|
|
||||||
if (InvokeRequired)
|
|
||||||
{
|
|
||||||
Invoke(new EventHandler<UiBridge.AdjustmentInProgressEventArgs>(OnAdjustmentInProgress), sender, args);
|
|
||||||
}
|
|
||||||
else OnAdjustmentInProgress(sender, args);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructor
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
|
||||||
public iPerlAdjustmentForm(IList<GenericDevices.IWaterMeter> waterMeters)
|
|
||||||
: this()
|
|
||||||
{
|
|
||||||
this.WaterMetersCount = waterMeters.Count;
|
|
||||||
this.WaterMeters = new List<WaterMeters.iPerl.WaterMeter>();
|
|
||||||
foreach (var wm in waterMeters) this.WaterMeters.Add(wm as WaterMeters.iPerl.WaterMeter);
|
|
||||||
|
|
||||||
ShuffleTextBoxes(this.WaterMetersCount, Program.LineSize);
|
|
||||||
|
|
||||||
disabled = new bool[this.WaterMetersCount];
|
|
||||||
|
|
||||||
foreach (var comp in StateMachine.Components)
|
|
||||||
{
|
|
||||||
if (comp is Modbus.QuidoRS.QuidoRS)
|
|
||||||
{
|
|
||||||
quido = comp as Modbus.QuidoRS.QuidoRS;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Make sure the layout of labels/text boxes on the screen
|
|
||||||
/// corresponds to the layout of watermeters of the test bench.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="wmsCount">Number of watermeters</param>
|
|
||||||
/// <param name="lineSize">Number of watermeters in one line</param>
|
|
||||||
void ShuffleTextBoxes(int wmsCount, int lineSize)
|
|
||||||
{
|
|
||||||
if (wmsCount < textBoxesCount && lineSize > 0)
|
|
||||||
{
|
|
||||||
int nrLines = (wmsCount + lineSize - 1) / lineSize;
|
|
||||||
int gap = (textBoxesCount - wmsCount) / nrLines;
|
|
||||||
|
|
||||||
int dest = 0;
|
|
||||||
for (int l = 0; l < nrLines; l++)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < lineSize; i++)
|
|
||||||
{
|
|
||||||
labels[dest] = labels[l * lineSize + l * gap + i];
|
|
||||||
errors[dest] = errors[l * lineSize + l * gap + i];
|
|
||||||
dest++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
textBoxesCount = wmsCount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Localize()
|
|
||||||
{
|
|
||||||
Text = Strings.Water_Meter_States;
|
|
||||||
for (int i = 0; i < textBoxesCount; i++)
|
|
||||||
{
|
|
||||||
labels[i].Text = string.Format("WM{0} {1}", i + 1, Strings.Error_pct);
|
|
||||||
}
|
|
||||||
okButton.Text = Strings.OkBtnText;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void WMErrorsForm24_Load(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Localize();
|
|
||||||
|
|
||||||
//Height = 50 + 90 * WaterMetersCount;
|
|
||||||
|
|
||||||
for (int i = 0; i < textBoxesCount; i++)
|
|
||||||
{
|
|
||||||
if (disabled != null && i < disabled.Length && disabled[i])
|
|
||||||
{
|
|
||||||
labels[i].Visible = errors[i].Visible = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
labels[i].Visible = errors[i].Visible = true;
|
|
||||||
errors[i].Text = "---";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void okButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
completed = true;
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnAdjustmentInProgress(object sender, UiBridge.AdjustmentInProgressEventArgs args)
|
|
||||||
{
|
|
||||||
tr = args.TestResult;
|
|
||||||
Redraw();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Redraw()
|
|
||||||
{
|
|
||||||
if (tr != null)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < textBoxesCount; i++)
|
|
||||||
{
|
|
||||||
errors[i].Text = tr.Meters[i].VolumeErrorPct.ToString("F1");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void WMErrorsForm_Paint(object sender, PaintEventArgs e)
|
|
||||||
{
|
|
||||||
//if (tr != null)
|
|
||||||
//{
|
|
||||||
// System.Drawing.Graphics graphics = this.CreateGraphics();
|
|
||||||
|
|
||||||
// for (int i = 0; i < WaterMetersCount; i++)
|
|
||||||
// {
|
|
||||||
// PaintOne(graphics, rects[i], tr.Meters[i].VolumeErrorPct, tr.ErrLimLo, tr.ErrLimHi);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PaintOne(System.Drawing.Graphics g, Rectangle r, float value, float limLo, float limHi)
|
|
||||||
{
|
|
||||||
Rectangle rect1 = new Rectangle(r.Left, r.Top, r.Width / 3, r.Height);
|
|
||||||
Rectangle rect2 = new Rectangle(r.Left + r.Width / 3, r.Top, r.Width / 3, r.Height);
|
|
||||||
Rectangle rect3 = new Rectangle(r.Left + 2 * (r.Width / 3), r.Top, r.Width / 3, r.Height);
|
|
||||||
Rectangle rectCent = new Rectangle(r.Left + r.Width / 2 - 1, r.Top, 3, r.Height);
|
|
||||||
|
|
||||||
Brush redBrush = new SolidBrush(Color.FromName("Salmon"));
|
|
||||||
Brush greenBrush = new SolidBrush(Color.FromName("LightGreen"));
|
|
||||||
Brush centBrush = new SolidBrush(Color.FromName("Green"));
|
|
||||||
|
|
||||||
g.FillRectangle(redBrush, rect1);
|
|
||||||
g.FillRectangle(greenBrush, rect2);
|
|
||||||
g.FillRectangle(redBrush, rect3);
|
|
||||||
g.FillRectangle(centBrush, rectCent);
|
|
||||||
|
|
||||||
int x0 = r.Left + r.Width / 2;
|
|
||||||
int dx = r.Height / 3;
|
|
||||||
int x = (int)((float)r.Width * (2.0 * value - limLo - limHi) / (limHi - limLo) / 6.0f + 0.5f);
|
|
||||||
|
|
||||||
if (x0 - dx + x >= r.Left && x0 + dx + x < r.Left + r.Width)
|
|
||||||
{
|
|
||||||
Point[] triangle = new Point[3]
|
|
||||||
{
|
|
||||||
new Point(x0 - dx + x, r.Top),
|
|
||||||
new Point(x0 + dx + x, r.Top),
|
|
||||||
new Point(x0 + x, r.Top + 2 * r.Height / 3),
|
|
||||||
};
|
|
||||||
|
|
||||||
Brush blackBrush = new SolidBrush(Color.Black);
|
|
||||||
g.FillPolygon(blackBrush, triangle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Forced close handling
|
|
||||||
|
|
||||||
public void StartForceCloseHandler()
|
|
||||||
{
|
|
||||||
UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args)
|
|
||||||
{
|
|
||||||
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
|
|
||||||
else OnForceClose(sender, args);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnForceClose(object sender, EventArgs args)
|
|
||||||
{
|
|
||||||
DialogResult = DialogResult.Cancel;
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private void readConfigBtn_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
for (int group = 1; group <= 10; group++)
|
|
||||||
{
|
|
||||||
if (quido != null)
|
|
||||||
{
|
|
||||||
quido.SetOutputs((ushort)(16 - group));
|
|
||||||
Thread.Sleep(200);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var wm in WaterMeters)
|
|
||||||
{
|
|
||||||
if (wm.Group == group)
|
|
||||||
{
|
|
||||||
Text = string.Format("WM={0} Group={1}", wm.Name, group);
|
|
||||||
if (wm.DebugLevel == Entities.DebugMode.Normal)
|
|
||||||
{
|
|
||||||
byte[] data = null;
|
|
||||||
bool success = false;
|
|
||||||
int r1 = openPort((uint)wm.MuxBoardNr);
|
|
||||||
for (int j = 0; j < 3; j++)
|
|
||||||
{
|
|
||||||
if (0 == ReadRequestPort(MessageID.Configuration, 0, ConfigStruct.Length, out data, 1000))
|
|
||||||
{
|
|
||||||
success = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
closePort();
|
|
||||||
|
|
||||||
if (r1 == 0 && success && data != null)
|
|
||||||
{
|
|
||||||
errors[i].Text = ConfigStruct.FromByteArray(data).ToString(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
errors[i].Text = "Cannot read configuration";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void toTestMdBtn_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
byte[] data = new byte[1];
|
|
||||||
data[0] = (byte)7;
|
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
for (int group = 1; group <= 10; group++)
|
|
||||||
{
|
|
||||||
if (quido != null)
|
|
||||||
{
|
|
||||||
quido.SetOutputs((ushort)(16 - group));
|
|
||||||
Thread.Sleep(200);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var wm in WaterMeters)
|
|
||||||
{
|
|
||||||
if (wm.DebugLevel == Entities.DebugMode.Normal && wm.Group == group)
|
|
||||||
{
|
|
||||||
int r1 = openPort((uint)wm.MuxBoardNr);
|
|
||||||
int r2 = WriteRequestPort(MessageID.Command, 0, 1, data, 1000);
|
|
||||||
int r3 = closePort();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void toActiveMdBtn_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
byte[] data = new byte[1];
|
|
||||||
data[0] = (byte)6;
|
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
for (int group = 1; group <= 10; group++)
|
|
||||||
{
|
|
||||||
if (quido != null)
|
|
||||||
{
|
|
||||||
quido.SetOutputs((ushort)(16 - group));
|
|
||||||
Thread.Sleep(200);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var wm in WaterMeters)
|
|
||||||
{
|
|
||||||
if (wm.DebugLevel == Entities.DebugMode.Normal && wm.Group == group)
|
|
||||||
{
|
|
||||||
int r1 = openPort((uint)wm.MuxBoardNr);
|
|
||||||
int r2 = WriteRequestPort(MessageID.Command, 0, 1, data, 1000);
|
|
||||||
int r3 = closePort();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Generated
-1366
File diff suppressed because it is too large
Load Diff
@@ -1,120 +0,0 @@
|
|||||||
<?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>
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
///
|
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
||||||
///
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using log4net;
|
|
||||||
using TBF.BenchControl;
|
|
||||||
using TBF.Boxes;
|
|
||||||
using TBF.Resources;
|
|
||||||
using TBF.UiBridge;
|
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.iPerlAdjustment
|
|
||||||
{
|
|
||||||
public class iPerlAdjustmentSeq : Sequences.SequenceBase
|
|
||||||
{
|
|
||||||
private static readonly ILog log = LogManager.GetLogger(typeof(iPerlAdjustmentSeq));
|
|
||||||
|
|
||||||
System.Windows.Forms.Form modelessDlg;
|
|
||||||
///
|
|
||||||
delegate void ErrorsFormDlgt(iPerlAdjustmentSeq myRef);
|
|
||||||
///
|
|
||||||
void OpenIPerlCommForm(iPerlAdjustmentSeq myRef)
|
|
||||||
{
|
|
||||||
myRef.modelessDlg = new iPerlAdjustmentForm(WaterMeters);
|
|
||||||
modelessDlg.Show();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Flying start mass collection method sequence
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="test">Test entity</param>
|
|
||||||
/// <returns>
|
|
||||||
/// Event.Done . . . . . . . OK
|
|
||||||
/// Event.UiCmdStop . . . . Stopped by the user using the on-screen button STOP
|
|
||||||
/// Event.OpArgumentError . Target flow is out of range
|
|
||||||
/// Event.Error . . . . . . Unspecified error
|
|
||||||
/// </returns>
|
|
||||||
public IList<Event> Execute(Entities.Test test)
|
|
||||||
{
|
|
||||||
|
|
||||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
|
||||||
|
|
||||||
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
|
||||||
Event retVal = Event.Done;
|
|
||||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
|
||||||
|
|
||||||
ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
|
|
||||||
|
|
||||||
/// Notes:
|
|
||||||
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
|
|
||||||
/// float timeSec = 3600.0f * timeHr;
|
|
||||||
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
|
|
||||||
int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f);
|
|
||||||
|
|
||||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
|
|
||||||
|
|
||||||
int repetitionNr = 1; /// First test: repetitionNr=1
|
|
||||||
|
|
||||||
//====================================
|
|
||||||
// Transition or SetRoute - Start
|
|
||||||
//====================================
|
|
||||||
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
|
|
||||||
{
|
|
||||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
|
||||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Start the test, initialize test results
|
|
||||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
|
||||||
Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Single);
|
|
||||||
tstRslt.DoNotEvaluate = true;
|
|
||||||
tstRslt.DoNotPublish = true;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Show the modeless dialog with error indication
|
|
||||||
///
|
|
||||||
Program.MainWnd.Invoke(new ErrorsFormDlgt(OpenIPerlCommForm), this);
|
|
||||||
|
|
||||||
loop:
|
|
||||||
|
|
||||||
//------------------------------------------------
|
|
||||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
|
||||||
//------------------------------------------------
|
|
||||||
|
|
||||||
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
|
||||||
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
|
||||||
|
|
||||||
/// Test 'Quit'
|
|
||||||
if ((modelessDlg is GenericDevices.IHasCompleted) && !(modelessDlg as GenericDevices.IHasCompleted).Completed)
|
|
||||||
{
|
|
||||||
goto loop; /// Modeless dilaog not closed, keep looping
|
|
||||||
}
|
|
||||||
modelessDlg = null; /// Modeless dialog is closed now
|
|
||||||
|
|
||||||
stopTest:
|
|
||||||
|
|
||||||
///----------------------///
|
|
||||||
/// Quit this sequence ///
|
|
||||||
///----------------------///
|
|
||||||
|
|
||||||
State.Create("Adjustment : Stopping diverter, gate, etc.")
|
|
||||||
.AddOperation(checkUiOp)
|
|
||||||
.AddOperation(cBrd.StopPreviousOp())
|
|
||||||
.EnterState();
|
|
||||||
do
|
|
||||||
{
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
|
||||||
}
|
|
||||||
while (!e.Contains(Event.PreviousStopped));
|
|
||||||
|
|
||||||
/// Transition sequence at the end of test
|
|
||||||
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier
|
|
||||||
switch (Transition(transitionAfter, TransitionContext.AfterTest))
|
|
||||||
{
|
|
||||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
|
||||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -329,22 +329,6 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="BenchControl\TestMethods\FixedStartCombinedMeters\TestMethodFactory.cs" />
|
<Compile Include="BenchControl\TestMethods\FixedStartCombinedMeters\TestMethodFactory.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\FlyingStartCollectionMethod\TestParams.cs" />
|
<Compile Include="BenchControl\TestMethods\FlyingStartCollectionMethod\TestParams.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\iPerlAdjustment\iPerlAdjustmentSeq.cs" />
|
|
||||||
<Compile Include="BenchControl\TestMethods\iPerlAdjustment\TestMethod.cs" />
|
|
||||||
<Compile Include="BenchControl\TestMethods\iPerlAdjustment\TestMethodCfg.cs" />
|
|
||||||
<Compile Include="BenchControl\TestMethods\iPerlAdjustment\TestMethodCfgCtrl.cs">
|
|
||||||
<SubType>UserControl</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="BenchControl\TestMethods\iPerlAdjustment\TestMethodCfgCtrl.designer.cs">
|
|
||||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="BenchControl\TestMethods\iPerlAdjustment\TestMethodFactory.cs" />
|
|
||||||
<Compile Include="BenchControl\TestMethods\iPerlAdjustment\iPerlAdjustmentForm.cs">
|
|
||||||
<SubType>Form</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="BenchControl\TestMethods\iPerlAdjustment\iPerlAdjustmentForm.designer.cs">
|
|
||||||
<DependentUpon>iPerlAdjustmentForm.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="BenchControl\TestMethods\iPerlCommunication\AllCompletedEventArgs.cs" />
|
<Compile Include="BenchControl\TestMethods\iPerlCommunication\AllCompletedEventArgs.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\iPerlCommunication\CommCompletedEventArgs.cs" />
|
<Compile Include="BenchControl\TestMethods\iPerlCommunication\CommCompletedEventArgs.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\iPerlCommunication\iPerlCommunicationParams.cs" />
|
<Compile Include="BenchControl\TestMethods\iPerlCommunication\iPerlCommunicationParams.cs" />
|
||||||
@@ -1521,12 +1505,6 @@
|
|||||||
<EmbeddedResource Include="BenchControl\TestMethods\FlyingStart\TestMethodCfgCtrl.resx">
|
<EmbeddedResource Include="BenchControl\TestMethods\FlyingStart\TestMethodCfgCtrl.resx">
|
||||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="BenchControl\TestMethods\iPerlAdjustment\TestMethodCfgCtrl.resx">
|
|
||||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="BenchControl\TestMethods\iPerlAdjustment\iPerlAdjustmentForm.resx">
|
|
||||||
<DependentUpon>iPerlAdjustmentForm.cs</DependentUpon>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="BenchControl\TestMethods\iPerlCommunication\iPerlCommunicationForm.resx">
|
<EmbeddedResource Include="BenchControl\TestMethods\iPerlCommunication\iPerlCommunicationForm.resx">
|
||||||
<DependentUpon>iPerlCommunicationForm.cs</DependentUpon>
|
<DependentUpon>iPerlCommunicationForm.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|||||||
Reference in New Issue
Block a user