Compare commits
45
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19ff06b01e | ||
|
|
d73eac8332 | ||
|
|
63041c0fc9 | ||
|
|
77c131f414 | ||
|
|
4173512ecc | ||
|
|
c991d530d5 | ||
|
|
2ba0bfe2b1 | ||
|
|
13490009a3 | ||
|
|
c6849deaef | ||
|
|
0b7dd2bafa | ||
|
|
2d8cc912a3 | ||
|
|
0b246b2ff5 | ||
|
|
8b025a0fca | ||
|
|
0f407920ac | ||
|
|
347a8798b8 | ||
|
|
3cd488fc76 | ||
|
|
e88e441875 | ||
|
|
89cfcb75e8 | ||
|
|
db90a096e3 | ||
|
|
6f919ede9b | ||
|
|
44b6060113 | ||
|
|
fde090c437 | ||
|
|
0af975f670 | ||
|
|
6d0d2cd34e | ||
|
|
d9a14ea3e1 | ||
|
|
2526e997e3 | ||
|
|
d346dcfa03 | ||
|
|
8437952478 | ||
|
|
34bf5d5473 | ||
|
|
6c4c7e73bb | ||
|
|
f97c406ae8 | ||
|
|
9cfadb8075 | ||
|
|
1709ef842d | ||
|
|
8e694dc910 | ||
|
|
0b1e09e0df | ||
|
|
84307f4bf4 | ||
|
|
463fb16b23 | ||
|
|
b4c0384b57 | ||
|
|
f4b8e42f59 | ||
|
|
abee5fa6b1 | ||
|
|
b8926ef93f | ||
|
|
502804c2de | ||
|
|
296621a590 | ||
|
|
cfc52f195b | ||
|
|
68a1eb9941 |
@@ -8,7 +8,7 @@
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>AppDiagnostic</RootNamespace>
|
||||
<AssemblyName>AppDiagnostic</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
@@ -102,4 +102,4 @@
|
||||
<None Include="Resources\TBF_icon.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Common</RootNamespace>
|
||||
<AssemblyName>Common</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@@ -114,4 +114,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Config</RootNamespace>
|
||||
<AssemblyName>Config</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
@@ -150,4 +150,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DataMatrix4Net</RootNamespace>
|
||||
<AssemblyName>DataMatrix4Net</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
@@ -58,4 +58,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DataStreamInterface</RootNamespace>
|
||||
<AssemblyName>DataStreamInterface</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
@@ -61,4 +61,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Decrypt</RootNamespace>
|
||||
<AssemblyName>Decrypt</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
@@ -63,4 +63,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DeviceTest</RootNamespace>
|
||||
<AssemblyName>DeviceTest</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
@@ -114,4 +114,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Dirichlet.Numerics</RootNamespace>
|
||||
<AssemblyName>Dirichlet.Numerics</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
@@ -51,4 +51,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Encrypt</RootNamespace>
|
||||
<AssemblyName>Encrypt</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
@@ -63,4 +63,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>EventViewer</RootNamespace>
|
||||
<AssemblyName>EventViewer</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@@ -142,4 +142,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>FeatureVectorCalculator</RootNamespace>
|
||||
<AssemblyName>FeatureVectorCalculator</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@@ -97,4 +97,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
@@ -28,7 +28,7 @@
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
@@ -180,4 +180,4 @@
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
@@ -35,7 +35,7 @@
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
@@ -146,4 +146,4 @@
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>GenericTest</RootNamespace>
|
||||
<AssemblyName>GenericTest</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
@@ -160,4 +160,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Xylem.Common.Hardware.Interfaces.Ports.PortCore;
|
||||
using static GenesisCordonelInterface.API.InterfaceOutsideToGCI;
|
||||
using static Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.GenesisMeter;
|
||||
|
||||
namespace GenesisCordonelInterface.API
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?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>
|
||||
@@ -35,6 +35,12 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Common">
|
||||
<HintPath>..\packages\Common\Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Logic.ProductionToProductMapper">
|
||||
<HintPath>..\packages\Common\Logic.ProductionToProductMapper.dll</HintPath>
|
||||
</Reference>
|
||||
<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>
|
||||
@@ -54,6 +60,57 @@
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Xylem.Common.CommonCore">
|
||||
<HintPath>..\packages\Common\Xylem.Common.CommonCore.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.CommonCore.Configuration">
|
||||
<HintPath>..\packages\Common\Xylem.Common.CommonCore.Configuration.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.CommonCore.ThreadWatcher">
|
||||
<HintPath>..\packages\Common\Xylem.Common.CommonCore.ThreadWatcher.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Hardware.Interfaces.Ports.PortCore">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Hardware.Interfaces.Ports.PortCore.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Hardware.Interfaces.Ports.SerialPorts">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Hardware.Interfaces.Ports.SerialPorts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Hardware.WaterMeter.Genesis.Applications">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.Applications.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Hardware.WaterMeter.Genesis.Registers">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.Registers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.RequestProtocol">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.RequestProtocol.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Hardware.WaterMeter.WaterMeterCore">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Hardware.WaterMeter.WaterMeterCore.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Logic.ProductionOrderCore">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Logic.ProductionOrderCore.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Logic.SoftwareAccessHelper">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Logic.SoftwareAccessHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Utils.ByteArrayStyle">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Utils.ByteArrayStyle.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Utils.Crc16Ccitt">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Utils.Crc16Ccitt.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Utils.Logging">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Utils.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Utils.ProcessExec">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Utils.ProcessExec.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="API\ModelsMapping.cs" />
|
||||
@@ -245,74 +302,18 @@
|
||||
<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>
|
||||
<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 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\Ui\GenesisToolBox\GenesisToolBox.csproj">
|
||||
<Project>{95a50087-99ee-4349-9a17-c547290db42f}</Project>
|
||||
<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 custom GCI runtime packaging logic -->
|
||||
<Import Project="RuntimePackage\Build\Copy.targets.xml" />
|
||||
|
||||
+2
-2
@@ -1,5 +1,4 @@
|
||||
using CordonelPreadjustmentUi;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
@@ -14,6 +13,7 @@ using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
|
||||
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
|
||||
using Xylem.Common.Ui.CordonelPreadjustmentUi;
|
||||
using CordonelPreadjustmentUi;
|
||||
using static Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.GenesisMeter;
|
||||
using System.Linq;//...MF
|
||||
|
||||
|
||||
@@ -14,12 +14,11 @@ 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;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig;
|
||||
|
||||
namespace GenesisCordonelInterface.UI.LaatzenAPI_GenesisToolBox
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ClassLibrary1</RootNamespace>
|
||||
<AssemblyName>GraphLib</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
@@ -115,4 +115,4 @@
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>LabelPrinting</RootNamespace>
|
||||
<AssemblyName>LabelPrinting</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@@ -174,4 +174,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MergeResultsDBs</RootNamespace>
|
||||
<AssemblyName>MergeResultsDBs</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@@ -82,4 +82,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OrderManagement</RootNamespace>
|
||||
<AssemblyName>OrderManagement</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@@ -179,4 +179,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ProductionTracing</RootNamespace>
|
||||
<AssemblyName>ProductionTracing</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
@@ -204,4 +204,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>RecordProcessing</RootNamespace>
|
||||
<AssemblyName>RFPowerCommon</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@@ -81,4 +81,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ResetBatchNr</RootNamespace>
|
||||
<AssemblyName>ResetBatchNr</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@@ -66,4 +66,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?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>
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>RestClient</RootNamespace>
|
||||
<AssemblyName>RestClient</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@@ -56,4 +56,4 @@
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -188,6 +188,15 @@ namespace Results
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public MeterTestRslt GetEachMeterTestRslt(string name, int wmNr0, CompoundMeterId meterId)
|
||||
{
|
||||
if (Batch.WaterMeters != null && Batch.WaterMeters.Count > wmNr0)
|
||||
{
|
||||
return Batch.WaterMeters[wmNr0].GetMeterTestRslt(name, meterId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
+70
-2
@@ -11,6 +11,7 @@ using NHibernate.Cfg;
|
||||
using NHibernate.Tool.hbm2ddl;
|
||||
using Common;
|
||||
using Results.Entities;
|
||||
using Results.Entities.helpers;
|
||||
|
||||
namespace Results
|
||||
{
|
||||
@@ -107,7 +108,11 @@ namespace Results
|
||||
throw new Exception("Connection string was not specified");
|
||||
}
|
||||
|
||||
if (SessionFactory == null) SessionFactory = CreateSessionFactory();
|
||||
if (SessionFactory == null)
|
||||
{
|
||||
DatabaseMigrationHelper.EnsureSchema(dbType, connectionString);
|
||||
SessionFactory = CreateSessionFactory();
|
||||
}
|
||||
|
||||
return SessionFactory.OpenSession();
|
||||
}
|
||||
@@ -267,9 +272,17 @@ namespace Results
|
||||
{
|
||||
log.Debug(tstRslt.ToString(1));
|
||||
}
|
||||
|
||||
|
||||
// Save batch, TestRslt, WaterMeter, MeterTestRslt, etc.
|
||||
session.SaveOrUpdate(batch);
|
||||
|
||||
// Important: after this, TestRslt.Id should be generated
|
||||
session.Flush();
|
||||
|
||||
// Optional table support
|
||||
SolveSaveCalibFactors(batch, session);
|
||||
|
||||
//Commit - store results
|
||||
transaction.Commit();
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -290,6 +303,52 @@ namespace Results
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void SolveSaveCalibFactors(Batch batch, ISession session)
|
||||
{
|
||||
bool hasCalibrationFactors = false;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
foreach (var tstRslt in batch.TestRslts)
|
||||
{
|
||||
if (tstRslt.CalibFactorResultsToSave != null &&
|
||||
tstRslt.CalibFactorResultsToSave.Count > 0)
|
||||
{
|
||||
hasCalibrationFactors = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasCalibrationFactors)
|
||||
{
|
||||
TestRsltCalibFactorHelper.CreateTableIfNotExists(session);
|
||||
|
||||
foreach (var tstRslt in batch.TestRslts)
|
||||
{
|
||||
if (tstRslt.CalibFactorResultsToSave == null ||
|
||||
tstRslt.CalibFactorResultsToSave.Count == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
TestRsltCalibFactorHelper.DeleteByTestRsltIdNoTransaction(session, tstRslt.Id);
|
||||
|
||||
foreach (var calib in tstRslt.CalibFactorResultsToSave)
|
||||
{
|
||||
calib.TestRslt = tstRslt;
|
||||
calib.ErrorStr = TestRsltCalibFactorHelper.Truncate(calib.ErrorStr, 240);
|
||||
|
||||
session.SaveOrUpdate(calib);
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch(Exception exc)
|
||||
{
|
||||
log.ErrorFormat("DB - Cannot save calibration factors: {0}", exc.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static Batch LoadBatch(int batchNr)
|
||||
{
|
||||
@@ -316,6 +375,15 @@ namespace Results
|
||||
batch.WaterMeters = session.QueryOver<WaterMeter>()
|
||||
.Where(x => (x.Batch.Id == batch.Id))
|
||||
.List();
|
||||
|
||||
TestRsltCalibFactorHelper.CreateTableIfNotExists(session);
|
||||
|
||||
foreach (var tstRslt in batch.TestRslts)
|
||||
{
|
||||
tstRslt.CalibFactorResultsToSave = TestRsltCalibFactorHelper.GetByTestRsltId( session, tstRslt.Id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return (batches.Count > 0) ? batches[0] : null;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
namespace Results.Entities
|
||||
{
|
||||
public class MeterTestCalibFactorRslt
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
|
||||
public virtual MeterTestRslt MeterTestRslt { get; set; }
|
||||
|
||||
/// 1, 2, 3 - calculated calib factor index
|
||||
public virtual int CalibFactorIndex { get; set; }
|
||||
|
||||
/// Base calib factor originally set in meter
|
||||
public virtual int BaseCalibFactor { get; set; }
|
||||
|
||||
/// Newly calculated calib factor
|
||||
public virtual int CalculatedCalibFactor { get; set; }
|
||||
|
||||
/// true = calculated value was stored/written to meter
|
||||
public virtual bool Stored { get; set; }
|
||||
|
||||
public virtual string ErrorStr { get; set; } // max 240 chars
|
||||
|
||||
public virtual double TimeStart { get; set; }
|
||||
public virtual double TimeEnd { get; set; }
|
||||
|
||||
public virtual double CalibRawStart { get; set; }
|
||||
public virtual double CalibRawEnd { get; set; }
|
||||
|
||||
public virtual double Error { get; set; }
|
||||
|
||||
public MeterTestCalibFactorRslt()
|
||||
{
|
||||
Stored = false;
|
||||
ErrorStr = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,11 @@ namespace Results.Entities
|
||||
#endif
|
||||
|
||||
public virtual WaterMeter WaterMeter { get; set; } /// reference to the WaterMeter entity
|
||||
public virtual TestRslt TestRslt { get; set; } /// reference to the TestRslt entity
|
||||
public virtual TestRslt TestRslt { get; set; }
|
||||
|
||||
/// reference to the TestRslt entity
|
||||
|
||||
public virtual int Q3Channel { get; set; }
|
||||
|
||||
/// Wrappers
|
||||
public virtual string Name() { return TestRslt.Name(); }
|
||||
@@ -97,6 +101,7 @@ namespace Results.Entities
|
||||
|
||||
public virtual WaterMeterData WaterMeterData() { return WaterMeter.WaterMeterData; }
|
||||
public virtual Batch Batch() { return WaterMeter.Batch; }
|
||||
|
||||
|
||||
public virtual bool IsPilotRslt()
|
||||
{
|
||||
|
||||
@@ -151,6 +151,11 @@ namespace Results.Entities
|
||||
public virtual int Counter3 { get; set; }
|
||||
public virtual int Counter4 { get; set; }
|
||||
public virtual int Counter5 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Not maped table - exist only in Genesis DB !!
|
||||
/// </summary>
|
||||
public virtual IList<TestRsltCalibFactor> CalibFactorResultsToSave { get; set; }
|
||||
|
||||
/// Wrappers
|
||||
public virtual string Name() { return Common.Utils.GetTestName(TestData.Name, TestData.Repeats, RepetitionNr); }
|
||||
@@ -266,15 +271,27 @@ namespace Results.Entities
|
||||
|
||||
MethodClass = string.Empty;
|
||||
Remark = string.Empty;
|
||||
|
||||
CalibFactorResultsToSave = new List<TestRsltCalibFactor>();
|
||||
}
|
||||
|
||||
public TestRslt(Batch batch, TestData testData, int part, int repetitionNr)
|
||||
public TestRslt(
|
||||
Batch batch,
|
||||
TestData testData,
|
||||
int part,
|
||||
int repetitionNr)
|
||||
: this(batch, testData, part, repetitionNr, null)
|
||||
{
|
||||
}
|
||||
|
||||
public TestRslt(Batch batch, TestData testData, int part, int repetitionNr, List<TestRsltCalibFactor> calibFactor)
|
||||
: this()
|
||||
{
|
||||
Batch = batch;
|
||||
TestData = testData;
|
||||
Part = part;
|
||||
RepetitionNr = repetitionNr;
|
||||
CalibFactorResultsToSave = calibFactor != null ? new List<TestRsltCalibFactor>(calibFactor) : new List<TestRsltCalibFactor>();
|
||||
}
|
||||
|
||||
public virtual void CopyContentFrom(TestRslt src)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
namespace Results.Entities
|
||||
{
|
||||
public class TestRsltCalibFactor
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
|
||||
public virtual TestRslt TestRslt { get; set; }
|
||||
|
||||
public virtual int CalibFactorIndex { get; set; } // 1, 2, 3
|
||||
|
||||
public virtual bool IsCalibFactorValid { get; set; }
|
||||
|
||||
public virtual int BaseCalibFactor { get; set; }
|
||||
public virtual int CalculatedCalibFactor { get; set; }
|
||||
|
||||
public virtual bool Stored { get; set; }
|
||||
|
||||
public virtual string ErrorStr { get; set; } // varchar(240)
|
||||
|
||||
public virtual double TimeStart { get; set; }
|
||||
public virtual double TimeEnd { get; set; }
|
||||
|
||||
public virtual double CalibRawStart { get; set; }
|
||||
public virtual double CalibRawEnd { get; set; }
|
||||
|
||||
public virtual double Error { get; set; }
|
||||
public virtual double VolumeStart { get; set; }
|
||||
public virtual double VolumeEnd { get; set; }
|
||||
|
||||
public TestRsltCalibFactor()
|
||||
{
|
||||
Stored = false;
|
||||
ErrorStr = string.Empty;
|
||||
IsCalibFactorValid = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,6 +110,9 @@ namespace Results.Entities
|
||||
public virtual string Workflow { get; set; } /// Not mapped to DB !!! Production tracing workflow name
|
||||
public virtual bool LastRecordIsNok { get; set; } /// Not mapped to DB !!! Previous record verification result
|
||||
public virtual bool PrintLabel { get; set; } /// Not mapped to DB !!!
|
||||
|
||||
/// mapped to DB !!! Q3 channel number
|
||||
public virtual int Q3Channel { get; set; }
|
||||
|
||||
public virtual WaterMeterData WaterMeterData { get; set; }
|
||||
public virtual Batch Batch { get; set; }
|
||||
@@ -493,6 +496,7 @@ namespace Results.Entities
|
||||
FWVersion = string.Empty;
|
||||
#endif
|
||||
PrintLabel = true;
|
||||
Q3Channel = 0; //No Q3 calibration by default
|
||||
}
|
||||
|
||||
|
||||
@@ -556,7 +560,8 @@ namespace Results.Entities
|
||||
Workflow = src.Workflow; /// Not mapped to DB
|
||||
LastRecordIsNok = src.LastRecordIsNok; /// Not mapped to DB
|
||||
PrintLabel = src.PrintLabel; /// Not mapped to DB
|
||||
|
||||
Q3Channel = src.Q3Channel; /// Mapped to DB
|
||||
|
||||
foreach (var mtr in MeterTestRslts)
|
||||
{
|
||||
MeterTestRslt srcMtr = src.GetMeterTestRslt(mtr.Name(), (CompoundMeterId)mtr.CompoundMeterId);
|
||||
@@ -597,9 +602,10 @@ namespace Results.Entities
|
||||
foreach (var mtr in MeterTestRslts)
|
||||
{
|
||||
if ((mtr.CompoundMeterId == (byte)CompoundMeterId.Single || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound || mtr.CompoundMeterId == (byte)CompoundMeterId.HeatMeterEnergy)
|
||||
&& mtr.TestDone
|
||||
&& (mtr.Q3Channel != 0 ||
|
||||
(mtr.TestDone
|
||||
&& (mtr.Publish() != Publish.Never)
|
||||
&& (mtr.Publish() != Publish.Internal))
|
||||
&& (mtr.Publish() != Publish.Internal))))
|
||||
{
|
||||
testNames.Add(mtr.Name());
|
||||
}
|
||||
@@ -771,6 +777,10 @@ namespace Results.Entities
|
||||
{
|
||||
MeterTestRslts[i].WriteBinary(writer);
|
||||
}
|
||||
|
||||
//New Q3 calibration adds
|
||||
writer.Write(2);//version number
|
||||
writer.Write(Q3Channel);
|
||||
}
|
||||
|
||||
public virtual void ReadBinary(BinaryReader reader, IList<WaterMeterData> wmDatasRetrievedSoFar, IList<TestRslt> testRslts)
|
||||
@@ -879,6 +889,13 @@ namespace Results.Entities
|
||||
mtr.ReadBinary(reader, testRslts);
|
||||
MeterTestRslts.Add(mtr);
|
||||
}
|
||||
|
||||
//New Q3 calibration adds
|
||||
int version = reader.ReadInt32();
|
||||
if (version == 2)
|
||||
{
|
||||
Q3Channel = reader.ReadInt32();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace Results.Entities
|
||||
public virtual bool Compound { get; set; }
|
||||
public virtual bool HeatMeter { get; set; }
|
||||
public virtual int WMTypeId { get; set; } /// Mapped to DB only when ORACLE_DB is defined
|
||||
public virtual int Q3Channel { get; set; } /// Q3 Channel = 0 no set > 0 is Q3 calibration
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor, safe values
|
||||
@@ -59,6 +60,7 @@ namespace Results.Entities
|
||||
{
|
||||
PulsesPerLtr = 1;
|
||||
PulsesPerLtrAux = 1;
|
||||
Q3Channel = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -101,6 +103,7 @@ namespace Results.Entities
|
||||
Compound = oriWMData.Compound;
|
||||
HeatMeter = oriWMData.HeatMeter;
|
||||
WMTypeId = oriWMData.WMTypeId;
|
||||
Q3Channel = oriWMData.Q3Channel;
|
||||
}
|
||||
|
||||
|
||||
@@ -146,6 +149,7 @@ namespace Results.Entities
|
||||
if (Compound != wmd.Compound) return false;
|
||||
if (HeatMeter != wmd.HeatMeter) return false;
|
||||
if (WMTypeId != wmd.WMTypeId) return false;
|
||||
if (Q3Channel != wmd.Q3Channel) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -206,6 +210,8 @@ namespace Results.Entities
|
||||
writer.Write(Compound);
|
||||
writer.Write(HeatMeter);
|
||||
writer.Write(WMTypeId);
|
||||
writer.Write(2); //Version of the binary format
|
||||
writer.Write(Q3Channel);
|
||||
}
|
||||
|
||||
public virtual void ReadBinary(BinaryReader reader)
|
||||
@@ -246,6 +252,15 @@ namespace Results.Entities
|
||||
Compound = reader.ReadBoolean();
|
||||
HeatMeter = reader.ReadBoolean();
|
||||
WMTypeId = reader.ReadInt32();
|
||||
|
||||
//Version 2 of the binary format introduced Q3Channel
|
||||
int Version = 0;
|
||||
Q3Channel = 0;
|
||||
try { Version = reader.ReadInt32(); }catch(Exception) { Version = 0; }
|
||||
if (Version == 2)
|
||||
{
|
||||
try { Q3Channel = reader.ReadInt32(); } catch (Exception) { Q3Channel = 0; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
using System;
|
||||
using MySql.Data.MySqlClient;
|
||||
using Common;
|
||||
|
||||
namespace Results.Entities.helpers
|
||||
{
|
||||
public static class DatabaseMigrationHelper
|
||||
{
|
||||
public static void EnsureSchema(DBType dbType, string connectionString)
|
||||
{
|
||||
switch (dbType)
|
||||
{
|
||||
case DBType.MySql:
|
||||
EnsureMySqlSchema(connectionString);
|
||||
break;
|
||||
|
||||
case DBType.SQLite:
|
||||
EnsureSQLiteSchema(connectionString);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static void EnsureMySqlSchema(string connectionString)
|
||||
{
|
||||
using (var conn = new MySqlConnection(connectionString))
|
||||
{
|
||||
conn.Open();
|
||||
|
||||
EnsureColumnMySql(conn, "WaterMeterData", "Q3Channel", "INT NOT NULL DEFAULT 0");
|
||||
EnsureColumnMySql(conn, "WaterMeter", "Q3Channel", "INT NOT NULL DEFAULT 0");
|
||||
EnsureColumnMySql(conn, "MeterTestRslt", "Q3Channel", "INT NOT NULL DEFAULT 0");
|
||||
}
|
||||
}
|
||||
|
||||
private static void EnsureColumnMySql(
|
||||
MySqlConnection conn,
|
||||
string tableName,
|
||||
string columnName,
|
||||
string columnDefinition)
|
||||
{
|
||||
using (var transaction = conn.BeginTransaction())
|
||||
{
|
||||
try
|
||||
{
|
||||
bool exists;
|
||||
|
||||
using (var cmd = conn.CreateCommand())
|
||||
{
|
||||
cmd.Transaction = transaction;
|
||||
cmd.CommandText = @"
|
||||
SELECT COUNT(*)
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = @tableName
|
||||
AND COLUMN_NAME = @columnName";
|
||||
|
||||
cmd.Parameters.AddWithValue("@tableName", tableName);
|
||||
cmd.Parameters.AddWithValue("@columnName", columnName);
|
||||
|
||||
exists = Convert.ToInt32(cmd.ExecuteScalar()) > 0;
|
||||
}
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
using (var alter = conn.CreateCommand())
|
||||
{
|
||||
alter.Transaction = transaction;
|
||||
|
||||
alter.CommandText = "ALTER TABLE `" + tableName + "` ADD COLUMN `" + columnName + "` " + columnDefinition;
|
||||
|
||||
alter.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
|
||||
transaction.Commit();
|
||||
}
|
||||
catch
|
||||
{
|
||||
transaction.Rollback();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void EnsureSQLiteSchema(string databaseFile)
|
||||
{
|
||||
using (var conn = new System.Data.SQLite.SQLiteConnection("Data Source=" + databaseFile))
|
||||
{
|
||||
conn.Open();
|
||||
|
||||
EnsureColumnSQLite(conn, "WaterMeterData", "Q3Channel", "INTEGER NOT NULL DEFAULT 0");
|
||||
EnsureColumnSQLite(conn, "WaterMeter", "Q3Channel", "INTEGER NOT NULL DEFAULT 0");
|
||||
EnsureColumnSQLite(conn, "MeterTestRslt", "Q3Channel", "INTEGER NOT NULL DEFAULT 0");
|
||||
}
|
||||
}
|
||||
|
||||
private static void EnsureColumnSQLite(
|
||||
System.Data.SQLite.SQLiteConnection conn,
|
||||
string tableName,
|
||||
string columnName,
|
||||
string columnDefinition)
|
||||
{
|
||||
bool exists = false;
|
||||
|
||||
using (var cmd = conn.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = "PRAGMA table_info(" + tableName + ")";
|
||||
|
||||
using (var reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
if (string.Equals(reader["name"].ToString(), columnName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
using (var alter = conn.CreateCommand())
|
||||
{
|
||||
alter.CommandText =
|
||||
"ALTER TABLE " + tableName + " ADD COLUMN " + columnName + " " + columnDefinition;
|
||||
|
||||
alter.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using NHibernate;
|
||||
|
||||
namespace Results.Entities.helpers
|
||||
{
|
||||
public static class TestRsltCalibFactorHelper
|
||||
{
|
||||
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(TestRsltCalibFactorHelper));
|
||||
|
||||
public static bool TableExists(ISession session)
|
||||
{
|
||||
try
|
||||
{
|
||||
session.CreateSQLQuery( "SELECT 1 FROM TestRsltCalibFactor LIMIT 1")
|
||||
.UniqueResult();
|
||||
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteByTestRsltIdNoTransaction(
|
||||
ISession session,
|
||||
int testRsltId)
|
||||
{
|
||||
log.DebugFormat("Deleting TestRsltCalibFactor records for TestRsltId: {0}", testRsltId);
|
||||
session.CreateSQLQuery(@" DELETE FROM TestRsltCalibFactor WHERE TestRsltId = :testRsltId")
|
||||
.SetParameter("testRsltId", testRsltId)
|
||||
.ExecuteUpdate();
|
||||
}
|
||||
|
||||
public static IList<TestRsltCalibFactor> GetByTestRsltId(
|
||||
ISession session,
|
||||
int testRsltId)
|
||||
{
|
||||
return session.QueryOver<TestRsltCalibFactor>()
|
||||
.Where(x => x.TestRslt.Id == testRsltId)
|
||||
.OrderBy(x => x.CalibFactorIndex).Asc
|
||||
.List();
|
||||
}
|
||||
|
||||
public static string Truncate(string value, int maxLength)
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
return string.Empty;
|
||||
|
||||
return value.Length <= maxLength
|
||||
? value
|
||||
: value.Substring(0, maxLength);
|
||||
}
|
||||
|
||||
public static void CreateTableIfNotExists(ISession session)
|
||||
{
|
||||
if (TableExists(session))
|
||||
return;
|
||||
|
||||
string sql;
|
||||
|
||||
if (DB.DbType == Common.DBType.MySql)
|
||||
{
|
||||
sql = @"
|
||||
CREATE TABLE IF NOT EXISTS TestRsltCalibFactor (
|
||||
Id INT NOT NULL AUTO_INCREMENT,
|
||||
TestRsltId INT NOT NULL,
|
||||
CalibFactorIndex INT NOT NULL,
|
||||
BaseCalibFactor INT NOT NULL,
|
||||
CalculatedCalibFactor INT NOT NULL,
|
||||
IsCalibFactorValid BIT NOT NULL,
|
||||
Stored BIT NOT NULL,
|
||||
ErrorStr VARCHAR(240) NULL,
|
||||
TimeStart DOUBLE NOT NULL,
|
||||
TimeEnd DOUBLE NOT NULL,
|
||||
CalibRawStart DOUBLE NOT NULL,
|
||||
CalibRawEnd DOUBLE NOT NULL,
|
||||
Error DOUBLE NOT NULL,
|
||||
VolumeStart DOUBLE NOT NULL,
|
||||
VolumeEnd DOUBLE NOT NULL,
|
||||
PRIMARY KEY (Id),
|
||||
INDEX IX_TestRsltCalibFactor_TestRsltId (TestRsltId),
|
||||
CONSTRAINT FK_TestRsltCalibFactor_TestRslt
|
||||
FOREIGN KEY (TestRsltId) REFERENCES TestRslt(Id)
|
||||
ON DELETE CASCADE
|
||||
);";
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = @"
|
||||
CREATE TABLE IF NOT EXISTS TestRsltCalibFactor (
|
||||
Id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
TestRsltId INTEGER NOT NULL,
|
||||
CalibFactorIndex INTEGER NOT NULL,
|
||||
BaseCalibFactor INTEGER NOT NULL,
|
||||
CalculatedCalibFactor INTEGER NOT NULL,
|
||||
IsCalibFactorValid INTEGER NOT NULL,
|
||||
Stored INTEGER NOT NULL,
|
||||
ErrorStr VARCHAR(240) NULL,
|
||||
TimeStart DOUBLE NOT NULL,
|
||||
TimeEnd DOUBLE NOT NULL,
|
||||
CalibRawStart DOUBLE NOT NULL,
|
||||
CalibRawEnd DOUBLE NOT NULL,
|
||||
Error DOUBLE NOT NULL,
|
||||
VolumeStart DOUBLE NOT NULL,
|
||||
VolumeEnd DOUBLE NOT NULL,
|
||||
FOREIGN KEY (TestRsltId) REFERENCES TestRslt(Id) ON DELETE CASCADE
|
||||
);";
|
||||
}
|
||||
|
||||
log.InfoFormat("Creating TestRsltCalibFactor table: {0}", sql);
|
||||
session.CreateSQLQuery(sql).ExecuteUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ namespace Results.Forms
|
||||
|
||||
public void Update(Results.Entities.WaterMeter wMtr)
|
||||
{
|
||||
if (wMtr == null || wMtr.Disabled)
|
||||
if (wMtr == null || (wMtr.Disabled && wMtr.Q3Channel == 0))
|
||||
{
|
||||
/// Water meter position is disabled
|
||||
this.disabled = true;
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace Results.Forms
|
||||
|
||||
public void Update(Results.Entities.WaterMeter wMtr)
|
||||
{
|
||||
if (wMtr == null || wMtr.Disabled)
|
||||
if (wMtr == null || (wMtr.Disabled && wMtr.Q3Channel == 0))
|
||||
{
|
||||
/// Water meter position is disabled
|
||||
this.disabled = true;
|
||||
@@ -114,8 +114,11 @@ namespace Results.Forms
|
||||
lView.Items.Clear();
|
||||
foreach (var mtr in wMtr.MeterTestRslts)
|
||||
{
|
||||
if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Publish.Never
|
||||
&& mtr.Publish() != Publish.Internal)
|
||||
if (mtr != null && mtr.IsPilotRslt() &&
|
||||
(mtr.Q3Channel!=0 || (mtr.TestDone &&
|
||||
mtr.Publish() != Publish.Never &&
|
||||
mtr.Publish() != Publish.Internal)
|
||||
) )
|
||||
{
|
||||
ListViewItem lvi = new ListViewItem(testNames[ix++]);
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
using FluentNHibernate.Mapping;
|
||||
using Results.Entities;
|
||||
|
||||
namespace Results.Mappings
|
||||
{
|
||||
public class MeterTestCalibFactorRsltMap : ClassMap<MeterTestCalibFactorRslt>
|
||||
{
|
||||
public MeterTestCalibFactorRsltMap()
|
||||
{
|
||||
Id(x => x.Id);
|
||||
|
||||
References(x => x.MeterTestRslt)
|
||||
.Not.Nullable()
|
||||
.Cascade.None();
|
||||
|
||||
Map(x => x.CalibFactorIndex).Not.Nullable();
|
||||
|
||||
Map(x => x.BaseCalibFactor).Not.Nullable();
|
||||
Map(x => x.CalculatedCalibFactor).Not.Nullable();
|
||||
|
||||
Map(x => x.Stored).Not.Nullable();
|
||||
|
||||
Map(x => x.ErrorStr)
|
||||
.Length(240)
|
||||
.Nullable();
|
||||
|
||||
Map(x => x.TimeStart).Not.Nullable();
|
||||
Map(x => x.TimeEnd).Not.Nullable();
|
||||
|
||||
Map(x => x.CalibRawStart).Not.Nullable();
|
||||
Map(x => x.CalibRawEnd).Not.Nullable();
|
||||
|
||||
Map(x => x.Error).Not.Nullable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,7 @@ namespace Results.Mappings
|
||||
#endif
|
||||
References(x => x.WaterMeter);
|
||||
References(x => x.TestRslt);
|
||||
Map(x => x.Q3Channel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
using FluentNHibernate.Mapping;
|
||||
using Results.Entities;
|
||||
|
||||
namespace Results.Mappings
|
||||
{
|
||||
class TestRsltCalibFactorMap : ClassMap<TestRsltCalibFactor>
|
||||
{
|
||||
public TestRsltCalibFactorMap()
|
||||
{
|
||||
Id(x => x.Id);
|
||||
|
||||
References(x => x.TestRslt)
|
||||
.Column("TestRsltId")
|
||||
.Not.Nullable();
|
||||
|
||||
Map(x => x.CalibFactorIndex).Not.Nullable();
|
||||
Map(x => x.IsCalibFactorValid).Not.Nullable();
|
||||
|
||||
Map(x => x.BaseCalibFactor).Not.Nullable();
|
||||
Map(x => x.CalculatedCalibFactor).Not.Nullable();
|
||||
|
||||
Map(x => x.Stored).Not.Nullable();
|
||||
|
||||
Map(x => x.ErrorStr)
|
||||
.Length(240)
|
||||
.Nullable();
|
||||
|
||||
Map(x => x.TimeStart).Not.Nullable();
|
||||
Map(x => x.TimeEnd).Not.Nullable();
|
||||
|
||||
Map(x => x.CalibRawStart).Not.Nullable();
|
||||
Map(x => x.CalibRawEnd).Not.Nullable();
|
||||
|
||||
Map(x => x.Error).Not.Nullable();
|
||||
|
||||
Map(x => x.VolumeStart).Not.Nullable();
|
||||
Map(x => x.VolumeEnd).Not.Nullable();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,8 @@ namespace Results.Mappings
|
||||
#if ORACLE_DB
|
||||
Map(x => x.WMTypeId);
|
||||
#endif
|
||||
}
|
||||
Map(x => x.Q3Channel);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ namespace Results.Mappings
|
||||
Map(x => x.Pruefindex);
|
||||
Map(x => x.HydrPruefung);
|
||||
#endif
|
||||
Map(x => x.Q3Channel);// Genesis meter identification
|
||||
References(x => x.WaterMeterData);
|
||||
References(x => x.Batch);
|
||||
HasMany(x => x.MeterTestRslts)
|
||||
|
||||
+12
-3
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Results</RootNamespace>
|
||||
<AssemblyName>Results</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
@@ -53,6 +53,9 @@
|
||||
<Reference Include="NHibernate">
|
||||
<HintPath>..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SQLite, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Data.SQLite.2.0.3\lib\net471\System.Data.SQLite.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
@@ -69,12 +72,16 @@
|
||||
<Compile Include="DBase.cs" />
|
||||
<Compile Include="Entities\Batch.cs" />
|
||||
<Compile Include="Entities\Components.cs" />
|
||||
<Compile Include="Entities\helpers\DatabaseMigrationHelper.cs" />
|
||||
<Compile Include="Entities\helpers\TestRsltCalibFactorHelper.cs" />
|
||||
<Compile Include="Entities\MeterTestCalibFactorRslt.cs" />
|
||||
<Compile Include="Entities\MeterTestRslt.cs" />
|
||||
<Compile Include="Entities\PurchaseBox.cs" />
|
||||
<Compile Include="Entities\PurchaseOrder.cs" />
|
||||
<Compile Include="Entities\PurchaseWaterMeterData.cs" />
|
||||
<Compile Include="Entities\TestData.cs" />
|
||||
<Compile Include="Entities\TestRslt.cs" />
|
||||
<Compile Include="Entities\TestRsltCalibFactor.cs" />
|
||||
<Compile Include="Entities\WaterMeterData.cs" />
|
||||
<Compile Include="Entities\WaterMeter.cs" />
|
||||
<Compile Include="DB.cs" />
|
||||
@@ -132,11 +139,13 @@
|
||||
<Compile Include="ManualEntryItemSpec.cs" />
|
||||
<Compile Include="Mappings\BatchMap.cs" />
|
||||
<Compile Include="Mappings\ComponentsMap.cs" />
|
||||
<Compile Include="Mappings\MeterTestCalibFactorRsltMap.cs" />
|
||||
<Compile Include="Mappings\MeterTestRsltMap.cs" />
|
||||
<Compile Include="Mappings\PurchaseBoxMap.cs" />
|
||||
<Compile Include="Mappings\PurchaseOrderMap.cs" />
|
||||
<Compile Include="Mappings\PurchaseWaterMeterDataMap.cs" />
|
||||
<Compile Include="Mappings\TestDataMap.cs" />
|
||||
<Compile Include="Mappings\TestRsltCalibFactorMap.cs" />
|
||||
<Compile Include="Mappings\TestRsltMap.cs" />
|
||||
<Compile Include="Mappings\WaterMeterDataMap.cs" />
|
||||
<Compile Include="Mappings\WaterMeterMap.cs" />
|
||||
@@ -266,4 +275,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ResultsBrowser</RootNamespace>
|
||||
<AssemblyName>ResultsBrowser</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
@@ -327,4 +327,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>S640TestApp</RootNamespace>
|
||||
<AssemblyName>S640TestApp</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SchematicDrawing</RootNamespace>
|
||||
<AssemblyName>SchematicDrawing</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@@ -217,4 +217,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SharedDatabase</RootNamespace>
|
||||
<AssemblyName>SharedDatabase</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@@ -232,4 +232,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Statistics</RootNamespace>
|
||||
<AssemblyName>Statistics</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
@@ -146,4 +146,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("3.9.3063.1")]
|
||||
[assembly: AssemblyFileVersion("3.9.3063.1")]
|
||||
[assembly: AssemblyVersion("3.9.3130.0")]
|
||||
[assembly: AssemblyFileVersion("3.9.3130.0")]
|
||||
|
||||
Generated
+18
-9
@@ -2723,15 +2723,6 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to iPerl Communication in progress.
|
||||
/// </summary>
|
||||
internal static string iPerl_Communication_in_progress {
|
||||
get {
|
||||
return ResourceManager.GetString("iPerl_Communication_in_progress", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ITS-27 calibration coefficients.
|
||||
/// </summary>
|
||||
@@ -3101,6 +3092,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Meter Communication in progress.
|
||||
/// </summary>
|
||||
internal static string Meter_Communication_in_progress {
|
||||
get {
|
||||
return ResourceManager.GetString("Meter_Communication_in_progress", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Sensors.
|
||||
/// </summary>
|
||||
@@ -4640,6 +4640,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Radio Communication failed.
|
||||
/// </summary>
|
||||
internal static string Radio_Communication_failed {
|
||||
get {
|
||||
return ResourceManager.GetString("Radio_Communication_failed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Rate of change [%].
|
||||
/// </summary>
|
||||
|
||||
Generated
+9
-9
@@ -1931,15 +1931,6 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to iPERL Komunikace probíhá.
|
||||
/// </summary>
|
||||
internal static string iPerl_Communication_in_progress {
|
||||
get {
|
||||
return ResourceManager.GetString("iPerl_Communication_in_progress", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Jazyk.
|
||||
/// </summary>
|
||||
@@ -2147,6 +2138,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Komunikace s vodemerem probíhá.
|
||||
/// </summary>
|
||||
internal static string Meter_Communication_in_progress {
|
||||
get {
|
||||
return ResourceManager.GetString("Meter_Communication_in_progress", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Testované typy měřičů.
|
||||
/// </summary>
|
||||
|
||||
@@ -1020,8 +1020,8 @@
|
||||
<data name="Simultaneous_with_previous_step" xml:space="preserve">
|
||||
<value>Současně s předchozím krokem</value>
|
||||
</data>
|
||||
<data name="iPerl_Communication_in_progress" xml:space="preserve">
|
||||
<value>iPERL Komunikace probíhá</value>
|
||||
<data name="Meter_Communication_in_progress" xml:space="preserve">
|
||||
<value>Komunikace s vodemerem probíhá</value>
|
||||
</data>
|
||||
<data name="Language" xml:space="preserve">
|
||||
<value>Jazyk</value>
|
||||
|
||||
Generated
+6398
File diff suppressed because it is too large
Load Diff
@@ -1023,8 +1023,8 @@
|
||||
<data name="Simultaneous_with_previous_step" xml:space="preserve">
|
||||
<value>Prallel mit vorherigem Schritt</value>
|
||||
</data>
|
||||
<data name="iPerl_Communication_in_progress" xml:space="preserve">
|
||||
<value>iPerl Kommunikation läuft</value>
|
||||
<data name="Meter_Communication_in_progress" xml:space="preserve">
|
||||
<value>Meter Kommunikation läuft</value>
|
||||
</data>
|
||||
<data name="Language" xml:space="preserve">
|
||||
<value>Sprache</value>
|
||||
|
||||
@@ -1020,8 +1020,8 @@
|
||||
<data name="Simultaneous_with_previous_step" xml:space="preserve">
|
||||
<value>Simultanée étape précédente</value>
|
||||
</data>
|
||||
<data name="iPerl_Communication_in_progress" xml:space="preserve">
|
||||
<value>iPerl Communication en cours</value>
|
||||
<data name="Meter_Communication_in_progress" xml:space="preserve">
|
||||
<value>Meter Communication en cours</value>
|
||||
</data>
|
||||
<data name="Language" xml:space="preserve">
|
||||
<value>Langue</value>
|
||||
|
||||
@@ -1017,8 +1017,8 @@
|
||||
<data name="Simultaneous_with_previous_step" xml:space="preserve">
|
||||
<value>simultaneo con il passo precedente</value>
|
||||
</data>
|
||||
<data name="iPerl_Communication_in_progress" xml:space="preserve">
|
||||
<value>iPerl comunicazioni in corso</value>
|
||||
<data name="Meter_Communication_in_progress" xml:space="preserve">
|
||||
<value>Meter comunicazioni in corso</value>
|
||||
</data>
|
||||
<data name="Language" xml:space="preserve">
|
||||
<value>lingua</value>
|
||||
|
||||
@@ -1011,8 +1011,8 @@
|
||||
<data name="Simultaneous_with_previous_step" xml:space="preserve">
|
||||
<value>Jednocześnie z poprzednim krokiem</value>
|
||||
</data>
|
||||
<data name="iPerl_Communication_in_progress" xml:space="preserve">
|
||||
<value>Komunikacja z iPERL w toku</value>
|
||||
<data name="Meter_Communication_in_progress" xml:space="preserve">
|
||||
<value>Komunikacja z vodomera w toku</value>
|
||||
</data>
|
||||
<data name="Language" xml:space="preserve">
|
||||
<value>Język</value>
|
||||
|
||||
@@ -1042,8 +1042,8 @@
|
||||
<data name="Simultaneous_with_previous_step" xml:space="preserve">
|
||||
<value>Simultaneous with previous step</value>
|
||||
</data>
|
||||
<data name="iPerl_Communication_in_progress" xml:space="preserve">
|
||||
<value>iPerl Communication in progress</value>
|
||||
<data name="Meter_Communication_in_progress" xml:space="preserve">
|
||||
<value>Meter Communication in progress</value>
|
||||
</data>
|
||||
<data name="Language" xml:space="preserve">
|
||||
<value>Language</value>
|
||||
@@ -1732,6 +1732,9 @@
|
||||
<data name="RFID_communication_failed" xml:space="preserve">
|
||||
<value>RFID communication failed</value>
|
||||
</data>
|
||||
<data name="Radio_Communication_failed" xml:space="preserve">
|
||||
<value>Radio Communication failed</value>
|
||||
</data>
|
||||
<data name="Head_was_disabled_by_the_user" xml:space="preserve">
|
||||
<value>Disabled by user</value>
|
||||
</data>
|
||||
|
||||
@@ -1011,8 +1011,8 @@
|
||||
<data name="Simultaneous_with_previous_step" xml:space="preserve">
|
||||
<value>Одновременно с предыдущим шагом</value>
|
||||
</data>
|
||||
<data name="iPerl_Communication_in_progress" xml:space="preserve">
|
||||
<value>Осуществляется связь с iPerl </value>
|
||||
<data name="Meter_Communication_in_progress" xml:space="preserve">
|
||||
<value>Осуществляется связь с водомером </value>
|
||||
</data>
|
||||
<data name="Language" xml:space="preserve">
|
||||
<value>Язык</value>
|
||||
|
||||
@@ -285,14 +285,30 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
GciPublicModels.GciInitSlotRequest request,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
EnsureExternalInterface();
|
||||
|
||||
if (request == null)
|
||||
throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.SlotId <= 0)
|
||||
throw new ArgumentException("Invalid slot id.", nameof(request));
|
||||
|
||||
if (string.Equals(request.RequestPort?.Type, "SIMULATE", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
log.InfoFormat("{0}: InitSlotAsync invoked. {1}, SIMULATE", Name, request);
|
||||
await Task.Delay(500);
|
||||
log.InfoFormat("{0}: InitSlotAsync SIMULATE finished.", Name);
|
||||
|
||||
return new GciPublicModels.GciInitSlotResult()
|
||||
{
|
||||
SlotId = request.SlotId,
|
||||
Success = true,
|
||||
AlreadyExists = false,
|
||||
Updated = false,
|
||||
Message = "Simulated",
|
||||
};
|
||||
}
|
||||
|
||||
EnsureExternalInterface();
|
||||
|
||||
var result = await gciExternalInterface
|
||||
.InitSlotAsync(request, token)
|
||||
.ConfigureAwait(false);
|
||||
@@ -366,18 +382,36 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
GciPublicModels.GciInitSlotRequest request,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
EnsureExternalInterface();
|
||||
|
||||
|
||||
if (request == null)
|
||||
throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.SlotId <= 0)
|
||||
throw new ArgumentException("Invalid slot id.", nameof(request));
|
||||
|
||||
if (string.Equals(request.RequestPort?.Type, "SIMULATE", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
log.InfoFormat("{0}: UpdateSlotAsync invoked. {1}, SIMULATE", Name, request);
|
||||
await Task.Delay(500);
|
||||
log.InfoFormat("{0}: UpdateSlotAsync SIMULATE finished.", Name);
|
||||
|
||||
return new GciPublicModels.GciInitSlotResult()
|
||||
{
|
||||
SlotId = request.SlotId,
|
||||
Success = true,
|
||||
AlreadyExists = false,
|
||||
Updated = true,
|
||||
Message = "Simulated",
|
||||
};
|
||||
}
|
||||
|
||||
EnsureExternalInterface();
|
||||
|
||||
var result = await gciExternalInterface
|
||||
.UpdateSlotAsync(request, token)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
log.InfoFormat("{0}: UpdateSlotAsync invoked. {1}, Result={2}", Name, request, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -888,6 +922,8 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
int slotId,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
log.InfoFormat("{0}: DisconnectAsync({1}) invoked.", Name, slotId);
|
||||
|
||||
EnsureExternalInterface();
|
||||
|
||||
if (slotId <= 0)
|
||||
|
||||
@@ -3,8 +3,6 @@ using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
|
||||
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
|
||||
|
||||
|
||||
+11
-11
@@ -44,7 +44,7 @@
|
||||
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||
this.groupBox5 = new System.Windows.Forms.GroupBox();
|
||||
this.ScenariousViewButton = new System.Windows.Forms.Button();
|
||||
this.preadjustmenActionsViewButton = new System.Windows.Forms.Button();
|
||||
this.preadjustmentActionsViewButton = new System.Windows.Forms.Button();
|
||||
this.slotsComPortsRegistersActionsViewButton = new System.Windows.Forms.Button();
|
||||
this.uniDataSorageActionsViewButton = new System.Windows.Forms.Button();
|
||||
this.combinedActionsViewButton = new System.Windows.Forms.Button();
|
||||
@@ -191,7 +191,7 @@
|
||||
// groupBox5
|
||||
//
|
||||
this.groupBox5.Controls.Add(this.ScenariousViewButton);
|
||||
this.groupBox5.Controls.Add(this.preadjustmenActionsViewButton);
|
||||
this.groupBox5.Controls.Add(this.preadjustmentActionsViewButton);
|
||||
this.groupBox5.Controls.Add(this.slotsComPortsRegistersActionsViewButton);
|
||||
this.groupBox5.Controls.Add(this.uniDataSorageActionsViewButton);
|
||||
this.groupBox5.Controls.Add(this.combinedActionsViewButton);
|
||||
@@ -211,15 +211,15 @@
|
||||
this.ScenariousViewButton.Text = "Scenarious";
|
||||
this.ScenariousViewButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// preadjustmenActionsViewButton
|
||||
// preadjustmentActionsViewButton
|
||||
//
|
||||
this.preadjustmenActionsViewButton.Location = new System.Drawing.Point(6, 127);
|
||||
this.preadjustmenActionsViewButton.Name = "preadjustmenActionsViewButton";
|
||||
this.preadjustmenActionsViewButton.Size = new System.Drawing.Size(150, 30);
|
||||
this.preadjustmenActionsViewButton.TabIndex = 2;
|
||||
this.preadjustmenActionsViewButton.Text = "Preadjustment";
|
||||
this.preadjustmenActionsViewButton.UseVisualStyleBackColor = true;
|
||||
this.preadjustmenActionsViewButton.Click += new System.EventHandler(this.preadjustmenActionsViewButton_Click);
|
||||
this.preadjustmentActionsViewButton.Location = new System.Drawing.Point(6, 127);
|
||||
this.preadjustmentActionsViewButton.Name = "preadjustmentActionsViewButton";
|
||||
this.preadjustmentActionsViewButton.Size = new System.Drawing.Size(150, 30);
|
||||
this.preadjustmentActionsViewButton.TabIndex = 2;
|
||||
this.preadjustmentActionsViewButton.Text = "Preadjustment";
|
||||
this.preadjustmentActionsViewButton.UseVisualStyleBackColor = true;
|
||||
this.preadjustmentActionsViewButton.Click += new System.EventHandler(this.preadjustmentActionsViewButton_Click);
|
||||
//
|
||||
// slotsComPortsRegistersActionsViewButton
|
||||
//
|
||||
@@ -412,7 +412,7 @@
|
||||
private System.Windows.Forms.GroupBox groupBox5;
|
||||
private System.Windows.Forms.Button combinedActionsViewButton;
|
||||
private System.Windows.Forms.Button btnDiagTablesConfigurationButton;
|
||||
private System.Windows.Forms.Button preadjustmenActionsViewButton;
|
||||
private System.Windows.Forms.Button preadjustmentActionsViewButton;
|
||||
private System.Windows.Forms.Button ScenariousViewButton;
|
||||
}
|
||||
}
|
||||
@@ -502,11 +502,11 @@ namespace TBF.Rig.BridgeComponents.GciBridge.UI
|
||||
new ConfigurationView(this));
|
||||
}
|
||||
|
||||
private void preadjustmenActionsViewButton_Click(object sender, EventArgs e)
|
||||
private void preadjustmentActionsViewButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
SwitchGciView(
|
||||
"PreadjustmenActionsView",
|
||||
new PreadjustmentActionsView(this, _bridge, AddSlotRow, SaveSlots));
|
||||
"PreadjustmentActionsView",
|
||||
new PreadjustmentActionsView(this, _bridge, AddSlotRow, SaveSlots));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/// * mark test method from smart family devices
|
||||
/// * (this Test method is used for devices that support smart reader)
|
||||
/// </summary>
|
||||
public interface ITestMethodSmart
|
||||
public interface ITestMethodSmart : ITestMethod
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -16,18 +16,18 @@ namespace TBF.Rig.RegisterReaders.CommonRR.IPerl
|
||||
|
||||
|
||||
|
||||
public int DfltQ2c_15_rl { get; set; }
|
||||
public int DfltQ2c_15_lr { get; set; }
|
||||
public int DfltQ2c_20_rl { get; set; }
|
||||
public int DfltQ2c_20_lr { get; set; }
|
||||
public int DfltQ2c_25_63_rl { get; set; }
|
||||
public int DfltQ2c_25_63_lr { get; set; }
|
||||
public int DfltQ2c_25_10_rl { get; set; }
|
||||
public int DfltQ2c_25_10_lr { get; set; }
|
||||
public int DfltQ2c_32_rl { get; set; }
|
||||
public int DfltQ2c_32_lr { get; set; }
|
||||
public int DfltQ2c_40_rl { get; set; }
|
||||
public int DfltQ2c_40_lr { get; set; }
|
||||
public int CalibFactor1InchCh1 { get; set; }
|
||||
public int CalibFactor1InchCh2 { get; set; }
|
||||
public int CalibFactor2InchCh1 { get; set; }
|
||||
public int CalibFactor2InchCh2 { get; set; }
|
||||
public int CalibFactor3InchCh1 { get; set; }
|
||||
public int CalibFactor3InchCh2 { get; set; }
|
||||
public int CalibFactor4InchCh1 { get; set; }
|
||||
public int CalibFactor4InchCh2 { get; set; }
|
||||
public int CalibFactor6InchCh1 { get; set; }
|
||||
public int CalibFactor6InchCh2 { get; set; }
|
||||
public int CalibFactor6MoreInchCh1 { get; set; }
|
||||
public int CalibFactor6MoreInchCh2 { get; set; }
|
||||
|
||||
public bool UseWebService { get; set; }
|
||||
public string BaseUrl { get; set; }
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
public int HeadCommunicationComPortNr;
|
||||
public int OptoComPortNr;
|
||||
public int RfidComPortNr; /// 0 = use MuxBoardNr
|
||||
public int MuxBoardNr; /// 0 = use RfidComPort(Nr), otherwise mux. board nr. 1 .. 4
|
||||
public int MuxBoardNr; /// 0 = use RfidComPort(Nr), otherwise mux. board nr. 1 .. 4 in new 1 .. 10 - paralel genesis access
|
||||
public int Group; /// Number written to QuidoRS to connct the watermeter to RfidComPort, 1 .. 10
|
||||
//public CommunicationInterface CommunicationInterface; /// Communication Interface: RFID or NFC
|
||||
public string CommunicationInterfaceBridge; /// Communication Interface: RFID or NFC
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
message += Environment.NewLine + "'Head communication serial port nr.' is not valid";
|
||||
}
|
||||
|
||||
if (!int.TryParse(muxBoardNrTextBox.Text, out dummy) || dummy < 1 || dummy > 4)
|
||||
if (!int.TryParse(muxBoardNrTextBox.Text, out dummy) || dummy < 1 || dummy > 10)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + string.Format(Strings.Invalid_0, muxBoardNrLabel.Text);
|
||||
|
||||
+84
-106
@@ -76,11 +76,11 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
//
|
||||
this.tabControl1.Controls.Add(this.tabPage1);
|
||||
this.tabControl1.Controls.Add(this.tabPage2);
|
||||
this.tabControl1.Location = new System.Drawing.Point(3, 4);
|
||||
this.tabControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tabControl1.Location = new System.Drawing.Point(2, 3);
|
||||
this.tabControl1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
this.tabControl1.SelectedIndex = 0;
|
||||
this.tabControl1.Size = new System.Drawing.Size(687, 540);
|
||||
this.tabControl1.Size = new System.Drawing.Size(458, 351);
|
||||
this.tabControl1.TabIndex = 0;
|
||||
//
|
||||
// tabPage1
|
||||
@@ -99,40 +99,42 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
this.tabPage1.Controls.Add(this.nameTextBox);
|
||||
this.tabPage1.Controls.Add(this.nameLabel);
|
||||
this.tabPage1.Controls.Add(this.classNameLabel);
|
||||
this.tabPage1.Location = new System.Drawing.Point(4, 29);
|
||||
this.tabPage1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tabPage1.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.tabPage1.Name = "tabPage1";
|
||||
this.tabPage1.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tabPage1.Size = new System.Drawing.Size(679, 507);
|
||||
this.tabPage1.Padding = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.tabPage1.Size = new System.Drawing.Size(450, 325);
|
||||
this.tabPage1.TabIndex = 0;
|
||||
this.tabPage1.Text = "Config";
|
||||
this.tabPage1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.Location = new System.Drawing.Point(372, 55);
|
||||
this.label5.Location = new System.Drawing.Point(248, 36);
|
||||
this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(100, 23);
|
||||
this.label5.Size = new System.Drawing.Size(67, 15);
|
||||
this.label5.TabIndex = 28;
|
||||
this.label5.Text = "Slot Nr:";
|
||||
//
|
||||
// textBoxSlotNr
|
||||
//
|
||||
this.textBoxSlotNr.Enabled = false;
|
||||
this.textBoxSlotNr.Location = new System.Drawing.Point(480, 55);
|
||||
this.textBoxSlotNr.Location = new System.Drawing.Point(320, 36);
|
||||
this.textBoxSlotNr.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.textBoxSlotNr.Name = "textBoxSlotNr";
|
||||
this.textBoxSlotNr.Size = new System.Drawing.Size(74, 26);
|
||||
this.textBoxSlotNr.Size = new System.Drawing.Size(51, 20);
|
||||
this.textBoxSlotNr.TabIndex = 27;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.headPortNrTextBox);
|
||||
this.groupBox2.Controls.Add(this.label2);
|
||||
this.groupBox2.Location = new System.Drawing.Point(11, 450);
|
||||
this.groupBox2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.groupBox2.Location = new System.Drawing.Point(7, 292);
|
||||
this.groupBox2.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.groupBox2.Size = new System.Drawing.Size(621, 52);
|
||||
this.groupBox2.Padding = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.groupBox2.Size = new System.Drawing.Size(414, 34);
|
||||
this.groupBox2.TabIndex = 26;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Head Communication";
|
||||
@@ -140,41 +142,37 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
// headPortNrTextBox
|
||||
//
|
||||
this.headPortNrTextBox.Enabled = false;
|
||||
this.headPortNrTextBox.Location = new System.Drawing.Point(494, 19);
|
||||
this.headPortNrTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.headPortNrTextBox.Location = new System.Drawing.Point(329, 12);
|
||||
this.headPortNrTextBox.Name = "headPortNrTextBox";
|
||||
this.headPortNrTextBox.Size = new System.Drawing.Size(49, 26);
|
||||
this.headPortNrTextBox.Size = new System.Drawing.Size(34, 20);
|
||||
this.headPortNrTextBox.TabIndex = 8;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(361, 22);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label2.Location = new System.Drawing.Point(241, 14);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(107, 20);
|
||||
this.label2.Size = new System.Drawing.Size(72, 13);
|
||||
this.label2.TabIndex = 7;
|
||||
this.label2.Text = "Serial port nr.:";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(234, 126);
|
||||
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label4.Location = new System.Drawing.Point(156, 82);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(52, 20);
|
||||
this.label4.Size = new System.Drawing.Size(37, 13);
|
||||
this.label4.TabIndex = 25;
|
||||
this.label4.Text = "1 .. 10";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(234, 90);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label3.Location = new System.Drawing.Point(156, 58);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(43, 20);
|
||||
this.label3.Size = new System.Drawing.Size(37, 13);
|
||||
this.label3.TabIndex = 24;
|
||||
this.label3.Text = "1 .. 4";
|
||||
this.label3.Text = "1 .. 10";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
@@ -182,11 +180,9 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
this.groupBox1.Controls.Add(this.label1);
|
||||
this.groupBox1.Controls.Add(this.rfidPortNrTextBox);
|
||||
this.groupBox1.Controls.Add(this.rfidSerialPortNrLabel);
|
||||
this.groupBox1.Location = new System.Drawing.Point(11, 363);
|
||||
this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.groupBox1.Location = new System.Drawing.Point(7, 236);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.groupBox1.Size = new System.Drawing.Size(621, 85);
|
||||
this.groupBox1.Size = new System.Drawing.Size(414, 55);
|
||||
this.groupBox1.TabIndex = 23;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "RFID / NFC communication (in case mux. board is not used)";
|
||||
@@ -195,38 +191,35 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
//
|
||||
this.comboBoxCommunicationInterface.Enabled = false;
|
||||
this.comboBoxCommunicationInterface.FormattingEnabled = true;
|
||||
this.comboBoxCommunicationInterface.Location = new System.Drawing.Point(202, 34);
|
||||
this.comboBoxCommunicationInterface.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.comboBoxCommunicationInterface.Location = new System.Drawing.Point(135, 22);
|
||||
this.comboBoxCommunicationInterface.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.comboBoxCommunicationInterface.Name = "comboBoxCommunicationInterface";
|
||||
this.comboBoxCommunicationInterface.Size = new System.Drawing.Size(152, 28);
|
||||
this.comboBoxCommunicationInterface.Size = new System.Drawing.Size(103, 21);
|
||||
this.comboBoxCommunicationInterface.TabIndex = 9;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(8, 38);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Location = new System.Drawing.Point(5, 25);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(187, 20);
|
||||
this.label1.Size = new System.Drawing.Size(124, 13);
|
||||
this.label1.TabIndex = 8;
|
||||
this.label1.Text = "Communication Interface";
|
||||
//
|
||||
// rfidPortNrTextBox
|
||||
//
|
||||
this.rfidPortNrTextBox.Enabled = false;
|
||||
this.rfidPortNrTextBox.Location = new System.Drawing.Point(494, 32);
|
||||
this.rfidPortNrTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.rfidPortNrTextBox.Location = new System.Drawing.Point(329, 21);
|
||||
this.rfidPortNrTextBox.Name = "rfidPortNrTextBox";
|
||||
this.rfidPortNrTextBox.Size = new System.Drawing.Size(49, 26);
|
||||
this.rfidPortNrTextBox.Size = new System.Drawing.Size(34, 20);
|
||||
this.rfidPortNrTextBox.TabIndex = 7;
|
||||
//
|
||||
// rfidSerialPortNrLabel
|
||||
//
|
||||
this.rfidSerialPortNrLabel.AutoSize = true;
|
||||
this.rfidSerialPortNrLabel.Location = new System.Drawing.Point(361, 38);
|
||||
this.rfidSerialPortNrLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.rfidSerialPortNrLabel.Location = new System.Drawing.Point(241, 25);
|
||||
this.rfidSerialPortNrLabel.Name = "rfidSerialPortNrLabel";
|
||||
this.rfidSerialPortNrLabel.Size = new System.Drawing.Size(107, 20);
|
||||
this.rfidSerialPortNrLabel.Size = new System.Drawing.Size(72, 13);
|
||||
this.rfidSerialPortNrLabel.TabIndex = 6;
|
||||
this.rfidSerialPortNrLabel.Text = "Serial port nr.:";
|
||||
//
|
||||
@@ -243,11 +236,9 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
this.optoDataGroupBox.Controls.Add(this.radioButton2);
|
||||
this.optoDataGroupBox.Controls.Add(this.optoSerialPortLabel);
|
||||
this.optoDataGroupBox.Controls.Add(this.optoSerialPortTextBox);
|
||||
this.optoDataGroupBox.Location = new System.Drawing.Point(11, 164);
|
||||
this.optoDataGroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.optoDataGroupBox.Location = new System.Drawing.Point(7, 107);
|
||||
this.optoDataGroupBox.Name = "optoDataGroupBox";
|
||||
this.optoDataGroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.optoDataGroupBox.Size = new System.Drawing.Size(621, 189);
|
||||
this.optoDataGroupBox.Size = new System.Drawing.Size(414, 123);
|
||||
this.optoDataGroupBox.TabIndex = 18;
|
||||
this.optoDataGroupBox.TabStop = false;
|
||||
this.optoDataGroupBox.Text = "Opto-data";
|
||||
@@ -257,9 +248,10 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
this.checkBox_EnableShowChanels.Checked = true;
|
||||
this.checkBox_EnableShowChanels.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.checkBox_EnableShowChanels.Enabled = false;
|
||||
this.checkBox_EnableShowChanels.Location = new System.Drawing.Point(351, 147);
|
||||
this.checkBox_EnableShowChanels.Location = new System.Drawing.Point(234, 96);
|
||||
this.checkBox_EnableShowChanels.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.checkBox_EnableShowChanels.Name = "checkBox_EnableShowChanels";
|
||||
this.checkBox_EnableShowChanels.Size = new System.Drawing.Size(238, 24);
|
||||
this.checkBox_EnableShowChanels.Size = new System.Drawing.Size(159, 16);
|
||||
this.checkBox_EnableShowChanels.TabIndex = 10;
|
||||
this.checkBox_EnableShowChanels.Text = "Enable Show Channels";
|
||||
this.checkBox_EnableShowChanels.UseVisualStyleBackColor = true;
|
||||
@@ -267,58 +259,56 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
// tBBeginDataFlush
|
||||
//
|
||||
this.tBBeginDataFlush.Enabled = false;
|
||||
this.tBBeginDataFlush.Location = new System.Drawing.Point(474, 105);
|
||||
this.tBBeginDataFlush.Location = new System.Drawing.Point(316, 68);
|
||||
this.tBBeginDataFlush.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.tBBeginDataFlush.MaxLength = 8;
|
||||
this.tBBeginDataFlush.Name = "tBBeginDataFlush";
|
||||
this.tBBeginDataFlush.Size = new System.Drawing.Size(69, 26);
|
||||
this.tBBeginDataFlush.Size = new System.Drawing.Size(47, 20);
|
||||
this.tBBeginDataFlush.TabIndex = 9;
|
||||
this.tBBeginDataFlush.Text = "2000";
|
||||
this.tBBeginDataFlush.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||
//
|
||||
// labelFlush
|
||||
//
|
||||
this.labelFlush.Location = new System.Drawing.Point(328, 109);
|
||||
this.labelFlush.Location = new System.Drawing.Point(219, 71);
|
||||
this.labelFlush.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.labelFlush.Name = "labelFlush";
|
||||
this.labelFlush.Size = new System.Drawing.Size(140, 22);
|
||||
this.labelFlush.Size = new System.Drawing.Size(93, 14);
|
||||
this.labelFlush.TabIndex = 8;
|
||||
this.labelFlush.Text = "Begin Data Flush:";
|
||||
//
|
||||
// tcpipPortLabel
|
||||
//
|
||||
this.tcpipPortLabel.AutoSize = true;
|
||||
this.tcpipPortLabel.Location = new System.Drawing.Point(46, 109);
|
||||
this.tcpipPortLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.tcpipPortLabel.Location = new System.Drawing.Point(31, 71);
|
||||
this.tcpipPortLabel.Name = "tcpipPortLabel";
|
||||
this.tcpipPortLabel.Size = new System.Drawing.Size(68, 20);
|
||||
this.tcpipPortLabel.Size = new System.Drawing.Size(47, 13);
|
||||
this.tcpipPortLabel.TabIndex = 4;
|
||||
this.tcpipPortLabel.Text = "Port nr..:";
|
||||
//
|
||||
// tcpipPortTextBox
|
||||
//
|
||||
this.tcpipPortTextBox.Enabled = false;
|
||||
this.tcpipPortTextBox.Location = new System.Drawing.Point(161, 105);
|
||||
this.tcpipPortTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.tcpipPortTextBox.Location = new System.Drawing.Point(107, 68);
|
||||
this.tcpipPortTextBox.Name = "tcpipPortTextBox";
|
||||
this.tcpipPortTextBox.Size = new System.Drawing.Size(57, 26);
|
||||
this.tcpipPortTextBox.Size = new System.Drawing.Size(39, 20);
|
||||
this.tcpipPortTextBox.TabIndex = 5;
|
||||
//
|
||||
// ipAddressLabel
|
||||
//
|
||||
this.ipAddressLabel.AutoSize = true;
|
||||
this.ipAddressLabel.Location = new System.Drawing.Point(46, 74);
|
||||
this.ipAddressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.ipAddressLabel.Location = new System.Drawing.Point(31, 48);
|
||||
this.ipAddressLabel.Name = "ipAddressLabel";
|
||||
this.ipAddressLabel.Size = new System.Drawing.Size(93, 20);
|
||||
this.ipAddressLabel.Size = new System.Drawing.Size(63, 13);
|
||||
this.ipAddressLabel.TabIndex = 2;
|
||||
this.ipAddressLabel.Text = "IP address.:";
|
||||
//
|
||||
// ipAddressTextBox
|
||||
//
|
||||
this.ipAddressTextBox.Enabled = false;
|
||||
this.ipAddressTextBox.Location = new System.Drawing.Point(161, 69);
|
||||
this.ipAddressTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.ipAddressTextBox.Location = new System.Drawing.Point(107, 45);
|
||||
this.ipAddressTextBox.Name = "ipAddressTextBox";
|
||||
this.ipAddressTextBox.Size = new System.Drawing.Size(145, 26);
|
||||
this.ipAddressTextBox.Size = new System.Drawing.Size(98, 20);
|
||||
this.ipAddressTextBox.TabIndex = 3;
|
||||
//
|
||||
// radioButton1
|
||||
@@ -326,10 +316,9 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
this.radioButton1.AutoSize = true;
|
||||
this.radioButton1.Checked = true;
|
||||
this.radioButton1.Enabled = false;
|
||||
this.radioButton1.Location = new System.Drawing.Point(33, 29);
|
||||
this.radioButton1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.radioButton1.Location = new System.Drawing.Point(22, 19);
|
||||
this.radioButton1.Name = "radioButton1";
|
||||
this.radioButton1.Size = new System.Drawing.Size(109, 24);
|
||||
this.radioButton1.Size = new System.Drawing.Size(83, 17);
|
||||
this.radioButton1.TabIndex = 0;
|
||||
this.radioButton1.TabStop = true;
|
||||
this.radioButton1.Text = "Use TCP/IP";
|
||||
@@ -339,10 +328,9 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
//
|
||||
this.radioButton2.AutoSize = true;
|
||||
this.radioButton2.Enabled = false;
|
||||
this.radioButton2.Location = new System.Drawing.Point(351, 29);
|
||||
this.radioButton2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.radioButton2.Location = new System.Drawing.Point(234, 19);
|
||||
this.radioButton2.Name = "radioButton2";
|
||||
this.radioButton2.Size = new System.Drawing.Size(129, 24);
|
||||
this.radioButton2.Size = new System.Drawing.Size(92, 17);
|
||||
this.radioButton2.TabIndex = 1;
|
||||
this.radioButton2.Text = "Use serial port";
|
||||
this.radioButton2.UseVisualStyleBackColor = true;
|
||||
@@ -350,108 +338,98 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader
|
||||
// optoSerialPortLabel
|
||||
//
|
||||
this.optoSerialPortLabel.AutoSize = true;
|
||||
this.optoSerialPortLabel.Location = new System.Drawing.Point(361, 69);
|
||||
this.optoSerialPortLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.optoSerialPortLabel.Location = new System.Drawing.Point(241, 45);
|
||||
this.optoSerialPortLabel.Name = "optoSerialPortLabel";
|
||||
this.optoSerialPortLabel.Size = new System.Drawing.Size(107, 20);
|
||||
this.optoSerialPortLabel.Size = new System.Drawing.Size(72, 13);
|
||||
this.optoSerialPortLabel.TabIndex = 6;
|
||||
this.optoSerialPortLabel.Text = "Serial port nr.:";
|
||||
//
|
||||
// optoSerialPortTextBox
|
||||
//
|
||||
this.optoSerialPortTextBox.Enabled = false;
|
||||
this.optoSerialPortTextBox.Location = new System.Drawing.Point(494, 65);
|
||||
this.optoSerialPortTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.optoSerialPortTextBox.Location = new System.Drawing.Point(329, 42);
|
||||
this.optoSerialPortTextBox.Name = "optoSerialPortTextBox";
|
||||
this.optoSerialPortTextBox.Size = new System.Drawing.Size(49, 26);
|
||||
this.optoSerialPortTextBox.Size = new System.Drawing.Size(34, 20);
|
||||
this.optoSerialPortTextBox.TabIndex = 7;
|
||||
//
|
||||
// groupTextBox
|
||||
//
|
||||
this.groupTextBox.Enabled = false;
|
||||
this.groupTextBox.Location = new System.Drawing.Point(172, 121);
|
||||
this.groupTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.groupTextBox.Location = new System.Drawing.Point(115, 79);
|
||||
this.groupTextBox.Name = "groupTextBox";
|
||||
this.groupTextBox.Size = new System.Drawing.Size(49, 26);
|
||||
this.groupTextBox.Size = new System.Drawing.Size(34, 20);
|
||||
this.groupTextBox.TabIndex = 22;
|
||||
//
|
||||
// groupLabel
|
||||
//
|
||||
this.groupLabel.AutoSize = true;
|
||||
this.groupLabel.Location = new System.Drawing.Point(7, 126);
|
||||
this.groupLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.groupLabel.Location = new System.Drawing.Point(5, 82);
|
||||
this.groupLabel.Name = "groupLabel";
|
||||
this.groupLabel.Size = new System.Drawing.Size(67, 20);
|
||||
this.groupLabel.Size = new System.Drawing.Size(45, 13);
|
||||
this.groupLabel.TabIndex = 21;
|
||||
this.groupLabel.Text = "Group 2";
|
||||
//
|
||||
// muxBoardNrTextBox
|
||||
//
|
||||
this.muxBoardNrTextBox.Enabled = false;
|
||||
this.muxBoardNrTextBox.Location = new System.Drawing.Point(172, 86);
|
||||
this.muxBoardNrTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.muxBoardNrTextBox.Location = new System.Drawing.Point(115, 56);
|
||||
this.muxBoardNrTextBox.Name = "muxBoardNrTextBox";
|
||||
this.muxBoardNrTextBox.Size = new System.Drawing.Size(49, 26);
|
||||
this.muxBoardNrTextBox.Size = new System.Drawing.Size(34, 20);
|
||||
this.muxBoardNrTextBox.TabIndex = 20;
|
||||
//
|
||||
// muxBoardNrLabel
|
||||
//
|
||||
this.muxBoardNrLabel.AutoSize = true;
|
||||
this.muxBoardNrLabel.Location = new System.Drawing.Point(7, 90);
|
||||
this.muxBoardNrLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.muxBoardNrLabel.Location = new System.Drawing.Point(5, 58);
|
||||
this.muxBoardNrLabel.Name = "muxBoardNrLabel";
|
||||
this.muxBoardNrLabel.Size = new System.Drawing.Size(159, 20);
|
||||
this.muxBoardNrLabel.Size = new System.Drawing.Size(106, 13);
|
||||
this.muxBoardNrLabel.TabIndex = 19;
|
||||
this.muxBoardNrLabel.Text = "Group 1 (mux. board)";
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(172, 50);
|
||||
this.nameTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.nameTextBox.Location = new System.Drawing.Point(115, 32);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(180, 26);
|
||||
this.nameTextBox.Size = new System.Drawing.Size(121, 20);
|
||||
this.nameTextBox.TabIndex = 17;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(7, 55);
|
||||
this.nameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.nameLabel.Location = new System.Drawing.Point(5, 36);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(51, 20);
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 16;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
//
|
||||
this.classNameLabel.AutoSize = true;
|
||||
this.classNameLabel.Location = new System.Drawing.Point(168, 14);
|
||||
this.classNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.classNameLabel.Location = new System.Drawing.Point(112, 9);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(90, 20);
|
||||
this.classNameLabel.Size = new System.Drawing.Size(60, 13);
|
||||
this.classNameLabel.TabIndex = 15;
|
||||
this.classNameLabel.Text = "ClassName";
|
||||
//
|
||||
// tabPage2
|
||||
//
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 29);
|
||||
this.tabPage2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage2.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tabPage2.Size = new System.Drawing.Size(679, 507);
|
||||
this.tabPage2.Padding = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.tabPage2.Size = new System.Drawing.Size(450, 325);
|
||||
this.tabPage2.TabIndex = 1;
|
||||
this.tabPage2.Text = "Test";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// GenesisCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.tabControl1);
|
||||
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.Name = "GenesisCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(694, 548);
|
||||
this.Size = new System.Drawing.Size(463, 356);
|
||||
this.Load += new System.EventHandler(this.WaterMeterCfgCtrl_Load);
|
||||
this.tabControl1.ResumeLayout(false);
|
||||
this.tabPage1.ResumeLayout(false);
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using GenesisCordonelInterface.API;
|
||||
using GenesisCordonelInterface.Core.Threading;
|
||||
using TBF.Rig.BridgeComponents.GciBridge;
|
||||
|
||||
|
||||
namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
{
|
||||
public class GciBridgeClient : IGciBridgeClient
|
||||
{
|
||||
private readonly GciBridge bridge;
|
||||
|
||||
public GciBridgeClient(GciBridge bridge)
|
||||
{
|
||||
this.bridge = bridge;
|
||||
}
|
||||
|
||||
public Task<RetryResult<PublicModels.RegisterReadResult>>
|
||||
ReadRegisterWithRetryAsync(
|
||||
int slotId,
|
||||
string registerName,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return bridge.ReadRegisterWithRetryAsync(
|
||||
slotId,
|
||||
registerName,
|
||||
token);
|
||||
}
|
||||
|
||||
public Task<RetryResult<PublicModels.RegisterWriteResult>>
|
||||
WriteRegisterWithRetryAsync(
|
||||
int slotId,
|
||||
string registerName,
|
||||
ushort value,
|
||||
bool verify,
|
||||
bool throwOnError,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return bridge.WriteRegisterWithRetryAsync(
|
||||
slotId,
|
||||
registerName,
|
||||
value,
|
||||
verify,
|
||||
throwOnError,
|
||||
token);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using GenesisCordonelInterface.API;
|
||||
using GenesisCordonelInterface.Core.Threading;
|
||||
|
||||
namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
{
|
||||
public interface IGciBridgeClient
|
||||
{
|
||||
Task<RetryResult<PublicModels.RegisterReadResult>>
|
||||
ReadRegisterWithRetryAsync(
|
||||
int slotId,
|
||||
string registerName,
|
||||
CancellationToken token = default);
|
||||
|
||||
Task<RetryResult<PublicModels.RegisterWriteResult>>
|
||||
WriteRegisterWithRetryAsync(
|
||||
int slotId,
|
||||
string registerName,
|
||||
ushort value,
|
||||
bool verify,
|
||||
bool throwOnError,
|
||||
CancellationToken token = default);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,176 +1,533 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using GenesisCordonelInterface.API;
|
||||
using log4net;
|
||||
using TBF.Rig.BridgeComponents.GciBridge;
|
||||
using TBF.Rig.RegisterReaders.GenesisRegReader.common;
|
||||
using TBF.Rig.RegisterReaders.GenesisRegReader.communication.common;
|
||||
using TBF.Rig.RegisterReaders.GenesisRegReader.implementations;
|
||||
using TBF.Rig.TestMethods.iPerlCommunication.communication.C4.diagnosticLed;
|
||||
using TBF.Rig.TestMethods.iPerlCommunication.communication.C4.protocolCommons;
|
||||
using PublicModels = TBF.Rig.BridgeComponents.GciBridge.Interfaces.PublicModels;
|
||||
|
||||
|
||||
namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
{
|
||||
public class ReadPcbResult
|
||||
{
|
||||
public bool IsConnected { get; set; }
|
||||
|
||||
public bool IsLoggedOn { get; set; }
|
||||
|
||||
public bool IsValidPcb { get; set; }
|
||||
|
||||
public string PcbId { get; set; }
|
||||
|
||||
public string Message { get; set; }
|
||||
}
|
||||
|
||||
public class RadioService
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(RadioService));
|
||||
|
||||
|
||||
static string okResponse = "Command complete, no errors";
|
||||
static string errorResponse = "Unable to execute";
|
||||
|
||||
private bool bConnected = false;
|
||||
|
||||
private GciBridge _bridge;
|
||||
|
||||
public RadioService(GciBridge genesisHeadCommInterfaceBridgeComponent)
|
||||
{
|
||||
this._bridge = genesisHeadCommInterfaceBridgeComponent;
|
||||
log.Debug("RadioService created with GciBridge= " + genesisHeadCommInterfaceBridgeComponent + "");
|
||||
this._bridge = genesisHeadCommInterfaceBridgeComponent;
|
||||
log.Debug("RadioService created with GciBridge= " + genesisHeadCommInterfaceBridgeComponent + "");
|
||||
}
|
||||
|
||||
public async Task<string> ReadRequest_PCBAsync(GenesisSmartReader iHead)
|
||||
|
||||
private async Task<ReadPcbResult> EnsureConnectedAsync(
|
||||
GenesisSmartReader head,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return null;
|
||||
|
||||
var connectTask = iHead.CommInterfaceBridge.ConnectAsync(iHead.GetSlotNr);
|
||||
|
||||
// Wait either for ConnectAsync or timeout
|
||||
if (await Task.WhenAny(connectTask, Task.Delay(TimeSpan.FromMinutes(1))) != connectTask)
|
||||
log.Debug("EnsureConnectedAsync called for iHead: " + head);
|
||||
if (head?.CommInterfaceBridge == null)
|
||||
{
|
||||
// Timed out
|
||||
return null;
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = false,
|
||||
IsLoggedOn = false,
|
||||
IsValidPcb = false,
|
||||
Message = "CommInterfaceBridge is null."
|
||||
};
|
||||
}
|
||||
|
||||
var slotInfo = await _bridge.GetSlotAsync(head.GetSlotNr);
|
||||
if (slotInfo == null || !slotInfo.Success)
|
||||
{
|
||||
//just no definet yet ?
|
||||
log.Debug("EnsureConnectedAsync() - SlotInfo is null.");
|
||||
}
|
||||
else if (slotInfo.IsConnected)
|
||||
{
|
||||
log.Debug("EnsureConnectedAsync() - Slot: " + slotInfo);
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = true,
|
||||
IsLoggedOn = slotInfo.IsLoggedOn,
|
||||
IsValidPcb = false,
|
||||
PcbId = slotInfo.PcbId,
|
||||
Message = "Already connected."
|
||||
};
|
||||
}
|
||||
|
||||
log.Debug("EnsureConnectedAsync() - Connecting...");
|
||||
|
||||
var connectTask = head.CommInterfaceBridge.ConnectAsync(head.GetSlotNr, token);
|
||||
var timeoutTask = Task.Delay(TimeSpan.FromMinutes(1), token);
|
||||
|
||||
var completedTask = await Task.WhenAny(connectTask, timeoutTask);
|
||||
|
||||
if (completedTask != connectTask)
|
||||
{
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = false,
|
||||
IsLoggedOn = false,
|
||||
IsValidPcb = false,
|
||||
Message = "Connect timeout."
|
||||
};
|
||||
}
|
||||
|
||||
var result = await connectTask;
|
||||
|
||||
if (result == null || !result.Success || !result.IsConnected)
|
||||
return null;
|
||||
|
||||
string pcbId = result.PcbId;
|
||||
|
||||
if (!string.IsNullOrEmpty(pcbId))
|
||||
if (result == null || !result.Success)
|
||||
{
|
||||
if (iHead.ConfigStruct != null)
|
||||
iHead.ConfigStruct.PCBNumberString = pcbId;
|
||||
|
||||
return pcbId;
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = false,
|
||||
IsLoggedOn = false,
|
||||
IsValidPcb = false,
|
||||
Message = result == null ? "Connect result is null." : "Connect failed."
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = result.IsConnected,
|
||||
IsLoggedOn = false,
|
||||
IsValidPcb = false,
|
||||
Message = "Connected OK."
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public async Task<PublicModels.UdsPasswordResult> FindKeyStone(
|
||||
string txtPCBId,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
string pcbId = txtPCBId?.Trim();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(pcbId))
|
||||
throw new Exception("PCB ID is empty.");
|
||||
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
PublicModels.UdsPasswordResult result = await _bridge.GetPasswordAsync(pcbId, token);
|
||||
|
||||
log.Debug("GetPasswordAsync PCB=" + pcbId + " Result: " + result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<GenesisCordonelInterface.API.PublicModels.GciLoginResult> LoginByPasswordAsync(
|
||||
int slotId, string txtPassword,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(txtPassword))
|
||||
throw new Exception("LoginByPasswordAsync() - PASSWORD is empty.");
|
||||
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
log.Debug($"LoginByPasswordAsync( Slot: {slotId}) - set password to: " + txtPassword.Substring(0, 4) + "************");
|
||||
var gciSetPasswordResult = await _bridge.SetPasswordAsync(slotId,txtPassword, token);
|
||||
log.Debug($"LoginByPasswordAsync( Slot: {slotId}) - SetPasswordAsync Result: " + gciSetPasswordResult);
|
||||
|
||||
// LOGIN
|
||||
log.Debug($"LoginByPasswordAsync( Slot: {slotId}) - START LOGIN");
|
||||
var gciSlotInfo = await _bridge.GetSlotAsync(slotId);
|
||||
log.Debug($"LoginByPasswordAsync( Checked before Login() Slot: {slotId}) - START LOGIN Slot: {gciSlotInfo}");
|
||||
GenesisCordonelInterface.API.PublicModels.GciLoginResult result = await _bridge.LoginAsync(slotId, token);
|
||||
log.Debug($"LoginByPasswordAsync( Slot: {slotId}) Result: " + result);
|
||||
log.Debug($"LoginByPasswordAsync( Slot: {slotId}) - END LOGIN, Success: {result.Success}");
|
||||
// ~ LOGIN
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public string ReadRequest_PCB(ref GenesisSmartReader iHead)
|
||||
public async Task<ReadPcbResult> ReadRequest_PCBAsync( GenesisSmartReader head, bool bReload = false)
|
||||
{
|
||||
log.Debug("ReadRequest_PCB called for iHead: " + iHead.ToString());
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return null;
|
||||
log.Debug("ReadRequest_PCB called for iHead: " + head);
|
||||
|
||||
// -- connection --
|
||||
var connectTask = iHead.CommInterfaceBridge.ConnectAsync(iHead.GetSlotNr);
|
||||
log.Debug("ReadRequest_PCB() - ConnectAsync created, Now waiting for result");
|
||||
|
||||
var completedTask = Task.WhenAny(
|
||||
connectTask,
|
||||
Task.Delay(TimeSpan.FromMinutes(1))
|
||||
).GetAwaiter().GetResult();
|
||||
|
||||
log.Debug("ReadRequest_PCB() - CompletedTask: " + completedTask);
|
||||
|
||||
// Timeout happened
|
||||
if (completedTask != connectTask)
|
||||
if (head?.CommInterfaceBridge == null)
|
||||
{
|
||||
log.Debug("ReadRequest_PCB() - Timeout happened");
|
||||
return null;
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = false,
|
||||
IsValidPcb = false,
|
||||
Message = "CommInterfaceBridge is null."
|
||||
};
|
||||
}
|
||||
|
||||
var result = connectTask.GetAwaiter().GetResult();
|
||||
log.Debug("ReadRequest_PCB() - ConnectAsync completed");
|
||||
|
||||
if (result == null || !result.Success || !result.IsConnected)
|
||||
return null;
|
||||
log.Debug("ReadRequest_PCB() - result: " + result);
|
||||
//~ -- connection --
|
||||
|
||||
string pcbId = result.PcbId;
|
||||
log.Debug("ReadRequest_PCB() - pcbId: " + pcbId);
|
||||
|
||||
if (!string.IsNullOrEmpty(pcbId))
|
||||
try
|
||||
{
|
||||
if (iHead.ConfigStruct != null)
|
||||
// CONNECT ONLY IF NEEDED
|
||||
var connectResult = await EnsureConnectedAsync(head);
|
||||
|
||||
if (!connectResult.IsConnected)
|
||||
{
|
||||
iHead.ConfigStruct.PCBNumberString = pcbId;
|
||||
log.Debug("ReadRequest_PCB() - iHead.ConfigStruct.PCBNumberString: " + iHead.ConfigStruct.PCBNumberString);
|
||||
return connectResult;
|
||||
}
|
||||
|
||||
return pcbId;
|
||||
log.Debug($"ReadRequest_PCB() connect - {connectResult.Message}");
|
||||
|
||||
//Check if exist PCB
|
||||
if (!bReload)
|
||||
{
|
||||
var gciSlotInfo = await head.CommInterfaceBridge.GetSlotAsync(head.GetSlotNr);
|
||||
|
||||
if (gciSlotInfo == null && gciSlotInfo.Success && string.IsNullOrEmpty(gciSlotInfo.PcbId))
|
||||
{
|
||||
log.Debug(
|
||||
$"BuildConnection() - SlotNr: {head.GetSlotNr} already exist PCB: {gciSlotInfo.PcbId}");
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = gciSlotInfo.IsConnected,
|
||||
IsValidPcb = true,
|
||||
PcbId = gciSlotInfo.PcbId,
|
||||
Message = "PCB already exist."
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// PCB READ LOOP
|
||||
string validPcbId = null;
|
||||
int maxAttempts = 5;
|
||||
DateTime startTime = DateTime.UtcNow;
|
||||
TimeSpan maxDuration = TimeSpan.FromSeconds(30);
|
||||
|
||||
//LOOP
|
||||
for (int attempt = 1; attempt <= maxAttempts; attempt++)
|
||||
{
|
||||
if (DateTime.UtcNow - startTime > maxDuration)
|
||||
{
|
||||
log.Debug($"ReadRequest_PCB({head.GetSlotNr}) - PCB max duration exceeded");
|
||||
break;
|
||||
}
|
||||
|
||||
log.Debug($"ReadRequest_PCB({head.GetSlotNr}) - PCB attempt {attempt}/{maxAttempts}");
|
||||
var pcbTask = head.CommInterfaceBridge.GetPcbIdAsync(head.GetSlotNr);
|
||||
var timeoutTaskPcb = Task.Delay(TimeSpan.FromSeconds(5));
|
||||
var completedTaskPcb = await Task.WhenAny(pcbTask, timeoutTaskPcb);
|
||||
|
||||
if (completedTaskPcb != pcbTask)
|
||||
{
|
||||
log.Debug($"ReadRequest_PCB() PCB attempt {attempt} - Timeout");
|
||||
continue;
|
||||
}
|
||||
|
||||
var resultPCB = await pcbTask;
|
||||
|
||||
// VALIDATION BLOCK
|
||||
{
|
||||
if (resultPCB == null)
|
||||
{
|
||||
log.Debug($"ReadRequest_PCB({head.GetSlotNr}) PCB attempt {attempt} - result is null");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!resultPCB.Success)
|
||||
{
|
||||
log.Debug($"ReadRequest_PCB({head.GetSlotNr}) PCB attempt {attempt} - Success=false");
|
||||
continue;
|
||||
}
|
||||
|
||||
string pcbId = resultPCB.PcbId;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(pcbId))
|
||||
{
|
||||
log.Debug($"ReadRequest_PCB({head.GetSlotNr}) PCB attempt {attempt} - PCB empty");
|
||||
continue;
|
||||
}
|
||||
|
||||
pcbId = pcbId.Trim();
|
||||
|
||||
if (pcbId.Length != 9)
|
||||
{
|
||||
log.Debug( $"ReadRequest_PCB({head.GetSlotNr}) PCB attempt {attempt} - Invalid PCB length: '{pcbId}', len={pcbId.Length}");
|
||||
continue;
|
||||
}
|
||||
|
||||
validPcbId = pcbId;
|
||||
log.Debug($"ReadRequest_PCB({head.GetSlotNr}) PCB valid: {validPcbId}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(validPcbId))
|
||||
{
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = connectResult.IsConnected,
|
||||
IsValidPcb = false,
|
||||
PcbId = null,
|
||||
Message = "Valid PCB not found."
|
||||
};
|
||||
}
|
||||
|
||||
if (head.ConfigStruct != null)
|
||||
{
|
||||
head.ConfigStruct.PCBNumberString = validPcbId;
|
||||
}
|
||||
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = connectResult.IsConnected,
|
||||
IsValidPcb = true,
|
||||
PcbId = validPcbId,
|
||||
Message = "PCB OK"
|
||||
};
|
||||
}
|
||||
|
||||
log.Debug("ReadRequest_PCB() - pcbId is empty");
|
||||
return null;
|
||||
}
|
||||
|
||||
public ProtocolStatuses GetActivityStatusMode(GenesisSmartReader iHead)
|
||||
{
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return ProtocolStatuses.Unknown;
|
||||
|
||||
var connectResult = iHead.CommInterfaceBridge
|
||||
.ConnectAsync(iHead.GetSlotNr)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
if (connectResult == null || !connectResult.Success || !connectResult.IsConnected)
|
||||
return ProtocolStatuses.Unknown;
|
||||
|
||||
var pcbResult = iHead.CommInterfaceBridge
|
||||
.GetPcbIdAsync(iHead.GetSlotNr)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
if (pcbResult == null || !pcbResult.Success || string.IsNullOrWhiteSpace(pcbResult.PcbId))
|
||||
return ProtocolStatuses.Unknown;
|
||||
|
||||
if (iHead.ConfigStruct != null)
|
||||
catch (Exception ex)
|
||||
{
|
||||
iHead.ConfigStruct.PCBNumberString = pcbResult.PcbId;
|
||||
}
|
||||
log.Error("ReadRequest_PCBAsync() failed", ex);
|
||||
|
||||
return ProtocolStatuses.Active;
|
||||
return new ReadPcbResult
|
||||
{
|
||||
IsConnected = false,
|
||||
IsValidPcb = false,
|
||||
PcbId = null,
|
||||
Message = ex.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public DiagnosticLedState SetOptoStatusMode(GenesisSmartReader iHead, DiagnosticLedState opthoStatusMode)
|
||||
|
||||
public async Task<bool> PrepareLoginAdnConnect_Async(
|
||||
GenesisSmartReader iHead,
|
||||
bool isConnected,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
log.Debug("PrepareLoginAdnConnect_Async called for iHead: " + iHead + " isConnected: " + isConnected);
|
||||
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return DiagnosticLedState.StatusUnknown;
|
||||
return false;
|
||||
|
||||
var connectResult = iHead.CommInterfaceBridge
|
||||
.ConnectAsync(iHead.GetSlotNr)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
if (connectResult == null || !connectResult.Success || !connectResult.IsConnected)
|
||||
return DiagnosticLedState.StatusUnknown;
|
||||
|
||||
//SetDiagnosticLEDState
|
||||
|
||||
var pcbResult = iHead.CommInterfaceBridge
|
||||
.GetPcbIdAsync(iHead.GetSlotNr)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
if (pcbResult == null || !pcbResult.Success || string.IsNullOrWhiteSpace(pcbResult.PcbId))
|
||||
return DiagnosticLedState.StatusUnknown;
|
||||
|
||||
if (iHead.ConfigStruct != null)
|
||||
try
|
||||
{
|
||||
iHead.ConfigStruct.PCBNumberString = pcbResult.PcbId;
|
||||
}
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
var connectResult = await EnsureConnectedAsync(iHead, token);
|
||||
|
||||
|
||||
return DiagnosticLedState.StatusUnknown;
|
||||
if (!connectResult.IsConnected)
|
||||
return false;
|
||||
log.Debug($"PrepareLoginAdnConnect_Async() connect - {connectResult.Message}");
|
||||
|
||||
if (connectResult.IsLoggedOn)
|
||||
return true;
|
||||
|
||||
//get stored PCB - Keystone
|
||||
log.Debug("Have we PCB stored?");
|
||||
string pcb = iHead.ConfigStruct?.PCBNumberString;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(pcb))
|
||||
{
|
||||
pcb = connectResult.PcbId;
|
||||
if (string.IsNullOrWhiteSpace(pcb))
|
||||
{
|
||||
pcb = iHead.SerialNr;
|
||||
}
|
||||
//GET PCB FROM Meter
|
||||
if (string.IsNullOrWhiteSpace(pcb))
|
||||
{
|
||||
log.Debug("PrepareLoginAdnConnect_Async() No PCB stored. Trying to get PCB from Meter");
|
||||
var pcbResult = await ReadRequest_PCBAsync(iHead);
|
||||
if (pcbResult.IsValidPcb)
|
||||
{
|
||||
pcb = pcbResult.PcbId;
|
||||
iHead.SerialNr = pcb;
|
||||
if (iHead.ConfigStruct != null)
|
||||
{
|
||||
iHead.ConfigStruct.PCBNumberString = pcb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(pcb))
|
||||
{
|
||||
log.Debug("PrepareLoginAdnConnect_Async() No PCB stored. MISSING PCB!!!!!");
|
||||
return false;
|
||||
}
|
||||
|
||||
log.Debug( $"PrepareLoginAdnConnect_Async() Start Find Keystone Slot: {iHead.GetSlotNr} PCB:{iHead.SerialNr} Calib PCB:{pcb} - find keystone");
|
||||
|
||||
var keyStoneResult = await FindKeyStone(pcb, token);
|
||||
|
||||
if (keyStoneResult == null || !keyStoneResult.Success)
|
||||
return false;
|
||||
|
||||
//LOGIN
|
||||
|
||||
log.Debug( $"PrepareLoginAdnConnect_Async() Start Login Slot: {iHead.GetSlotNr} PCB:{iHead.SerialNr} Calib PCB:{pcb} - login");
|
||||
GenesisCordonelInterface.API.PublicModels.GciLoginResult loginByPasswordAsync =
|
||||
await LoginByPasswordAsync(iHead.GetSlotNr, keyStoneResult.Password, token);
|
||||
|
||||
if (loginByPasswordAsync == null || !loginByPasswordAsync.Success)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
log.Debug($"PrepareLoginAdnConnect_Async() Login OK");
|
||||
return true;
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
log.Debug("PrepareLoginAdnConnect_Async() canceled.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly String LedMode = "GENESISFLOW_LedMode";
|
||||
public static readonly String SampleRate = "GENESISFLOW_SampleRate";
|
||||
public static readonly String CalFactor1 = "GENESISFLOW_CalFactor1";
|
||||
public static readonly String CalFactor2 = "GENESISFLOW_CalFactor2";
|
||||
public static readonly String CalFactor3 = "GENESISFLOW_CalFactor3";
|
||||
public static readonly String ResetAccumulators = "GENESISFLOW_ResetAccumulators";
|
||||
public static readonly String ForwardArrow = "GENESISFLOW_ForwardArrow";
|
||||
public static readonly String StoreCalibration = "GENESISFLOW_StoreCalibration";
|
||||
public static readonly String TriggerIdle = "GENESISFLOW_TriggerIdle";
|
||||
public static readonly String MeterSize = "GENESISFLOW_MeterSize";
|
||||
|
||||
public async Task<LedState> GetActivityLedStatusMode_Async(
|
||||
GenesisSmartReader iHead,
|
||||
bool isConnected,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
log.Debug("GetActivityLedStatusMode_Async called for iHead: " + iHead + " isConnected: " + isConnected);
|
||||
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return LedState.Unknown;
|
||||
|
||||
try
|
||||
{
|
||||
var loginAdnConnectAsync = await PrepareLoginAdnConnect_Async(iHead, isConnected, token);
|
||||
|
||||
if (!loginAdnConnectAsync)
|
||||
return LedState.Unknown;
|
||||
|
||||
//Get Activity Status
|
||||
|
||||
var registerReadResult =
|
||||
await _bridge.ReadRegisterWithRetryAsync(iHead.GetSlotNr,LedMode, token);
|
||||
|
||||
if (registerReadResult == null || !registerReadResult.Success)
|
||||
{
|
||||
return LedState.Unknown;
|
||||
}
|
||||
log.Debug($"GetActivityStatusMode() Read Register OK Response: {registerReadResult}");
|
||||
try
|
||||
{
|
||||
byte[] bytes = HexFormatter.HexStringToByteArray(registerReadResult.Result.RawHex);
|
||||
//Convert byte array to int
|
||||
if (bytes == null || bytes.Length < 4)
|
||||
{
|
||||
log.Debug("Invalid byte array length");
|
||||
return LedState.Unknown;
|
||||
}
|
||||
|
||||
int value = BitConverter.ToInt32(bytes, 0);
|
||||
|
||||
// continue your real status logic here...
|
||||
return value == 6 ? LedState.active : LedState.inactive;
|
||||
}catch(Exception ex)
|
||||
{
|
||||
log.Error("GetActivityStatusMode() failed", ex);
|
||||
return LedState.Unknown;
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
log.Debug("GetActivityLedStatusMode_Async() canceled.");
|
||||
return LedState.Unknown;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("GetActivityLedStatusMode_Async() failed", ex);
|
||||
return LedState.Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> SetLedMode_Async(GenesisSmartReader iHead, LedState ledMode, bool isConnected,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
log.Debug("SetLedMode_Async called for iHead: " + iHead + " isConnected: " + isConnected);
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
var loginAdnConnectAsync = await PrepareLoginAdnConnect_Async(iHead, isConnected, token);
|
||||
|
||||
if (!loginAdnConnectAsync)
|
||||
return false;
|
||||
|
||||
//Get Activity Status
|
||||
byte valueLed = (ledMode == LedState.active) ? (byte)6 : (byte)0;
|
||||
log.Debug($"SetLedMode_Async() Set Led Mode: {valueLed}");
|
||||
var registerWriteResult =
|
||||
await _bridge.WriteRegisterAsync(iHead.GetSlotNr, LedMode, valueLed, false, false, token);
|
||||
|
||||
if (registerWriteResult == null || !registerWriteResult.Success)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
log.Debug($"SetLedMode_Async() Write Register OK Response: {registerWriteResult}");
|
||||
return true;
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
log.Debug("GetActivityLedStatusMode_Async() canceled.");
|
||||
return false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("GetActivityLedStatusMode_Async() failed", ex);
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
log.Debug("SetLedMode_Async() - End - DO DISCONNECT");
|
||||
var gciDisconnectResult = await _bridge.DisconnectAsync(iHead.GetSlotNr);
|
||||
log.Debug($"SetLedMode_Async() Disconnect Result: {gciDisconnectResult}");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> Disconnect_Async(GenesisSmartReader iHead)
|
||||
{
|
||||
try
|
||||
{
|
||||
log.Debug("Disconnect_Async() - Start");
|
||||
var gciSlotInfo = await _bridge.GetSlotAsync(iHead.GetSlotNr);
|
||||
log.Debug($"Disconnect_Async() - Slot: {iHead.GetSlotNr} - SlotInfo: {gciSlotInfo}");
|
||||
log.Debug("Disconnect_Async() - DO DISCONNECT");
|
||||
var gciDisconnectResult = await _bridge.DisconnectAsync(iHead.GetSlotNr);
|
||||
log.Debug($"Disconnect_Async() Disconnect Result: {gciDisconnectResult}");
|
||||
|
||||
return gciDisconnectResult.Success;
|
||||
}catch(Exception ex)
|
||||
{
|
||||
log.Error("Disconnect_Async() failed", ex);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static ushort SafeIntToUShort(int value)
|
||||
{
|
||||
if (value < ushort.MinValue || value > ushort.MaxValue)
|
||||
@@ -179,7 +536,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
return (ushort)value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public string GetVersion(GenesisSmartReader iHead)
|
||||
{
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
@@ -201,38 +558,50 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
// }
|
||||
// return version;
|
||||
// }
|
||||
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
|
||||
public bool SetActivityMode_Active(GenesisSmartReader iHead)
|
||||
|
||||
public async Task<bool> SetActivityMode_Active(GenesisSmartReader iHead,
|
||||
bool isConnected, CancellationToken token = default)
|
||||
{
|
||||
log.Debug("SetActivityMode_Active called for iHead: " + iHead + " isConnected: " + isConnected);
|
||||
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
return false;
|
||||
|
||||
var connectResult = iHead.CommInterfaceBridge
|
||||
.ConnectAsync(iHead.GetSlotNr)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
try
|
||||
{
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
if (connectResult == null || !connectResult.Success || !connectResult.IsConnected)
|
||||
var connectResult = await EnsureConnectedAsync(iHead, token);
|
||||
|
||||
if (!connectResult.IsConnected)
|
||||
return false;
|
||||
|
||||
isConnected = connectResult.IsConnected;
|
||||
|
||||
log.Debug($"SetActivityMode_Active() connect - {connectResult.Message}");
|
||||
|
||||
//Set LED to state 4
|
||||
// string version = _bridge?.GciExternalInterface?.GetPcbId(iHead.GetSlotNr);
|
||||
// if (!string.IsNullOrEmpty(version))
|
||||
// {
|
||||
// if (iHead.ConfigStruct != null) // store mechanism
|
||||
// {
|
||||
// iHead.ConfigStruct.Version = version;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
}catch(OperationCanceledException)
|
||||
{
|
||||
return false;
|
||||
|
||||
//Set LED to state 4
|
||||
// string version = _bridge?.GciExternalInterface?.GetPcbId(iHead.GetSlotNr);
|
||||
// if (!string.IsNullOrEmpty(version))
|
||||
// {
|
||||
// if (iHead.ConfigStruct != null) // store mechanism
|
||||
// {
|
||||
// iHead.ConfigStruct.Version = version;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public bool SetActivityMode_Idle(GenesisSmartReader iHead)
|
||||
{
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
@@ -245,7 +614,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
|
||||
if (connectResult == null || !connectResult.Success || !connectResult.IsConnected)
|
||||
return false;
|
||||
|
||||
|
||||
//Set Activity State Idle
|
||||
// string version = _bridge?.GciExternalInterface?.GetPcbId(iHead.GetSlotNr);
|
||||
// if (!string.IsNullOrEmpty(version))
|
||||
@@ -256,10 +625,10 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public bool SetOptTestMode(GenesisSmartReader iHead)
|
||||
{
|
||||
if (iHead?.CommInterfaceBridge == null)
|
||||
@@ -272,7 +641,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
|
||||
if (connectResult == null || !connectResult.Success || !connectResult.IsConnected)
|
||||
return false;
|
||||
|
||||
|
||||
//Set LED to state 4
|
||||
// string version = _bridge?.GciExternalInterface?.GetPcbId(iHead.GetSlotNr);
|
||||
// if (!string.IsNullOrEmpty(version))
|
||||
@@ -283,9 +652,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -316,7 +684,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -342,7 +710,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
|
||||
// }
|
||||
// return version;
|
||||
// }
|
||||
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication.common
|
||||
{
|
||||
public enum LedState : int
|
||||
{
|
||||
Unknown = -1,
|
||||
inactive = 0,
|
||||
active = 1,
|
||||
}
|
||||
}
|
||||
+40
-30
@@ -16,11 +16,15 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(GenesisSmartReader));
|
||||
private static readonly ILog logStream = LogManager.GetLogger("StreamData");
|
||||
|
||||
|
||||
Thread optoThread;
|
||||
//GenesisSmartReader _genesiHead;
|
||||
|
||||
public GenesisSmartReader Head { get { return ISmartReader as GenesisSmartReader;} }
|
||||
public GenesisSmartReader Head
|
||||
{
|
||||
get { return ISmartReader as GenesisSmartReader; }
|
||||
}
|
||||
|
||||
public ISmartReader ISmartReader { get; set; }
|
||||
|
||||
public bool stopWorkerThread { get; set; }
|
||||
@@ -36,13 +40,18 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
public void Destroy()
|
||||
{
|
||||
if(Head != null && Head.OptoHeadTest != null)
|
||||
{
|
||||
Head.OptoHeadTest.CloseConnection();
|
||||
}
|
||||
|
||||
stopWorkerThread = true;
|
||||
if (optoThread != null)
|
||||
{
|
||||
optoThread.Abort();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private const string StrReadPcbCmd = "ReadPCB";
|
||||
private const string StrSetTestModeCmd = "SetTestMode";
|
||||
private const string StrSetActiveModeCmd = "SetActiveMode";
|
||||
@@ -55,33 +64,33 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
public enum Operations
|
||||
{
|
||||
[Description(StrReadPcbCmd)]ReadPcbCmd,
|
||||
[Description(StrSetTestModeCmd)]SetTestModeCmd,
|
||||
[Description(StrSetActiveModeCmd)]SetActiveModeCmd,
|
||||
[Description(StrReadOptoDataCmd)]ReadOptoDataCmd,
|
||||
[Description(StrStopReadOptoDataCmd)]StopReadOptoDataCmd,
|
||||
[Description(StrResetNfcHeadCmd)]ResetNfcHeadCmd,
|
||||
[Description(StrSetNfcHeadCmd)]SetNfcHeadCmd,
|
||||
[Description(StrSetRfidHeadCmd)]SetRfidHeadCmd,
|
||||
[Description(StrEmptyCmd)]EmptyCmd
|
||||
[Description(StrReadPcbCmd)] ReadPcbCmd,
|
||||
[Description(StrSetTestModeCmd)] SetTestModeCmd,
|
||||
[Description(StrSetActiveModeCmd)] SetActiveModeCmd,
|
||||
[Description(StrReadOptoDataCmd)] ReadOptoDataCmd,
|
||||
[Description(StrStopReadOptoDataCmd)] StopReadOptoDataCmd,
|
||||
[Description(StrResetNfcHeadCmd)] ResetNfcHeadCmd,
|
||||
[Description(StrSetNfcHeadCmd)] SetNfcHeadCmd,
|
||||
[Description(StrSetRfidHeadCmd)] SetRfidHeadCmd,
|
||||
[Description(StrEmptyCmd)] EmptyCmd
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static readonly Dictionary<string, Operations> ItemsForIperlOperations = new Dictionary<string, Operations>
|
||||
{
|
||||
{"Read PCB", Operations.ReadPcbCmd},
|
||||
{"Set Test Mode", Operations.SetTestModeCmd},
|
||||
{"Set Active Mode", Operations.SetActiveModeCmd},
|
||||
|
||||
private static readonly Dictionary<string, Operations> ItemsForIperlOperations =
|
||||
new Dictionary<string, Operations>
|
||||
{
|
||||
{ "Read PCB", Operations.ReadPcbCmd },
|
||||
{ "Set Test Mode", Operations.SetTestModeCmd },
|
||||
{ "Set Active Mode", Operations.SetActiveModeCmd },
|
||||
#if TRUE
|
||||
{"Start Read Opto Data", Operations.ReadOptoDataCmd},
|
||||
{"Stop Read Opto Data", Operations.StopReadOptoDataCmd},
|
||||
{ "Start Read Opto Data", Operations.ReadOptoDataCmd },
|
||||
{ "Stop Read Opto Data", Operations.StopReadOptoDataCmd },
|
||||
#endif
|
||||
{" ", Operations.EmptyCmd},
|
||||
{"Reset NFC Head", Operations.ResetNfcHeadCmd},
|
||||
{"Set NFC Head Interface", Operations.SetNfcHeadCmd},
|
||||
{"Set RFID Head interface", Operations.SetRfidHeadCmd}
|
||||
};
|
||||
{ " ", Operations.EmptyCmd },
|
||||
{ "Reset NFC Head", Operations.ResetNfcHeadCmd },
|
||||
{ "Set NFC Head Interface", Operations.SetNfcHeadCmd },
|
||||
{ "Set RFID Head interface", Operations.SetRfidHeadCmd }
|
||||
};
|
||||
|
||||
public (string Name, string Value)[] GetComboOperationsPairs()
|
||||
{
|
||||
@@ -94,16 +103,17 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
a.RfidOutputListBox.Items.Clear();
|
||||
|
||||
log.Debug($"CommandTestButtonClick called: {a?.RfidCommandComboBox?.SelectedValue}");
|
||||
|
||||
|
||||
using (Tools.LogChecker logChecker = new Tools.LogChecker("RfidData", log4net.Core.Level.Debug))
|
||||
{
|
||||
ListItem rfidListItem = new ListItem();
|
||||
rfidListItem.Attributes.Add("style", "font-weight:bold");
|
||||
Operations selectedOperation;
|
||||
if(!ItemsForIperlOperations.TryGetValue((string)a.RfidCommandComboBox.SelectedValue, out selectedOperation))
|
||||
if (!ItemsForIperlOperations.TryGetValue((string)a.RfidCommandComboBox.SelectedValue,
|
||||
out selectedOperation))
|
||||
selectedOperation = Operations.EmptyCmd;
|
||||
bool isTestModeSuccessful = false;
|
||||
switch (selectedOperation)
|
||||
switch (selectedOperation)
|
||||
{
|
||||
case Operations.ReadPcbCmd:
|
||||
rfidListItem.Text = $"PCB: {Head.OptoHeadTest.ReadRequest_PCB()}";
|
||||
@@ -121,7 +131,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
break;
|
||||
case Operations.SetActiveModeCmd:
|
||||
rfidListItem.Text = Head.OptoHeadTest.SetActiveMode( ref isTestModeSuccessful);
|
||||
rfidListItem.Text = Head.OptoHeadTest.SetActiveMode(ref isTestModeSuccessful);
|
||||
stopWorkerThread = true;
|
||||
a.ISmartReader.StopDataStreamProcessing(); // close opto port
|
||||
break;
|
||||
|
||||
@@ -215,6 +215,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
|
||||
|
||||
public int ChannelsCount { get => iChanelsCount; }
|
||||
|
||||
private static int iChanelsCount = 3;
|
||||
private int firstChanel;
|
||||
|
||||
@@ -1338,16 +1340,6 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
void DataStreamPostProcessing()
|
||||
{
|
||||
PrepareCalculatedChannelData();
|
||||
try
|
||||
{
|
||||
log.DebugFormat("DataStreamPostProcessing() - harcoded call GetQ3Calibration(200.0, 120.0, 15625.0);");
|
||||
SetQ3Calibration(new double[]{15625.0,15625.0,15625.0 });
|
||||
CalculateQ3Calibration(200.0, 120.0);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"DataStreamPostProcessing -- Q3 CALIBRATION -- failed: {ex}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1881,7 +1873,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
_readLoopTask = Task.Run(() =>
|
||||
{
|
||||
log.Debug($"OPTHO {OptoComPortNr} background read loop started.");
|
||||
logStream.Debug($"OPTHO {OptoComPortNr} background read loop started.");
|
||||
|
||||
while (!token.IsCancellationRequested)
|
||||
{
|
||||
@@ -1937,12 +1929,12 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"OPTHO {OptoComPortNr} background read error: {ex.Message}");
|
||||
logStream.Error($"OPTHO {OptoComPortNr} background read error: {ex.Message}");
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug($"OPTHO {OptoComPortNr} background read loop stopped.");
|
||||
logStream.Debug($"OPTHO {OptoComPortNr} background read loop stopped.");
|
||||
}, token);
|
||||
}
|
||||
|
||||
@@ -2023,7 +2015,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
{
|
||||
try
|
||||
{
|
||||
log.Debug($"OPTHO {OptoComPortNr} processing loop started.");
|
||||
logStream.Debug($"OPTHO {OptoComPortNr} processing loop started.");
|
||||
|
||||
while (!token.IsCancellationRequested)
|
||||
{
|
||||
@@ -2053,14 +2045,14 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
if (blockCompleted)
|
||||
{
|
||||
log.Debug("Processing loop completed flow block detected.");
|
||||
logStream.Debug("Processing loop completed flow block detected.");
|
||||
if (resetSerialBuffersOnCompletedFlowBlock)
|
||||
ResetDataBuffer();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"Processing loop failed: {ex}");
|
||||
logStream.Error($"Processing loop failed: {ex}");
|
||||
}
|
||||
|
||||
continue;
|
||||
@@ -2074,16 +2066,16 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"OPTHO {OptoComPortNr} processing loop error: {ex}");
|
||||
logStream.Error($"OPTHO {OptoComPortNr} processing loop error: {ex}");
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug($"OPTHO {OptoComPortNr} processing loop stopped.");
|
||||
logStream.Debug($"OPTHO {OptoComPortNr} processing loop stopped.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"StartProcessingLoop fatal error: {ex}");
|
||||
logStream.Error($"StartProcessingLoop fatal error: {ex}");
|
||||
}
|
||||
}, token);
|
||||
}
|
||||
@@ -2112,13 +2104,13 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
// 🔴 STEP 1: Check if we should start processing
|
||||
if (startDataProcessing && optoState == DataStreamState.ProcessAndSave)
|
||||
{
|
||||
log.DebugFormat("Read Opto Data Line timestamp:{0} to process from queue: {1}",timestamp.ToString("HH:mm:ss.fff") , line);
|
||||
logStream.DebugFormat("Read Opto Data Line timestamp:{0} to process from queue: {1}",timestamp.ToString("HH:mm:ss.fff") , line);
|
||||
bool blockCompleted;
|
||||
ProcessOptoLine(line, optoState, out blockCompleted);
|
||||
|
||||
if (blockCompleted)
|
||||
{
|
||||
log.Debug("ReadOptoData() completed flow block detected.");
|
||||
logStream.Debug("ReadOptoData() completed flow block detected.");
|
||||
if (resetSerialBuffersOnCompletedFlowBlock) // DO NOT call ResetDataBuffer() here
|
||||
ResetDataBuffer();
|
||||
}
|
||||
@@ -2126,7 +2118,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"OPTHO {OptoComPortNr} processing queued line failed: {ex.Message}");
|
||||
logStream.Error($"OPTHO {OptoComPortNr} processing queued line failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2142,7 +2134,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
var encoding = optoSerialPort?.Encoding ?? Encoding.ASCII;
|
||||
byte[] bytes = encoding.GetBytes(line);
|
||||
log.Debug("ComPort: " + OptoComPortNr + " OPTHO RX ← " + HexFormatter.ToSerialHex(bytes));
|
||||
logStream.Debug("ComPort: " + OptoComPortNr + " OPTHO RX ← " + HexFormatter.ToSerialHex(bytes));
|
||||
|
||||
var streamingDecode = new StreamingDecoder(true);
|
||||
streamingDecode.DecodeMsg(line);
|
||||
@@ -2152,14 +2144,14 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
if (streamingDecode.DataFlowTest != null && streamingDecode.DataFlowTest.IsValid)
|
||||
{
|
||||
blockCompleted = HandleFlowMarker();
|
||||
log.Debug("ComPort: " + OptoComPortNr + " Decoded Flow data: " + streamingDecode.DataFlowTest +
|
||||
" OPTHO RX ← " + HexFormatter.ToSerialHex(bytes));
|
||||
logStream.Debug("ComPort: " + OptoComPortNr + " Decoded Flow data: " + streamingDecode.DataFlowTest +
|
||||
" OPTHO RX ← " + HexFormatter.ToSerialHex(bytes));
|
||||
}
|
||||
|
||||
if (calibData != null && calibData.IsValid)
|
||||
{
|
||||
log.Debug("ComPort: " + OptoComPortNr + " Decoded Calib: " + calibData + " OPTHO RX ← " +
|
||||
HexFormatter.ToSerialHex(bytes));
|
||||
logStream.Debug("ComPort: " + OptoComPortNr + " Decoded Calib: " + calibData + " OPTHO RX ← " +
|
||||
HexFormatter.ToSerialHex(bytes));
|
||||
|
||||
MarkCalibrationChannelSeen(calibData.Channel);
|
||||
}
|
||||
@@ -2179,7 +2171,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
if (optoData[bufferIx] == null)
|
||||
{
|
||||
log.ErrorFormat("{0}: optoData[{1}] was null, recreating.", Name, bufferIx);
|
||||
logStream.ErrorFormat("{0}: optoData[{1}] was null, recreating.", Name, bufferIx);
|
||||
optoData[bufferIx] = new OptoTelegramRaw();
|
||||
}
|
||||
|
||||
@@ -2192,7 +2184,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
int iChanel = calibData.Channel - 1;
|
||||
if (iChanel >= 0 && iChanel < iChanelsCount)
|
||||
{
|
||||
log.Debug(
|
||||
logStream.Debug(
|
||||
$"Before UpdateFromSmart ch={iChanel + 1}: " +
|
||||
$"volumeRawExtLast={volumeRawExtLast[iChanel]}, " +
|
||||
$"timestampExtLast={timestampExtLast[iChanel]}, " +
|
||||
@@ -2260,7 +2252,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
var encoding = optoSerialPort?.Encoding ?? Encoding.ASCII;
|
||||
byte[] bytes = encoding.GetBytes(line);
|
||||
received = HexFormatter.ToSerialHex(bytes);
|
||||
log.Debug("RX ← " + received);
|
||||
logStream.Debug("RX ← " + received);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -2269,19 +2261,19 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
CalibrationRecord data = _streamingDecode.DataCalib;
|
||||
if (data != null && data.IsValid)
|
||||
{
|
||||
log.Info($"OPTHO {OptoComPortNr} DataCalib Parsed opto data: " + data + " RX ← " +
|
||||
received);
|
||||
logStream.Info($"OPTHO {OptoComPortNr} DataCalib Parsed opto data: " + data + " RX ← " +
|
||||
received);
|
||||
MarkCalibrationChannelSeen(data.Channel);
|
||||
}
|
||||
|
||||
FlowTestRecord dataFlow = _streamingDecode.DataFlowTest;
|
||||
if (dataFlow != null && dataFlow.IsValid)
|
||||
{
|
||||
log.Info($"OPTHO {OptoComPortNr} FLOW Parsed opto data: " + dataFlow + " RX ← " + received);
|
||||
logStream.Info($"OPTHO {OptoComPortNr} FLOW Parsed opto data: " + dataFlow + " RX ← " + received);
|
||||
|
||||
if (HandleFlowMarker())
|
||||
{
|
||||
log.Debug("ReadOptoData() completed flow block detected.");
|
||||
logStream.Debug("ReadOptoData() completed flow block detected.");
|
||||
if (resetSerialBuffersOnCompletedFlowBlock)
|
||||
ResetDataBuffer(); // no ResetDataBuffer() here
|
||||
}
|
||||
@@ -2290,7 +2282,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"OPTHO {OptoComPortNr} Read error: {ex.Message}");
|
||||
logStream.Error($"OPTHO {OptoComPortNr} Read error: {ex.Message}");
|
||||
}
|
||||
|
||||
// string line = optoSerialPort.ReadExisting();
|
||||
@@ -2335,11 +2327,11 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
catch (TimeoutException)
|
||||
{
|
||||
log.Debug($"ReadOptoData() OPTHO {OptoComPortNr} timeout - continuing.");
|
||||
logStream.Debug($"ReadOptoData() OPTHO {OptoComPortNr} timeout - continuing.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"ReadOptoData() OPTHO {OptoComPortNr} Read error: {ex.Message}");
|
||||
logStream.Error($"ReadOptoData() OPTHO {OptoComPortNr} Read error: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2355,11 +2347,11 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
{
|
||||
optoSerialPort.DiscardInBuffer();
|
||||
optoSerialPort.DiscardOutBuffer();
|
||||
log.Debug("-- Reaset Data Buffer --");
|
||||
logStream.Debug("-- Reaset Data Buffer --");
|
||||
return;
|
||||
}
|
||||
}
|
||||
log.Debug("-- Reaset Data Buffer - no serial port --");
|
||||
logStream.Debug("-- Reaset Data Buffer - no serial port --");
|
||||
}
|
||||
|
||||
void ISmartReader.SetNfcInterface()
|
||||
@@ -2385,17 +2377,17 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
byte[] bytes = optoSerialPort.Encoding.GetBytes(line);
|
||||
string received = HexFormatter.ToSerialHex(bytes);
|
||||
|
||||
log.Debug("RX ← " + received);
|
||||
logStream.Debug("RX ← " + received);
|
||||
return line;
|
||||
}
|
||||
}
|
||||
catch (TimeoutException)
|
||||
{
|
||||
log.Debug($"ReadOptoData() OPTHO {OptoComPortNr} ReadLine timeout (3s) - continuing.");
|
||||
logStream.Debug($"ReadOptoData() OPTHO {OptoComPortNr} ReadLine timeout (3s) - continuing.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error($"ReadOptoData() OPTHO {OptoComPortNr} Read error: {ex.Message}");
|
||||
logStream.Error($"ReadOptoData() OPTHO {OptoComPortNr} Read error: {ex.Message}");
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
@@ -2406,7 +2398,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
if (completedTask == readTask)
|
||||
return await readTask;
|
||||
|
||||
log.Debug("ReadOptoData timeout after " + timeoutMs + " ms");
|
||||
logStream.Debug("ReadOptoData timeout after " + timeoutMs + " ms");
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
@@ -2955,7 +2947,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
if (data == null || !data.IsValid)
|
||||
continue;
|
||||
|
||||
log.Info($"OPTHO {OptoComPortNr} Parsed optho data:" + data);
|
||||
logStream.Info($"OPTHO {OptoComPortNr} Parsed optho data:" + data);
|
||||
|
||||
int dch = data.Channel - 1;
|
||||
if (dch >= 0 && dch < iChanelsCount)
|
||||
@@ -2968,7 +2960,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Warn($"Parsing DiagnosticLedState4Data: {ex.Message}");
|
||||
logStream.Warn($"Parsing DiagnosticLedState4Data: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2979,7 +2971,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
|
||||
|
||||
log.Debug($"Try get End Volume! COM: {this.OptoComPortNr}, Volume: {volumeLtr}");
|
||||
logStream.Debug($"Try get End Volume! COM: {this.OptoComPortNr}, Volume: {volumeLtr}");
|
||||
if (optoSerialPort != null && optoSerialPort.IsOpen) CloseOptoSerialPort();
|
||||
|
||||
if (!Double.IsNaN(volumeLtr[channel0]))
|
||||
@@ -2990,12 +2982,12 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
//Solve roll over
|
||||
if (endWMState < beginWMState)
|
||||
{
|
||||
log.Debug($"Solve roll over! endWMState: {endWMState} < beginWMState: {beginWMState}");
|
||||
logStream.Debug($"Solve roll over! endWMState: {endWMState} < beginWMState: {beginWMState}");
|
||||
const double VOL_RANGE_LITERS = 16777216.0 * 0.00025; // 4,194.304 l
|
||||
endWMState += VOL_RANGE_LITERS;
|
||||
volumeLtr[channel0] = endWMState;
|
||||
ReadPulses();
|
||||
log.Debug(
|
||||
logStream.Debug(
|
||||
$"Solve roll over! Upgraded endWMState: {endWMState}, beginWMState: {beginWMState}");
|
||||
}
|
||||
}
|
||||
@@ -3004,7 +2996,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
//}
|
||||
|
||||
log.Warn("Default NaN value returned! Data Opto stream reading failed!");
|
||||
logStream.Warn("Default NaN value returned! Data Opto stream reading failed!");
|
||||
return Double.NaN;
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
@@ -3014,14 +3006,14 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
{
|
||||
if (ConfigStruct == null)
|
||||
{
|
||||
log.Debug("ConfigStruct is null - created new in ReadSerialNr()");
|
||||
logStream.Debug("ConfigStruct is null - created new in ReadSerialNr()");
|
||||
ConfigStruct = new ConfigStruct();
|
||||
}
|
||||
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
|
||||
log.Debug($"Try get Start Volume! COM: {this.OptoComPortNr}");
|
||||
logStream.Debug($"Try get Start Volume! COM: {this.OptoComPortNr}");
|
||||
|
||||
Start();
|
||||
|
||||
@@ -3042,7 +3034,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
StreamingDecoder _streamingDecode = new StreamingDecoder(true);
|
||||
_streamingDecode.DecodeMsg(readOptoDataWithTimeout);
|
||||
CalibrationRecord data = _streamingDecode.DataCalib;
|
||||
log.Info($"OPTHO {OptoComPortNr} Parsed optho data:" + data);
|
||||
logStream.Info($"OPTHO {OptoComPortNr} Parsed optho data:" + data);
|
||||
if (data == null || !data.IsValid)
|
||||
continue;
|
||||
|
||||
@@ -3058,7 +3050,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Warn($"Parsing DiagnosticLedState4Data: {ex.Message}");
|
||||
logStream.Warn($"Parsing DiagnosticLedState4Data: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3068,7 +3060,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug($"Try get Start Volume! COM: {this.OptoComPortNr}, Volume: {volumeLtr0}");
|
||||
logStream.Debug($"Try get Start Volume! COM: {this.OptoComPortNr}, Volume: {volumeLtr0}");
|
||||
if (optoSerialPort != null && optoSerialPort.IsOpen) CloseOptoSerialPort();
|
||||
|
||||
if (!Double.IsNaN(volumeLtr0[ch]))
|
||||
@@ -3079,7 +3071,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
//}
|
||||
|
||||
log.Warn("Default NaN value returned! Data Opto stream reading failed!");
|
||||
logStream.Warn("Default NaN value returned! Data Opto stream reading failed!");
|
||||
return Double.NaN;
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
@@ -3091,7 +3083,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
if (ConfigStruct == null)
|
||||
{
|
||||
log.Debug("ConfigStruct is null - created new in ReadSerialNr()");
|
||||
logStream.Debug("ConfigStruct is null - created new in ReadSerialNr()");
|
||||
ConfigStruct = new ConfigStruct();
|
||||
}
|
||||
|
||||
@@ -3101,11 +3093,11 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
|
||||
log.Debug($"Try get ReadSerialNr! COM: {this.RfidComPortNr}");
|
||||
logStream.Debug($"Try get ReadSerialNr! COM: {this.RfidComPortNr}");
|
||||
SerialNr = OptoHeadTest.ReadRequest_PCB();
|
||||
if (string.IsNullOrEmpty(SerialNr))
|
||||
{
|
||||
log.Debug("ReadSerialNr successful");
|
||||
logStream.Debug("ReadSerialNr successful");
|
||||
}
|
||||
|
||||
//optoHeadTest.CloseConnection();
|
||||
@@ -3890,7 +3882,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
_startupFlushActive = false;
|
||||
|
||||
log.WarnFormat(
|
||||
"Startup flush finished. Ignored {0} incoming opto lines.",
|
||||
"Startup flush finished. ({0}) Ignored {1} incoming opto lines.",
|
||||
Name,
|
||||
_startupFlushIgnoredLines);
|
||||
}
|
||||
}
|
||||
@@ -3907,7 +3900,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
_startupFlushActive = false;
|
||||
|
||||
log.WarnFormat(
|
||||
"Startup flush finished. Ignored {0} incoming opto lines. Window: {1:HH:mm:ss.fff} - {2:HH:mm:ss.fff}",
|
||||
"Startup flush finished. ({0}) Ignored {1} incoming opto lines. Window: {2:HH:mm:ss.fff} - {3:HH:mm:ss.fff}",
|
||||
Name,
|
||||
_startupFlushIgnoredLines,
|
||||
_startupFlushFirstIgnoredUtc,
|
||||
_startupFlushLastIgnoredUtc);
|
||||
@@ -3929,6 +3923,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
private double[] q3CalibInitial = {Double.NaN,Double.NaN,Double.NaN};
|
||||
private bool[] isChQ3CalibValid = { false,false,false};
|
||||
private double[] q3CalibCh = {Double.NaN,Double.NaN,Double.NaN};
|
||||
private double[] q3DiffPercentageCalibCh = {Double.NaN,Double.NaN,Double.NaN};
|
||||
|
||||
|
||||
public bool Q3CalibValid
|
||||
@@ -3946,6 +3941,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
}
|
||||
|
||||
public double[] Q3CalibValue { get => q3CalibInitial; }
|
||||
public double[] Q3CalibDiffPercentageValue { get => q3DiffPercentageCalibCh; }
|
||||
|
||||
public bool Q3Calib_Ch1Valid { get => isChQ3CalibValid[0]; }
|
||||
public bool Q3Calib_Ch2Valid { get => isChQ3CalibValid[1]; }
|
||||
@@ -3956,14 +3952,33 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
public int GetSlotNr { get => genesisHeadCfg?.SlotNr ?? -1; }
|
||||
|
||||
void SetQ3Calibration(double[] q3CalibInitial) { this.q3CalibInitial = q3CalibInitial; }
|
||||
//TODO BUMI implement variable values for Q3Channel!
|
||||
public void SetQ3Calibration(double[] q3CalibInitial) { this.q3CalibInitial = q3CalibInitial; }
|
||||
|
||||
public void CalculateQ3Calibration(double refVolume, double refTime)
|
||||
private double refVolume = double.NaN;
|
||||
private double refTime = double.NaN;
|
||||
public double RefVolume { get => refVolume; set => refVolume = value; }
|
||||
public double RefTime { get => refTime; set => refTime = value; }
|
||||
|
||||
|
||||
public bool CalculateQ3Calibration()
|
||||
{
|
||||
GetQ3Calibration(refVolume, refTime, q3CalibInitial, ref isChQ3CalibValid, ref q3CalibCh);
|
||||
if (Double.IsNaN(refVolume) || Double.IsNaN((refTime)))
|
||||
{
|
||||
log.Debug("RefVolume or RefTime is NaN");
|
||||
return false;
|
||||
}
|
||||
|
||||
CalculateQ3Calibration( refVolume, refTime);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void GetQ3Calibration(double refVolume, double refTime, double[] initCalibFactor, ref bool[] isChQ3CalibValid, ref double[] q3CalibCh)
|
||||
public void CalculateQ3Calibration(double refVolume, double refTime)
|
||||
{
|
||||
GetQ3Calibration(refVolume, refTime, q3CalibInitial, ref isChQ3CalibValid,ref q3DiffPercentageCalibCh, ref q3CalibCh);
|
||||
}
|
||||
|
||||
public void GetQ3Calibration(double refVolume, double refTime, double[] initCalibFactor, ref bool[] isChQ3CalibValid, ref double[] calibDiffPercent, ref double[] q3CalibCh)
|
||||
{
|
||||
log.Debug("=== Q3 CALIBRATION START ===");
|
||||
|
||||
@@ -3982,8 +3997,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug($"Inputs: refVolume={refVolume}, refTime={refTime}, initCalibFactor={initCalibFactor}");
|
||||
|
||||
log.Debug($"Inputs: refVolume={refVolume}, refTime={refTime}, initCalibFactors={string.Join(",", initCalibFactor)}");
|
||||
|
||||
if (_rawStartEndByChannel == null)
|
||||
{
|
||||
@@ -4073,25 +4088,13 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
|
||||
|
||||
q3CalibCh[iChannel] = (refVolume / recalculatedDeltaVolume) * initCalibFactor[iChannel];
|
||||
double diffPercent = Math.Abs((initCalibFactor[iChannel] - q3CalibCh[iChannel] ) / initCalibFactor[iChannel]) * 100.0;
|
||||
isChQ3CalibValid[iChannel] = diffPercent <= 5.0;
|
||||
isChQ3CalibValid[iChannel] = diffPercent <= 5.0 && diffPercent >= -5.0;
|
||||
calibDiffPercent[iChannel] = diffPercent;
|
||||
log.Debug($"Calculated Q3Calib Ch[{iChannel}] ={q3CalibCh[iChannel]} DiffPercent={diffPercent}% isValid[{isChQ3CalibValid[iChannel]}] IninitCalibFactor={initCalibFactor}");
|
||||
|
||||
}
|
||||
|
||||
log.Debug("=== Q3 CALIBRATION END ===");
|
||||
}
|
||||
|
||||
|
||||
void newPokus()
|
||||
{
|
||||
//TODO BUMI implement genesis communication
|
||||
//volat z GCI Bridge
|
||||
|
||||
//vybere sa component - GCI bridge
|
||||
// - rozhranie
|
||||
// - database
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ namespace TBF.Rig.RegisterReaders.iPerlReaderUNI
|
||||
MaxCommRetries = 4;
|
||||
WaitTimeAfterFailure = 2200;
|
||||
PassThroughWaitTime = 1500;
|
||||
NrThreads = 2; /// 1, 2 or 4 threads
|
||||
NrThreads = 10; /// 1, 2 or 4 threads / 10 threads for genesis
|
||||
IperlCheckErrorsToStop = 10;
|
||||
MciTimeoutMs = 4000; // ms, NFC interface
|
||||
BaudRate = 57600; // NFC Interface
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
using Config.Resources;
|
||||
using log4net;
|
||||
using Sensus.iPerl.RfidCom.Helper;
|
||||
using System;
|
||||
using TBF.Rig.RegisterReaders.CommonRR;
|
||||
using TBF.Rig.RegisterReaders.CommonRR.IPerl;
|
||||
using TBF.Rig.TestMethods.iPerlCommunication;
|
||||
using TBF.Rig.TestMethods.GenesisCommunication;
|
||||
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
|
||||
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.common;
|
||||
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.implementations;
|
||||
|
||||
@@ -21,7 +21,9 @@ using TBF.UiBridge;
|
||||
using SharedComponents;
|
||||
using System.Text;
|
||||
using TBF.Rig.RegisterReaders.CommonRR.IPerl;
|
||||
using TBF.Rig.TestMethods.GenesisCommunication;
|
||||
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
|
||||
using iPerlCommunicationParams = TBF.Rig.TestMethods.GenesisCommunication.iPerlCommunicationParams;
|
||||
|
||||
namespace TBF.Rig.Sequences
|
||||
{
|
||||
@@ -76,19 +78,19 @@ namespace TBF.Rig.Sequences
|
||||
// myRef.modelessDlg.Show();
|
||||
|
||||
/// 1nd argument
|
||||
TestMethods.iPerlCommunication.TestMethodCfg iPerlCfg = cfg as TestMethods.iPerlCommunication.TestMethodCfg;
|
||||
TestMethodCfg iPerlCfg = cfg as TestMethodCfg;
|
||||
|
||||
/// 2rd argument: as is
|
||||
|
||||
/// 3th argument
|
||||
IList<TestMethods.iPerlCommunication.iPerlCommunicationParams> iPerlCommParams = new List<TestMethods.iPerlCommunication.iPerlCommunicationParams>();
|
||||
foreach (var tp in multiTestParams) iPerlCommParams.Add(tp as TestMethods.iPerlCommunication.iPerlCommunicationParams);
|
||||
IList<iPerlCommunicationParams> iPerlCommParams = new List<iPerlCommunicationParams>();
|
||||
foreach (var tp in multiTestParams) iPerlCommParams.Add(tp as iPerlCommunicationParams);
|
||||
|
||||
/*myRef.modelessDlg = new TestMethods.iPerlCommunication.iPerlCommunicationForm(iPerlCfg, tests, iPerlCommParams);
|
||||
myRef.modelessDlg.Show();*/
|
||||
|
||||
myRef.modelessDlg = new TestMethods.iPerlCommunication.iPerlCommunicationForm(
|
||||
testMethod as TBF.Rig.TestMethods.iPerlCommunication.TestMethod, tests, iPerlCommParams);
|
||||
testMethod as TestMethod, tests, iPerlCommParams);
|
||||
myRef.modelessDlg.Show();
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -1424,15 +1426,24 @@ namespace TBF.Rig.Sequences
|
||||
for (int wmNr0 = BatchRslts.Batch.WaterMeters.Count - 1; wmNr0 >= 0; wmNr0--)
|
||||
{
|
||||
var wm = BatchRslts.Batch.WaterMeters[wmNr0];
|
||||
if (wm.Disabled)
|
||||
{
|
||||
/// Do not save disabled watermeters to DB, remove them from the list
|
||||
BatchRslts.Batch.WaterMeters.RemoveAt(wmNr0);
|
||||
if (wm.Q3Channel == 0){
|
||||
if (wm.Disabled)
|
||||
{
|
||||
/// Do not save disabled watermeters to DB, remove them from the list
|
||||
BatchRslts.Batch.WaterMeters.RemoveAt(wmNr0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Determine whether the watermeter passed all required tests
|
||||
wm.Passed = wm.PassedFromTests();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Determine whether the watermeter passed all required tests
|
||||
wm.Passed = wm.PassedFromTests();
|
||||
if (!wm.Disabled)
|
||||
{
|
||||
wm.Passed = wm.PassedFromTests();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1276,7 +1276,10 @@ namespace TBF.Rig.Sequences
|
||||
|
||||
var smryItems = DEItem.GetSummaryColumns();
|
||||
|
||||
for (int i = 0; i < BatchRslts.Batch.WaterMeters.Count; i++)
|
||||
//TODO BUMI check this part
|
||||
//Make channels showing the data
|
||||
int iWMCount = false ? BatchRslts.WMPositionsCount : BatchRslts.Batch.WaterMeters.Count;
|
||||
for (int i = 0; i < iWMCount; i++)
|
||||
{
|
||||
if (BatchRslts.Batch.WaterMeters != null &&
|
||||
BatchRslts.Batch.WaterMeters.Count > i &&
|
||||
|
||||
@@ -366,7 +366,7 @@ namespace TBF.Rig.Sequences
|
||||
Program.MainWnd.Invoke(new iPerlCommFormDlgt(OpenIPerlCommForm), new object[] { this, method, test, testParams });
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.iPerl_Communication_in_progress);
|
||||
Bridge.OnActivity(this, Strings.Meter_Communication_in_progress);
|
||||
//------------------------------------------------
|
||||
|
||||
bool stopPressed = false; /// true when STOP button pressed
|
||||
|
||||
@@ -195,9 +195,9 @@ namespace TBF.Rig
|
||||
new TestMethods.FlyingStartFirstRepetWithMassColl.HeatMeters.Factory(),
|
||||
new TestMethods.FlyingStartTankCollection.Single.Factory(),
|
||||
new TestMethods.FlyingStartTankCollection.Compound.Factory(),
|
||||
//new TestMethods.GenesisCommunication.GenesisHead.Factory(),
|
||||
new TestMethods.GenesisCommunication.Factory(),//GenesisTestMethod - inserted/ into IperlCommunication
|
||||
new TestMethods.GrabImage.Factory(),
|
||||
new TestMethods.iPerlCommunication.TestMethodFactory(), /// iPerlCommunication
|
||||
//new TestMethods.iPerlCommunication.TestMethodFactory(), /// iPerlCommunication
|
||||
new TestMethods.LeakTest.Factory(),
|
||||
new TestMethods.LiveStream.Factory(),
|
||||
new TestMethods.ManualEntry.Factory(),
|
||||
|
||||
@@ -12,6 +12,8 @@ using TBF.Rig;
|
||||
using TBF.Rig.GenericDevices;
|
||||
using TBF.Boxes;
|
||||
using TBF.Resources;
|
||||
using TBF.Rig.RegisterReaders.GenesisRegReader.implementations;
|
||||
using TBF.Rig.Sequences;
|
||||
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.common;
|
||||
using TBF.UiBridge;
|
||||
|
||||
@@ -464,6 +466,11 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
}
|
||||
while (!e.Contains(Event.TestCompleted) && !e.Contains(Event.Next)); /// 'Next' button is enabled in Debug version only
|
||||
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_in_calculation);
|
||||
//------------------------------------------------
|
||||
|
||||
/// Measurement loop end
|
||||
StopRecordingStatistics();
|
||||
|
||||
@@ -532,7 +539,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
tstRslt.TimeBtwnMassMsrmnts = 0;
|
||||
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
|
||||
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
||||
double flowMID = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
|
||||
double flowMID = tstRslt.TestTime == 0 ? 0 : 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
|
||||
|
||||
/// Corrected data
|
||||
tstRslt.MassStart = 0;
|
||||
@@ -542,7 +549,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
|
||||
/// Main result calculation
|
||||
tstRslt.VolumeCTV = tstRslt.ConstMasterCorr * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
|
||||
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
|
||||
tstRslt.Flow = tstRslt.TestTime==0 ? 0 : 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
|
||||
tstRslt.ErrorMaster = 0.0; /// Not available without a mass measurement
|
||||
tstRslt.ConstMaster = tstRslt.ConstMasterCorr;
|
||||
|
||||
@@ -660,6 +667,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = regReader as TestMethods.iPerlCommunication.iPerlHead.IperlHead;
|
||||
GenericDevices.IRegReaderLiveCamera cameraRoi = regReader as GenericDevices.IRegReaderLiveCamera;
|
||||
//GenesisHead Genesis = regReader as GenesisHead;
|
||||
TBF.Rig.RegisterReaders.GenesisRegReader.implementations.GenesisSmartReader GenesisSmart = regReader as TBF.Rig.RegisterReaders.GenesisRegReader.implementations.GenesisSmartReader;
|
||||
|
||||
if (meterRslt != null && regReader != null)
|
||||
{
|
||||
@@ -711,6 +719,24 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
Genesis.Log(" MeterError = " + calError.ToString() + " %");
|
||||
}
|
||||
else*/
|
||||
if (GenesisSmart != null)
|
||||
{
|
||||
log.Debug("GenesisSmart - store data on end!");
|
||||
int CH1=0, CH2=1, CH3=2;
|
||||
|
||||
CalculateMeterResults(meterRslt, GenesisSmart, tstRslt,GenesisSmart.TimestampSecStart, GenesisSmart.TimestampSecEnd, GenesisSmart.VolumeLtrStart, GenesisSmart.VolumeLtrEnd);
|
||||
|
||||
//Init Calculate Calibration
|
||||
GenesisSmart.RefVolume = meterRslt.VolumeRef;
|
||||
GenesisSmart.RefTime = meterRslt.TestTime;
|
||||
|
||||
//Store Raw Calibration Data to database
|
||||
WaterMeterParentCopy(i, CH1,testName,meterRslt,GenesisSmart,tstRslt);
|
||||
WaterMeterParentCopy(i, CH2,testName,meterRslt,GenesisSmart,tstRslt);
|
||||
WaterMeterParentCopy(i, CH3,testName,meterRslt,GenesisSmart,tstRslt);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dstrReader != null)
|
||||
{
|
||||
@@ -915,6 +941,217 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
// }
|
||||
// }
|
||||
|
||||
private const int CountCh = 3;
|
||||
private static void WaterMeterParentCopy(int i, int iCH, string testName, MeterTestRslt meterRslt,
|
||||
GenesisSmartReader genesisSmart,
|
||||
TestRslt tstRslt)
|
||||
{
|
||||
try
|
||||
{
|
||||
WaterMeter waterMeterParent = BatchRslts.Batch.WaterMeters[i];
|
||||
int wmNrChX = (i * CountCh) + BatchRslts.WMPositionsCount + iCH + 1;
|
||||
String sSerialNr =
|
||||
(string.IsNullOrEmpty(waterMeterParent.SerialNr) ? (i + 1).ToString() : waterMeterParent.SerialNr) +
|
||||
"_CH" + (iCH + 1);
|
||||
WaterMeter chXWaterMeter = null;
|
||||
//------ add new water meter to batch ------
|
||||
if (BatchRslts.Batch.WaterMeters.Count < wmNrChX || BatchRslts.Batch.WaterMeters[wmNrChX - 1] == null)
|
||||
{
|
||||
log.Debug("add new water meter to batch, CH = " + (iCH + 1) + " CH = " + wmNrChX);
|
||||
chXWaterMeter = new WaterMeter()
|
||||
{
|
||||
MeterTestRslts = new List<MeterTestRslt>(),
|
||||
};
|
||||
//This will delete each setting before
|
||||
chXWaterMeter.CopyContentFrom(waterMeterParent);
|
||||
|
||||
chXWaterMeter.Batch = BatchRslts.Batch;
|
||||
chXWaterMeter.WaterMeterData = waterMeterParent.WaterMeterData;
|
||||
|
||||
chXWaterMeter.SerialNr = sSerialNr;
|
||||
chXWaterMeter.WMPosition = wmNrChX;
|
||||
chXWaterMeter.Q3Channel = iCH + 1;
|
||||
chXWaterMeter.YearOfProduction = waterMeterParent.YearOfProduction;
|
||||
chXWaterMeter.Disabled = false;
|
||||
|
||||
BatchRslts.Batch.WaterMeters.Add(chXWaterMeter);
|
||||
}
|
||||
else
|
||||
{
|
||||
chXWaterMeter = BatchRslts.Batch.WaterMeters[wmNrChX - 1];
|
||||
|
||||
chXWaterMeter.Batch = BatchRslts.Batch;
|
||||
chXWaterMeter.WaterMeterData = waterMeterParent.WaterMeterData;
|
||||
chXWaterMeter.SerialNr = sSerialNr;
|
||||
chXWaterMeter.WMPosition = wmNrChX;
|
||||
chXWaterMeter.Q3Channel = iCH + 1;
|
||||
chXWaterMeter.YearOfProduction = waterMeterParent.YearOfProduction;
|
||||
chXWaterMeter.Disabled = false;
|
||||
}
|
||||
//~------ add new water meter to batch ------~
|
||||
|
||||
//create copy of meterRslt and add to additionalResultsByChannel
|
||||
MeterTestRslt meterTestRsltChX = new MeterTestRslt(chXWaterMeter, meterRslt.TestRslt,
|
||||
(CompoundMeterId)meterRslt.CompoundMeterId);
|
||||
meterTestRsltChX.Q3Channel = iCH + 1;
|
||||
chXWaterMeter.MeterTestRslts.Add(meterTestRsltChX);
|
||||
MeterTestRslt chanelXMeterRslt =
|
||||
BatchRslts.GetMeterTestRslt(testName, wmNrChX - 1, Common.CompoundMeterId.Single);
|
||||
|
||||
if (chanelXMeterRslt != null)
|
||||
{
|
||||
chanelXMeterRslt?.CopyContentFrom(meterRslt);
|
||||
if (iCH == 0)
|
||||
{
|
||||
chanelXMeterRslt.Q3Channel = 1;
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt,
|
||||
genesisSmart.TimestampSecStartRawCh1,
|
||||
genesisSmart.TimestampSecEndRawCh1, genesisSmart.VolumeLtrStartRawCh1,
|
||||
genesisSmart.VolumeLtrEndRawCh1);
|
||||
|
||||
try
|
||||
{
|
||||
TestRsltCalibFactor testRsltCalibFactor = null;
|
||||
if (tstRslt.CalibFactorResultsToSave.Count > 0)
|
||||
{
|
||||
testRsltCalibFactor = tstRslt.CalibFactorResultsToSave[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
//store in table
|
||||
testRsltCalibFactor = new TestRsltCalibFactor();
|
||||
tstRslt.CalibFactorResultsToSave.Add(testRsltCalibFactor);
|
||||
testRsltCalibFactor.CalibFactorIndex = 1;
|
||||
}
|
||||
|
||||
testRsltCalibFactor.TestRslt = chanelXMeterRslt.TestRslt;
|
||||
testRsltCalibFactor.TimeStart = genesisSmart.TimestampSecStartRawCh1;
|
||||
testRsltCalibFactor.TimeEnd = genesisSmart.TimestampSecEndRawCh1;
|
||||
testRsltCalibFactor.VolumeStart = genesisSmart.VolumeLtrStartRawCh1;
|
||||
testRsltCalibFactor.VolumeEnd = genesisSmart.VolumeLtrEndRawCh1;
|
||||
testRsltCalibFactor.Error = chanelXMeterRslt.Error;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in store to DB result set CH1", ex);
|
||||
}
|
||||
}
|
||||
else if (iCH == 1)
|
||||
{
|
||||
chanelXMeterRslt.Q3Channel = 2;
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt,
|
||||
genesisSmart.TimestampSecStartRawCh2,
|
||||
genesisSmart.TimestampSecEndRawCh2, genesisSmart.VolumeLtrStartRawCh2,
|
||||
genesisSmart.VolumeLtrEndRawCh2);
|
||||
|
||||
try
|
||||
{
|
||||
TestRsltCalibFactor testRsltCalibFactor = null;
|
||||
if (tstRslt.CalibFactorResultsToSave.Count > 1)
|
||||
{
|
||||
testRsltCalibFactor = tstRslt.CalibFactorResultsToSave[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
//store in table
|
||||
testRsltCalibFactor = new TestRsltCalibFactor();
|
||||
tstRslt.CalibFactorResultsToSave.Add(testRsltCalibFactor);
|
||||
testRsltCalibFactor.CalibFactorIndex = 2;
|
||||
}
|
||||
|
||||
testRsltCalibFactor.TestRslt = chanelXMeterRslt.TestRslt;
|
||||
testRsltCalibFactor.TimeStart = genesisSmart.TimestampSecStartRawCh2;
|
||||
testRsltCalibFactor.TimeEnd = genesisSmart.TimestampSecEndRawCh2;
|
||||
testRsltCalibFactor.VolumeStart = genesisSmart.VolumeLtrStartRawCh2;
|
||||
testRsltCalibFactor.VolumeEnd = genesisSmart.VolumeLtrEndRawCh2;
|
||||
testRsltCalibFactor.Error = chanelXMeterRslt.Error;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in store to DB result set CH2", ex);
|
||||
}
|
||||
}
|
||||
else if (iCH == 2)
|
||||
{
|
||||
chanelXMeterRslt.Q3Channel = 3;
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt,
|
||||
genesisSmart.TimestampSecStartRawCh3,
|
||||
genesisSmart.TimestampSecEndRawCh3, genesisSmart.VolumeLtrStartRawCh3,
|
||||
genesisSmart.VolumeLtrEndRawCh3);
|
||||
try
|
||||
{
|
||||
TestRsltCalibFactor testRsltCalibFactor = null;
|
||||
if (tstRslt.CalibFactorResultsToSave.Count > 2)
|
||||
{
|
||||
testRsltCalibFactor = tstRslt.CalibFactorResultsToSave[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
//store in table
|
||||
testRsltCalibFactor = new TestRsltCalibFactor();
|
||||
tstRslt.CalibFactorResultsToSave.Add(testRsltCalibFactor);
|
||||
testRsltCalibFactor.CalibFactorIndex = 3;
|
||||
}
|
||||
|
||||
testRsltCalibFactor.TestRslt = chanelXMeterRslt.TestRslt;
|
||||
testRsltCalibFactor.TimeStart = genesisSmart.TimestampSecStartRawCh3;
|
||||
testRsltCalibFactor.TimeEnd = genesisSmart.TimestampSecEndRawCh3;
|
||||
testRsltCalibFactor.VolumeStart = genesisSmart.VolumeLtrStartRawCh3;
|
||||
testRsltCalibFactor.VolumeEnd = genesisSmart.VolumeLtrEndRawCh3;
|
||||
testRsltCalibFactor.Error = chanelXMeterRslt.Error;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in store to DB result set CH3", ex);
|
||||
}
|
||||
}
|
||||
|
||||
if (!genesisSmart.EnableShowChanels)
|
||||
{
|
||||
chXWaterMeter.Disabled = !genesisSmart.EnableShowChanels;
|
||||
//meterTestRsltChX.TestDone = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
chXWaterMeter.Disabled = false;
|
||||
meterTestRsltChX.TestDone = true;
|
||||
}
|
||||
|
||||
meterTestRsltChX.Passed = meterRslt.Passed;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in WaterMeterParentCopy", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static void CalculateMeterResults(MeterTestRslt meterRslt, IRegReaderDatastream dstrReader, TestRslt tstRslt, double dstrReaderTimestampSecStart, double dstrReaderTimestampSecEnd, double dstrReaderVolumeLtrStart, double dstrReaderVolumeLtrEnd)
|
||||
{
|
||||
try
|
||||
{
|
||||
meterRslt.TimestampStart = dstrReaderTimestampSecStart;
|
||||
meterRslt.TimestampEnd = !dstrReader.NoSamples
|
||||
? dstrReaderTimestampSecEnd
|
||||
: (dstrReaderTimestampSecStart + tstRslt.TestTime);
|
||||
meterRslt.TestTime = meterRslt.TimestampEnd - meterRslt.TimestampStart;
|
||||
meterRslt.VolumeStart = dstrReaderVolumeLtrStart; /// liter
|
||||
meterRslt.VolumeEnd = dstrReaderVolumeLtrEnd; /// liter
|
||||
meterRslt.VolumeMeter =
|
||||
Math.Abs(dstrReaderVolumeLtrEnd - dstrReaderVolumeLtrStart);
|
||||
meterRslt.VolumeRef = tstRslt.TestTime == 0
|
||||
? tstRslt.VolumeCTV
|
||||
: tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
|
||||
meterRslt.PulsesMaster = tstRslt.TestTime == 0
|
||||
? tstRslt.PulsesMaster
|
||||
: tstRslt.PulsesMaster * meterRslt.TestTime / tstRslt.TestTime;
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter,
|
||||
meterRslt.VolumeRef); // Error based on volume difference
|
||||
}catch(Exception ex)
|
||||
{
|
||||
log.Error($"Error in calculate meter results, meterRslt.Name:{meterRslt.Name()} Calculation Bug Detail:", ex);
|
||||
}
|
||||
}
|
||||
|
||||
IList<Event> Simulate(Config.Entities.Test test, int repetitionNr, bool isLastRepetition,
|
||||
Compound.TestParams compoundTestParams,
|
||||
@@ -939,6 +1176,14 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
else if (test.Name.ToLower().Contains("q2")) MakeSimulated(test, 1, 0, 0.5f);
|
||||
else if (test.Name.ToLower().Contains("q1")) MakeSimulated(test, 1, 0, -5.1f);
|
||||
else MakeSimulated(test, 1, 0, 0.9f);
|
||||
|
||||
//TODO bumi do simulate foe Q3 Calibration
|
||||
///
|
||||
/// Single meters
|
||||
///
|
||||
SimulateQ3CalibrationData(test,1, 0, -5.1f);
|
||||
|
||||
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Completed));
|
||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
|
||||
@@ -955,5 +1200,46 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
|
||||
return new List<Event> { TestAndLogUiCmdStop(test, e) ? Event.UiCmdStop : Event.Done };
|
||||
}
|
||||
|
||||
private void SimulateQ3CalibrationData(Test test,int repetitionNr, int part, float errorPctBase)
|
||||
{
|
||||
string testName = test.Name;
|
||||
string fullTestName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||
|
||||
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(fullTestName, part);
|
||||
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
|
||||
|
||||
|
||||
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||
{
|
||||
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
|
||||
|
||||
Results.Entities.MeterTestRslt meterRslt =
|
||||
BatchRslts.GetMeterTestRslt(testName, i, Common.CompoundMeterId.Single);
|
||||
GenericDevices.IRegReader regReader = sensPath.RegisterReaders[i];
|
||||
TBF.Rig.RegisterReaders.GenesisRegReader.implementations.GenesisSmartReader GenesisSmart =
|
||||
regReader as TBF.Rig.RegisterReaders.GenesisRegReader.implementations.GenesisSmartReader;
|
||||
|
||||
|
||||
if (GenesisSmart != null)
|
||||
{
|
||||
log.Debug("GenesisSmart - store data on end!");
|
||||
int CH1 = 0, CH2 = 1, CH3 = 2;
|
||||
|
||||
CalculateMeterResults(meterRslt, GenesisSmart, tstRslt, GenesisSmart.TimestampSecStart,
|
||||
GenesisSmart.TimestampSecEnd, GenesisSmart.VolumeLtrStart, GenesisSmart.VolumeLtrEnd);
|
||||
|
||||
//Init Calculate Calibration
|
||||
GenesisSmart.RefVolume = meterRslt.VolumeRef;
|
||||
GenesisSmart.RefTime = meterRslt.TestTime;
|
||||
|
||||
//Store Raw Calibration Data to database
|
||||
WaterMeterParentCopy(i, CH1, testName, meterRslt, GenesisSmart, tstRslt);
|
||||
WaterMeterParentCopy(i, CH2, testName, meterRslt, GenesisSmart, tstRslt);
|
||||
WaterMeterParentCopy(i, CH3, testName, meterRslt, GenesisSmart, tstRslt);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ using TBF.Rig.GenericDevices;
|
||||
using TBF.Rig.RegisterReaders.GenesisRegReader.implementations;
|
||||
using TBF.Rig.RegisterReaders.PoseidonReader;
|
||||
using TBF.Rig.RegisterReaders.PoseidonReader.implementations;
|
||||
using TBF.Rig.Sequences;
|
||||
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.common;
|
||||
using TBF.UiBridge;
|
||||
|
||||
@@ -1086,12 +1087,13 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
|
||||
bUpgradeCountOfMeters = true;
|
||||
int CH1=0, CH2=1, CH3=2;
|
||||
|
||||
//BatchRslts.Batch.WaterMeters.Add(ch1WaterMeter); //[i + BatchRslts.WMPositionsCount + CH1 + 1]
|
||||
//BatchRslts.Batch.WaterMeters.Add(ch1WaterMeter); //[i + BatchRslts.WMPositionsCount + CH2 + 1]
|
||||
//BatchRslts.Batch.WaterMeters.Add(ch1WaterMeter); //[i + BatchRslts.WMPositionsCount + CH3 + 1]
|
||||
|
||||
CalculateMeterResults(meterRslt, GenesisSmart, tstRslt,GenesisSmart.TimestampSecStart, GenesisSmart.TimestampSecEnd, GenesisSmart.VolumeLtrStart, GenesisSmart.VolumeLtrEnd);
|
||||
|
||||
//Init Calculate Calibration
|
||||
GenesisSmart.RefVolume = meterRslt.VolumeRef;
|
||||
GenesisSmart.RefTime = meterRslt.TestTime;
|
||||
|
||||
//Store Raw Calibration Data to database
|
||||
WaterMeterParentCopy(i, CH1,testName,meterRslt,GenesisSmart,tstRslt);
|
||||
WaterMeterParentCopy(i, CH2,testName,meterRslt,GenesisSmart,tstRslt);
|
||||
WaterMeterParentCopy(i, CH3,testName,meterRslt,GenesisSmart,tstRslt);
|
||||
@@ -1352,91 +1354,212 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
|
||||
GenesisSmartReader genesisSmart,
|
||||
TestRslt tstRslt)
|
||||
{
|
||||
WaterMeter waterMeterParent = BatchRslts.Batch.WaterMeters[i];
|
||||
int wmNrChX = (i*CountCh) + BatchRslts.WMPositionsCount + iCH + 1;
|
||||
String sSerialNr = waterMeterParent.SerialNr + "_CH" + (iCH + 1);
|
||||
WaterMeter chXWaterMeter = null;
|
||||
//------ add new water meter to batch ------
|
||||
if (BatchRslts.Batch.WaterMeters.Count < wmNrChX || BatchRslts.Batch.WaterMeters[wmNrChX-1] == null)
|
||||
try
|
||||
{
|
||||
log.Debug("add new water meter to batch, CH = " + (iCH + 1) + " CH = " + wmNrChX);
|
||||
chXWaterMeter = new WaterMeter()
|
||||
WaterMeter waterMeterParent = BatchRslts.Batch.WaterMeters[i];
|
||||
int wmNrChX = (i * CountCh) + BatchRslts.WMPositionsCount + iCH + 1;
|
||||
String sSerialNr =
|
||||
(string.IsNullOrEmpty(waterMeterParent.SerialNr) ? (i+1).ToString() : waterMeterParent.SerialNr) +
|
||||
"_CH" + (iCH + 1);
|
||||
WaterMeter chXWaterMeter = null;
|
||||
//------ add new water meter to batch ------
|
||||
if (BatchRslts.Batch.WaterMeters.Count < wmNrChX || BatchRslts.Batch.WaterMeters[wmNrChX - 1] == null)
|
||||
{
|
||||
Batch = BatchRslts.Batch,
|
||||
WaterMeterData = waterMeterParent.WaterMeterData,
|
||||
MeterTestRslts = new List<MeterTestRslt>(),
|
||||
SerialNr = sSerialNr,
|
||||
WMPosition = wmNrChX,
|
||||
YearOfProduction = 0,
|
||||
Disabled = false,
|
||||
};
|
||||
chXWaterMeter.CopyContentFrom(waterMeterParent);
|
||||
log.Debug("add new water meter to batch, CH = " + (iCH + 1) + " CH = " + wmNrChX);
|
||||
chXWaterMeter = new WaterMeter()
|
||||
{
|
||||
MeterTestRslts = new List<MeterTestRslt>(),
|
||||
};
|
||||
//This will delete each setting before
|
||||
chXWaterMeter.CopyContentFrom(waterMeterParent);
|
||||
|
||||
chXWaterMeter.SerialNr = sSerialNr;
|
||||
chXWaterMeter.WMPosition = wmNrChX;
|
||||
chXWaterMeter.YearOfProduction = waterMeterParent.YearOfProduction;
|
||||
chXWaterMeter.Disabled = false;
|
||||
chXWaterMeter.Batch = BatchRslts.Batch;
|
||||
chXWaterMeter.WaterMeterData = waterMeterParent.WaterMeterData;
|
||||
|
||||
chXWaterMeter.SerialNr = sSerialNr;
|
||||
chXWaterMeter.WMPosition = wmNrChX;
|
||||
chXWaterMeter.Q3Channel = iCH+1;
|
||||
chXWaterMeter.YearOfProduction = waterMeterParent.YearOfProduction;
|
||||
chXWaterMeter.Disabled = false;
|
||||
|
||||
|
||||
BatchRslts.Batch.WaterMeters.Add(chXWaterMeter);
|
||||
}
|
||||
else
|
||||
{
|
||||
chXWaterMeter = BatchRslts.Batch.WaterMeters[wmNrChX-1];
|
||||
}
|
||||
//~------ add new water meter to batch ------~
|
||||
|
||||
//create copy of meterRslt and add to additionalResultsByChannel
|
||||
MeterTestRslt meterTestRsltChX = new MeterTestRslt(chXWaterMeter, meterRslt.TestRslt, (CompoundMeterId)meterRslt.CompoundMeterId);
|
||||
chXWaterMeter.MeterTestRslts.Add(meterTestRsltChX);
|
||||
MeterTestRslt chanelXMeterRslt = BatchRslts.GetMeterTestRslt(testName, wmNrChX-1, Common.CompoundMeterId.Single);
|
||||
|
||||
if (chanelXMeterRslt != null)
|
||||
{
|
||||
chanelXMeterRslt?.CopyContentFrom(meterRslt);
|
||||
if (iCH == 0)
|
||||
{
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt, genesisSmart.TimestampSecStartRawCh1,
|
||||
genesisSmart.TimestampSecEndRawCh1, genesisSmart.VolumeLtrStartRawCh1, genesisSmart.VolumeLtrEndRawCh1);
|
||||
}
|
||||
else if (iCH == 1)
|
||||
{
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt, genesisSmart.TimestampSecStartRawCh2,
|
||||
genesisSmart.TimestampSecEndRawCh2, genesisSmart.VolumeLtrStartRawCh2, genesisSmart.VolumeLtrEndRawCh2);
|
||||
}
|
||||
else if (iCH == 2)
|
||||
{
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt, genesisSmart.TimestampSecStartRawCh3,
|
||||
genesisSmart.TimestampSecEndRawCh3, genesisSmart.VolumeLtrStartRawCh3, genesisSmart.VolumeLtrEndRawCh3);
|
||||
}
|
||||
|
||||
if (!genesisSmart.EnableShowChanels)
|
||||
{
|
||||
chXWaterMeter.Disabled = !genesisSmart.EnableShowChanels;
|
||||
meterTestRsltChX.TestDone = false;
|
||||
BatchRslts.Batch.WaterMeters.Add(chXWaterMeter);
|
||||
}
|
||||
else
|
||||
{
|
||||
meterTestRsltChX.TestDone = true;
|
||||
chXWaterMeter = BatchRslts.Batch.WaterMeters[wmNrChX - 1];
|
||||
|
||||
|
||||
chXWaterMeter.Batch = BatchRslts.Batch;
|
||||
chXWaterMeter.WaterMeterData = waterMeterParent.WaterMeterData;
|
||||
chXWaterMeter.SerialNr = sSerialNr;
|
||||
chXWaterMeter.WMPosition = wmNrChX;
|
||||
chXWaterMeter.Q3Channel = iCH+1;
|
||||
chXWaterMeter.YearOfProduction = waterMeterParent.YearOfProduction;
|
||||
chXWaterMeter.Disabled = false;
|
||||
}
|
||||
//~------ add new water meter to batch ------~
|
||||
|
||||
meterTestRsltChX.Passed = meterRslt.Passed;
|
||||
//create copy of meterRslt and add to additionalResultsByChannel
|
||||
MeterTestRslt meterTestRsltChX = new MeterTestRslt(chXWaterMeter, meterRslt.TestRslt,
|
||||
(CompoundMeterId)meterRslt.CompoundMeterId);
|
||||
meterTestRsltChX.Q3Channel = iCH + 1;
|
||||
chXWaterMeter.MeterTestRslts.Add(meterTestRsltChX);
|
||||
MeterTestRslt chanelXMeterRslt =
|
||||
BatchRslts.GetMeterTestRslt(testName, wmNrChX - 1, Common.CompoundMeterId.Single);
|
||||
|
||||
if (chanelXMeterRslt != null)
|
||||
{
|
||||
chanelXMeterRslt?.CopyContentFrom(meterRslt);
|
||||
if (iCH == 0)
|
||||
{
|
||||
chanelXMeterRslt.Q3Channel = 1;
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt,
|
||||
genesisSmart.TimestampSecStartRawCh1,
|
||||
genesisSmart.TimestampSecEndRawCh1, genesisSmart.VolumeLtrStartRawCh1,
|
||||
genesisSmart.VolumeLtrEndRawCh1);
|
||||
|
||||
try
|
||||
{
|
||||
TestRsltCalibFactor testRsltCalibFactor = null;
|
||||
if (tstRslt.CalibFactorResultsToSave.Count > 0)
|
||||
{
|
||||
testRsltCalibFactor = tstRslt.CalibFactorResultsToSave[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
//store in table
|
||||
testRsltCalibFactor = new TestRsltCalibFactor();
|
||||
tstRslt.CalibFactorResultsToSave.Add(testRsltCalibFactor);
|
||||
testRsltCalibFactor.CalibFactorIndex = 1;
|
||||
}
|
||||
|
||||
testRsltCalibFactor.TestRslt = chanelXMeterRslt.TestRslt;
|
||||
testRsltCalibFactor.TimeStart = genesisSmart.TimestampSecStartRawCh1;
|
||||
testRsltCalibFactor.TimeEnd = genesisSmart.TimestampSecEndRawCh1;
|
||||
testRsltCalibFactor.VolumeStart = genesisSmart.VolumeLtrStartRawCh1;
|
||||
testRsltCalibFactor.VolumeEnd = genesisSmart.VolumeLtrEndRawCh1;
|
||||
testRsltCalibFactor.Error = chanelXMeterRslt.Error;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in store to DB result set CH1", ex);
|
||||
}
|
||||
}
|
||||
else if (iCH == 1)
|
||||
{
|
||||
chanelXMeterRslt.Q3Channel = 2;
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt,
|
||||
genesisSmart.TimestampSecStartRawCh2,
|
||||
genesisSmart.TimestampSecEndRawCh2, genesisSmart.VolumeLtrStartRawCh2,
|
||||
genesisSmart.VolumeLtrEndRawCh2);
|
||||
try
|
||||
{
|
||||
|
||||
TestRsltCalibFactor testRsltCalibFactor = null;
|
||||
if (tstRslt.CalibFactorResultsToSave.Count > 1)
|
||||
{
|
||||
testRsltCalibFactor = tstRslt.CalibFactorResultsToSave[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
//store in table
|
||||
testRsltCalibFactor = new TestRsltCalibFactor();
|
||||
tstRslt.CalibFactorResultsToSave.Add(testRsltCalibFactor);
|
||||
testRsltCalibFactor.CalibFactorIndex = 2;
|
||||
}
|
||||
|
||||
testRsltCalibFactor.TestRslt = chanelXMeterRslt.TestRslt;
|
||||
testRsltCalibFactor.TimeStart = genesisSmart.TimestampSecStartRawCh2;
|
||||
testRsltCalibFactor.TimeEnd = genesisSmart.TimestampSecEndRawCh2;
|
||||
testRsltCalibFactor.VolumeStart = genesisSmart.VolumeLtrStartRawCh2;
|
||||
testRsltCalibFactor.VolumeEnd = genesisSmart.VolumeLtrEndRawCh2;
|
||||
testRsltCalibFactor.Error = chanelXMeterRslt.Error;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in store to DB result set CH2", ex);
|
||||
}
|
||||
}
|
||||
else if (iCH == 2)
|
||||
{
|
||||
chanelXMeterRslt.Q3Channel = 3;
|
||||
CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt,
|
||||
genesisSmart.TimestampSecStartRawCh3,
|
||||
genesisSmart.TimestampSecEndRawCh3, genesisSmart.VolumeLtrStartRawCh3,
|
||||
genesisSmart.VolumeLtrEndRawCh3);
|
||||
|
||||
try
|
||||
{
|
||||
TestRsltCalibFactor testRsltCalibFactor = null;
|
||||
if (tstRslt.CalibFactorResultsToSave.Count > 2)
|
||||
{
|
||||
testRsltCalibFactor = tstRslt.CalibFactorResultsToSave[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
//store in table
|
||||
testRsltCalibFactor = new TestRsltCalibFactor();
|
||||
tstRslt.CalibFactorResultsToSave.Add(testRsltCalibFactor);
|
||||
testRsltCalibFactor.CalibFactorIndex = 3;
|
||||
}
|
||||
|
||||
testRsltCalibFactor.TestRslt = chanelXMeterRslt.TestRslt;
|
||||
testRsltCalibFactor.TimeStart = genesisSmart.TimestampSecStartRawCh3;
|
||||
testRsltCalibFactor.TimeEnd = genesisSmart.TimestampSecEndRawCh3;
|
||||
testRsltCalibFactor.VolumeStart = genesisSmart.VolumeLtrStartRawCh3;
|
||||
testRsltCalibFactor.VolumeEnd = genesisSmart.VolumeLtrEndRawCh3;
|
||||
testRsltCalibFactor.Error = chanelXMeterRslt.Error;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in store to DB result set CH3", ex);
|
||||
}
|
||||
}
|
||||
|
||||
if (!genesisSmart.EnableShowChanels)
|
||||
{
|
||||
chXWaterMeter.Disabled = !genesisSmart.EnableShowChanels;
|
||||
//meterTestRsltChX.TestDone = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
chXWaterMeter.Disabled = false;
|
||||
meterTestRsltChX.TestDone = true;
|
||||
}
|
||||
|
||||
meterTestRsltChX.Passed = meterRslt.Passed;
|
||||
}
|
||||
}catch(Exception ex)
|
||||
{
|
||||
log.Error("Error in WaterMeterParentCopy", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static void CalculateMeterResults(MeterTestRslt meterRslt, IRegReaderDatastream dstrReader, TestRslt tstRslt, double dstrReaderTimestampSecStart, double dstrReaderTimestampSecEnd, double dstrReaderVolumeLtrStart, double dstrReaderVolumeLtrEnd)
|
||||
{
|
||||
meterRslt.TimestampStart = dstrReaderTimestampSecStart;
|
||||
meterRslt.TimestampEnd = !dstrReader.NoSamples
|
||||
? dstrReaderTimestampSecEnd
|
||||
: (dstrReaderTimestampSecStart + tstRslt.TestTime);
|
||||
meterRslt.TestTime = meterRslt.TimestampEnd - meterRslt.TimestampStart;
|
||||
meterRslt.VolumeStart = dstrReaderVolumeLtrStart; /// liter
|
||||
meterRslt.VolumeEnd = dstrReaderVolumeLtrEnd; /// liter
|
||||
meterRslt.VolumeMeter =
|
||||
Math.Abs(dstrReaderVolumeLtrEnd - dstrReaderVolumeLtrStart);
|
||||
meterRslt.VolumeRef = tstRslt.TestTime==0? tstRslt.VolumeCTV : tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
|
||||
meterRslt.PulsesMaster = tstRslt.TestTime == 0? tstRslt.PulsesMaster :
|
||||
tstRslt.PulsesMaster * meterRslt.TestTime / tstRslt.TestTime;
|
||||
try
|
||||
{
|
||||
meterRslt.TimestampStart = dstrReaderTimestampSecStart;
|
||||
meterRslt.TimestampEnd = !dstrReader.NoSamples
|
||||
? dstrReaderTimestampSecEnd
|
||||
: (dstrReaderTimestampSecStart + tstRslt.TestTime);
|
||||
meterRslt.TestTime = meterRslt.TimestampEnd - meterRslt.TimestampStart;
|
||||
meterRslt.VolumeStart = dstrReaderVolumeLtrStart; /// liter
|
||||
meterRslt.VolumeEnd = dstrReaderVolumeLtrEnd; /// liter
|
||||
meterRslt.VolumeMeter = Math.Abs(dstrReaderVolumeLtrEnd - dstrReaderVolumeLtrStart);
|
||||
meterRslt.VolumeRef = tstRslt.TestTime == 0
|
||||
? tstRslt.VolumeCTV
|
||||
: tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
|
||||
meterRslt.PulsesMaster = tstRslt.TestTime == 0
|
||||
? tstRslt.PulsesMaster
|
||||
: tstRslt.PulsesMaster * meterRslt.TestTime / tstRslt.TestTime;
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter,
|
||||
meterRslt.VolumeRef); // Error based on volume difference
|
||||
}catch(Exception ex)
|
||||
{
|
||||
log.Error($"Error in calculate meter results, meterRslt.Name:{meterRslt.Name()} Calculation Bug Detail:", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1479,6 +1602,12 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
|
||||
|
||||
MakeSimulated(test, repetitionNr, test.Part, errorPctBase + repetitionNr * 0.1f);
|
||||
}
|
||||
|
||||
//TODO bumi do simulate foe Q3 Calibration
|
||||
///
|
||||
/// Single meters
|
||||
///
|
||||
SimulateQ3CalibrationData(test,1, 0, -5.1f);
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Completed));
|
||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
|
||||
@@ -1496,6 +1625,64 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
|
||||
return new List<Event> { TestAndLogUiCmdStop(test, e) ? Event.UiCmdStop : Event.Done };
|
||||
}
|
||||
|
||||
private void SimulateQ3CalibrationData(Test test,int repetitionNr, int part, float errorPctBase)
|
||||
{
|
||||
string testName = test.Name;
|
||||
string fullTestName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||
|
||||
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(fullTestName, part);
|
||||
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
|
||||
|
||||
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||
{
|
||||
if (WaterMeters.Count > i && WaterMeters[i] != null)
|
||||
WaterMeters[i].SerialNr = "Simul_" + (i + 1).ToString();
|
||||
}
|
||||
|
||||
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||
{
|
||||
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
|
||||
|
||||
Results.Entities.MeterTestRslt meterRslt =
|
||||
BatchRslts.GetEachMeterTestRslt(testName, i, Common.CompoundMeterId.Single);
|
||||
if (meterRslt == null) continue;
|
||||
if (meterRslt?.WaterMeter == null) continue;
|
||||
if (string.IsNullOrEmpty(meterRslt.WaterMeter.SerialNr))
|
||||
{
|
||||
meterRslt.WaterMeter.SerialNr = "Simul_" + (i + 1).ToString();
|
||||
meterRslt.WaterMeter.SerialNrAux = "Simul_" + (i + 1).ToString();
|
||||
log.Debug("Simul_SerialNr: " + meterRslt.WaterMeter.SerialNr);
|
||||
}
|
||||
|
||||
GenericDevices.IRegReader regReader = sensPath.RegisterReaders[i];
|
||||
TBF.Rig.RegisterReaders.GenesisRegReader.implementations.GenesisSmartReader GenesisSmart =
|
||||
regReader as TBF.Rig.RegisterReaders.GenesisRegReader.implementations.GenesisSmartReader;
|
||||
|
||||
|
||||
if (GenesisSmart != null)
|
||||
{
|
||||
log.Debug("GenesisSmart - store data on end!");
|
||||
int CH1 = 0, CH2 = 1, CH3 = 2;
|
||||
|
||||
CalculateMeterResults(meterRslt, GenesisSmart, tstRslt, GenesisSmart.TimestampSecStart,
|
||||
GenesisSmart.TimestampSecEnd, GenesisSmart.VolumeLtrStart, GenesisSmart.VolumeLtrEnd);
|
||||
|
||||
//Init Calculate Calibration
|
||||
GenesisSmart.RefVolume = meterRslt.VolumeRef;
|
||||
GenesisSmart.RefTime = meterRslt.TestTime;
|
||||
|
||||
//Store Raw Calibration Data to database
|
||||
WaterMeterParentCopy(i, CH1, testName, meterRslt, GenesisSmart, tstRslt);
|
||||
log.Debug($"GenesisSmart - i:{i}, CH1:{CH1}, testName:{testName}, meterRslt:{meterRslt.Id}, GenesisSmart:{GenesisSmart.Name}, tstRslt:{tstRslt.Id}");
|
||||
WaterMeterParentCopy(i, CH2, testName, meterRslt, GenesisSmart, tstRslt);
|
||||
log.Debug($"GenesisSmart - i:{i}, CH2:{CH2}, testName:{testName}, meterRslt:{meterRslt.Id}, GenesisSmart:{GenesisSmart.Name}, tstRslt:{tstRslt.Id}");
|
||||
WaterMeterParentCopy(i, CH3, testName, meterRslt, GenesisSmart, tstRslt);
|
||||
log.Debug($"GenesisSmart - i:{i}, CH3:{CH3}, testName:{testName}, meterRslt:{meterRslt.Id}, GenesisSmart:{GenesisSmart.Name}, tstRslt:{tstRslt.Id}");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IList<Event> Simulate2(Config.Entities.Test test, int repetitionNr, bool isLastRepetition,
|
||||
Compound.CombinedTestParams compoundTestParams,
|
||||
|
||||
@@ -48,6 +48,16 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection.Single
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (DebugLevel == DebugMode.Simulate &&
|
||||
test.Name.ToLower().Contains("q3")
|
||||
)
|
||||
{
|
||||
//Q3 Test - calibration data
|
||||
return new FlyingStartMassCollectionSeq().Execute(test, repetNr, isLastRepetition,
|
||||
testMethodCfg.TestParams.DelayedStart, null, null, DebugLevel);
|
||||
}
|
||||
|
||||
/// DebugLevel == DebugMode.Simulate
|
||||
(new FlyingStartMassCollectionSeq()).MakeSimulatedTrivial(test, repetNr, test.Part);
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetNr, Progress.Completed));
|
||||
|
||||
@@ -32,15 +32,15 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
///
|
||||
delegate void iPerlCommFormDlgt(GenesisCommunicationSeq myRef, iPerlCommunication.TestMethod method, Test test, iPerlCommunicationParams testParams);
|
||||
delegate void iPerlCommFormDlgt(GenesisCommunicationSeq myRef, TestMethod method, Test test, iPerlCommunicationParams testParams);
|
||||
///
|
||||
void OpenIPerlCommForm(GenesisCommunicationSeq myRef, iPerlCommunication.TestMethod method, Test test, iPerlCommunicationParams testParams)
|
||||
void OpenIPerlCommForm(GenesisCommunicationSeq myRef, TestMethod method, Test test, iPerlCommunicationParams testParams)
|
||||
{
|
||||
|
||||
//TODO solve this wia SmartCommunicationForm
|
||||
throw new NotImplementedException();
|
||||
//myRef.modelessDlg = new iPerlCommunicationForm(method, test, testParams);
|
||||
//myRef.modelessDlg.Show();
|
||||
|
||||
myRef.modelessDlg = new iPerlCommunicationForm(method, test, testParams);
|
||||
myRef.modelessDlg.Show();
|
||||
}
|
||||
|
||||
|
||||
@@ -376,7 +376,7 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
Program.MainWnd.Invoke(new iPerlCommFormDlgt(OpenIPerlCommForm), new object[] { this, method, test, testParams });
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.iPerl_Communication_in_progress);
|
||||
Bridge.OnActivity(this, Strings.Meter_Communication_in_progress);
|
||||
//------------------------------------------------
|
||||
|
||||
bool stopPressed = false; /// true when STOP button pressed
|
||||
|
||||
@@ -16,7 +16,7 @@ using iPerlCommunicationSeq = TBF.Rig.TestMethods.iPerlCommunication.iPerlCommun
|
||||
|
||||
namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
{
|
||||
public class TestMethod : SmartComponentBase, ISimultTestMethod, ISequenceCondition, ISessionDataMngmnt, ITestMethodSmart
|
||||
public class TestMethod : SmartComponentBase, ISimultTestMethod, ISequenceCondition, ISessionDataMngmnt, ITestMethodSmart
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod));
|
||||
protected static readonly ILog rfidDataLogger = LogManager.GetLogger("RfidData");
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
@@ -39,7 +41,7 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
MaxCommRetries = 4;
|
||||
WaitTimeAfterFailure = 2200;
|
||||
PassThroughWaitTime = 1500;
|
||||
NrThreads = 2; /// 1, 2 or 4 threads
|
||||
NrThreads = 10; /// 1, 2 or 4 threads / 10 threads for genesis
|
||||
IperlCheckErrorsToStop = 10;
|
||||
MciTimeoutMs = 4000; // ms, NFC interface
|
||||
BaudRate = 57600; // NFC Interface
|
||||
@@ -74,18 +76,18 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
public int DataBits { get; set; }
|
||||
public Parity ParityBit { get; set; }
|
||||
public StopBits StopBits { get; set; }
|
||||
public int DfltQ2c_15_rl { get; set; }
|
||||
public int DfltQ2c_15_lr { get; set; }
|
||||
public int DfltQ2c_20_rl { get; set; }
|
||||
public int DfltQ2c_20_lr { get; set; }
|
||||
public int DfltQ2c_25_63_rl { get; set; }
|
||||
public int DfltQ2c_25_63_lr { get; set; }
|
||||
public int DfltQ2c_25_10_rl { get; set; }
|
||||
public int DfltQ2c_25_10_lr { get; set; }
|
||||
public int DfltQ2c_32_rl { get; set; }
|
||||
public int DfltQ2c_32_lr { get; set; }
|
||||
public int DfltQ2c_40_rl { get; set; }
|
||||
public int DfltQ2c_40_lr { get; set; }
|
||||
public int CalibFactor1InchCh1 { get; set; }
|
||||
public int CalibFactor1InchCh2 { get; set; }
|
||||
public int CalibFactor2InchCh1 { get; set; }
|
||||
public int CalibFactor2InchCh2 { get; set; }
|
||||
public int CalibFactor3InchCh1 { get; set; }
|
||||
public int CalibFactor3InchCh2 { get; set; }
|
||||
public int CalibFactor4InchCh1 { get; set; }
|
||||
public int CalibFactor4InchCh2 { get; set; }
|
||||
public int CalibFactor6InchCh1 { get; set; }
|
||||
public int CalibFactor6InchCh2 { get; set; }
|
||||
public int CalibFactor6MoreInchCh1 { get; set; }
|
||||
public int CalibFactor6MoreInchCh2 { get; set; }
|
||||
public bool UseWebService { get; set; }
|
||||
public string BaseUrl { get; set; }
|
||||
public string RelativeUrl { get; set; }
|
||||
@@ -93,5 +95,36 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
///Remember to Ignore in XmlSerializer !!
|
||||
[XmlIgnore]
|
||||
public ITestParams TestParams { get; set; }
|
||||
|
||||
public int CalibFactor1InchCh3 { get; set; }
|
||||
public int CalibFactor2InchCh3 { get; set; }
|
||||
public int CalibFactor3InchCh3 { get; set; }
|
||||
public int CalibFactor4InchCh3 { get; set; }
|
||||
public int CalibFactor6InchCh3 { get; set; }
|
||||
public int CalibFactor6MoreInchCh3 { get; set; }
|
||||
|
||||
public double[] GetQ3CalibrationBySizeDoubles(ushort int16MeterSize)
|
||||
{
|
||||
return GetQ3CalibrationBySizeInts(int16MeterSize).Select(i => (double)i).ToArray();
|
||||
}
|
||||
|
||||
public int[] GetQ3CalibrationBySizeInts(ushort int16MeterSize)
|
||||
{
|
||||
switch (int16MeterSize)
|
||||
{
|
||||
case 0:
|
||||
return new int[] { CalibFactor1InchCh1, CalibFactor1InchCh2, CalibFactor1InchCh3 };
|
||||
case 1:
|
||||
return new int[] { CalibFactor2InchCh1, CalibFactor2InchCh2, CalibFactor2InchCh3 };
|
||||
case 2:
|
||||
return new int[] { CalibFactor3InchCh1, CalibFactor3InchCh2, CalibFactor3InchCh3 };
|
||||
case 3:
|
||||
return new int[] { CalibFactor4InchCh1, CalibFactor4InchCh2, CalibFactor4InchCh3 };
|
||||
case 4:
|
||||
return new int[] { CalibFactor6InchCh1, CalibFactor6InchCh2, CalibFactor6InchCh3};
|
||||
default:
|
||||
return new int[] { CalibFactor6MoreInchCh1, CalibFactor6MoreInchCh2, CalibFactor6MoreInchCh3};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
{
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
iPerlCommunication.TestMethodCfg config;
|
||||
TestMethodCfg config;
|
||||
public IComponentCfg Config
|
||||
{
|
||||
get { return config as IComponentCfg; }
|
||||
set
|
||||
{
|
||||
config = value as iPerlCommunication.TestMethodCfg;
|
||||
config = value as TestMethodCfg;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
@@ -50,18 +50,24 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
nrThreadsTextBox.Text = config.NrThreads.ToString();
|
||||
iperlCheckErrorsToStopTextBox.Text = config.IperlCheckErrorsToStop.ToString();
|
||||
|
||||
textBox15rl.Text = config.DfltQ2c_15_rl.ToString();
|
||||
textBox15lr.Text = config.DfltQ2c_15_lr.ToString();
|
||||
textBox20rl.Text = config.DfltQ2c_20_rl.ToString();
|
||||
textBox20lr.Text = config.DfltQ2c_20_lr.ToString();
|
||||
textBox25_63rl.Text = config.DfltQ2c_25_63_rl.ToString();
|
||||
textBox25_63lr.Text = config.DfltQ2c_25_63_lr.ToString();
|
||||
textBox25_10rl.Text = config.DfltQ2c_25_10_rl.ToString();
|
||||
textBox25_10lr.Text = config.DfltQ2c_25_10_lr.ToString();
|
||||
textBox32rl.Text = config.DfltQ2c_32_rl.ToString();
|
||||
textBox32lr.Text = config.DfltQ2c_32_lr.ToString();
|
||||
textBox40rl.Text = config.DfltQ2c_40_rl.ToString();
|
||||
textBox40lr.Text = config.DfltQ2c_40_lr.ToString();
|
||||
textBoxCh1_15inch.Text = config.CalibFactor1InchCh1.ToString();
|
||||
textBoxCh2_15inch.Text = config.CalibFactor1InchCh2.ToString();
|
||||
textBoxCh3_15inch.Text = config.CalibFactor1InchCh3.ToString();
|
||||
textBoxCh1_2inch.Text = config.CalibFactor2InchCh1.ToString();
|
||||
textBoxCh2_2inch.Text = config.CalibFactor2InchCh2.ToString();
|
||||
textBoxCh3_2inch.Text = config.CalibFactor2InchCh3.ToString();
|
||||
textBoxCh1_3inch.Text = config.CalibFactor3InchCh1.ToString();
|
||||
textBoxCh2_3inch.Text = config.CalibFactor3InchCh2.ToString();
|
||||
textBoxCh3_3inch.Text = config.CalibFactor3InchCh3.ToString();
|
||||
textBoxCh1_4inch.Text = config.CalibFactor4InchCh1.ToString();
|
||||
textBoxCh2_4inch.Text = config.CalibFactor4InchCh2.ToString();
|
||||
textBoxCh3_4inch.Text = config.CalibFactor4InchCh3.ToString();
|
||||
textBoxCh1_6inch.Text = config.CalibFactor6InchCh1.ToString();
|
||||
textBoxCh2_6inch.Text = config.CalibFactor6InchCh2.ToString();
|
||||
textBoxCh3_6inch.Text = config.CalibFactor6InchCh3.ToString();
|
||||
textBoxCh1_6MoreInch.Text = config.CalibFactor6MoreInchCh1.ToString();
|
||||
textBoxCh2_6MoreInch.Text = config.CalibFactor6MoreInchCh2.ToString();
|
||||
textBoxCh3_6MoreInch.Text = config.CalibFactor6MoreInchCh3.ToString();
|
||||
|
||||
useWebServiceCheckBox.Checked = config.UseWebService;
|
||||
baseUrlTextBox.Text = config.BaseUrl;
|
||||
@@ -77,18 +83,24 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
nrThreadsTextBox.Enabled = true;
|
||||
iperlCheckErrorsToStopTextBox.Enabled = true;
|
||||
|
||||
textBox15rl.Enabled = true;
|
||||
textBox15lr.Enabled = true;
|
||||
textBox20rl.Enabled = true;
|
||||
textBox20lr.Enabled = true;
|
||||
textBox25_63rl.Enabled = true;
|
||||
textBox25_63lr.Enabled = true;
|
||||
textBox25_10rl.Enabled = true;
|
||||
textBox25_10lr.Enabled = true;
|
||||
textBox32rl.Enabled = true;
|
||||
textBox32lr.Enabled = true;
|
||||
textBox40rl.Enabled = true;
|
||||
textBox40lr.Enabled = true;
|
||||
textBoxCh1_15inch.Enabled = true;
|
||||
textBoxCh2_15inch.Enabled = true;
|
||||
textBoxCh3_15inch.Enabled = true;
|
||||
textBoxCh1_2inch.Enabled = true;
|
||||
textBoxCh2_2inch.Enabled = true;
|
||||
textBoxCh3_2inch.Enabled = true;
|
||||
textBoxCh1_3inch.Enabled = true;
|
||||
textBoxCh2_3inch.Enabled = true;
|
||||
textBoxCh3_3inch.Enabled = true;
|
||||
textBoxCh1_4inch.Enabled = true;
|
||||
textBoxCh2_4inch.Enabled = true;
|
||||
textBoxCh3_4inch.Enabled = true;
|
||||
textBoxCh1_6inch.Enabled = true;
|
||||
textBoxCh2_6inch.Enabled = true;
|
||||
textBoxCh3_6inch.Enabled = true;
|
||||
textBoxCh1_6MoreInch.Enabled = true;
|
||||
textBoxCh2_6MoreInch.Enabled = true;
|
||||
textBoxCh3_6MoreInch.Enabled = true;
|
||||
|
||||
useWebServiceCheckBox.Enabled = true;
|
||||
ManageCheckGroupBox(useWebServiceCheckBox, useWebServiceGroupBox);
|
||||
@@ -116,10 +128,10 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Comm. timeout' should be in range 0 .. 5000";
|
||||
}
|
||||
if (!int.TryParse(nrThreadsTextBox.Text, out dummy) || (dummy != 1 && dummy != 2 && dummy != 4))
|
||||
if (!int.TryParse(nrThreadsTextBox.Text, out dummy) || (dummy != 1 && dummy != 2 && dummy != 4 && dummy != 8 && dummy != 10))
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Nr. threads' should be 1, 2 or 4";
|
||||
message += Environment.NewLine + "'Nr. threads' should be 1, 2, 4, 8, 10";
|
||||
}
|
||||
if (!int.TryParse(iperlCheckErrorsToStopTextBox.Text, out dummy) || ((dummy < 1) && (dummy > 40)))
|
||||
{
|
||||
@@ -127,66 +139,42 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
message += Environment.NewLine + string.Format(Strings.Invalid_0, iperlCheckErrorsToStopLabel.Text);
|
||||
}
|
||||
|
||||
if (!int.TryParse(textBox15rl.Text, out dummy) || dummy < -50 || dummy > 50)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Default Q2 correction factor DN15 RL should be in range -50 .. 50";
|
||||
}
|
||||
if (!int.TryParse(textBox15lr.Text, out dummy) || dummy < -50 || dummy > 50)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Default Q2 correction factor DN15 LR should be in range -50 .. 50";
|
||||
}
|
||||
if (!int.TryParse(textBox20rl.Text, out dummy) || dummy < -50 || dummy > 50)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Default Q2 correction factor DN20 RL should be in range -50 .. 50";
|
||||
}
|
||||
if (!int.TryParse(textBox20lr.Text, out dummy) || dummy < -50 || dummy > 50)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Default Q2 correction factor DN20 LR should be in range -50 .. 50";
|
||||
}
|
||||
if (!int.TryParse(textBox25_63rl.Text, out dummy) || dummy < -50 || dummy > 50)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Default Q2 correction factor DN25 Q3 6.3 RL should be in range -50 .. 50";
|
||||
}
|
||||
if (!int.TryParse(textBox25_63lr.Text, out dummy) || dummy < -50 || dummy > 50)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Default Q2 correction factor DN25 Q3 6.3 LR should be in range -50 .. 50";
|
||||
}
|
||||
if (!int.TryParse(textBox25_10rl.Text, out dummy) || dummy < -50 || dummy > 50)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Default Q2 correction factor DN25 Q3 10 RL should be in range -50 .. 50";
|
||||
}
|
||||
if (!int.TryParse(textBox25_10lr.Text, out dummy) || dummy < -50 || dummy > 50)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Default Q2 correction factor DN25 Q3 10 LR should be in range -50 .. 50";
|
||||
}
|
||||
if (!int.TryParse(textBox32rl.Text, out dummy) || dummy < -50 || dummy > 50)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Default Q2 correction factor DN32 RL should be in range -50 .. 50";
|
||||
}
|
||||
if (!int.TryParse(textBox32lr.Text, out dummy) || dummy < -50 || dummy > 50)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Default Q2 correction factor DN32 LR should be in range -50 .. 50";
|
||||
}
|
||||
if (!int.TryParse(textBox40rl.Text, out dummy) || dummy < -50 || dummy > 50)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Default Q2 correction factor DN40 RL should be in range -50 .. 50";
|
||||
}
|
||||
if (!int.TryParse(textBox40lr.Text, out dummy) || dummy < -50 || dummy > 50)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Default Q2 correction factor DN40 LR should be in range -50 .. 50";
|
||||
}
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh1_15inch.Text,"1.5 inch", ref message, flags, 1);
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh2_15inch.Text,"1.5 inch", ref message, flags, 2);
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh3_15inch.Text,"1.5 inch", ref message, flags, 3);
|
||||
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh1_2inch.Text,"2 inch", ref message, flags, 1);
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh2_2inch.Text,"2 inch", ref message, flags, 2);
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh3_2inch.Text,"2 inch", ref message, flags, 3);
|
||||
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh1_3inch.Text,"3 inch", ref message, flags, 1);
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh2_3inch.Text,"3 inch", ref message, flags, 2);
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh3_3inch.Text,"3 inch", ref message, flags, 3);
|
||||
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh1_4inch.Text,"4 inch", ref message, flags, 1);
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh2_4inch.Text,"4 inch", ref message, flags, 2);
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh3_4inch.Text,"4 inch", ref message, flags, 3);
|
||||
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh1_6inch.Text,"6 inch", ref message, flags, 1);
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh2_6inch.Text,"6 inch", ref message, flags, 2);
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh3_6inch.Text,"6 inch", ref message, flags, 3);
|
||||
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh1_6MoreInch.Text,">6 inch", ref message, flags, 1);
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh1_6MoreInch.Text,">6 inch", ref message, flags, 2);
|
||||
flags = CfgUpdateFlagsQ3(textBoxCh1_6MoreInch.Text,">6 inch", ref message, flags, 3);
|
||||
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
private CfgUpdateFlags CfgUpdateFlagsQ3(string ValueText, string DN, ref string message, CfgUpdateFlags flags, int ch, int minRange = 0, int maxRange = 25000)
|
||||
{
|
||||
int dummy;
|
||||
if (!int.TryParse(ValueText, out dummy) || dummy < minRange || dummy > maxRange)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + $"Default Q3 correction factor DN({DN}) CH{ch} should be in range {minRange} .. {maxRange}";
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
@@ -208,18 +196,25 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
var DelayBetweenRetries = config.DelayBetweenRetries;
|
||||
var NrThreads = config.NrThreads;
|
||||
var IperlCheckErrorsToStop = config.IperlCheckErrorsToStop;
|
||||
var DfltQ2c_15_rl = config.DfltQ2c_15_rl;
|
||||
var DfltQ2c_15_lr = config.DfltQ2c_15_lr;
|
||||
var DfltQ2c_20_rl = config.DfltQ2c_20_rl;
|
||||
var DfltQ2c_20_lr = config.DfltQ2c_20_lr;
|
||||
var DfltQ2c_25_63_rl = config.DfltQ2c_25_63_rl;
|
||||
var DfltQ2c_25_63_lr = config.DfltQ2c_25_63_lr;
|
||||
var DfltQ2c_25_10_rl = config.DfltQ2c_25_10_rl;
|
||||
var DfltQ2c_25_10_lr = config.DfltQ2c_25_10_lr;
|
||||
var DfltQ2c_32_rl = config.DfltQ2c_32_rl;
|
||||
var DfltQ2c_32_lr = config.DfltQ2c_32_lr;
|
||||
var DfltQ2c_40_rl = config.DfltQ2c_40_rl;
|
||||
var DfltQ2c_40_lr = config.DfltQ2c_40_lr;
|
||||
var calFactor1Ch1 = config.CalibFactor1InchCh1;
|
||||
var calFactor1Ch2 = config.CalibFactor1InchCh2;
|
||||
var calFactor1Ch3 = config.CalibFactor1InchCh3;
|
||||
var calFactor2Ch1 = config.CalibFactor2InchCh1;
|
||||
var calFactor2Ch2 = config.CalibFactor2InchCh2;
|
||||
var calFactor2Ch3 = config.CalibFactor2InchCh3;
|
||||
var calFactor3Ch1 = config.CalibFactor3InchCh1;
|
||||
var calFactor3Ch2 = config.CalibFactor3InchCh2;
|
||||
var calFactor3Ch3 = config.CalibFactor3InchCh3;
|
||||
var calFactor4Ch1 = config.CalibFactor4InchCh1;
|
||||
var calFactor4Ch2 = config.CalibFactor4InchCh2;
|
||||
var calFactor4Ch3 = config.CalibFactor4InchCh3;
|
||||
var calFactor6Ch1 = config.CalibFactor6InchCh1;
|
||||
var calFactor6Ch2 = config.CalibFactor6InchCh2;
|
||||
var calFactor6Ch3 = config.CalibFactor6InchCh3;
|
||||
var calFactor6MCh1 = config.CalibFactor6MoreInchCh1;
|
||||
var calFactor6MCh2 = config.CalibFactor6MoreInchCh2;
|
||||
var calFactor6MCh3 = config.CalibFactor6MoreInchCh3;
|
||||
|
||||
var UseWebService = config.UseWebService;
|
||||
var BaseUrl = config.BaseUrl;
|
||||
var RelativeUrl = config.RelativeUrl;
|
||||
@@ -230,18 +225,24 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
flags |= UpdateDifferent(ref NrThreads, nrThreadsTextBox.Text, CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref IperlCheckErrorsToStop, iperlCheckErrorsToStopTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
|
||||
flags |= UpdateDifferent(ref DfltQ2c_15_rl, textBox15rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref DfltQ2c_15_lr, textBox15lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref DfltQ2c_20_rl, textBox20rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref DfltQ2c_20_lr, textBox20lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref DfltQ2c_25_63_rl, textBox25_63rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref DfltQ2c_25_63_lr, textBox25_63lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref DfltQ2c_25_10_rl, textBox25_10rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref DfltQ2c_25_10_lr, textBox25_10lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref DfltQ2c_32_rl, textBox32rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref DfltQ2c_32_lr, textBox32lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref DfltQ2c_40_rl, textBox40rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref DfltQ2c_40_lr, textBox40lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor1Ch1, textBoxCh1_15inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor1Ch2, textBoxCh2_15inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor1Ch3, textBoxCh3_15inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor2Ch1, textBoxCh1_2inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor2Ch2, textBoxCh2_2inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor2Ch3, textBoxCh3_2inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor3Ch1, textBoxCh1_3inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor3Ch2, textBoxCh2_3inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor3Ch3, textBoxCh3_3inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor4Ch1, textBoxCh1_4inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor4Ch2, textBoxCh2_4inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor4Ch3, textBoxCh3_4inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor6Ch1, textBoxCh1_6inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor6Ch2, textBoxCh2_6inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor6Ch3, textBoxCh3_6inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor6MCh1, textBoxCh1_6MoreInch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor6MCh2, textBoxCh2_6MoreInch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref calFactor6MCh3, textBoxCh3_6MoreInch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
|
||||
flags |= UpdateDifferent(ref UseWebService, useWebServiceCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref BaseUrl, baseUrlTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
@@ -253,25 +254,31 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
config.DelayBetweenRetries = DelayBetweenRetries;
|
||||
config.NrThreads = NrThreads;
|
||||
config.IperlCheckErrorsToStop = IperlCheckErrorsToStop;
|
||||
config.DfltQ2c_15_rl = DfltQ2c_15_rl;
|
||||
config.DfltQ2c_15_lr = DfltQ2c_15_lr;
|
||||
config.DfltQ2c_20_rl = DfltQ2c_20_rl;
|
||||
config.DfltQ2c_20_lr = DfltQ2c_20_lr;
|
||||
config.DfltQ2c_25_63_rl = DfltQ2c_25_63_rl;
|
||||
config.DfltQ2c_25_63_lr = DfltQ2c_25_63_lr;
|
||||
config.DfltQ2c_25_10_rl = DfltQ2c_25_10_rl;
|
||||
config.DfltQ2c_25_10_lr = DfltQ2c_25_10_lr;
|
||||
config.DfltQ2c_32_rl = DfltQ2c_32_rl;
|
||||
config.DfltQ2c_32_lr = DfltQ2c_32_lr;
|
||||
config.DfltQ2c_40_rl = DfltQ2c_40_rl;
|
||||
config.DfltQ2c_40_lr = DfltQ2c_40_lr;
|
||||
config.CalibFactor1InchCh1 = calFactor1Ch1;
|
||||
config.CalibFactor1InchCh2 = calFactor1Ch2;
|
||||
config.CalibFactor1InchCh3 = calFactor1Ch3;
|
||||
config.CalibFactor2InchCh1 = calFactor2Ch1;
|
||||
config.CalibFactor2InchCh2 = calFactor2Ch2;
|
||||
config.CalibFactor2InchCh3 = calFactor2Ch3;
|
||||
config.CalibFactor3InchCh1 = calFactor3Ch1;
|
||||
config.CalibFactor3InchCh2 = calFactor3Ch2;
|
||||
config.CalibFactor3InchCh3 = calFactor3Ch3;
|
||||
config.CalibFactor4InchCh1 = calFactor4Ch1;
|
||||
config.CalibFactor4InchCh2 = calFactor4Ch2;
|
||||
config.CalibFactor4InchCh3 = calFactor4Ch3;
|
||||
config.CalibFactor6InchCh1 = calFactor6Ch1;
|
||||
config.CalibFactor6InchCh2 = calFactor6Ch2;
|
||||
config.CalibFactor6InchCh3 = calFactor6Ch3;
|
||||
config.CalibFactor6MoreInchCh1 = calFactor6MCh1;
|
||||
config.CalibFactor6MoreInchCh2 = calFactor6MCh2;
|
||||
config.CalibFactor6MoreInchCh3 = calFactor6MCh3;
|
||||
config.UseWebService = UseWebService;
|
||||
config.BaseUrl = BaseUrl;
|
||||
config.RelativeUrl = RelativeUrl;
|
||||
|
||||
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
|
||||
{
|
||||
iPerlCommunication.TestMethod.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||
TestMethod.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||
}
|
||||
|
||||
return flags;
|
||||
|
||||
+582
-454
File diff suppressed because it is too large
Load Diff
@@ -30,7 +30,7 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
|
||||
public override void InitializeAll()
|
||||
{
|
||||
Activity = iPerlCommunicationForm.ReadConfigurationStr;
|
||||
Activity = iPerlCommunicationForm.SlotInitializeStr;
|
||||
SimultWithPrevious = false;
|
||||
SimultWithNext = false;
|
||||
}
|
||||
@@ -50,61 +50,80 @@ namespace TBF.Rig.TestMethods.GenesisCommunication
|
||||
if (i == 0)
|
||||
{
|
||||
var retVal = new List<string>();
|
||||
retVal.Add(iPerlCommunicationForm.ReadConfigurationStr);
|
||||
retVal.Add(iPerlCommunicationForm.ReadSerialNrStr);
|
||||
retVal.Add(string.Format("{0} A0", iPerlCommunicationForm.SetTestModeStr));
|
||||
retVal.Add(string.Format("{0} A4", iPerlCommunicationForm.SetTestModeStr));
|
||||
retVal.Add(iPerlCommunicationForm.ReadCalibrationStr);
|
||||
retVal.Add(iPerlCommunicationForm.ReadCalibrationV4Str);
|
||||
retVal.Add(iPerlCommunicationForm.NormalizeCalibrationFactorStr);
|
||||
retVal.Add(iPerlCommunicationForm.NormalizeCalibrationV4FactorsStr);
|
||||
retVal.Add(iPerlCommunicationForm.GetDefaultQ2CorrectionsStr);
|
||||
retVal.Add(iPerlCommunicationForm.ReadQ2CorrectionStr);
|
||||
retVal.Add(iPerlCommunicationForm.ResetQ2CorrectionStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteDefaultQ2CorrectionsStr);
|
||||
retVal.Add(iPerlCommunicationForm.InitOrReadQ2CorrectionsStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteCalibrationFactorStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteCalibrationV4FactorsStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionAltStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionGreeceStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionRLStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionLRStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionIncl05Str);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionAltIncl05Str);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionPlusIncl05Str);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionPlusAltIncl05Str);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionGreeceIncl05Str);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionRLIncl05Str);
|
||||
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionLRIncl05Str);
|
||||
retVal.Add(iPerlCommunicationSeq.Q2correctedFromCmd + "Qx");
|
||||
retVal.Add(iPerlCommunicationSeq.StrictQ2ErrorCheckStr + "Qx");
|
||||
retVal.Add(iPerlCommunicationSeq.Q2correctionCheckCmd);
|
||||
retVal.Add(iPerlCommunicationSeq.IperlCheckCmd);
|
||||
retVal.Add(iPerlCommunicationForm.UpdateBothQ2FactorsTestRLOnlyStr);
|
||||
retVal.Add(iPerlCommunicationForm.UpdateBothQ2FactorsTestLROnlyStr);
|
||||
retVal.Add(iPerlCommunicationForm.UpdateQ2CorrectionsStr);
|
||||
retVal.Add(iPerlCommunicationForm.ConditnlUpdateQ2CorrectionsStr);
|
||||
retVal.Add(iPerlCommunicationForm.ConditnlUpdateQ2CorrRLStr);
|
||||
retVal.Add(iPerlCommunicationForm.ConditnlUpdateQ2CorrLRStr);
|
||||
retVal.Add("Q2 corrected from Q2adj");
|
||||
retVal.Add("Q2 correction check Q2bc Q2ac");
|
||||
retVal.Add(iPerlCommunicationForm.SetActiveModeStr);
|
||||
retVal.Add(iPerlCommunicationForm.SetIdleModeStr);
|
||||
retVal.Add("---");
|
||||
retVal.Add(iPerlCommunicationForm.Reset2HzCorrectionStr);
|
||||
retVal.Add(iPerlCommunicationForm.Write2HzCorrectionStr);
|
||||
retVal.Add(iPerlCommunicationForm.DewaReworkRLStr);
|
||||
retVal.Add(iPerlCommunicationForm.DewaReworkLRStr);
|
||||
retVal.Add(iPerlCommunicationForm.StartTestingSealedMetersStr);
|
||||
retVal.Add(iPerlCommunicationForm.EndTestingSealedMetersStr);
|
||||
retVal.Add(string.Format("{0} if enabled", iPerlCommunicationForm.ReadConfigurationStr));
|
||||
retVal.Add(string.Format("{0} 80", iPerlCommunicationForm.SetTestModeStr));
|
||||
retVal.Add("iPerl_check prevWorkStep direction q2factors");
|
||||
for (iPerlCommunication.ConditionID id = iPerlCommunication.ConditionID.A; id < iPerlCommunication.ConditionID.Count; id++)
|
||||
{
|
||||
retVal.Add(string.Format(iPerlCommunication.SequenceConditionOp.ConditionNameFmt, id));
|
||||
}
|
||||
|
||||
retVal.Add(iPerlCommunicationForm.SlotInitializeStr);
|
||||
retVal.Add(iPerlCommunicationForm.SlotUpdateStr);
|
||||
retVal.Add(iPerlCommunicationForm.SlotConnectStr);
|
||||
retVal.Add(iPerlCommunicationForm.SlotPCBSlotStr);
|
||||
retVal.Add(iPerlCommunicationForm.SlotSetPasswordStr);
|
||||
retVal.Add(iPerlCommunicationForm.SlotLoginStr);
|
||||
retVal.Add(iPerlCommunicationForm.SlotGroupedLoginStr);
|
||||
retVal.Add(iPerlCommunicationForm.SlotSetTestModeStr);
|
||||
retVal.Add(iPerlCommunicationForm.SlotSetActiveModeStr);
|
||||
retVal.Add(iPerlCommunicationForm.SlotDisconnectStr);
|
||||
retVal.Add(iPerlCommunicationForm.PrepareSlotQ3CalibrationStr);
|
||||
retVal.Add(iPerlCommunicationForm.WriteSlotQ3CalibrationStr);
|
||||
retVal.Add(iPerlCommunicationForm.CheckMeterPrepareStr);
|
||||
retVal.Add(iPerlCommunicationForm.HoldSlotStr);
|
||||
|
||||
retVal.Add(iPerlCommunicationForm.PrepareInitializeStr);
|
||||
|
||||
|
||||
// retVal.Add(iPerlCommunicationForm.ReadConfigurationStr);
|
||||
// retVal.Add(iPerlCommunicationForm.ReadSerialNrStr);
|
||||
// retVal.Add(string.Format("{0} A0", iPerlCommunicationForm.SetTestModeStr));
|
||||
// retVal.Add(string.Format("{0} A4", iPerlCommunicationForm.SetTestModeStr));
|
||||
// retVal.Add(iPerlCommunicationForm.ReadCalibrationStr);
|
||||
// retVal.Add(iPerlCommunicationForm.ReadCalibrationV4Str);
|
||||
// retVal.Add(iPerlCommunicationForm.NormalizeCalibrationFactorStr);
|
||||
// retVal.Add(iPerlCommunicationForm.NormalizeCalibrationV4FactorsStr);
|
||||
// retVal.Add(iPerlCommunicationForm.GetDefaultQ2CorrectionsStr);
|
||||
// retVal.Add(iPerlCommunicationForm.ReadQ2CorrectionStr);
|
||||
// retVal.Add(iPerlCommunicationForm.ResetQ2CorrectionStr);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteDefaultQ2CorrectionsStr);
|
||||
// retVal.Add(iPerlCommunicationForm.InitOrReadQ2CorrectionsStr);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteCalibrationFactorStr);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteCalibrationV4FactorsStr);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionStr);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionAltStr);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionGreeceStr);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionRLStr);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionLRStr);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionIncl05Str);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionAltIncl05Str);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionPlusIncl05Str);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionPlusAltIncl05Str);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionGreeceIncl05Str);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionRLIncl05Str);
|
||||
// retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionLRIncl05Str);
|
||||
// retVal.Add(iPerlCommunicationSeq.Q2correctedFromCmd + "Qx");
|
||||
// retVal.Add(iPerlCommunicationSeq.StrictQ2ErrorCheckStr + "Qx");
|
||||
// retVal.Add(iPerlCommunicationSeq.Q2correctionCheckCmd);
|
||||
// retVal.Add(iPerlCommunicationSeq.IperlCheckCmd);
|
||||
// retVal.Add(iPerlCommunicationForm.UpdateBothQ2FactorsTestRLOnlyStr);
|
||||
// retVal.Add(iPerlCommunicationForm.UpdateBothQ2FactorsTestLROnlyStr);
|
||||
// retVal.Add(iPerlCommunicationForm.UpdateQ2CorrectionsStr);
|
||||
// retVal.Add(iPerlCommunicationForm.ConditnlUpdateQ2CorrectionsStr);
|
||||
// retVal.Add(iPerlCommunicationForm.ConditnlUpdateQ2CorrRLStr);
|
||||
// retVal.Add(iPerlCommunicationForm.ConditnlUpdateQ2CorrLRStr);
|
||||
// retVal.Add("Q2 corrected from Q2adj");
|
||||
// retVal.Add("Q2 correction check Q2bc Q2ac");
|
||||
// retVal.Add(iPerlCommunicationForm.SetActiveModeStr);
|
||||
// retVal.Add(iPerlCommunicationForm.SetIdleModeStr);
|
||||
// retVal.Add("---");
|
||||
// retVal.Add(iPerlCommunicationForm.Reset2HzCorrectionStr);
|
||||
// retVal.Add(iPerlCommunicationForm.Write2HzCorrectionStr);
|
||||
// retVal.Add(iPerlCommunicationForm.DewaReworkRLStr);
|
||||
// retVal.Add(iPerlCommunicationForm.DewaReworkLRStr);
|
||||
// retVal.Add(iPerlCommunicationForm.StartTestingSealedMetersStr);
|
||||
// retVal.Add(iPerlCommunicationForm.EndTestingSealedMetersStr);
|
||||
// retVal.Add(string.Format("{0} if enabled", iPerlCommunicationForm.ReadConfigurationStr));
|
||||
// retVal.Add(string.Format("{0} 80", iPerlCommunicationForm.SetTestModeStr));
|
||||
// retVal.Add("iPerl_check prevWorkStep direction q2factors");
|
||||
// for (ConditionID id = ConditionID.A; id < ConditionID.Count; id++)
|
||||
// {
|
||||
// retVal.Add(string.Format(SequenceConditionOp.ConditionNameFmt, id));
|
||||
// }
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
Program.MainWnd.Invoke(new S640CommFormDlgt(OpenS640CommForm), new object[] { this, activity, config, procParams, test });
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.iPerl_Communication_in_progress);
|
||||
Bridge.OnActivity(this, Strings.Meter_Communication_in_progress);
|
||||
//------------------------------------------------
|
||||
|
||||
bool stopPressed = false; /// true when STOP button pressed
|
||||
|
||||
@@ -9,6 +9,7 @@ using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Resources;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Rig.TestMethods.GenesisCommunication;
|
||||
using TBF.Rig.TestMethods.iPerlCommunication;
|
||||
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
|
||||
|
||||
|
||||
@@ -376,7 +376,7 @@ namespace TBF.Rig.TestMethods.SmartMeterFlyingStartMassCollection
|
||||
Program.MainWnd.Invoke(new SmartCommFormDlgt(OpenSmartCommForm), new object[] { this, method, test, testParams });
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.iPerl_Communication_in_progress);
|
||||
Bridge.OnActivity(this, Strings.Meter_Communication_in_progress);
|
||||
//------------------------------------------------
|
||||
|
||||
bool stopPressed = false; /// true when STOP button pressed
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace TBF.Rig.TestMethods.SmartMeterFlyingStartMassCollection
|
||||
MaxCommRetries = 4;
|
||||
WaitTimeAfterFailure = 2200;
|
||||
PassThroughWaitTime = 1500;
|
||||
NrThreads = 2; /// 1, 2 or 4 threads
|
||||
NrThreads = 10; /// 1, 2 or 4 threads / 10 threads for genesis
|
||||
IperlCheckErrorsToStop = 10;
|
||||
MciTimeoutMs = 4000; // ms, NFC interface
|
||||
BaudRate = 57600; // NFC Interface
|
||||
@@ -73,18 +73,18 @@ namespace TBF.Rig.TestMethods.SmartMeterFlyingStartMassCollection
|
||||
public int DataBits { get; set; }
|
||||
public Parity ParityBit { get; set; }
|
||||
public StopBits StopBits { get; set; }
|
||||
public int DfltQ2c_15_rl { get; set; }
|
||||
public int DfltQ2c_15_lr { get; set; }
|
||||
public int DfltQ2c_20_rl { get; set; }
|
||||
public int DfltQ2c_20_lr { get; set; }
|
||||
public int DfltQ2c_25_63_rl { get; set; }
|
||||
public int DfltQ2c_25_63_lr { get; set; }
|
||||
public int DfltQ2c_25_10_rl { get; set; }
|
||||
public int DfltQ2c_25_10_lr { get; set; }
|
||||
public int DfltQ2c_32_rl { get; set; }
|
||||
public int DfltQ2c_32_lr { get; set; }
|
||||
public int DfltQ2c_40_rl { get; set; }
|
||||
public int DfltQ2c_40_lr { get; set; }
|
||||
public int CalibFactor1InchCh1 { get; set; }
|
||||
public int CalibFactor1InchCh2 { get; set; }
|
||||
public int CalibFactor2InchCh1 { get; set; }
|
||||
public int CalibFactor2InchCh2 { get; set; }
|
||||
public int CalibFactor3InchCh1 { get; set; }
|
||||
public int CalibFactor3InchCh2 { get; set; }
|
||||
public int CalibFactor4InchCh1 { get; set; }
|
||||
public int CalibFactor4InchCh2 { get; set; }
|
||||
public int CalibFactor6InchCh1 { get; set; }
|
||||
public int CalibFactor6InchCh2 { get; set; }
|
||||
public int CalibFactor6MoreInchCh1 { get; set; }
|
||||
public int CalibFactor6MoreInchCh2 { get; set; }
|
||||
public bool UseWebService { get; set; }
|
||||
public string BaseUrl { get; set; }
|
||||
public string RelativeUrl { get; set; }
|
||||
|
||||
@@ -51,18 +51,18 @@ namespace TBF.Rig.TestMethods.SmartMeterFlyingStartMassCollection
|
||||
nrThreadsTextBox.Text = config.NrThreads.ToString();
|
||||
iperlCheckErrorsToStopTextBox.Text = config.IperlCheckErrorsToStop.ToString();
|
||||
|
||||
textBox15rl.Text = config.DfltQ2c_15_rl.ToString();
|
||||
textBox15lr.Text = config.DfltQ2c_15_lr.ToString();
|
||||
textBox20rl.Text = config.DfltQ2c_20_rl.ToString();
|
||||
textBox20lr.Text = config.DfltQ2c_20_lr.ToString();
|
||||
textBox25_63rl.Text = config.DfltQ2c_25_63_rl.ToString();
|
||||
textBox25_63lr.Text = config.DfltQ2c_25_63_lr.ToString();
|
||||
textBox25_10rl.Text = config.DfltQ2c_25_10_rl.ToString();
|
||||
textBox25_10lr.Text = config.DfltQ2c_25_10_lr.ToString();
|
||||
textBox32rl.Text = config.DfltQ2c_32_rl.ToString();
|
||||
textBox32lr.Text = config.DfltQ2c_32_lr.ToString();
|
||||
textBox40rl.Text = config.DfltQ2c_40_rl.ToString();
|
||||
textBox40lr.Text = config.DfltQ2c_40_lr.ToString();
|
||||
textBox15rl.Text = config.CalibFactor1InchCh1.ToString();
|
||||
textBox15lr.Text = config.CalibFactor1InchCh2.ToString();
|
||||
textBox20rl.Text = config.CalibFactor2InchCh1.ToString();
|
||||
textBox20lr.Text = config.CalibFactor2InchCh2.ToString();
|
||||
textBox25_63rl.Text = config.CalibFactor3InchCh1.ToString();
|
||||
textBox25_63lr.Text = config.CalibFactor3InchCh2.ToString();
|
||||
textBox25_10rl.Text = config.CalibFactor4InchCh1.ToString();
|
||||
textBox25_10lr.Text = config.CalibFactor4InchCh2.ToString();
|
||||
textBox32rl.Text = config.CalibFactor6InchCh1.ToString();
|
||||
textBox32lr.Text = config.CalibFactor6InchCh2.ToString();
|
||||
textBox40rl.Text = config.CalibFactor6MoreInchCh1.ToString();
|
||||
textBox40lr.Text = config.CalibFactor6MoreInchCh2.ToString();
|
||||
|
||||
useWebServiceCheckBox.Checked = config.UseWebService;
|
||||
baseUrlTextBox.Text = config.BaseUrl;
|
||||
@@ -209,18 +209,18 @@ namespace TBF.Rig.TestMethods.SmartMeterFlyingStartMassCollection
|
||||
var DelayBetweenRetries = config.DelayBetweenRetries;
|
||||
var NrThreads = config.NrThreads;
|
||||
var IperlCheckErrorsToStop = config.IperlCheckErrorsToStop;
|
||||
var DfltQ2c_15_rl = config.DfltQ2c_15_rl;
|
||||
var DfltQ2c_15_lr = config.DfltQ2c_15_lr;
|
||||
var DfltQ2c_20_rl = config.DfltQ2c_20_rl;
|
||||
var DfltQ2c_20_lr = config.DfltQ2c_20_lr;
|
||||
var DfltQ2c_25_63_rl = config.DfltQ2c_25_63_rl;
|
||||
var DfltQ2c_25_63_lr = config.DfltQ2c_25_63_lr;
|
||||
var DfltQ2c_25_10_rl = config.DfltQ2c_25_10_rl;
|
||||
var DfltQ2c_25_10_lr = config.DfltQ2c_25_10_lr;
|
||||
var DfltQ2c_32_rl = config.DfltQ2c_32_rl;
|
||||
var DfltQ2c_32_lr = config.DfltQ2c_32_lr;
|
||||
var DfltQ2c_40_rl = config.DfltQ2c_40_rl;
|
||||
var DfltQ2c_40_lr = config.DfltQ2c_40_lr;
|
||||
var DfltQ2c_15_rl = config.CalibFactor1InchCh1;
|
||||
var DfltQ2c_15_lr = config.CalibFactor1InchCh2;
|
||||
var DfltQ2c_20_rl = config.CalibFactor2InchCh1;
|
||||
var DfltQ2c_20_lr = config.CalibFactor2InchCh2;
|
||||
var DfltQ2c_25_63_rl = config.CalibFactor3InchCh1;
|
||||
var DfltQ2c_25_63_lr = config.CalibFactor3InchCh2;
|
||||
var DfltQ2c_25_10_rl = config.CalibFactor4InchCh1;
|
||||
var DfltQ2c_25_10_lr = config.CalibFactor4InchCh2;
|
||||
var DfltQ2c_32_rl = config.CalibFactor6InchCh1;
|
||||
var DfltQ2c_32_lr = config.CalibFactor6InchCh2;
|
||||
var DfltQ2c_40_rl = config.CalibFactor6MoreInchCh1;
|
||||
var DfltQ2c_40_lr = config.CalibFactor6MoreInchCh2;
|
||||
var UseWebService = config.UseWebService;
|
||||
var BaseUrl = config.BaseUrl;
|
||||
var RelativeUrl = config.RelativeUrl;
|
||||
@@ -254,18 +254,18 @@ namespace TBF.Rig.TestMethods.SmartMeterFlyingStartMassCollection
|
||||
config.DelayBetweenRetries = DelayBetweenRetries;
|
||||
config.NrThreads = NrThreads;
|
||||
config.IperlCheckErrorsToStop = IperlCheckErrorsToStop;
|
||||
config.DfltQ2c_15_rl = DfltQ2c_15_rl;
|
||||
config.DfltQ2c_15_lr = DfltQ2c_15_lr;
|
||||
config.DfltQ2c_20_rl = DfltQ2c_20_rl;
|
||||
config.DfltQ2c_20_lr = DfltQ2c_20_lr;
|
||||
config.DfltQ2c_25_63_rl = DfltQ2c_25_63_rl;
|
||||
config.DfltQ2c_25_63_lr = DfltQ2c_25_63_lr;
|
||||
config.DfltQ2c_25_10_rl = DfltQ2c_25_10_rl;
|
||||
config.DfltQ2c_25_10_lr = DfltQ2c_25_10_lr;
|
||||
config.DfltQ2c_32_rl = DfltQ2c_32_rl;
|
||||
config.DfltQ2c_32_lr = DfltQ2c_32_lr;
|
||||
config.DfltQ2c_40_rl = DfltQ2c_40_rl;
|
||||
config.DfltQ2c_40_lr = DfltQ2c_40_lr;
|
||||
config.CalibFactor1InchCh1 = DfltQ2c_15_rl;
|
||||
config.CalibFactor1InchCh2 = DfltQ2c_15_lr;
|
||||
config.CalibFactor2InchCh1 = DfltQ2c_20_rl;
|
||||
config.CalibFactor2InchCh2 = DfltQ2c_20_lr;
|
||||
config.CalibFactor3InchCh1 = DfltQ2c_25_63_rl;
|
||||
config.CalibFactor3InchCh2 = DfltQ2c_25_63_lr;
|
||||
config.CalibFactor4InchCh1 = DfltQ2c_25_10_rl;
|
||||
config.CalibFactor4InchCh2 = DfltQ2c_25_10_lr;
|
||||
config.CalibFactor6InchCh1 = DfltQ2c_32_rl;
|
||||
config.CalibFactor6InchCh2 = DfltQ2c_32_lr;
|
||||
config.CalibFactor6MoreInchCh1 = DfltQ2c_40_rl;
|
||||
config.CalibFactor6MoreInchCh2 = DfltQ2c_40_lr;
|
||||
config.UseWebService = UseWebService;
|
||||
config.BaseUrl = BaseUrl;
|
||||
config.RelativeUrl = RelativeUrl;
|
||||
|
||||
@@ -55,18 +55,18 @@ namespace TBF.Rig.TestMethods.SmartTest
|
||||
if (config is IiPerlTestMethodCfg cfg)
|
||||
{
|
||||
iperlCheckErrorsToStopTextBox.Text = cfg.IperlCheckErrorsToStop.ToString();
|
||||
textBox15rl.Text = cfg.DfltQ2c_15_rl.ToString();
|
||||
textBox15lr.Text = cfg.DfltQ2c_15_lr.ToString();
|
||||
textBox20rl.Text = cfg.DfltQ2c_20_rl.ToString();
|
||||
textBox20lr.Text = cfg.DfltQ2c_20_lr.ToString();
|
||||
textBox25_63rl.Text = cfg.DfltQ2c_25_63_rl.ToString();
|
||||
textBox25_63lr.Text = cfg.DfltQ2c_25_63_lr.ToString();
|
||||
textBox25_10rl.Text = cfg.DfltQ2c_25_10_rl.ToString();
|
||||
textBox25_10lr.Text = cfg.DfltQ2c_25_10_lr.ToString();
|
||||
textBox32rl.Text = cfg.DfltQ2c_32_rl.ToString();
|
||||
textBox32lr.Text = cfg.DfltQ2c_32_lr.ToString();
|
||||
textBox40rl.Text = cfg.DfltQ2c_40_rl.ToString();
|
||||
textBox40lr.Text = cfg.DfltQ2c_40_lr.ToString();
|
||||
textBox15rl.Text = cfg.CalibFactor1InchCh1.ToString();
|
||||
textBox15lr.Text = cfg.CalibFactor1InchCh2.ToString();
|
||||
textBox20rl.Text = cfg.CalibFactor2InchCh1.ToString();
|
||||
textBox20lr.Text = cfg.CalibFactor2InchCh2.ToString();
|
||||
textBox25_63rl.Text = cfg.CalibFactor3InchCh1.ToString();
|
||||
textBox25_63lr.Text = cfg.CalibFactor3InchCh2.ToString();
|
||||
textBox25_10rl.Text = cfg.CalibFactor4InchCh1.ToString();
|
||||
textBox25_10lr.Text = cfg.CalibFactor4InchCh2.ToString();
|
||||
textBox32rl.Text = cfg.CalibFactor6InchCh1.ToString();
|
||||
textBox32lr.Text = cfg.CalibFactor6InchCh2.ToString();
|
||||
textBox40rl.Text = cfg.CalibFactor6MoreInchCh1.ToString();
|
||||
textBox40lr.Text = cfg.CalibFactor6MoreInchCh2.ToString();
|
||||
}
|
||||
|
||||
useWebServiceCheckBox.Checked = config.UseWebService;
|
||||
@@ -225,18 +225,18 @@ namespace TBF.Rig.TestMethods.SmartTest
|
||||
{
|
||||
|
||||
var IperlCheckErrorsToStop = cfg.IperlCheckErrorsToStop;
|
||||
var DfltQ2c_15_rl = cfg.DfltQ2c_15_rl;
|
||||
var DfltQ2c_15_lr = cfg.DfltQ2c_15_lr;
|
||||
var DfltQ2c_20_rl = cfg.DfltQ2c_20_rl;
|
||||
var DfltQ2c_20_lr = cfg.DfltQ2c_20_lr;
|
||||
var DfltQ2c_25_63_rl = cfg.DfltQ2c_25_63_rl;
|
||||
var DfltQ2c_25_63_lr = cfg.DfltQ2c_25_63_lr;
|
||||
var DfltQ2c_25_10_rl = cfg.DfltQ2c_25_10_rl;
|
||||
var DfltQ2c_25_10_lr = cfg.DfltQ2c_25_10_lr;
|
||||
var DfltQ2c_32_rl = cfg.DfltQ2c_32_rl;
|
||||
var DfltQ2c_32_lr = cfg.DfltQ2c_32_lr;
|
||||
var DfltQ2c_40_rl = cfg.DfltQ2c_40_rl;
|
||||
var DfltQ2c_40_lr = cfg.DfltQ2c_40_lr;
|
||||
var DfltQ2c_15_rl = cfg.CalibFactor1InchCh1;
|
||||
var DfltQ2c_15_lr = cfg.CalibFactor1InchCh2;
|
||||
var DfltQ2c_20_rl = cfg.CalibFactor2InchCh1;
|
||||
var DfltQ2c_20_lr = cfg.CalibFactor2InchCh2;
|
||||
var DfltQ2c_25_63_rl = cfg.CalibFactor3InchCh1;
|
||||
var DfltQ2c_25_63_lr = cfg.CalibFactor3InchCh2;
|
||||
var DfltQ2c_25_10_rl = cfg.CalibFactor4InchCh1;
|
||||
var DfltQ2c_25_10_lr = cfg.CalibFactor4InchCh2;
|
||||
var DfltQ2c_32_rl = cfg.CalibFactor6InchCh1;
|
||||
var DfltQ2c_32_lr = cfg.CalibFactor6InchCh2;
|
||||
var DfltQ2c_40_rl = cfg.CalibFactor6MoreInchCh1;
|
||||
var DfltQ2c_40_lr = cfg.CalibFactor6MoreInchCh2;
|
||||
|
||||
flags |= UpdateDifferent(ref IperlCheckErrorsToStop, iperlCheckErrorsToStopTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref DfltQ2c_15_rl, textBox15rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
@@ -253,18 +253,18 @@ namespace TBF.Rig.TestMethods.SmartTest
|
||||
flags |= UpdateDifferent(ref DfltQ2c_40_lr, textBox40lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
|
||||
cfg.IperlCheckErrorsToStop = IperlCheckErrorsToStop;
|
||||
cfg.DfltQ2c_15_rl = DfltQ2c_15_rl;
|
||||
cfg.DfltQ2c_15_lr = DfltQ2c_15_lr;
|
||||
cfg.DfltQ2c_20_rl = DfltQ2c_20_rl;
|
||||
cfg.DfltQ2c_20_lr = DfltQ2c_20_lr;
|
||||
cfg.DfltQ2c_25_63_rl = DfltQ2c_25_63_rl;
|
||||
cfg.DfltQ2c_25_63_lr = DfltQ2c_25_63_lr;
|
||||
cfg.DfltQ2c_25_10_rl = DfltQ2c_25_10_rl;
|
||||
cfg.DfltQ2c_25_10_lr = DfltQ2c_25_10_lr;
|
||||
cfg.DfltQ2c_32_rl = DfltQ2c_32_rl;
|
||||
cfg.DfltQ2c_32_lr = DfltQ2c_32_lr;
|
||||
cfg.DfltQ2c_40_rl = DfltQ2c_40_rl;
|
||||
cfg.DfltQ2c_40_lr = DfltQ2c_40_lr;
|
||||
cfg.CalibFactor1InchCh1 = DfltQ2c_15_rl;
|
||||
cfg.CalibFactor1InchCh2 = DfltQ2c_15_lr;
|
||||
cfg.CalibFactor2InchCh1 = DfltQ2c_20_rl;
|
||||
cfg.CalibFactor2InchCh2 = DfltQ2c_20_lr;
|
||||
cfg.CalibFactor3InchCh1 = DfltQ2c_25_63_rl;
|
||||
cfg.CalibFactor3InchCh2 = DfltQ2c_25_63_lr;
|
||||
cfg.CalibFactor4InchCh1 = DfltQ2c_25_10_rl;
|
||||
cfg.CalibFactor4InchCh2 = DfltQ2c_25_10_lr;
|
||||
cfg.CalibFactor6InchCh1 = DfltQ2c_32_rl;
|
||||
cfg.CalibFactor6InchCh2 = DfltQ2c_32_lr;
|
||||
cfg.CalibFactor6MoreInchCh1 = DfltQ2c_40_rl;
|
||||
cfg.CalibFactor6MoreInchCh2 = DfltQ2c_40_lr;
|
||||
}
|
||||
flags |= UpdateDifferent(ref UseWebService, useWebServiceCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref BaseUrl, baseUrlTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using System;
|
||||
using TBF.Rig.RegisterReaders.GenesisRegReader.implementations;
|
||||
|
||||
namespace TBF.Rig.TestMethods.iPerlCommunication
|
||||
{
|
||||
@@ -10,12 +11,12 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
|
||||
{
|
||||
public int ThreadId;
|
||||
public int WMNr0; /// 0-based water meter position
|
||||
public iPerlHead.IperlHead Ihead;
|
||||
public GenesisSmartReader Ihead;
|
||||
public Results.Entities.WaterMeter Wm;
|
||||
public string CommMessage;
|
||||
public CommErr CommErr;
|
||||
|
||||
public CommCompletedEventArgs(int threadId, int wmNr0, iPerlHead.IperlHead ihead, Results.Entities.WaterMeter wm, string commMessage, CommErr commErr)
|
||||
public CommCompletedEventArgs(int threadId, int wmNr0, GenesisSmartReader ihead, Results.Entities.WaterMeter wm, string commMessage, CommErr commErr)
|
||||
{
|
||||
this.ThreadId = threadId;
|
||||
this.WMNr0 = wmNr0;
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2022 Sensus Slovensko a.s.
|
||||
///
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.Rig.TestMethods.iPerlCommunication
|
||||
{
|
||||
public enum ConditionID
|
||||
{
|
||||
A,
|
||||
B,
|
||||
C,
|
||||
Count,
|
||||
}
|
||||
|
||||
public class SequenceConditionOp : IOperation
|
||||
{
|
||||
public const string ConditionNameFmt = "iPERL communication milestone {0}";
|
||||
|
||||
ConditionID id;
|
||||
TestMethod testMethodComponent;
|
||||
|
||||
public SequenceConditionOp(TestMethod testMethodComponent, ConditionID id)
|
||||
{
|
||||
this.testMethodComponent = testMethodComponent;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void Start() { }
|
||||
|
||||
public Event Run()
|
||||
{
|
||||
bool conditionMet = testMethodComponent.IperlCommMilestone[(int)id];
|
||||
return conditionMet ? Event.ConditionMet : Event.ConditionNotMet;
|
||||
}
|
||||
|
||||
public void Stop() { }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format(ConditionNameFmt, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user