Initial commit

This commit is contained in:
Rowlander
2021-10-01 11:09:20 +02:00
commit fe54fceb1e
1301 changed files with 853973 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
</configSections>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /></startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<specFlow>
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config --><unitTestProvider name="NUnit" /></specFlow></configuration>
@@ -0,0 +1,298 @@
Feature: MeasurementResults
DUT: Device under test
REF: Reference for measurements, either a weight scale or a REF-meter
[SRS_TBF_COMMON_METRO_001] DUT measured volume calculation
For the “Static Start/Stop” the measurement-time is out of focus because the REF volume will be obtained
from a weight-scale or a REF meter. Therefore the DUT-volume can be directly calculated using the
difference between the start- and stop-volume taking an overflow into account:
DutVolumeCm [m³] = (DutStopVolumeCm [m³] + DutOverflowVolumeCm [m³]) - DutStartVolumeCm [m³]
[SRS_TBF_COMMON_METRO_002] DUT measured time calculation
For the DUT-time can be directly calculated using the difference between the start- and stop-time given by
the DUT and the overflow time:
DutTimeS [s] = (DutStopTimeS [s] + DutOverflowTimeS [s]) - DutStartTimeS [s]
[SRS_TBF_COMMON_METRO _003] DUT measured flow-rate calculation
For the flow-rate calculation the individual DUT-volume and the DUT-time is being needed:
DutFlowRateQmPh [m³/h] = DutVolumeCm [m³] / DutTimeS [s] * 3600 [s/h]
[SRS_TBF_COMMON_METRO _004] DUT versus REF volume correction
For the “Flying Start/ Stop Measurement” the REF time is being used to recalculate the volume during
the test time, due to the fact, that the start and stop data record may be delayed by the software program
flow or the unpredictable operational system timing:
CorrDutVolumeCm [m³] = DutFlowRateQmPh [m³/h] * RefTimeS [s] / 3600 [s/h]
[SRS_TBF_COMMON_METRO _005] DUT to REF scale factor calculation
The calibration is being done using the measured DUT-volume of each individual path, the REF-volume, measured
by a weight scale or a REF meter, and for the flying start/stop measurement the timings of the individual
DUT-channel and the precisely timing of the REF system. The absolute values are going to be used to calculate
the unit-less scale factor:
ScaleFactorRefToDut [] = |RefVolumeCm| / |DutVolumeCm|
[SRS_TBF_COMMON_METRO _006] DUT from REF deviation calculation
The deviation at a specific flow rate shall be calculated using the REF and the measured volume. The
deviation calculation shall be based on absolute values to be independent of the direction of the flow rate:
DeviationDutToRefRel [] = (|DutVolumeCm [m³]| - |RefVolumeCm [m³]|) / |RefVolumeCm [m³]|
DeviationDutToRefPer [%] = DeviationDutToRefRel [] * 100%
[SRS_TBF_COMMON_METRO _007] Channel assignment check
It shall be checked if the required and the start- and end-record-channels are identical to avoid comparison
of unequally channels.
#############################################################################################################
Scenario: 1.0_[SRS_TBF_COMMON_METRO_001]_DutVolumeCalculation_VALID_volume
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | Comment |
| 0 | 0.0 | 6.0 | 0.0 | 180.0 | Positive direction |
| 1 | 0.2 | 6.2 | 0.0 | 180.0 | Offset volume |
| 2 | 0.0 | -6.0 | 0.0 | 180.0 | Negative direction |
| 3 | -0.2 | -6.2 | 0.0 | 180.0 | Offset volume |
| 4 | -0.2 | 5.8 | 0.0 | 180.0 | Zero crossing |
# only start- and stop-records input
When Calculate measurement results - minimal input
Then Test measurement results
# DutVolumeCm [m³] = (DutStopVolumeCm [m³] + DutOverflowVolumeCm [m³]) - DutStartVolumeCm [m³]
| Test | DutVolumeCm | State | Comment |
| 0 | 6.0 | Okay | Positive direction |
| 1 | 6.0 | Okay | Positive direction |
| 2 | -6.0 | Okay | Negative direction |
| 3 | -6.0 | Okay | Offset volume |
| 4 | 6.0 | Okay | Zero crossing |
# -----------------------------------------------------------------------------------------------------------
Scenario: 1.1_[SRS_TBF_COMMON_METRO_001]_DutVolumeCalculation_VALID_volume with overflow
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | DutOverflowVolumeCm | Comment |
| 0 | 0.0 | 2.0 | 0.0 | 180.0 | 4.0 | Positive direction |
| 1 | 0.2 | 2.2 | 0.0 | 180.0 | 4.0 | Positive direction |
| 2 | 0.0 | -2.0 | 0.0 | 180.0 | -4.0 | Negative direction |
| 3 | -0.2 | -2.2 | 0.0 | 180.0 | -4.0 | Negative direction |
# start-, stop-records and overflow volume input
When Calculate measurement results - over flow volume input
Then Test measurement results
# DutVolumeCm [m³] = (DutStopVolumeCm [m³] + DutOverflowVolumeCm [m³]) - DutStartVolumeCm [m³]
| Test | DutVolumeCm | State | Comment |
| 0 | 6.0 | Okay | Positive direction |
| 1 | 6.0 | Okay | Positive direction |
| 2 | -6.0 | Okay | Negative direction |
| 3 | -6.0 | Okay | Negative direction |
# -----------------------------------------------------------------------------------------------------------
Scenario: 1.2_[SRS_TBF_COMMON_METRO_001]_DutVolumeCalculation_INVALID_volume
Given Assign measurement values
# start- and stop-time needed to avoid abortion due to DutTimeS <= 0
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | DutOverflowVolumeCm | Comment |
| 0 | 0.0 | 0.0 | 0.0 | 180.0 | 0.0 | DUT didn't measure |
# start-, stop-records and overflow volume input
When Calculate measurement results - over flow volume input
Then Test measurement results
# DutVolumeCm [m³] = (DutStopVolumeCm [m³] + DutOverflowVolumeCm [m³]) - DutStartVolumeCm [m³]
| Test | DutVolumeCm | State | Comment |
| 0 | 0.0 | ZeroDutVolume | DUT didn't measure |
#############################################################################################################
Scenario: 2.0_[SRS_TBF_COMMON_METRO_002]_DutTimeCalculation_VALID_time
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | Comment |
| 0 | 0.0 | 6.0 | 0.0 | 180.0 | Time increasing |
| 1 | 0.0 | 6.0 | 10.0 | 190.0 | Time offset |
# only start- and stop-records input
When Calculate measurement results - minimal input
Then Test measurement results
# DutTimeS [s] = (DutStopTimeS [s] + DutOverflowTimeS [s]) - DutStartTimeS [s]
| Test | DutTimeS | State | Comment |
| 0 | 180.0 | Okay | Time increasing |
| 1 | 180.0 | Okay | Time offset |
# -----------------------------------------------------------------------------------------------------------
Scenario: 2.1_[SRS_TBF_COMMON_METRO_002]_DutTimeCalculation_VALID_time with overflow
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | DutOverflowTimeS | Comment |
| 0 | 0.0 | 6.0 | 0.0 | 80.0 | 100.0 | Time with overflow |
| 1 | 0.0 | 6.0 | 100.0 | 80.0 | 200.0 | Start time higher |
# start-, stop-records and overflow time input
When Calculate measurement results - over flow time input
Then Test measurement results
# DutTimeS [s] = (DutStopTimeS [s] + DutOverflowTimeS [s]) - DutStartTimeS [s]
| Test | DutTimeS | State | Comment |
| 0 | 180.0 | Okay | Time with overflow |
| 1 | 180.0 | Okay | Start time higher |
# -----------------------------------------------------------------------------------------------------------
Scenario: 2.2_[SRS_TBF_COMMON_METRO_002]_DutTimeCalculation_INVALID_time
Given Assign measurement values
# volumes not needed due to early abortion of execution due to time check <= 0 which is physically impossible
| Test | DutStartTimeS | DutStopTimeS | DutOverflowTimeS | Comment |
| 0 | 0.0 | 0.0 | 0.0 | DUT didn't measure |
| 1 | 100.0 | 80.0 | 0.0 | End time below start time |
| 2 | 0.0 | 80.0 | -100.0 | Negative overflow time |
| 3 | -10.0 | 80.0 | 0.0 | Negative start time |
| 4 | 0.0 | -80.0 | 0.0 | Negative stop time |
| 5 | -100.0 | -80.0 | 0.0 | Negative start and stop time |
# start-, stop-records and overflow time input
When Calculate measurement results - over flow time input
Then Test measurement results
# DutTimeS [s] = (DutStopTimeS [s] + DutOverflowTimeS [s]) - DutStartTimeS [s]
| Test | DutTimeS | State | Comment |
| 0 | 0.0 | ZeroDutTime | DUT didn't measure |
| 1 | -20.0 | InvalidDutTime | End time below start time |
| 2 | -20.0 | InvalidOverFlowTime | Negative overflow time |
| 3 | 90.0 | InvalidDutTime | Negative start time |
| 4 | -80.0 | InvalidDutTime | Negative stop time |
| 5 | 20.0 | InvalidDutTime | Negative start and stop time |
#############################################################################################################
Scenario: 3.0_[SRS_TBF_COMMON_METRO_003]_DutFowRateCalculation_VALID_records with overflow
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutOverflowVolumeCm | DutStartTimeS | DutStopTimeS | DutOverflowTimeS | Comment |
| 0 | 0.0 | 1.8 | 4.2 | 0.0 | 180.0 | 0.0 | Positive direction |
When Calculate measurement results - full input
Then Test measurement results
# DutFlowRateCmPh [m³/h] = DutVolumeCm [m³] / DutTimeS [s] * 3600 [s/h]
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | State | Comment |
| 0 | 6.0 | 180.0 | 120.0 | Okay | Positive direction |
# -----------------------------------------------------------------------------------------------------------
Scenario: 3.1_[SRS_TBF_COMMON_METRO_003]_DutFlowRateCalculation_INVALID_records
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutOverflowVolumeCm | DutStartTimeS | DutStopTimeS | DutOverflowTimeS | Comment |
| 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | DUT didn't measure |
| 1 | 0.0 | 0.0 | 0.0 | 0.0 | 180.0 | 0.0 | DUT didn't measure |
When Calculate measurement results - full input
Then Test measurement results
# DutFlowRateCmPh [m³/h] = DutVolumeCm [m³] / DutTimeS [s] * 3600 [s/h]
# DutTimeS will be checked first and cause abortion before DutVolumeCm check
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | State | Comment |
| 0 | 0.0 | 0.0 | null | ZeroDutTime | DUT didn't measure |
| 1 | 0.0 | 180.0 | 0.0 | ZeroDutVolume | DUT didn't measure |
#############################################################################################################
Scenario: 4.0_[SRS_TBF_COMMON_METRO_004]_DutVersusRefVolumeCorrection_VALID_Ref time
Given Assign measurement values
# REF-volume is needed to avoid abortion due to REF-volume equals 0.0
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | RefVolumeCm | RefTimeS | Comment |
| 0 | 0.0 | 6.2 | 0.0 | 186.0 | 6.0 | 180.0 | Positive direction |
| 1 | 2.0 | 8.2 | 0.0 | 186.0 | 6.0 | 180.0 | Offset volume |
| 2 | 0.0 | -6.2 | 0.0 | 186.0 | 6.0 | 180.0 | Negative direction |
| 3 | -2.0 | -8.2 | 0.0 | 186.0 | 6.0 | 180.0 | Offset volume |
| 4 | -2.0 | 4.2 | 0.0 | 186.0 | 6.0 | 180.0 | Zero crossing |
When Calculate measurement results - full input
# CorrDutVolumeCm [m³] = DutFlowRateCmPh [m³/h] * RefTimeS [s] / 3600 [s/h]
Then Test measurement results
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | CorrDutVolumeCm | State | Comment |
| 0 | 6.2 | 186.0 | 120.0 | 6.0 | Okay | Positive direction |
| 1 | 6.2 | 186.0 | 120.0 | 6.0 | Okay | Offset volume |
| 2 | -6.2 | 186.0 | -120.0 | -6.0 | Okay | Negative direction |
| 3 | -6.2 | 186.0 | -120.0 | -6.0 | Okay | Offset volume |
| 4 | 6.2 | 186.0 | 120.0 | 6.0 | Okay | Zero crossing |
# -----------------------------------------------------------------------------------------------------------
Scenario: 4.1_[SRS_TBF_COMMON_METRO_004]_DutVersusRefVolumeCorrection_INVALID_Ref time
Given Assign measurement values
# REF-volume is needed to avoid abortion due to zero REF-volume
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | RefVolumeCm | RefTimeS | Comment |
| 0 | 0.0 | 6.2 | 0.0 | 186.0 | 6.0 | 0.0 | REF time zero |
| 1 | 0.0 | 6.2 | 0.0 | 186.0 | 6.0 | -180.0 | REF time invalid |
When Calculate measurement results - full input
# CorrDutVolumeCm [m³] = DutFlowRateCmPh [m³/h] * RefTimeS [s] / 3600 [s/h]
Then Test measurement results
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | CorrDutVolumeCm | State | Comment |
| 0 | 6.2 | 186.0 | 120.0 | 6.2 | ZeroRefTime | REF time zero |
| 1 | 6.2 | 186.0 | 120.0 | 6.2 | InvalidRefTime | REF time invalid |
#############################################################################################################
Scenario: 5.0_[SRS_TBF_COMMON_METRO_005]_DutToRefScaleFactorCalculation_VALID_Ref volume static start stop
Given Assign measurement values
# DUT-time is needed to avoid abortion with zero or invalid meter time even if static start stop is independent
# of DUT- and REF-time, it simply compares the given volumes
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | RefVolumeCm | Comment |
| 0 | 0.0 | 6.0 | 0.0 | 180.0 | 6.0 | Volumes identical |
| 1 | 0.0 | 5.4 | 0.0 | 186.0 | 6.0 | REF volume higher |
| 2 | 0.0 | 6.6 | 0.0 | 190.0 | 6.0 | DUT volume higher |
When Calculate measurement results - ref volume input
# ScaleFactorRefToMeter [] = |RefVolumeCm| / |DutVolumeCm|
Then Test measurement results
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | RefFlowRateCmPh | ScaleFactorRefToDut | State | Comment |
| 0 | 6.0 | 180.0 | 120.0 | null | 1.0 | Okay | Volumes identical |
| 1 | 5.4 | 186.0 | 104.516 | null | 1.1111111 | Okay | REF volume higher |
| 2 | 6.6 | 190.0 | 125.053 | null | 0.9090909 | Okay | DUT volume higher |
# -----------------------------------------------------------------------------------------------------------
Scenario: 5.1_[SRS_TBF_COMMON_METRO_005]_DutToRefScaleFactorCalculation_VALID_Ref time and volume flying start stop
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | RefVolumeCm | RefTimeS | Comment |
| 0 | 0.0 | 6.2 | 0.0 | 186.0 | 6.0 | 180.0 | Volumes identical |
| 1 | 0.0 | 5.58 | 0.0 | 186.0 | 6.0 | 180.0 | REF volume higher |
| 2 | 0.0 | 6.82 | 0.0 | 186.0 | 6.0 | 180.0 | DUT volume higher |
When Calculate measurement results - full input
# ScaleFactorRefToMeter [] = |RefVolumeCm| / |DutVolumeCm|
Then Test measurement results
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | CorrDutVolumeCm | RefFlowRateCmPh | ScaleFactorRefToDut | State | Comment |
| 0 | 6.2 | 186.0 | 120.0 | 6.0 | 120.0 | 1.0 | Okay | Volumes identical |
| 1 | 5.58 | 186.0 | 108.0 | 5.4 | 120.0 | 1.1111111 | Okay | REF volume higher |
| 2 | 6.82 | 186.0 | 132.0 | 6.6 | 120.0 | 0.9090909 | Okay | DUT volume higher |
# -----------------------------------------------------------------------------------------------------------
Scenario: 5.2_[SRS_TBF_COMMON_METRO_005]_DutToRefScaleFactorCalculation_INVALID_Ref volume
Given Assign measurement values
# DUT-time is needed to avoid abortion with zero or invalid meter time even if static start stop is independent
# of DUT- and REF-time, it simply compares the given volumes
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | RefVolumeCm | Comment |
| 0 | 0.0 | 6.0 | 0.0 | 180.0 | null | REF volume null |
| 1 | 0.0 | 6.0 | 0.0 | 180.0 | 0.0 | REF volume zero |
When Calculate measurement results - ref volume input
# ScaleFactorRefToMeter [] = |RefVolumeCm| / |DutVolumeCm|
# if REF-volume is null, a simple calculation of DUT parameters is executed, therefore the state is "Okay"
Then Test measurement results
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | RefFlowRateCmPh | ScaleFactorRefToDut | State | Comment |
| 0 | 6.0 | 180.0 | 120.0 | null | null | Okay | REF volume null |
| 1 | 6.0 | 180.0 | 120.0 | null | null | ZeroRefVolume | REF volume zero |
#############################################################################################################
Scenario: 6.0_[SRS_TBF_COMMON_METRO_006]_DutFromRefDeviationCalculation_VALID_Ref time and volume flying start stop
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | RefVolumeCm | RefTimeS | Comment |
| 0 | 0.0 | 6.2 | 0.0 | 186.0 | 6.0 | 180.0 | Volumes identical |
| 1 | 0.0 | 5.58 | 0.0 | 186.0 | 6.0 | 180.0 | REF volume higher |
| 2 | 0.0 | 6.82 | 0.0 | 186.0 | 6.0 | 180.0 | DUT volume higher |
When Calculate measurement results - full input
# DeviationDutToRefRel [] = (|CorrDutVolumeCm [m³]| - |RefVolumeCm [m³]|) / |RefVolumeCm [m³]|
# DeviationDutToRefPer [%] = DeviationDutToRefRel [] * 100%
Then Test measurement results
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | CorrDutVolumeCm | RefFlowRateCmPh | DeviationDutToRefRel | DeviationDutToRefPer | State | Comment |
| 0 | 6.2 | 186.0 | 120.0 | 6.0 | 120.0 | 0.0 | 0.0 | Okay | Volumes identical |
| 1 | 5.58 | 186.0 | 108.0 | 5.4 | 120.0 | -0.1 | -10.0 | Okay | REF volume higher |
| 2 | 6.82 | 186.0 | 132.0 | 6.6 | 120.0 | 0.1 | 10.0 | Okay | DUT volume higher |
# -----------------------------------------------------------------------------------------------------------
Scenario: 6.1_[SRS_TBF_COMMON_METRO_006]_DutFromRefDeviationCalculation_INVALID_Ref volume
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | RefVolumeCm | Comment |
| 0 | 0.0 | 6.0 | 0.0 | 180.0 | null | REF volume null |
| 1 | 0.0 | 6.0 | 0.0 | 180.0 | 0.0 | REF volume zero |
When Calculate measurement results - full input
# if REF-volume is null, a simple calculation of DUT parameters is executed, therefore the state is "Okay"
Then Test measurement results
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | DeviationDutToRefRel | DeviationDutToRefPer | State | Comment |
| 0 | 6.0 | 180.0 | 120.0 | null | null | Okay | REF volume null |
| 1 | 6.0 | 180.0 | 120.0 | null | null | ZeroRefVolume | REF volume zero |
#############################################################################################################
Scenario: 7.0_[SRS_TBF_COMMON_METRO_007]_ChannelAssignmentCheck_INVALID_channel input
Given Assign measurement values
| Test | StartChannel | EndChannel | RequiredChannel | Comment |
| 0 | 1 | 0 | 0 | Records do not match |
| 1 | 0 | 1 | 0 | Records do not match |
| 2 | 0 | 0 | 1 | Wrong channel required |
When Calculate measurement results - channel input
# Are the StartChannel, EndChannel and RequiredChannels equal?
Then Test measurement results
| Test | State | Comment |
| 0 | WrongChannel | Records do not match |
| 1 | WrongChannel | Records do not match |
| 2 | WrongChannel | Wrong channel required |
############################################################################################################
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,276 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\NUnit3TestAdapter.3.13.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\..\packages\NUnit3TestAdapter.3.13.0\build\net35\NUnit3TestAdapter.props')" />
<Import Project="..\..\packages\NUnit.3.11.0\build\NUnit.props" Condition="Exists('..\..\packages\NUnit.3.11.0\build\NUnit.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3DD94AD1-D153-46DD-8550-645C57EA8326}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Xylem.Common.Metrology.Measurements.UnitTests</RootNamespace>
<AssemblyName>Xylem.Common.Metrology.Measurements.UnitTests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>6</LangVersion>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'XP32bit|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\XP32bit\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'XP32bit|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\XP32bit\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'XP32bit|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\XP32bit\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'PerformTest|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\PerformTest\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>6</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'PerformTest|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\PerformTest\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'PerformTest|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\PerformTest\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '_MANUAL_CONTROL|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\_MANUAL_CONTROL\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '_MANUAL_CONTROL|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\_MANUAL_CONTROL\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>6</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '_MANUAL_CONTROL|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\_MANUAL_CONTROL\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise />
</Choose>
<ItemGroup>
<Compile Include="MeasurementResults.feature.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>MeasurementResults.feature</DependentUpon>
</Compile>
<Compile Include="MeasurementsResultsSteps.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="MeasurementResults.feature">
<Generator>SpecFlowSingleFileGenerator</Generator>
<LastGenOutput>MeasurementResults.feature.cs</LastGenOutput>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.11.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0-preview.18571.3\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
<HintPath>..\..\packages\System.Threading.Tasks.Extensions.4.6.0-preview.18571.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
<HintPath>..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="TechTalk.SpecFlow, Version=2.4.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL">
<HintPath>..\..\packages\SpecFlow.2.4.1\lib\net45\TechTalk.SpecFlow.dll</HintPath>
</Reference>
<Reference Include="Utf8Json, Version=1.3.7.0, Culture=neutral, PublicKeyToken=8a73d3ba7e392e27">
<HintPath>..\..\packages\Utf8Json.1.3.7\lib\net45\Utf8Json.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Measurements\Measurements.csproj">
<Project>{4137F700-709D-411D-99ED-BC03E82F7BF6}</Project>
<Name>Measurements</Name>
</ProjectReference>
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\NUnit.3.11.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit.3.11.0\build\NUnit.props'))" />
<Error Condition="!Exists('..\..\packages\NUnit3TestAdapter.3.13.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit3TestAdapter.3.13.0\build\net35\NUnit3TestAdapter.props'))" />
<Error Condition="!Exists('..\..\packages\SpecFlow.2.4.1\build\SpecFlow.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\SpecFlow.2.4.1\build\SpecFlow.targets'))" />
</Target>
<Import Project="..\..\packages\SpecFlow.2.4.1\build\SpecFlow.targets" Condition="Exists('..\..\packages\SpecFlow.2.4.1\build\SpecFlow.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -0,0 +1,246 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
using TechTalk.SpecFlow;
using Xylem.Common.Metrology.Measurements.Consts;
namespace Xylem.Common.Metrology.Measurements.UnitTests
{
[Binding]
public class MeasurementsResultsSteps
{
private class Measurement
{
public UInt16 Test;
public MeasurementRecord DutStartRecord;
public MeasurementRecord DutStopRecord;
public Double DutOverflowVolumeCm;
public Double DutOverflowTimeS;
public Double? RefVolumeCm;
public Double? RefTimeS;
public Int32 RequiredChannel;
public MeasurementResults MeasurementResults;
}
private readonly List<Measurement> _measurementList = new List<Measurement>();
[Given(@"Assign measurement values")]
public void GivenAssignMeasurementValues(Table table)
{
try
{
//creation of new measurements out of feature "Given" table
foreach (var row in table.Rows)
{
var measurement = new Measurement
{
DutStartRecord = new MeasurementRecord(),
DutStopRecord = new MeasurementRecord()
};
if (row.ContainsKey("Test"))
measurement.Test = UInt16.Parse(row["Test"]);
//filter for missing inputs
if (row.ContainsKey("DutStartVolumeCm"))
measurement.DutStartRecord.VolumeCm = Double.Parse(row["DutStartVolumeCm"]);
if (row.ContainsKey("DutStopVolumeCm"))
measurement.DutStopRecord.VolumeCm = Double.Parse(row["DutStopVolumeCm"]);
if (row.ContainsKey("DutStartTimeS"))
measurement.DutStartRecord.TimeS = Double.Parse(row["DutStartTimeS"]);
if (row.ContainsKey("DutStopTimeS"))
measurement.DutStopRecord.TimeS = Double.Parse(row["DutStopTimeS"]);
if (row.ContainsKey("StartChannel"))
measurement.DutStartRecord.Channel = Int32.Parse(row["StartChannel"]);
if (row.ContainsKey("EndChannel"))
measurement.DutStopRecord.Channel = Int32.Parse(row["EndChannel"]);
if (row.ContainsKey("RequiredChannel"))
measurement.RequiredChannel = Int32.Parse(row["RequiredChannel"]);
if (row.ContainsKey("DutOverflowVolumeCm"))
measurement.DutOverflowVolumeCm = Double.Parse(row["DutOverflowVolumeCm"]);
if (row.ContainsKey("DutOverflowTimeS"))
measurement.DutOverflowTimeS = Double.Parse(row["DutOverflowTimeS"]);
if (row.ContainsKey("RefVolumeCm"))
{
if (row["RefVolumeCm"].Equals("null")) measurement.RefVolumeCm = null;
else measurement.RefVolumeCm = Double.Parse(row["RefVolumeCm"]);
}
if (row.ContainsKey("RefTimeS"))
{
if (row["RefTimeS"].Equals("null")) measurement.RefTimeS = null;
else measurement.RefTimeS = Double.Parse(row["RefTimeS"]);
}
//fill list with measurement
_measurementList.Add(measurement);
}
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
}
[When(@"Calculate measurement results - minimal input")]
public void WhenCalculateMeasurementResults_MinimalInput()
{
foreach (var measurement in _measurementList)
{
measurement.MeasurementResults = new MeasurementResults(measurement.DutStartRecord,
measurement.DutStopRecord);
}
}
[When(@"Calculate measurement results - over flow volume input")]
public void WhenCalculateMeasurementResults_OverFlowVolumeInput()
{
foreach (var measurement in _measurementList)
{
measurement.MeasurementResults = new MeasurementResults(measurement.DutStartRecord,
measurement.DutStopRecord, measurement.DutOverflowVolumeCm);
}
}
[When(@"Calculate measurement results - over flow time input")]
public void WhenCalculateMeasurementResults_OverFlowTimeInput()
{
foreach (var measurement in _measurementList)
{
measurement.MeasurementResults = new MeasurementResults(measurement.DutStartRecord,
measurement.DutStopRecord, accuDutOverflowTimeS: measurement.DutOverflowTimeS);
}
}
[When(@"Calculate measurement results - ref volume input")]
public void WhenCalculateMeasurementResults_RefVolumeInput()
{
foreach (var measurement in _measurementList)
{
measurement.MeasurementResults = new MeasurementResults(measurement.DutStartRecord,
measurement.DutStopRecord, refVolumeCm: measurement.RefVolumeCm);
}
}
[When(@"Calculate measurement results - channel input")]
public void WhenCalculateMeasurementResults_ChannelInput()
{
foreach (var measurement in _measurementList)
{
measurement.MeasurementResults = new MeasurementResults(measurement.DutStartRecord,
measurement.DutStopRecord, requiredChannel: measurement.RequiredChannel);
}
}
[When(@"Calculate measurement results - full input")]
public void WhenCalculateMeasurementResults_FullInput()
{
foreach (var measurement in _measurementList)
{
measurement.MeasurementResults = new MeasurementResults(measurement.DutStartRecord,
measurement.DutStopRecord, measurement.DutOverflowVolumeCm, measurement.DutOverflowTimeS,
measurement.RefVolumeCm, measurement.RefTimeS, measurement.RequiredChannel);
}
}
[Then(@"Test measurement results")]
public void ThenTestMeasurementResultsFullInput(Table table)
{
try
{
foreach (var row in table.Rows)
{
if (row.ContainsKey("Test"))
{
var index = UInt16.Parse(row["Test"]);
Assert.AreEqual(index, _measurementList[index].Test, "Wrong test number");
if (row.ContainsKey("DutVolumeCm"))
Assert.AreEqual(Double.Parse(row["DutVolumeCm"]),
_measurementList[index].MeasurementResults.DutVolumeCm, 0.001,
"Wrong DutVolumeCm");
if (row.ContainsKey("DutTimeS"))
Assert.AreEqual(Double.Parse(row["DutTimeS"]),
_measurementList[index].MeasurementResults.DutTimeS, 0.001,
"Wrong DutTimeS");
if (row.ContainsKey("DutFlowRateCmPh"))
{
if (row["DutFlowRateCmPh"].Equals("null"))
Assert.IsNull(_measurementList[index].MeasurementResults.DutFlowRateCmPh,
"Wrong DutFlowRateCmPh");
else
Assert.AreEqual(Double.Parse(row["DutFlowRateCmPh"]),
_measurementList[index].MeasurementResults.DutFlowRateCmPh, 0.001,
"Wrong DutFlowRateCmPh");
}
if (row.ContainsKey("CorrDutVolumeCm"))
Assert.AreEqual(Double.Parse(row["CorrDutVolumeCm"]),
_measurementList[index].MeasurementResults.CorrectedDutVolumeCm, 0.001,
"Wrong CorrectedDutVolumeCm");
if (row.ContainsKey("RefFlowRateCmPh"))
{
if (row["RefFlowRateCmPh"].Equals("null"))
Assert.IsNull(_measurementList[index].MeasurementResults.RefFlowRateCmPh,
"Wrong RefFlowRateCmPh");
else
Assert.AreEqual(Double.Parse(row["RefFlowRateCmPh"]),
_measurementList[index].MeasurementResults.RefFlowRateCmPh, 0.001,
"Wrong RefFlowRateCmPh");
}
if (row.ContainsKey("ScaleFactorRefToDut"))
{
if (row["ScaleFactorRefToDut"].Equals("null"))
Assert.IsNull(_measurementList[index].MeasurementResults.ScaleFactorRefToDut,
"Wrong ScaleFactorRefToDut");
else
Assert.AreEqual(Double.Parse(row["ScaleFactorRefToDut"]),
_measurementList[index].MeasurementResults.ScaleFactorRefToDut, 0.000001,
"Wrong ScaleFactorRefToDut");
}
if (row.ContainsKey("DeviationDutToRefRel"))
{
if (row["DeviationDutToRefRel"].Equals("null"))
Assert.IsNull(_measurementList[index].MeasurementResults.DeviationDutToRefRel,
"Wrong DeviationDutToRefRel");
else
Assert.AreEqual(Double.Parse(row["DeviationDutToRefRel"]),
_measurementList[index].MeasurementResults.DeviationDutToRefRel, 0.00001,
"Wrong DeviationDutToRefRel");
}
if (row.ContainsKey("DeviationDutToRefPer"))
{
if (row["DeviationDutToRefPer"].Equals("null"))
Assert.IsNull(_measurementList[index].MeasurementResults.DeviationDutToRefPer,
"Wrong DeviationDutToRefPer");
else
Assert.AreEqual(Double.Parse(row["DeviationDutToRefPer"]),
_measurementList[index].MeasurementResults.DeviationDutToRefPer, 0.001,
"Wrong DeviationDutToRefPer");
}
if (row.ContainsKey("State"))
{
var requiredState = (MeasurementResultsStates)Enum.Parse(typeof(MeasurementResultsStates), row["State"]);
Assert.AreEqual(requiredState, _measurementList[index].MeasurementResults.State, "Unexpected state");
}
}
}
//clear measurement list for next test
_measurementList.Clear();
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
}
}
}
@@ -0,0 +1,8 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Xylem.Common.Metrology.Measurements.UnitTests")]
[assembly: AssemblyDescription("")]
[assembly: ComVisible(false)]
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net461" />
<package id="NUnit" version="3.11.0" targetFramework="net461" />
<package id="NUnit3TestAdapter" version="3.13.0" targetFramework="net461" />
<package id="SpecFlow" version="2.4.1" targetFramework="net461" />
<package id="SpecFlow.NUnit" version="2.4.1" targetFramework="net461" />
<package id="System.Reflection.Emit" version="4.3.0" targetFramework="net461" />
<package id="System.Reflection.Emit.Lightweight" version="4.3.0" targetFramework="net461" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0-preview.18571.3" targetFramework="net461" />
<package id="System.Threading.Tasks.Extensions" version="4.6.0-preview.18571.3" targetFramework="net461" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
<package id="Utf8Json" version="1.3.7" targetFramework="net461" />
</packages>
@@ -0,0 +1,324 @@
using System;
using System.Timers;
using NLog;
using Xylem.Common.CommonCore.Consts;
using Xylem.Common.Metrology.Measurements.Consts;
using Xylem.Common.Utils.Logging;
namespace Xylem.Common.Metrology.Measurements
{
/// <inheritdoc />
/// <summary>
/// Holds all stuff for calibration of a Genesis Meter
/// </summary>
public class BaseMeasurement : IMeasurement
{
/// <summary>
/// Record at the start of the measurement
/// </summary>
public IMeasurementRecord DutStartRecord;
/// <summary>
/// Record at the end of the measurement
/// </summary>
public IMeasurementRecord DutStopRecord;
/// <summary>
/// Backup of intermediate record
/// </summary>
private IMeasurementRecord _lastIntermediateRecord;
/// <summary>
/// Backup of intermediate record for short term result
/// This can be used to observe a result (e.g. flow rate)
/// between two intermediate records. The update time is
/// set in the ctor by intermediateUpdateTimeS.
/// </summary>
private IMeasurementRecord _last2IntermediateRecord;
/// <summary>
/// Intermediate record for ongoing measurement
/// </summary>
public IMeasurementRecord IntermediateRecord;
/// <inheritdoc />
public event EventHandler OnActionStateHasChanged;
/// <summary>
/// Holds the accumulated overflow volume, will work only if
/// <see cref="CheckForOverFlowVolumeAndTime()" /> is being called cyclically.
/// The overflow will take place due to the fixed point number format or the
/// display resolution setting.
/// </summary>
private Double _accuDutOverflowVolumeCm;
/// <summary>
/// Holds the accumulated overflow time, will work only if
/// <see cref="CheckForOverFlowVolumeAndTime()" /> is being called cyclically.
/// The overflow takes place due to the fixed point number format.
/// </summary>
private Double _accuDutOverflowTimeS;
/// <summary>
/// Logger for debug output of measurement
/// </summary>
public readonly ILogger LoggerMeasurement;
/// <summary>
/// Physical slot of the device
/// </summary>
public readonly Int32 Slot;
/// <summary>
/// Identification of the channel
/// </summary>
private readonly Int32 _channel;
private MeasurementStates _state;
private readonly Type _measurementRecordType;
/// <inheritdoc />
/// <summary>
/// State machine for one measurement (on one meter and one channel)
/// </summary>
/// <history date="2018Jan24" author="drabesch">
/// - add State-machine for better handling
/// </history>
public MeasurementStates MeasurementState
{
get
{
return _state;
}
set
{
if (value == MeasurementStates.IsWaitingForIntermediateData &&
(_state == MeasurementStates.IsCompleted || _state == MeasurementStates.IsWaitingForEndData
|| _state == MeasurementStates.IsWaitingForStartData))
{
LoggerMeasurement.Info(
$"Tried to override measurement state with {value} while current state is {_state}");
}
else if (value == MeasurementStates.IsRunning && (_state == MeasurementStates.IsWaitingForEndData
|| _state == MeasurementStates.IsCompleted))
{
LoggerMeasurement.Info(
$"Tried to override measurement state with {value} while current state is {_state}");
}
else
{
_state = value;
}
}
}
/// <inheritdoc />
public BaseMeasurement(Int32 slot, Type measurementRecordType, Int32 intermediateUpdateTimeS, Int32 channel = 0)
{
//build the update time in milliseconds, this will be needed for overflow detection of volume and time
var sw = new Timer(intermediateUpdateTimeS * 1000);
sw.Start();
//request intermediate record for overflow detection and display update
sw.Elapsed += RequestIntermediateRecordByTimer;
Slot = slot;
_channel = channel;
_measurementRecordType = measurementRecordType;
LoggerMeasurement = NLogHelper.CreateOrGetMultiLogger($"Slot:{Slot}", "Slot", "Measurement", "MeterBase", "MeterBase");
}
public void RequestIntermediateRecordByTimer(Object o, ElapsedEventArgs e)
{
if (MeasurementState != MeasurementStates.IsRunning) return;
MeasurementState = MeasurementStates.IsWaitingForIntermediateData;
OnActionStateHasChanged?.Invoke(o, e);
}
public void RequestIntermediateRecord()
{
if (MeasurementState != MeasurementStates.IsRunning) return;
MeasurementState = MeasurementStates.IsWaitingForIntermediateData;
OnActionStateHasChanged?.Invoke(this, EventArgs.Empty);
}
/// <inheritdoc />
public new Type GetType()
{
return _measurementRecordType;
}
/// <inheritdoc />
public Int32 GetChannel()
{
return _channel;
}
/// <inheritdoc />
public void Clear()
{
DutStartRecord = null;
DutStopRecord = null;
IntermediateRecord = null;
_lastIntermediateRecord = null;
_last2IntermediateRecord = null;
MeasurementState = MeasurementStates.NotStarted;
}
/// <inheritdoc />
public void Dispose()
{
Clear();
}
/// <inheritdoc />
public MeasurementResults GetShortTermMeasurementResult(Double? refVolumeCm = null, Double? refTimeS = null)
{
if (_last2IntermediateRecord == null || _lastIntermediateRecord == null)
throw new ApplicationException("Measurement records missing");
return new MeasurementResults(_last2IntermediateRecord, _lastIntermediateRecord, _accuDutOverflowVolumeCm,
_accuDutOverflowTimeS, refVolumeCm, refTimeS, _channel);
}
/// <inheritdoc />
public MeasurementResults GetIntermediateMeasurementResult(Double? refVolumeCm = null, Double? refTimeS = null)
{
if (DutStartRecord == null || IntermediateRecord == null)
throw new ApplicationException("Measurement records missing");
return new MeasurementResults(DutStartRecord, IntermediateRecord, _accuDutOverflowVolumeCm,
_accuDutOverflowTimeS, refVolumeCm, refTimeS, _channel);
}
/// <inheritdoc />
public MeasurementResults GetFinalMeasurementResult(Double? refVolumeCm, Double ? refTimeS = null)
{
if (DutStartRecord == null || DutStopRecord == null)
throw new ApplicationException("Measurement records missing");
return new MeasurementResults(DutStartRecord, DutStopRecord, _accuDutOverflowVolumeCm,
_accuDutOverflowTimeS, refVolumeCm, refTimeS, _channel);
}
private void CheckForOverFlowVolumeAndTime()
{
if (IntermediateRecord == null || _lastIntermediateRecord == null) return;
var dutOverflowVolumeCm = IntermediateRecord.GetOverflowVolumeCm();
var currentVolumeQm = IntermediateRecord.GetVolumeCm();
var lastVolumeQm = _lastIntermediateRecord.GetVolumeCm();
//an overflow is detected when absolute volume difference is higher than 1/2 of the OverflowVolumeCm
if (Math.Abs(currentVolumeQm - lastVolumeQm) > (0.5 * dutOverflowVolumeCm))
{
//if the overflow has been detected the end volume is higher than the start volume
//indicates the negative flow direction
if (currentVolumeQm > lastVolumeQm)
{
//negative overflow
_accuDutOverflowVolumeCm -= dutOverflowVolumeCm;
LoggerMeasurement.Info($"Slot:{Slot}, Channel: {IntermediateRecord.GetChannel()} - has negative overflow. currentVolumeQm ({currentVolumeQm}) - lastVolumeQm ({lastVolumeQm}). current accuOverflowVolume is {_accuDutOverflowVolumeCm}");
}
else
{
//positive overflow
_accuDutOverflowVolumeCm += dutOverflowVolumeCm;
LoggerMeasurement.Info($"Slot:{Slot}, Channel: {IntermediateRecord.GetChannel()} - has positive overflow. currentVolumeQm ({currentVolumeQm}) - lastVolumeQm ({lastVolumeQm}). current accuOverflowVolume is {_accuDutOverflowVolumeCm}");
}
}
var dutOverflowTimeS = IntermediateRecord.GetOverflowTimeS();
var currentTimeS = IntermediateRecord.GetTimeS();
var lastTimeS = _lastIntermediateRecord.GetTimeS();
//check for timer overflow due to number range (e.g. 2^32) of raw value
if (currentTimeS < lastTimeS)
{
_accuDutOverflowTimeS += dutOverflowTimeS;
}
//remind record for short term results
_last2IntermediateRecord = _lastIntermediateRecord;
//remind this intermediate record for the next run for overflow detection
_lastIntermediateRecord = IntermediateRecord;
}
/// <inheritdoc />
public MeasurementStates GetMeasurementState()
{
return _state;
}
/// <inheritdoc />
public void StopMeasurement()
{
LoggerMeasurement.Info($"Slot:{Slot} - Stop of measurement");
MeasurementState = MeasurementStates.IsWaitingForEndData;
}
/// <inheritdoc />
public void StartMeasurement()
{
Clear();
LoggerMeasurement.Info($"Slot:{Slot} - Start of measurement");
MeasurementState = MeasurementStates.IsWaitingForStartData;
}
/// <summary>
/// Set flag for starting Calibration.
/// The next record is going to set the start values.
/// </summary>
public void StartIntermediateMeasurement()
{
LoggerMeasurement.Info($"Slot:{Slot} - Start of intermediate measurement");
MeasurementState = MeasurementStates.IsWaitingForIntermediateData;
}
/// <inheritdoc />
public void AddData(IMeasurementRecord record)
{
var dataSyncMark = record.GetDataSyncMark();
var channel = record.GetChannel();
if (MeasurementState == MeasurementStates.IsWaitingForStartData)
{
//check if the record is marked as start record
if (dataSyncMark != SyncMarkRecord.SyncStart) return;
//remind start record for the entire measurement duration
DutStartRecord = record;
// set LastIntermediateRecord for initial OverflowCalculation
_lastIntermediateRecord = DutStartRecord;
_last2IntermediateRecord = DutStartRecord;
//set intermediate record
IntermediateRecord = DutStartRecord;
LoggerMeasurement.Info($"Slot:{Slot}, Channel:{channel} - Received start record({DutStartRecord})");
LoggerMeasurement.Info($"Slot:{Slot}, Channel:{channel} - Calibration state set to 'IsRunning'");
MeasurementState = MeasurementStates.IsRunning;
}
else if (MeasurementState == MeasurementStates.IsWaitingForIntermediateData)
{
IntermediateRecord = record;
CheckForOverFlowVolumeAndTime();
LoggerMeasurement.Info($"Slot:{Slot}, Channel:{channel} - Received intermediate record({IntermediateRecord})");
LoggerMeasurement.Info($"Slot:{Slot}, Channel:{channel} - Calibration state set to 'IsRunning'");
MeasurementState = MeasurementStates.IsRunning;
}
else if (MeasurementState == MeasurementStates.IsWaitingForEndData)
{
//can use intermediate records as well
if (dataSyncMark != SyncMarkRecord.SyncEnd && dataSyncMark != SyncMarkRecord.DecodeIntermediate ) return;
DutStopRecord = record;
// set IntermediateRecord for OverflowCalculation
IntermediateRecord = DutStopRecord;
CheckForOverFlowVolumeAndTime();
LoggerMeasurement.Info($"Slot:{Slot}, Channel:{channel} - Received end record({DutStopRecord})");
LoggerMeasurement.Info($"Slot:{Slot}, Channel:{channel} - Calibration state set to 'IsCompleted'");
MeasurementState = MeasurementStates.IsCompleted;
}
}
}
}
@@ -0,0 +1,79 @@
using System;
namespace Xylem.Common.Metrology.Measurements
{
/// <inheritdoc />
/// <summary>
/// Holds all stuff for calibration of a Genesis Meter
/// </summary>
public class CalibrationMeasurement : BaseMeasurement
{
/// <summary>
/// Calibration default value used to reset meter calibration
/// </summary>
private const Double CalibFactorRelativeDefault = 1.0;
/// <summary>
/// relative value (e.g. 0.05)
/// </summary>
private Double _calibFactorToleranceRelative = 0.05;
/// <summary>
/// Setup the required tolerance in percent for check (e.g. 5 = +/-5%)
/// </summary>
public Double CalibFactorTolerancePercent
{
get { return _calibFactorToleranceRelative * 100; }
set { _calibFactorToleranceRelative = value / 100; }
}
/// <summary>
/// Check the tolerance of the calibration factor (e.g. 0.95 to 1.05 at 0.05 tolerance)
/// </summary>
/// <param name="calibFactorToCheck"></param>
/// <returns>true if the calibration factor is inside the tolerance </returns>
public Boolean IsCalibFactorInTolerance(Double calibFactorToCheck)
{
return (calibFactorToCheck <= _calibFactorToleranceRelative + CalibFactorRelativeDefault
&& calibFactorToCheck >= _calibFactorToleranceRelative - CalibFactorRelativeDefault);
}
/// <inheritdoc />
/// <summary>
/// Remind the calibration factor for the register write access
/// </summary>
/// <param name="slot"></param>
/// <param name="measurementRecordType">FlowTestRecord or CalibrationRecord</param>
/// <param name="intermediateUpdateTimeS">Update time needed for overflow detection in seconds</param>
/// <param name="channel"></param>
public CalibrationMeasurement(Int32 slot, Type measurementRecordType, Int32 intermediateUpdateTimeS, Int32 channel)
: base(slot, measurementRecordType, intermediateUpdateTimeS, channel)
{
}
/// <summary>
/// Calculate calibration factor from reference volume and reference time if set.
/// The deviation can adjust the factor to a required offset, it may be useful not to calibrate to 0.0).
/// The Result is NOT being stored to the meter.
/// CAN BE USED FOR STATIC START/STOP AND FLYING START/STOP PROCEDURE
/// </summary>
/// <param name="RefVolumeCm">reference volume in m³</param>
/// <param name="refTimeS">reference time in seconds</param>
/// <param name="reqDeviationPercent">the deviation to set the calibration in %</param>
/// <returns> calibration factor as relative value or null if calibration factor cannot be calculated</returns>
/// <history date="06-Dec-2018" author="Thomas Wiedebusch">
/// - The scale factor for calibration is going to adjusted here to keep the measurement result accurate.
/// </history>
public Double? CalculateCalibFactorRel(Double RefVolumeCm, Double? refTimeS = null, Double reqDeviationPercent = 0.0)
{
//the deviation can be positive or negative
var reqDeviationRel = 1.0 + reqDeviationPercent / 100;
//for calibration the RefVolumeCm is essential, the refTimeS is needed for flying start/stop
var measurementResult = GetFinalMeasurementResult(RefVolumeCm, refTimeS);
//adjust the calibration scale factor to the required deviation
return measurementResult.ScaleFactorRefToDut * reqDeviationRel;
}
}
}
@@ -0,0 +1,56 @@
using System;
namespace Xylem.Common.Metrology.Measurements.Consts
{
/// <summary>
/// information about measurement results to identify on input depending results
/// </summary>
public enum MeasurementResultsStates
{
/// <summary>
/// everything is good
/// </summary>
Okay,
/// <summary>
/// inconsistent channel assignment
/// </summary>
WrongChannel,
/// <summary>
/// DUT time zero
/// </summary>
ZeroDutTime,
/// <summary>
/// DUT time is invalid
/// </summary>
InvalidDutTime,
/// <summary>
/// over flow time is invalid
/// </summary>
InvalidOverFlowTime,
/// <summary>
/// REF time zero
/// </summary>
ZeroRefTime,
/// <summary>
/// REF time is invalid
/// </summary>
InvalidRefTime,
/// <summary>
/// DUT volume zero
/// </summary>
ZeroDutVolume,
/// <summary>
/// REF volume is unknown
/// </summary>
ZeroRefVolume,
}
}
@@ -0,0 +1,37 @@
namespace Xylem.Common.Metrology.Measurements.Consts
{
/// <summary>
/// holds the current state for genesis actions (e.g. calibration,measurement)
/// </summary>
public enum MeasurementStates
{
/// <summary>
/// If Measurement/Calibration/Action is not started
/// </summary>
NotStarted,
/// <summary>
/// Measurement/Calibration/Action waits for next record package and sore this as start record,
/// After this Measurement/Calibration/Action IsRunning
/// </summary>
IsWaitingForStartData,
/// <summary>
/// Measurement/Calibration/Action collecting record and wait for end call
/// </summary>
IsRunning,
/// <summary>
/// Measurement/Calibration/Action collecting next record record
/// </summary>
IsWaitingForIntermediateData,
/// <summary>
/// Measurement/Calibration/Action waits for next record package and sore this as end record,
/// After this Measurement/Calibration/Action IsCompleted
/// </summary>
IsWaitingForEndData,
/// <summary>
/// Measurement/Calibration/Action has start and end record and can calculate a result
/// </summary>
IsCompleted,
}
}
@@ -0,0 +1,58 @@
namespace Xylem.Common.Metrology.Measurements.Consts
{
/// <summary>
/// ProcessState nearly linear
/// </summary>
public enum ProcessState
{
/// <summary>
/// meter not initialized
/// </summary>
IsNotInit,
/// <summary>
/// meter currently in initialization
/// </summary>
InitIsActive,
/// <summary>
/// initialization done
/// </summary>
WaitForMeasurement,
/// <summary>
/// meter is on measurement
/// </summary>
MeasurementIsActive,
/// <summary>
/// Measurement is done (not equal to succeed)
/// </summary>
MeasurementIsDone,
/// <summary>
/// Meter is prepared for calibration
/// </summary>
WaitForCalibration,
/// <summary>
/// meter is on calibration
/// </summary>
CalibrationIsActive,
/// <summary>
/// need Q from reference meter for calculation
/// </summary>
WaitForQRef,
/// <summary>
/// Calibration is calculated
/// </summary>
QRefDone,
/// <summary>
/// Calibration is stored on meter
/// </summary>
CalibrationIsDone
}
}
@@ -0,0 +1,96 @@
using System;
using Xylem.Common.Metrology.Measurements.Consts;
namespace Xylem.Common.Metrology.Measurements
{
/// <inheritdoc />
/// <summary>
/// Collection of measurement interfaces
/// </summary>
public interface IMeasurement : IDisposable
{
/// <summary>
/// Event for new action of measurement state
/// </summary>
event EventHandler OnActionStateHasChanged;
/// <summary>
/// Get the Type of the measurement record
/// </summary>
/// <returns></returns>
Type GetType();
/// <summary>
/// Get the channel no. the measurement collecting record for
/// </summary>
/// <returns> returns 0 when all channels should be collected</returns>
Int32 GetChannel();
/// <summary>
/// Actual state of the measurement
/// </summary>
MeasurementStates MeasurementState { get; set; }
/// <summary>
/// Clear start, intermediate and end record and set action state to idle
/// </summary>
void Clear();
/// <summary>
/// Adding measurement record to processing FIFO
/// </summary>
/// <param name="record"></param>
void AddData(IMeasurementRecord record);
/// <summary>
/// Returns the actual state of the ongoing measurement
/// </summary>
/// <returns></returns>
MeasurementStates GetMeasurementState();
/// <summary>
/// Fist clear all record from earlier calibrations.
/// Set flag for starting measurement.
/// The next record is going to set the start values.
/// </summary>
void StartMeasurement();
/// <summary>
/// Stop grabbing record from streaming.
/// Last Data package is count as end volume (and time)
/// </summary>
void StopMeasurement();
/// <summary>
/// Returning the results of the ongoing measurement between two updates.
/// This can be used to update the screen during measurements like actual flow rate.
/// The timing will be set by the IntermediateUpdateTimeS.
/// </summary>
/// <param name="refTimeS"></param>
/// <param name="RefVolumeCm"></param>
/// <returns></returns>
MeasurementResults GetShortTermMeasurementResult(Double? RefVolumeCm = null, Double? refTimeS = null);
/// <summary>
/// Returning the intermediate results of the ongoing measurement from the start of measurement until now!
/// </summary>
/// <param name="refTimeS"></param>
/// <param name="RefVolumeCm"></param>
/// <returns></returns>
MeasurementResults GetIntermediateMeasurementResult(Double? RefVolumeCm = null, Double? refTimeS = null);
/// <summary>
/// Returning the results of the measurements from start until stop.
/// </summary>
/// <param name="refTimeS">Measurement duration is needed explicit for flying start/stop procedure</param>
/// <param name="RefVolumeCm">reference volume is ALWAYS needed for scale and deviation</param>
/// <returns></returns>
MeasurementResults GetFinalMeasurementResult(Double? RefVolumeCm, Double? refTimeS = null);
/// <summary>
/// Sets a marker that a mesaurment start looking for an intermediate record
/// </summary>
void RequestIntermediateRecord();
}
}
@@ -0,0 +1,47 @@
using System;
using Xylem.Common.CommonCore.Consts;
namespace Xylem.Common.Metrology.Measurements
{
/// <inheritdoc />
/// <summary>
/// interface for all incoming streaming protocol
/// to simplify measurements
/// </summary>
public interface IMeasurementRecord : ICloneable
{
/// <summary>
/// Get volume of the record
/// </summary>
Double GetVolumeCm();
/// <summary>
/// Get time stamp of the record from meter
/// </summary>
Double GetTimeS();
/// <summary>
/// Get Data
/// </summary>
/// <returns></returns>
SyncMarkRecord GetDataSyncMark();
/// <summary>
/// Get the channel the record comes from
/// </summary>
/// <returns>returns 0 if the channel is unavailable for this type of record (e.g. protocol f) </returns>
Int32 GetChannel();
/// <summary>
/// Get overflow volume
/// </summary>
/// <returns></returns>
Double GetOverflowVolumeCm();
/// <summary>
/// get overflow time
/// </summary>
/// <returns></returns>
Double GetOverflowTimeS();
}
}
@@ -0,0 +1,105 @@
using System;
using Xylem.Common.CommonCore.Consts;
namespace Xylem.Common.Metrology.Measurements
{
/// <inheritdoc />
/// <summary>
/// struct to hold a measurement record
/// </summary>
public class MeasurementRecord : IMeasurementRecord
{
/// <summary>
/// physical channel 1, 2 and 3
/// </summary>
public Int32 Channel = 0;
/// <summary>
/// actual volume in cubic meters
/// </summary>
public Double VolumeCm;
/// <summary>
/// Overflow volume
/// </summary>
public Double OverflowVolumeCm;
/// <summary>
/// time converted to seconds
/// </summary>
public Double TimeS;
/// <summary>
/// Overflow time
/// </summary>
public Double OverflowTimeS;
/// <summary>
/// CRC16 CCITT
/// </summary>
public UInt16 Crc;
/// <summary>
/// record is valid
/// </summary>
public Boolean IsValid;
/// <summary>
/// Mark package as start, end, intermediate or not sync
/// </summary>
public SyncMarkRecord SyncMarkRecord;
/// <summary>
/// time when package was decoded
/// </summary>
public DateTimeOffset DecodedTime;
/// <summary>
/// time when package was received
/// </summary>
public DateTimeOffset ReceivedTime;
/// <inheritdoc />
public Double GetVolumeCm()
{
return VolumeCm;
}
/// <inheritdoc />
public Double GetTimeS()
{
return TimeS;
}
/// <inheritdoc />
public SyncMarkRecord GetDataSyncMark()
{
return SyncMarkRecord;
}
/// <inheritdoc />
public Int32 GetChannel()
{
//channel 0 is for the entire device without a physical channel assignment
return Channel;
}
/// <inheritdoc />
public Double GetOverflowVolumeCm()
{
return OverflowVolumeCm;
}
/// <inheritdoc />
public Double GetOverflowTimeS()
{
return OverflowTimeS;
}
/// <inheritdoc />
public Object Clone()
{
return MemberwiseClone();
}
}
}
@@ -0,0 +1,292 @@
using System;
using Xylem.Common.Metrology.Measurements.Consts;
namespace Xylem.Common.Metrology.Measurements
{
/// <inheritdoc />
public struct MeasurementResults
{
/// <inheritdoc cref="MeasurementResultsStates"/>
public readonly MeasurementResultsStates State;
/// <summary>
/// Channel being needed for later analysis of channel number
/// as feedback to the caller
/// </summary>
public readonly Int32 Channel;
/// <summary>
/// Accumulated overflow volume in cubic-meters,
/// the DUT internal range can overflow due to
/// the limitation of the number or the display resolution.
/// </summary>
public readonly Double AccuDutOverflowVolumeCm;
/// <summary>
/// Accumulated overflow time in seconds,
/// the number-range can cause an timer overflow.
/// </summary>
public readonly Double AccuDutOverflowTimeS;
/// <summary>
/// DUT start record
/// </summary>
public readonly IMeasurementRecord DutStartRecord;
/// <summary>
/// DUT end record
/// </summary>
public readonly IMeasurementRecord DutStopRecord;
/// <summary>
/// Volume = (End Volume + overflow) - Start Volume in cubic meters,
/// real DUT measurement uncorrected
/// </summary>
public readonly Double DutVolumeCm;
/// <summary>
/// DUT measurement corrected if REF time is given
/// </summary>
public readonly Double CorrectedDutVolumeCm;
/// <summary>
/// REF volume in cubic meters
/// </summary>
public readonly Double? RefVolumeCm;
/// <summary>
/// Time = (End time + overflow) - Start time in seconds,
/// real DUT measurement uncorrected
/// </summary>
public readonly Double DutTimeS;
/// <summary>
/// REF time in seconds
/// </summary>
public readonly Double? RefTimeS;
/// <summary>
/// Flow rate in cubic meters per hour based on DUT
/// </summary>
public readonly Double? DutFlowRateCmPh;
/// <summary>
/// Flow rate in cubic meters per hour based on REF
/// </summary>
public readonly Double? RefFlowRateCmPh;
/// <summary>
/// Scale factor between REF volume and DUT volume
/// this will use the <see cref="CorrectedDutVolumeCm"/>
/// /// </summary>
public readonly Double? ScaleFactorRefToDut;
/// <summary>
/// Deviation between DUT volume and REF volume relative,
/// this will use the <see cref="CorrectedDutVolumeCm"/>
/// </summary>
public readonly Double? DeviationDutToRefRel;
/// <summary>
/// Deviation between DUT volume and REF volume in percent,
/// this will use the <see cref="CorrectedDutVolumeCm"/>
/// </summary>
public readonly Double? DeviationDutToRefPer;
/// <summary>
/// Calculation of measurement results, overflow will be taken into account:
/// - DutVolumeCm in cubic meters:
/// DUT volume measurement uncorrected, direct measurement from the DUT,
/// - CorrectedDutVolumeCm in cubic meters:
/// equals the uncorrected DutVolumeCm if REF time is unknown,
/// else it is the volume calculated from the DUT flow-rate with the REF time,
/// - DutTimeS in seconds:
/// DUT time measurement,
/// - DutFlowRateCmPh in cubic meters per hour:
/// based on DUT volume and DUT time uncorrected,
/// - RefFlowRateCmPh in cubic meters per hour:
/// REF volume and REF time being used,
/// - ScaleFactorRefToDut unit less:
/// calculated with absolute and corrected DUT volume and REF volume
/// needed for calibration, is higher than one if DUT volume is less than the REF volume,
/// can be directly used to calculate the new scale by multiplication with the current scale,
/// - DeviationDutToRefRel unit less:
/// calculated with absolute and corrected DUT volume and REF volume
/// deviation needed for verification relative of DUT to REF,
/// - DeviationDutToRefPer in percent:
/// calculated with absolute and corrected DUT volume and REF volume
/// deviation needed for verification of DUT to REF in percent.
/// </summary>
/// <history date="07-Nov-2018" author="Thomas Wiedebusch">
/// - Scale factor calculation added,
/// - Deviation calculation added.
/// </history>
/// <history date="03-Nov-2018" author="Thomas Wiedebusch">
/// - Flow rate calculation added,
/// - Slot added.
/// </history>
/// <history date="19-Dec-2018" author="Thomas Wiedebusch">
/// - RefVolumeCm, RefTimeSS and absVolumeQm added,
/// - Slot removed.
/// </history>
/// <history date="22-Jan-2019" author="Thomas Wiedebusch">
/// - FlowRateQmPh split to DutFlowRateCmPh and RefFlowRateCmPh,
/// - CorrectedDutVolumeCm added,
/// - input channel compared with start and end record channels.
/// </history>
/// <history date="27-Feb-2019" author="Thomas Wiedebusch">
/// - State implemented.
/// </history>
/// <history date="01-Mar-2019" author="Thomas Wiedebusch">
/// - Check and states for DUT time zero, DUT volume zero, over flow volume below zero,
/// start and end record time below zero.
/// </history>
/// <history date="04-Mar-2019" author="Thomas Wiedebusch">
/// - Supported static start/stop with DUT- and REF-volume, this is time independent but the
/// DUT- and over-flow-times shouldn't be negative or zero.
/// - Meter renamed to DUT (Device under Test).
/// </history>
/// <param name="dutStartRecord">Start of measurement record set </param>
/// <param name="dutStopRecord">End of measurement record set </param>
/// <param name="accuDutOverflowVolumeCm">accumulated overflow volume, will add to result volume</param>
/// <param name="accuDutOverflowTimeS">accumulated overflow time, will add to result time</param>
/// <param name="refTimeS">measured REF time</param>
/// <param name="refVolumeCm">REF volume</param>
/// <param name="requiredChannel">physical channel of measurement path (0 for main measurement)</param>
public MeasurementResults(IMeasurementRecord dutStartRecord, IMeasurementRecord dutStopRecord,
Double accuDutOverflowVolumeCm = 0.0, Double accuDutOverflowTimeS = 0.0, Double? refVolumeCm = null,
Double? refTimeS = null, Int32 requiredChannel = 0)
{
//backup input
DutStartRecord = dutStartRecord;
DutStopRecord = dutStopRecord;
AccuDutOverflowVolumeCm = accuDutOverflowVolumeCm;
AccuDutOverflowTimeS = accuDutOverflowTimeS;
RefVolumeCm = refVolumeCm;
RefTimeS = refTimeS;
Channel = requiredChannel;
//initialize
State = MeasurementResultsStates.Okay;
DutVolumeCm = 0.0;
DutTimeS = 0;
CorrectedDutVolumeCm = 0.0;
DeviationDutToRefPer = null;
DeviationDutToRefRel = null;
ScaleFactorRefToDut = null;
DutFlowRateCmPh = null;
RefFlowRateCmPh = null;
//safety issue for channel input, has to be identical
if (requiredChannel != DutStartRecord.GetChannel() || requiredChannel != DutStopRecord.GetChannel())
{
State = MeasurementResultsStates.WrongChannel;
return;
}
//build the measured volume
DutVolumeCm = (DutStopRecord.GetVolumeCm() + accuDutOverflowVolumeCm) - DutStartRecord.GetVolumeCm();
//assume a correct measurement for static start/stop procedure, in case of flying start/stop
//this is going to be overwritten if REF time is set
CorrectedDutVolumeCm = DutVolumeCm;
//Flow-direction can be negative because of hardware assembly of sensors
var absDutVolumeCm = Math.Abs(CorrectedDutVolumeCm);
//calculate the measurement time
DutTimeS = (DutStopRecord.GetTimeS() + accuDutOverflowTimeS) - DutStartRecord.GetTimeS();
//a negative overflow time is impossible due to the physics
if (accuDutOverflowTimeS < 0.0)
{
State = MeasurementResultsStates.InvalidOverFlowTime;
return;
}
//a negative time is impossible due to the physics
if ( DutTimeS < 0.0 || DutStopRecord.GetTimeS() < 0.0 || DutStartRecord.GetTimeS() < 0.0 )
{
State = MeasurementResultsStates.InvalidDutTime;
return;
}
//the <= will be used to avoid floating point comparison with == 0.0 warning message,
//if the DUT time is zero, there might be an error on filling the record
if (Math.Abs(DutTimeS) <= 0.0)
{
State = MeasurementResultsStates.ZeroDutTime;
return;
}
//DUT flow-rate in cubic meters per second
var dutFlowRateCmPs = DutVolumeCm / DutTimeS;
//finally the DUT flow-rate in cubic meters per hour uncorrected
DutFlowRateCmPh = dutFlowRateCmPs * 3600;
//the <= will be used to avoid floating point comparison with == 0.0 warning message,
if (absDutVolumeCm <= 0.0)
{
State = MeasurementResultsStates.ZeroDutVolume;
return;
}
//TODO ref volume can not be null anymore
//for static start/stop the scale factor can be calculated
//further calculation cannot be executed if REF volume is unknown
if (!RefVolumeCm.HasValue)
{
return;
}
//Flow-direction can be negative because of hardware assembly of sensors
var absRefVolumeCm = Math.Abs(RefVolumeCm.Value);
//the <= will be used to avoid floating point comparison with == 0.0 warning message
if (absRefVolumeCm <= 0.0)
{
State = MeasurementResultsStates.ZeroRefVolume;
return;
}
//calculate scale for static start/stop
ScaleFactorRefToDut = absRefVolumeCm / absDutVolumeCm;
DeviationDutToRefRel = 0.0;
DeviationDutToRefPer = 0.0;
//return with status okay if nothing else to calculate
if (!refTimeS.HasValue)
{
return;
}
//the <= will be used to avoid floating point comparison with == 0.0 warning message,
if (Math.Abs(refTimeS.Value) <= 0.0)
{
State = MeasurementResultsStates.ZeroRefTime;
return;
}
//a negative time is impossible due to the physics
if (refTimeS.Value < 0.0)
{
State = MeasurementResultsStates.InvalidRefTime;
return;
}
//for flying start/stop usage of REF time is required to correct the DUT volume
//take the ultra precise REF time to recalculate the DutVolumeCm via the constant flow rate
CorrectedDutVolumeCm = dutFlowRateCmPs * refTimeS.Value;
//Flow-direction can be negative because of hardware assembly of sensors, recalculate
//the corrected abs value
absDutVolumeCm = Math.Abs(CorrectedDutVolumeCm);
//calculate the REF flow rate
RefFlowRateCmPh = RefVolumeCm.Value / refTimeS.Value * 3600;
//final calculation of scale and deviation
ScaleFactorRefToDut = absRefVolumeCm / absDutVolumeCm;
DeviationDutToRefRel = (absDutVolumeCm - absRefVolumeCm) / absRefVolumeCm;
DeviationDutToRefPer = DeviationDutToRefRel * 100;
}
}
}
@@ -0,0 +1,215 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6CCDB656-C676-4360-BABA-C4596AAD175D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Xylem.Common.Metrology.Measurements</RootNamespace>
<AssemblyName>Xylem.Common.Metrology.Measurements</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\Xylem.Common.Metrology.Measurements.xml</DocumentationFile>
<LangVersion>7.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>7.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\x86\Debug\Xylem.Common.Metrology.Measurements.xml</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>6</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'XP32bit|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\XP32bit\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\Xylem.Common.Hardware.WaterMeter.Genesis.Action.xml</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>7.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'XP32bit|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\XP32bit\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\Xylem.Common.Hardware.WaterMeter.Genesis.Action.xml</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\Xylem.Common.Hardware.WaterMeter.Genesis.Action.xml</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'XP32bit|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\XP32bit\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\Xylem.Common.Hardware.WaterMeter.Genesis.Action.xml</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'PerformTest|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\PerformTest\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\Xylem.Common.Hardware.WaterMeter.Genesis.Action.xml</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.0</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'PerformTest|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\PerformTest\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\Xylem.Common.Hardware.WaterMeter.Genesis.Action.xml</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'PerformTest|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\PerformTest\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\Xylem.Common.Hardware.WaterMeter.Genesis.Action.xml</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '_MANUAL_CONTROL|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\_MANUAL_CONTROL\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\Xylem.Common.Metrology.Measurements.xml</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.0</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '_MANUAL_CONTROL|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\_MANUAL_CONTROL\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\x86\Debug\Xylem.Common.Metrology.Measurements.xml</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>6</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '_MANUAL_CONTROL|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\_MANUAL_CONTROL\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\Xylem.Common.Hardware.WaterMeter.Genesis.Action.xml</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\.shared\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="BaseMeasurement.cs" />
<Compile Include="CalibrationMeasurement.cs" />
<Compile Include="Consts\MeasurementResultsStates.cs" />
<Compile Include="Consts\MeasurementStates.cs" />
<Compile Include="Consts\ProcessStates.cs" />
<Compile Include="IMeasurement.cs" />
<Compile Include="IMeasurementRecord.cs" />
<Compile Include="MeasurementRecord.cs" />
<Compile Include="MeasurementResults.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\CommonCore\CommonCore.csproj">
<Project>{1b02c79e-0b19-43e2-8f6b-71ef0c786c97}</Project>
<Name>CommonCore</Name>
</ProjectReference>
<ProjectReference Include="..\..\Utils\Logging\Logging.csproj">
<Project>{4B88B0D3-E791-4774-9521-EABEACDC420E}</Project>
<Name>Logging</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\packages\NLog.4.6.7\lib\net40-client\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -0,0 +1,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Xylem.Common.Metrology.Measurements")]
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="4.6.7" targetFramework="net40" />
</packages>