RoiDetecion wizard forms added to TestWizard, ver. 2.12.534
This commit is contained in:
parent
796d9fa554
commit
c2e32c774e
@ -1690,6 +1690,7 @@ namespace TBF
|
||||
|
||||
/// Add a test
|
||||
Test test = new Test(newName, listViewEx.Items.Count, LoadedProcedure);
|
||||
TestWizard.RoiData roiData = new TestWizard.RoiData();
|
||||
|
||||
/// Run a create new test wizard
|
||||
TestWizard.MethodSelection methodDlg = new TestWizard.MethodSelection(true, false, test, TestMethods);
|
||||
@ -1697,9 +1698,16 @@ namespace TBF
|
||||
TestWizard.VolumeAndErrorSelection volumeDlg = new TestWizard.VolumeAndErrorSelection(false, true, test);
|
||||
TestWizard.PressureSelection pressureDlg = new TestWizard.PressureSelection(false, true, test);
|
||||
TestWizard.HeatMetersSelection heatMetersDlg = new TestWizard.HeatMetersSelection(false, false, test);
|
||||
//TestWizard.SensorsSelection sensorsDlg = new TestWizard.SensorsSelection(test);
|
||||
TestWizard.Roi1 roi1Dlg = new TestWizard.Roi1(false, false, roiData);
|
||||
TestWizard.Roi2 roi2Dlg = new TestWizard.Roi2(false, false, roiData);
|
||||
TestWizard.Roi3 roi3Dlg = new TestWizard.Roi3(false, false, roiData);
|
||||
roiData.Calculate();
|
||||
test.Qfrom = (float)(roiData.Q * 0.95);
|
||||
test.Qto = (float)(roiData.Q * 1.05);
|
||||
//test.
|
||||
|
||||
methodLabel:
|
||||
|
||||
switch (methodDlg.ShowDialog())
|
||||
{
|
||||
case DialogResult.Cancel: return;
|
||||
@ -1719,6 +1727,27 @@ namespace TBF
|
||||
#if HEAT_METERS
|
||||
if (selectedMethod.CanTest(MetersKind.HeatMeter)) goto heat_meters_label;
|
||||
#endif
|
||||
if (!(selectedMethod is BenchControl.TestMethods.RoiDetection.RoiDetection)) goto flowLabel;
|
||||
|
||||
roi_detection_label_1:
|
||||
switch (roi1Dlg.ShowDialog())
|
||||
{
|
||||
case DialogResult.Cancel: return;
|
||||
case DialogResult.Retry: goto methodLabel;
|
||||
}
|
||||
|
||||
roi_detection_label_2:
|
||||
switch (roi2Dlg.ShowDialog())
|
||||
{
|
||||
case DialogResult.Cancel: return;
|
||||
case DialogResult.Retry: goto roi_detection_label_1;
|
||||
}
|
||||
|
||||
switch (roi3Dlg.ShowDialog())
|
||||
{
|
||||
case DialogResult.Cancel: return;
|
||||
case DialogResult.Retry: goto roi_detection_label_2;
|
||||
}
|
||||
|
||||
flowLabel:
|
||||
switch (flowDlg.ShowDialog())
|
||||
@ -1727,12 +1756,19 @@ namespace TBF
|
||||
case DialogResult.Retry: goto methodLabel;
|
||||
}
|
||||
|
||||
if (selectedMethod is BenchControl.TestMethods.RoiDetection.RoiDetection)
|
||||
{
|
||||
goto select_paths;
|
||||
}
|
||||
|
||||
switch (volumeDlg.ShowDialog())
|
||||
{
|
||||
case DialogResult.Cancel: return;
|
||||
case DialogResult.Retry: goto flowLabel;
|
||||
}
|
||||
|
||||
select_paths:
|
||||
|
||||
/// Depending on the chosen Q select the paths
|
||||
float Qaver = (test.Qfrom + test.Qto) / 2.0f;
|
||||
foreach (var path in feedingPaths)
|
||||
@ -1773,7 +1809,7 @@ namespace TBF
|
||||
}
|
||||
goto flowLabel;
|
||||
#endif
|
||||
|
||||
|
||||
pressure_label:
|
||||
|
||||
switch (pressureDlg.ShowDialog())
|
||||
@ -2020,5 +2056,52 @@ namespace TBF
|
||||
UpdateButtonStates(SharedButtons.SelectedItemPos.Middle);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds ROI data/process data prepared by the wizard to ROI-components in the selected sensors path
|
||||
/// </summary>
|
||||
/// <param name="procedure">Loaded procedure</param>
|
||||
/// <param name="sensorsPath">Selected sensors path</param>
|
||||
/// <param name="roiData">ROI data</param>
|
||||
void AddProcessDataToRoiComponents(Config.Entities.Procedure procedure, string sensorsPathName, TestWizard.RoiData roiData)
|
||||
{
|
||||
/// Create controls for each sensors path used in this procedure.
|
||||
/// Initialize it with its components (sensors or cameras) and add it to the list.
|
||||
try
|
||||
{
|
||||
MetersPath sensorsPath = metersPaths.First<MetersPath>(x => (x.Name == sensorsPathName));
|
||||
|
||||
if (sensorsPath != null)
|
||||
{
|
||||
IList<IComponent> cmpntsInMPath = new List<IComponent>();
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
IComponent sensor = TbfComponents.FirstOrDefault<IComponent>(x => (x.Cfg.Name.Equals(sensorsPath.GetSensor(i))));
|
||||
cmpntsInMPath.Add(sensor);
|
||||
}
|
||||
|
||||
foreach (var cmpnt in cmpntsInMPath)
|
||||
{
|
||||
if (cmpnt != null && (cmpnt.Cfg.GetProcedureParams() != null))
|
||||
{
|
||||
IParamsProvider procedureParams = cmpnt.Cfg.CreateProcedureParams(procedure);
|
||||
BenchControl.Network.Camera.Roi.ProcedureParams roiParams = procedureParams as BenchControl.Network.Camera.Roi.ProcedureParams;
|
||||
if (roiParams != null)
|
||||
{
|
||||
roiParams.PulsesPerLtr = (float)roiData.PulsesPerLiter;
|
||||
roiParams.DetectionImagesCount = roiData.N;
|
||||
roiParams.DetectionPeriod1 = roiData.P1;
|
||||
roiParams.DetectionPeriod2 = roiData.P2;
|
||||
roiParams.RoiParams = roiData.GetRoiParams();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.12.533.1")]
|
||||
[assembly: AssemblyFileVersion("2.12.533.1")]
|
||||
[assembly: AssemblyVersion("2.12.534.1")]
|
||||
[assembly: AssemblyFileVersion("2.12.534.1")]
|
||||
|
||||
30
TestBenchFramework/Properties/Resources.Designer.cs
generated
30
TestBenchFramework/Properties/Resources.Designer.cs
generated
@ -60,6 +60,36 @@ namespace TBF.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap RoiStyle1 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("RoiStyle1", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap RoiStyle2 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("RoiStyle2", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap RoiStyle3 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("RoiStyle3", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
||||
@ -136,4 +136,13 @@
|
||||
<data name="TestPassedImage2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\TestPassedImage2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="RoiStyle1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\RoiStyle1.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="RoiStyle2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\RoiStyle2.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="RoiStyle3" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\RoiStyle3.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
BIN
TestBenchFramework/Resources/RoiStyle1.bmp
Normal file
BIN
TestBenchFramework/Resources/RoiStyle1.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
TestBenchFramework/Resources/RoiStyle2.bmp
Normal file
BIN
TestBenchFramework/Resources/RoiStyle2.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
TestBenchFramework/Resources/RoiStyle3.bmp
Normal file
BIN
TestBenchFramework/Resources/RoiStyle3.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
36
TestBenchFramework/Resources/Strings.Designer.cs
generated
36
TestBenchFramework/Resources/Strings.Designer.cs
generated
@ -573,6 +573,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Clockwise.
|
||||
/// </summary>
|
||||
internal static string Clockwise {
|
||||
get {
|
||||
return ResourceManager.GetString("Clockwise", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to close.
|
||||
/// </summary>
|
||||
@ -816,6 +825,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Counterclockwise.
|
||||
/// </summary>
|
||||
internal static string Counterclockwise {
|
||||
get {
|
||||
return ResourceManager.GetString("Counterclockwise", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Create DB.
|
||||
/// </summary>
|
||||
@ -3354,6 +3372,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ROI Data.
|
||||
/// </summary>
|
||||
internal static string ROI_Data {
|
||||
get {
|
||||
return ResourceManager.GetString("ROI_Data", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ROI Detection in Progress.
|
||||
/// </summary>
|
||||
@ -4464,6 +4491,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Turning direction.
|
||||
/// </summary>
|
||||
internal static string Turning_direction {
|
||||
get {
|
||||
return ResourceManager.GetString("Turning_direction", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Type.
|
||||
/// </summary>
|
||||
|
||||
@ -1401,4 +1401,16 @@
|
||||
<data name="Select_images_and_press_Retry_to_retry_RoI_detection" xml:space="preserve">
|
||||
<value>Wählen Sie Bilder aus und drücken Sie 'Wiederholen', um die Erkennung zu wiederholen</value>
|
||||
</data>
|
||||
<data name="Turning_direction" xml:space="preserve">
|
||||
<value>Richtung drehen</value>
|
||||
</data>
|
||||
<data name="Clockwise" xml:space="preserve">
|
||||
<value>Im Uhrzeigersinn</value>
|
||||
</data>
|
||||
<data name="Counterclockwise" xml:space="preserve">
|
||||
<value>Gegen den Uhrzeigersinn</value>
|
||||
</data>
|
||||
<data name="ROI_Data" xml:space="preserve">
|
||||
<value>ROI Daten</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -1702,4 +1702,16 @@
|
||||
<data name="Select_images_and_press_Retry_to_retry_RoI_detection" xml:space="preserve">
|
||||
<value>Select images and press Retry to retry RoI detection</value>
|
||||
</data>
|
||||
<data name="Clockwise" xml:space="preserve">
|
||||
<value>Clockwise</value>
|
||||
</data>
|
||||
<data name="Counterclockwise" xml:space="preserve">
|
||||
<value>Counterclockwise</value>
|
||||
</data>
|
||||
<data name="ROI_Data" xml:space="preserve">
|
||||
<value>ROI Data</value>
|
||||
</data>
|
||||
<data name="Turning_direction" xml:space="preserve">
|
||||
<value>Turning direction</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -1530,12 +1530,25 @@
|
||||
<Compile Include="TestWizard\PressureSelection.designer.cs">
|
||||
<DependentUpon>PressureSelection.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TestWizard\SensorsSelection.cs">
|
||||
<Compile Include="TestWizard\Roi1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TestWizard\SensorsSelection.Designer.cs">
|
||||
<DependentUpon>SensorsSelection.cs</DependentUpon>
|
||||
<Compile Include="TestWizard\Roi1.designer.cs">
|
||||
<DependentUpon>Roi1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TestWizard\Roi2.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TestWizard\Roi2.designer.cs">
|
||||
<DependentUpon>Roi2.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TestWizard\Roi3.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TestWizard\Roi3.designer.cs">
|
||||
<DependentUpon>Roi3.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TestWizard\RoiData.cs" />
|
||||
<Compile Include="TestWizard\VolumeAndErrorSelection.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -2278,8 +2291,14 @@
|
||||
<EmbeddedResource Include="TestWizard\PressureSelection.resx">
|
||||
<DependentUpon>PressureSelection.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="TestWizard\SensorsSelection.resx">
|
||||
<DependentUpon>SensorsSelection.cs</DependentUpon>
|
||||
<EmbeddedResource Include="TestWizard\Roi1.resx">
|
||||
<DependentUpon>Roi1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="TestWizard\Roi2.resx">
|
||||
<DependentUpon>Roi2.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="TestWizard\Roi3.resx">
|
||||
<DependentUpon>Roi3.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="TestWizard\VolumeAndErrorSelection.resx">
|
||||
<DependentUpon>VolumeAndErrorSelection.cs</DependentUpon>
|
||||
@ -2394,6 +2413,9 @@
|
||||
<None Include="Resources\TestNotDoneImage.png" />
|
||||
<None Include="Resources\TestPassedImage2.png" />
|
||||
<None Include="Resources\TestFailedImage2.png" />
|
||||
<None Include="Resources\RoiStyle1.bmp" />
|
||||
<None Include="Resources\RoiStyle2.bmp" />
|
||||
<None Include="Resources\RoiStyle3.bmp" />
|
||||
<Content Include="SampleConfig\config.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
||||
188
TestBenchFramework/TestWizard/Roi1.Designer.cs
generated
Normal file
188
TestBenchFramework/TestWizard/Roi1.Designer.cs
generated
Normal file
@ -0,0 +1,188 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.TestWizard
|
||||
{
|
||||
partial class Roi1
|
||||
{
|
||||
/// <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 Windows Form 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.horizSplitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.stylePictureBox = new System.Windows.Forms.PictureBox();
|
||||
this.fwButton = new System.Windows.Forms.Button();
|
||||
this.bwButton = new System.Windows.Forms.Button();
|
||||
this.teetgCountTextBox = new System.Windows.Forms.TextBox();
|
||||
this.teethCount = new System.Windows.Forms.Label();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.nextButton = new System.Windows.Forms.Button();
|
||||
this.backButton = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit();
|
||||
this.horizSplitContainer.Panel1.SuspendLayout();
|
||||
this.horizSplitContainer.Panel2.SuspendLayout();
|
||||
this.horizSplitContainer.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.stylePictureBox)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// horizSplitContainer
|
||||
//
|
||||
this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.horizSplitContainer.Location = new System.Drawing.Point(0, 0);
|
||||
this.horizSplitContainer.Name = "horizSplitContainer";
|
||||
this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// horizSplitContainer.Panel1
|
||||
//
|
||||
this.horizSplitContainer.Panel1.Controls.Add(this.stylePictureBox);
|
||||
this.horizSplitContainer.Panel1.Controls.Add(this.fwButton);
|
||||
this.horizSplitContainer.Panel1.Controls.Add(this.bwButton);
|
||||
this.horizSplitContainer.Panel1.Controls.Add(this.teetgCountTextBox);
|
||||
this.horizSplitContainer.Panel1.Controls.Add(this.teethCount);
|
||||
//
|
||||
// horizSplitContainer.Panel2
|
||||
//
|
||||
this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton);
|
||||
this.horizSplitContainer.Panel2.Controls.Add(this.nextButton);
|
||||
this.horizSplitContainer.Panel2.Controls.Add(this.backButton);
|
||||
this.horizSplitContainer.Size = new System.Drawing.Size(284, 262);
|
||||
this.horizSplitContainer.SplitterDistance = 182;
|
||||
this.horizSplitContainer.TabIndex = 1;
|
||||
//
|
||||
// stylePictureBox
|
||||
//
|
||||
this.stylePictureBox.Location = new System.Drawing.Point(79, 12);
|
||||
this.stylePictureBox.Name = "stylePictureBox";
|
||||
this.stylePictureBox.Size = new System.Drawing.Size(128, 128);
|
||||
this.stylePictureBox.TabIndex = 7;
|
||||
this.stylePictureBox.TabStop = false;
|
||||
//
|
||||
// fwButton
|
||||
//
|
||||
this.fwButton.Location = new System.Drawing.Point(220, 54);
|
||||
this.fwButton.Name = "fwButton";
|
||||
this.fwButton.Size = new System.Drawing.Size(41, 44);
|
||||
this.fwButton.TabIndex = 6;
|
||||
this.fwButton.Text = "->";
|
||||
this.fwButton.UseVisualStyleBackColor = true;
|
||||
this.fwButton.Click += new System.EventHandler(this.fwButton_Click);
|
||||
//
|
||||
// bwButton
|
||||
//
|
||||
this.bwButton.Location = new System.Drawing.Point(24, 54);
|
||||
this.bwButton.Name = "bwButton";
|
||||
this.bwButton.Size = new System.Drawing.Size(41, 44);
|
||||
this.bwButton.TabIndex = 5;
|
||||
this.bwButton.Text = "<-";
|
||||
this.bwButton.UseVisualStyleBackColor = true;
|
||||
this.bwButton.Click += new System.EventHandler(this.bwButton_Click);
|
||||
//
|
||||
// teetgCountTextBox
|
||||
//
|
||||
this.teetgCountTextBox.Location = new System.Drawing.Point(175, 150);
|
||||
this.teetgCountTextBox.Name = "teetgCountTextBox";
|
||||
this.teetgCountTextBox.Size = new System.Drawing.Size(32, 20);
|
||||
this.teetgCountTextBox.TabIndex = 4;
|
||||
this.teetgCountTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
|
||||
//
|
||||
// teethCount
|
||||
//
|
||||
this.teethCount.AutoSize = true;
|
||||
this.teethCount.Location = new System.Drawing.Point(76, 153);
|
||||
this.teethCount.Name = "teethCount";
|
||||
this.teethCount.Size = new System.Drawing.Size(65, 13);
|
||||
this.teethCount.TabIndex = 1;
|
||||
this.teethCount.Text = "Teeth count";
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.Location = new System.Drawing.Point(186, 17);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(75, 42);
|
||||
this.cancelButton.TabIndex = 27;
|
||||
this.cancelButton.Text = "&Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
||||
//
|
||||
// nextButton
|
||||
//
|
||||
this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.nextButton.Location = new System.Drawing.Point(105, 17);
|
||||
this.nextButton.Name = "nextButton";
|
||||
this.nextButton.Size = new System.Drawing.Size(75, 42);
|
||||
this.nextButton.TabIndex = 26;
|
||||
this.nextButton.Text = "&Next >";
|
||||
this.nextButton.UseVisualStyleBackColor = true;
|
||||
this.nextButton.Click += new System.EventHandler(this.nextButton_Click);
|
||||
//
|
||||
// backButton
|
||||
//
|
||||
this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry;
|
||||
this.backButton.Location = new System.Drawing.Point(24, 17);
|
||||
this.backButton.Name = "backButton";
|
||||
this.backButton.Size = new System.Drawing.Size(75, 42);
|
||||
this.backButton.TabIndex = 25;
|
||||
this.backButton.Text = "< &Back";
|
||||
this.backButton.UseVisualStyleBackColor = true;
|
||||
this.backButton.Click += new System.EventHandler(this.backButton_Click);
|
||||
//
|
||||
// Roi1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(284, 262);
|
||||
this.Controls.Add(this.horizSplitContainer);
|
||||
this.Name = "Roi1";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Pointer/arrow style";
|
||||
this.Load += new System.EventHandler(this.Roi1_Load);
|
||||
this.horizSplitContainer.Panel1.ResumeLayout(false);
|
||||
this.horizSplitContainer.Panel1.PerformLayout();
|
||||
this.horizSplitContainer.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit();
|
||||
this.horizSplitContainer.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.stylePictureBox)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer horizSplitContainer;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.Button nextButton;
|
||||
private System.Windows.Forms.Button backButton;
|
||||
private System.Windows.Forms.TextBox teetgCountTextBox;
|
||||
private System.Windows.Forms.Label teethCount;
|
||||
private System.Windows.Forms.PictureBox stylePictureBox;
|
||||
private System.Windows.Forms.Button fwButton;
|
||||
private System.Windows.Forms.Button bwButton;
|
||||
|
||||
}
|
||||
}
|
||||
136
TestBenchFramework/TestWizard/Roi1.cs
Normal file
136
TestBenchFramework/TestWizard/Roi1.cs
Normal file
@ -0,0 +1,136 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.TestWizard
|
||||
{
|
||||
public partial class Roi1 : Form
|
||||
{
|
||||
RoiData roiData;
|
||||
|
||||
const int StylesCount = 3;
|
||||
int styleIdx; /// 0 .. StylesCount - 1
|
||||
|
||||
|
||||
public Roi1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public Roi1(bool first, bool last, RoiData roiData)
|
||||
: this()
|
||||
{
|
||||
this.roiData = roiData;
|
||||
|
||||
Text = "Pointer/arrow style";
|
||||
teethCount.Text = "Teeth count";
|
||||
|
||||
backButton.Text = Strings.BackBtnText;
|
||||
nextButton.Text = Strings.NextBtnText;
|
||||
cancelButton.Text = Strings.CancelBtnText;
|
||||
|
||||
if (first) backButton.Visible = false;
|
||||
if (last) nextButton.Text = Strings.FinishBtnText;
|
||||
}
|
||||
|
||||
|
||||
private void Roi1_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (roiData == null) return;
|
||||
|
||||
RefreshWizardPage();
|
||||
}
|
||||
|
||||
void RefreshWizardPage()
|
||||
{
|
||||
teetgCountTextBox.Text = roiData.TeethCount.ToString();
|
||||
styleIdx = roiData.StyleIdx;
|
||||
LoadImageAndUpdateFwBwBtns();
|
||||
nextButton.Enabled = IsFormValid();
|
||||
}
|
||||
|
||||
void LoadImageAndUpdateFwBwBtns()
|
||||
{
|
||||
switch (styleIdx)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
stylePictureBox.Image = new Bitmap(TBF.Properties.Resources.RoiStyle1);
|
||||
break;
|
||||
case 1:
|
||||
stylePictureBox.Image = new Bitmap(TBF.Properties.Resources.RoiStyle2);
|
||||
break;
|
||||
case 2:
|
||||
stylePictureBox.Image = new Bitmap(TBF.Properties.Resources.RoiStyle3);
|
||||
break;
|
||||
}
|
||||
|
||||
fwButton.Enabled = styleIdx < StylesCount - 1;
|
||||
bwButton.Enabled = styleIdx > 0;
|
||||
}
|
||||
|
||||
void UpdateTest()
|
||||
{
|
||||
roiData.StyleIdx = styleIdx;
|
||||
roiData.TeethCount = int.Parse(teetgCountTextBox.Text);
|
||||
}
|
||||
|
||||
bool IsFormValid()
|
||||
{
|
||||
int teethCnt;
|
||||
return int.TryParse(teetgCountTextBox.Text, out teethCnt)
|
||||
&& teethCnt > 0 && teethCnt <= 20
|
||||
&& styleIdx >= 0 && styleIdx < StylesCount
|
||||
&& (styleIdx == 2 || teethCnt == 1);
|
||||
}
|
||||
|
||||
private void backButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Retry;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void nextButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (roiData != null && IsFormValid())
|
||||
{
|
||||
UpdateTest();
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
}
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void anyTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
nextButton.Enabled = IsFormValid();
|
||||
}
|
||||
|
||||
private void bwButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (styleIdx > 0) styleIdx--;
|
||||
LoadImageAndUpdateFwBwBtns();
|
||||
nextButton.Enabled = IsFormValid();
|
||||
}
|
||||
|
||||
private void fwButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (styleIdx < StylesCount - 1) styleIdx++;
|
||||
LoadImageAndUpdateFwBwBtns();
|
||||
nextButton.Enabled = IsFormValid();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.TestWizard
|
||||
{
|
||||
partial class SensorsSelection
|
||||
partial class Roi2
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
@ -32,10 +32,15 @@ namespace TBF.TestWizard
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.horizSplitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.r2TextBox = new System.Windows.Forms.TextBox();
|
||||
this.r1TextBox = new System.Windows.Forms.TextBox();
|
||||
this.r2Label = new System.Windows.Forms.Label();
|
||||
this.r1Label = new System.Windows.Forms.Label();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.nextButton = new System.Windows.Forms.Button();
|
||||
this.backButton = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit();
|
||||
this.horizSplitContainer.Panel1.SuspendLayout();
|
||||
this.horizSplitContainer.Panel2.SuspendLayout();
|
||||
this.horizSplitContainer.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
@ -48,6 +53,13 @@ namespace TBF.TestWizard
|
||||
this.horizSplitContainer.Name = "horizSplitContainer";
|
||||
this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// horizSplitContainer.Panel1
|
||||
//
|
||||
this.horizSplitContainer.Panel1.Controls.Add(this.r2TextBox);
|
||||
this.horizSplitContainer.Panel1.Controls.Add(this.r1TextBox);
|
||||
this.horizSplitContainer.Panel1.Controls.Add(this.r2Label);
|
||||
this.horizSplitContainer.Panel1.Controls.Add(this.r1Label);
|
||||
//
|
||||
// horizSplitContainer.Panel2
|
||||
//
|
||||
this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton);
|
||||
@ -57,6 +69,40 @@ namespace TBF.TestWizard
|
||||
this.horizSplitContainer.SplitterDistance = 182;
|
||||
this.horizSplitContainer.TabIndex = 1;
|
||||
//
|
||||
// r2TextBox
|
||||
//
|
||||
this.r2TextBox.Location = new System.Drawing.Point(137, 93);
|
||||
this.r2TextBox.Name = "r2TextBox";
|
||||
this.r2TextBox.Size = new System.Drawing.Size(59, 20);
|
||||
this.r2TextBox.TabIndex = 5;
|
||||
this.r2TextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
|
||||
//
|
||||
// r1TextBox
|
||||
//
|
||||
this.r1TextBox.Location = new System.Drawing.Point(137, 63);
|
||||
this.r1TextBox.Name = "r1TextBox";
|
||||
this.r1TextBox.Size = new System.Drawing.Size(59, 20);
|
||||
this.r1TextBox.TabIndex = 4;
|
||||
this.r1TextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
|
||||
//
|
||||
// r2Label
|
||||
//
|
||||
this.r2Label.AutoSize = true;
|
||||
this.r2Label.Location = new System.Drawing.Point(83, 96);
|
||||
this.r2Label.Name = "r2Label";
|
||||
this.r2Label.Size = new System.Drawing.Size(21, 13);
|
||||
this.r2Label.TabIndex = 2;
|
||||
this.r2Label.Text = "R2";
|
||||
//
|
||||
// r1Label
|
||||
//
|
||||
this.r1Label.AutoSize = true;
|
||||
this.r1Label.Location = new System.Drawing.Point(83, 66);
|
||||
this.r1Label.Name = "r1Label";
|
||||
this.r1Label.Size = new System.Drawing.Size(21, 13);
|
||||
this.r1Label.TabIndex = 1;
|
||||
this.r1Label.Text = "R1";
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
@ -92,16 +138,18 @@ namespace TBF.TestWizard
|
||||
this.backButton.UseVisualStyleBackColor = true;
|
||||
this.backButton.Click += new System.EventHandler(this.backButton_Click);
|
||||
//
|
||||
// SensorsSelection
|
||||
// Roi2
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(284, 262);
|
||||
this.Controls.Add(this.horizSplitContainer);
|
||||
this.Name = "SensorsSelection";
|
||||
this.Name = "Roi2";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "SensorsSelection";
|
||||
this.Load += new System.EventHandler(this.SensorsSelection_Load);
|
||||
this.Text = "Pointer/arrow size";
|
||||
this.Load += new System.EventHandler(this.Roi2_Load_1);
|
||||
this.horizSplitContainer.Panel1.ResumeLayout(false);
|
||||
this.horizSplitContainer.Panel1.PerformLayout();
|
||||
this.horizSplitContainer.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit();
|
||||
this.horizSplitContainer.ResumeLayout(false);
|
||||
@ -115,5 +163,10 @@ namespace TBF.TestWizard
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.Button nextButton;
|
||||
private System.Windows.Forms.Button backButton;
|
||||
private System.Windows.Forms.TextBox r2TextBox;
|
||||
private System.Windows.Forms.TextBox r1TextBox;
|
||||
private System.Windows.Forms.Label r2Label;
|
||||
private System.Windows.Forms.Label r1Label;
|
||||
|
||||
}
|
||||
}
|
||||
97
TestBenchFramework/TestWizard/Roi2.cs
Normal file
97
TestBenchFramework/TestWizard/Roi2.cs
Normal file
@ -0,0 +1,97 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.TestWizard
|
||||
{
|
||||
public partial class Roi2 : Form
|
||||
{
|
||||
RoiData roiData;
|
||||
|
||||
|
||||
public Roi2()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public Roi2(bool first, bool last, RoiData roiData)
|
||||
: this()
|
||||
{
|
||||
this.roiData = roiData;
|
||||
|
||||
Text = "Pointer/arrow size";
|
||||
r1Label.Text = "R1";
|
||||
r2Label.Text = "R2";
|
||||
|
||||
backButton.Text = Strings.BackBtnText;
|
||||
nextButton.Text = Strings.NextBtnText;
|
||||
cancelButton.Text = Strings.CancelBtnText;
|
||||
|
||||
if (first) backButton.Visible = false;
|
||||
if (last) nextButton.Text = Strings.FinishBtnText;
|
||||
}
|
||||
|
||||
|
||||
private void Roi2_Load_1(object sender, EventArgs e)
|
||||
{
|
||||
if (roiData == null) return;
|
||||
|
||||
RefreshWizardPage();
|
||||
}
|
||||
|
||||
void RefreshWizardPage()
|
||||
{
|
||||
r1TextBox.Text = roiData.R1.ToString();
|
||||
r2TextBox.Text = roiData.R2.ToString();
|
||||
nextButton.Enabled = IsFormValid();
|
||||
}
|
||||
|
||||
void UpdateTest()
|
||||
{
|
||||
roiData.R1 = int.Parse(r1TextBox.Text);
|
||||
roiData.R2 = int.Parse(r2TextBox.Text);
|
||||
}
|
||||
|
||||
bool IsFormValid()
|
||||
{
|
||||
int r1, r2;
|
||||
return int.TryParse(r1TextBox.Text, out r1) &&
|
||||
int.TryParse(r2TextBox.Text, out r2) &&
|
||||
(r2 > r1) && (r1 > 0);
|
||||
}
|
||||
|
||||
private void backButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Retry;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void nextButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (roiData != null && IsFormValid())
|
||||
{
|
||||
UpdateTest();
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
}
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void anyTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
nextButton.Enabled = IsFormValid();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
TestBenchFramework/TestWizard/Roi2.resx
Normal file
120
TestBenchFramework/TestWizard/Roi2.resx
Normal file
@ -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>
|
||||
173
TestBenchFramework/TestWizard/Roi3.Designer.cs
generated
Normal file
173
TestBenchFramework/TestWizard/Roi3.Designer.cs
generated
Normal file
@ -0,0 +1,173 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.TestWizard
|
||||
{
|
||||
partial class Roi3
|
||||
{
|
||||
/// <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 Windows Form 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.horizSplitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.directionComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.directionLabel = new System.Windows.Forms.Label();
|
||||
this.pulsesPerLiterTextBox = new System.Windows.Forms.TextBox();
|
||||
this.pulsesPerLiterLabel = new System.Windows.Forms.Label();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.nextButton = new System.Windows.Forms.Button();
|
||||
this.backButton = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit();
|
||||
this.horizSplitContainer.Panel1.SuspendLayout();
|
||||
this.horizSplitContainer.Panel2.SuspendLayout();
|
||||
this.horizSplitContainer.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// horizSplitContainer
|
||||
//
|
||||
this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.horizSplitContainer.Location = new System.Drawing.Point(0, 0);
|
||||
this.horizSplitContainer.Name = "horizSplitContainer";
|
||||
this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// horizSplitContainer.Panel1
|
||||
//
|
||||
this.horizSplitContainer.Panel1.Controls.Add(this.directionComboBox);
|
||||
this.horizSplitContainer.Panel1.Controls.Add(this.directionLabel);
|
||||
this.horizSplitContainer.Panel1.Controls.Add(this.pulsesPerLiterTextBox);
|
||||
this.horizSplitContainer.Panel1.Controls.Add(this.pulsesPerLiterLabel);
|
||||
//
|
||||
// horizSplitContainer.Panel2
|
||||
//
|
||||
this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton);
|
||||
this.horizSplitContainer.Panel2.Controls.Add(this.nextButton);
|
||||
this.horizSplitContainer.Panel2.Controls.Add(this.backButton);
|
||||
this.horizSplitContainer.Size = new System.Drawing.Size(284, 262);
|
||||
this.horizSplitContainer.SplitterDistance = 182;
|
||||
this.horizSplitContainer.TabIndex = 1;
|
||||
//
|
||||
// directionComboBox
|
||||
//
|
||||
this.directionComboBox.FormattingEnabled = true;
|
||||
this.directionComboBox.Location = new System.Drawing.Point(129, 98);
|
||||
this.directionComboBox.Name = "directionComboBox";
|
||||
this.directionComboBox.Size = new System.Drawing.Size(132, 21);
|
||||
this.directionComboBox.TabIndex = 5;
|
||||
this.directionComboBox.SelectedIndexChanged += new System.EventHandler(this.anyTextBox_TextChanged);
|
||||
//
|
||||
// directionLabel
|
||||
//
|
||||
this.directionLabel.AutoSize = true;
|
||||
this.directionLabel.Location = new System.Drawing.Point(21, 101);
|
||||
this.directionLabel.Name = "directionLabel";
|
||||
this.directionLabel.Size = new System.Drawing.Size(86, 13);
|
||||
this.directionLabel.TabIndex = 4;
|
||||
this.directionLabel.Text = "Turning direction";
|
||||
//
|
||||
// pulsesPerLiterTextBox
|
||||
//
|
||||
this.pulsesPerLiterTextBox.Location = new System.Drawing.Point(129, 57);
|
||||
this.pulsesPerLiterTextBox.Name = "pulsesPerLiterTextBox";
|
||||
this.pulsesPerLiterTextBox.Size = new System.Drawing.Size(132, 20);
|
||||
this.pulsesPerLiterTextBox.TabIndex = 3;
|
||||
this.pulsesPerLiterTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
|
||||
//
|
||||
// pulsesPerLiterLabel
|
||||
//
|
||||
this.pulsesPerLiterLabel.AutoSize = true;
|
||||
this.pulsesPerLiterLabel.Location = new System.Drawing.Point(21, 60);
|
||||
this.pulsesPerLiterLabel.Name = "pulsesPerLiterLabel";
|
||||
this.pulsesPerLiterLabel.Size = new System.Drawing.Size(75, 13);
|
||||
this.pulsesPerLiterLabel.TabIndex = 2;
|
||||
this.pulsesPerLiterLabel.Text = "Pulses per liter";
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.Location = new System.Drawing.Point(186, 17);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(75, 42);
|
||||
this.cancelButton.TabIndex = 2;
|
||||
this.cancelButton.Text = "&Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
||||
//
|
||||
// nextButton
|
||||
//
|
||||
this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.nextButton.Location = new System.Drawing.Point(105, 17);
|
||||
this.nextButton.Name = "nextButton";
|
||||
this.nextButton.Size = new System.Drawing.Size(75, 42);
|
||||
this.nextButton.TabIndex = 1;
|
||||
this.nextButton.Text = "&Next >";
|
||||
this.nextButton.UseVisualStyleBackColor = true;
|
||||
this.nextButton.Click += new System.EventHandler(this.nextButton_Click);
|
||||
//
|
||||
// backButton
|
||||
//
|
||||
this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry;
|
||||
this.backButton.Location = new System.Drawing.Point(24, 17);
|
||||
this.backButton.Name = "backButton";
|
||||
this.backButton.Size = new System.Drawing.Size(75, 42);
|
||||
this.backButton.TabIndex = 0;
|
||||
this.backButton.Text = "< &Back";
|
||||
this.backButton.UseVisualStyleBackColor = true;
|
||||
this.backButton.Click += new System.EventHandler(this.backButton_Click);
|
||||
//
|
||||
// Roi3
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(284, 262);
|
||||
this.Controls.Add(this.horizSplitContainer);
|
||||
this.Name = "Roi3";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "ROI Data";
|
||||
this.Load += new System.EventHandler(this.Roi3_Load);
|
||||
this.horizSplitContainer.Panel1.ResumeLayout(false);
|
||||
this.horizSplitContainer.Panel1.PerformLayout();
|
||||
this.horizSplitContainer.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit();
|
||||
this.horizSplitContainer.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer horizSplitContainer;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.Button nextButton;
|
||||
private System.Windows.Forms.Button backButton;
|
||||
private System.Windows.Forms.TextBox pulsesPerLiterTextBox;
|
||||
private System.Windows.Forms.Label pulsesPerLiterLabel;
|
||||
private System.Windows.Forms.ComboBox directionComboBox;
|
||||
private System.Windows.Forms.Label directionLabel;
|
||||
|
||||
}
|
||||
}
|
||||
100
TestBenchFramework/TestWizard/Roi3.cs
Normal file
100
TestBenchFramework/TestWizard/Roi3.cs
Normal file
@ -0,0 +1,100 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.TestWizard
|
||||
{
|
||||
public partial class Roi3 : Form
|
||||
{
|
||||
RoiData roiData;
|
||||
|
||||
|
||||
public Roi3()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public Roi3(bool first, bool last, RoiData roiData)
|
||||
: this()
|
||||
{
|
||||
this.roiData = roiData;
|
||||
|
||||
Text = Strings.ROI_Data;
|
||||
pulsesPerLiterLabel.Text = Strings.PulsesPerLtr;
|
||||
directionLabel.Text = Strings.Turning_direction;
|
||||
|
||||
backButton.Text = Strings.BackBtnText;
|
||||
nextButton.Text = Strings.NextBtnText;
|
||||
cancelButton.Text = Strings.CancelBtnText;
|
||||
|
||||
if (first) backButton.Visible = false;
|
||||
if (last) nextButton.Text = Strings.FinishBtnText;
|
||||
}
|
||||
|
||||
|
||||
private void Roi3_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (roiData == null) return;
|
||||
|
||||
directionComboBox.Items.Add(Strings.Clockwise);
|
||||
directionComboBox.Items.Add(Strings.Counterclockwise);
|
||||
|
||||
RefreshWizardPage();
|
||||
}
|
||||
|
||||
void RefreshWizardPage()
|
||||
{
|
||||
pulsesPerLiterTextBox.Text = roiData.PulsesPerLiter.ToString();
|
||||
directionComboBox.Text = (roiData.Direction == TurningDirection.Clockwise) ? Strings.Clockwise : Strings.Counterclockwise;
|
||||
|
||||
nextButton.Enabled = IsFormValid();
|
||||
}
|
||||
|
||||
void UpdateTest()
|
||||
{
|
||||
roiData.PulsesPerLiter = Utils.ParseUDouble(pulsesPerLiterTextBox.Text);
|
||||
roiData.Direction = (directionComboBox.Text == Strings.Clockwise) ? TurningDirection.Clockwise : TurningDirection.Counterclockwise;
|
||||
}
|
||||
|
||||
bool IsFormValid()
|
||||
{
|
||||
double dummy;
|
||||
return Utils.TryParseUDouble(pulsesPerLiterTextBox.Text, out dummy) &&
|
||||
directionComboBox.Items.Contains(directionComboBox.Text);
|
||||
}
|
||||
|
||||
private void backButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Retry;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void nextButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (IsFormValid())
|
||||
{
|
||||
UpdateTest();
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
}
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void anyTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
nextButton.Enabled = IsFormValid();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
TestBenchFramework/TestWizard/Roi3.resx
Normal file
120
TestBenchFramework/TestWizard/Roi3.resx
Normal file
@ -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>
|
||||
89
TestBenchFramework/TestWizard/RoiData.cs
Normal file
89
TestBenchFramework/TestWizard/RoiData.cs
Normal file
@ -0,0 +1,89 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.TestWizard
|
||||
{
|
||||
public enum TurningDirection
|
||||
{
|
||||
Clockwise,
|
||||
Counterclockwise,
|
||||
Count,
|
||||
}
|
||||
|
||||
public class RoiData
|
||||
{
|
||||
/// Set by the wizard
|
||||
public int StyleIdx;
|
||||
public int TeethCount;
|
||||
public int R1;
|
||||
public int R2;
|
||||
public double PulsesPerLiter;
|
||||
public TurningDirection Direction;
|
||||
|
||||
/// Calculated
|
||||
public int WidHgh;
|
||||
public int CxCy;
|
||||
public int R3;
|
||||
public int P1;
|
||||
public int P2;
|
||||
public int N;
|
||||
public double Q; /// [m3/h]
|
||||
|
||||
|
||||
public RoiData()
|
||||
{
|
||||
TeethCount = 1;
|
||||
R1 = 30;
|
||||
R2 = 80;
|
||||
PulsesPerLiter = 36.0;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Calculate additional data from data entered by the wizard
|
||||
/// </summary>
|
||||
public void Calculate()
|
||||
{
|
||||
WidHgh = 2 * R2 + 1;
|
||||
CxCy = R2;
|
||||
|
||||
double acqTime; /// Duration of image sequence
|
||||
switch (StyleIdx)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
R3 = (int)System.Math.Round(0.8 * R2);
|
||||
P1 = 1;
|
||||
P2 = 19;
|
||||
N = 10;
|
||||
acqTime = 3.0;
|
||||
break;
|
||||
case 1:
|
||||
R3 = 0;
|
||||
P1 = 1;
|
||||
P2 = 19;
|
||||
N = 10;
|
||||
acqTime = 3.0;
|
||||
break;
|
||||
case 2:
|
||||
R3 = 0;
|
||||
P1 = 1;
|
||||
P2 = 1;
|
||||
N = 10;
|
||||
acqTime = 3.0;
|
||||
break;
|
||||
}
|
||||
|
||||
double vol = 360.0 / PulsesPerLiter; /// Liters per 1 rotation
|
||||
double flowLps = vol / acqTime;
|
||||
Q = 3.6 * flowLps; /// Convert to m3 / h
|
||||
}
|
||||
|
||||
public string GetRoiParams()
|
||||
{
|
||||
return string.Format("{0} {0} {1} {1} {2} {3} {4} 0 360 360 {5} {6}",
|
||||
WidHgh, CxCy, R1, R2, R3, TeethCount,
|
||||
(Direction == TestWizard.TurningDirection.Clockwise) ? 1 : -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,84 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.TestWizard
|
||||
{
|
||||
public partial class SensorsSelection : Form
|
||||
{
|
||||
Test test;
|
||||
|
||||
public SensorsSelection()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public SensorsSelection(Test test)
|
||||
: this()
|
||||
{
|
||||
this.test = test;
|
||||
}
|
||||
|
||||
private void SensorsSelection_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (test == null) return;
|
||||
|
||||
backButton.Text = Strings.BackBtnText;
|
||||
nextButton.Text = Strings.NextBtnText;
|
||||
cancelButton.Text = Strings.CancelBtnText;
|
||||
|
||||
RefreshWizardPage();
|
||||
}
|
||||
|
||||
void RefreshWizardPage()
|
||||
{
|
||||
nextButton.Enabled = IsFormValid();
|
||||
}
|
||||
|
||||
void UpdateTest()
|
||||
{
|
||||
}
|
||||
|
||||
bool IsFormValid()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private void backButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (test != null && IsFormValid()) UpdateTest();
|
||||
DialogResult = DialogResult.Retry;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void nextButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (test != null && IsFormValid())
|
||||
{
|
||||
UpdateTest();
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
}
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user