S640TestApp to verify web-services, etc.

This commit is contained in:
Milan Hanajik 2023-05-30 08:50:15 +02:00
parent b4f41a2f1f
commit f4db55cc0b
17 changed files with 912 additions and 8 deletions

2
.gitignore vendored
View File

@ -44,6 +44,8 @@ ResultsBrowser/bin/
ResultsBrowser/obj/
ResultsParser/bin/
ResultsParser/obj/
S640TestApp/bin/
S640TestApp/obj/
SharedDatabase/bin
SharedDatabase/obj
SchematicDrawing/bin

6
S640TestApp/App.config Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

22
S640TestApp/Program.cs Normal file
View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace S640TestApp
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new S640TestWnd());
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("S640TestApp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("S640TestApp")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2b84f803-89f3-43cd-9e2d-6ed03de6c3b8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace S640TestApp.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("S640TestApp.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace S640TestApp.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EE097B5A-8162-45B1-9643-4969FC3A8921}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>S640TestApp</RootNamespace>
<AssemblyName>S640TestApp</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="S640TestWnd.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="S640TestWnd.Designer.cs">
<DependentUpon>S640TestWnd.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="S640TestWnd.resx">
<DependentUpon>S640TestWnd.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{c8939821-ba5c-4988-a3d0-bf53b74865c7}</Project>
<Name>Common</Name>
</ProjectReference>
<ProjectReference Include="..\Config\Config.csproj">
<Project>{743df7db-c7b6-42eb-986d-0f485e5588e4}</Project>
<Name>Config</Name>
</ProjectReference>
<ProjectReference Include="..\RestClient\RestClient.csproj">
<Project>{46e3b0e1-209f-4550-b0dd-d7e2c039b3ce}</Project>
<Name>RestClient</Name>
</ProjectReference>
<ProjectReference Include="..\Results\Results.csproj">
<Project>{9d0dcc88-dc81-47eb-9fdd-4c3907871bfb}</Project>
<Name>Results</Name>
</ProjectReference>
<ProjectReference Include="..\TBF\TBF.csproj">
<Project>{8648fd92-cda1-4c3a-b5f9-fe547ce1fa48}</Project>
<Name>TBF</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

207
S640TestApp/S640TestWnd.Designer.cs generated Normal file
View File

@ -0,0 +1,207 @@
namespace S640TestApp
{
partial class S640TestWnd
{
/// <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.startButton = new System.Windows.Forms.Button();
this.endButton = new System.Windows.Forms.Button();
this.startCfgButton = new System.Windows.Forms.Button();
this.endCfgButton = new System.Windows.Forms.Button();
this.procParamsCfgButton = new System.Windows.Forms.Button();
this.idWzTypTextBox = new System.Windows.Forms.TextBox();
this.idWzTypLabel = new System.Windows.Forms.Label();
this.getButton = new System.Windows.Forms.Button();
this.baseUrlTextBox = new System.Windows.Forms.TextBox();
this.relativeUrlTextBox = new System.Windows.Forms.TextBox();
this.relativeUrlLabel = new System.Windows.Forms.Label();
this.baseUrlLabel = new System.Windows.Forms.Label();
this.getDefaultsGroupBox = new System.Windows.Forms.GroupBox();
this.getDefaultsGroupBox.SuspendLayout();
this.SuspendLayout();
//
// startButton
//
this.startButton.Location = new System.Drawing.Point(12, 110);
this.startButton.Name = "startButton";
this.startButton.Size = new System.Drawing.Size(109, 43);
this.startButton.TabIndex = 2;
this.startButton.Text = "Start";
this.startButton.UseVisualStyleBackColor = true;
this.startButton.Click += new System.EventHandler(this.startButton_Click);
//
// endButton
//
this.endButton.Location = new System.Drawing.Point(12, 208);
this.endButton.Name = "endButton";
this.endButton.Size = new System.Drawing.Size(109, 43);
this.endButton.TabIndex = 4;
this.endButton.Text = "End";
this.endButton.UseVisualStyleBackColor = true;
this.endButton.Click += new System.EventHandler(this.endButton_Click);
//
// startCfgButton
//
this.startCfgButton.Location = new System.Drawing.Point(12, 61);
this.startCfgButton.Name = "startCfgButton";
this.startCfgButton.Size = new System.Drawing.Size(109, 43);
this.startCfgButton.TabIndex = 1;
this.startCfgButton.Text = "Configure Start";
this.startCfgButton.UseVisualStyleBackColor = true;
this.startCfgButton.Click += new System.EventHandler(this.startCfgButton_Click);
//
// endCfgButton
//
this.endCfgButton.Location = new System.Drawing.Point(12, 159);
this.endCfgButton.Name = "endCfgButton";
this.endCfgButton.Size = new System.Drawing.Size(109, 43);
this.endCfgButton.TabIndex = 3;
this.endCfgButton.Text = "Configure End";
this.endCfgButton.UseVisualStyleBackColor = true;
this.endCfgButton.Click += new System.EventHandler(this.endCfgButton_Click);
//
// procParamsCfgButton
//
this.procParamsCfgButton.Location = new System.Drawing.Point(12, 12);
this.procParamsCfgButton.Name = "procParamsCfgButton";
this.procParamsCfgButton.Size = new System.Drawing.Size(109, 43);
this.procParamsCfgButton.TabIndex = 0;
this.procParamsCfgButton.Text = "Comm. parameters";
this.procParamsCfgButton.UseVisualStyleBackColor = true;
this.procParamsCfgButton.Click += new System.EventHandler(this.procParamsCfgButton_Click);
//
// idWzTypTextBox
//
this.idWzTypTextBox.Location = new System.Drawing.Point(87, 75);
this.idWzTypTextBox.Name = "idWzTypTextBox";
this.idWzTypTextBox.Size = new System.Drawing.Size(53, 20);
this.idWzTypTextBox.TabIndex = 5;
//
// idWzTypLabel
//
this.idWzTypLabel.AutoSize = true;
this.idWzTypLabel.Location = new System.Drawing.Point(12, 78);
this.idWzTypLabel.Name = "idWzTypLabel";
this.idWzTypLabel.Size = new System.Drawing.Size(60, 13);
this.idWzTypLabel.TabIndex = 4;
this.idWzTypLabel.Text = "ID WZ Typ";
//
// getButton
//
this.getButton.Location = new System.Drawing.Point(14, 109);
this.getButton.Name = "getButton";
this.getButton.Size = new System.Drawing.Size(126, 33);
this.getButton.TabIndex = 6;
this.getButton.Text = "Get";
this.getButton.UseVisualStyleBackColor = true;
this.getButton.Click += new System.EventHandler(this.getButton_Click);
//
// baseUrlTextBox
//
this.baseUrlTextBox.Location = new System.Drawing.Point(87, 25);
this.baseUrlTextBox.Name = "baseUrlTextBox";
this.baseUrlTextBox.Size = new System.Drawing.Size(298, 20);
this.baseUrlTextBox.TabIndex = 1;
//
// relativeUrlTextBox
//
this.relativeUrlTextBox.Location = new System.Drawing.Point(87, 50);
this.relativeUrlTextBox.Name = "relativeUrlTextBox";
this.relativeUrlTextBox.Size = new System.Drawing.Size(298, 20);
this.relativeUrlTextBox.TabIndex = 3;
//
// relativeUrlLabel
//
this.relativeUrlLabel.AutoSize = true;
this.relativeUrlLabel.Location = new System.Drawing.Point(11, 53);
this.relativeUrlLabel.Name = "relativeUrlLabel";
this.relativeUrlLabel.Size = new System.Drawing.Size(71, 13);
this.relativeUrlLabel.TabIndex = 2;
this.relativeUrlLabel.Text = "Relative URL";
//
// baseUrlLabel
//
this.baseUrlLabel.AutoSize = true;
this.baseUrlLabel.Location = new System.Drawing.Point(11, 28);
this.baseUrlLabel.Name = "baseUrlLabel";
this.baseUrlLabel.Size = new System.Drawing.Size(56, 13);
this.baseUrlLabel.TabIndex = 0;
this.baseUrlLabel.Text = "Base URL";
//
// getDefaultsGroupBox
//
this.getDefaultsGroupBox.Controls.Add(this.relativeUrlTextBox);
this.getDefaultsGroupBox.Controls.Add(this.baseUrlTextBox);
this.getDefaultsGroupBox.Controls.Add(this.idWzTypTextBox);
this.getDefaultsGroupBox.Controls.Add(this.idWzTypLabel);
this.getDefaultsGroupBox.Controls.Add(this.relativeUrlLabel);
this.getDefaultsGroupBox.Controls.Add(this.getButton);
this.getDefaultsGroupBox.Controls.Add(this.baseUrlLabel);
this.getDefaultsGroupBox.Location = new System.Drawing.Point(127, 12);
this.getDefaultsGroupBox.Name = "getDefaultsGroupBox";
this.getDefaultsGroupBox.Size = new System.Drawing.Size(394, 157);
this.getDefaultsGroupBox.TabIndex = 5;
this.getDefaultsGroupBox.TabStop = false;
this.getDefaultsGroupBox.Text = "Get default Q2 correction factors";
//
// S640TestWnd
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(533, 312);
this.Controls.Add(this.getDefaultsGroupBox);
this.Controls.Add(this.procParamsCfgButton);
this.Controls.Add(this.endCfgButton);
this.Controls.Add(this.startCfgButton);
this.Controls.Add(this.endButton);
this.Controls.Add(this.startButton);
this.Name = "S640TestWnd";
this.Text = "Form1";
this.getDefaultsGroupBox.ResumeLayout(false);
this.getDefaultsGroupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button startButton;
private System.Windows.Forms.Button endButton;
private System.Windows.Forms.Button startCfgButton;
private System.Windows.Forms.Button endCfgButton;
private System.Windows.Forms.Button procParamsCfgButton;
private System.Windows.Forms.TextBox idWzTypTextBox;
private System.Windows.Forms.Label idWzTypLabel;
private System.Windows.Forms.Button getButton;
private System.Windows.Forms.TextBox baseUrlTextBox;
private System.Windows.Forms.TextBox relativeUrlTextBox;
private System.Windows.Forms.Label relativeUrlLabel;
private System.Windows.Forms.Label baseUrlLabel;
private System.Windows.Forms.GroupBox getDefaultsGroupBox;
}
}

162
S640TestApp/S640TestWnd.cs Normal file
View File

@ -0,0 +1,162 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Common;
using Config;
using Config.Entities;
using RestClient;
using Results.Entities;
using TBF.Rig.TestMethods.S640Communication;
namespace S640TestApp
{
public partial class S640TestWnd : Form
{
ProcParams procParams;
S640StartCfg startCfg;
S640EndCfg endCfg;
Test test;
IList<WaterMeter> waterMeters;
public S640TestWnd()
{
InitializeComponent();
baseUrlTextBox.Text = "https://api-operations.sensus-emea.com/core/";
relativeUrlTextBox.Text = "metrology/q2correction/Locations/Wztyp/{0}";
test = new Test()
{
};
waterMeters = new List<WaterMeter>();
waterMeters.Add(new WaterMeter() { });
waterMeters.Add(new WaterMeter() { });
waterMeters.Add(new WaterMeter() { });
}
private void procParamsCfgButton_Click(object sender, EventArgs e)
{
if (procParams == null)
{
procParams = new ProcParams(true);
}
}
private void startCfgButton_Click(object sender, EventArgs e)
{
if (startCfg == null)
{
startCfg = new S640StartFactory().DefaultConfig() as S640StartCfg;
}
var cfgForm = new TBF.UI.Bench.Components.ComponentParametersDlg(this);
var cfgControl = startCfg.GetControl(null);
cfgControl.Config = startCfg;
cfgControl.Config.ItemNr = 1;
cfgForm.ComponentCfgCtrl = cfgControl;
cfgForm.UnlockAfterStart = true;
DialogResult dr = cfgForm.ShowDialog();
if (dr == DialogResult.OK)
{
return;
}
}
private void startButton_Click(object sender, EventArgs e)
{
if (startCfg == null || procParams == null)
{
MessageBox.Show("Not configured");
}
(new S640CommForm(S640Activity.Start, startCfg, procParams, test, waterMeters)).ShowDialog();
}
private void endCfgButton_Click(object sender, EventArgs e)
{
if (endCfg == null)
{
endCfg = new S640EndFactory().DefaultConfig() as S640EndCfg;
}
var cfgForm = new TBF.UI.Bench.Components.ComponentParametersDlg(this);
var cfgControl = endCfg.GetControl(null);
cfgControl.Config = endCfg;
cfgControl.Config.ItemNr = 1;
cfgForm.ComponentCfgCtrl = cfgControl;
cfgForm.UnlockAfterStart = true;
DialogResult dr = cfgForm.ShowDialog();
if (dr == DialogResult.OK)
{
return;
}
}
private void endButton_Click(object sender, EventArgs e)
{
if (endCfg == null || procParams == null)
{
MessageBox.Show("Not configured");
}
(new S640CommForm(S640Activity.End, endCfg, procParams, test, waterMeters)).ShowDialog();
}
private void getButton_Click(object sender, EventArgs e)
{
string baseUrl = baseUrlTextBox.Text;
string relativeUrl = relativeUrlTextBox.Text;
int wmType = 0;
int q2PreCorrectionLR;
int q2PreCorrectionRL;
if (string.IsNullOrEmpty(baseUrl) || string.IsNullOrEmpty(relativeUrl) ||
!int.TryParse(idWzTypTextBox.Text, out wmType) || wmType <= 0)
{
MessageBox.Show("Invalid parameter(s)");
return;
}
/// Get Q2 pre-correction values from REST service
try
{
GetQ2PreCorrectionClient client = new GetQ2PreCorrectionClient(baseUrl);
client.GetToken("ReadUser", "sensus",
"https://deluh1web03.world.fluidtechnology.net/SensusCore/api/v1/Locations/1/Login2").Wait();
string finalRelativeUrl = string.Format(relativeUrl, wmType);
Q2PreCorrection response = client.GetQ2Correction(finalRelativeUrl).Result;
if (response != null && response.AreDataCalculated)
{
q2PreCorrectionLR = response.CorrLR;
q2PreCorrectionRL = response.CorrRL;
MessageBox.Show(string.Format(
"Q2 corrections from a REST client for WM Type = {0} are: LR = {1}, RL = {2}",
wmType, q2PreCorrectionLR, q2PreCorrectionRL));
}
else
{
MessageBox.Show(string.Format(
"Failed to obtain Q2 corrections from a REST client for WM Type = {0}", wmType));
}
}
catch (Exception exc)
{
MessageBox.Show(string.Format(
"Failed to obtain Q2 corrections from a REST client for WM Type = {0}: {1}",
wmType, exc.Message));
}
}
}
}

View 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>

12
TBF.sln
View File

@ -96,6 +96,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenericTest", "GenericTest\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProductionTracing", "ProductionTracing\ProductionTracing.csproj", "{328AD6D5-6E62-42FB-B348-9899F813DBD3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "S640TestApp", "S640TestApp\S640TestApp.csproj", "{EE097B5A-8162-45B1-9643-4969FC3A8921}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -420,6 +422,16 @@ Global
{328AD6D5-6E62-42FB-B348-9899F813DBD3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{328AD6D5-6E62-42FB-B348-9899F813DBD3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{328AD6D5-6E62-42FB-B348-9899F813DBD3}.Release|x86.ActiveCfg = Release|Any CPU
{EE097B5A-8162-45B1-9643-4969FC3A8921}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EE097B5A-8162-45B1-9643-4969FC3A8921}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE097B5A-8162-45B1-9643-4969FC3A8921}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{EE097B5A-8162-45B1-9643-4969FC3A8921}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{EE097B5A-8162-45B1-9643-4969FC3A8921}.Debug|x86.ActiveCfg = Debug|Any CPU
{EE097B5A-8162-45B1-9643-4969FC3A8921}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE097B5A-8162-45B1-9643-4969FC3A8921}.Release|Any CPU.Build.0 = Release|Any CPU
{EE097B5A-8162-45B1-9643-4969FC3A8921}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{EE097B5A-8162-45B1-9643-4969FC3A8921}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{EE097B5A-8162-45B1-9643-4969FC3A8921}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -235,16 +235,16 @@ namespace TBF.Rig.TestMethods.S640Communication
throw new Exception("Something strange: activities.Count != tests.Count");
}
if (ProcessData.RegisterReaders.Length != ProcessData.BatchRslts.Batch.WaterMeters.Count)
if (activities.Count > 0)
{
ProcessData.RegisterReaders = StateMachine.GetMetersPath(tests[0]).RegisterReaders;
}
if (ProcessData.RegisterReaders.Length != waterMeters.Count)
{
throw new Exception("Something strange: RegisterReaders.Length != WaterMeters.Count");
}
if (activities.Count > 0)
{
ProcessData.RegisterReaders = StateMachine.GetMetersPath(tests[0]).RegisterReaders;
}
optoHeads = new RegisterReaders.S640Stream.S640Stream[ProcessData.RegisterReaders.Length];
///
for (int wmPos = 0; wmPos < ProcessData.RegisterReaders.Length; wmPos++)

View File

@ -62,7 +62,7 @@ namespace TBF.Rig.TestMethods.S640Communication
public void InitializeAll()
{
OptoDataTimeout = 120;
FileExchangePath = "1";
FileExchangePath = "C:\\eRegister Programming\\DataTransfer";
FileExchangeTimeout = 420;
SerialNumbers = SerialNumbers.None;
AssignedNumbers = SerialNumbers.None;

View File

@ -61,7 +61,7 @@ namespace TBF.Rig.TestMethods.S640Communication
public void InitializeAll()
{
OptoDataTimeout = 180;
FileExchangePath = "1";
FileExchangePath = "C:\\eRegister Programming\\DataTransfer";
FileExchangeTimeout = 420;
SerialNumbers = SerialNumbers.None;
AssignedNumbers = SerialNumbers.None;

View File

@ -46,6 +46,8 @@ rmdir /s /q ResultsBrowser\bin
rmdir /s /q ResultsBrowser\obj
rmdir /s /q ResultsParser\bin
rmdir /s /q ResultsParser\obj
rmdir /s /q S640TestApp\bin
rmdir /s /q S640TestApp\obj
rmdir /s /q SharedDatabase\bin
rmdir /s /q SharedDatabase\obj
rmdir /s /q SchematicDrawing\bin