Add (develop) GCI - GciBridge

This commit is contained in:
Marek Frniak 2026-04-23 09:09:27 +02:00
parent c13cb725f0
commit 8c10aa3752
40 changed files with 16218 additions and 32 deletions

6
.gitignore vendored
View File

@ -94,3 +94,9 @@ TBF.sln.DotSettings.user
/ExternalProjects
/GenesisCordonelTester
/packages
/GenesisCordonelInterface/bin/Debug/GenesisCordonelInterfaceLogger.log
/GenesisCordonelInterface/bin/Debug/GenesisCordonelTesterLogger.log
/GenesisCordonelInterface/bin/Debug/SirtConfig.json
/GenesisCordonelInterface/bin/Release
/GenesisCordonelInterface/obj/Debug
/GenesisCordonelInterface/obj/Release

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,124 @@
using System;
using System.Collections.Generic;
using Xylem.Common.Hardware.Interfaces.Ports.PortCore;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
using static Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.GenesisMeter;
namespace GenesisCordonelInterface.API
{
/// <summary>
/// Outside-facing facade for Genesis Cordonel Interface.
/// Exposes only selected operations intended for external callers.
/// </summary>
public class InterfaceOutsideToGCI
{
private readonly InterfaceGCIToLaatzen _innerMeterAPI;
/// <summary>
/// Initializes a new instance of the <see cref="InterfaceOutsideToGCI"/> class.
/// </summary>
public InterfaceOutsideToGCI()
{
_innerMeterAPI = new InterfaceGCIToLaatzen();
}
/// <summary>
/// Gets a value indicating whether the meter is currently connected and logged on.
/// </summary>
public bool IsConnected
{
get
{
return _innerMeterAPI.IsConnected;
}
}
/// <summary>
/// Connects to the meter on the specified slot.
/// </summary>
/// <param name="slotNo">Slot number.</param>
/// <param name="usePasswordsSource">Specifies whether offline passwords should be used.</param>
/// <returns>Connect operation result.</returns>
public InterfaceGCIToLaatzen.InitResult InitOneMeterFromExtern(Int32 slotNo, ConfigSource useConfigSource, PasswordSource usePasswordSource, PortConfig? requestPort, PortConfig? streamingPort)
{
return _innerMeterAPI.InitOneMeterFromExtern(slotNo, useConfigSource, usePasswordSource, requestPort, streamingPort);
}
/// <summary>
/// Connects to the meter on the specified slot.
/// </summary>
/// <param name="slotNo">Slot number.</param>
/// <param name="usePasswordsSource">Specifies whether offline passwords should be used.</param>
/// <returns>Connect operation result.</returns>
public InterfaceGCIToLaatzen.ConnectResult ConnectOneMeter(int slotNo)
{
return _innerMeterAPI.ConnectOneMeter(slotNo);
}
/// <summary>
/// Connects to the meter on the specified slot.
/// </summary>
/// <param name="slotNo">Slot number.</param>
/// <param name="usePasswordsSource">Specifies whether offline passwords should be used.</param>
/// <returns>Connect operation result.</returns>
public InterfaceGCIToLaatzen.ConnectResult ConnectAllMeters(int slotNo)
{
return _innerMeterAPI.ConnectAllMeters(slotNo);
}
/// <summary>
/// Disconnects from the currently connected meter.
/// </summary>
public void Disconnect()
{
_innerMeterAPI.Disconnect();
}
/// <summary>
/// Reads PCB ID from the specified slot.
/// </summary>
/// <param name="slot">Slot number.</param>
/// <returns>PCB ID string.</returns>
public string GetPcbId(int slot)
{
return _innerMeterAPI.GetPcbId(slot);
}
/// <summary>
/// Reads a register by name.
/// </summary>
/// <param name="registerName">Register name.</param>
/// <returns>Register read result.</returns>
public InterfaceGCIToLaatzen.RegisterReadResult ReadRegister(string registerName)
{
return _innerMeterAPI.ReadRegister(registerName);
}
/// <summary>
/// Writes a value to a register.
/// </summary>
/// <param name="registerName">Register name.</param>
/// <param name="value">Value to write.</param>
/// <param name="storeToDevice">Specifies whether configuration should be stored after write.</param>
/// <param name="refreshSystemState">Specifies whether system state refresh should be triggered after write.</param>
/// <returns>Register write result.</returns>
public InterfaceGCIToLaatzen.RegisterWriteResult WriteRegister(
string registerName,
object value,
bool storeToDevice = false,
bool refreshSystemState = false)
{
return _innerMeterAPI.WriteRegister(registerName, value, storeToDevice, refreshSystemState);
}
/// <summary>
/// Sets meter password.
/// </summary>
/// <param name="password">Password value.</param>
/// <returns>True if operation succeeded; otherwise false.</returns>
public bool SetMeterPassword(string password)
{
return _innerMeterAPI.SetMeterPassword(password);
}
}
}

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -0,0 +1,23 @@
Navod na logovanie projektu Laatzen/Common/ pre Genesis Cordonel meradla:
1. Princip:
- logovanie je zabezpecene pomocou nastroja NLog, ktory pouziva Laatzen
- Laatzen vsak pouziva nad NLogom svoj wrapper NLogHelper.cs a teda sa na pracu pri ich projektoch konfiguruje NLog pomocou ich suboru Nlogconfig.xml,
no nakolko ja som nechcel zasahovat do ich konfiguracneho suboru NLogu, pouzil som svoj, ktory je definovany v mojom projekte GenesisCordonelInterface,
s nazvom nlog.config
- z dovodu, ze som teda nechcel zasahovat do ich konfiguracie a zaroven som musel NLog na svoje ucely (presmerovanie logov do mema v mojom projekte),
musel som teda konfigurovat svojim konfiguracnym suborom, a zaroven plati ze pouzivam raw NLog.
- btw ked som pouzil ich wrapper a zaroven moj konfiguracny subor NLogu, tak pri spusten appky ho aj nacitalo, no nasledne sa nacitali Laatzenacke projekty
a nacital sa aj ich konfigurak Nlogu, ci sa prepisal ten moj. Pouzil som ten raw Nlog a uz to bolo ok
- takto je mozne presmerovat pomocou nizsie uvedenej metody logy az do mema v mojom projekte a tiez aj do suboru, pricom vsetko definujem v nlog.config
mojho projektu a nie v projekte Laatzenu
2. prilozene subory UiLogBus.cs a UiTarget.cs musia byt nakopirovane do projektu v ramci Solution s nazvom Common od Laatzenu
- kopiruju sa do top adresara projektu
- musia obsahovat ""namespace Xylem.Common.Utils.Logging"
- v mieste kde chcem logovat, je potrebne:
- zadefinovat:
private readonly ILogger Logger = NLogHelper.CreateOrGetLogger("GenesisCordonelInterface");
- pouzit log:
Logger.Error(ex, $"Slot #{slotNR} failed: {ex.Message}");
Logger.Trace("CONFIG: Setup loaded.");
Logger.Info("CONFIG: Setup loaded.");
...whatever

View File

@ -0,0 +1,18 @@
using System;
/*namespace Xylem.Common.Utils.Logging
{
public static class UiLogBus
{
public static event Action<string> MessageReceived;
public static void Publish(string message)
{
var handler = MessageReceived;
if (handler != null)
{
handler(message);
}
}
}
}*/

View File

@ -0,0 +1,15 @@
using NLog;
using NLog.Targets;
/*namespace Xylem.Common.Utils.Logging
{
[Target("UiTarget")]
public class UiTarget : TargetWithLayout
{
protected override void Write(LogEventInfo logEvent)
{
string message = Layout.Render(logEvent);
UiLogBus.Publish(message);
}
}
}*/

View File

@ -0,0 +1,225 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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>{C955D8AC-76B8-42D8-A83F-8AEB56CF2567}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>GenesisCordonelInterface</RootNamespace>
<AssemblyName>GenesisCordonelInterface</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<LangVersion>7.3</LangVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</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="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.5.2.2\lib\net46\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<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.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="API\InterfaceOutsideToGCI.cs" />
<Compile Include="API\InterfaceGCIToLaatzen.cs" />
<Compile Include="Core\Logging\UiLogBus.cs" />
<Compile Include="Core\Logging\UiTarget.cs" />
<Compile Include="UI\LaatzenAPI_GenesisToolBox\FrmConfigurations.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\LaatzenAPI_GenesisToolBox\FrmConfigurations.Designer.cs">
<DependentUpon>FrmConfigurations.cs</DependentUpon>
</Compile>
<Compile Include="UI\LaatzenAPI_CordonelPreadjustmentUI\FrmCordonelPreadjustmentUI.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\LaatzenAPI_CordonelPreadjustmentUI\FrmCordonelPreadjustmentUI.Designer.cs">
<DependentUpon>FrmCordonelPreadjustmentUI.cs</DependentUpon>
</Compile>
<Compile Include="UI\LaatzenAPI_GenesisToolBox\FrmRegisterStore.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\LaatzenAPI_GenesisToolBox\FrmRegisterStore.Designer.cs">
<DependentUpon>FrmRegisterStore.cs</DependentUpon>
</Compile>
<Compile Include="UI\LaatzenAPI_GenesisToolBox\FrmSetup.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\LaatzenAPI_GenesisToolBox\FrmSetup.Designer.cs">
<DependentUpon>FrmSetup.cs</DependentUpon>
</Compile>
<Compile Include="UI\MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UI\LaatzenAPI_CordonelPreadjustmentUI\PreAdjustmentControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UI\LaatzenAPI_CordonelPreadjustmentUI\PreAdjustmentControl.Designer.cs">
<DependentUpon>PreAdjustmentControl.cs</DependentUpon>
</Compile>
<Compile Include="UI\StaraTuraAPI_GenesisCordonelInterface\FrmGCIAPI.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\StaraTuraAPI_GenesisCordonelInterface\FrmGCIAPI.Designer.cs">
<DependentUpon>FrmGCIAPI.cs</DependentUpon>
</Compile>
<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>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="UI\LaatzenAPI_GenesisToolBox\FrmSetup.resx">
<DependentUpon>FrmSetup.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<Content Include="Core\Logging\ImportantInstructions.txt" />
<Content Include="nlog.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="UI\LaatzenAPI_CordonelPreadjustmentUI\PreAdjustmentControl.resx">
<DependentUpon>PreAdjustmentControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\StaraTuraAPI_GenesisCordonelInterface\FrmGCIAPI.resx">
<DependentUpon>FrmGCIAPI.cs</DependentUpon>
</EmbeddedResource>
<None Include="packages.config" />
<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>
<Folder Include="Core\AsTbfComponent\" />
<Folder Include="UI\AsTbfComponent\" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{c8939821-ba5c-4988-a3d0-bf53b74865c7}</Project>
<Name>Common</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\CommonCore.Configuration\CommonCore.Configuration.csproj">
<Project>{9eb1f659-6f73-4f65-bcab-4114fd94f5fc}</Project>
<Name>CommonCore.Configuration</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\CommonCore\CommonCore.csproj">
<Project>{1b02c79e-0b19-43e2-8f6b-71ef0c786c97}</Project>
<Name>CommonCore</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\CordonelPreadjustmentUi\CordonelPreadjustmentUi.csproj">
<Project>{d0c8d887-ed52-40ab-a069-90bce0e801e2}</Project>
<Name>CordonelPreadjustmentUi</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\Hardware\Interfaces\Ports\PortCore\PortCore.csproj">
<Project>{2e139f63-b6fe-4ea9-a098-85364fe9b26c}</Project>
<Name>PortCore</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\Hardware\Interfaces\Ports\SerialPorts\SerialPorts.csproj">
<Project>{72037e89-4f63-4b3f-beff-4138e578ce99}</Project>
<Name>SerialPorts</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\Hardware\WaterMeter\Genesis\Applications\Applications.csproj">
<Project>{315e94b8-b82f-4b25-b5bd-297df3bc1d54}</Project>
<Name>Applications</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\Hardware\WaterMeter\Genesis\GenesisConfig\GenesisConfig.csproj">
<Project>{f013a56b-7be6-4852-9cd8-b971cd1add0c}</Project>
<Name>GenesisConfig</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\Hardware\WaterMeter\Genesis\GenesisCore\GenesisCore.csproj">
<Project>{04201e95-90a0-4b73-a72f-379739b2a3ae}</Project>
<Name>GenesisCore</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\Hardware\WaterMeter\Genesis\Registers\Registers.csproj">
<Project>{f4aaf7e6-7333-4284-b735-e32deb076c64}</Project>
<Name>Registers</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\Hardware\WaterMeter\WaterMeterCore\WaterMeterCore.csproj">
<Project>{8203abb8-38e5-472e-a742-33f38b7a74a6}</Project>
<Name>WaterMeterCore</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\Hardware\WaterMeter\WaterMeterCore\WaterMeterRegisters\WaterMeterRegisters.csproj">
<Project>{26afcf1e-1287-48b8-a506-32b1e8a0dd0e}</Project>
<Name>WaterMeterRegisters</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\Logic.PrdoctionToProductMapper\Logic.ProductionToProductMapper.csproj">
<Project>{d0c859d9-d55e-4e85-ac50-0ff31b1ce50d}</Project>
<Name>Logic.ProductionToProductMapper</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\Logic\ProductionOrderCore\ProductionOrderCore.csproj">
<Project>{6d2777bb-7a88-466d-a49b-3266f9bf0160}</Project>
<Name>ProductionOrderCore</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\SoftwareAccessHelper\SoftwareAccessHelper.csproj">
<Project>{a33e3c6d-eaae-4a20-a0ee-f9e6922fd029}</Project>
<Name>SoftwareAccessHelper</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\Ui\GenesisToolBox\GenesisToolBox.csproj">
<Project>{95a50087-99ee-4349-9a17-c547290db42f}</Project>
<Name>GenesisToolBox</Name>
</ProjectReference>
<ProjectReference Include="..\ExternalProjects\Laatzen\Genesis\Common\Utils\Logging\Logging.csproj">
<Project>{4b88b0d3-e791-4774-9521-eabeacdc420e}</Project>
<Name>Logging</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,22 @@
using GenesisCordonelInterface.UI;
using NLog;
using System;
using System.Windows.Forms;
using Xylem.Common.Utils.Logging;
using System.IO;
namespace GenesisCordonelInterface
{
static class Program
{
private static readonly ILogger Logger = NLogHelper.CreateOrGetLogger("GenesisCordonelInterface");
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}

View File

@ -0,0 +1,33 @@
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("GenesisCordonelInterface")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Windows Org")]
[assembly: AssemblyProduct("GenesisCordonelInterface")]
[assembly: AssemblyCopyright("Copyright © Windows Org 2026")]
[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("c955d8ac-76b8-42d8-a83f-8aeb56cf2567")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <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 GenesisCordonelInterface.Properties {
using System;
/// <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", "17.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 (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GenesisCordonelInterface.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,26 @@
//------------------------------------------------------------------------------
// <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 GenesisCordonelInterface.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.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,275 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Xylem.Common.CommonCore.Consts;
using Xylem.Common.Hardware.Interfaces.Ports.PortCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
using Xylem.Common.Ui.CordonelPreadjustmentUi;
using CordonelPreadjustmentUi;
namespace GenesisCordonelInterface.UI.LaatzenAPI_CordonelPreadjustmentUI
{
public partial class FrmCordonelPreadjustmentUI : Form
{
private PreAdjustmentControl preadjustCtl;
private PreAdjustmentSettingsContainer mainSettings = new PreAdjustmentSettingsContainer();
public FrmCordonelPreadjustmentUI()
{
InitializeComponent();
}
private void MainForm_Load(object sender, EventArgs e)
{
preadjustCtl = new PreAdjustmentControl(mainSettings);
tab_ZeroFlowCal.Controls.Add(preadjustCtl);
cB_SinglePath.Checked = mainSettings.NumberOfPaths == 1 ? true : false;
nUD_SettingsTempMonitorLowerValue.Value = (decimal)mainSettings.LowerTempLimit;
nUD_SettingsTempMonitorUpperValue.Value = (decimal)mainSettings.UpperTempLimit;
nUD_SettingsTempMonitorDeviation.Value = (decimal)mainSettings.TempDeviationLimit;
// nUD_SettingsPreparationMetersize.Value = mainSettings.MeterSize.GetHashCode();
cB_OffsetTestLogFiles.Checked = mainSettings.OffsetTestGenerateLogfiles;
nUD_Settings_ZeroflowOffsetTestActivityCheckInterval.Value = mainSettings.OffsetTestActivityCheckInverval;
nUD_Settings_ZeroflowOffsetTestNumberOfLines.Value = mainSettings.OffsetTestNumberOfLines;
nUD_Settings_ZeroflowOffsetTestSettlingTime.Value = mainSettings.OffsetTestSettlingTime;
nUD_Settings_ZeroflowOffsetTestOffsetLimit.Value = mainSettings.OffsetTestOffsetLimitPS;
nUD_Settings_ZeroflowOffsetTestLowerLimit.Value = mainSettings.OffsetTestLowerVoltageLimitMV;
nUD_Settings_ZeroflowOffsetTestUpperLimit.Value = mainSettings.OffsetTestUpperVoltageLimitMV;
cB_AmpLogFiles.Checked = mainSettings.AmpTestGenerateLogfiles;
nUD_Settings_AmplitudeActivityCheckInterval.Value = mainSettings.AmpTestActivityCheckInverval;
cB_MeanAmplitudeFiles.Checked = mainSettings.AmpTestGenerateMeanValuesFile;
nUD_PercentageStop.Value = mainSettings.AmpTestPercentageStop;
nUD_PercentageStart.Value = mainSettings.AmpTestPercentageStart;
nUD_Settings_AmplitudeTestMinDistance.Value = mainSettings.AmpTestAmpTestDistance;
nUD_Settings_AmplitudeTestLowerLimit.Value = mainSettings.AmpTestFirstHitLevelPropMin;
nUD_Settings_AmplitudeTestUpperLimit.Value = mainSettings.AmpTestFirstHitLevelPropMax;
nUD_Settings_Samplerate.Value = mainSettings.Samplerate;
}
private void tab_Maintab_Selected(object sender, TabControlEventArgs e)
{
if (e.TabPage.Name == tab_ZeroFlowCal.Name)
{
try
{
var _serialConfigFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Genesis", ProgramConfig.SerialConfigFileName);
SlotConfig[] meterConfigList;
using (var tr = new StreamReader(_serialConfigFile))
{
var _fileString = tr.ReadToEnd();
meterConfigList = JsonConvert.DeserializeObject<SlotConfig[]>(_fileString);
}
mainSettings.Meters = new List<int>();
mainSettings.TempMeters = new List<int>();
foreach (var item in meterConfigList)
{
if (item.Type != SlotType.TemperatureMeter)
{
mainSettings.Meters.Add(item.Slot);
}
else
{
mainSettings.TempMeters.Add(item.Slot);
}
}
}
catch (Exception ex)
{
MessageBox.Show($"use default meters because of {ex.Message}");
}
mainSettings.NumberOfPaths = cB_SinglePath.Checked ? 1 : 3;
mainSettings.LowerTempLimit = (double)nUD_SettingsTempMonitorLowerValue.Value;
mainSettings.UpperTempLimit = (double)nUD_SettingsTempMonitorUpperValue.Value;
mainSettings.TempDeviationLimit = (double)nUD_SettingsTempMonitorDeviation.Value;
//mainSettings.MeterSize = (Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.Consts.MeterSize)nUD_SettingsPreparationMetersize.Value;
mainSettings.TempOnly = cB_TempOnly.Checked;
mainSettings.SetTempUseTempFlansh(true);
if (cB_TempManualAcquisition.Checked)
{
mainSettings.SetTempUseManualInput(true);
mainSettings.SetTempUseTempFlansh(false);
}
else
{
mainSettings.SetTempUseTempFlansh(true);
mainSettings.SetTempUseManualInput(false);
}
mainSettings.OffsetTestGenerateLogfiles = cB_OffsetTestLogFiles.Checked;
mainSettings.OffsetTestActivityCheckInverval = (int)nUD_Settings_ZeroflowOffsetTestActivityCheckInterval.Value;
mainSettings.OffsetTestNumberOfLines = (int)nUD_Settings_ZeroflowOffsetTestNumberOfLines.Value;
mainSettings.OffsetTestSettlingTime = (int)nUD_Settings_ZeroflowOffsetTestSettlingTime.Value;
mainSettings.OffsetTestOffsetLimitPS = (int)nUD_Settings_ZeroflowOffsetTestOffsetLimit.Value;
mainSettings.OffsetTestLowerVoltageLimitMV = (int)nUD_Settings_ZeroflowOffsetTestLowerLimit.Value;
mainSettings.OffsetTestUpperVoltageLimitMV = (int)nUD_Settings_ZeroflowOffsetTestUpperLimit.Value;
mainSettings.AmpTestGenerateLogfiles = cB_AmpLogFiles.Checked;
mainSettings.AmpTestActivityCheckInverval = (int)nUD_Settings_AmplitudeActivityCheckInterval.Value;
mainSettings.AmpTestGenerateMeanValuesFile = cB_MeanAmplitudeFiles.Checked;
mainSettings.AmpTestPercentageStop = (int)nUD_PercentageStop.Value;
mainSettings.AmpTestPercentageStart = (int)nUD_PercentageStart.Value;
mainSettings.AmpTestAmpTestDistance = (int)nUD_Settings_AmplitudeTestMinDistance.Value;
mainSettings.AmpTestFirstHitLevelPropMin = (int)nUD_Settings_AmplitudeTestLowerLimit.Value;
mainSettings.AmpTestFirstHitLevelPropMax = (int)nUD_Settings_AmplitudeTestUpperLimit.Value;
mainSettings.Samplerate = (int)nUD_Settings_Samplerate.Value;
preadjustCtl.SetSettings(mainSettings);
}
}
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
if (preadjustCtl != null)
{
preadjustCtl.CloseConnections();
preadjustCtl.Dispose();
}
if (ThermoMeterBatch != null)
{
ThermoMeterBatch.Dispose();
}
if (TempMeterStateCtls != null)
{
foreach (var item in TempMeterStateCtls)
{
item.Dispose();
}
}
}
private MeterBatch ThermoMeterBatch = new MeterBatch();
private List<MeterStateControl> TempMeterStateCtls = new List<MeterStateControl>();
private void tmpStart(int slot, bool RaspiMode = false)
{
var ctlZehn = new TempMeterStateControl(slot);
ctlZehn.Location = new Point(5 + ((TempMeterStateCtls.Count + 1) * ctlZehn.Width), 15);
TempMeterStateCtls.Add(ctlZehn);
gB_TempMeters.Controls.Add(ctlZehn);
ctlZehn.Enabled = true;
var currentMeter = new ZeroFlowGenesisMeter(ctlZehn.Slot, 3, !RaspiMode);
currentMeter.LogOnEnable = true;
currentMeter.LoginFailed = false;
currentMeter.PreparationFailed = false;
currentMeter.AmplitudeFailed = false;
currentMeter.ZeroFlowOffsetFailed = false;
currentMeter.AmplitudeFailed = false;
currentMeter.CompletionFailed = false;
currentMeter.Ok = false;
currentMeter.EmptyPipeCheckEnable = false;
currentMeter.EmptyPipeCheckFailed = false;
ThermoMeterBatch.AddMeter(currentMeter);
ctlZehn.IsEnabled = true;
ctlZehn.Meter = currentMeter;
ctlZehn.EnableOpening = true;
ctlZehn.Ok = ctlZehn.Meter.CheckStreamingPort();
ctlZehn.SetUi();
ctlZehn.Meter.StartRecordData();
ctlZehn.Meter.LogRawData(true);
if (RaspiMode)
{
ctlZehn.StartTempWatch(MeterStateControl.TempMode.CalcTof);
}
else
{
ctlZehn.StartTempWatch(MeterStateControl.TempMode.Meter);
}
ctlZehn.SetTemperature(0);
ctlZehn.DisableTemperatureinput(true);
ctlZehn.IsEnabled = true;
}
private void btn_LoadTempe_Click(object sender, EventArgs e)
{
tmpStart((int)nudTempSlot.Value, false);
}
private void btnTempRaspi_Click(object sender, EventArgs e)
{
tmpStart((int)nudTempSlot.Value, true);
}
private void button1_Click(object sender, EventArgs e)
{
if (TempMeterStateCtls != null)
{
StringBuilder sb = new StringBuilder();
foreach (var item in TempMeterStateCtls)
{
sb.AppendLine();
sb.AppendLine($"##########Meter{item.Slot}#############");
sb.Append(item.GetLog());
sb.AppendLine();
}
richTextBox1.Text = sb.ToString();
richTextBox1.ScrollToCaret();
}
}
private void tab_ZeroFlowCal_Click(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,673 @@
using Xylem.Common.Ui.CordonelPreadjustmentUi;
namespace GenesisCordonelInterface.UI
{
partial class PreAdjustmentControl
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Komponenten-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PreAdjustmentControl));
this.pB_Logo1 = new System.Windows.Forms.PictureBox();
this.gB_Meters = new System.Windows.Forms.GroupBox();
this.pB_Bubbles1 = new System.Windows.Forms.PictureBox();
this.l_ZeroFlowCal_Status = new System.Windows.Forms.Label();
this.gB_Progress = new System.Windows.Forms.GroupBox();
this.p_ZeroFlowCal_Completion = new System.Windows.Forms.Panel();
this.l_ZeroFlowCal_Completion = new System.Windows.Forms.Label();
this.p_ZeroFlowCal_Offset = new System.Windows.Forms.Panel();
this.l_ZeroFlowCal_Offset = new System.Windows.Forms.Label();
this.cB_ZeroFlowOffsetTestEnable = new System.Windows.Forms.CheckBox();
this.cB_AmplitudeTestEnable = new System.Windows.Forms.CheckBox();
this.cB_TempCalEnable = new System.Windows.Forms.CheckBox();
this.p_ZeroFlowCal_Detect = new System.Windows.Forms.Panel();
this.l_ZeroFlowCal_Detect = new System.Windows.Forms.Label();
this.p_ZeroFlowCal_TempCal = new System.Windows.Forms.Panel();
this.l_ZeroFlowCal_TempCal = new System.Windows.Forms.Label();
this.p_ZeroFlowCal_Prepare = new System.Windows.Forms.Panel();
this.l_ZeroFlowCal_Prepare = new System.Windows.Forms.Label();
this.p_ZeroFlowCal_Amplitude = new System.Windows.Forms.Panel();
this.l_ZeroFlowCal_Amplitude = new System.Windows.Forms.Label();
this.gB_TempMeters = new System.Windows.Forms.GroupBox();
this.btn_StoreTempe = new System.Windows.Forms.Button();
this.pB_ZeroFlowCal_Progress = new System.Windows.Forms.ProgressBar();
this.l_ZeroFlowCal_ResttimeDisplayValue = new System.Windows.Forms.Label();
this.l_ZeroFlowCal_Resttime = new System.Windows.Forms.Label();
this.btn_ZeroFlowCal_Abort = new System.Windows.Forms.Button();
this.btn_ZeroFlowCal_Start = new System.Windows.Forms.Button();
this.btn_ZeroFlowCal_Pdf = new System.Windows.Forms.Button();
this.btn_ZeroFlowCal_Save = new System.Windows.Forms.Button();
this.btn_ZeroFlowCal_Clear = new System.Windows.Forms.Button();
this.btn_ZeroFlowCal_Detect = new System.Windows.Forms.Button();
this.gB_MeterLog = new System.Windows.Forms.GroupBox();
this.btn_ShowAll = new System.Windows.Forms.Button();
this.rTB_ZeroFlowCalMeter = new System.Windows.Forms.RichTextBox();
this.pB_ZeroFlowCal_SubProgress = new System.Windows.Forms.ProgressBar();
this.l_ZeroFlowCal_SubResttimeDisplayValue = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.rTB_ZeroFlowCal = new System.Windows.Forms.RichTextBox();
this.l_SettingsPreparationMetersize = new System.Windows.Forms.Label();
this.cb_Metersize = new System.Windows.Forms.ComboBox();
this.lblBuildDate = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pB_Logo1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pB_Bubbles1)).BeginInit();
this.gB_Progress.SuspendLayout();
this.p_ZeroFlowCal_Completion.SuspendLayout();
this.p_ZeroFlowCal_Offset.SuspendLayout();
this.p_ZeroFlowCal_Detect.SuspendLayout();
this.p_ZeroFlowCal_TempCal.SuspendLayout();
this.p_ZeroFlowCal_Prepare.SuspendLayout();
this.p_ZeroFlowCal_Amplitude.SuspendLayout();
this.gB_TempMeters.SuspendLayout();
this.gB_MeterLog.SuspendLayout();
this.SuspendLayout();
//
// pB_Logo1
//
this.pB_Logo1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pB_Logo1.BackColor = System.Drawing.SystemColors.Control;
this.pB_Logo1.Image = ((System.Drawing.Image)(resources.GetObject("pB_Logo1.Image")));
this.pB_Logo1.InitialImage = null;
this.pB_Logo1.Location = new System.Drawing.Point(781, 0);
this.pB_Logo1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pB_Logo1.Name = "pB_Logo1";
this.pB_Logo1.Size = new System.Drawing.Size(158, 86);
this.pB_Logo1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pB_Logo1.TabIndex = 69;
this.pB_Logo1.TabStop = false;
//
// gB_Meters
//
this.gB_Meters.Location = new System.Drawing.Point(1, 98);
this.gB_Meters.Margin = new System.Windows.Forms.Padding(10, 10, 10, 10);
this.gB_Meters.Name = "gB_Meters";
this.gB_Meters.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gB_Meters.Size = new System.Drawing.Size(950, 174);
this.gB_Meters.TabIndex = 71;
this.gB_Meters.TabStop = false;
this.gB_Meters.Text = "Meters";
//
// pB_Bubbles1
//
this.pB_Bubbles1.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.pB_Bubbles1.Image = ((System.Drawing.Image)(resources.GetObject("pB_Bubbles1.Image")));
this.pB_Bubbles1.Location = new System.Drawing.Point(20, 2);
this.pB_Bubbles1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pB_Bubbles1.Name = "pB_Bubbles1";
this.pB_Bubbles1.Size = new System.Drawing.Size(267, 93);
this.pB_Bubbles1.TabIndex = 70;
this.pB_Bubbles1.TabStop = false;
this.pB_Bubbles1.Visible = false;
//
// l_ZeroFlowCal_Status
//
this.l_ZeroFlowCal_Status.AutoSize = true;
this.l_ZeroFlowCal_Status.Font = new System.Drawing.Font("Microsoft Sans Serif", 22.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.l_ZeroFlowCal_Status.Location = new System.Drawing.Point(10, 478);
this.l_ZeroFlowCal_Status.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.l_ZeroFlowCal_Status.Name = "l_ZeroFlowCal_Status";
this.l_ZeroFlowCal_Status.Size = new System.Drawing.Size(243, 36);
this.l_ZeroFlowCal_Status.TabIndex = 72;
this.l_ZeroFlowCal_Status.Text = "Press \'DETECT\'";
//
// gB_Progress
//
this.gB_Progress.Controls.Add(this.p_ZeroFlowCal_Completion);
this.gB_Progress.Controls.Add(this.p_ZeroFlowCal_Offset);
this.gB_Progress.Controls.Add(this.p_ZeroFlowCal_Detect);
this.gB_Progress.Controls.Add(this.p_ZeroFlowCal_TempCal);
this.gB_Progress.Controls.Add(this.p_ZeroFlowCal_Prepare);
this.gB_Progress.Controls.Add(this.p_ZeroFlowCal_Amplitude);
this.gB_Progress.Location = new System.Drawing.Point(8, 517);
this.gB_Progress.Margin = new System.Windows.Forms.Padding(10, 10, 10, 10);
this.gB_Progress.Name = "gB_Progress";
this.gB_Progress.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gB_Progress.Size = new System.Drawing.Size(744, 89);
this.gB_Progress.TabIndex = 80;
this.gB_Progress.TabStop = false;
//
// p_ZeroFlowCal_Completion
//
this.p_ZeroFlowCal_Completion.BackColor = System.Drawing.Color.Gainsboro;
this.p_ZeroFlowCal_Completion.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.p_ZeroFlowCal_Completion.Controls.Add(this.l_ZeroFlowCal_Completion);
this.p_ZeroFlowCal_Completion.Location = new System.Drawing.Point(607, 17);
this.p_ZeroFlowCal_Completion.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.p_ZeroFlowCal_Completion.Name = "p_ZeroFlowCal_Completion";
this.p_ZeroFlowCal_Completion.Size = new System.Drawing.Size(117, 65);
this.p_ZeroFlowCal_Completion.TabIndex = 32;
//
// l_ZeroFlowCal_Completion
//
this.l_ZeroFlowCal_Completion.AutoSize = true;
this.l_ZeroFlowCal_Completion.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.l_ZeroFlowCal_Completion.ForeColor = System.Drawing.Color.Gray;
this.l_ZeroFlowCal_Completion.Location = new System.Drawing.Point(0, 22);
this.l_ZeroFlowCal_Completion.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.l_ZeroFlowCal_Completion.Name = "l_ZeroFlowCal_Completion";
this.l_ZeroFlowCal_Completion.Size = new System.Drawing.Size(108, 17);
this.l_ZeroFlowCal_Completion.TabIndex = 40;
this.l_ZeroFlowCal_Completion.Text = "COMPLETION";
this.l_ZeroFlowCal_Completion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// p_ZeroFlowCal_Offset
//
this.p_ZeroFlowCal_Offset.BackColor = System.Drawing.Color.Gainsboro;
this.p_ZeroFlowCal_Offset.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.p_ZeroFlowCal_Offset.Controls.Add(this.l_ZeroFlowCal_Offset);
this.p_ZeroFlowCal_Offset.Controls.Add(this.cB_ZeroFlowOffsetTestEnable);
this.p_ZeroFlowCal_Offset.Controls.Add(this.cB_AmplitudeTestEnable);
this.p_ZeroFlowCal_Offset.Controls.Add(this.cB_TempCalEnable);
this.p_ZeroFlowCal_Offset.Location = new System.Drawing.Point(486, 17);
this.p_ZeroFlowCal_Offset.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.p_ZeroFlowCal_Offset.Name = "p_ZeroFlowCal_Offset";
this.p_ZeroFlowCal_Offset.Size = new System.Drawing.Size(121, 65);
this.p_ZeroFlowCal_Offset.TabIndex = 94;
//
// l_ZeroFlowCal_Offset
//
this.l_ZeroFlowCal_Offset.AutoSize = true;
this.l_ZeroFlowCal_Offset.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.l_ZeroFlowCal_Offset.ForeColor = System.Drawing.Color.Gray;
this.l_ZeroFlowCal_Offset.Location = new System.Drawing.Point(24, 12);
this.l_ZeroFlowCal_Offset.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.l_ZeroFlowCal_Offset.Name = "l_ZeroFlowCal_Offset";
this.l_ZeroFlowCal_Offset.Size = new System.Drawing.Size(68, 34);
this.l_ZeroFlowCal_Offset.TabIndex = 40;
this.l_ZeroFlowCal_Offset.Text = "OFFSET\r\nTEST";
this.l_ZeroFlowCal_Offset.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// cB_ZeroFlowOffsetTestEnable
//
this.cB_ZeroFlowOffsetTestEnable.AutoSize = true;
this.cB_ZeroFlowOffsetTestEnable.Checked = true;
this.cB_ZeroFlowOffsetTestEnable.CheckState = System.Windows.Forms.CheckState.Checked;
this.cB_ZeroFlowOffsetTestEnable.Enabled = false;
this.cB_ZeroFlowOffsetTestEnable.Location = new System.Drawing.Point(24, 15);
this.cB_ZeroFlowOffsetTestEnable.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cB_ZeroFlowOffsetTestEnable.Name = "cB_ZeroFlowOffsetTestEnable";
this.cB_ZeroFlowOffsetTestEnable.Size = new System.Drawing.Size(58, 17);
this.cB_ZeroFlowOffsetTestEnable.TabIndex = 90;
this.cB_ZeroFlowOffsetTestEnable.Text = "enable";
this.cB_ZeroFlowOffsetTestEnable.UseVisualStyleBackColor = true;
this.cB_ZeroFlowOffsetTestEnable.Visible = false;
//
// cB_AmplitudeTestEnable
//
this.cB_AmplitudeTestEnable.AutoSize = true;
this.cB_AmplitudeTestEnable.Checked = true;
this.cB_AmplitudeTestEnable.CheckState = System.Windows.Forms.CheckState.Checked;
this.cB_AmplitudeTestEnable.Enabled = false;
this.cB_AmplitudeTestEnable.Location = new System.Drawing.Point(-216, 48);
this.cB_AmplitudeTestEnable.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cB_AmplitudeTestEnable.Name = "cB_AmplitudeTestEnable";
this.cB_AmplitudeTestEnable.Size = new System.Drawing.Size(58, 17);
this.cB_AmplitudeTestEnable.TabIndex = 92;
this.cB_AmplitudeTestEnable.Text = "enable";
this.cB_AmplitudeTestEnable.UseVisualStyleBackColor = true;
//
// cB_TempCalEnable
//
this.cB_TempCalEnable.AutoSize = true;
this.cB_TempCalEnable.Checked = true;
this.cB_TempCalEnable.CheckState = System.Windows.Forms.CheckState.Checked;
this.cB_TempCalEnable.Enabled = false;
this.cB_TempCalEnable.Location = new System.Drawing.Point(-96, 48);
this.cB_TempCalEnable.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cB_TempCalEnable.Name = "cB_TempCalEnable";
this.cB_TempCalEnable.Size = new System.Drawing.Size(58, 17);
this.cB_TempCalEnable.TabIndex = 94;
this.cB_TempCalEnable.Text = "enable";
this.cB_TempCalEnable.UseVisualStyleBackColor = true;
//
// p_ZeroFlowCal_Detect
//
this.p_ZeroFlowCal_Detect.BackColor = System.Drawing.Color.Gainsboro;
this.p_ZeroFlowCal_Detect.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.p_ZeroFlowCal_Detect.Controls.Add(this.l_ZeroFlowCal_Detect);
this.p_ZeroFlowCal_Detect.Location = new System.Drawing.Point(4, 17);
this.p_ZeroFlowCal_Detect.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.p_ZeroFlowCal_Detect.Name = "p_ZeroFlowCal_Detect";
this.p_ZeroFlowCal_Detect.Size = new System.Drawing.Size(121, 65);
this.p_ZeroFlowCal_Detect.TabIndex = 40;
//
// l_ZeroFlowCal_Detect
//
this.l_ZeroFlowCal_Detect.AutoSize = true;
this.l_ZeroFlowCal_Detect.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.l_ZeroFlowCal_Detect.ForeColor = System.Drawing.Color.Gray;
this.l_ZeroFlowCal_Detect.Location = new System.Drawing.Point(24, 22);
this.l_ZeroFlowCal_Detect.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.l_ZeroFlowCal_Detect.Name = "l_ZeroFlowCal_Detect";
this.l_ZeroFlowCal_Detect.Size = new System.Drawing.Size(69, 17);
this.l_ZeroFlowCal_Detect.TabIndex = 39;
this.l_ZeroFlowCal_Detect.Text = "DETECT";
//
// p_ZeroFlowCal_TempCal
//
this.p_ZeroFlowCal_TempCal.BackColor = System.Drawing.Color.Gainsboro;
this.p_ZeroFlowCal_TempCal.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.p_ZeroFlowCal_TempCal.Controls.Add(this.l_ZeroFlowCal_TempCal);
this.p_ZeroFlowCal_TempCal.Location = new System.Drawing.Point(365, 17);
this.p_ZeroFlowCal_TempCal.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.p_ZeroFlowCal_TempCal.Name = "p_ZeroFlowCal_TempCal";
this.p_ZeroFlowCal_TempCal.Size = new System.Drawing.Size(121, 65);
this.p_ZeroFlowCal_TempCal.TabIndex = 41;
//
// l_ZeroFlowCal_TempCal
//
this.l_ZeroFlowCal_TempCal.AutoSize = true;
this.l_ZeroFlowCal_TempCal.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.l_ZeroFlowCal_TempCal.ForeColor = System.Drawing.Color.Gray;
this.l_ZeroFlowCal_TempCal.Location = new System.Drawing.Point(0, 12);
this.l_ZeroFlowCal_TempCal.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.l_ZeroFlowCal_TempCal.Name = "l_ZeroFlowCal_TempCal";
this.l_ZeroFlowCal_TempCal.Size = new System.Drawing.Size(123, 34);
this.l_ZeroFlowCal_TempCal.TabIndex = 40;
this.l_ZeroFlowCal_TempCal.Text = "TEMPERATURE\r\nCALIBRATION";
this.l_ZeroFlowCal_TempCal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// p_ZeroFlowCal_Prepare
//
this.p_ZeroFlowCal_Prepare.BackColor = System.Drawing.Color.Gainsboro;
this.p_ZeroFlowCal_Prepare.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.p_ZeroFlowCal_Prepare.Controls.Add(this.l_ZeroFlowCal_Prepare);
this.p_ZeroFlowCal_Prepare.Location = new System.Drawing.Point(124, 17);
this.p_ZeroFlowCal_Prepare.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.p_ZeroFlowCal_Prepare.Name = "p_ZeroFlowCal_Prepare";
this.p_ZeroFlowCal_Prepare.Size = new System.Drawing.Size(121, 65);
this.p_ZeroFlowCal_Prepare.TabIndex = 31;
//
// l_ZeroFlowCal_Prepare
//
this.l_ZeroFlowCal_Prepare.AutoSize = true;
this.l_ZeroFlowCal_Prepare.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.l_ZeroFlowCal_Prepare.ForeColor = System.Drawing.Color.Gray;
this.l_ZeroFlowCal_Prepare.Location = new System.Drawing.Point(18, 22);
this.l_ZeroFlowCal_Prepare.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.l_ZeroFlowCal_Prepare.Name = "l_ZeroFlowCal_Prepare";
this.l_ZeroFlowCal_Prepare.Size = new System.Drawing.Size(80, 17);
this.l_ZeroFlowCal_Prepare.TabIndex = 39;
this.l_ZeroFlowCal_Prepare.Text = "PREPARE";
//
// p_ZeroFlowCal_Amplitude
//
this.p_ZeroFlowCal_Amplitude.BackColor = System.Drawing.Color.Gainsboro;
this.p_ZeroFlowCal_Amplitude.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.p_ZeroFlowCal_Amplitude.Controls.Add(this.l_ZeroFlowCal_Amplitude);
this.p_ZeroFlowCal_Amplitude.Location = new System.Drawing.Point(244, 17);
this.p_ZeroFlowCal_Amplitude.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.p_ZeroFlowCal_Amplitude.Name = "p_ZeroFlowCal_Amplitude";
this.p_ZeroFlowCal_Amplitude.Size = new System.Drawing.Size(121, 65);
this.p_ZeroFlowCal_Amplitude.TabIndex = 32;
//
// l_ZeroFlowCal_Amplitude
//
this.l_ZeroFlowCal_Amplitude.AutoSize = true;
this.l_ZeroFlowCal_Amplitude.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.l_ZeroFlowCal_Amplitude.ForeColor = System.Drawing.Color.Gray;
this.l_ZeroFlowCal_Amplitude.Location = new System.Drawing.Point(12, 15);
this.l_ZeroFlowCal_Amplitude.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.l_ZeroFlowCal_Amplitude.Name = "l_ZeroFlowCal_Amplitude";
this.l_ZeroFlowCal_Amplitude.Size = new System.Drawing.Size(95, 34);
this.l_ZeroFlowCal_Amplitude.TabIndex = 39;
this.l_ZeroFlowCal_Amplitude.Text = "AMPLITUDE\r\nTEST";
this.l_ZeroFlowCal_Amplitude.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// gB_TempMeters
//
this.gB_TempMeters.Controls.Add(this.btn_StoreTempe);
this.gB_TempMeters.Location = new System.Drawing.Point(8, 275);
this.gB_TempMeters.Margin = new System.Windows.Forms.Padding(10, 10, 10, 10);
this.gB_TempMeters.Name = "gB_TempMeters";
this.gB_TempMeters.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gB_TempMeters.Size = new System.Drawing.Size(403, 193);
this.gB_TempMeters.TabIndex = 72;
this.gB_TempMeters.TabStop = false;
this.gB_TempMeters.Text = "Temp. Meters";
//
// btn_StoreTempe
//
this.btn_StoreTempe.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_StoreTempe.Enabled = false;
this.btn_StoreTempe.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_StoreTempe.Location = new System.Drawing.Point(4, 158);
this.btn_StoreTempe.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btn_StoreTempe.Name = "btn_StoreTempe";
this.btn_StoreTempe.Size = new System.Drawing.Size(395, 31);
this.btn_StoreTempe.TabIndex = 95;
this.btn_StoreTempe.Text = "SAVE TEMP";
this.btn_StoreTempe.UseVisualStyleBackColor = true;
this.btn_StoreTempe.Click += new System.EventHandler(this.btn_StoreTempe_Click);
//
// pB_ZeroFlowCal_Progress
//
this.pB_ZeroFlowCal_Progress.Location = new System.Drawing.Point(8, 634);
this.pB_ZeroFlowCal_Progress.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pB_ZeroFlowCal_Progress.Name = "pB_ZeroFlowCal_Progress";
this.pB_ZeroFlowCal_Progress.Size = new System.Drawing.Size(724, 18);
this.pB_ZeroFlowCal_Progress.Step = 1;
this.pB_ZeroFlowCal_Progress.TabIndex = 35;
//
// l_ZeroFlowCal_ResttimeDisplayValue
//
this.l_ZeroFlowCal_ResttimeDisplayValue.AutoSize = true;
this.l_ZeroFlowCal_ResttimeDisplayValue.Location = new System.Drawing.Point(843, 634);
this.l_ZeroFlowCal_ResttimeDisplayValue.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.l_ZeroFlowCal_ResttimeDisplayValue.Name = "l_ZeroFlowCal_ResttimeDisplayValue";
this.l_ZeroFlowCal_ResttimeDisplayValue.Size = new System.Drawing.Size(49, 13);
this.l_ZeroFlowCal_ResttimeDisplayValue.TabIndex = 37;
this.l_ZeroFlowCal_ResttimeDisplayValue.Text = "00:00:00";
//
// l_ZeroFlowCal_Resttime
//
this.l_ZeroFlowCal_Resttime.AutoSize = true;
this.l_ZeroFlowCal_Resttime.Location = new System.Drawing.Point(736, 634);
this.l_ZeroFlowCal_Resttime.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.l_ZeroFlowCal_Resttime.Name = "l_ZeroFlowCal_Resttime";
this.l_ZeroFlowCal_Resttime.Size = new System.Drawing.Size(54, 13);
this.l_ZeroFlowCal_Resttime.TabIndex = 36;
this.l_ZeroFlowCal_Resttime.Text = "Est. total: ";
//
// btn_ZeroFlowCal_Abort
//
this.btn_ZeroFlowCal_Abort.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_ZeroFlowCal_Abort.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_ZeroFlowCal_Abort.Location = new System.Drawing.Point(672, 44);
this.btn_ZeroFlowCal_Abort.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btn_ZeroFlowCal_Abort.Name = "btn_ZeroFlowCal_Abort";
this.btn_ZeroFlowCal_Abort.Size = new System.Drawing.Size(102, 52);
this.btn_ZeroFlowCal_Abort.TabIndex = 84;
this.btn_ZeroFlowCal_Abort.Text = "STOP";
this.btn_ZeroFlowCal_Abort.UseVisualStyleBackColor = true;
this.btn_ZeroFlowCal_Abort.Click += new System.EventHandler(this.btn_ZeroFlowCal_Abort_Click);
//
// btn_ZeroFlowCal_Start
//
this.btn_ZeroFlowCal_Start.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_ZeroFlowCal_Start.Enabled = false;
this.btn_ZeroFlowCal_Start.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_ZeroFlowCal_Start.Location = new System.Drawing.Point(566, 44);
this.btn_ZeroFlowCal_Start.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btn_ZeroFlowCal_Start.Name = "btn_ZeroFlowCal_Start";
this.btn_ZeroFlowCal_Start.Size = new System.Drawing.Size(102, 51);
this.btn_ZeroFlowCal_Start.TabIndex = 83;
this.btn_ZeroFlowCal_Start.Text = "START";
this.btn_ZeroFlowCal_Start.UseVisualStyleBackColor = true;
this.btn_ZeroFlowCal_Start.Click += new System.EventHandler(this.btn_ZeroFlowCal_Start_Click);
//
// btn_ZeroFlowCal_Pdf
//
this.btn_ZeroFlowCal_Pdf.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btn_ZeroFlowCal_Pdf.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_ZeroFlowCal_Pdf.Location = new System.Drawing.Point(846, 529);
this.btn_ZeroFlowCal_Pdf.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btn_ZeroFlowCal_Pdf.Name = "btn_ZeroFlowCal_Pdf";
this.btn_ZeroFlowCal_Pdf.Size = new System.Drawing.Size(63, 38);
this.btn_ZeroFlowCal_Pdf.TabIndex = 91;
this.btn_ZeroFlowCal_Pdf.Text = "PDF";
this.btn_ZeroFlowCal_Pdf.UseVisualStyleBackColor = true;
//
// btn_ZeroFlowCal_Save
//
this.btn_ZeroFlowCal_Save.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btn_ZeroFlowCal_Save.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_ZeroFlowCal_Save.Location = new System.Drawing.Point(779, 529);
this.btn_ZeroFlowCal_Save.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btn_ZeroFlowCal_Save.Name = "btn_ZeroFlowCal_Save";
this.btn_ZeroFlowCal_Save.Size = new System.Drawing.Size(63, 38);
this.btn_ZeroFlowCal_Save.TabIndex = 90;
this.btn_ZeroFlowCal_Save.Text = "Save";
this.btn_ZeroFlowCal_Save.UseVisualStyleBackColor = true;
//
// btn_ZeroFlowCal_Clear
//
this.btn_ZeroFlowCal_Clear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btn_ZeroFlowCal_Clear.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_ZeroFlowCal_Clear.Location = new System.Drawing.Point(779, 571);
this.btn_ZeroFlowCal_Clear.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btn_ZeroFlowCal_Clear.Name = "btn_ZeroFlowCal_Clear";
this.btn_ZeroFlowCal_Clear.Size = new System.Drawing.Size(130, 28);
this.btn_ZeroFlowCal_Clear.TabIndex = 89;
this.btn_ZeroFlowCal_Clear.Text = "Clear";
this.btn_ZeroFlowCal_Clear.UseVisualStyleBackColor = true;
//
// btn_ZeroFlowCal_Detect
//
this.btn_ZeroFlowCal_Detect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_ZeroFlowCal_Detect.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_ZeroFlowCal_Detect.Location = new System.Drawing.Point(291, 44);
this.btn_ZeroFlowCal_Detect.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btn_ZeroFlowCal_Detect.Name = "btn_ZeroFlowCal_Detect";
this.btn_ZeroFlowCal_Detect.Size = new System.Drawing.Size(102, 51);
this.btn_ZeroFlowCal_Detect.TabIndex = 82;
this.btn_ZeroFlowCal_Detect.Text = "DETECT";
this.btn_ZeroFlowCal_Detect.UseVisualStyleBackColor = true;
this.btn_ZeroFlowCal_Detect.Click += new System.EventHandler(this.btn_ZeroFlowCal_Detect_Click);
//
// gB_MeterLog
//
this.gB_MeterLog.Controls.Add(this.btn_ShowAll);
this.gB_MeterLog.Controls.Add(this.rTB_ZeroFlowCalMeter);
this.gB_MeterLog.Location = new System.Drawing.Point(419, 275);
this.gB_MeterLog.Margin = new System.Windows.Forms.Padding(10, 10, 10, 10);
this.gB_MeterLog.Name = "gB_MeterLog";
this.gB_MeterLog.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gB_MeterLog.Size = new System.Drawing.Size(532, 193);
this.gB_MeterLog.TabIndex = 72;
this.gB_MeterLog.TabStop = false;
this.gB_MeterLog.Text = "Meters";
this.gB_MeterLog.Visible = false;
//
// btn_ShowAll
//
this.btn_ShowAll.Location = new System.Drawing.Point(5, 14);
this.btn_ShowAll.Name = "btn_ShowAll";
this.btn_ShowAll.Size = new System.Drawing.Size(123, 20);
this.btn_ShowAll.TabIndex = 97;
this.btn_ShowAll.Text = "ShowAll";
this.btn_ShowAll.UseVisualStyleBackColor = true;
this.btn_ShowAll.Click += new System.EventHandler(this.btn_ShowAll_Click);
//
// rTB_ZeroFlowCalMeter
//
this.rTB_ZeroFlowCalMeter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.rTB_ZeroFlowCalMeter.Location = new System.Drawing.Point(4, 39);
this.rTB_ZeroFlowCalMeter.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.rTB_ZeroFlowCalMeter.Name = "rTB_ZeroFlowCalMeter";
this.rTB_ZeroFlowCalMeter.ReadOnly = true;
this.rTB_ZeroFlowCalMeter.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
this.rTB_ZeroFlowCalMeter.Size = new System.Drawing.Size(516, 139);
this.rTB_ZeroFlowCalMeter.TabIndex = 96;
this.rTB_ZeroFlowCalMeter.Text = "";
//
// pB_ZeroFlowCal_SubProgress
//
this.pB_ZeroFlowCal_SubProgress.Location = new System.Drawing.Point(8, 612);
this.pB_ZeroFlowCal_SubProgress.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pB_ZeroFlowCal_SubProgress.Name = "pB_ZeroFlowCal_SubProgress";
this.pB_ZeroFlowCal_SubProgress.Size = new System.Drawing.Size(724, 18);
this.pB_ZeroFlowCal_SubProgress.Step = 1;
this.pB_ZeroFlowCal_SubProgress.TabIndex = 92;
//
// l_ZeroFlowCal_SubResttimeDisplayValue
//
this.l_ZeroFlowCal_SubResttimeDisplayValue.AutoSize = true;
this.l_ZeroFlowCal_SubResttimeDisplayValue.Location = new System.Drawing.Point(845, 617);
this.l_ZeroFlowCal_SubResttimeDisplayValue.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.l_ZeroFlowCal_SubResttimeDisplayValue.Name = "l_ZeroFlowCal_SubResttimeDisplayValue";
this.l_ZeroFlowCal_SubResttimeDisplayValue.Size = new System.Drawing.Size(49, 13);
this.l_ZeroFlowCal_SubResttimeDisplayValue.TabIndex = 94;
this.l_ZeroFlowCal_SubResttimeDisplayValue.Text = "00:00:00";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(736, 616);
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(105, 13);
this.label2.TabIndex = 93;
this.label2.Text = "Est. finish Proccess: ";
//
// rTB_ZeroFlowCal
//
this.rTB_ZeroFlowCal.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.rTB_ZeroFlowCal.Location = new System.Drawing.Point(419, 280);
this.rTB_ZeroFlowCal.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.rTB_ZeroFlowCal.Name = "rTB_ZeroFlowCal";
this.rTB_ZeroFlowCal.ReadOnly = true;
this.rTB_ZeroFlowCal.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
this.rTB_ZeroFlowCal.Size = new System.Drawing.Size(528, 193);
this.rTB_ZeroFlowCal.TabIndex = 101;
this.rTB_ZeroFlowCal.Text = "";
//
// l_SettingsPreparationMetersize
//
this.l_SettingsPreparationMetersize.AutoSize = true;
this.l_SettingsPreparationMetersize.Location = new System.Drawing.Point(416, 72);
this.l_SettingsPreparationMetersize.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.l_SettingsPreparationMetersize.Name = "l_SettingsPreparationMetersize";
this.l_SettingsPreparationMetersize.Size = new System.Drawing.Size(55, 13);
this.l_SettingsPreparationMetersize.TabIndex = 104;
this.l_SettingsPreparationMetersize.Text = "Metersize:";
//
// cb_Metersize
//
this.cb_Metersize.FormattingEnabled = true;
this.cb_Metersize.Location = new System.Drawing.Point(476, 66);
this.cb_Metersize.Name = "cb_Metersize";
this.cb_Metersize.Size = new System.Drawing.Size(73, 21);
this.cb_Metersize.TabIndex = 105;
//
// lblBuildDate
//
this.lblBuildDate.AutoSize = true;
this.lblBuildDate.Location = new System.Drawing.Point(779, 88);
this.lblBuildDate.Name = "lblBuildDate";
this.lblBuildDate.Size = new System.Drawing.Size(10, 13);
this.lblBuildDate.TabIndex = 106;
this.lblBuildDate.Text = "-";
//
// PreAdjustmentControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Window;
this.Controls.Add(this.lblBuildDate);
this.Controls.Add(this.cb_Metersize);
this.Controls.Add(this.l_SettingsPreparationMetersize);
this.Controls.Add(this.rTB_ZeroFlowCal);
this.Controls.Add(this.l_ZeroFlowCal_SubResttimeDisplayValue);
this.Controls.Add(this.label2);
this.Controls.Add(this.pB_ZeroFlowCal_SubProgress);
this.Controls.Add(this.gB_MeterLog);
this.Controls.Add(this.gB_TempMeters);
this.Controls.Add(this.btn_ZeroFlowCal_Pdf);
this.Controls.Add(this.btn_ZeroFlowCal_Save);
this.Controls.Add(this.btn_ZeroFlowCal_Clear);
this.Controls.Add(this.btn_ZeroFlowCal_Abort);
this.Controls.Add(this.l_ZeroFlowCal_ResttimeDisplayValue);
this.Controls.Add(this.pB_ZeroFlowCal_Progress);
this.Controls.Add(this.btn_ZeroFlowCal_Start);
this.Controls.Add(this.l_ZeroFlowCal_Resttime);
this.Controls.Add(this.btn_ZeroFlowCal_Detect);
this.Controls.Add(this.l_ZeroFlowCal_Status);
this.Controls.Add(this.gB_Progress);
this.Controls.Add(this.pB_Logo1);
this.Controls.Add(this.gB_Meters);
this.Controls.Add(this.pB_Bubbles1);
this.Name = "PreAdjustmentControl";
this.Size = new System.Drawing.Size(970, 674);
this.Load += new System.EventHandler(this.PreAdjustmentControl_Load);
((System.ComponentModel.ISupportInitialize)(this.pB_Logo1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pB_Bubbles1)).EndInit();
this.gB_Progress.ResumeLayout(false);
this.p_ZeroFlowCal_Completion.ResumeLayout(false);
this.p_ZeroFlowCal_Completion.PerformLayout();
this.p_ZeroFlowCal_Offset.ResumeLayout(false);
this.p_ZeroFlowCal_Offset.PerformLayout();
this.p_ZeroFlowCal_Detect.ResumeLayout(false);
this.p_ZeroFlowCal_Detect.PerformLayout();
this.p_ZeroFlowCal_TempCal.ResumeLayout(false);
this.p_ZeroFlowCal_TempCal.PerformLayout();
this.p_ZeroFlowCal_Prepare.ResumeLayout(false);
this.p_ZeroFlowCal_Prepare.PerformLayout();
this.p_ZeroFlowCal_Amplitude.ResumeLayout(false);
this.p_ZeroFlowCal_Amplitude.PerformLayout();
this.gB_TempMeters.ResumeLayout(false);
this.gB_MeterLog.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.PictureBox pB_Logo1;
private System.Windows.Forms.GroupBox gB_Meters;
private System.Windows.Forms.PictureBox pB_Bubbles1;
private System.Windows.Forms.Label l_ZeroFlowCal_Status;
private System.Windows.Forms.GroupBox gB_Progress;
private System.Windows.Forms.Panel p_ZeroFlowCal_Completion;
private System.Windows.Forms.Label l_ZeroFlowCal_Completion;
private System.Windows.Forms.ProgressBar pB_ZeroFlowCal_Progress;
private System.Windows.Forms.Label l_ZeroFlowCal_ResttimeDisplayValue;
private System.Windows.Forms.Panel p_ZeroFlowCal_Offset;
private System.Windows.Forms.Label l_ZeroFlowCal_Offset;
private System.Windows.Forms.Label l_ZeroFlowCal_Resttime;
private System.Windows.Forms.Panel p_ZeroFlowCal_Detect;
private System.Windows.Forms.Label l_ZeroFlowCal_Detect;
private System.Windows.Forms.Panel p_ZeroFlowCal_TempCal;
private System.Windows.Forms.Label l_ZeroFlowCal_TempCal;
private System.Windows.Forms.Panel p_ZeroFlowCal_Prepare;
private System.Windows.Forms.Label l_ZeroFlowCal_Prepare;
private System.Windows.Forms.Panel p_ZeroFlowCal_Amplitude;
private System.Windows.Forms.Label l_ZeroFlowCal_Amplitude;
private System.Windows.Forms.Button btn_ZeroFlowCal_Abort;
private System.Windows.Forms.Button btn_ZeroFlowCal_Start;
private System.Windows.Forms.Button btn_ZeroFlowCal_Pdf;
private System.Windows.Forms.Button btn_ZeroFlowCal_Save;
private System.Windows.Forms.Button btn_ZeroFlowCal_Clear;
private System.Windows.Forms.Button btn_ZeroFlowCal_Detect;
private System.Windows.Forms.GroupBox gB_TempMeters;
private System.Windows.Forms.CheckBox cB_ZeroFlowOffsetTestEnable;
private System.Windows.Forms.CheckBox cB_TempCalEnable;
private System.Windows.Forms.CheckBox cB_AmplitudeTestEnable;
private System.Windows.Forms.Button btn_StoreTempe;
private System.Windows.Forms.GroupBox gB_MeterLog;
private System.Windows.Forms.RichTextBox rTB_ZeroFlowCalMeter;
private System.Windows.Forms.ProgressBar pB_ZeroFlowCal_SubProgress;
private System.Windows.Forms.Label l_ZeroFlowCal_SubResttimeDisplayValue;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btn_ShowAll;
private System.Windows.Forms.RichTextBox rTB_ZeroFlowCal;
private System.Windows.Forms.Label l_SettingsPreparationMetersize;
private System.Windows.Forms.ComboBox cb_Metersize;
private System.Windows.Forms.Label lblBuildDate;
}
}

View File

@ -0,0 +1,553 @@
namespace GenesisCordonelInterface.UI.LaatzenAPI_GenesisToolBox
{
partial class FrmConfigurations
{
/// <summary>
/// <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.lblState = new System.Windows.Forms.Label();
this.btnConnect = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.cbComSlot = new System.Windows.Forms.ComboBox();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.cbPulseWiegth = new System.Windows.Forms.ComboBox();
this.panel1 = new System.Windows.Forms.Panel();
this.rbEvenDistOff = new System.Windows.Forms.RadioButton();
this.rbEvenDistOn = new System.Windows.Forms.RadioButton();
this.lblPrencesInMin = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.lblPulseWeightInternal = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.nudPulseResolution = new System.Windows.Forms.NumericUpDown();
this.cbxPulseMode = new System.Windows.Forms.ComboBox();
this.cbxPulseLength = new System.Windows.Forms.ComboBox();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.nudAdapterPresence = new System.Windows.Forms.NumericUpDown();
this.rbTestModeOff = new System.Windows.Forms.RadioButton();
this.rbTestModeOn = new System.Windows.Forms.RadioButton();
this.lblPulsesequence = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.btnDisplayDefault = new System.Windows.Forms.Button();
this.btnWrite = new System.Windows.Forms.Button();
this.btnRead = new System.Windows.Forms.Button();
this.btnLogout = new System.Windows.Forms.Button();
this.lblPulseWeightMl = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.lblP2000PulseSetup = new System.Windows.Forms.Label();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudPulseResolution)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudAdapterPresence)).BeginInit();
this.SuspendLayout();
//
// lblState
//
this.lblState.AutoSize = true;
this.lblState.Location = new System.Drawing.Point(12, 51);
this.lblState.Name = "lblState";
this.lblState.Size = new System.Drawing.Size(78, 13);
this.lblState.TabIndex = 9;
this.lblState.Text = "Not connected";
//
// btnConnect
//
this.btnConnect.Location = new System.Drawing.Point(212, 8);
this.btnConnect.Name = "btnConnect";
this.btnConnect.Size = new System.Drawing.Size(85, 30);
this.btnConnect.TabIndex = 8;
this.btnConnect.Text = "Connect";
this.btnConnect.UseVisualStyleBackColor = true;
this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 21);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(25, 13);
this.label1.TabIndex = 7;
this.label1.Text = "Slot";
//
// cbComSlot
//
this.cbComSlot.FormattingEnabled = true;
this.cbComSlot.Location = new System.Drawing.Point(83, 12);
this.cbComSlot.Name = "cbComSlot";
this.cbComSlot.Size = new System.Drawing.Size(104, 21);
this.cbComSlot.TabIndex = 6;
this.cbComSlot.Text = "1";
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Location = new System.Drawing.Point(6, 92);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(574, 324);
this.tabControl1.TabIndex = 11;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.lblP2000PulseSetup);
this.tabPage1.Controls.Add(this.label12);
this.tabPage1.Controls.Add(this.lblPulseWeightMl);
this.tabPage1.Controls.Add(this.cbPulseWiegth);
this.tabPage1.Controls.Add(this.panel1);
this.tabPage1.Controls.Add(this.lblPrencesInMin);
this.tabPage1.Controls.Add(this.label13);
this.tabPage1.Controls.Add(this.label14);
this.tabPage1.Controls.Add(this.lblPulseWeightInternal);
this.tabPage1.Controls.Add(this.label11);
this.tabPage1.Controls.Add(this.label10);
this.tabPage1.Controls.Add(this.nudPulseResolution);
this.tabPage1.Controls.Add(this.cbxPulseMode);
this.tabPage1.Controls.Add(this.cbxPulseLength);
this.tabPage1.Controls.Add(this.label8);
this.tabPage1.Controls.Add(this.label9);
this.tabPage1.Controls.Add(this.nudAdapterPresence);
this.tabPage1.Controls.Add(this.rbTestModeOff);
this.tabPage1.Controls.Add(this.rbTestModeOn);
this.tabPage1.Controls.Add(this.lblPulsesequence);
this.tabPage1.Controls.Add(this.label7);
this.tabPage1.Controls.Add(this.label6);
this.tabPage1.Controls.Add(this.label5);
this.tabPage1.Controls.Add(this.label4);
this.tabPage1.Controls.Add(this.label3);
this.tabPage1.Controls.Add(this.label2);
this.tabPage1.Controls.Add(this.btnDisplayDefault);
this.tabPage1.Controls.Add(this.btnWrite);
this.tabPage1.Controls.Add(this.btnRead);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(566, 298);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Pluse";
this.tabPage1.UseVisualStyleBackColor = true;
this.tabPage1.Click += new System.EventHandler(this.tabPage1_Click);
//
// cbPulseWiegth
//
this.cbPulseWiegth.FormattingEnabled = true;
this.cbPulseWiegth.Items.AddRange(new object[] {
" 1 l/Imp.",
"10 l/Imp.",
"100 l/Imp.",
"1.000 l/Imp.",
"1 Gallons/Imp.",
"10 Gallons/Imp.",
"100 Gallons/Imp.",
"1.000 Gallons/Imp.",
"1 Cub. Feet/Imp.",
"10 Cub. Feet/Imp.",
"100 Cub. Feet/Imp.",
"1.000 Cub. Feet/Imp.",
"1 Barrel/Imp.",
"10 Barrels/Imp.",
"100 Barrels/Imp.",
"1.000 Barrels/Imp.",
"ohne"});
this.cbPulseWiegth.Location = new System.Drawing.Point(237, 180);
this.cbPulseWiegth.Name = "cbPulseWiegth";
this.cbPulseWiegth.Size = new System.Drawing.Size(111, 21);
this.cbPulseWiegth.TabIndex = 37;
this.cbPulseWiegth.SelectedIndexChanged += new System.EventHandler(this.cbPulseWiegth_SelectedIndexChanged);
//
// panel1
//
this.panel1.Controls.Add(this.rbEvenDistOff);
this.panel1.Controls.Add(this.rbEvenDistOn);
this.panel1.Location = new System.Drawing.Point(237, 74);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(124, 21);
this.panel1.TabIndex = 36;
//
// rbEvenDistOff
//
this.rbEvenDistOff.AutoSize = true;
this.rbEvenDistOff.Location = new System.Drawing.Point(59, 3);
this.rbEvenDistOff.Name = "rbEvenDistOff";
this.rbEvenDistOff.Size = new System.Drawing.Size(39, 17);
this.rbEvenDistOff.TabIndex = 27;
this.rbEvenDistOff.TabStop = true;
this.rbEvenDistOff.Text = "Off";
this.rbEvenDistOff.UseVisualStyleBackColor = true;
//
// rbEvenDistOn
//
this.rbEvenDistOn.AutoSize = true;
this.rbEvenDistOn.Location = new System.Drawing.Point(3, 3);
this.rbEvenDistOn.Name = "rbEvenDistOn";
this.rbEvenDistOn.Size = new System.Drawing.Size(39, 17);
this.rbEvenDistOn.TabIndex = 26;
this.rbEvenDistOn.TabStop = true;
this.rbEvenDistOn.Text = "On";
this.rbEvenDistOn.UseVisualStyleBackColor = true;
//
// lblPrencesInMin
//
this.lblPrencesInMin.AutoSize = true;
this.lblPrencesInMin.Location = new System.Drawing.Point(401, 34);
this.lblPrencesInMin.Name = "lblPrencesInMin";
this.lblPrencesInMin.Size = new System.Drawing.Size(13, 13);
this.lblPrencesInMin.TabIndex = 35;
this.lblPrencesInMin.Text = "0";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(485, 34);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(54, 13);
this.label13.TabIndex = 34;
this.label13.Text = "in minutes";
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(354, 34);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(41, 13);
this.label14.TabIndex = 33;
this.label14.Text = "internal";
//
// lblPulseWeightInternal
//
this.lblPulseWeightInternal.AutoSize = true;
this.lblPulseWeightInternal.Location = new System.Drawing.Point(467, 206);
this.lblPulseWeightInternal.Name = "lblPulseWeightInternal";
this.lblPulseWeightInternal.Size = new System.Drawing.Size(13, 13);
this.lblPulseWeightInternal.TabIndex = 32;
this.lblPulseWeightInternal.Text = "0";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(467, 183);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(72, 13);
this.label11.TabIndex = 31;
this.label11.Text = "in internal unit";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(354, 183);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(28, 13);
this.label10.TabIndex = 30;
this.label10.Text = "in ml";
//
// nudPulseResolution
//
this.nudPulseResolution.Location = new System.Drawing.Point(237, 152);
this.nudPulseResolution.Maximum = new decimal(new int[] {
7,
0,
0,
0});
this.nudPulseResolution.Name = "nudPulseResolution";
this.nudPulseResolution.Size = new System.Drawing.Size(111, 20);
this.nudPulseResolution.TabIndex = 28;
this.nudPulseResolution.Value = new decimal(new int[] {
7,
0,
0,
0});
//
// cbxPulseMode
//
this.cbxPulseMode.FormattingEnabled = true;
this.cbxPulseMode.Location = new System.Drawing.Point(237, 127);
this.cbxPulseMode.Name = "cbxPulseMode";
this.cbxPulseMode.Size = new System.Drawing.Size(111, 21);
this.cbxPulseMode.TabIndex = 27;
//
// cbxPulseLength
//
this.cbxPulseLength.FormattingEnabled = true;
this.cbxPulseLength.Location = new System.Drawing.Point(237, 103);
this.cbxPulseLength.Name = "cbxPulseLength";
this.cbxPulseLength.Size = new System.Drawing.Size(111, 21);
this.cbxPulseLength.TabIndex = 26;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(6, 178);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(169, 13);
this.label8.TabIndex = 23;
this.label8.Text = "METROLOGYASST_PulseWeight";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(6, 154);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(185, 13);
this.label9.TabIndex = 22;
this.label9.Text = "METROLOGYASST_PulseResolution";
//
// nudAdapterPresence
//
this.nudAdapterPresence.Location = new System.Drawing.Point(237, 27);
this.nudAdapterPresence.Name = "nudAdapterPresence";
this.nudAdapterPresence.Size = new System.Drawing.Size(111, 20);
this.nudAdapterPresence.TabIndex = 21;
this.nudAdapterPresence.ValueChanged += new System.EventHandler(this.nudAdapterPresence_ValueChanged);
//
// rbTestModeOff
//
this.rbTestModeOff.AutoSize = true;
this.rbTestModeOff.Location = new System.Drawing.Point(293, 8);
this.rbTestModeOff.Name = "rbTestModeOff";
this.rbTestModeOff.Size = new System.Drawing.Size(39, 17);
this.rbTestModeOff.TabIndex = 18;
this.rbTestModeOff.TabStop = true;
this.rbTestModeOff.Text = "Off";
this.rbTestModeOff.UseVisualStyleBackColor = true;
//
// rbTestModeOn
//
this.rbTestModeOn.AutoSize = true;
this.rbTestModeOn.Location = new System.Drawing.Point(237, 8);
this.rbTestModeOn.Name = "rbTestModeOn";
this.rbTestModeOn.Size = new System.Drawing.Size(39, 17);
this.rbTestModeOn.TabIndex = 17;
this.rbTestModeOn.TabStop = true;
this.rbTestModeOn.Text = "On";
this.rbTestModeOn.UseVisualStyleBackColor = true;
//
// lblPulsesequence
//
this.lblPulsesequence.AutoSize = true;
this.lblPulsesequence.Location = new System.Drawing.Point(234, 58);
this.lblPulsesequence.Name = "lblPulsesequence";
this.lblPulsesequence.Size = new System.Drawing.Size(13, 13);
this.lblPulsesequence.TabIndex = 16;
this.lblPulsesequence.Text = "0";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(5, 10);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(55, 13);
this.label7.TabIndex = 15;
this.label7.Text = "TestMode";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(6, 130);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(162, 13);
this.label6.TabIndex = 14;
this.label6.Text = "METROLOGYASST_PulseMode";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(6, 106);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(168, 13);
this.label5.TabIndex = 13;
this.label5.Text = "METROLOGYASST_PulseLength";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(6, 82);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(212, 13);
this.label4.TabIndex = 12;
this.label4.Text = "METROLOGYASST_PulseEvenDistribution";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(5, 58);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(114, 13);
this.label3.TabIndex = 11;
this.label3.Text = "IRDA_PulseSequence";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(5, 34);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(142, 13);
this.label2.TabIndex = 10;
this.label2.Text = "IRDA_AdapterPresenceLimit";
//
// btnDisplayDefault
//
this.btnDisplayDefault.Location = new System.Drawing.Point(282, 239);
this.btnDisplayDefault.Name = "btnDisplayDefault";
this.btnDisplayDefault.Size = new System.Drawing.Size(113, 53);
this.btnDisplayDefault.TabIndex = 8;
this.btnDisplayDefault.Text = "Set DisplayDefault";
this.btnDisplayDefault.UseVisualStyleBackColor = true;
this.btnDisplayDefault.Click += new System.EventHandler(this.btnDisplayDefault_Click);
//
// btnWrite
//
this.btnWrite.Location = new System.Drawing.Point(147, 239);
this.btnWrite.Name = "btnWrite";
this.btnWrite.Size = new System.Drawing.Size(129, 53);
this.btnWrite.TabIndex = 1;
this.btnWrite.Text = "Write";
this.btnWrite.UseVisualStyleBackColor = true;
this.btnWrite.Click += new System.EventHandler(this.btnWrite_Click);
//
// btnRead
//
this.btnRead.Location = new System.Drawing.Point(3, 239);
this.btnRead.Name = "btnRead";
this.btnRead.Size = new System.Drawing.Size(129, 53);
this.btnRead.TabIndex = 0;
this.btnRead.Text = "Read";
this.btnRead.UseVisualStyleBackColor = true;
this.btnRead.Click += new System.EventHandler(this.btnRead_Click);
//
// btnLogout
//
this.btnLogout.Location = new System.Drawing.Point(303, 8);
this.btnLogout.Name = "btnLogout";
this.btnLogout.Size = new System.Drawing.Size(85, 30);
this.btnLogout.TabIndex = 12;
this.btnLogout.Text = "Logout";
this.btnLogout.UseVisualStyleBackColor = true;
this.btnLogout.Click += new System.EventHandler(this.btnLogout_Click);
//
// lblPulseWeightMl
//
this.lblPulseWeightMl.AutoSize = true;
this.lblPulseWeightMl.Location = new System.Drawing.Point(354, 206);
this.lblPulseWeightMl.Name = "lblPulseWeightMl";
this.lblPulseWeightMl.Size = new System.Drawing.Size(13, 13);
this.lblPulseWeightMl.TabIndex = 38;
this.lblPulseWeightMl.Text = "0";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(466, 223);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(94, 13);
this.label12.TabIndex = 39;
this.label12.Text = "p2000 PulseSetup";
//
// lblP2000PulseSetup
//
this.lblP2000PulseSetup.AutoSize = true;
this.lblP2000PulseSetup.Location = new System.Drawing.Point(467, 249);
this.lblP2000PulseSetup.Name = "lblP2000PulseSetup";
this.lblP2000PulseSetup.Size = new System.Drawing.Size(13, 13);
this.lblP2000PulseSetup.TabIndex = 40;
this.lblP2000PulseSetup.Text = "0";
//
// FrmConfigurations
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(587, 450);
this.Controls.Add(this.btnLogout);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.lblState);
this.Controls.Add(this.btnConnect);
this.Controls.Add(this.label1);
this.Controls.Add(this.cbComSlot);
this.Name = "FrmConfigurations";
this.Text = "FrmConfigurations";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmConfigurations_FormClosing);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudPulseResolution)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudAdapterPresence)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblState;
private System.Windows.Forms.Button btnConnect;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cbComSlot;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.Button btnLogout;
private System.Windows.Forms.Button btnWrite;
private System.Windows.Forms.Button btnRead;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnDisplayDefault;
private System.Windows.Forms.Label lblPulsesequence;
private System.Windows.Forms.RadioButton rbTestModeOff;
private System.Windows.Forms.RadioButton rbTestModeOn;
private System.Windows.Forms.NumericUpDown nudAdapterPresence;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.NumericUpDown nudPulseResolution;
private System.Windows.Forms.ComboBox cbxPulseMode;
private System.Windows.Forms.ComboBox cbxPulseLength;
private System.Windows.Forms.Label lblPulseWeightInternal;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label lblPrencesInMin;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.RadioButton rbEvenDistOff;
private System.Windows.Forms.RadioButton rbEvenDistOn;
private System.Windows.Forms.ComboBox cbPulseWiegth;
private System.Windows.Forms.Label lblPulseWeightMl;
private System.Windows.Forms.Label lblP2000PulseSetup;
private System.Windows.Forms.Label label12;
}
}

View File

@ -0,0 +1,405 @@
using GenesisCordonelInterface.API;
using Newtonsoft.Json;
using NLog;
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using Xylem.Common.CommonCore.Consts;
using Xylem.Common.Hardware.Interfaces.Ports.PortCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
using Xylem.Common.Utils.Logging;
namespace GenesisCordonelInterface.UI.LaatzenAPI_GenesisToolBox
{
public enum METROLOGYASST_PulseMode
{
OFF = 0, /* No pulse output */
FOR_REV_AB, /* Forward/reverse on A/B */
FOR_REV_BA, /* Forward/reverse on B/A */
PUL_DIR_AB, /* Pulse/direction on A/B */
PUL_DIR_BA, /* Pulse/direction on B/A */
PUL_BAL_A, /* Balanced pulse on A? */
PUL_BAL_B, /* Balanced pulse on B? */
TEST_PUL_DIR_AB, /* Test mode, pulse/direction on A/B */
};
public enum METROLOGYASST_PulseLength
{
L_1MS_NotSupported = 0, /* 1ms pulse <- not supported */
L_2MS_NotSupported, /* 2ms pulse <- not supported */
L_5MS, /* 5ms pulse */
L_10MS, /* 10ms pulse */
L_20MS, /* 20ms pulse */
L_50MS, /* 50ms pulse */
L_100MS_NotSupported, /* 100ms pulse <- not supported */
L_200MS, /* 200ms pulse */
L_500MS, /* 500ms pulse */
L_DYNAMIC, /* Dynamic pulse width */
L_1_5MS, /* 1.5ms pulse */
};
public partial class FrmConfigurations : Form
{
private static readonly NLog.ILogger Logger = NLog.LogManager.GetLogger("GenesisCordonelInterface");
private readonly InterfaceGCIToLaatzen interfaceToLaatzen = new InterfaceGCIToLaatzen();
private GenesisMeter _currentGenesis;
private String _currentPcbId;
private MeterBatch _meterBatch = new MeterBatch();
public FrmConfigurations()
{
InitializeComponent();
cbxPulseLength.DataSource = Enum.GetValues(typeof(METROLOGYASST_PulseLength));
cbxPulseMode.DataSource = Enum.GetValues(typeof(METROLOGYASST_PulseMode));
_meterBatch = new MeterBatch();
var configfile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), nameof(Xylem.Common.Hardware.WaterMeter.Genesis), ProgramConfig.SerialConfigFileName);
if (!File.Exists(configfile))
{
throw new ApplicationException($"Configuration file {configfile} not found ");
}
var tr = new StreamReader(configfile);
var meterConfigList = JsonConvert.DeserializeObject<SlotConfig[]>(tr.ReadToEnd());
cbComSlot.Items.Clear();
var listSlots = new List<Int32>();
foreach (var item in meterConfigList)
{
cbComSlot.Items.Add(item.Slot);
listSlots.Add(item.Slot);
}
if (cbComSlot.Items.Count >= 1)
{
cbComSlot.SelectedItem = cbComSlot.Items[0];
}
//foreach (var info in typeof(Register).GetNestedTypes())
//{
// cbPreselection.Items.Add(info.Name);
//}
}
private void btnLogout_Click(Object sender, EventArgs e)
{
if (_currentGenesis != null && _currentGenesis.IsLoggedOn)
{
_currentGenesis.Logout();
}
_currentPcbId = "";
}
private void btnConnect_Click(Object sender, EventArgs e)
{
if (cbComSlot.SelectedItem != null) // && cbComSlot.SelectedValue is ListBoxItem)
{
Int32 slotNR = 0;
if (!string.IsNullOrEmpty(cbComSlot.SelectedItem.ToString()) &&
int.TryParse(cbComSlot.SelectedItem.ToString(), out slotNR))
{
conntect(slotNR);
}
}
}
private void btnRead_Click(Object sender, EventArgs e)
{
if (_currentGenesis != null && _currentGenesis.IsLoggedOn)
{
Boolean TriggerTest = false;
Boolean PulseEvenDistributio = false;
Byte AdapterPresenceLimit;
Byte PulseSequence;
Int32 PulseLength;
Int32 PulseMode;
Byte PulseResolution = 0;
UInt32 PulseWeight;
TriggerTest = RegisterConverter.ByteArrayToValue<Boolean>(_currentGenesis.ReadRegister("GENESISFLOW_TriggerTest"));
try
{
PulseEvenDistributio = RegisterConverter.ByteArrayToValue<Boolean>(_currentGenesis.ReadRegister("METROLOGYASST_PulseEvenDistribution"));
PulseResolution = RegisterConverter.ByteArrayToValue<Byte>(_currentGenesis.ReadRegister("METROLOGYASST_PulseResolution"));
}
catch (Exception)
{
}
AdapterPresenceLimit = RegisterConverter.ByteArrayToValue<Byte>(_currentGenesis.ReadRegister("IRDA_AdapterPresenceLimit"));
PulseSequence = RegisterConverter.ByteArrayToValue<Byte>(_currentGenesis.ReadRegister("IRDA_PulseSequence"));
PulseLength = RegisterConverter.ByteArrayToValue<Int32>(_currentGenesis.ReadRegister("METROLOGYASST_PulseLength"));
PulseMode = RegisterConverter.ByteArrayToValue<Int32>(_currentGenesis.ReadRegister("METROLOGYASST_PulseMode"));
PulseWeight = RegisterConverter.ByteArrayToValue<UInt32>(_currentGenesis.ReadRegister("METROLOGYASST_PulseWeight"));
rbTestModeOn.Checked = false;
rbTestModeOff.Checked = true;
if (TriggerTest)
{
rbTestModeOff.Checked = false;
rbTestModeOn.Checked = true;
}
rbEvenDistOn.Checked = false;
rbEvenDistOff.Checked = true;
if (PulseEvenDistributio)
{
rbEvenDistOff.Checked = false;
rbEvenDistOn.Checked = true;
}
nudAdapterPresence.Value = AdapterPresenceLimit;
lblPulsesequence.Text = PulseSequence.ToString();
cbxPulseLength.SelectedItem = ((METROLOGYASST_PulseLength)PulseLength);
cbxPulseMode.SelectedItem = ((METROLOGYASST_PulseMode)PulseMode);
nudPulseResolution.Value = PulseResolution;
lblPulseWeightMl.Text = (PulseWeight * (Decimal)0.03125).ToString();
lblPulseWeightInternal.Text = PulseWeight.ToString();
cbPulseWiegth.SelectedText = getText(PulseWeight);
}
}
private void btnWrite_Click(Object sender, EventArgs e)
{
if (_currentGenesis != null && _currentGenesis.IsLoggedOn)
{
Boolean TriggerTest = rbTestModeOn.Checked;
Boolean PulseEvenDistributio = rbEvenDistOn.Checked;
Byte AdapterPresenceLimit = (Byte)nudAdapterPresence.Value;
Int32 PulseLength = ((METROLOGYASST_PulseLength)cbxPulseLength.SelectedItem).GetHashCode();
Int32 PulseMode = ((METROLOGYASST_PulseMode)cbxPulseMode.SelectedItem).GetHashCode();
Byte PulseResolution = (Byte)nudPulseResolution.Value;
UInt32 PulseWeight = getValue(cbPulseWiegth.SelectedText);
actionResult = null;
try
{
setActionResult(_currentGenesis.WriteRegister("METROLOGYASST_PulseEvenDistribution", PulseEvenDistributio));
// setActionResult(_currentGenesis.WriteRegister("METROLOGYASST_PulseResolution", PulseResolution));
}
catch (Exception)
{
}
if (TriggerTest)
{
setActionResult(_currentGenesis.WriteRegister("GENESISFLOW_TriggerTest", 1));
}
else
{
setActionResult(_currentGenesis.WriteRegister("GENESISFLOW_TriggerActive", 1));
}
setActionResult(_currentGenesis.WriteRegister("IRDA_AdapterPresenceLimit", AdapterPresenceLimit));
setActionResult(_currentGenesis.WriteRegister("METROLOGYASST_PulseLength", PulseLength));
setActionResult(_currentGenesis.WriteRegister("METROLOGYASST_PulseMode", PulseMode));
setActionResult(_currentGenesis.WriteRegister("METROLOGYASST_PulseWeight", PulseWeight));
setActionResult(_currentGenesis.StoreAllConfigurations());
setActionResult(_currentGenesis.WriteRegister("SENSUSRADIO_SYSTEMSTATE", 0xFF, true, false));
}
}
private void tabPage1_Click(Object sender, EventArgs e)
{
}
private void conntect(Int32 slotNR)
{
try
{
_meterBatch.RemoveAllMeters();
_currentGenesis = new GenesisMeter();
//_currentGenesis.IsDevelopmentUsage = true; //Make sure to set this before login
try
{
_currentGenesis.SetupFromConfigFile(slotNR);
_currentGenesis.EnableAutoLogon();
_meterBatch.AddMeter(_currentGenesis);
}
catch (Exception ex)
{
Logger.Error(ex, $"Slot #{slotNR} failed: {ex.Message}");
}
_currentGenesis.Login();
_currentPcbId = _currentGenesis.PcbId;
}
catch (Exception ex)
{
Logger.Error(ex, ex.Message);
}
}
private void nudAdapterPresence_ValueChanged(Object sender, EventArgs e)
{
lblPrencesInMin.Text = (nudAdapterPresence.Value * 15).ToString();
}
private void nudPulseWeight_ValueChanged(Object sender, EventArgs e)
{
}
private void btnDisplayDefault_Click(Object sender, EventArgs e)
{
if (_currentGenesis != null && _currentGenesis.IsLoggedOn)
{
actionResult = null;
setActionResult(_currentGenesis.WriteRegister("GENESISFLOW_SealDisplay", 0));
setActionResult(_currentGenesis.WriteRegister("CUSTOMER_Locale", 0));
setActionResult(_currentGenesis.WriteRegister("GENESISFLOW_DisplayPow10", 253));
setActionResult(_currentGenesis.WriteRegister("GENESISFLOW_DisplayUnits", 0));
setActionResult(_currentGenesis.WriteRegister("METROLOGYASST_FlowUnits", 1));
setActionResult(_currentGenesis.StoreAllConfigurations());
setActionResult(_currentGenesis.WriteRegister("SENSUSRADIO_SYSTEMSTATE", 0xFF, true, false));
}
}
private void setActionResult(Boolean v)
{
if (!actionResult.HasValue)
{
actionResult = v;
}
if (!v)
{
actionResult = false;
}
}
private Boolean? actionResult = null;
private void FrmConfigurations_FormClosing(Object sender, FormClosingEventArgs e)
{
_meterBatch.Dispose();
}
private void cbPulseWiegth_SelectedIndexChanged(Object sender, EventArgs e)
{
var PInternal = getValue(cbPulseWiegth.SelectedItem.ToString().Trim());
lblPulseWeightMl.Text = (PInternal * (Decimal)0.03125).ToString();
lblPulseWeightInternal.Text = (PInternal).ToString();
var PulseFQm3 = (PInternal * (Decimal)0.03125);
lblP2000PulseSetup.Text = (1000000 / PulseFQm3).ToString();
}
private String getText(UInt32 v)
{
String intHelper = "NA";
switch (v)
{
case 0x00007D00: intHelper = "1 l/Imp."; break;
case 0x0004E200: intHelper = "10 l/Imp."; break;
case 0x0030D400: intHelper = "100 l/Imp."; break;
case 0x01E84800: intHelper = "1.000 l/Imp."; break;
case 0x0001D92D: intHelper = "1 Gallons/Imp."; break;
case 0x00127BC3: intHelper = "10 Gallons/Imp."; break;
case 0x00B8D5A0: intHelper = "100 Gallons/Imp."; break;
case 0x07382500: intHelper = "1.000 Gallons/Imp."; break;
case 0x000DD399: intHelper = "1 Cub. Feet/Imp."; break;
case 0x008A4400: intHelper = "10 Cub. Feet/Imp."; break;
case 0x0566D000: intHelper = "100 Cub. Feet/Imp."; break;
case 0x36042000: intHelper = "1.000 Cub. Feet/Imp."; break;
case 0x004DA169: intHelper = "1 Barrel/Imp."; break;
case 0x03084E1E: intHelper = "10 Barrels/Imp."; break;
case 0x1E530D2F: intHelper = "100 Barrels/Imp."; break;
case 0xFFF0279D: intHelper = "1.000 Barrels/Imp."; break;
case 0x00000000: intHelper = "ohne"; break;
default: intHelper = "ohne"; break;
}
return intHelper;
}
private UInt32 getValue(String v)
{
UInt32 intHelper = 0;
switch (v.Replace(" ", ""))
{
case "1l/Imp.": intHelper = 0x00007D00; break;
case "10l/Imp.": intHelper = 0x0004E200; break;
case "100l/Imp.": intHelper = 0x0030D400; break;
case "1.000l/Imp.": intHelper = 0x01E84800; break;
case "1Gallons/Imp.": intHelper = 0x0001D92D; break;
case "10Gallons/Imp.": intHelper = 0x00127BC3; break;
case "100Gallons/Imp.": intHelper = 0x00B8D5A0; break;
case "1.000Gallons/Imp.": intHelper = 0x07382500; break;
case "1Cub.Feet/Imp.": intHelper = 0x000DD399; break;
case "10Cub.Feet/Imp.": intHelper = 0x008A4400; break;
case "100Cub.Feet/Imp.": intHelper = 0x0566D000; break;
case "1.000Cub.Feet/Imp.": intHelper = 0x36042000; break;
case "1Barrel/Imp.": intHelper = 0x004DA169; break;
case "10Barrels/Imp.": intHelper = 0x03084E1E; break;
case "100Barrels/Imp.": intHelper = 0x1E530D2F; break;
case "1.000Barrels/Imp.": intHelper = 0xFFF0279D; break;
case "ohne": intHelper = 0; break;
default: intHelper = 0; break;
}
return intHelper;
}
}
}

View File

@ -0,0 +1,410 @@
namespace GenesisCordonelInterface.UI.LaatzenAPI_GenesisToolBox
{
partial class FrmRegisterStore
{
/// <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.components = new System.ComponentModel.Container();
this.cbComSlot = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.btnReadRegister = new System.Windows.Forms.Button();
this.registerGridView = new System.Windows.Forms.DataGridView();
this.btnConnect = new System.Windows.Forms.Button();
this.lblState = new System.Windows.Forms.Label();
this.timProgress = new System.Windows.Forms.Timer(this.components);
this.btnGetPCbID = new System.Windows.Forms.Button();
this.pnlBussy = new System.Windows.Forms.Panel();
this.lblProgress = new System.Windows.Forms.Label();
this.lblAction = new System.Windows.Forms.Label();
this.probarBusy = new System.Windows.Forms.ProgressBar();
this.label3 = new System.Windows.Forms.Label();
this.btnReadFwVersions = new System.Windows.Forms.Button();
this.btnCalibrationRestore = new System.Windows.Forms.Button();
this.btnBatteryIdle = new System.Windows.Forms.Button();
this.btnSetDefaultPulse = new System.Windows.Forms.Button();
this.btnStoreAll = new System.Windows.Forms.Button();
this.btnRegisterToFile = new System.Windows.Forms.Button();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.btnBatLife = new System.Windows.Forms.Button();
this.btnRadioPressure = new System.Windows.Forms.Button();
this.nundCalResultID = new System.Windows.Forms.NumericUpDown();
this.lblGtbVersion = new System.Windows.Forms.Label();
this.lblConfigVersion = new System.Windows.Forms.Label();
this.btnFileToRegister = new System.Windows.Forms.Button();
this.cbxUseOfflinePwds = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.registerGridView)).BeginInit();
this.pnlBussy.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nundCalResultID)).BeginInit();
this.SuspendLayout();
//
// cbComSlot
//
this.cbComSlot.FormattingEnabled = true;
this.cbComSlot.Location = new System.Drawing.Point(44, 91);
this.cbComSlot.Name = "cbComSlot";
this.cbComSlot.Size = new System.Drawing.Size(58, 21);
this.cbComSlot.TabIndex = 0;
this.cbComSlot.Text = "1";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(10, 94);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(28, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Slot:";
this.label1.Click += new System.EventHandler(this.label1_Click);
//
// btnRead
//
this.btnReadRegister.Location = new System.Drawing.Point(251, 123);
this.btnReadRegister.Name = "btnReadRegister";
this.btnReadRegister.Size = new System.Drawing.Size(110, 30);
this.btnReadRegister.TabIndex = 2;
this.btnReadRegister.Text = "Read Meter";
this.btnReadRegister.UseVisualStyleBackColor = true;
this.btnReadRegister.Click += new System.EventHandler(this.btnRead_Click);
//
// registerGridView
//
this.registerGridView.AllowUserToAddRows = false;
this.registerGridView.AllowUserToDeleteRows = false;
this.registerGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.registerGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.registerGridView.Location = new System.Drawing.Point(8, 171);
this.registerGridView.Name = "registerGridView";
this.registerGridView.Size = new System.Drawing.Size(778, 370);
this.registerGridView.TabIndex = 3;
this.registerGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.registerGridView_CellClick);
this.registerGridView.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.registerGridView_CellEndEdit);
//
// btnConnect
//
this.btnConnect.Location = new System.Drawing.Point(125, 87);
this.btnConnect.Name = "btnConnect";
this.btnConnect.Size = new System.Drawing.Size(110, 30);
this.btnConnect.TabIndex = 4;
this.btnConnect.Text = "Connect";
this.btnConnect.UseVisualStyleBackColor = true;
this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
//
// lblState
//
this.lblState.AutoSize = true;
this.lblState.Location = new System.Drawing.Point(12, 132);
this.lblState.Name = "lblState";
this.lblState.Size = new System.Drawing.Size(78, 13);
this.lblState.TabIndex = 5;
this.lblState.Text = "Not connected";
this.lblState.Click += new System.EventHandler(this.lblState_Click);
//
// timProgress
//
this.timProgress.Tick += new System.EventHandler(this.TimeProgress_tick);
//
// btnGetPCbID
//
this.btnGetPCbID.Location = new System.Drawing.Point(399, 16);
this.btnGetPCbID.Name = "btnGetPCbID";
this.btnGetPCbID.Size = new System.Drawing.Size(110, 30);
this.btnGetPCbID.TabIndex = 11;
this.btnGetPCbID.Text = "Get PCB ID";
this.btnGetPCbID.UseVisualStyleBackColor = true;
this.btnGetPCbID.Click += new System.EventHandler(this.btnGetPCbID_Click);
//
// pnlBussy
//
this.pnlBussy.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlBussy.BackColor = System.Drawing.Color.Transparent;
this.pnlBussy.Controls.Add(this.lblProgress);
this.pnlBussy.Controls.Add(this.lblAction);
this.pnlBussy.Controls.Add(this.probarBusy);
this.pnlBussy.Controls.Add(this.label3);
this.pnlBussy.Location = new System.Drawing.Point(8, 171);
this.pnlBussy.Name = "pnlBussy";
this.pnlBussy.Size = new System.Drawing.Size(803, 398);
this.pnlBussy.TabIndex = 51;
this.pnlBussy.Visible = false;
//
// lblProgress
//
this.lblProgress.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblProgress.AutoSize = true;
this.lblProgress.Location = new System.Drawing.Point(240, 334);
this.lblProgress.Name = "lblProgress";
this.lblProgress.Size = new System.Drawing.Size(0, 13);
this.lblProgress.TabIndex = 3;
//
// lblAction
//
this.lblAction.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblAction.AutoSize = true;
this.lblAction.Location = new System.Drawing.Point(240, 312);
this.lblAction.Name = "lblAction";
this.lblAction.Size = new System.Drawing.Size(0, 13);
this.lblAction.TabIndex = 2;
//
// probarBusy
//
this.probarBusy.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.probarBusy.Location = new System.Drawing.Point(12, 286);
this.probarBusy.Name = "probarBusy";
this.probarBusy.Size = new System.Drawing.Size(779, 23);
this.probarBusy.TabIndex = 1;
//
// label3
//
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(240, 270);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(64, 13);
this.label3.TabIndex = 0;
this.label3.Text = "Please wait!";
//
// btnReadFwVersions
//
this.btnReadFwVersions.Location = new System.Drawing.Point(399, 51);
this.btnReadFwVersions.Name = "btnReadFwVersions";
this.btnReadFwVersions.Size = new System.Drawing.Size(110, 30);
this.btnReadFwVersions.TabIndex = 52;
this.btnReadFwVersions.Text = "Read FW Versions";
this.btnReadFwVersions.UseVisualStyleBackColor = true;
this.btnReadFwVersions.Click += new System.EventHandler(this.btnReadFwVersions_Click);
//
// btnCalibrationRestore
//
this.btnCalibrationRestore.Location = new System.Drawing.Point(560, 14);
this.btnCalibrationRestore.Name = "btnCalibrationRestore";
this.btnCalibrationRestore.Size = new System.Drawing.Size(110, 30);
this.btnCalibrationRestore.TabIndex = 58;
this.btnCalibrationRestore.Text = "CalibrationRestore";
this.btnCalibrationRestore.UseVisualStyleBackColor = true;
this.btnCalibrationRestore.Visible = false;
this.btnCalibrationRestore.Click += new System.EventHandler(this.btnCalibrationRestore_Click);
//
// btnBatteryIdle
//
this.btnBatteryIdle.Location = new System.Drawing.Point(399, 87);
this.btnBatteryIdle.Name = "btnBatteryIdle";
this.btnBatteryIdle.Size = new System.Drawing.Size(110, 30);
this.btnBatteryIdle.TabIndex = 60;
this.btnBatteryIdle.Text = "Battery Idle";
this.btnBatteryIdle.UseVisualStyleBackColor = true;
this.btnBatteryIdle.Visible = false;
this.btnBatteryIdle.Click += new System.EventHandler(this.btnBatteryIdle_Click);
//
// btnSetDefaultPulse
//
this.btnSetDefaultPulse.Location = new System.Drawing.Point(560, 85);
this.btnSetDefaultPulse.Name = "btnSetDefaultPulse";
this.btnSetDefaultPulse.Size = new System.Drawing.Size(110, 30);
this.btnSetDefaultPulse.TabIndex = 61;
this.btnSetDefaultPulse.Text = "Set default Pulse";
this.btnSetDefaultPulse.UseVisualStyleBackColor = true;
this.btnSetDefaultPulse.Click += new System.EventHandler(this.btnSetDefaultPulse_Click);
//
// btnStoreAll
//
this.btnStoreAll.Location = new System.Drawing.Point(251, 16);
this.btnStoreAll.Name = "btnStoreAll";
this.btnStoreAll.Size = new System.Drawing.Size(110, 28);
this.btnStoreAll.TabIndex = 62;
this.btnStoreAll.Text = "Store All";
this.btnStoreAll.UseVisualStyleBackColor = true;
this.btnStoreAll.Click += new System.EventHandler(this.btnStoreAll_Click);
//
// btnRegisterToFile
//
this.btnRegisterToFile.Location = new System.Drawing.Point(251, 50);
this.btnRegisterToFile.Name = "btnRegisterToFile";
this.btnRegisterToFile.Size = new System.Drawing.Size(110, 30);
this.btnRegisterToFile.TabIndex = 63;
this.btnRegisterToFile.Text = "RegisterToFile";
this.btnRegisterToFile.UseVisualStyleBackColor = true;
this.btnRegisterToFile.Click += new System.EventHandler(this.btnRegisterToFile_Click);
//
// timer1
//
this.timer1.Interval = 5000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// btnBatLife
//
this.btnBatLife.Location = new System.Drawing.Point(399, 123);
this.btnBatLife.Name = "btnBatLife";
this.btnBatLife.Size = new System.Drawing.Size(110, 30);
this.btnBatLife.TabIndex = 71;
this.btnBatLife.Text = "Lifetime";
this.btnBatLife.UseVisualStyleBackColor = true;
this.btnBatLife.Click += new System.EventHandler(this.btnBatLife_Click);
//
// btnRadioPressure
//
this.btnRadioPressure.Location = new System.Drawing.Point(560, 123);
this.btnRadioPressure.Name = "btnRadioPressure";
this.btnRadioPressure.Size = new System.Drawing.Size(110, 30);
this.btnRadioPressure.TabIndex = 72;
this.btnRadioPressure.Text = "Activate Radio";
this.btnRadioPressure.UseVisualStyleBackColor = true;
this.btnRadioPressure.Click += new System.EventHandler(this.btnRadioPressure_Click);
//
// nundCalResultID
//
this.nundCalResultID.Location = new System.Drawing.Point(562, 58);
this.nundCalResultID.Maximum = new decimal(new int[] {
999999,
0,
0,
0});
this.nundCalResultID.Name = "nundCalResultID";
this.nundCalResultID.Size = new System.Drawing.Size(110, 20);
this.nundCalResultID.TabIndex = 73;
this.nundCalResultID.Visible = false;
//
// lblGtbVersion
//
this.lblGtbVersion.AutoSize = true;
this.lblGtbVersion.Location = new System.Drawing.Point(10, 10);
this.lblGtbVersion.Name = "lblGtbVersion";
this.lblGtbVersion.Size = new System.Drawing.Size(79, 13);
this.lblGtbVersion.TabIndex = 75;
this.lblGtbVersion.Text = "GTB Version: ?";
//
// lblConfigVersion
//
this.lblConfigVersion.AutoSize = true;
this.lblConfigVersion.Location = new System.Drawing.Point(10, 33);
this.lblConfigVersion.Name = "lblConfigVersion";
this.lblConfigVersion.Size = new System.Drawing.Size(119, 13);
this.lblConfigVersion.TabIndex = 76;
this.lblConfigVersion.Text = "Configuration Version: ?";
//
// btnFileToRegister
//
this.btnFileToRegister.Location = new System.Drawing.Point(251, 87);
this.btnFileToRegister.Name = "btnFileToRegister";
this.btnFileToRegister.Size = new System.Drawing.Size(110, 30);
this.btnFileToRegister.TabIndex = 77;
this.btnFileToRegister.Text = "FileToRegister";
this.btnFileToRegister.UseVisualStyleBackColor = true;
this.btnFileToRegister.Click += new System.EventHandler(this.btnFileToRegister_Click);
//
// cbxUseOfflinePwds
//
this.cbxUseOfflinePwds.AutoSize = true;
this.cbxUseOfflinePwds.Location = new System.Drawing.Point(12, 59);
this.cbxUseOfflinePwds.Name = "cbxUseOfflinePwds";
this.cbxUseOfflinePwds.Size = new System.Drawing.Size(132, 17);
this.cbxUseOfflinePwds.TabIndex = 78;
this.cbxUseOfflinePwds.Text = "Use Offline _externPasswords";
this.cbxUseOfflinePwds.UseVisualStyleBackColor = true;
this.cbxUseOfflinePwds.CheckedChanged += new System.EventHandler(this.cbxUseOfflinePwds_CheckedChanged);
//
// FrmRegisterStore
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(803, 553);
this.Controls.Add(this.cbxUseOfflinePwds);
this.Controls.Add(this.btnFileToRegister);
this.Controls.Add(this.lblConfigVersion);
this.Controls.Add(this.lblGtbVersion);
this.Controls.Add(this.nundCalResultID);
this.Controls.Add(this.btnRadioPressure);
this.Controls.Add(this.btnBatLife);
this.Controls.Add(this.btnRegisterToFile);
this.Controls.Add(this.btnStoreAll);
this.Controls.Add(this.btnSetDefaultPulse);
this.Controls.Add(this.btnBatteryIdle);
this.Controls.Add(this.btnCalibrationRestore);
this.Controls.Add(this.btnReadFwVersions);
this.Controls.Add(this.pnlBussy);
this.Controls.Add(this.btnGetPCbID);
this.Controls.Add(this.lblState);
this.Controls.Add(this.btnConnect);
this.Controls.Add(this.registerGridView);
this.Controls.Add(this.btnReadRegister);
this.Controls.Add(this.label1);
this.Controls.Add(this.cbComSlot);
this.Name = "FrmRegisterStore";
this.Text = "frmRegisterStore";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmRegisterStore_FormClosing);
this.Load += new System.EventHandler(this.frmRegisterStore_Load);
((System.ComponentModel.ISupportInitialize)(this.registerGridView)).EndInit();
this.pnlBussy.ResumeLayout(false);
this.pnlBussy.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nundCalResultID)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ComboBox cbComSlot;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnReadRegister;
private System.Windows.Forms.DataGridView registerGridView;
private System.Windows.Forms.Button btnConnect;
private System.Windows.Forms.Label lblState;
private System.Windows.Forms.Timer timProgress;
private System.Windows.Forms.Button btnGetPCbID;
private System.Windows.Forms.Panel pnlBussy;
private System.Windows.Forms.Label lblProgress;
private System.Windows.Forms.Label lblAction;
private System.Windows.Forms.ProgressBar probarBusy;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button btnReadFwVersions;
private System.Windows.Forms.Button btnCalibrationRestore;
private System.Windows.Forms.Button btnBatteryIdle;
private System.Windows.Forms.Button btnSetDefaultPulse;
private System.Windows.Forms.Button btnStoreAll;
private System.Windows.Forms.Button btnRegisterToFile;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Button btnBatLife;
private System.Windows.Forms.Button btnRadioPressure;
private System.Windows.Forms.NumericUpDown nundCalResultID;
private System.Windows.Forms.Label lblGtbVersion;
private System.Windows.Forms.Label lblConfigVersion;
private System.Windows.Forms.Button btnFileToRegister;
private System.Windows.Forms.CheckBox cbxUseOfflinePwds;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,705 @@
namespace GenesisCordonelInterface.UI.LaatzenAPI_GenesisToolBox
{
partial class FrmSetup
{
/// <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.components = new System.ComponentModel.Container();
this.btnReload = new System.Windows.Forms.Button();
this.btnStore = new System.Windows.Forms.Button();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.btnAddRow = new System.Windows.Forms.Button();
this.dgvConfig = new System.Windows.Forms.DataGridView();
this.tbcSlot = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.cbcRequestPort = new System.Windows.Forms.DataGridViewComboBoxColumn();
this.cbcRequestType = new System.Windows.Forms.DataGridViewComboBoxColumn();
this.cbcStreamingPort = new System.Windows.Forms.DataGridViewComboBoxColumn();
this.cbcSlotType = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.btcDetectRequest = new System.Windows.Forms.DataGridViewButtonColumn();
this.btcDetectStreaming = new System.Windows.Forms.DataGridViewButtonColumn();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.cbxProductionMode = new System.Windows.Forms.CheckBox();
this.cbUpdateFiles = new System.Windows.Forms.CheckBox();
this.cbUseMinMaxCheck = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.txtWachSeriveUrl = new System.Windows.Forms.TextBox();
this.cbUseRegisterWatch = new System.Windows.Forms.CheckBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.cmdAddOffline = new System.Windows.Forms.Button();
this.dgvofflinePw = new System.Windows.Forms.DataGridView();
this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.offlinePaswordItemBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.tabPage4 = new System.Windows.Forms.TabPage();
this.lblGlobalCurrentPath = new System.Windows.Forms.Label();
this.btnGlobalSearch = new System.Windows.Forms.Button();
this.btnGlobalDefaultLan = new System.Windows.Forms.Button();
this.btnGlobalDefaultLocal = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
this.lblLocalCurrentPath = new System.Windows.Forms.Label();
this.btnLocalSearch = new System.Windows.Forms.Button();
this.btnLocalDefaultLan = new System.Windows.Forms.Button();
this.btnLocalDefaultLocal = new System.Windows.Forms.Button();
this.lblLocalPath = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.cbxSirtService868MHz = new System.Windows.Forms.ComboBox();
this.cbxSirtService433MHz = new System.Windows.Forms.ComboBox();
this.label5 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.cbxSirtComport868MHz = new System.Windows.Forms.ComboBox();
this.cbxSirtComport433MHz = new System.Windows.Forms.ComboBox();
this.tbxSirtBoxNo = new System.Windows.Forms.TextBox();
this.tbxSirtStationId = new System.Windows.Forms.TextBox();
this.lblSirtComport868MHz = new System.Windows.Forms.Label();
this.lblSirtComport433MHz = new System.Windows.Forms.Label();
this.lblSirtBoxNo = new System.Windows.Forms.Label();
this.lblSirtStation = new System.Windows.Forms.Label();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvConfig)).BeginInit();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvofflinePw)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.offlinePaswordItemBindingSource)).BeginInit();
this.tabPage4.SuspendLayout();
this.tabPage5.SuspendLayout();
this.SuspendLayout();
//
// btnReload
//
this.btnReload.Location = new System.Drawing.Point(12, 12);
this.btnReload.Name = "btnReload";
this.btnReload.Size = new System.Drawing.Size(140, 43);
this.btnReload.TabIndex = 1;
this.btnReload.Text = "Reload Setup";
this.btnReload.UseVisualStyleBackColor = true;
this.btnReload.Click += new System.EventHandler(this.BtnReload_Click);
//
// btnStore
//
this.btnStore.Location = new System.Drawing.Point(158, 12);
this.btnStore.Name = "btnStore";
this.btnStore.Size = new System.Drawing.Size(140, 43);
this.btnStore.TabIndex = 2;
this.btnStore.Text = "Save Setup";
this.btnStore.UseVisualStyleBackColor = true;
this.btnStore.Click += new System.EventHandler(this.BtnStore_Click);
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage4);
this.tabControl1.Controls.Add(this.tabPage5);
this.tabControl1.Location = new System.Drawing.Point(12, 74);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(768, 387);
this.tabControl1.TabIndex = 17;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.btnAddRow);
this.tabPage1.Controls.Add(this.dgvConfig);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(760, 361);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Slots";
this.tabPage1.UseVisualStyleBackColor = true;
//
// btnAddRow
//
this.btnAddRow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnAddRow.Location = new System.Drawing.Point(6, 255);
this.btnAddRow.Name = "btnAddRow";
this.btnAddRow.Size = new System.Drawing.Size(199, 29);
this.btnAddRow.TabIndex = 5;
this.btnAddRow.Text = "Add Slot";
this.btnAddRow.UseVisualStyleBackColor = true;
this.btnAddRow.Click += new System.EventHandler(this.btnAddRow_Click);
//
// dgvConfig
//
this.dgvConfig.AllowUserToAddRows = false;
this.dgvConfig.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvConfig.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvConfig.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.tbcSlot,
this.cbcRequestPort,
this.cbcRequestType,
this.cbcStreamingPort,
this.cbcSlotType,
this.btcDetectRequest,
this.btcDetectStreaming});
this.dgvConfig.Location = new System.Drawing.Point(6, 6);
this.dgvConfig.Name = "dgvConfig";
this.dgvConfig.Size = new System.Drawing.Size(746, 243);
this.dgvConfig.TabIndex = 4;
this.dgvConfig.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgvConfig_CellContentClick);
this.dgvConfig.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.dgvConfig_DataError);
//
// tbcSlot
//
this.tbcSlot.HeaderText = "tbcSlot";
this.tbcSlot.Name = "tbcSlot";
//
// cbcRequestPort
//
this.cbcRequestPort.HeaderText = "cbcRequestPort";
this.cbcRequestPort.Name = "cbcRequestPort";
//
// cbcRequestType
//
this.cbcRequestType.HeaderText = "cbcRequestType";
this.cbcRequestType.Name = "cbcRequestType";
//
// cbcStreamingPort
//
this.cbcStreamingPort.HeaderText = "cbcStreamingPort";
this.cbcStreamingPort.Name = "cbcStreamingPort";
//
// cbcSlotType
//
this.cbcSlotType.HeaderText = "TempretureMeter";
this.cbcSlotType.Name = "cbcSlotType";
this.cbcSlotType.Resizable = System.Windows.Forms.DataGridViewTriState.True;
//
// btcDetectRequest
//
this.btcDetectRequest.HeaderText = "btcDetectRequest";
this.btcDetectRequest.Name = "btcDetectRequest";
//
// btcDetectStreaming
//
this.btcDetectStreaming.HeaderText = "btcDetectStreaming";
this.btcDetectStreaming.Name = "btcDetectStreaming";
//
// tabPage2
//
this.tabPage2.Controls.Add(this.cbxProductionMode);
this.tabPage2.Controls.Add(this.cbUpdateFiles);
this.tabPage2.Controls.Add(this.cbUseMinMaxCheck);
this.tabPage2.Controls.Add(this.label1);
this.tabPage2.Controls.Add(this.txtWachSeriveUrl);
this.tabPage2.Controls.Add(this.cbUseRegisterWatch);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(760, 361);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "General";
this.tabPage2.UseVisualStyleBackColor = true;
//
// cbxProductionMode
//
this.cbxProductionMode.AutoSize = true;
this.cbxProductionMode.Location = new System.Drawing.Point(25, 19);
this.cbxProductionMode.Name = "cbxProductionMode";
this.cbxProductionMode.Size = new System.Drawing.Size(104, 17);
this.cbxProductionMode.TabIndex = 22;
this.cbxProductionMode.Text = "ProductionMode";
this.cbxProductionMode.UseVisualStyleBackColor = true;
//
// cbUpdateFiles
//
this.cbUpdateFiles.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cbUpdateFiles.AutoSize = true;
this.cbUpdateFiles.Location = new System.Drawing.Point(25, 42);
this.cbUpdateFiles.Name = "cbUpdateFiles";
this.cbUpdateFiles.Size = new System.Drawing.Size(199, 17);
this.cbUpdateFiles.TabIndex = 21;
this.cbUpdateFiles.Text = "Auto Update files (configuration.json)";
this.cbUpdateFiles.UseVisualStyleBackColor = true;
this.cbUpdateFiles.CheckedChanged += new System.EventHandler(this.cbUpdateFiles_CheckedChanged);
//
// cbUseMinMaxCheck
//
this.cbUseMinMaxCheck.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cbUseMinMaxCheck.AutoSize = true;
this.cbUseMinMaxCheck.Location = new System.Drawing.Point(25, 88);
this.cbUseMinMaxCheck.Name = "cbUseMinMaxCheck";
this.cbUseMinMaxCheck.Size = new System.Drawing.Size(113, 17);
this.cbUseMinMaxCheck.TabIndex = 20;
this.cbUseMinMaxCheck.Text = "UseMinMaxCheck";
this.cbUseMinMaxCheck.UseVisualStyleBackColor = true;
this.cbUseMinMaxCheck.CheckedChanged += new System.EventHandler(this.cbUseMinMaxCheck_CheckedChanged);
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(147, 65);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(136, 13);
this.label1.TabIndex = 19;
this.label1.Text = "RegisterWatchServiceURL";
//
// txtWachSeriveUrl
//
this.txtWachSeriveUrl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtWachSeriveUrl.Location = new System.Drawing.Point(288, 60);
this.txtWachSeriveUrl.Name = "txtWachSeriveUrl";
this.txtWachSeriveUrl.Size = new System.Drawing.Size(439, 20);
this.txtWachSeriveUrl.TabIndex = 18;
this.txtWachSeriveUrl.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// cbUseRegisterWatch
//
this.cbUseRegisterWatch.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cbUseRegisterWatch.AutoSize = true;
this.cbUseRegisterWatch.Location = new System.Drawing.Point(25, 65);
this.cbUseRegisterWatch.Name = "cbUseRegisterWatch";
this.cbUseRegisterWatch.Size = new System.Drawing.Size(116, 17);
this.cbUseRegisterWatch.TabIndex = 17;
this.cbUseRegisterWatch.Text = "UseRegisterWatch";
this.cbUseRegisterWatch.UseVisualStyleBackColor = true;
this.cbUseRegisterWatch.CheckedChanged += new System.EventHandler(this.cbUseRegisterWatch_CheckedChanged);
//
// tabPage3
//
this.tabPage3.Controls.Add(this.cmdAddOffline);
this.tabPage3.Controls.Add(this.dgvofflinePw);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(760, 361);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "OfflinePasswords";
this.tabPage3.UseVisualStyleBackColor = true;
//
// cmdAddOffline
//
this.cmdAddOffline.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cmdAddOffline.Location = new System.Drawing.Point(3, 195);
this.cmdAddOffline.Name = "cmdAddOffline";
this.cmdAddOffline.Size = new System.Drawing.Size(257, 43);
this.cmdAddOffline.TabIndex = 17;
this.cmdAddOffline.Text = "Add Item";
this.cmdAddOffline.UseVisualStyleBackColor = true;
this.cmdAddOffline.Click += new System.EventHandler(this.cmdAddOffline_Click);
//
// dgvofflinePw
//
this.dgvofflinePw.AutoGenerateColumns = false;
this.dgvofflinePw.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvofflinePw.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dataGridViewTextBoxColumn1,
this.dataGridViewTextBoxColumn2});
this.dgvofflinePw.DataSource = this.offlinePaswordItemBindingSource;
this.dgvofflinePw.Location = new System.Drawing.Point(3, 19);
this.dgvofflinePw.Name = "dgvofflinePw";
this.dgvofflinePw.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvofflinePw.Size = new System.Drawing.Size(345, 170);
this.dgvofflinePw.TabIndex = 16;
//
// dataGridViewTextBoxColumn1
//
this.dataGridViewTextBoxColumn1.DataPropertyName = "PcbID";
this.dataGridViewTextBoxColumn1.HeaderText = "PcbID";
this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
//
// dataGridViewTextBoxColumn2
//
this.dataGridViewTextBoxColumn2.DataPropertyName = "Password";
this.dataGridViewTextBoxColumn2.HeaderText = "Password";
this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
//
// offlinePaswordItemBindingSource
//
this.offlinePaswordItemBindingSource.DataSource = typeof(OfflinePasswordItem);
//
// tabPage4
//
this.tabPage4.Controls.Add(this.lblGlobalCurrentPath);
this.tabPage4.Controls.Add(this.btnGlobalSearch);
this.tabPage4.Controls.Add(this.btnGlobalDefaultLan);
this.tabPage4.Controls.Add(this.btnGlobalDefaultLocal);
this.tabPage4.Controls.Add(this.label6);
this.tabPage4.Controls.Add(this.lblLocalCurrentPath);
this.tabPage4.Controls.Add(this.btnLocalSearch);
this.tabPage4.Controls.Add(this.btnLocalDefaultLan);
this.tabPage4.Controls.Add(this.btnLocalDefaultLocal);
this.tabPage4.Controls.Add(this.lblLocalPath);
this.tabPage4.Controls.Add(this.label4);
this.tabPage4.Controls.Add(this.label3);
this.tabPage4.Controls.Add(this.label2);
this.tabPage4.Location = new System.Drawing.Point(4, 22);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(760, 361);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = "Logging";
this.tabPage4.UseVisualStyleBackColor = true;
this.tabPage4.Enter += new System.EventHandler(this.tabPage4_Click);
//
// lblGlobalCurrentPath
//
this.lblGlobalCurrentPath.AutoSize = true;
this.lblGlobalCurrentPath.Location = new System.Drawing.Point(132, 211);
this.lblGlobalCurrentPath.Name = "lblGlobalCurrentPath";
this.lblGlobalCurrentPath.Size = new System.Drawing.Size(10, 13);
this.lblGlobalCurrentPath.TabIndex = 12;
this.lblGlobalCurrentPath.Text = "-";
//
// btnGlobalSearch
//
this.btnGlobalSearch.Location = new System.Drawing.Point(52, 307);
this.btnGlobalSearch.Name = "btnGlobalSearch";
this.btnGlobalSearch.Size = new System.Drawing.Size(314, 29);
this.btnGlobalSearch.TabIndex = 11;
this.btnGlobalSearch.Text = "Search";
this.btnGlobalSearch.UseVisualStyleBackColor = true;
this.btnGlobalSearch.Click += new System.EventHandler(this.btnGlobalSearch_Click);
//
// btnGlobalDefaultLan
//
this.btnGlobalDefaultLan.Location = new System.Drawing.Point(52, 272);
this.btnGlobalDefaultLan.Name = "btnGlobalDefaultLan";
this.btnGlobalDefaultLan.Size = new System.Drawing.Size(314, 29);
this.btnGlobalDefaultLan.TabIndex = 10;
this.btnGlobalDefaultLan.Text = "Use \\\\sla12buma\\cordonelds$\\${machinename}";
this.btnGlobalDefaultLan.UseVisualStyleBackColor = true;
this.btnGlobalDefaultLan.Click += new System.EventHandler(this.btnGlobalDefaultLan_Click);
//
// btnGlobalDefaultLocal
//
this.btnGlobalDefaultLocal.Location = new System.Drawing.Point(52, 237);
this.btnGlobalDefaultLocal.Name = "btnGlobalDefaultLocal";
this.btnGlobalDefaultLocal.Size = new System.Drawing.Size(314, 29);
this.btnGlobalDefaultLocal.TabIndex = 9;
this.btnGlobalDefaultLocal.Text = "Use C:\\GenesisLog\\";
this.btnGlobalDefaultLocal.UseVisualStyleBackColor = true;
this.btnGlobalDefaultLocal.Click += new System.EventHandler(this.btnGlobalDefaultLocal_Click);
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(49, 211);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(66, 13);
this.label6.TabIndex = 8;
this.label6.Text = "CurrentPath:";
//
// lblLocalCurrentPath
//
this.lblLocalCurrentPath.AutoSize = true;
this.lblLocalCurrentPath.Location = new System.Drawing.Point(132, 57);
this.lblLocalCurrentPath.Name = "lblLocalCurrentPath";
this.lblLocalCurrentPath.Size = new System.Drawing.Size(10, 13);
this.lblLocalCurrentPath.TabIndex = 7;
this.lblLocalCurrentPath.Text = "-";
//
// btnLocalSearch
//
this.btnLocalSearch.Location = new System.Drawing.Point(52, 153);
this.btnLocalSearch.Name = "btnLocalSearch";
this.btnLocalSearch.Size = new System.Drawing.Size(314, 29);
this.btnLocalSearch.TabIndex = 6;
this.btnLocalSearch.Text = "Search";
this.btnLocalSearch.UseVisualStyleBackColor = true;
this.btnLocalSearch.Click += new System.EventHandler(this.btnLocalSearch_Click);
//
// btnLocalDefaultLan
//
this.btnLocalDefaultLan.Location = new System.Drawing.Point(52, 118);
this.btnLocalDefaultLan.Name = "btnLocalDefaultLan";
this.btnLocalDefaultLan.Size = new System.Drawing.Size(314, 29);
this.btnLocalDefaultLan.TabIndex = 5;
this.btnLocalDefaultLan.Text = "Use \\\\sla12buma\\cordonelds$\\${machinename}";
this.btnLocalDefaultLan.UseVisualStyleBackColor = true;
this.btnLocalDefaultLan.Click += new System.EventHandler(this.btnLocalDefaultLan_Click);
//
// btnLocalDefaultLocal
//
this.btnLocalDefaultLocal.Location = new System.Drawing.Point(52, 83);
this.btnLocalDefaultLocal.Name = "btnLocalDefaultLocal";
this.btnLocalDefaultLocal.Size = new System.Drawing.Size(314, 29);
this.btnLocalDefaultLocal.TabIndex = 4;
this.btnLocalDefaultLocal.Text = "Use C:\\GenesisLog\\";
this.btnLocalDefaultLocal.UseVisualStyleBackColor = true;
this.btnLocalDefaultLocal.Click += new System.EventHandler(this.btnLocalDefaultLocal_Click);
//
// lblLocalPath
//
this.lblLocalPath.AutoSize = true;
this.lblLocalPath.Location = new System.Drawing.Point(121, 57);
this.lblLocalPath.Name = "lblLocalPath";
this.lblLocalPath.Size = new System.Drawing.Size(0, 13);
this.lblLocalPath.TabIndex = 3;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(49, 57);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(66, 13);
this.label4.TabIndex = 2;
this.label4.Text = "CurrentPath:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(13, 190);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(37, 13);
this.label3.TabIndex = 1;
this.label3.Text = "Global";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(13, 32);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(103, 13);
this.label2.TabIndex = 0;
this.label2.Text = "Local (only ToolBox)";
//
// tabPage5
//
this.tabPage5.Controls.Add(this.cbxSirtService868MHz);
this.tabPage5.Controls.Add(this.cbxSirtService433MHz);
this.tabPage5.Controls.Add(this.label5);
this.tabPage5.Controls.Add(this.label7);
this.tabPage5.Controls.Add(this.cbxSirtComport868MHz);
this.tabPage5.Controls.Add(this.cbxSirtComport433MHz);
this.tabPage5.Controls.Add(this.tbxSirtBoxNo);
this.tabPage5.Controls.Add(this.tbxSirtStationId);
this.tabPage5.Controls.Add(this.lblSirtComport868MHz);
this.tabPage5.Controls.Add(this.lblSirtComport433MHz);
this.tabPage5.Controls.Add(this.lblSirtBoxNo);
this.tabPage5.Controls.Add(this.lblSirtStation);
this.tabPage5.Location = new System.Drawing.Point(4, 22);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Size = new System.Drawing.Size(760, 361);
this.tabPage5.TabIndex = 4;
this.tabPage5.Text = "SIRT";
this.tabPage5.UseVisualStyleBackColor = true;
//
// cbxSirtService868MHz
//
this.cbxSirtService868MHz.FormattingEnabled = true;
this.cbxSirtService868MHz.Location = new System.Drawing.Point(142, 164);
this.cbxSirtService868MHz.Name = "cbxSirtService868MHz";
this.cbxSirtService868MHz.Size = new System.Drawing.Size(121, 21);
this.cbxSirtService868MHz.TabIndex = 13;
//
// cbxSirtService433MHz
//
this.cbxSirtService433MHz.FormattingEnabled = true;
this.cbxSirtService433MHz.Location = new System.Drawing.Point(142, 137);
this.cbxSirtService433MHz.Name = "cbxSirtService433MHz";
this.cbxSirtService433MHz.Size = new System.Drawing.Size(121, 21);
this.cbxSirtService433MHz.TabIndex = 12;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(22, 168);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(114, 13);
this.label5.TabIndex = 11;
this.label5.Text = "Service Port 868 MHz:";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(22, 140);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(114, 13);
this.label7.TabIndex = 10;
this.label7.Text = "Service Port 433 MHz:";
//
// cbxSirtComport868MHz
//
this.cbxSirtComport868MHz.FormattingEnabled = true;
this.cbxSirtComport868MHz.Location = new System.Drawing.Point(142, 102);
this.cbxSirtComport868MHz.Name = "cbxSirtComport868MHz";
this.cbxSirtComport868MHz.Size = new System.Drawing.Size(121, 21);
this.cbxSirtComport868MHz.TabIndex = 9;
//
// cbxSirtComport433MHz
//
this.cbxSirtComport433MHz.FormattingEnabled = true;
this.cbxSirtComport433MHz.Location = new System.Drawing.Point(142, 75);
this.cbxSirtComport433MHz.Name = "cbxSirtComport433MHz";
this.cbxSirtComport433MHz.Size = new System.Drawing.Size(121, 21);
this.cbxSirtComport433MHz.TabIndex = 8;
//
// tbxSirtBoxNo
//
this.tbxSirtBoxNo.Location = new System.Drawing.Point(142, 44);
this.tbxSirtBoxNo.Name = "tbxSirtBoxNo";
this.tbxSirtBoxNo.Size = new System.Drawing.Size(100, 20);
this.tbxSirtBoxNo.TabIndex = 7;
//
// tbxSirtStationId
//
this.tbxSirtStationId.Location = new System.Drawing.Point(142, 17);
this.tbxSirtStationId.Name = "tbxSirtStationId";
this.tbxSirtStationId.Size = new System.Drawing.Size(100, 20);
this.tbxSirtStationId.TabIndex = 6;
//
// lblSirtComport868MHz
//
this.lblSirtComport868MHz.AutoSize = true;
this.lblSirtComport868MHz.Location = new System.Drawing.Point(22, 106);
this.lblSirtComport868MHz.Name = "lblSirtComport868MHz";
this.lblSirtComport868MHz.Size = new System.Drawing.Size(103, 13);
this.lblSirtComport868MHz.TabIndex = 5;
this.lblSirtComport868MHz.Text = "RSSI Port 868 MHz:";
//
// lblSirtComport433MHz
//
this.lblSirtComport433MHz.AutoSize = true;
this.lblSirtComport433MHz.Location = new System.Drawing.Point(22, 78);
this.lblSirtComport433MHz.Name = "lblSirtComport433MHz";
this.lblSirtComport433MHz.Size = new System.Drawing.Size(103, 13);
this.lblSirtComport433MHz.TabIndex = 4;
this.lblSirtComport433MHz.Text = "RSSI Port 433 MHz:";
//
// lblSirtBoxNo
//
this.lblSirtBoxNo.AutoSize = true;
this.lblSirtBoxNo.Location = new System.Drawing.Point(22, 51);
this.lblSirtBoxNo.Name = "lblSirtBoxNo";
this.lblSirtBoxNo.Size = new System.Drawing.Size(45, 13);
this.lblSirtBoxNo.TabIndex = 3;
this.lblSirtBoxNo.Text = "Box No:";
//
// lblSirtStation
//
this.lblSirtStation.AutoSize = true;
this.lblSirtStation.Location = new System.Drawing.Point(22, 24);
this.lblSirtStation.Name = "lblSirtStation";
this.lblSirtStation.Size = new System.Drawing.Size(57, 13);
this.lblSirtStation.TabIndex = 2;
this.lblSirtStation.Text = "Station ID:";
//
// FrmSetup
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(780, 671);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.btnStore);
this.Controls.Add(this.btnReload);
this.MinimumSize = new System.Drawing.Size(755, 410);
this.Name = "FrmSetup";
this.Text = "Setup";
this.Load += new System.EventHandler(this.FrmSetup_Load);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvConfig)).EndInit();
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.tabPage3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvofflinePw)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.offlinePaswordItemBindingSource)).EndInit();
this.tabPage4.ResumeLayout(false);
this.tabPage4.PerformLayout();
this.tabPage5.ResumeLayout(false);
this.tabPage5.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnReload;
private System.Windows.Forms.Button btnStore;
private System.Windows.Forms.DataGridViewTextBoxColumn pcbIDDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn passwordDataGridViewTextBoxColumn;
private System.Windows.Forms.BindingSource offlinePaswordItemBindingSource;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.Button btnAddRow;
private System.Windows.Forms.DataGridView dgvConfig;
private System.Windows.Forms.DataGridViewTextBoxColumn tbcSlot;
private System.Windows.Forms.DataGridViewComboBoxColumn cbcRequestPort;
private System.Windows.Forms.DataGridViewComboBoxColumn cbcRequestType;
private System.Windows.Forms.DataGridViewComboBoxColumn cbcStreamingPort;
private System.Windows.Forms.DataGridViewCheckBoxColumn cbcSlotType;
private System.Windows.Forms.DataGridViewButtonColumn btcDetectRequest;
private System.Windows.Forms.DataGridViewButtonColumn btcDetectStreaming;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.CheckBox cbxProductionMode;
private System.Windows.Forms.CheckBox cbUpdateFiles;
private System.Windows.Forms.CheckBox cbUseMinMaxCheck;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtWachSeriveUrl;
private System.Windows.Forms.CheckBox cbUseRegisterWatch;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.Button cmdAddOffline;
private System.Windows.Forms.DataGridView dgvofflinePw;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.Button btnLocalDefaultLocal;
private System.Windows.Forms.Label lblLocalPath;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnLocalSearch;
private System.Windows.Forms.Button btnLocalDefaultLan;
private System.Windows.Forms.Label lblLocalCurrentPath;
private System.Windows.Forms.Label lblGlobalCurrentPath;
private System.Windows.Forms.Button btnGlobalSearch;
private System.Windows.Forms.Button btnGlobalDefaultLan;
private System.Windows.Forms.Button btnGlobalDefaultLocal;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TabPage tabPage5;
private System.Windows.Forms.Label lblSirtComport868MHz;
private System.Windows.Forms.Label lblSirtComport433MHz;
private System.Windows.Forms.Label lblSirtBoxNo;
private System.Windows.Forms.Label lblSirtStation;
private System.Windows.Forms.TextBox tbxSirtBoxNo;
private System.Windows.Forms.TextBox tbxSirtStationId;
private System.Windows.Forms.ComboBox cbxSirtComport868MHz;
private System.Windows.Forms.ComboBox cbxSirtComport433MHz;
private System.Windows.Forms.ComboBox cbxSirtService868MHz;
private System.Windows.Forms.ComboBox cbxSirtService433MHz;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label7;
}
}

View File

@ -0,0 +1,862 @@
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
using System.Xml.Linq;
using Xylem.Common.CommonCore.Consts;
using Xylem.Common.Hardware.Interfaces.Ports.PortCore;
using Xylem.Common.Hardware.Interfaces.Ports.PortCore.EventArguments;
using Xylem.Common.Hardware.Interfaces.Ports.SerialPorts;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
using Xylem.Common.Utils.Logging;
using NLog;
using GenesisCordonelInterface.API;
namespace GenesisCordonelInterface.UI.LaatzenAPI_GenesisToolBox
{
/// <summary>
/// Setup of GTB
/// </summary>
public partial class FrmSetup : Form
{
private static readonly NLog.ILogger Logger = NLog.LogManager.GetLogger("GenesisCordonelInterface");
private readonly InterfaceGCIToLaatzen interfaceToLaatzen = new InterfaceGCIToLaatzen();
private const String RequestPortString = "RequestPort";
private const String RequestTypeString = "RequestType";
private const String StreamingPortString = "StreamingPort";
private const String SlotTypeString = "RefTemperature";
private const String SlotString = "Slot";
private const String StreamingDetectString = "DetectStreaming";
private const String RequestDetectString = "DetectRequest";
private const String ValueString = "Value";
private const String TextString = "Text";
private String _fileString;
private readonly String _serialConfigFilePathName;
private readonly String _offlinePwdPathName;
private readonly DataTable _slotConfigDataTable = new DataTable();
private readonly SirtConfig _sirtConfig = new SirtConfig();
private readonly ProcessConfig _configuration = new ProcessConfig();
private ConcurrentBag<String> _countRawData = new ConcurrentBag<String>();
private List<OfflinePasswordItem> _listOfOfflinePasswords = new List<OfflinePasswordItem>();
/// <summary>
/// Ctor
/// </summary>
public FrmSetup()
{
_serialConfigFilePathName = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"Genesis",
ProgramConfig.SerialConfigFileName);
_offlinePwdPathName = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"Genesis",
ProgramConfig.OfflineInfoFile);
if (!File.Exists(_offlinePwdPathName))
{
_listOfOfflinePasswords.Add(new OfflinePasswordItem("", ""));
File.WriteAllText(_offlinePwdPathName, JsonConvert.SerializeObject(_listOfOfflinePasswords));
}
_slotConfigDataTable.Columns.Add(SlotString, typeof(String));
_slotConfigDataTable.Columns.Add(StreamingPortString, typeof(String));
_slotConfigDataTable.Columns.Add(RequestPortString, typeof(String));
_slotConfigDataTable.Columns.Add(RequestTypeString, typeof(String));
_slotConfigDataTable.Columns.Add(SlotTypeString, typeof(String));
InitializeComponent();
tbcSlot.Name = SlotString;
cbcRequestPort.Name = RequestPortString;
cbcRequestType.Name = RequestTypeString;
cbcStreamingPort.Name = StreamingPortString;
cbcSlotType.Name = SlotTypeString;
btcDetectStreaming.Name = StreamingDetectString;
btcDetectRequest.Name = RequestDetectString;
btcDetectStreaming.Name = StreamingDetectString;
tbcSlot.HeaderText = SlotString;
cbcRequestPort.HeaderText = RequestPortString;
cbcRequestType.HeaderText = RequestTypeString;
cbcStreamingPort.HeaderText = StreamingPortString;
btcDetectRequest.HeaderText = RequestDetectString;
btcDetectStreaming.HeaderText = StreamingDetectString;
cbcSlotType.HeaderText = SlotTypeString;
LoadFromFile();
_configuration.ReadProcessConfig();
cbUseMinMaxCheck.Checked = _configuration.UseMinMaxCheck;
cbUseRegisterWatch.Checked = _configuration.UseRegisterWatchService;
txtWachSeriveUrl.Text = _configuration.RegisterWatchServiceUrl;
cbUpdateFiles.Checked = _configuration.AutoUpdateFiles;
cbxProductionMode.Checked = _configuration.ProductionMode;
_sirtConfig.ReadSirtConfig();
tbxSirtStationId.Text = _sirtConfig.StationId?.ToString();
tbxSirtBoxNo.Text = _sirtConfig.SirtBoxNo?.ToString();
if (_sirtConfig.SirtComport433MHz != null)
cbxSirtComport433MHz.Items.Add(_sirtConfig.SirtComport433MHz);
if (_sirtConfig.SirtComport868MHz != null)
cbxSirtComport868MHz.Items.Add(_sirtConfig.SirtComport868MHz);
var comPorts = SerialPort.GetPortNames().ToList();
foreach (var comPort in comPorts.Where(comPort => !cbxSirtComport433MHz.Items.Contains(comPort)))
{
cbxSirtComport433MHz.Items.Add(comPort);
}
foreach (var comPort in comPorts.Where(comPort => !cbxSirtComport868MHz.Items.Contains(comPort)))
{
cbxSirtComport868MHz.Items.Add(comPort);
}
if (cbxSirtComport433MHz.Items.Count > 0)
cbxSirtComport433MHz.Text = cbxSirtComport433MHz.Items[0].ToString();
if (cbxSirtComport868MHz.Items.Count > 0)
cbxSirtComport868MHz.Text = cbxSirtComport868MHz.Items[0].ToString();
if (_sirtConfig.ServiceSirtComport433MHz != null)
cbxSirtService433MHz.Items.Add(_sirtConfig.ServiceSirtComport433MHz);
if (_sirtConfig.ServiceSirtComport868MHz != null)
cbxSirtService868MHz.Items.Add(_sirtConfig.ServiceSirtComport868MHz);
foreach (var comPort in comPorts.Where(comPort => !cbxSirtService433MHz.Items.Contains(comPort)))
{
cbxSirtService433MHz.Items.Add(comPort);
}
foreach (var comPort in comPorts.Where(comPort => !cbxSirtService868MHz.Items.Contains(comPort)))
{
cbxSirtService868MHz.Items.Add(comPort);
}
if (cbxSirtService433MHz.Items.Count > 0)
cbxSirtService433MHz.Text = cbxSirtService433MHz.Items[0].ToString();
if (cbxSirtService868MHz.Items.Count > 0)
cbxSirtService868MHz.Text = cbxSirtService868MHz.Items[0].ToString();
Logger.Trace("CONFIG: Setup loaded.");
}
private void BtnReload_Click(Object sender, EventArgs e)
{
Logger.Trace("CONFIG: Reload setup requested.");
LoadFromFile();
LoadOfflineFile();
Logger.Trace("CONFIG: Setup reloaded.");
}
private void BtnStore_Click(Object sender, EventArgs e)
{
Logger.Trace("CONFIG: Save setup requested.");
StoreToPc();
StoreOfflineFile();
StoreSirtSettings();
Logger.Trace("CONFIG: Setup saved.");
}
private void StoreSirtSettings()
{
if (int.TryParse(tbxSirtStationId.Text, out var intNo))
{
_sirtConfig.StationId = intNo;
}
if (int.TryParse(tbxSirtBoxNo.Text, out intNo))
{
_sirtConfig.SirtBoxNo = intNo;
}
_sirtConfig.SirtComport433MHz = cbxSirtComport433MHz.Text;
_sirtConfig.SirtComport868MHz = cbxSirtComport868MHz.Text;
_sirtConfig.ServiceSirtComport433MHz = cbxSirtService433MHz.Text;
_sirtConfig.ServiceSirtComport868MHz = cbxSirtService868MHz.Text;
_sirtConfig.Update();
Logger.Trace("CONFIG: SIRT settings stored.");
}
private void StoreToPc()
{
Logger.Trace("CONFIG: Storing slot configuration to PC.");
var newFileContent = new List<SlotConfig>();
for (var row = 0; row < dgvConfig.Rows.Count; row++)
{
var slotStr = (String)dgvConfig.Rows[row].Cells[SlotString].Value;
int.TryParse(slotStr, out var slot);
var irdaType = typeof(IrdaSerialPort).FullName;
if (dgvConfig.Rows[row].Cells[RequestTypeString].Value != null)
{
irdaType = (String)dgvConfig.Rows[row].Cells[RequestTypeString].Value;
}
var requestPort = new PortConfig()
{
PortName = (String)dgvConfig.Rows[row].Cells[RequestPortString].Value,
Type = irdaType
};
var streamingPort = new PortConfig()
{
PortName = (String)dgvConfig.Rows[row].Cells[StreamingPortString].Value,
Type = typeof(UartSerialPort).FullName
};
var slotType = SlotType.DutMeter;
if (dgvConfig.Rows[row].Cells[SlotTypeString].Value != null)
{
var isChecked = dgvConfig.Rows[row].Cells[SlotTypeString].Value.ToString();
if (bool.TrueString == isChecked)
{
slotType = SlotType.TemperatureMeter;
}
}
if (!string.IsNullOrEmpty(slotStr))
{
newFileContent.Add(new SlotConfig()
{
Slot = slot,
Request = requestPort,
Streaming = streamingPort,
Type = slotType
});
}
}
var text = JsonConvert.SerializeObject(newFileContent);
if (text == _fileString)
{
Logger.Trace("CONFIG: No setup changes detected.");
LoadFromFile();
return;
}
if (File.Exists(_serialConfigFilePathName))
{
var backupSerialConfigFile =
$"{Path.GetDirectoryName(_serialConfigFilePathName)}\\Backup_{DateTime.Now:yyyyMMdd}_{DateTime.Now:HHmmss}_{ProgramConfig.SerialConfigFileName}";
File.Move(_serialConfigFilePathName, backupSerialConfigFile);
}
File.WriteAllText(_serialConfigFilePathName, text);
LoadFromFile();
LoadOfflineFile();
Logger.Trace("CONFIG: Slot configuration stored.");
}
private void LoadFromFile()
{
Logger.Trace("CONFIG: Loading slot configuration from file.");
_slotConfigDataTable.Clear();
dgvConfig.Rows.Clear();
if (!File.Exists(_serialConfigFilePathName))
{
Logger.Trace("CONFIG: Serial configuration file not found.");
return;
}
SlotConfig[] meterConfigList;
using (var tr = new StreamReader(_serialConfigFilePathName))
{
_fileString = tr.ReadToEnd();
meterConfigList = JsonConvert.DeserializeObject<SlotConfig[]>(_fileString);
}
foreach (var item in meterConfigList)
{
var row = _slotConfigDataTable.NewRow();
row[SlotString] = item.Slot;
row[RequestPortString] = item.Request.PortName;
row[RequestTypeString] = item.Request.Type;
row[StreamingPortString] = item.Streaming.PortName;
row[SlotTypeString] = item.Type == SlotType.TemperatureMeter;
_slotConfigDataTable.Rows.Add(row);
}
foreach (DataRow row in _slotConfigDataTable.Rows)
{
dgvConfig.Rows.Add(AddRowToGrid(row));
}
Logger.Trace("CONFIG: Slot configuration loaded.");
}
private DataGridViewRow AddRowToGrid(DataRow row = null)
{
var newRow = new DataGridViewRow();
var slotCell = new DataGridViewTextBoxCell();
newRow.Cells.Add(slotCell);
var requestPortCell = new DataGridViewComboBoxCell
{
DataSource = GetPorts(),
DisplayMember = TextString,
ValueMember = ValueString
};
newRow.Cells.Add(requestPortCell);
var requestTypeCell = new DataGridViewComboBoxCell
{
DataSource = GetTypes(),
DisplayMember = TextString,
ValueMember = ValueString
};
newRow.Cells.Add(requestTypeCell);
var streamingPortCell = new DataGridViewComboBoxCell
{
DataSource = GetPorts(),
DisplayMember = TextString,
ValueMember = ValueString
};
newRow.Cells.Add(streamingPortCell);
var slotTypeCell = new DataGridViewCheckBoxCell();
slotTypeCell.Value = false;
if (row == null)
{
return newRow;
}
slotCell.Value = row[SlotString];
streamingPortCell.Value = row[StreamingPortString];
requestPortCell.Value = row[RequestPortString];
try
{
requestTypeCell.Value = row[RequestTypeString];
}
catch (Exception ex)
{
Logger.Error("Failed to set request type in grid: " + ex.Message);
}
slotTypeCell.Value = row[SlotTypeString];
newRow.Cells.Add(slotTypeCell);
return newRow;
}
private DataTable GetSlotTypes()
{
var ret = new DataTable();
ret.Columns.Add(TextString);
ret.Columns.Add(ValueString, typeof(Int32));
ret.Rows.Add("DutMeter", SlotType.DutMeter.GetHashCode());
ret.Rows.Add("TemperatureMeter", SlotType.TemperatureMeter.GetHashCode());
return ret;
}
private DataTable GetPorts()
{
var ret = new DataTable();
ret.Columns.Add(ValueString);
ret.Columns.Add(TextString);
var portList = SerialPort.GetPortNames().ToList();
foreach (var item in portList)
{
ret.Rows.Add(item, item);
}
foreach (DataRow row in _slotConfigDataTable.Rows)
{
if (portList.All(pl => pl != (String)row[StreamingPortString]))
{
ret.Rows.Add(row[StreamingPortString].ToString(), BaseSerialPort.PortNotAssigned);
}
if (portList.All(pl => pl != (String)row[RequestPortString]))
{
ret.Rows.Add(row[RequestPortString].ToString(), BaseSerialPort.PortNotAssigned);
}
}
return ret;
}
private static DataTable GetTypes()
{
var ret = new DataTable();
ret.Columns.Add(ValueString);
ret.Columns.Add(TextString);
ret.Rows.Add(typeof(UartSerialPort).FullName, nameof(UartSerialPort));
ret.Rows.Add(typeof(RfidSerialPort).FullName, nameof(RfidSerialPort));
ret.Rows.Add(typeof(IrdaSerialPort).FullName, nameof(IrdaSerialPort));
return ret;
}
private void __DgvConfig_CellContentClick(Object sender, DataGridViewCellEventArgs e)
{
Logger.Trace("UI-CLICK: FrmSetup: DgvConfig_CellContentClick() use APILaatzen");
if (e.RowIndex < 0 || e.ColumnIndex < 0)
{
return;
}
if (!dgvConfig.Columns[e.ColumnIndex].Name.Contains(StreamingDetectString) &&
!dgvConfig.Columns[e.ColumnIndex].Name.Contains(RequestDetectString))
{
return;
}
StoreToPc();
var slotString = (String)dgvConfig.Rows[e.RowIndex].Cells[SlotString].Value;
int.TryParse(slotString, out var slot);
using (var mb = new MeterBatch())
{
using (var meter = new GenesisMeter())
{
meter.SetupFromConfigFile(slot, false);
mb.AddMeter(meter);
const String checkMark = "\u2714";
if (dgvConfig.Columns[e.ColumnIndex].Name.Contains(StreamingDetectString))
{
Logger.Trace("COM: Detecting streaming port for slot " + slot + "...");
_countRawData = new ConcurrentBag<String>();
meter.StreamingPort.OnRawRecordReceived += delegate (Object o, BasePortDataEventArgs rawMsg)
{
var data = (String)rawMsg.GetData();
_countRawData.Add(data);
};
Thread.Sleep(500);
if (_countRawData.Any())
{
var text = $"SUCCESS\nSlot: {slot}\nStreaming port: {meter.StreamingPort.GetPortName()}\n\n{checkMark}";
MessageBox.Show(text, @"SUCCESS", MessageBoxButtons.OK);
dgvConfig.Rows[e.RowIndex].Cells[StreamingDetectString].Style.BackColor = Color.Green;
Logger.Info("COM: Streaming detection SUCCESS for slot " + slot + ", port " + meter.StreamingPort.GetPortName() + ".");
}
else
{
var text = $"FAILED\nSlot: {slot}\nStreaming port: {meter.StreamingPort.GetPortName()}";
MessageBox.Show(text, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error);
dgvConfig.Rows[e.RowIndex].Cells[StreamingDetectString].Style.BackColor = Color.Red;
Logger.Error("COM: Streaming detection FAILED for slot " + slot + ", port " + meter.StreamingPort.GetPortName() + ".");
}
_countRawData = new ConcurrentBag<String>();
}
else
{
meter.Logout();
var pcbId = meter.GetPcbId();
if (string.IsNullOrEmpty(pcbId))
{
var text = $"FAILED\nSlot: {slot}\nRequest port: {meter.RequestPort.GetPortName()}";
MessageBox.Show(text, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error);
dgvConfig.Rows[e.RowIndex].Cells[RequestDetectString].Style.BackColor = Color.Red;
Logger.Info("COM: Streaming detection SUCCESS for slot " + slot + ", port " + meter.StreamingPort.GetPortName() + ".");
}
else
{
var text = $"SUCCESS\nSlot: {slot}\nRequest port: {meter.RequestPort.GetPortName()}\n\n{checkMark}";
MessageBox.Show(text, @"SUCCESS", MessageBoxButtons.OK);
dgvConfig.Rows[e.RowIndex].Cells[RequestDetectString].Style.BackColor = Color.Green;
Logger.Error("COM: Streaming detection FAILED for slot " + slot + ", port " + meter.StreamingPort.GetPortName() + ".");
}
}
}
}
}
private void DgvConfig_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
Logger.Trace("UI-CLICK: FrmSetup: DgvConfig_CellContentClick() use API2");
if (e.RowIndex < 0 || e.ColumnIndex < 0)
return;
var columnName = dgvConfig.Columns[e.ColumnIndex].Name;
if (!columnName.Contains(StreamingDetectString) &&
!columnName.Contains(RequestDetectString))
{
return;
}
StoreToPc();
var slotString = (string)dgvConfig.Rows[e.RowIndex].Cells[SlotString].Value;
if (!int.TryParse(slotString, out var slot))
return;
const string checkMark = "\u2714";
try
{
if (columnName.Contains(StreamingDetectString))
{
Logger.Trace("COM: Detecting streaming port for slot " + slot + "...");
var result = interfaceToLaatzen.DetectStreamingPort(slot);
if (result.Success)
{
var text = $"SUCCESS\nSlot: {result.Slot}\nStreaming port: {result.PortName}\n\n{checkMark}";
MessageBox.Show(text, @"SUCCESS", MessageBoxButtons.OK);
dgvConfig.Rows[e.RowIndex].Cells[StreamingDetectString].Style.BackColor = Color.Green;
Logger.Info("COM: Streaming detection SUCCESS for slot " + result.Slot + ", port " + result.PortName + ".");
}
else
{
var text = $"FAILED\nSlot: {result.Slot}\nStreaming port: {result.PortName}";
MessageBox.Show(text, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error);
dgvConfig.Rows[e.RowIndex].Cells[StreamingDetectString].Style.BackColor = Color.Red;
Logger.Error("COM: Streaming detection FAILED for slot " + result.Slot + ", port " + result.PortName + ".");
}
}
else
{
var result = interfaceToLaatzen.DetectRequestPort(slot);
if (result.Success)
{
var text = $"SUCCESS\nSlot: {result.Slot}\nRequest port: {result.PortName}\n\n{checkMark}";
MessageBox.Show(text, @"SUCCESS", MessageBoxButtons.OK);
dgvConfig.Rows[e.RowIndex].Cells[RequestDetectString].Style.BackColor = Color.Green;
Logger.Info("COM: Request detection SUCCESS for slot " + result.Slot + ", port " + result.PortName + ".");
}
else
{
var text = $"FAILED\nSlot: {result.Slot}\nRequest port: {result.PortName}";
MessageBox.Show(text, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error);
dgvConfig.Rows[e.RowIndex].Cells[RequestDetectString].Style.BackColor = Color.Red;
Logger.Error("COM: Request detection FAILED for slot " + result.Slot + ", port " + result.PortName + ".");
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, @"ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
Logger.Error(ex);
}
}
private void dgvConfig_DataError(Object sender, DataGridViewDataErrorEventArgs e)
{
Logger.Error("CONFIG: DataGridView data error.");
}
private void cbUseRegisterWatch_CheckedChanged(Object sender, EventArgs e)
{
_configuration.UseRegisterWatchService = cbUseRegisterWatch.Checked;
_configuration.Update();
StoreToPc();
Logger.Trace("UseRegisterWatchService changed to " + cbUseRegisterWatch.Checked);
}
private void cbUseMinMaxCheck_CheckedChanged(Object sender, EventArgs e)
{
_configuration.UseMinMaxCheck = cbUseMinMaxCheck.Checked;
_configuration.Update();
StoreToPc();
Logger.Trace("UseMinMaxCheck changed to " + cbUseMinMaxCheck.Checked);
}
private void textBox1_TextChanged(Object sender, EventArgs e)
{
_configuration.RegisterWatchServiceUrl = txtWachSeriveUrl.Text;
_configuration.Update();
StoreToPc();
Logger.Trace("RegisterWatchServiceUrl changed.");
}
private void cbUpdateFiles_CheckedChanged(Object sender, EventArgs e)
{
_configuration.AutoUpdateFiles = cbUpdateFiles.Checked;
_configuration.Update();
StoreToPc();
Logger.Trace("CONFIG: AutoUpdateFiles changed to " + cbUpdateFiles.Checked);
}
private void FrmSetup_Load(Object sender, EventArgs e)
{
LoadOfflineFile();
cbxProductionMode.CheckedChanged += cbxProductionMode_CheckedChanged;
Logger.Trace("FORM: FrmSetup loaded.");
}
private void StoreOfflineFile()
{
try
{
var listToRemove = _listOfOfflinePasswords.Where(offlinePwd => string.IsNullOrEmpty(offlinePwd.PcbID)).ToList();
foreach (var itemToRemove in listToRemove)
{
_listOfOfflinePasswords.Remove(itemToRemove);
}
_listOfOfflinePasswords.Add(new OfflinePasswordItem("", ""));
File.WriteAllText(_offlinePwdPathName, JsonConvert.SerializeObject(_listOfOfflinePasswords));
dgvofflinePw.CellValidated -= dgvofflinePw_CellValidated;
dgvofflinePw.DataSource = null;
dgvofflinePw.DataSource = _listOfOfflinePasswords;
dgvofflinePw.CellValidated += dgvofflinePw_CellValidated;
Logger.Trace("CONFIG: Offline password file stored.");
}
catch (Exception ex)
{
Logger.Error("CONFIG: Failed to store offline password file: " + ex.Message);
}
}
private void LoadOfflineFile()
{
try
{
_listOfOfflinePasswords = JsonConvert.DeserializeObject<List<OfflinePasswordItem>>(File.ReadAllText(_offlinePwdPathName));
}
catch (Exception ex)
{
_listOfOfflinePasswords = new List<OfflinePasswordItem>();
Logger.Error("CONFIG: Failed to load offline password file. New empty list created. " + ex.Message);
}
finally
{
if (!_listOfOfflinePasswords.Any())
{
_listOfOfflinePasswords.Add(new OfflinePasswordItem("", ""));
}
dgvofflinePw.CellValidated -= dgvofflinePw_CellValidated;
dgvofflinePw.DataSource = null;
dgvofflinePw.DataSource = _listOfOfflinePasswords;
dgvofflinePw.CellValidated += dgvofflinePw_CellValidated;
Logger.Trace("CONFIG: Offline password file loaded.");
}
}
private void dgvofflinePw_CellValidated(Object sender, DataGridViewCellEventArgs e)
{
StoreOfflineFile();
}
private void cmdAddOffline_Click(Object sender, EventArgs e)
{
_listOfOfflinePasswords.Add(new OfflinePasswordItem("", ""));
dgvofflinePw.DataSource = null;
dgvofflinePw.DataSource = _listOfOfflinePasswords;
Logger.Trace("TABLE: Offline password row added.");
}
private void cbxProductionMode_CheckedChanged(Object sender, EventArgs e)
{
if (cbxProductionMode.Checked)
{
MessageBox.Show(@"Production mode! Configuration.json has to be the latest! ");
}
else
{
MessageBox.Show("Developer mode! Configuration.json can be exchanged on individual requirements.\n" +
"\nRISK:\n" +
"- Register ranges cannot be checked\n" +
"- Register may not be able to access");
}
_configuration.ProductionMode = cbxProductionMode.Checked;
_configuration.Update();
StoreToPc();
Logger.Trace("CHECKBOX: ProductionMode changed to " + cbxProductionMode.Checked);
}
private void tabPage4_Click(Object sender, EventArgs e)
{
Logger.Trace("TABPAGE4: Logging tab opened.");
try
{
var path = NLogHelper.GetCurrentApplicationFolder();
var a = XElement.Load(path);
lblLocalCurrentPath.Text = a.Elements()
.First(s => s.Name.LocalName == "variable")
.Attributes()
.First(s => s.Value == "BasePath")
.NextAttribute.Value;
}
catch (Exception ex)
{
lblLocalCurrentPath.Text = ex.Message;
Logger.Error("TABPAGE4: Failed to read local NLog path: " + ex.Message);
}
try
{
var path = NLogHelper.GetApplicationDataPath();
var b = XElement.Load(path);
lblGlobalCurrentPath.Text = b.Elements()
.First(s => s.Name.LocalName == "variable")
.Attributes()
.First(s => s.Value == "BasePath")
.NextAttribute.Value;
}
catch (Exception ex)
{
lblGlobalCurrentPath.Text = ex.Message;
Logger.Error("TABPAGE4: Failed to read global NLog path: " + ex.Message);
}
}
private void Add(String path, String newDest)
{
try
{
var a = XElement.Load(path);
var firstIsVariable = a.Elements().First();
if (firstIsVariable.Name.LocalName != "variable")
{
var newElm = new XElement("variable", null);
newElm.SetAttributeValue("name", "BasePath");
newElm.SetAttributeValue("value", newDest);
a.AddFirst(newElm);
}
else if (a.Elements().First(b => b.Name.LocalName == "variable").Attributes()
.All(s => s.Value != "BasePath"))
{
var newElm = new XElement("variable", null);
newElm.SetAttributeValue("name", "BasePath");
newElm.SetAttributeValue("value", newDest);
a.AddFirst(newElm);
}
else
{
a.Elements().First(b => b.Name.LocalName == "variable").Attributes()
.First(s => s.Value == "BasePath").NextAttribute.Value = newDest;
}
a.Save(path);
tabPage4_Click(this, null);
Logger.Trace("Log path updated to: " + newDest);
}
catch (Exception ex)
{
Logger.Trace("Failed to update log path: " + ex.Message);
}
}
private void btnLocalDefaultLocal_Click(Object sender, EventArgs e)
{
Add(NLogHelper.GetCurrentApplicationFolder(), "C:\\GenesisLog\\");
Logger.Trace("Local log path set to default local.");
}
private void btnLocalDefaultLan_Click(Object sender, EventArgs e)
{
Add(NLogHelper.GetCurrentApplicationFolder(), "\\\\sla12buma\\cordonelds$\\${machinename}");
Logger.Trace("Local log path set to default LAN.");
}
private void btnGlobalDefaultLocal_Click(Object sender, EventArgs e)
{
Add(NLogHelper.GetApplicationDataPath(), "C:\\GenesisLog\\");
Logger.Trace("Global log path set to default local.");
}
private void btnGlobalDefaultLan_Click(Object sender, EventArgs e)
{
Add(NLogHelper.GetApplicationDataPath(), "\\\\sla12buma\\cordonelds$\\${{machinename}}");
Logger.Trace("Global log path set to default LAN.");
}
private void btnGlobalSearch_Click(Object sender, EventArgs e)
{
var dia = new FolderBrowserDialog();
dia.ShowDialog();
Add(NLogHelper.GetApplicationDataPath(), dia.SelectedPath);
Logger.Trace("Global log path selected by search dialog.");
}
private void btnLocalSearch_Click(Object sender, EventArgs e)
{
var dia = new FolderBrowserDialog();
dia.ShowDialog();
Add(NLogHelper.GetCurrentApplicationFolder(), dia.SelectedPath);
Logger.Trace("Local log path selected by search dialog.");
}
private void btnAddRow_Click(Object sender, EventArgs e)
{
dgvConfig.Rows.Add(AddRowToGrid());
Logger.Trace("TABLE: New slot row added.");
}
public class OfflinePasswordItem
{
public OfflinePasswordItem()
{
}
public OfflinePasswordItem(String pcbID, String password)
{
PcbID = pcbID;
Password = password;
}
public String PcbID { get; set; }
public String Password { get; set; }
}
}
}

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>

View File

@ -0,0 +1,333 @@
namespace GenesisCordonelInterface.UI
{
partial class MainForm
{
private System.ComponentModel.IContainer components = null;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem miFile;
private System.Windows.Forms.ToolStripMenuItem miExit;
private System.Windows.Forms.ToolStripMenuItem miView;
private System.Windows.Forms.ToolStripMenuItem miClearLog;
private System.Windows.Forms.ToolStripMenuItem miHelp;
private System.Windows.Forms.ToolStripMenuItem miHelpAbout;
private System.Windows.Forms.Panel pnlLeftMenu;
private System.Windows.Forms.Panel pnlMain;
private System.Windows.Forms.RichTextBox rtbMainLog;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel tslStatus;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.miFile = new System.Windows.Forms.ToolStripMenuItem();
this.miExit = new System.Windows.Forms.ToolStripMenuItem();
this.miView = new System.Windows.Forms.ToolStripMenuItem();
this.miClearLog = new System.Windows.Forms.ToolStripMenuItem();
this.miHelp = new System.Windows.Forms.ToolStripMenuItem();
this.miHelpAbout = new System.Windows.Forms.ToolStripMenuItem();
this.pnlLeftMenu = new System.Windows.Forms.Panel();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.preadjustmentButton = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnPulseSetup = new System.Windows.Forms.Button();
this.btnSetup = new System.Windows.Forms.Button();
this.btnRegisterStore = new System.Windows.Forms.Button();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.pnlMain = new System.Windows.Forms.Panel();
this.rtbMainLog = new System.Windows.Forms.RichTextBox();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.tslStatus = new System.Windows.Forms.ToolStripStatusLabel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.button1 = new System.Windows.Forms.Button();
this.menuStrip1.SuspendLayout();
this.pnlLeftMenu.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.pnlMain.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.miFile,
this.miView,
this.miHelp});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Padding = new System.Windows.Forms.Padding(5, 2, 0, 2);
this.menuStrip1.Size = new System.Drawing.Size(1309, 24);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
//
// miFile
//
this.miFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.miExit});
this.miFile.Name = "miFile";
this.miFile.Size = new System.Drawing.Size(37, 20);
this.miFile.Text = "File";
//
// miExit
//
this.miExit.Name = "miExit";
this.miExit.Size = new System.Drawing.Size(92, 22);
this.miExit.Text = "Exit";
this.miExit.Click += new System.EventHandler(this.miExit_Click);
//
// miView
//
this.miView.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.miClearLog});
this.miView.Name = "miView";
this.miView.Size = new System.Drawing.Size(44, 20);
this.miView.Text = "View";
//
// miClearLog
//
this.miClearLog.Name = "miClearLog";
this.miClearLog.Size = new System.Drawing.Size(124, 22);
this.miClearLog.Text = "Clear Log";
this.miClearLog.Click += new System.EventHandler(this.miClearLog_Click);
//
// miHelp
//
this.miHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.miHelpAbout});
this.miHelp.Name = "miHelp";
this.miHelp.Size = new System.Drawing.Size(44, 20);
this.miHelp.Text = "Help";
//
// miHelpAbout
//
this.miHelpAbout.Name = "miHelpAbout";
this.miHelpAbout.Size = new System.Drawing.Size(107, 22);
this.miHelpAbout.Text = "About";
this.miHelpAbout.Click += new System.EventHandler(this.miHelpAbout_Click);
//
// pnlLeftMenu
//
this.pnlLeftMenu.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pnlLeftMenu.Controls.Add(this.tabControl1);
this.pnlLeftMenu.Dock = System.Windows.Forms.DockStyle.Left;
this.pnlLeftMenu.Location = new System.Drawing.Point(0, 24);
this.pnlLeftMenu.Name = "pnlLeftMenu";
this.pnlLeftMenu.Size = new System.Drawing.Size(190, 474);
this.pnlLeftMenu.TabIndex = 1;
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(3, 5);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(186, 464);
this.tabControl1.TabIndex = 4;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox2);
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(178, 438);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Laatzen API";
this.tabPage1.UseVisualStyleBackColor = true;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.preadjustmentButton);
this.groupBox2.Location = new System.Drawing.Point(6, 190);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(166, 66);
this.groupBox2.TabIndex = 5;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "CordonelPreadjustmentUI";
//
// preadjustmentButton
//
this.preadjustmentButton.Location = new System.Drawing.Point(6, 19);
this.preadjustmentButton.Name = "preadjustmentButton";
this.preadjustmentButton.Size = new System.Drawing.Size(153, 35);
this.preadjustmentButton.TabIndex = 3;
this.preadjustmentButton.Text = "Preadjustment";
this.preadjustmentButton.UseVisualStyleBackColor = true;
this.preadjustmentButton.Click += new System.EventHandler(this.preadjustmentButton_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.btnPulseSetup);
this.groupBox1.Controls.Add(this.btnSetup);
this.groupBox1.Controls.Add(this.btnRegisterStore);
this.groupBox1.Location = new System.Drawing.Point(6, 17);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(166, 153);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "GenesisToolBox";
//
// btnPulseSetup
//
this.btnPulseSetup.Location = new System.Drawing.Point(7, 101);
this.btnPulseSetup.Name = "btnPulseSetup";
this.btnPulseSetup.Size = new System.Drawing.Size(153, 35);
this.btnPulseSetup.TabIndex = 2;
this.btnPulseSetup.Text = "Pulse Setup";
this.btnPulseSetup.UseVisualStyleBackColor = true;
this.btnPulseSetup.Click += new System.EventHandler(this.btnPulseSetup_Click);
//
// btnSetup
//
this.btnSetup.Location = new System.Drawing.Point(7, 19);
this.btnSetup.Name = "btnSetup";
this.btnSetup.Size = new System.Drawing.Size(153, 35);
this.btnSetup.TabIndex = 0;
this.btnSetup.Text = "Setup";
this.btnSetup.UseVisualStyleBackColor = true;
this.btnSetup.Click += new System.EventHandler(this.btnSetup_Click);
//
// btnRegisterStore
//
this.btnRegisterStore.Location = new System.Drawing.Point(7, 60);
this.btnRegisterStore.Name = "btnRegisterStore";
this.btnRegisterStore.Size = new System.Drawing.Size(153, 35);
this.btnRegisterStore.TabIndex = 1;
this.btnRegisterStore.Text = "Register Store";
this.btnRegisterStore.UseVisualStyleBackColor = true;
this.btnRegisterStore.Click += new System.EventHandler(this.btnRegisterStore_Click);
//
// tabPage2
//
this.tabPage2.Controls.Add(this.groupBox3);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(178, 438);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "GCI API";
this.tabPage2.UseVisualStyleBackColor = true;
//
// pnlMain
//
this.pnlMain.Controls.Add(this.rtbMainLog);
this.pnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlMain.Location = new System.Drawing.Point(190, 24);
this.pnlMain.Name = "pnlMain";
this.pnlMain.Padding = new System.Windows.Forms.Padding(9);
this.pnlMain.Size = new System.Drawing.Size(1119, 474);
this.pnlMain.TabIndex = 2;
//
// rtbMainLog
//
this.rtbMainLog.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtbMainLog.Font = new System.Drawing.Font("Consolas", 10F);
this.rtbMainLog.Location = new System.Drawing.Point(9, 9);
this.rtbMainLog.Name = "rtbMainLog";
this.rtbMainLog.ReadOnly = true;
this.rtbMainLog.Size = new System.Drawing.Size(1101, 456);
this.rtbMainLog.TabIndex = 0;
this.rtbMainLog.Text = "";
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tslStatus});
this.statusStrip1.Location = new System.Drawing.Point(0, 498);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 12, 0);
this.statusStrip1.Size = new System.Drawing.Size(1309, 22);
this.statusStrip1.TabIndex = 3;
this.statusStrip1.Text = "statusStrip1";
//
// tslStatus
//
this.tslStatus.Name = "tslStatus";
this.tslStatus.Size = new System.Drawing.Size(39, 17);
this.tslStatus.Text = "Ready";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.button1);
this.groupBox3.Location = new System.Drawing.Point(6, 15);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(166, 66);
this.groupBox3.TabIndex = 6;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "GenesisCordonelInterface";
//
// button1
//
this.button1.Location = new System.Drawing.Point(6, 19);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(153, 35);
this.button1.TabIndex = 3;
this.button1.Text = "API";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1309, 520);
this.Controls.Add(this.pnlMain);
this.Controls.Add(this.pnlLeftMenu);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.MinimumSize = new System.Drawing.Size(774, 439);
this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Genesis Cordonel Interface";
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.pnlLeftMenu.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.pnlMain.ResumeLayout(false);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.Button btnSetup;
private System.Windows.Forms.Button preadjustmentButton;
private System.Windows.Forms.Button btnRegisterStore;
private System.Windows.Forms.Button btnPulseSetup;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Button button1;
}
}

View File

@ -0,0 +1,290 @@
using GenesisCordonelInterface.UI.LaatzenAPI_CordonelPreadjustmentUI;
using GenesisCordonelInterface.UI.StaraTuraAPI_GenesisCordonelInterface;
using System;
using System.Drawing;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Xylem.Common.Ui.GenesisToolBox;
using Xylem.Common.Utils.Logging;
namespace GenesisCordonelInterface.UI
{
public partial class MainForm : Form
{
private static readonly NLog.ILogger Logger = NLog.LogManager.GetLogger("GenesisCordonelInterface");
private static readonly Regex LogLevelRegex = new Regex(@"\|\s*(TRACE|DEBUG|INFO|WARN|ERROR|FATAL)\s*\|", RegexOptions.Compiled | RegexOptions.IgnoreCase);
public MainForm()
{
InitializeComponent();
/*_logger = logger;
_logger.MessagePublished += OnLogMessagePublished;*/
UiLogBus.MessageReceived += UiLogBus_MessageReceived;
//TopRight position on screen
this.StartPosition = FormStartPosition.Manual;
this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - this.Width, 0);
//black background
rtbMainLog.BackColor = Color.Black;
rtbMainLog.ForeColor = Color.Gainsboro;
rtbMainLog.Font = new Font("Consolas", 9f);
rtbMainLog.ReadOnly = true;
rtbMainLog.HideSelection = false;
}
private void UiLogBus_MessageReceived(string msg)
{
if (InvokeRequired)
{
BeginInvoke(new Action<string>(UiLogBus_MessageReceived), msg);
return;
}
string[] lines = msg.Replace("\r\n", "\n").Split('\n');
foreach (string originalLine in lines)
{
if (string.IsNullOrWhiteSpace(originalLine))
continue;
string line = originalLine;
// Find header (timestamp|LEVEL|)
Match m = LogLevelRegex.Match(line);
string indent = "";
if (m.Success)
{
int indentLength = m.Index + m.Length;
indent = new string(' ', indentLength);
}
// Split long message manually if needed (optional)
string[] subLines = line.Split(new[] { " - " }, 2, StringSplitOptions.None);
string firstLine = line;
string rest = null;
if (subLines.Length == 2 && subLines[1].Length > 120) // heuristic
{
firstLine = subLines[0] + " - " + subLines[1].Substring(0, 120);
rest = subLines[1].Substring(120);
}
AppendStyledLine(firstLine);
if (!string.IsNullOrEmpty(rest))
{
AppendStyledLine(indent + rest);
}
}
}
private void AppendStyledLine(string line)
{
int start = rtbMainLog.TextLength;
rtbMainLog.SelectionStart = start;
rtbMainLog.SelectionLength = 0;
rtbMainLog.SelectionColor = Color.Gainsboro;
rtbMainLog.AppendText(line + Environment.NewLine);
Match m = LogLevelRegex.Match(line);
if (m.Success)
{
rtbMainLog.SelectionStart = start + m.Index;
rtbMainLog.SelectionLength = m.Length;
rtbMainLog.SelectionColor = GetLogLevelColor(m.Groups[1].Value);
}
HighlightKeywordsInLine(line, start);
}
private int MeasureTextWidthPx(string text)
{
if (string.IsNullOrEmpty(text))
return 0;
return TextRenderer.MeasureText(text, rtbMainLog.Font).Width;
}
protected override void OnFormClosed(FormClosedEventArgs e)
{
//_logger.MessagePublished -= OnLogMessagePublished;
UiLogBus.MessageReceived -= UiLogBus_MessageReceived;
base.OnFormClosed(e);
}
private void btnSetup_Click(object sender, EventArgs e)
{
Logger.Trace("FORM: ---------------------------------");
Logger.Trace("FORM: Setup open");
using (FrmSetup frm = new FrmSetup())
{
frm.ShowDialog(this);
}
Logger.Trace("FORM: Setup closed.");
}
private void btnRegisterStore_Click(object sender, EventArgs e)
{
Logger.Trace("FORM: ---------------------------------");
Logger.Trace("FORM: Register Store open.");
using (FrmRegisterStore frm = new FrmRegisterStore())
{
frm.ShowDialog(this);
}
Logger.Trace("FORM: Register Store closed.");
}
private void btnPulseSetup_Click(object sender, EventArgs e)
{
Logger.Trace("FORM: ---------------------------------");
Logger.Trace("FORM: Pulse Setup open.");
using (FrmConfigurations frm = new FrmConfigurations())
{
frm.ShowDialog(this);
}
Logger.Trace("FORM: Pulse Setup closed.");
}
private void miExit_Click(object sender, EventArgs e)
{
this.Close();
}
private void miClearLog_Click(object sender, EventArgs e)
{
rtbMainLog.Clear();
Logger.Trace("Log cleared.");
}
private void miHelpAbout_Click(object sender, EventArgs e)
{
MessageBox.Show(
"Genesis Cordonel Tester",
"About",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
private Color GetLogLevelColor(string level)
{
switch (level.Trim().ToUpperInvariant())
{
case "TRACE": return Color.Gray;
case "DEBUG": return Color.DeepSkyBlue;
case "INFO": return Color.LimeGreen;
case "WARN": return Color.Orange;
case "ERROR": return Color.Red;
case "FATAL": return Color.Magenta;
default: return Color.Gainsboro;
}
}
private bool IsSeparatorLine(string text)
{
if (string.IsNullOrWhiteSpace(text))
return false;
string trimmed = text.Trim();
// Remove spaces and tab-like spacing
string compact = new string(trimmed.Where(c => !char.IsWhiteSpace(c)).ToArray());
if (compact.Length < 4)
return false;
// Count non-letter/non-digit characters
int nonAlnumCount = compact.Count(c => !char.IsLetterOrDigit(c));
// Consider it a separator if most characters are non-alphanumeric
// Examples:
// -----CommandToMeter()-----
// ==========================
// /////////
double ratio = (double)nonAlnumCount / compact.Length;
return ratio >= 0.6;
}
/// <summary>
/// special string highlighting
/// "TX FINAL" have to go before "TX"
/// else "TX" will highlighted in the middle of "TX FINAL"
/// </summary>
private static readonly (Color color, string[] keywords)[] KeywordGroups =
{
(Color.DeepSkyBlue, new[] { "REQUEST" }),
(Color.Lime, new[] { "RESPONSE" }),
//(Color.LightGreen, new[] { "START", "END" }),
//(Color.Cyan, new[] { "TX", "TX FINAL" }),
//(Color.DeepSkyBlue,new[] { "RX", "RX FINAL", "RX CHUNK" }),
(Color.Gold, new[] { "READ-REGISTER-SESSION", "UI-CLICK"}),
//(Color.Violet, new[] { "REGADDR" }),
//(Color.Khaki, new[] { "DEFAULT", "ALIGNED", "STRING" })
};
/// <summary>
/// special string highlighting
/// </summary>
/// <param name="line"></param>
/// <param name="lineStartIndex"></param>
private void HighlightKeywordsInLine(string line, int lineStartIndex)
{
foreach (var group in KeywordGroups)
{
foreach (var keyword in group.keywords)
{
int index = 0;
while ((index = line.IndexOf(keyword, index, StringComparison.Ordinal)) >= 0)
{
rtbMainLog.SelectionStart = lineStartIndex + index;
rtbMainLog.SelectionLength = keyword.Length;
rtbMainLog.SelectionColor = group.color;
index += keyword.Length;
}
}
}
}
private void preadjustmentButton_Click(object sender, EventArgs e)
{
Logger.Trace("FORM: ---------------------------------");
Logger.Trace("FORM: Preadjustment open.");
using (FrmCordonelPreadjustmentUI frm = new FrmCordonelPreadjustmentUI())
{
frm.ShowDialog(this);
}
Logger.Trace("FORM: Preadjustment closed.");
}
private void button1_Click(object sender, EventArgs e)
{
Logger.Trace("FORM: ---------------------------------");
Logger.Trace("FORM: GCI GUI interface open.");
using (FrmGCIAPI frm = new FrmGCIAPI())
{
frm.ShowDialog(this);
}
Logger.Trace("FORM: GCI GUI interface closed.");
}
}
}

View File

@ -0,0 +1,129 @@
<?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>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>65</value>
</metadata>
</root>

View File

@ -0,0 +1,383 @@
namespace GenesisCordonelInterface.UI.StaraTuraAPI_GenesisCordonelInterface
{
partial class FrmGCIAPI
{
/// <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.
/// </summary>
private void InitializeComponent()
{
this.lblSlot = new System.Windows.Forms.Label();
this.txtSlot = new System.Windows.Forms.TextBox();
this.lblConfigSource = new System.Windows.Forms.Label();
this.cmbConfigSource = new System.Windows.Forms.ComboBox();
this.lblPasswordSource = new System.Windows.Forms.Label();
this.cmbPasswordSource = new System.Windows.Forms.ComboBox();
this.lblRequestPort = new System.Windows.Forms.Label();
this.txtRequestPort = new System.Windows.Forms.TextBox();
this.lblRequestBaudRate = new System.Windows.Forms.Label();
this.txtRequestBaudRate = new System.Windows.Forms.TextBox();
this.lblStreamingPort = new System.Windows.Forms.Label();
this.txtStreamingPort = new System.Windows.Forms.TextBox();
this.lblStreamingBaudRate = new System.Windows.Forms.Label();
this.txtStreamingBaudRate = new System.Windows.Forms.TextBox();
this.lblRegister = new System.Windows.Forms.Label();
this.txtRegister = new System.Windows.Forms.TextBox();
this.lblValue = new System.Windows.Forms.Label();
this.txtValue = new System.Windows.Forms.TextBox();
this.lblPassword = new System.Windows.Forms.Label();
this.txtPassword = new System.Windows.Forms.TextBox();
this.btnInit = new System.Windows.Forms.Button();
this.btnConnectOne = new System.Windows.Forms.Button();
this.btnConnectAll = new System.Windows.Forms.Button();
this.btnDisconnect = new System.Windows.Forms.Button();
this.btnGetPcbId = new System.Windows.Forms.Button();
this.btnReadRegister = new System.Windows.Forms.Button();
this.btnWriteRegister = new System.Windows.Forms.Button();
this.btnSetPassword = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lblSlot
//
this.lblSlot.AutoSize = true;
this.lblSlot.Location = new System.Drawing.Point(20, 20);
this.lblSlot.Name = "lblSlot";
this.lblSlot.Size = new System.Drawing.Size(28, 13);
this.lblSlot.TabIndex = 0;
this.lblSlot.Text = "Slot:";
//
// txtSlot
//
this.txtSlot.Location = new System.Drawing.Point(150, 17);
this.txtSlot.Name = "txtSlot";
this.txtSlot.Size = new System.Drawing.Size(120, 20);
this.txtSlot.TabIndex = 1;
this.txtSlot.Text = "1";
//
// lblConfigSource
//
this.lblConfigSource.AutoSize = true;
this.lblConfigSource.Location = new System.Drawing.Point(20, 55);
this.lblConfigSource.Name = "lblConfigSource";
this.lblConfigSource.Size = new System.Drawing.Size(75, 13);
this.lblConfigSource.TabIndex = 2;
this.lblConfigSource.Text = "ConfigSource:";
//
// cmbConfigSource
//
this.cmbConfigSource.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbConfigSource.FormattingEnabled = true;
this.cmbConfigSource.Location = new System.Drawing.Point(150, 52);
this.cmbConfigSource.Name = "cmbConfigSource";
this.cmbConfigSource.Size = new System.Drawing.Size(180, 21);
this.cmbConfigSource.TabIndex = 3;
//
// lblPasswordSource
//
this.lblPasswordSource.AutoSize = true;
this.lblPasswordSource.Location = new System.Drawing.Point(20, 90);
this.lblPasswordSource.Name = "lblPasswordSource";
this.lblPasswordSource.Size = new System.Drawing.Size(88, 13);
this.lblPasswordSource.TabIndex = 4;
this.lblPasswordSource.Text = "PasswordSource:";
//
// cmbPasswordSource
//
this.cmbPasswordSource.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbPasswordSource.FormattingEnabled = true;
this.cmbPasswordSource.Location = new System.Drawing.Point(150, 87);
this.cmbPasswordSource.Name = "cmbPasswordSource";
this.cmbPasswordSource.Size = new System.Drawing.Size(180, 21);
this.cmbPasswordSource.TabIndex = 5;
//
// lblRequestPort
//
this.lblRequestPort.AutoSize = true;
this.lblRequestPort.Location = new System.Drawing.Point(20, 125);
this.lblRequestPort.Name = "lblRequestPort";
this.lblRequestPort.Size = new System.Drawing.Size(67, 13);
this.lblRequestPort.TabIndex = 6;
this.lblRequestPort.Text = "RequestPort:";
//
// txtRequestPort
//
this.txtRequestPort.Location = new System.Drawing.Point(150, 122);
this.txtRequestPort.Name = "txtRequestPort";
this.txtRequestPort.Size = new System.Drawing.Size(180, 20);
this.txtRequestPort.TabIndex = 7;
this.txtRequestPort.Text = "COM1";
//
// lblRequestBaudRate
//
this.lblRequestBaudRate.AutoSize = true;
this.lblRequestBaudRate.Location = new System.Drawing.Point(360, 125);
this.lblRequestBaudRate.Name = "lblRequestBaudRate";
this.lblRequestBaudRate.Size = new System.Drawing.Size(94, 13);
this.lblRequestBaudRate.TabIndex = 8;
this.lblRequestBaudRate.Text = "RequestBaudRate:";
//
// txtRequestBaudRate
//
this.txtRequestBaudRate.Location = new System.Drawing.Point(480, 122);
this.txtRequestBaudRate.Name = "txtRequestBaudRate";
this.txtRequestBaudRate.Size = new System.Drawing.Size(120, 20);
this.txtRequestBaudRate.TabIndex = 9;
this.txtRequestBaudRate.Text = "115200";
//
// lblStreamingPort
//
this.lblStreamingPort.AutoSize = true;
this.lblStreamingPort.Location = new System.Drawing.Point(20, 160);
this.lblStreamingPort.Name = "lblStreamingPort";
this.lblStreamingPort.Size = new System.Drawing.Size(74, 13);
this.lblStreamingPort.TabIndex = 10;
this.lblStreamingPort.Text = "StreamingPort:";
//
// txtStreamingPort
//
this.txtStreamingPort.Location = new System.Drawing.Point(150, 157);
this.txtStreamingPort.Name = "txtStreamingPort";
this.txtStreamingPort.Size = new System.Drawing.Size(180, 20);
this.txtStreamingPort.TabIndex = 11;
this.txtStreamingPort.Text = "COM2";
//
// lblStreamingBaudRate
//
this.lblStreamingBaudRate.AutoSize = true;
this.lblStreamingBaudRate.Location = new System.Drawing.Point(360, 160);
this.lblStreamingBaudRate.Name = "lblStreamingBaudRate";
this.lblStreamingBaudRate.Size = new System.Drawing.Size(101, 13);
this.lblStreamingBaudRate.TabIndex = 12;
this.lblStreamingBaudRate.Text = "StreamingBaudRate:";
//
// txtStreamingBaudRate
//
this.txtStreamingBaudRate.Location = new System.Drawing.Point(480, 157);
this.txtStreamingBaudRate.Name = "txtStreamingBaudRate";
this.txtStreamingBaudRate.Size = new System.Drawing.Size(120, 20);
this.txtStreamingBaudRate.TabIndex = 13;
this.txtStreamingBaudRate.Text = "115200";
//
// lblRegister
//
this.lblRegister.AutoSize = true;
this.lblRegister.Location = new System.Drawing.Point(20, 195);
this.lblRegister.Name = "lblRegister";
this.lblRegister.Size = new System.Drawing.Size(49, 13);
this.lblRegister.TabIndex = 14;
this.lblRegister.Text = "Register:";
//
// txtRegister
//
this.txtRegister.Location = new System.Drawing.Point(150, 192);
this.txtRegister.Name = "txtRegister";
this.txtRegister.Size = new System.Drawing.Size(450, 20);
this.txtRegister.TabIndex = 15;
this.txtRegister.Text = "GENESISFLOW_TriggerTest";
//
// lblValue
//
this.lblValue.AutoSize = true;
this.lblValue.Location = new System.Drawing.Point(20, 230);
this.lblValue.Name = "lblValue";
this.lblValue.Size = new System.Drawing.Size(37, 13);
this.lblValue.TabIndex = 16;
this.lblValue.Text = "Value:";
//
// txtValue
//
this.txtValue.Location = new System.Drawing.Point(150, 227);
this.txtValue.Name = "txtValue";
this.txtValue.Size = new System.Drawing.Size(450, 20);
this.txtValue.TabIndex = 17;
this.txtValue.Text = "1";
//
// lblPassword
//
this.lblPassword.AutoSize = true;
this.lblPassword.Location = new System.Drawing.Point(20, 265);
this.lblPassword.Name = "lblPassword";
this.lblPassword.Size = new System.Drawing.Size(56, 13);
this.lblPassword.TabIndex = 18;
this.lblPassword.Text = "Password:";
//
// txtPassword
//
this.txtPassword.Location = new System.Drawing.Point(150, 262);
this.txtPassword.Name = "txtPassword";
this.txtPassword.Size = new System.Drawing.Size(450, 20);
this.txtPassword.TabIndex = 19;
this.txtPassword.Text = "1234";
//
// btnInit
//
this.btnInit.Location = new System.Drawing.Point(23, 310);
this.btnInit.Name = "btnInit";
this.btnInit.Size = new System.Drawing.Size(180, 32);
this.btnInit.TabIndex = 20;
this.btnInit.Text = "Init One Meter From Extern";
this.btnInit.UseVisualStyleBackColor = true;
this.btnInit.Click += new System.EventHandler(this.btnInit_Click);
//
// btnConnectOne
//
this.btnConnectOne.Location = new System.Drawing.Point(220, 310);
this.btnConnectOne.Name = "btnConnectOne";
this.btnConnectOne.Size = new System.Drawing.Size(180, 32);
this.btnConnectOne.TabIndex = 21;
this.btnConnectOne.Text = "Connect One Meter";
this.btnConnectOne.UseVisualStyleBackColor = true;
this.btnConnectOne.Click += new System.EventHandler(this.btnConnectOne_Click);
//
// btnConnectAll
//
this.btnConnectAll.Location = new System.Drawing.Point(417, 310);
this.btnConnectAll.Name = "btnConnectAll";
this.btnConnectAll.Size = new System.Drawing.Size(180, 32);
this.btnConnectAll.TabIndex = 22;
this.btnConnectAll.Text = "Connect All Meters";
this.btnConnectAll.UseVisualStyleBackColor = true;
this.btnConnectAll.Click += new System.EventHandler(this.btnConnectAll_Click);
//
// btnDisconnect
//
this.btnDisconnect.Location = new System.Drawing.Point(23, 355);
this.btnDisconnect.Name = "btnDisconnect";
this.btnDisconnect.Size = new System.Drawing.Size(180, 32);
this.btnDisconnect.TabIndex = 23;
this.btnDisconnect.Text = "Disconnect";
this.btnDisconnect.UseVisualStyleBackColor = true;
this.btnDisconnect.Click += new System.EventHandler(this.btnDisconnect_Click);
//
// btnGetPcbId
//
this.btnGetPcbId.Location = new System.Drawing.Point(220, 355);
this.btnGetPcbId.Name = "btnGetPcbId";
this.btnGetPcbId.Size = new System.Drawing.Size(180, 32);
this.btnGetPcbId.TabIndex = 24;
this.btnGetPcbId.Text = "Get PCB ID";
this.btnGetPcbId.UseVisualStyleBackColor = true;
this.btnGetPcbId.Click += new System.EventHandler(this.btnGetPcbId_Click);
//
// btnReadRegister
//
this.btnReadRegister.Location = new System.Drawing.Point(417, 355);
this.btnReadRegister.Name = "btnReadRegister";
this.btnReadRegister.Size = new System.Drawing.Size(180, 32);
this.btnReadRegister.TabIndex = 25;
this.btnReadRegister.Text = "Read Register";
this.btnReadRegister.UseVisualStyleBackColor = true;
this.btnReadRegister.Click += new System.EventHandler(this.btnReadRegister_Click);
//
// btnWriteRegister
//
this.btnWriteRegister.Location = new System.Drawing.Point(23, 400);
this.btnWriteRegister.Name = "btnWriteRegister";
this.btnWriteRegister.Size = new System.Drawing.Size(180, 32);
this.btnWriteRegister.TabIndex = 26;
this.btnWriteRegister.Text = "Write Register";
this.btnWriteRegister.UseVisualStyleBackColor = true;
this.btnWriteRegister.Click += new System.EventHandler(this.btnWriteRegister_Click);
//
// btnSetPassword
//
this.btnSetPassword.Location = new System.Drawing.Point(220, 400);
this.btnSetPassword.Name = "btnSetPassword";
this.btnSetPassword.Size = new System.Drawing.Size(180, 32);
this.btnSetPassword.TabIndex = 27;
this.btnSetPassword.Text = "Set Meter Password";
this.btnSetPassword.UseVisualStyleBackColor = true;
this.btnSetPassword.Click += new System.EventHandler(this.btnSetPassword_Click);
//
// FrmGCIAPI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(624, 455);
this.Controls.Add(this.btnSetPassword);
this.Controls.Add(this.btnWriteRegister);
this.Controls.Add(this.btnReadRegister);
this.Controls.Add(this.btnGetPcbId);
this.Controls.Add(this.btnDisconnect);
this.Controls.Add(this.btnConnectAll);
this.Controls.Add(this.btnConnectOne);
this.Controls.Add(this.btnInit);
this.Controls.Add(this.txtPassword);
this.Controls.Add(this.lblPassword);
this.Controls.Add(this.txtValue);
this.Controls.Add(this.lblValue);
this.Controls.Add(this.txtRegister);
this.Controls.Add(this.lblRegister);
this.Controls.Add(this.txtStreamingBaudRate);
this.Controls.Add(this.lblStreamingBaudRate);
this.Controls.Add(this.txtStreamingPort);
this.Controls.Add(this.lblStreamingPort);
this.Controls.Add(this.txtRequestBaudRate);
this.Controls.Add(this.lblRequestBaudRate);
this.Controls.Add(this.txtRequestPort);
this.Controls.Add(this.lblRequestPort);
this.Controls.Add(this.cmbPasswordSource);
this.Controls.Add(this.lblPasswordSource);
this.Controls.Add(this.cmbConfigSource);
this.Controls.Add(this.lblConfigSource);
this.Controls.Add(this.txtSlot);
this.Controls.Add(this.lblSlot);
this.Name = "FrmGCIAPI";
this.Text = "GCI API Test Panel";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblSlot;
private System.Windows.Forms.TextBox txtSlot;
private System.Windows.Forms.Label lblConfigSource;
private System.Windows.Forms.ComboBox cmbConfigSource;
private System.Windows.Forms.Label lblPasswordSource;
private System.Windows.Forms.ComboBox cmbPasswordSource;
private System.Windows.Forms.Label lblRequestPort;
private System.Windows.Forms.TextBox txtRequestPort;
private System.Windows.Forms.Label lblRequestBaudRate;
private System.Windows.Forms.TextBox txtRequestBaudRate;
private System.Windows.Forms.Label lblStreamingPort;
private System.Windows.Forms.TextBox txtStreamingPort;
private System.Windows.Forms.Label lblStreamingBaudRate;
private System.Windows.Forms.TextBox txtStreamingBaudRate;
private System.Windows.Forms.Label lblRegister;
private System.Windows.Forms.TextBox txtRegister;
private System.Windows.Forms.Label lblValue;
private System.Windows.Forms.TextBox txtValue;
private System.Windows.Forms.Label lblPassword;
private System.Windows.Forms.TextBox txtPassword;
private System.Windows.Forms.Button btnInit;
private System.Windows.Forms.Button btnConnectOne;
private System.Windows.Forms.Button btnConnectAll;
private System.Windows.Forms.Button btnDisconnect;
private System.Windows.Forms.Button btnGetPcbId;
private System.Windows.Forms.Button btnReadRegister;
private System.Windows.Forms.Button btnWriteRegister;
private System.Windows.Forms.Button btnSetPassword;
}
}

View File

@ -0,0 +1,193 @@
using System;
using System.Windows.Forms;
using GenesisCordonelInterface.API;
using Xylem.Common.Hardware.Interfaces.Ports.PortCore;
using static Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.GenesisMeter;
namespace GenesisCordonelInterface.UI.StaraTuraAPI_GenesisCordonelInterface
{
public partial class FrmGCIAPI : Form
{
private readonly InterfaceOutsideToGCI _api = new InterfaceOutsideToGCI();
public FrmGCIAPI()
{
InitializeComponent();
InitializeDefaults();
}
private void InitializeDefaults()
{
cmbConfigSource.DataSource = Enum.GetValues(typeof(ConfigSource));
cmbPasswordSource.DataSource = Enum.GetValues(typeof(PasswordSource));
cmbConfigSource.SelectedItem = ConfigSource.ExternStorage;
cmbPasswordSource.SelectedItem = PasswordSource.OfflineFile;
}
private void ExecuteApiAction(Action action)
{
try
{
action();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "API call failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private int GetSlot()
{
if (!int.TryParse(txtSlot.Text, out int slot))
throw new Exception("Invalid slot number.");
return slot;
}
private object ParseValue(string input)
{
if (int.TryParse(input, out int intValue))
return intValue;
if (uint.TryParse(input, out uint uintValue))
return uintValue;
if (bool.TryParse(input, out bool boolValue))
return boolValue;
return input;
}
private PortConfig? CreatePortConfig(string portName, string baudRateText)
{
if (string.IsNullOrWhiteSpace(portName))
return null;
if (!int.TryParse(baudRateText, out int baudRate))
throw new Exception($"Invalid baud rate for port {portName}.");
var cfg = new PortConfig
{
PortName = portName,
Type = "Serial"
};
var sp = cfg.GetSerialPort();
if (sp == null)
throw new Exception($"Serial port object was not created for {portName}.");
sp.BaudRate = baudRate;
return cfg;
}
private ConfigSource GetConfigSource()
{
if (cmbConfigSource.SelectedItem == null)
throw new Exception("ConfigSource is not selected.");
return (ConfigSource)cmbConfigSource.SelectedItem;
}
private PasswordSource GetPasswordSource()
{
if (cmbPasswordSource.SelectedItem == null)
throw new Exception("PasswordSource is not selected.");
return (PasswordSource)cmbPasswordSource.SelectedItem;
}
private void btnInit_Click(object sender, EventArgs e)
{
ExecuteApiAction(() =>
{
int slot = GetSlot();
var requestPort = CreatePortConfig(txtRequestPort.Text, txtRequestBaudRate.Text);
var streamingPort = CreatePortConfig(txtStreamingPort.Text, txtStreamingBaudRate.Text);
_api.InitOneMeterFromExtern(
slot,
GetConfigSource(),
GetPasswordSource(),
requestPort,
streamingPort);
});
}
private void btnConnectOne_Click(object sender, EventArgs e)
{
ExecuteApiAction(() =>
{
_api.ConnectOneMeter(GetSlot());
});
}
private void btnConnectAll_Click(object sender, EventArgs e)
{
ExecuteApiAction(() =>
{
_api.ConnectAllMeters(GetSlot());
});
}
private void btnDisconnect_Click(object sender, EventArgs e)
{
ExecuteApiAction(() =>
{
_api.Disconnect();
});
}
private void btnGetPcbId_Click(object sender, EventArgs e)
{
ExecuteApiAction(() =>
{
_api.GetPcbId(GetSlot());
});
}
private void btnReadRegister_Click(object sender, EventArgs e)
{
ExecuteApiAction(() =>
{
string registerName = txtRegister.Text;
if (string.IsNullOrWhiteSpace(registerName))
throw new Exception("Register name is empty.");
_api.ReadRegister(registerName);
});
}
private void btnWriteRegister_Click(object sender, EventArgs e)
{
ExecuteApiAction(() =>
{
string registerName = txtRegister.Text;
string valueText = txtValue.Text;
if (string.IsNullOrWhiteSpace(registerName))
throw new Exception("Register name is empty.");
object value = ParseValue(valueText);
_api.WriteRegister(registerName, value, false, false);
});
}
private void btnSetPassword_Click(object sender, EventArgs e)
{
ExecuteApiAction(() =>
{
string password = txtPassword.Text;
if (string.IsNullOrWhiteSpace(password))
throw new Exception("Password is empty.");
_api.SetMeterPassword(password);
});
}
}
}

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>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<extensions>
<add assembly="Xylem.Common.Utils.Logging" />
</extensions>
<targets>
<target name="uiTrace"
xsi:type="UiTarget"
layout="${time}|${level:uppercase=true:padding=-5}|${message}" />
<target name="logfile"
xsi:type="File"
fileName="${basedir}/GenesisCordonelInterfaceLogger.log"
layout="${longdate}|${level:uppercase=true:padding=-5}|${logger}|${message}|${exception:format=tostring}" />
</targets>
<rules>
<logger name="GenesisCordonelInterface*" minlevel="Trace" writeTo="uiTrace" />
<logger name="GenesisCordonelInterface*" minlevel="Trace" writeTo="logfile" />
</rules>
</nlog>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
<package id="NLog" version="5.2.2" targetFramework="net48" />
</packages>

View File

@ -123,7 +123,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NfcC7_DLL", "NfcC7_DLL\NfcC
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NfcC7_DLL.Tests", "NfcC7_DLL.Tests\NfcC7_DLL.Tests.csproj", "{715605C5-568B-48D6-9C09-2DC5F2E81F66}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenesisCordonelInterface", "GenesisCordonelTester\GenesisCordonelInterface.csproj", "{C955D8AC-76B8-42D8-A83F-8AEB56CF2567}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenesisCordonelInterface", "GenesisCordonelInterface\GenesisCordonelInterface.csproj", "{C955D8AC-76B8-42D8-A83F-8AEB56CF2567}"
ProjectSection(ProjectDependencies) = postProject
{04201E95-90A0-4B73-A72F-379739B2A3AE} = {04201E95-90A0-4B73-A72F-379739B2A3AE}
{1B02C79E-0B19-43E2-8F6B-71EF0C786C97} = {1B02C79E-0B19-43E2-8F6B-71EF0C786C97}

View File

@ -24,7 +24,7 @@ namespace TBF.Rig.BridgeComponents.GciBridge
public IComponentCfg DefaultConfig()
{
return new GciBridgeCfg("GCI", this);
return new GciBridgeCfg("GCI Bridge", this);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)

View File

@ -5,8 +5,10 @@ using System;
using System.Collections.Generic;
using log4net;
using TBF.Rig.Generic;
using UdsReaderType = TBF.Rig.Input.DataStorage.UniDataStorageReader.UniDataStorageReader;
using UdsWriterType = TBF.Rig.Output.DataStorage.UniDataStorageWriter.UniDataStorageWriter;
using UdsReaderType = TBF.Rig.Input.DataStorage.UniDataStorageReader.Reader;
using UdsWriterType = TBF.Rig.Output.DataStorage.UniDataStorageWriter.Writer;
using ExternalInterfaceType = GenesisCordonelInterface.API.InterfaceOutsideToGCI;
using ExternalInterfaceGUIType = GenesisCordonelInterface.UI.MainForm;
namespace TBF.Rig.BridgeComponents.GciBridge
{
@ -35,17 +37,17 @@ namespace TBF.Rig.BridgeComponents.GciBridge
/// Placeholder for GCI GUI entry point.
/// Replace object with real GCI MainForm type later.
/// </summary>
object gciMainForm;
ExternalInterfaceGUIType gciGUI;
/// <summary>
/// Placeholder for GCI external/public interface.
/// Replace object with real GCI interface type later.
/// </summary>
object gciExternalInterface;
ExternalInterfaceType gciExternalInterface;
public bool HasReader { get { return reader != null; } }
public bool HasWriter { get { return writer != null; } }
public bool IsGuiInitialized { get { return gciMainForm != null; } }
public bool IsGuiInitialized { get { return gciGUI != null; } }
public bool IsExternalInitialized { get { return gciExternalInterface != null; } }
public GciBridge() { }
@ -97,9 +99,10 @@ namespace TBF.Rig.BridgeComponents.GciBridge
{
try
{
/// TODO:
/// Replace with real GCI MainForm initialization.
gciMainForm = new object();
using (gciGUI = new ExternalInterfaceGUIType())
{
gciGUI.ShowDialog(/*this*/);
}
log.InfoFormat("{0}: GCI GUI initialized.", Name);
}
@ -117,9 +120,7 @@ namespace TBF.Rig.BridgeComponents.GciBridge
{
try
{
/// TODO:
/// Replace with real GCI external interface initialization.
gciExternalInterface = new object();
gciExternalInterface = new ExternalInterfaceType();
log.InfoFormat("{0}: GCI external interface initialized.", Name);
}
@ -141,8 +142,6 @@ namespace TBF.Rig.BridgeComponents.GciBridge
TryInitializeGui();
}
/// TODO:
/// Replace with real MainForm.Show() call.
log.InfoFormat("{0}: ShowGui invoked.", Name);
}
@ -154,8 +153,10 @@ namespace TBF.Rig.BridgeComponents.GciBridge
if (!gciBridgeCfg.EnableGuiAccess) return;
if (!IsGuiInitialized) return;
/// TODO:
/// Replace with real MainForm.Hide() call.
using (gciGUI)
{
gciGUI.Hide(/*this*/);
}
log.InfoFormat("{0}: HideGui invoked.", Name);
}

View File

@ -69,7 +69,7 @@
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(139, 40);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
this.nameTextBox.Size = new System.Drawing.Size(290, 20);
this.nameTextBox.TabIndex = 2;
//
// readerNameLabel
@ -77,7 +77,7 @@
this.readerNameLabel.AutoSize = true;
this.readerNameLabel.Location = new System.Drawing.Point(28, 70);
this.readerNameLabel.Name = "readerNameLabel";
this.readerNameLabel.Size = new System.Drawing.Size(70, 13);
this.readerNameLabel.Size = new System.Drawing.Size(73, 13);
this.readerNameLabel.TabIndex = 3;
this.readerNameLabel.Text = "Reader Name";
//
@ -87,7 +87,7 @@
this.readerNameComboBox.FormattingEnabled = true;
this.readerNameComboBox.Location = new System.Drawing.Point(139, 67);
this.readerNameComboBox.Name = "readerNameComboBox";
this.readerNameComboBox.Size = new System.Drawing.Size(130, 21);
this.readerNameComboBox.Size = new System.Drawing.Size(465, 21);
this.readerNameComboBox.TabIndex = 4;
//
// writerNameLabel
@ -95,7 +95,7 @@
this.writerNameLabel.AutoSize = true;
this.writerNameLabel.Location = new System.Drawing.Point(28, 97);
this.writerNameLabel.Name = "writerNameLabel";
this.writerNameLabel.Size = new System.Drawing.Size(67, 13);
this.writerNameLabel.Size = new System.Drawing.Size(66, 13);
this.writerNameLabel.TabIndex = 5;
this.writerNameLabel.Text = "Writer Name";
//
@ -105,7 +105,7 @@
this.writerNameComboBox.FormattingEnabled = true;
this.writerNameComboBox.Location = new System.Drawing.Point(139, 94);
this.writerNameComboBox.Name = "writerNameComboBox";
this.writerNameComboBox.Size = new System.Drawing.Size(130, 21);
this.writerNameComboBox.Size = new System.Drawing.Size(465, 21);
this.writerNameComboBox.TabIndex = 6;
//
// enableGuiCheckBox
@ -114,7 +114,7 @@
this.enableGuiCheckBox.Enabled = false;
this.enableGuiCheckBox.Location = new System.Drawing.Point(31, 129);
this.enableGuiCheckBox.Name = "enableGuiCheckBox";
this.enableGuiCheckBox.Size = new System.Drawing.Size(114, 17);
this.enableGuiCheckBox.Size = new System.Drawing.Size(118, 17);
this.enableGuiCheckBox.TabIndex = 7;
this.enableGuiCheckBox.Text = "Enable GUI access";
this.enableGuiCheckBox.UseVisualStyleBackColor = true;
@ -125,7 +125,7 @@
this.enableExternalCheckBox.Enabled = false;
this.enableExternalCheckBox.Location = new System.Drawing.Point(31, 152);
this.enableExternalCheckBox.Name = "enableExternalCheckBox";
this.enableExternalCheckBox.Size = new System.Drawing.Size(134, 17);
this.enableExternalCheckBox.Size = new System.Drawing.Size(136, 17);
this.enableExternalCheckBox.TabIndex = 8;
this.enableExternalCheckBox.Text = "Enable external access";
this.enableExternalCheckBox.UseVisualStyleBackColor = true;
@ -136,7 +136,7 @@
this.showGuiOnInitializeCheckBox.Enabled = false;
this.showGuiOnInitializeCheckBox.Location = new System.Drawing.Point(31, 175);
this.showGuiOnInitializeCheckBox.Name = "showGuiOnInitializeCheckBox";
this.showGuiOnInitializeCheckBox.Size = new System.Drawing.Size(132, 17);
this.showGuiOnInitializeCheckBox.Size = new System.Drawing.Size(129, 17);
this.showGuiOnInitializeCheckBox.TabIndex = 9;
this.showGuiOnInitializeCheckBox.Text = "Show GUI on initialize";
this.showGuiOnInitializeCheckBox.UseVisualStyleBackColor = true;
@ -146,7 +146,7 @@
this.externalTypeNameLabel.AutoSize = true;
this.externalTypeNameLabel.Location = new System.Drawing.Point(28, 205);
this.externalTypeNameLabel.Name = "externalTypeNameLabel";
this.externalTypeNameLabel.Size = new System.Drawing.Size(103, 13);
this.externalTypeNameLabel.Size = new System.Drawing.Size(105, 13);
this.externalTypeNameLabel.TabIndex = 10;
this.externalTypeNameLabel.Text = "External type / name";
//
@ -155,16 +155,16 @@
this.externalTypeNameTextBox.Enabled = false;
this.externalTypeNameTextBox.Location = new System.Drawing.Point(139, 202);
this.externalTypeNameTextBox.Name = "externalTypeNameTextBox";
this.externalTypeNameTextBox.Size = new System.Drawing.Size(130, 20);
this.externalTypeNameTextBox.Size = new System.Drawing.Size(290, 20);
this.externalTypeNameTextBox.TabIndex = 11;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.connectExternalButton);
this.groupBox1.Controls.Add(this.showGuiButton);
this.groupBox1.Location = new System.Drawing.Point(10, 527);
this.groupBox1.Location = new System.Drawing.Point(31, 241);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(280, 60);
this.groupBox1.Size = new System.Drawing.Size(573, 60);
this.groupBox1.TabIndex = 12;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "GCI bridge";
@ -181,7 +181,7 @@
//
// showGuiButton
//
this.showGuiButton.Location = new System.Drawing.Point(160, 19);
this.showGuiButton.Location = new System.Drawing.Point(449, 19);
this.showGuiButton.Name = "showGuiButton";
this.showGuiButton.Size = new System.Drawing.Size(107, 28);
this.showGuiButton.TabIndex = 1;
@ -207,7 +207,7 @@
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "GciBridgeCfgCtrl";
this.Size = new System.Drawing.Size(300, 700);
this.Size = new System.Drawing.Size(618, 323);
this.Load += new System.EventHandler(this.GciBridgeCfgCtrl_Load);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);

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>

View File

@ -3232,6 +3232,9 @@
</Compile>
<Compile Include="UI\TestProgressControls.cs" />
<Compile Include="Utils.cs" />
<EmbeddedResource Include="Rig\BridgeComponents\GciBridge\GciBridgeCfgCtrl.resx">
<DependentUpon>GciBridgeCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Rig\BuiltIn\PumpTandem\PumpCfgCtrl.resx">
<DependentUpon>PumpCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
@ -4349,7 +4352,7 @@
<Project>{32817bf9-e380-4467-9c7f-936f4b122bc7}</Project>
<Name>GenCode128</Name>
</ProjectReference>
<ProjectReference Include="..\GenesisCordonelTester\GenesisCordonelInterface.csproj">
<ProjectReference Include="..\GenesisCordonelInterface\GenesisCordonelInterface.csproj">
<Project>{c955d8ac-76b8-42d8-a83f-8aeb56cf2567}</Project>
<Name>GenesisCordonelInterface</Name>
</ProjectReference>