Compare commits

..
Author SHA1 Message Date
Milan Hanajik b4882aa08c Reconfigured for iPERL-NEW 2020-04-21 13:39:49 +02:00
198 changed files with 3557 additions and 7189 deletions
+1 -4
View File
@@ -2,8 +2,6 @@ Common/bin/
Common/obj/
Config/bin/
Config/obj/
DataStreamInterface/bin/
DataStreamInterface/obj/
Decrypt/bin/
Decrypt/obj/
DeviceTest/bin/
@@ -24,8 +22,6 @@ GraphLib/bin
GraphLib/obj
TracingDB/bin
TracingDB/obj
ResetBatchNr/bin
ResetBatchNr/obj
RestClient/bin
RestClient/obj
Results/bin/
@@ -44,6 +40,7 @@ Users/bin/
Users/obj/
UserManagement/bin/
UserManagement/obj/
Doc/
.vs/
*.suo
*.bak
-1
View File
@@ -41,7 +41,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="SerializableDictionary.cs" />
<Compile Include="UIControls\CoolButtonCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
-69
View File
@@ -1,69 +0,0 @@
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
namespace Common
{
[XmlRoot("dictionary")]
public class SerializableDictionary<TKey, TValue>
: Dictionary<TKey, TValue>, IXmlSerializable
{
public System.Xml.Schema.XmlSchema GetSchema()
{
return null;
}
public void ReadXml(System.Xml.XmlReader reader)
{
XmlSerializer keySerializer = new XmlSerializer(typeof(TKey));
XmlSerializer valueSerializer = new XmlSerializer(typeof(TValue));
bool wasEmpty = reader.IsEmptyElement;
reader.Read();
if (wasEmpty)
return;
while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
{
reader.ReadStartElement("item");
reader.ReadStartElement("key");
TKey key = (TKey)keySerializer.Deserialize(reader);
reader.ReadEndElement();
reader.ReadStartElement("value");
TValue value = (TValue)valueSerializer.Deserialize(reader);
reader.ReadEndElement();
this.Add(key, value);
reader.ReadEndElement();
reader.MoveToContent();
}
reader.ReadEndElement();
}
public void WriteXml(System.Xml.XmlWriter writer)
{
XmlSerializer keySerializer = new XmlSerializer(typeof(TKey));
XmlSerializer valueSerializer = new XmlSerializer(typeof(TValue));
foreach (TKey key in this.Keys)
{
writer.WriteStartElement("item");
writer.WriteStartElement("key");
keySerializer.Serialize(writer, key);
writer.WriteEndElement();
writer.WriteStartElement("value");
TValue value = this[key];
valueSerializer.Serialize(writer, value);
writer.WriteEndElement();
writer.WriteEndElement();
}
}
}
}
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;SLM_150;LANG_SK</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -30,7 +30,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;SLM_150;LANG_SK</DefineConstants>
<DefineConstants>TRACE;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+53 -35
View File
@@ -8,43 +8,31 @@ namespace Config
public const string AdminPassword = "staratura";
public const string SQLiteDbFName = "SQLite.db";
#if DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT || CEVAK_200
public const int WMsCount = 3;
public const int LineSize = 3;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
#elif MUNICH
#if MUNICH
public const int WMsCount = 3;
public const int LineSize = 3;
public const int CompoundWMsCount = 3;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif MALTA_WSD25
#elif DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT || CEVAK_200
public const int WMsCount = 3;
public const int LineSize = 3;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU_300 || FUZHOU_150 || IZRAEL_200 || GENESIS || SLM_150 || PETERSBURG_200
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 0;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
#elif BADGER_MALA_TRAT || BERLIN || FUZHOU_150 || FUZHOU_300 || GELSENWASSER || GENESIS || IZRAEL_200 || PETERSBURG_200 || SENTEC || SLM_150 || TORINO_50 || TURA_SPECIAL
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
public const int MaxPartNr = 3;
#elif PUCHONG_200
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 3;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif RUM_MOB
public const int WMsCount = 8;
public const int LineSize = 8;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif DEWA_300 || FUZHOU_100 || ROMA_200
#elif DEWA_300 || ROMA_200
public const int WMsCount = 10;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
@@ -56,33 +44,63 @@ namespace Config
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif SLM_END || WARSAW_END
public const int WMsCount = 10;
public const int LineSize = 5;
#elif IZRAEL_50
public const int WMsCount = 40;
public const int LineSize = 10;
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU_100
public const int WMsCount = 10;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 4;
#elif SLM_50
public const int WMsCount = 12;
public const int LineSize = 12;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 6;
public const int MaxPartNr = WMsCount / LineSize;
#elif TORINO_50 || BADGER_MALA_TRAT || BERLIN || GELSENWASSER
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
#elif TORUN_50 || CEVAK_40 || MURES_40 || FUZHOU_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || ALZIR_25
public const int WMsCount = 20;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif RUM_MOB
public const int WMsCount = 8;
public const int LineSize = 8;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif TURA_IPERL || TURA_IPERL_NEW
public const int WMsCount = 40;
public const int LineSize = 20;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif IZRAEL_50
public const int WMsCount = 40;
public const int LineSize = 10;
#elif TURA_SPECIAL || SENTEC
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif SLM_50
public const int WMsCount = 12;
public const int LineSize = 12;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 6;
public const int MaxPartNr = WMsCount / LineSize;
#elif SLM_END || WARSAW_END
public const int WMsCount = 10;
public const int LineSize = 5;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 4;
#elif MALTA_WSD25
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
+1 -7
View File
@@ -10,7 +10,7 @@ namespace Config
/// <summary>
/// Test bench database settings, contains bench name and settings od several databases
/// </summary>
public class DatabaseSettings : ICloneable, IComparable
public class DatabaseSettings : ICloneable
{
// Public fields
public string BenchName;
@@ -45,12 +45,6 @@ namespace Config
return result;
}
public int CompareTo(object dbs2)
{
if (!(dbs2 is DatabaseSettings)) return 0;
return String.Compare(BenchName, (dbs2 as DatabaseSettings).BenchName);
}
public override string ToString()
{
return string.Format("{0} config={1} results={2} events={3} users={4}",
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.26.1458.0")]
[assembly: AssemblyFileVersion("2.26.1458.0")]
[assembly: AssemblyVersion("2.26.1447.0")]
[assembly: AssemblyFileVersion("2.26.1447.0")]
+3 -3
View File
@@ -118,15 +118,15 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Failed" xml:space="preserve">
<value>Nicht OK</value>
<value>NiO</value>
</data>
<data name="Passed" xml:space="preserve">
<value>OK</value>
<value>iO</value>
</data>
<data name="Error" xml:space="preserve">
<value>Fehler</value>
</data>
<data name="Cannot_open_DB_Cause_0" xml:space="preserve">
<value>Datenbank kann nicht geöffnet werden.\\r\\nUrsache:\\r\\n{0}</value>
<value>Datenbank kann nicht geöffnet.\\r\\nUrsache:\\r\\n{0}</value>
</data>
</root>
+13 -33
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016-2020 Sensus Slovensko a.s.
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
///
using System;
using System.Reflection;
@@ -27,14 +27,14 @@ namespace Config
[Description("m3/h")] m3ph, /// * 1 m3/h = 1000 l/h
[Description("g")] g, /// 0.001 kg
[Description("lb")] lb, /// 0.45359237 kg
[Description("kg")] kg, /// * 1 kilogram
[Description("t")] t, /// 1000 kg
[Description("lb")] lb, /// 0.45359237 kg
[Description("ms")] ms, /// 1 ms = 0.001 s
[Description("s")] s, /// * 1 second
[Description("min")] min, /// 1 min = 60 s
[Description("hr")] hour, /// 1 hour = 60 min = 3600 s
[Description("ms")] ms, /// 1 ms = 0.001 s
[Description("°C")] C, /// * degree Celsius (°C)
[Description("°F")] F, /// degree Fahrenheit
@@ -42,12 +42,11 @@ namespace Config
[Description("Pa")] Pa, /// 1 Pa = 0.01 hPa
[Description("hPa")] hPa, /// 1 hPa = 100 Pa
[Description("mbar")] mbar, /// 1 mbar = 1 hPa = 100 Pa
[Description("kPa")] kPa, /// 1 kPa = 10 hPa = 10000 Pa
[Description("inHg")] inHg, /// 1 inHg = 33.864 hPa
[Description("psi")] psi, /// 1 psi = 0.0689475729 bar
[Description("bar")] bar, /// * 1 Bar = 1000 mbar = 0.1 MPa = 100000 Pa
[Description("kPa")] kPa, /// 1 kPa = 10 HPa
[Description("MPa")] MPa, /// 1 MPa = 10000 hPa
[Description("mbar")] mbar, /// 1 mbar = 1 hPa = 100 Pa
[Description("bar")] bar, /// * 1 Bar = 1000 mbar = 0.1 MPa = 100000 Pa
[Description("inHg")] inHg, /// 1 inHg = 33.864 hPa
[Description("R%")] RPct, /// * 1 R%
@@ -69,8 +68,6 @@ namespace Config
[Description("kWh")] kWh, /// 1 kWh = 3600000 J
[Description("MWh")] MWh, /// 1 MWh = 3600000000 J
[Description("uS/cm")] uSpcm, /// * 1 uS/cm
#if LANG_PL
[Description("imp/l")] ppl, /// * 1 pulse/l
[Description("imp/dm3")] ppdm3, /// * 1 pulse/dm3
@@ -115,14 +112,12 @@ namespace Config
[Description("Impulse")] Pulses,
[Description("Impulse/l")] PulsePerLtr,
[Description("Impulse/kWh")] PulsePerKWh,
[Description("Leitfähigkeit")] Conductivity,
/// Quantities without units and conversions
[Description("Nummer")] Number,
[Description("Text")] String,
[Description("Boolean")] Boolean,
[Description("Datum und Uhrzeit")] DateTime,
[Description("Aufgezählt")] Enumerated,
#elif LANG_PL
[Description("Objętość")] Volume,
[Description("Przepływ")] Flow,
@@ -138,14 +133,12 @@ namespace Config
[Description("Impulsy")] Pulses,
[Description("Impulsy/litr")] PulsePerLtr,
[Description("Impulsy/kWh")] PulsePerKWh,
[Description("Przewodność")] Conductivity,
/// Quantities without units and conversions
[Description("Numer")] Number,
[Description("Tekst")] String,
[Description("Boolean")] Boolean,
[Description("Data i czas")] DateTime,
[Description("Wyliczone")] Enumerated,
#elif LANG_CS
[Description("Objem")] Volume,
[Description("Průtok")] Flow,
@@ -161,14 +154,12 @@ namespace Config
[Description("Pulzy")] Pulses,
[Description("Pulzy/litr")] PulsePerLtr,
[Description("Pulzy/kWh")] PulsePerKWh,
[Description("Vodivost")] Conductivity,
/// Quantities without units and conversions
[Description("Počet")] Number,
[Description("Text")] String,
[Description("Boolean")] Boolean,
[Description("Datum a čas")] DateTime,
[Description("Vyjmenované")] Enumerated,
#elif LANG_IT
[Description("Volume")] Volume,
[Description("Flusso")] Flow,
@@ -184,14 +175,12 @@ namespace Config
[Description("Impulso")] Pulses,
[Description("Impulso/litro")] PulsePerLtr,
[Description("Impulso/kWh")] PulsePerKWh,
[Description("Conduttività")] Conductivity,
/// Quantities without units and conversions
[Description("Numero")] Number,
[Description("Stringa")] String,
[Description("Boolean")] Boolean,
[Description("Data e ora")] DateTime,
[Description("Enumerato")] Enumerated,
#else
[Description("Volume")] Volume,
[Description("Flow")] Flow,
@@ -207,14 +196,13 @@ namespace Config
[Description("Pulses")] Pulses,
[Description("Pulses/liter")] PulsePerLtr,
[Description("Pulses/kWh")] PulsePerKWh,
[Description("Conductivity")] Conductivity,
/// Quantities without units and conversions
[Description("Number")] Number,
[Description("String")] String,
[Description("Boolean")] Boolean,
[Description("Date and time")] DateTime,
[Description("Enumerated")] Enumerated,
[Description("Enum")] Enum,
#endif
Count,
}
@@ -229,7 +217,7 @@ namespace Config
public static bool IsDefaultUnit(Unit unit)
{
return unit == Unit.l || unit == Unit.m3ph || unit == Unit.kg || unit == Unit.s || unit == Unit.C || unit == Unit.bar || unit == Unit.RPct ||
unit == Unit.Pct || unit == Unit.mm || unit == Unit.kgpm3 || unit == Unit.J || unit == Unit.ppl || unit == Unit.ppkWh || unit == Unit.uSpcm;
unit == Unit.Pct || unit == Unit.mm || unit == Unit.kgpm3 || unit == Unit.J || unit == Unit.ppl || unit == Unit.ppkWh;
}
public static bool IsQuantity(Unit units, Quantity quantity)
@@ -277,11 +265,10 @@ namespace Config
case Unit.hPa:
case Unit.mbar:
case Unit.kPa:
case Unit.inHg:
case Unit.psi:
case Unit.bar:
case Unit.MPa:
return Config.Quantity.Pressure;
case Unit.inHg:
return Config.Quantity.Pressure;
case Unit.RPct:
return Config.Quantity.Humidity;
@@ -322,9 +309,6 @@ namespace Config
case Unit.kWhpp:
return Config.Quantity.PulsePerKWh;
case Unit.uSpcm:
return Config.Quantity.Conductivity;
default:
return Config.Quantity.Number;
}
@@ -344,8 +328,6 @@ namespace Config
public static bool IsPulses(Unit units) { return IsQuantity(units, Config.Quantity.Pulses); }
public static bool IsPulsePerLtr(Unit units) { return IsQuantity(units, Config.Quantity.PulsePerLtr); }
public static bool IsPulsePerKWh(Unit units) { return IsQuantity(units, Config.Quantity.PulsePerKWh); }
public static bool IsConductivity(Unit units) { return IsQuantity(units, Config.Quantity.Conductivity); }
public static double ConvertTo(Unit units, double v)
@@ -385,10 +367,9 @@ namespace Config
case Unit.hPa: return 1000 * v; /// 1 hPa = 100 Pa
case Unit.mbar: return 1000 * v; /// 1 mbar = 1 hPa = 100 Pa
case Unit.kPa: return 100 * v; /// 1 kPa = 10 HPa
case Unit.inHg: return 29.53 * v; /// 1 inHg =
case Unit.psi: return 14.50377378 * v; /// 1 psi =
case Unit.bar: return v; /// 1 bar = 1000 mbar = 100000 Pa
case Unit.MPa: return 0.1 * v; /// 1 MPa = 10000 hPa
case Unit.inHg: return 29.53 * v; /// 1 inHg = 33.864 hPa
/// Error: internal representation in %
case Unit.Pct: return v; /// 1 %
@@ -459,10 +440,9 @@ namespace Config
case Unit.hPa: return 0.001 * v; /// 1 hPa = 100 Pa
case Unit.mbar: return 0.001 * v; /// 1 mbar = 1 hPa = 100 Pa
case Unit.kPa: return 0.01 * v; /// 1 kPa = 10 HPa
case Unit.inHg: return 0.033864 * v; /// 1 inHg = 33.864 hPa
case Unit.psi: return 0.0689475729 * v;/// 1 psi = 0.0689475729 bar
case Unit.bar: return v; /// 1 bar = 1000 mbar = 100000 Pa
case Unit.MPa: return 10 * v; /// 1 MPa = 10000 hPa
case Unit.inHg: return 0.033864 * v; /// 1 inHg = 33.864 hPa
/// Error: internal representation in %
case Unit.Pct: return v; /// 1 %
-23
View File
@@ -1,23 +0,0 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
namespace DataStreamInterface
{
public class DataFrame
{
public readonly UInt64 ID; /// Frame ID
public readonly double Time; /// Time stamp in units of time
public readonly double Volume; /// Volume in units of volume
public readonly double[] Quantity; /// An array of optional quantities in their respective units
public DataFrame(UInt64 id, double time, double volume, double[] quantity)
{
ID = id;
Time = time;
Volume = volume;
Quantity = quantity;
}
}
}
@@ -1,61 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DataStreamInterface</RootNamespace>
<AssemblyName>DataStreamInterface</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</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>
</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>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DataFrame.cs" />
<Compile Include="Enums.cs" />
<Compile Include="IDataStreamMeter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Doc\Software interface for datastream water meters.docx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</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>
-95
View File
@@ -1,95 +0,0 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
namespace DataStreamInterface
{
public enum Unit
{
None,
pulse,
degree,
/// Volume
ml, /// 0.001 l
l, /// * 1 liter = 1 l
dm3, /// 1 dm3 = 1 l
m3, /// 1000 l
gal_UK, /// 1 gal(UK) = 4.54609 l
gal_US, /// 1 gal(US) = 3.78541178 l
/// Flow
lph, /// 1 liter/h
m3ph, /// * 1 m3/h = 1000 l/h
/// Mass
g, /// 0.001 kg
kg, /// * 1 kilogram
t, /// 1000 kg
lb, /// 0.45359237 kg
/// Time
ms, /// 1 ms = 0.001 s
s, /// * 1 second = 1 s
min, /// 1 min = 60 s
hour, /// 1 hour = 60 min = 3600 s
/// Temperature
C, /// * degree Celsius (°C)
F, /// degree Fahrenheit
K, /// degree Kelvin
/// Pressure
Pa, /// 1 Pa = 0.01 hPa
hPa, /// 1 hPa = 100 Pa
mbar, /// 1 mbar = 1 hPa = 100 Pa
kPa, /// 1 kPa = 10 HPa
inHg, /// 1 inHg = 33.864 hPa
bar, /// * 1 Bar = 1000 mbar = 0.1 MPa = 100000 Pa
MPa, /// 1 MPa = 10000 hPa
/// Humidity
RPct, /// * 1 R%
/// Relative error
Promile, /// 1 promile = 0.1 %
Pct, /// * 1 %
/// Length
mm, /// * 1 millimeter
cm, /// 1 cm = 10 mm
inch, /// 1 inch = 25.4 mm
foot, /// 1 foot = 304.8 mm
m, /// 1 m = 1000 mm
/// Density
kgpm3, /// * 1 kg/m3 = 0.001 kg/l
kgpl, /// 1 kg/l = 1000 kg/m3
/// Energy
J, /// * 1 Joul
kJ, /// 1 kJ = 1000 J
MJ, /// 1 MJ = 1000000 J
Wh, /// 1 Wh = 3600 J
kWh, /// 1 kWh = 3600000 J
MWh, /// 1 MWh = 3600000000 J
/// Meter coefficient - volume
ppl, /// * 1 pulse/l
ppdm3, /// * 1 pulse/dm3
degpl, /// * 1 degree/l
degpdm3, /// * 1 degree/dm3
lpp, /// * 1 l/pulse
dm3pp, /// * 1 dm3/pulse
lpdeg, /// * 1 l/degree
dm3pdeg, /// * 1 dm3/degree
/// Meter coefficient - energy
ppkWh, /// * 1 pulse/kWh
kWhpp, /// * 1 kWh/pulse
Count
}
}
-114
View File
@@ -1,114 +0,0 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataStreamInterface
{
public interface IDataStreamMeter
{
/// <summary>
/// Get state of the connected data stream meter
/// </summary>
/// <param name="state">Current state of the meter</param>
/// <returns>true when successful</returns>
bool GetState(out int state, out string parameter);
/// <summary>
/// Set state of the connected data stream meter
/// </summary>
/// <param name="state">Required state of the meter</param>
/// <returns>true when successful</returns>
bool SetState(int state, string parameter);
/// <summary>
/// Establish connection with a data stream meter
/// </summary>
/// <param name="connectionParameters">Connection parameters</param>
/// <param name="meterId">Meter ID (e.g. serial number)</param>
/// <returns>true when successful</returns>
bool OpenConnection(string connectionParameters, out string meterId);
/// <summary>
/// Closes connection with the data stream meter
/// </summary>
/// <returns>true when successful</returns>
bool CloseConnection();
/// <summary>
/// Stars saving measurement results into internal data structures of the component.
/// Each data frame obtains a unique ID.
/// The very first data fraim obrains ID = 0.
/// </summary>
/// <returns>true when successful</returns>
bool StartMeasurement();
/// <summary>
/// Stops saving measurement results into internal data structures of the component.
/// Updates ID of the last date frame received from the meter.
/// </summary>
/// <param name="lastFrameID">ID of the last date frame</param>
/// <returns>true when successful</returns>
bool StopMeasurement(out UInt64 lastFrameID);
///------------------------------------------------
/// Units of time, volume and optional quantities
///------------------------------------------------
/// <summary>
/// Returns time units (s, ms, ...)
/// </summary>
Unit GetTimeUnits();
/// <summary>
/// Returns units of volume (ml, l, ...)
/// </summary>
Unit GetVolumeUnits();
///-----------------------------------------------
/// Ooptional quantities: count, units, captions
///-----------------------------------------------
/// <summary>
/// Returns count of optional quantities in each data frame
/// </summary>
/// <returns>Count of optional quantities</returns>
int GetQuantitiesCount();
/// <summary>
/// Returns units of the specified quantity
/// </summary>
/// <param name="quanityNr">Zero based quantity number 0 .. quantites count-1</param>
Unit GetQuantityUnits(int quanityNr);
/// <summary>
/// Returns caption of the specified quantity
/// </summary>
/// <param name="quanityNr">Zero based quantity number 0 .. quantites count-1</param>
string GetQuantityCaption(int quanityNr);
///---------------------------
/// Datastream data exchange
///---------------------------
/// <summary>
/// Retuns 'count' data frames starting with data frame with ID = 'id'
/// </summary>
/// <param name="id">First frame ID</param>
/// <param name="count">Frames count</param>
/// <returns>Selected data frames</returns>
DataFrame[] GetFrames(UInt64 id, int count);
/// <summary>
/// Returns ID of the data frame where time equals or exceeds the specified time.
/// When time of the first frame (ID=0) is larger then specified time, function returns 0.
/// </summary>
/// <param name="time">Time</param>
/// <returns>ID of the data frame at or after the pecified time</returns>
UInt64 GetID(double time);
}
}
@@ -1,38 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Resources;
// 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("DataStreamInterface")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DataStreamInterface")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e44458ee-b635-4d7c-a763-20054399e817")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]
+525
View File
@@ -0,0 +1,525 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="12.2">
<zoom_level>8</zoom_level>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>0</y>
<w>40</w>
<h>64</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;48;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.InitialState</type>
<coordinates>
<x>416</x>
<y>8</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes>i</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>48</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>'Test Start' transition sequence</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>56</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>416</x>
<y>96</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>88</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>128</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Initialize (single) test results</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>136</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>408</x>
<y>176</y>
<w>32</w>
<h>32</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>184</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>408</x>
<y>224</y>
<w>32</w>
<h>32</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>416</x>
<y>272</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>232</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>264</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>304</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Make the water tank empty</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>312</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>416</x>
<y>352</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>344</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>272</x>
<y>168</y>
<w>160</w>
<h>128</h>
</coordinates>
<panel_attributes>lt=&lt;-
m2=[Emptying always]</panel_attributes>
<additional_attributes>144;112;24;112;24;24;136;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>408</x>
<y>216</y>
<w>176</w>
<h>160</h>
</coordinates>
<panel_attributes>lt=&lt;-
m2=[Enough room in tank]</panel_attributes>
<additional_attributes>24;144;160;144;160;24;32;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>384</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Set the required water flow</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>392</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>432</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>Measure the 'start' mass of water</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>440</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>480</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Start the test (diverter, etc.)</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>488</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>416</x>
<y>528</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>560</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Read intermediate results</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>520</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>568</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>408</x>
<y>608</y>
<w>32</w>
<h>32</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>272</x>
<y>512</y>
<w>160</w>
<h>128</h>
</coordinates>
<panel_attributes>lt=&lt;-
m2=[Test in progress]</panel_attributes>
<additional_attributes>144;24;24;24;24;112;136;112</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>616</y>
<w>40</w>
<h>64</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;48;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Text</type>
<coordinates>
<x>424</x>
<y>640</y>
<w>104</w>
<h>24</h>
</coordinates>
<panel_attributes>[Test completed]</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>664</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>Measure the 'end' mass of water</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>712</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>Calculate and save this test results</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>672</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>720</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>408</x>
<y>760</y>
<w>32</w>
<h>32</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>768</y>
<w>40</w>
<h>64</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;48;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>408</x>
<y>80</y>
<w>216</w>
<h>712</h>
</coordinates>
<panel_attributes>lt=&lt;-
m2=[More repetitions to be done]</panel_attributes>
<additional_attributes>24;24;200;24;200;696;32;696</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Text</type>
<coordinates>
<x>264</x>
<y>792</y>
<w>160</w>
<h>24</h>
</coordinates>
<panel_attributes>[All test repetitions completed]</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>816</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>Stop any running tests, etc. (?)</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>864</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>'Test End' transition sequence</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>824</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>872</y>
<w>40</w>
<h>64</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;48;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.FinalState</type>
<coordinates>
<x>416</x>
<y>920</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
</diagram>
+261
View File
@@ -0,0 +1,261 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="12.2">
<zoom_level>10</zoom_level>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>400</x>
<y>120</y>
<w>120</w>
<h>40</h>
</coordinates>
<panel_attributes>Load the default
procedure
</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>40</y>
<w>50</w>
<h>100</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;80;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.InitialState</type>
<coordinates>
<x>450</x>
<y>60</y>
<w>20</w>
<h>20</h>
</coordinates>
<panel_attributes>i</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>400</x>
<y>190</y>
<w>120</w>
<h>40</h>
</coordinates>
<panel_attributes>Reset valves,
pumps, etc.
</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>130</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>400</x>
<y>260</y>
<w>120</w>
<h>40</h>
</coordinates>
<panel_attributes>Detect cameras</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>200</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>370</x>
<y>550</y>
<w>180</w>
<h>110</h>
</coordinates>
<panel_attributes>complex
state
--
some more...
-.</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>370</x>
<y>390</y>
<w>180</w>
<h>60</h>
</coordinates>
<panel_attributes>Display prompt, enable
'Cycle' and 'Test' buttons
and wait for a selection</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>320</y>
<w>50</w>
<h>90</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;70;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>450</x>
<y>330</y>
<w>20</w>
<h>20</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>270</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>440</x>
<y>480</y>
<w>40</w>
<h>40</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>420</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>490</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>620</x>
<y>430</y>
<w>160</w>
<h>40</h>
</coordinates>
<panel_attributes>Disable 'Cycle'
and 'Test' buttons</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>620</x>
<y>360</y>
<w>160</w>
<h>40</h>
</coordinates>
<panel_attributes>Empty the tank</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>450</x>
<y>440</y>
<w>270</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>250;30;250;60;30;60</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>670</x>
<y>370</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;30;30;60</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>440</x>
<y>310</y>
<w>280</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;30;260;30;260;50</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Text</type>
<coordinates>
<x>490</x>
<y>480</y>
<w>180</w>
<h>20</h>
</coordinates>
<panel_attributes>'Empty a tank' selected
</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.Text</type>
<coordinates>
<x>290</x>
<y>520</y>
<w>160</w>
<h>20</h>
</coordinates>
<panel_attributes>'Cycle' or 'Test' selected
</panel_attributes>
<additional_attributes/>
</element>
</diagram>
+73
View File
@@ -0,0 +1,73 @@
Otazky:
-------
- ako pouzit T6
- co je 'T to Open' pri RV
- na co sluzia VI2P, VI3P a VI4P
TODO:
-----
- nefunguje pumpa P3
- nahlad na cestu v procedure
- purgeStart a purgeEnd --> transitionSteps/Sequences
- horeuvedene pre RegulValve
- volba procedury nie je zablokovana pocas testov
- vsetky Target... v Process tabe
- Hmotnosti:
1 netarovat, merat okamzitu,
2 nulovacia procedura na tlacitko manualne,
3 pri starte sa spytat ci vynulovat vahy
- Preco sa nenacitaju zmeny v Test-e ???
- pouzit oneskorenie na ventily
- skontrolovat doc (freq v Hz)
Demo version:
- pouzit progress bary na vyber testu
- vycistit Measurement
- simulacia skonci pri druhom 'start_measurement'
- pri simulacii sa meni mass pri merani end-mass (klapka by mala byt vypnuta!)
- otvorit Proceduru (v dalsom okne v zamknutom stave) aj ked je okno Procedures zamknute
- pridat seriove cisla do parametrov komponentov
- zapamatavat si sirky stlpcov v PathsDlg, ... (aj inde)
- skontroluj vsetky ListViewEx-y + skorsie spracovanie vysledkov (dolezite aj pre spravnu tvorbu noveho mena)
- preco posledne okno skace
- chyba spracovanie procedure / metrology2 Tol.Abzug, Fehl.Korr -+
- vsetky mena stlpcov a tabov do Strings.xxx
Testovanie na stanici:
- pouzivat skutocne 'rvalves'
- ked vyberiem priamo Q1, Q2, Q3 (poskonceni predchadzajuceho testu), neprepise sa obsah combo boxu
- prislusne EtPulses by mali ist cez RegisterReader komponent + common RegisterReader pre Master
- ako je to s WM0 ...
- na zaciatku zmerat vahu a dovolit vypustit tanky
- updatovat vahu - obrazok = je nespravna kapacita vahy
- spracovanie vysledkov podla excelu: corr. na hustotu vzduchu (zavazie), corr. na hustotu vody v zav. od teploty
- podpora pre zbieranie vysledkov
- logovanie vysledkov do excelu
- zastavit vodu na konci skusky
- Pri nastavovani prietoku nie je nic vidno
- pouzivat skutocne 'rvalves'
- pri vytvarani testov vyberat cesty podla prietoku
- ked sa zada cesta napisanim mena = skontrolovat
- zapamatat si stav ventilu pri prietoku
- nulovanie = nulovanie vahy
- zmenit text: tarovanie -> vypustanie
- pripravit IDC100: !ReadRegisterOp, Idc100.GetValue-SetValue (na konci), GetState a ukoncenie operacie
- sub-sekvencie pre Q-set a metody
- zobrazit typizovanu schemu
Neskor:
- nevidno ci su neulozene zmeny
- upozornenie pri cancel ak su neulozene zmeny
- spravne updatovat tlacitka ked su FixedItems (FixedRows)
- ked odomknem Komponenty tak sa zrusi vyber
- vaha ToString - prve zobrazit capacity
- moznost menenia poradia aj v components
- rozdelit ventily podla ciest?
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

+91
View File
@@ -0,0 +1,91 @@
Assumption
----------
The installation consists of one or more similar test benches. Each test bench is controlled by one PC-based computer. In addition, one or more PC-s can run the same application and manipulated data shared by the test benches (e.g. PC located in offices). All PC-s run the same version of software (this is a must now - Munich - in the future we can try to deal with backward/forward compatibility issues).
Development environment
-----------------------
- Visual Studio 2012 Professional
- Database: MySQL (???)
User iterface
-------------
- WindowsFormsApplication
- Main part of the window occupies a tab control with hidden tabs
(see http://weblogs.asp.net/kdente/archive/2005/11/14/430591.aspx)
Tabs swithing is done programatically
Tabs:
Procedure
- Procedure Info (summary, header)
- Procedure History (changes)
- Procedure Metrology
- Procedure Technical
- Procedure Purge
- Procedure End
- Procedure Adjustment
- Procedure View
- Procedure Inputs
Home
Insert
Results
- Results
- Results D
- Meters Ch
- Temp Ch
- Pressure
Bench parameters
- Technical
- Balance
- Temperature
- Pressure
- Flowmeter
- Density
Logs
Sensus Testbench Framework application settings consist of
----------------------------------------------------------
S1. Local settings stored on each PC
S1.1 language settings, appearance, etc. (no other impact on the system function)
S1.2 specification of databases used to store other settings (see 2.)
There might be several sets of DB settings (1.2) when one should be able to access more test benches. When starting the system, this is indicated on the login screen as 'Test bench'/'Pruefstation'.
S2. Settings stored in databases:
S2.1 'users' (typically shared between all benches - centralized access control)
S2.2 'watermeter_types' info (typically shared between more benches)
S2.3 'test_procedures' (typically shared between more identical benches)
S2.4 'metrological_parameters' of the system (always unique for each system, not shared)
S2.5 'watermeters' info (typically centralized / shared)
S2.6 'test_results' (typically centralized / shared)
etc.
The databases might be running either on the local PC or remote,
each database might be used by a single bench, or shared by more test benches. This configured in 1.2.
Application can be used to:
---------------------------
A1. Change local settings (S1.1, S1.2)
A2. Change settings stored in the databases
A3. Control system and run test procedures - this is only possible on PC-s controlling the benches. When procedure is started, local copy of necessary information from the DB-s is made to avoid problems.
User access control:
--------------------
U1. Access to
U1.1 information read
U1.2 information write/modify
U1.3 action start
is controlled by an access control mechanism.
U2. Users
U3. Groups
Each user is a member of one or more groups. In case needed, a group with a single user is created. Access to information/actions is granted to groups.
Muenich: Grooups are 'Tester',
'Testing specialist',
'Head of lab'
'Maintenance specialist'
'Metrologist'
'Calibration specialist'
U4. When necessary, system prompts user to authenticate himself/herself (login dialog). Authentication is invalidated as follows (optional):
U4.1 When user closes the dialog, which was protected.
U4.2 After certain time period
U4.3 Never
+25
View File
@@ -0,0 +1,25 @@
<log4net>
<!-- A1 is set to be a ConsoleAppender -->
<appender name="A1" type="log4net.Appender.ConsoleAppender">
<!-- A1 uses PatternLayout -->
<layout type="log4net.Layout.PatternLayout">
<!-- Print the date in ISO 8601 format -->
<conversionPattern value="%date [%thread] %-5level %logger %ndc - %message%newline" />
</layout>
</appender>
<!-- Set root logger level to DEBUG and its only appender to A1 -->
<root>
<level value="DEBUG" />
<appender-ref ref="A1" />
</root>
<!-- Print only messages of level WARN or above in the package NHibernate -->
<logger name="NHibernate">
<level value="WARN" />
</logger>
<logger name="TestBenchFramework.BenchControl.StateMachine">
<level value="WARN" />
</logger>
</log4net>
+27
View File
@@ -0,0 +1,27 @@
foreach (var device in devices) device.RunDeviceBefore(); . . . . . . in StateMachine.Worker()
State.Create(...).AddOperation(...).AddOperation(...).EnterState() . . in the sequence in Execute(...)
foreach (var device in devices) device.RunDeviceAfter(); . . . . . . . in WaitRunDevsRunOps()
WaitNextTick() (may throw QuitStateMachineException) . . . . . . . . in WaitRunDevsRunOps()
foreach (var device in devices) device.RunDeviceBefore(); . . . . . . in WaitRunDevsRunOps()
IList<Event> events = State.RunOperations(); . . . . . . . . . . . . . in WaitRunDevsRunOps()
foreach (var device in devices) device.RunDeviceAfter(); . . . . . . . in WaitRunDevsRunOps()
WaitNextTick() (may throw QuitStateMachineException) . . . . . . . . in WaitRunDevsRunOps()
foreach (var device in devices) device.RunDeviceBefore(); . . . . . . in WaitRunDevsRunOps()
IList<Event> events = State.RunOperations(); . . . . . . . . . . . . . in WaitRunDevsRunOps()
State.Create(...).AddOperation(...).AddOperation(...).EnterState() . . in the sequence in Execute(...)
foreach (var device in devices) device.RunDeviceAfter(); . . . . . . . in WaitRunDevsRunOps()
WaitNextTick() (may throw QuitStateMachineException) . . . . . . . . in WaitRunDevsRunOps()
foreach (var device in devices) device.RunDeviceBefore(); . . . . . . in WaitRunDevsRunOps()
IList<Event> events = State.RunOperations(); . . . . . . . . . . . . . in WaitRunDevsRunOps()
foreach (var device in devices) device.RunDeviceAfter(); . . . . . . . in WaitRunDevsRunOps()
WaitNextTick() (assume QuitStateMachineException thrown) . . . . . . in WaitRunDevsRunOps()
foreach (var device in devices) device.RunDeviceBefore(); . . . . . . in StateMachine.Worker() catch()
State.RunOperations(); . . . . . . . . . . . . . . . . . . . . . . . . in StateMachine.Worker() catch()
State.Empty.EnterState(); . . . . . . . . . . . . . . . . . . . . . . in StateMachine.Worker() catch()
foreach (var device in devices) device.RunDeviceAfter(); . . . . . . . in StateMachine.Worker() catch()
foreach (var device in devices) device.StopDevice(); . . . . . . . . . in StateMachine.Worker() catch()
+11
View File
@@ -0,0 +1,11 @@
Showing tabs in the designer:
- select mainTabControl
- in Properies change SizeMode to normal
- in Properies change ItemSize to 0; 20
Hiding tabs in the designer:
- select mainTabControl
- in Properies change SizeMode to Fixed
- in Poperties change ItemSize to 0; 1
+4
View File
@@ -0,0 +1,4 @@
af242843887f3bdcc52e485483356eaccd37ba67a35941530bd195a8310fc7d5aca8560576dfb62ad5a4bd2df789a5e8be068e62e7c976d6eeed8d63abbd9909
= staratura
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
-46
View File
@@ -1,46 +0,0 @@
using System;
using System.IO;
using TBF;
namespace ResetBatchNr
{
class Program
{
static LocalSettings ls;
static void Main(string[] args)
{
if (!Directory.Exists(TBF.Program.ConfigDir)) return;
Environment.CurrentDirectory = TBF.Program.ConfigDir;
ls = LocalSettings.Load(TBF.Program.LocalSettingsFileName);
if (ls == null || ls.TestBenches == null)
{
/// Loading local seetings from regular config file failed. Use the backup
ls = LocalSettings.Load(TBF.Program.LocalSettingsBackupName);
if (ls == null || ls.TestBenches == null)
{
/// Neither config.xml, nor config.backup.xml could be loaded
Console.WriteLine(string.Format("Could not load file {0}, nor {1}.", TBF.Program.LocalSettingsFileName, TBF.Program.LocalSettingsBackupName));
Console.ReadLine();
return;
}
}
else
{
/// Loading local seetings from the regular config file was successful. Update the backup
File.Copy(TBF.Program.LocalSettingsFileName, TBF.Program.LocalSettingsBackupName, true);
}
///
/// Process local settings so that windows are shifted to the 1st monitor
///
ls.BatchNr = 1;
ls.Save();
Console.WriteLine("BatchNr was reset to 1");
Console.ReadLine();
return;
}
}
}
-36
View File
@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ResetBatchNr")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ResetBatchNr")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("de8130eb-2f43-46a6-9f5b-bf96432a0c7c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
-72
View File
@@ -1,72 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D7F5A111-B2DF-4761-9574-AB730DF573A6}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ResetBatchNr</RootNamespace>
<AssemblyName>ResetBatchNr</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Config\Config.csproj">
<Project>{743df7db-c7b6-42eb-986d-0f485e5588e4}</Project>
<Name>Config</Name>
</ProjectReference>
<ProjectReference Include="..\TBF\TBF.csproj">
<Project>{8648fd92-cda1-4c3a-b5f9-fe547ce1fa48}</Project>
<Name>TBF</Name>
</ProjectReference>
<ProjectReference Include="..\Users\Users.csproj">
<Project>{6e5cb0e9-e1b6-4e5d-ac6e-b1049e180f2b}</Project>
<Name>Users</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
+4 -5
View File
@@ -66,13 +66,13 @@ namespace Results
switch (dbType)
{
default:
case Users.Entities.DBType.SQLite:
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString));
break;
case Users.Entities.DBType.MySql:
cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(connectionString));
break;
case Users.Entities.DBType.SQLite:
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString));
break;
}
}
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Entities.WaterMeterData>());
@@ -311,7 +311,6 @@ namespace Results
batch.TestRslts = session.QueryOver<TestRslt>()
.Where(x => (x.Batch.Id == batch.Id))
.List();
batch.WaterMeters = session.QueryOver<WaterMeter>()
.Where(x => (x.Batch.Id == batch.Id))
.List();
Binary file not shown.
Binary file not shown.
-7
View File
@@ -320,13 +320,6 @@ namespace Results
ThreeState, /// 272
Conduct, /// 273
Conduct_start, /// 274
Conduct_end, /// 275
Conduct_avg, /// 276
Conduct_min, /// 277
Conduct_max, /// 278
Count,
}
}
@@ -1,24 +1,19 @@
///
/// Copyright (c) 2017-2020 Sensus Metering Systems
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Printing;
using System.IO;
using Config.Entities;
using GenCode128;
using Gma.QrCodeNet.Encoding;
using Results.Resources;
namespace Results.Output.Printers.Enhanced
{
public class EnhancedPrintDocument : PrintDocument
{
static QrEncoder encoder = new QrEncoder();
/// Size of the printed area without margins, after taking into account 'pageOrientation'
/// Size of the printed area without margins, after taking into account 'pageOrientation'
readonly int printHeight;
readonly int printWidth;
@@ -28,14 +23,12 @@ namespace Results.Output.Printers.Enhanced
readonly int TitleX;
readonly int TitleY; /// Depends on the size of the header
readonly int spacingOne;
readonly int spacingOneAndHalf;
readonly int spacingOne4Header;
readonly int spacingOneAndHalf4Header;
readonly int spacingOne4Footer;
readonly int SpacingOne;
readonly int SpacingOneAndHalf;
readonly int SpacingOne4Header;
readonly int SpacingOneAndHalf4Header;
int spacingAboveTable;
int spacingBelowTable;
readonly int SpacingOne4Footer;
int CommonTop; /// = TitleY + 60
int BodyTop; /// = HdrTop + 160
@@ -131,11 +124,11 @@ namespace Results.Output.Printers.Enhanced
}
/// Document outline preliminary calculations
spacingOne = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", font).Height;
spacingOneAndHalf = (3 * spacingOne) / 2;
spacingOne4Header = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", headerFont).Height;
spacingOneAndHalf4Header = (3 * spacingOne4Header) / 2;
spacingOne4Footer = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", footerFont).Height;
SpacingOne = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", font).Height;
SpacingOneAndHalf = (3 * SpacingOne) / 2;
SpacingOne4Header = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", headerFont).Height;
SpacingOneAndHalf4Header = (3 * SpacingOne4Header) / 2;
SpacingOne4Footer = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", footerFont).Height;
TitleX = cfg.LeftMargin;
TitleY = cfg.TopMargin;
@@ -185,27 +178,17 @@ namespace Results.Output.Printers.Enhanced
/// Prepare document outline
///----------
titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height;
CommonTop = TitleY + titleHeight + spacingOne4Header;
CommonTop = TitleY + titleHeight + SpacingOne4Header;
commonHeight = commonItems.Count * spacingOne;
BodyTop = CommonTop + commonHeight + spacingOne4Header;
commonHeight = commonItems.Count * SpacingOne;
BodyTop = CommonTop + commonHeight + SpacingOne4Header;
Table table0 = Table.Create_TestsAreRows(batch.WaterMeters[0], testItems, style);
SizeF tableSize = table0.Measure(e);
int wmSectionHeight = (int)tableSize.Height + SpacingOne4Header * ((tableSize.Height > 0) ? 3 : 2);
if (cfg.BarcodeType == BarcodeType.None)
{
spacingAboveTable = spacingOneAndHalf4Header;
}
else
{
spacingAboveTable = Math.Max(spacingOneAndHalf4Header, cfg.BarcodeHeight + spacingOne4Header / 2);
}
spacingBelowTable = (tableSize.Height > 0) ? spacingOneAndHalf4Header : (spacingOne4Header / 2);
int wmSectionHeight = (int)tableSize.Height + spacingAboveTable + spacingBelowTable;
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * spacingOne) / wmSectionHeight;
nrWMsOnNextPage = (printHeight - 2 * spacingOne) / wmSectionHeight;
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
nrWMsOnNextPage = Math.Max(nrWMsOnNextPage, 1); /// Prevent division by zero if there are too many WM tests
nrPages = 1 + (batch.WaterMeters.Count - nrWMsOnFirstPage + nrWMsOnNextPage - 1) / nrWMsOnNextPage;
@@ -238,8 +221,8 @@ namespace Results.Output.Printers.Enhanced
/// Write aligned columns
for (int i = 0; i < Math.Min(leftColumn.Length, rightColumn.Length); i++)
{
PrintAt(e, leftMargin, CommonTop + spacingOne * i, leftColumn[i]);
PrintAt(e, 300, CommonTop + spacingOne * i, rightColumn[i]);
PrintAt(e, leftMargin, CommonTop + SpacingOne * i, leftColumn[i]);
PrintAt(e, 300, CommonTop + SpacingOne * i, rightColumn[i]);
}
}
@@ -258,7 +241,7 @@ namespace Results.Output.Printers.Enhanced
int wmPosition = true ? batch.WaterMeters[wmNr].WMPosition : (wmNr + 1);
if (!cfg.GoodOnly || batch.WaterMeters[wmNr].Passed)
{
nextWmTop = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + spacingBelowTable;
nextWmTop = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + SpacingOneAndHalf4Header;
}
}
@@ -269,11 +252,11 @@ namespace Results.Output.Printers.Enhanced
/// Footer
///----------
int footerWidth = (int)e.Graphics.MeasureString(footer, footerFont).Width;
PrintFooterAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - 2 * spacingOne, footer);
PrintFooterAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - 2 * SpacingOne, footer);
string pageNrText = string.Format("{0} {1}/{2}", Strings.Page, pageNr++, nrPages);
int pageNrWidth = (int)e.Graphics.MeasureString(pageNrText, font).Width;
PrintAt(e, leftMargin + (printWidth - pageNrWidth) / 2, topMargin + printHeight - spacingOne, pageNrText);
PrintAt(e, leftMargin + (printWidth - pageNrWidth) / 2, topMargin + printHeight - SpacingOne, pageNrText);
}
@@ -287,48 +270,25 @@ namespace Results.Output.Printers.Enhanced
float PrintWM(System.Drawing.Printing.PrintPageEventArgs e,
Results.Entities.WaterMeter wm, int printedWMNr, int top)
{
int tableTop = top + spacingAboveTable;
/// Print the water meter number and the serial number
if (string.IsNullOrEmpty(wm.SerialNr))
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
PrintHeaderAt(e, leftMargin, top, wmText);
if (!string.IsNullOrEmpty(wm.SerialNr))
{
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
int wmTextWidth = (int)e.Graphics.MeasureString(wmText, headerFont).Width;
PrintHeaderAt(e, leftMargin, tableTop - spacingOneAndHalf4Header, wmText);
}
else
{
string wmText = string.Format("{0} {1} {2} = {3}", Strings.Water_Meter, printedWMNr, Strings.sn, wm.SerialNr);
int wmTextWidth = (int)e.Graphics.MeasureString(wmText, headerFont).Width;
PrintHeaderAt(e, leftMargin, tableTop - spacingOneAndHalf4Header, wmText);
switch (cfg.BarcodeType)
{
case BarcodeType.Code_128_Horizontally:
{
Image img = Code128Rendering.MakeBarcodeImage(wm.SerialNr, 1, true);
e.Graphics.DrawImage(img, leftMargin + wmTextWidth + spacingOne4Header, top, cfg.BarcodeWidth, cfg.BarcodeHeight);
break;
}
case BarcodeType.Code_128_Vertically:
{
Image img = Code128Rendering.MakeBarcodeImage(wm.SerialNr, 1, true);
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
e.Graphics.DrawImage(img, leftMargin + wmTextWidth + spacingOne4Header, top, cfg.BarcodeWidth, cfg.BarcodeHeight);
break;
}
case BarcodeType.QR_Code:
{
QrCode qrCode = encoder.Encode(wm.SerialNr);
DrawQR(e.Graphics, qrCode, leftMargin + wmTextWidth + spacingOne4Header, top, cfg.BarcodeWidth, cfg.BarcodeHeight);
break;
}
}
PrintHeaderAt(e, leftMargin + (int)e.Graphics.MeasureString(wmText, headerFont).Width, top,
string.Format(" {0} = {1}", Strings.sn, wm.SerialNr));
}
Table table = Table.Create_TestsAreRows(wm, testItems, style);
return table.IsEmpty() ? tableTop : table.Draw(e, leftMargin, tableTop);
if (table.IsEmpty())
{
return top;
}
else
{
return table.Draw(e, leftMargin, top + SpacingOneAndHalf4Header);
}
}
@@ -338,7 +298,7 @@ namespace Results.Output.Printers.Enhanced
}
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 2000, spacingOne);
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne);
e.Graphics.DrawString(text, this.font, Brushes.Black, printArea);
}
@@ -349,7 +309,7 @@ namespace Results.Output.Printers.Enhanced
}
void PrintHeaderAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 2000, spacingOne4Header);
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne4Header);
e.Graphics.DrawString(text, this.headerFont, Brushes.Black, printArea);
}
@@ -360,33 +320,8 @@ namespace Results.Output.Printers.Enhanced
}
void PrintFooterAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 2000, spacingOne4Footer);
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne4Footer);
e.Graphics.DrawString(text, this.footerFont, Brushes.Black, printArea);
}
public static void DrawQR(Graphics g, QrCode qrCode, float left, float top, float width, float height)
{
/// Assuming 100 dpi (printer)
g.SmoothingMode = SmoothingMode.AntiAlias;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
float qrPixWidth = width / qrCode.Matrix.Width;
float qrPixHeight = height / qrCode.Matrix.Height;
for (int i = 0; i < qrCode.Matrix.Height; i++)
{
for (int j = 0; j < qrCode.Matrix.Width; j++)
{
if (qrCode.Matrix[j, i])
{
g.FillRectangle(Brushes.Black, new RectangleF(left + j * qrPixWidth,
top + i * qrPixHeight,
qrPixWidth,
qrPixHeight));
}
}
}
}
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
namespace Results.Output.Printers.Enhanced
@@ -30,8 +30,5 @@ namespace Results.Output.Printers.Enhanced
public string[] CommonItems;
public string[] TestItems;
public string Footer;
public BarcodeType BarcodeType; /// s/n is printed as barcode when valid (BarcodeType.None < BarcodeType < BarcodeType.Count)
public int BarcodeWidth;
public int BarcodeHeight;
}
}
}
@@ -1,15 +1,12 @@
///
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
/// Copyright (c) 2017-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Printing;
using System.IO;
using Config.Entities;
using GenCode128;
using Gma.QrCodeNet.Encoding;
using Results.Resources;
namespace Results.Output.Printers.OnePerMeter
@@ -19,9 +16,7 @@ namespace Results.Output.Printers.OnePerMeter
const float GapBetweenTableColumns = 10;
const float GapBetweenCommonColumns = 10;
static QrEncoder encoder = new QrEncoder();
/// Size of the printed area without margins, after taking into account 'pageOrientation'
/// Size of the printed area without margins, after taking into account 'pageOrientation'
readonly int printHeight;
readonly int printWidth;
@@ -163,30 +158,6 @@ namespace Results.Output.Printers.OnePerMeter
WMChart.GetChart(wm, true).Printing.PrintPaint(e.Graphics, pos);
}
if (cfg.BarcodeType != BarcodeType.None && cfg.BarcodeType < BarcodeType.Count && !string.IsNullOrEmpty(wm.SerialNr))
{
try
{
if (cfg.BarcodeType == BarcodeType.QR_Code)
{
QrCode qrCode = encoder.Encode(wm.SerialNr);
DrawQR(e.Graphics, qrCode, cfg.BarcodeLeft, cfg.BarcodeTop, cfg.BarcodeWidth, cfg.BarcodeHeight);
}
else if (cfg.BarcodeType == BarcodeType.Code_128_Horizontally || cfg.BarcodeType == BarcodeType.Code_128_Vertically)
{
Image img = Code128Rendering.MakeBarcodeImage(wm.SerialNr, 1, true);
if (cfg.BarcodeType == BarcodeType.Code_128_Vertically)
{
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
}
e.Graphics.DrawImage(img, cfg.BarcodeLeft, cfg.BarcodeTop, cfg.BarcodeWidth, cfg.BarcodeHeight);
}
}
catch (Exception)
{
}
}
float tableTop = cfg.TopMargin;
if (pageNr == 1)
@@ -380,30 +351,5 @@ namespace Results.Output.Printers.OnePerMeter
pageNr++;
}
public static void DrawQR(Graphics g, QrCode qrCode, float left, float top, float width, float height)
{
/// Assuming 100 dpi (printer)
g.SmoothingMode = SmoothingMode.AntiAlias;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
float qrPixWidth = width / qrCode.Matrix.Width;
float qrPixHeight = height / qrCode.Matrix.Height;
for (int i = 0; i < qrCode.Matrix.Height; i++)
{
for (int j = 0; j < qrCode.Matrix.Width; j++)
{
if (qrCode.Matrix[j, i])
{
g.FillRectangle(Brushes.Black, new RectangleF(left + j * qrPixWidth,
top + i * qrPixHeight,
qrPixWidth,
qrPixHeight));
}
}
}
}
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
/// Copyright (c) 2017-2019 Sensus Slovensko a.s.
///
namespace Results.Output.Printers.OnePerMeter
@@ -54,10 +54,5 @@ namespace Results.Output.Printers.OnePerMeter
public int ImgWid;
public int ImgHgh;
public string ImgFullPathName;
public BarcodeType BarcodeType; /// s/n is printed as barcode when valid (BarcodeType.None < BarcodeType < BarcodeType.Count)
public int BarcodeLeft;
public int BarcodeTop;
public int BarcodeWidth;
public int BarcodeHeight;
}
}
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.26.1458.0")]
[assembly: AssemblyFileVersion("2.26.1458.0")]
[assembly: AssemblyVersion("2.26.1447.0")]
[assembly: AssemblyFileVersion("2.26.1447.0")]
-9
View File
@@ -1977,15 +1977,6 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Conduct..
/// </summary>
internal static string VName_Conduct {
get {
return ResourceManager.GetString("VName_Conduct", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ro.
/// </summary>
+28 -442
View File
@@ -130,7 +130,7 @@
<value>Ergebnisse</value>
</data>
<data name="Batch_nr" xml:space="preserve">
<value>Los Nr.</value>
<value>Stapel Nr.</value>
</data>
<data name="Bench" xml:space="preserve">
<value>Prüfstand</value>
@@ -154,13 +154,13 @@
<value>Endzeit</value>
</data>
<data name="EndState_aux" xml:space="preserve">
<value>Endstand Nebenzähler</value>
<value>Eindstand Nebenz.</value>
</data>
<data name="EndState_main" xml:space="preserve">
<value>Endstand Hauptzähler</value>
<value>Eindstand Hauptz.</value>
</data>
<data name="End_state" xml:space="preserve">
<value>Endstand</value>
<value>Eindstand</value>
</data>
<data name="ErrLimHi" xml:space="preserve">
<value>Fehlergrenze hoch</value>
@@ -175,10 +175,10 @@
<value>Referenzfehler</value>
</data>
<data name="Err_aux" xml:space="preserve">
<value>Fehler Nebenzähler</value>
<value>Fehler Nebenz.</value>
</data>
<data name="Err_main" xml:space="preserve">
<value>Fehler Hauptzähler</value>
<value>Fehler Hauptz.</value>
</data>
<data name="Flow" xml:space="preserve">
<value>Durchfluss</value>
@@ -187,13 +187,13 @@
<value>Format</value>
</data>
<data name="H_amb" xml:space="preserve">
<value>Luftfeuchte Umgebung</value>
<value>H umgebung</value>
</data>
<data name="Item" xml:space="preserve">
<value>Objekt</value>
<value>Posten</value>
</data>
<data name="MClass" xml:space="preserve">
<value>Metrologische Klasse</value>
<value>Metr. Klasse</value>
</data>
<data name="OkBtnText" xml:space="preserve">
<value>OK</value>
@@ -220,34 +220,34 @@
<value>Impulse/l</value>
</data>
<data name="P_amb" xml:space="preserve">
<value>Druck amb. (Umgebungsdruck)</value>
<value>Dr umgebung</value>
</data>
<data name="P_dn_end" xml:space="preserve">
<value>Druck Eingang Prüfungsende</value>
<value>Dr aus ende</value>
</data>
<data name="P_dn" xml:space="preserve">
<value>Druck Eingang</value>
<value>Dr aus</value>
</data>
<data name="P_dn_start" xml:space="preserve">
<value>Druck Eingang Prüfungsbeginn</value>
<value>Dr aus start</value>
</data>
<data name="P_up_end" xml:space="preserve">
<value>Druck Ausgang Prüfungsende</value>
<value>Dr ein ende</value>
</data>
<data name="P_up" xml:space="preserve">
<value>Druck Ausgang</value>
<value>Dr ein</value>
</data>
<data name="P_up_start" xml:space="preserve">
<value>Druck Ausgang Prüfungsanfang</value>
<value>Dr ein start</value>
</data>
<data name="Q_fall" xml:space="preserve">
<value>Q Fall </value>
<value>Q fall</value>
</data>
<data name="Q_from" xml:space="preserve">
<value>Q von</value>
</data>
<data name="Q_rise" xml:space="preserve">
<value>Q Steig</value>
<value>Q steig</value>
</data>
<data name="Q_to" xml:space="preserve">
<value>Q bis</value>
@@ -292,13 +292,13 @@
<value>Prüfvolumen</value>
</data>
<data name="T_amb" xml:space="preserve">
<value>T Umgebung</value>
<value>T umgebung</value>
</data>
<data name="T_div" xml:space="preserve">
<value>T Umschaltung</value>
<value>T div</value>
</data>
<data name="T_end" xml:space="preserve">
<value>T Ende</value>
<value>Endzeit</value>
</data>
<data name="T_in" xml:space="preserve">
<value>T ein</value>
@@ -364,13 +364,13 @@
<value>Hersteller</value>
</data>
<data name="Meter_type" xml:space="preserve">
<value>WZ-Typ</value>
<value>Typ</value>
</data>
<data name="Compound" xml:space="preserve">
<value>Verbundzähler</value>
<value>Verbund</value>
</data>
<data name="Heat_meter" xml:space="preserve">
<value>Wärmezähler</value>
<value />
</data>
<data name="Single" xml:space="preserve">
<value>Einzel</value>
@@ -382,16 +382,16 @@
<value>Größe</value>
</data>
<data name="Page" xml:space="preserve">
<value>Seite</value>
<value>Blz.</value>
</data>
<data name="Water_Meter" xml:space="preserve">
<value>Wasserzähler</value>
</data>
<data name="aux" xml:space="preserve">
<value>Nebenzähler</value>
<value>Nebenz.</value>
</data>
<data name="main" xml:space="preserve">
<value>Hauptzähler</value>
<value>Hauptz.</value>
</data>
<data name="fall" xml:space="preserve">
<value>fall</value>
@@ -409,420 +409,6 @@
<value>Masse</value>
</data>
<data name="Density_correction" xml:space="preserve">
<value>Dichtekorrektur</value>
</data>
<data name="Energy" xml:space="preserve">
<value>Energie</value>
</data>
<data name="Energy_ref" xml:space="preserve">
<value>Energie ref.</value>
</data>
<data name="P_delta" xml:space="preserve">
<value>Druckdifferenz </value>
</data>
<data name="P_delta_end" xml:space="preserve">
<value>Druckdifferenz Ende Prüfung</value>
</data>
<data name="P_delta_mean" xml:space="preserve">
<value>Druckdifferenz Delta Prüfung </value>
</data>
<data name="P_delta_start" xml:space="preserve">
<value>Druckdifferenz Beginn Prüfung</value>
</data>
<data name="End_volume" xml:space="preserve">
<value>Ende Volumen</value>
</data>
<data name="Start_volume" xml:space="preserve">
<value>Start Volumen</value>
</data>
<data name="End_volume_aux" xml:space="preserve">
<value>Ende Volumen Nebenzähler</value>
</data>
<data name="End_volume_main" xml:space="preserve">
<value>Ende Volumen Hauptzähler</value>
</data>
<data name="Start_volume_aux" xml:space="preserve">
<value>Start Volumen Nebenzähler</value>
</data>
<data name="Start_volume_main" xml:space="preserve">
<value>Start Volumen Hauptzähler</value>
</data>
<data name="Volume_aux" xml:space="preserve">
<value>Volumen Nebenzähler</value>
</data>
<data name="Volume_main" xml:space="preserve">
<value>Volumen Hauptzähler</value>
</data>
<data name="End_mass" xml:space="preserve">
<value>End Prüfung</value>
</data>
<data name="Start_mass" xml:space="preserve">
<value>Start Prüfung</value>
</data>
<data name="VName_Flow" xml:space="preserve">
<value>Q</value>
</data>
<data name="VName_Press" xml:space="preserve">
<value>Druck</value>
</data>
<data name="VName_Temp" xml:space="preserve">
<value>Temperatur</value>
</data>
<data name="VName_Dens" xml:space="preserve">
<value>Ro</value>
</data>
<data name="VName_Humi" xml:space="preserve">
<value>Hu</value>
</data>
<data name="VName_TstTime" xml:space="preserve">
<value>Tau</value>
</data>
<data name="VName_Vol" xml:space="preserve">
<value>Vol.</value>
</data>
<data name="Tooltip_P_de_ac" xml:space="preserve">
<value>Druckdifferenz gemessen von Druckgeber aktuell</value>
</data>
<data name="Tooltip_P_de_avg" xml:space="preserve">
<value>Druckdifferenz gemessen von Druckgeber Mittelwert</value>
</data>
<data name="Tooltip_P_de_en" xml:space="preserve">
<value>Druckdifferenz gemessen von Druckgeber am Prüfungsende</value>
</data>
<data name="Tooltip_P_de_me" xml:space="preserve">
<value>Druckdifferenz gemessen von Druckgeber-Durchschnitt </value>
</data>
<data name="Tooltip_P_de_st" xml:space="preserve">
<value>Druckdifferenz gemessen von Druckgeber am Prüfungsbeginn</value>
</data>
<data name="Tooltip_P_dw_ac" xml:space="preserve">
<value>Druck am Prüfstreckenausgang aktuell</value>
</data>
<data name="Tooltip_P_dw_avg" xml:space="preserve">
<value>Druck Mittelwert am Prüfstreckenausgang</value>
</data>
<data name="Tooltip_P_dw_en" xml:space="preserve">
<value>Druck am Prüfstreckenausgang am Ende der Prüfung</value>
</data>
<data name="Tooltip_P_dw_me" xml:space="preserve">
<value>Druck Durchnschnitt am Prüfstreckenausgang</value>
</data>
<data name="Tooltip_P_dw_st" xml:space="preserve">
<value>Hauptdruck am Ausgang bei Prüfbeginn</value>
</data>
<data name="Tooltip_P_up_ac" xml:space="preserve">
<value>Hauptdruck am Eingang aktuell</value>
</data>
<data name="Tooltip_P_up_avg" xml:space="preserve">
<value>Druck Mittelwert am Prüfstreckeneingang</value>
</data>
<data name="Tooltip_P_up_en" xml:space="preserve">
<value>Druck am Prüfstreckeneingang am Ende der Prüfung</value>
</data>
<data name="Tooltip_P_up_me" xml:space="preserve">
<value>Druck Durchnschnitt am Prüfstreckeneingang</value>
</data>
<data name="Tooltip_P_up_st" xml:space="preserve">
<value>Druck am Prüfstreckeneingang bei Prüfbeginn</value>
</data>
<data name="Tooltip_Q_m_r" xml:space="preserve">
<value>Durchfluss berechnet von Masse der Waage und Zeit </value>
</data>
<data name="Tooltip_Q_riac" xml:space="preserve">
<value>Durchfluss angezeigt von NHO/ aktuell</value>
</data>
<data name="Tooltip_Q_rim" xml:space="preserve">
<value>Durchfluss von aktuellem NHO/ Durchnschnitt</value>
</data>
<data name="Tooltip_Q_v_r" xml:space="preserve">
<value>Durchfluss von aktuellem Refferenzzähler</value>
</data>
<data name="Tooltip_T_di_ac" xml:space="preserve">
<value>Temperatur aktuell an der Umschaltung</value>
</data>
<data name="Tooltip_T_di_avg" xml:space="preserve">
<value>Temperatur-Mittelwert an der Umschaltung</value>
</data>
<data name="Tooltip_T_di_en" xml:space="preserve">
<value>Temperatur Umschaltung am Prüfungsende (4 letzten Messungen)</value>
</data>
<data name="Tooltip_T_di_me" xml:space="preserve">
<value>Temperatur-Durchschnitt an der Umschaltung</value>
</data>
<data name="Tooltip_T_di_st" xml:space="preserve">
<value>Temperatur Umschaltung am Prüfungsanfang (4 ersten Messungen)</value>
</data>
<data name="Tooltip_T_dw_ac" xml:space="preserve">
<value>Temperatur aktuell am Prüfstreckenausgang</value>
</data>
<data name="Tooltip_T_dw_avg" xml:space="preserve">
<value>Temperatur-Mittelwert am Prüstreckenausgang</value>
</data>
<data name="Tooltip_T_dw_en" xml:space="preserve">
<value>Temperatur Prüfstreckenausgang am Prüfungsende ( 4 letzten Messungen)</value>
</data>
<data name="Tooltip_T_dw_me" xml:space="preserve">
<value>Temperatur-Durchschnitt am Prüstreckenausgang</value>
</data>
<data name="Tooltip_T_dw_st" xml:space="preserve">
<value>Temperatur Prüfstreckenausgang am Prüfungsanfang( 4 ersten Messungen)</value>
</data>
<data name="Tooltip_T_up_ac" xml:space="preserve">
<value>Temperatur aktuell am Prüfstreckeneingang</value>
</data>
<data name="Tooltip_T_up_avg" xml:space="preserve">
<value>Temperatur-Mittelwert am Prüstreckeneingang während der Prüfung</value>
</data>
<data name="Tooltip_T_up_en" xml:space="preserve">
<value>Temperatur Prüfstreckeneingang und -Ausgang am Prüfungsanfang( 4 Messungen bevor Ende)</value>
</data>
<data name="Tooltip_T_up_me" xml:space="preserve">
<value>Temperatur-Durchschnitt am Prüfstreckeneingang wärend der Prüfung</value>
</data>
<data name="Tooltip_T_up_st" xml:space="preserve">
<value>Temperatur Prüstreckeneingang am Prüfungsbeginn (4 Messungen nach Beginn)</value>
</data>
<data name="Tooltip_E_rel" xml:space="preserve">
<value>Relative Messabweichung eines WZ</value>
</data>
<data name="Tooltip_E_rel_ref" xml:space="preserve">
<value>Relative Messabweichung des NHO</value>
</data>
<data name="Tooltip_sn" xml:space="preserve">
<value>Serie Nr. des WZ</value>
</data>
<data name="Tooltip_sn_aux" xml:space="preserve">
<value>Serie Nr. des Nebenzählers (Verbundzähler)</value>
</data>
<data name="Tooltip_sn_main" xml:space="preserve">
<value>Serie Nr. des Hauptzählers (Verbundzähler)</value>
</data>
<data name="Tooltip_Vol_Mt" xml:space="preserve">
<value>Volumen gemessen vom geprüften WZ</value>
</data>
<data name="Tooltip_Vol_rm" xml:space="preserve">
<value>Refferenz-Volumen vom geprüften WZ</value>
</data>
<data name="VName_Error" xml:space="preserve">
<value>E</value>
</data>
<data name="Tooltip_Hu_Amb_M" xml:space="preserve">
<value>Umgebungs-Luftfeuchtigkeit während der Prüfung</value>
</data>
<data name="Tooltip_P_Amb_M" xml:space="preserve">
<value>Umgebungs-Druck während der Prüfung</value>
</data>
<data name="Tooltip_T_Amb_M" xml:space="preserve">
<value>Umgebungs-Temperatur während der Prüfung</value>
</data>
<data name="Test_done" xml:space="preserve">
<value>Prüfung erledigt</value>
</data>
<data name="Test_passed" xml:space="preserve">
<value>Prüfung beendet</value>
</data>
<data name="No" xml:space="preserve">
<value>Nein</value>
</data>
<data name="Yes" xml:space="preserve">
<value>Ja</value>
</data>
<data name="Error_flags" xml:space="preserve">
<value>Fehlerflags</value>
</data>
<data name="Legalizator" xml:space="preserve">
<value>Prüfstellenleiter</value>
</data>
<data name="User_description" xml:space="preserve">
<value>Benutzerbeschreibung</value>
</data>
<data name="Failed_meters_count" xml:space="preserve">
<value>WZ-Prüfung nicht bestanden</value>
</data>
<data name="Passed_meters_count" xml:space="preserve">
<value>WZ-Prüfung bestanden</value>
</data>
<data name="sensitivity" xml:space="preserve">
<value>Empfindlichkeit</value>
</data>
<data name="Tooltip_Q_end" xml:space="preserve">
<value>Durchflusswert vom NHO-am Prüfungsende</value>
</data>
<data name="Tooltip_Q_max" xml:space="preserve">
<value>Durchflusswert vom NHO-max</value>
</data>
<data name="Tooltip_Q_min" xml:space="preserve">
<value>Durchflusswert vom NHO-min</value>
</data>
<data name="Tooltip_Q_start" xml:space="preserve">
<value>Durchflusswert vom NHO-am Prüfungsanfang</value>
</data>
<data name="Tooltip_P_dw_max" xml:space="preserve">
<value>Druck max. am Prüfstandsausgang während der Prüfung</value>
</data>
<data name="Tooltip_P_dw_min" xml:space="preserve">
<value>Druck min. am Prüfstandsausgang während der Prüfung</value>
</data>
<data name="Tooltip_P_up_max" xml:space="preserve">
<value>Druck max. am Prüfstandseingang während der Prüfung</value>
</data>
<data name="Tooltip_P_up_min" xml:space="preserve">
<value>Druck min. am Prüfstandseingang während der Prüfung</value>
</data>
<data name="Tooltip_T_di_max" xml:space="preserve">
<value>Temp. max. an der Umschaltung während der Prüfung</value>
</data>
<data name="Tooltip_T_di_min" xml:space="preserve">
<value>Temp. min. an der Umschaltung während der Prüfung</value>
</data>
<data name="Tooltip_T_dw_max" xml:space="preserve">
<value>Temp. max am Prüfstandsausgang während der Prüfung</value>
</data>
<data name="Tooltip_T_dw_min" xml:space="preserve">
<value>Temp. min. am Prüfstandsausgang während der Prüfung</value>
</data>
<data name="Tooltip_T_up_max" xml:space="preserve">
<value>Temp. max am Prüfstandseingang während der Prüfung</value>
</data>
<data name="Tooltip_T_up_min" xml:space="preserve">
<value>Temp. min am Prüfstandseingang während der Prüfung</value>
</data>
<data name="Tooltip_P_de_max" xml:space="preserve">
<value>Druckdifferenz gemessen von Delta P /WZ max. während der Prüfung</value>
</data>
<data name="Tooltip_P_de_min" xml:space="preserve">
<value>Druckdifferenz gemessen von Delta P /WZ min. während der Prüfung</value>
</data>
<data name="Tooltip_Rho_Wa_calc" xml:space="preserve">
<value>Dichte vom Wasser aus Tabelle oder Formel</value>
</data>
<data name="Tooltip_T_rho_0" xml:space="preserve">
<value>Temperatur von der Wasserprobe bei der Dichtekalibrierung</value>
</data>
<data name="Tooltip_T_ln_ac" xml:space="preserve">
<value>Temperatur aktuell in der Prüfstrecke</value>
</data>
<data name="Tooltip_T_ln_avg" xml:space="preserve">
<value>Temperatur-Mittelwert in der Prüfstrecke während der Prüfung</value>
</data>
<data name="Tooltip_T_ln_en" xml:space="preserve">
<value>Temperatur in der Prüfstrecke am Ende der Prüfung -4 letzten Messungen</value>
</data>
<data name="Tooltip_T_ln_max" xml:space="preserve">
<value>Temperatur max. in der Prüfstrecke während der Prüfung</value>
</data>
<data name="Tooltip_T_ln_me" xml:space="preserve">
<value>Temperatur-Durchschnitt in der Prüfstrecke während der Prüfung</value>
</data>
<data name="Tooltip_T_ln_min" xml:space="preserve">
<value>Temperatur min. in der Prüfstrecke während der Prüfung</value>
</data>
<data name="Tooltip_T_ln_st" xml:space="preserve">
<value>Temperatur in der Prüfstrecke am Anfang der Prüfung -4 ersten Messungen</value>
</data>
<data name="Unit" xml:space="preserve">
<value>Einheit</value>
</data>
<data name="Procedure_description" xml:space="preserve">
<value>Prüfprozess Beschreibung</value>
</data>
<data name="Bench_ID" xml:space="preserve">
<value>Prüfstand ID</value>
</data>
<data name="Bench_name" xml:space="preserve">
<value>Prüfstamdsname</value>
</data>
<data name="Address" xml:space="preserve">
<value>Adresse</value>
</data>
<data name="Tooltip_E_rel_last" xml:space="preserve">
<value>Relativer Fehler vom WZ in vorheriger Prüfung/ in Produktion</value>
</data>
<data name="Batch" xml:space="preserve">
<value>Zälerlos</value>
</data>
<data name="repetition" xml:space="preserve">
<value>Wiederholung</value>
</data>
<data name="Invalid_Q2_correction_factors" xml:space="preserve">
<value>Fehlerhafter Q2 Korrektur-Faktor</value>
</data>
<data name="Previous_step_is_missing_or_NOK" xml:space="preserve">
<value>Vorgehender Schritt fehlt oder nicht OK</value>
</data>
<data name="Test_repetition_count_exceeded_upper_limit" xml:space="preserve">
<value>Prüfungswiederholung Anzahl überschritten!</value>
</data>
<data name="Wrong_iPerl_counting_direction" xml:space="preserve">
<value>Falsche iPERL Durchflussrichtung</value>
</data>
<data name="Failed" xml:space="preserve">
<value>Nicht OK</value>
</data>
<data name="Passed" xml:space="preserve">
<value>OK</value>
</data>
<data name="Test_in_progress" xml:space="preserve">
<value>Prüfung läuft</value>
</data>
<data name="Counter_0" xml:space="preserve">
<value>Zähler {0}</value>
</data>
<data name="Date_and_time" xml:space="preserve">
<value>Datum und Zeit</value>
</data>
<data name="Name" xml:space="preserve">
<value>Name</value>
</data>
<data name="Step" xml:space="preserve">
<value>Schritt</value>
</data>
<data name="Workplace" xml:space="preserve">
<value>Arbeitsplatz</value>
</data>
<data name="Workflow" xml:space="preserve">
<value>Arbeitsablauf</value>
</data>
<data name="Production_tracing_results" xml:space="preserve">
<value>Produktion Ergebnisse verfolgen</value>
</data>
<data name="Code" xml:space="preserve">
<value>Code</value>
</data>
<data name="Part" xml:space="preserve">
<value>Teil</value>
</data>
<data name="All_results" xml:space="preserve">
<value>Alle Ergebnisse</value>
</data>
<data name="Graphs" xml:space="preserve">
<value>Graphiken</value>
</data>
<data name="No_water_meter" xml:space="preserve">
<value>Kein WZ</value>
</data>
<data name="Serial_number_is_missing" xml:space="preserve">
<value>Serie Nr. fehlt.</value>
</data>
<data name="Lower_limit" xml:space="preserve">
<value>Untere Grenze</value>
</data>
<data name="Upper_limit" xml:space="preserve">
<value>Obere Grenze</value>
</data>
<data name="Water_meter_results" xml:space="preserve">
<value>WZ Ergebnisse</value>
</data>
<data name="Relative_error" xml:space="preserve">
<value>Relativer Fehler</value>
</data>
<data name="This_position_is_disabled" xml:space="preserve">
<value>Position nicht aktiviert.</value>
</data>
<data name="Available_items" xml:space="preserve">
<value>Verfügbare Positionen</value>
</data>
<data name="Selected_items" xml:space="preserve">
<value>Ausgewählte Objekte</value>
<value>Dichtekorektur</value>
</data>
</root>
-3
View File
@@ -825,7 +825,4 @@
<data name="Selected_items" xml:space="preserve">
<value>Selected item</value>
</data>
<data name="VName_Conduct" xml:space="preserve">
<value>Conduct.</value>
</data>
</root>
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;SLM_150;LANG_SK</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
@@ -29,7 +29,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;SLM_150;LANG_SK</DefineConstants>
<DefineConstants>TRACE;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+17 -27
View File
@@ -210,22 +210,22 @@ namespace Results
///
/// Flow
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qfrom())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qto())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowVolume)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} rim ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_min, string.Format("{0} ref min ()", Strings.VName_Flow), Strings.Tooltip_Q_min, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_max, string.Format("{0} ref max ()", Strings.VName_Flow), Strings.Tooltip_Q_max, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_start, string.Format("{0} ref start ()",Strings.VName_Flow),Strings.Tooltip_Q_start, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_end, string.Format("{0} ref end ()", Strings.VName_Flow), Strings.Tooltip_Q_end, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Qc, string.Format("Qc"), "Calculated water meter flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", w.GetTestRslt(t).FlowVolume)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv, string.Format("{0} ctv ()", Strings.VName_Flow), "CTV of the flow (mean val.)", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", w.GetTestRslt(t).FlowVolume)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_min, string.Format("{0} ctv min ()", Strings.VName_Flow), "Min. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowMin : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowMin / w.GetTestRslt(t).FlowMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_max, string.Format("{0} ctv max ()", Strings.VName_Flow), "Max. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowMax : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowMax / w.GetTestRslt(t).FlowMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_start, string.Format("{0} ctv start ()", Strings.VName_Flow), "Start flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowStart : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowStart / w.GetTestRslt(t).FlowMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_end, string.Format("{0} ctv end ()", Strings.VName_Flow), "End flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowEnd : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowEnd / w.GetTestRslt(t).FlowMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, string.Format("{0} {1}", Strings.VName_Flow, Strings.rise), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, string.Format("{0} {1}", Strings.VName_Flow, Strings.fall), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QFall == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QFall)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qfrom())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qto())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowVolume)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} rim ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_min, string.Format("{0} ref min ()", Strings.VName_Flow), Strings.Tooltip_Q_min, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_max, string.Format("{0} ref max ()", Strings.VName_Flow), Strings.Tooltip_Q_max, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_start, string.Format("{0} ref start ()",Strings.VName_Flow),Strings.Tooltip_Q_start, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_end, string.Format("{0} ref end ()", Strings.VName_Flow), Strings.Tooltip_Q_end, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Qc, string.Format("Qc"), "Calculated water meter flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", (w.GetMeterTestRslt(t).TestTime == 0 || w.GetTestRslt(t).PulsesMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV / w.GetMeterTestRslt(t).TestTime * 3.6 * w.GetMeterTestRslt(t).PulsesMaster / w.GetTestRslt(t).PulsesMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv, string.Format("{0} ctv ()", Strings.VName_Flow), "CTV of the flow (mean val.)", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", (w.GetMeterTestRslt(t).TestTime == 0 || w.GetTestRslt(t).PulsesMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV / w.GetMeterTestRslt(t).TestTime * 3.6 * w.GetMeterTestRslt(t).PulsesMaster / w.GetTestRslt(t).PulsesMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_min, string.Format("{0} ctv min ()", Strings.VName_Flow), "Min. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMin / w.GetTestRslt(t).VolumeMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_max, string.Format("{0} ctv max ()", Strings.VName_Flow), "Max. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMax / w.GetTestRslt(t).VolumeMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_start, string.Format("{0} ctv start ()", Strings.VName_Flow), "Start flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowStart / w.GetTestRslt(t).VolumeMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_end, string.Format("{0} ctv end ()", Strings.VName_Flow), "End flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowEnd / w.GetTestRslt(t).VolumeMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, string.Format("{0} {1}", Strings.VName_Flow, Strings.rise), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, string.Format("{0} {1}", Strings.VName_Flow, Strings.fall), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QFall == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QFall)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_sensitivity, string.Format("{0} {1}", Strings.VName_Flow, Strings.sensitivity), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ConstMaster, string.Format("k MID ()"), "Const. of the reference flow meter", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", ((w.GetTestRslt(t).ConstMaster < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMaster)))));
@@ -297,16 +297,6 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean_from_up_down_per_mtr, string.Format("{0} UP-DW ME per mtr ()", Strings.VName_Press), "P delta mean from UP/DW per one meter", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).PressUpMean - w.GetTestRslt(t).PressDownMean) / Math.Max(1, w.GetTestRslt(t).Batch.WaterMeters.Count))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_PMax_test_mean, string.Format("{0} PMax mean ()", Strings.VName_Press), "Mean PMax test pressure", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsPMaxTest()) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).PressUpMean + w.GetTestRslt(t).PressDownMean) / 2)));
///
/// Electrical conductivity of water
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct, string.Format("{0} ME ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_start, string.Format("{0} ST ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_end, string.Format("{0} EN ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_avg, string.Format("{0} avg ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).ConductStart + w.GetTestRslt(t).ConductEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_min, string.Format("{0} min ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_max, string.Format("{0} max ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductMax)));
///
/// Ambient temperature/pressure/humidity/Buoyancy
///
@@ -336,7 +326,7 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed, Strings.Result, Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => string.IsNullOrEmpty(t) ? w.PassedColorStr(f)
: ((w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr(f))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ThreeState, "Three state result", Quantity.Enumerated, ItemCategory.MeterResult, (w, t, u, f, p) => FormatThreeState(f, w.ThreeStateFromTests())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ThreeState, "Three state result", Quantity.Enum, ItemCategory.MeterResult, (w, t, u, f, p) => FormatThreeState(f, w.ThreeStateFromTests())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.RefFlowmeter, "Ref. flowmeter", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).RefFlowmeter()) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ResultOrErrorFlags, "Winiki lub E", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.PassedOrErrorFlagsStr()))); /// PL specific result
-1
View File
@@ -14,7 +14,6 @@ namespace ResultsBrowser
ListOfSerialNumbers,
WZTypeIdAndTimePeriod,
ProducedWithinTimePeriod,
BenchAndBatchNr,
Count,
}
@@ -39,7 +39,6 @@ namespace ResultsBrowser.Forms
//queryTypeComboBox.Items.Add(new CQSelectionItem(CQCriteria.ListOfSerialNumbers, "Všetky vodomery so sériovými číslami podľa zadaného zoznamu"));
queryTypeComboBox.Items.Add(new CQSelectionItem(CQCriteria.WZTypeIdAndTimePeriod, "Všetky vodomery so zadaným WZTypeID vyrobené v zadanom časovom období"));
queryTypeComboBox.Items.Add(new CQSelectionItem(CQCriteria.ProducedWithinTimePeriod, "Všetky vodomery vyrobené v zadanom časovom období"));
queryTypeComboBox.Items.Add(new CQSelectionItem(CQCriteria.BenchAndBatchNr, "Stanica a číslo dávky"));
queryTypeComboBox.Text = "Všetky vodomery vyrobené v zadanom časovom období";
destinationFileTextBox.Text = string.Format("vysledky_hladania_{0:ddMMyyyy_HHmm}.csv", DateTime.Now);
@@ -69,8 +68,7 @@ namespace ResultsBrowser.Forms
/// Update UI elements visibility
inputListGroupBox.Enabled = (CQCriteria == CQCriteria.ListOfOrders) ||
(CQCriteria == CQCriteria.ListOfPcbNumbers) ||
(CQCriteria == CQCriteria.ListOfSerialNumbers) ||
(CQCriteria == CQCriteria.BenchAndBatchNr);
(CQCriteria == CQCriteria.ListOfSerialNumbers);
timePeriodGroupBox.Enabled = (CQCriteria == CQCriteria.WZTypeIdAndTimePeriod) ||
(CQCriteria == CQCriteria.ProducedWithinTimePeriod);
@@ -80,11 +78,6 @@ namespace ResultsBrowser.Forms
parameterGroupBox.Enabled = true;
parameterNameLabel.Text = "WZ Type ID";
}
else if (CQCriteria == CQCriteria.BenchAndBatchNr)
{
parameterGroupBox.Enabled = true;
parameterNameLabel.Text = "Test bench number (e.g. 10 for WR10)";
}
else
{
parameterGroupBox.Enabled = false;
-7
View File
@@ -20,18 +20,11 @@ namespace ResultsBrowser
public DateTime End;
public int HydrPruefung;
public double AdjErr;
public double Q4Err;
public double Q3Err;
public double Q2AdjErr;
public double Q2Err;
public double Q1Err;
public double AdjErrA4;
public double Q3RlErr;
public double Q3LrErr;
public double Q2RlErr;
public double Q2LrErr;
public double Q2acRlErr;
public double Q2acLrErr;
public double Q1RlErr;
public double Q1LrErr;
public int CalibFactor;
+3 -3
View File
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sensus")]
[assembly: AssemblyProduct("ResultsBrowser")]
[assembly: AssemblyCopyright("Copyright © 2015 - 2020 Sensus Slovensko a.s.")]
[assembly: AssemblyCopyright("Copyright © 2015 - 2018 Sensus Slovensko a.s.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.26.1498.0")]
[assembly: AssemblyFileVersion("2.26.1498.0")]
[assembly: AssemblyVersion("2.25.1440.0")]
[assembly: AssemblyFileVersion("2.25.1440.0")]
+3 -75
View File
@@ -163,7 +163,7 @@
<value>OK</value>
</data>
<data name="Print_query_results" xml:space="preserve">
<value>Ergebnisse Abfrage Drucken</value>
<value>Ergebnise drucken</value>
</data>
<data name="Procedure" xml:space="preserve">
<value>Prüfvorlage</value>
@@ -172,7 +172,7 @@
<value>Protokoll</value>
</data>
<data name="Query_results" xml:space="preserve">
<value>Abfrageergebnisse</value>
<value>Ergebnisse</value>
</data>
<data name="Results_Browser" xml:space="preserve">
<value>Analyse der Ergebnisse</value>
@@ -199,7 +199,7 @@
<value>Statistiken</value>
</data>
<data name="Test" xml:space="preserve">
<value>Prüfung</value>
<value>Prüfpunkt</value>
</data>
<data name="Test_bench" xml:space="preserve">
<value>Prüfstand</value>
@@ -231,76 +231,4 @@
<data name="Print" xml:space="preserve">
<value>Drucken</value>
</data>
<data name="Name" xml:space="preserve">
<value>Name</value>
</data>
<data name="ConfigureDatabaseText" xml:space="preserve">
<value>Password für Prüfstand configurieren</value>
</data>
<data name="ExitBtnText" xml:space="preserve">
<value>Exit</value>
</data>
<data name="Component" xml:space="preserve">
<value>Komponenten</value>
</data>
<data name="Configure" xml:space="preserve">
<value>Konfigurieren</value>
</data>
<data name="Printer" xml:space="preserve">
<value>Drucker</value>
</data>
<data name="Question" xml:space="preserve">
<value>Fragen</value>
</data>
<data name="Add" xml:space="preserve">
<value>&amp;Hinzufügen</value>
</data>
<data name="Message" xml:space="preserve">
<value>Nachricht</value>
</data>
<data name="Data" xml:space="preserve">
<value>Daten</value>
</data>
<data name="All_files" xml:space="preserve">
<value>Alle Dateien</value>
</data>
<data name="Query_files" xml:space="preserve">
<value>Abfragedateien</value>
</data>
<data name="No_program_settings_found" xml:space="preserve">
<value>Programmeinstellungen nicht gefunden</value>
</data>
<data name="Using_default_settings" xml:space="preserve">
<value>Einstellungen Vorgaben benutzen.</value>
</data>
<data name="Selected_language_not_supported" xml:space="preserve">
<value>Ausgewählte Sprache wird nicht unterstützt.</value>
</data>
<data name="Using_English" xml:space="preserve">
<value>Englische Sprache benutzen!</value>
</data>
<data name="Warning" xml:space="preserve">
<value>Warnung</value>
</data>
<data name="Format" xml:space="preserve">
<value>Formatieren</value>
</data>
<data name="Configure_printer" xml:space="preserve">
<value>Drucker konfigurieren.</value>
</data>
<data name="No_printer_defined" xml:space="preserve">
<value>Kein Drucker ausgewählt.</value>
</data>
<data name="Printing_failed" xml:space="preserve">
<value>Druck fehlgeschlagen</value>
</data>
<data name="Printing_completed" xml:space="preserve">
<value>Druck vollständig</value>
</data>
<data name="Error_exporting_results" xml:space="preserve">
<value>Fehler beim exportieren der Ergebnisse!</value>
</data>
<data name="Histograms" xml:space="preserve">
<value>Histogramm</value>
</data>
</root>
+2 -2
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;SLM_150;LANG_SK</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -32,7 +32,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;SLM_150;LANG_SK</DefineConstants>
<DefineConstants>TRACE;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+122 -254
View File
@@ -28,8 +28,8 @@ namespace ResultsBrowser
IList<WaterMeter> waterMeters;
DateTime timePeriodStart;
DateTime timePeriodEnd;
DateTime timePeriodStart;
DateTime timePeriodEnd;
static IList<IComponent> tbfComponents;
static IList<IDevice> tbfDevices;
@@ -47,9 +47,9 @@ namespace ResultsBrowser
tbfComponents = new List<TBF.BenchControl.Generic.IComponent>();
tbfDevices = new List<IDevice>();
timePeriodStart = new DateTime(0);
timePeriodEnd = new DateTime(0);
}
timePeriodStart = new DateTime(0);
timePeriodEnd = new DateTime(0);
}
private void ResultsBrowserWnd_Load(object sender, EventArgs e)
{
@@ -102,15 +102,15 @@ namespace ResultsBrowser
checkBox6.Visible = !string.IsNullOrEmpty(checkBox6.Text);
}
string BenchName()
{
return checkBox1.Checked ? Program.LocalSettings.Bench1
: checkBox2.Checked ? Program.LocalSettings.Bench2
: checkBox3.Checked ? Program.LocalSettings.Bench3
: checkBox4.Checked ? Program.LocalSettings.Bench4
string BenchName()
{
return checkBox1.Checked ? Program.LocalSettings.Bench1
: checkBox2.Checked ? Program.LocalSettings.Bench2
: checkBox3.Checked ? Program.LocalSettings.Bench3
: checkBox4.Checked ? Program.LocalSettings.Bench4
: checkBox5.Checked ? Program.LocalSettings.Bench5
: Program.LocalSettings.Bench6;
}
}
void Localize()
{
@@ -118,19 +118,19 @@ namespace ResultsBrowser
resultsGroupBox.Text = Strings.Query_results;
settingsBtn.Text = Strings.Settings;
testBenchesGroupBox.Text = Strings.Test_benches;
clearFiltersBtn.Text = Strings.Clear_filters;
clearFiltersBtn.Text = Strings.Clear_filters;
addFilterBtn.Text = Strings.Add_filter;
formatOfResultsBtn.Text = Strings.Format_of_results;
printerConfigBtn.Text = Strings.Configure_printer;
loadConfigBtn.Text = Strings.Load_filters;
formatOfResultsBtn.Text = Strings.Format_of_results;
printerConfigBtn.Text = Strings.Configure_printer;
loadConfigBtn.Text = Strings.Load_filters;
saveConfigBtn.Text = Strings.Save_filters;
executeQueryBtn.Text = Strings.Execute_query;
executeQueryBtn.Text = Strings.Execute_query;
exportQueryResultsBtn.Text = Strings.Export_query_results;
printQueryResultsBtn.Text = Strings.Print_query_results;
statisticsBtn.Text = Strings.Statistics;
statisticsBtn.Text = Strings.Statistics;
}
private void settingsBtn_Click(object sender, EventArgs e)
@@ -176,40 +176,40 @@ namespace ResultsBrowser
}
}
private void formatOfResultsBtn_Click(object sender, EventArgs e)
{
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg();
dlg.MetersKind = Config.Entities.MetersKind.Single;
dlg.SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
private void formatOfResultsBtn_Click(object sender, EventArgs e)
{
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg();
dlg.MetersKind = Config.Entities.MetersKind.Single;
dlg.SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
if (dlg.ShowDialog() == DialogResult.OK)
{
filtersConfig.ResultItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
RedrawResults();
}
}
if (dlg.ShowDialog() == DialogResult.OK)
{
filtersConfig.ResultItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
RedrawResults();
}
}
private void printerConfigBtn_Click(object sender, EventArgs e)
{
Forms.PrinterConfigDlg dlg = new Forms.PrinterConfigDlg
{
PrinterClass = filtersConfig.PrinterClass,
PrinterCfg = filtersConfig.PrinterCfg
};
private void printerConfigBtn_Click(object sender, EventArgs e)
{
Forms.PrinterConfigDlg dlg = new Forms.PrinterConfigDlg
{
PrinterClass = filtersConfig.PrinterClass,
PrinterCfg = filtersConfig.PrinterCfg
};
if (dlg.ShowDialog() == DialogResult.OK)
{
filtersConfig.PrinterClass = dlg.PrinterClass;
filtersConfig.PrinterCfg = dlg.PrinterCfg;
}
}
if (dlg.ShowDialog() == DialogResult.OK)
{
filtersConfig.PrinterClass = dlg.PrinterClass;
filtersConfig.PrinterCfg = dlg.PrinterCfg;
}
}
private void loadConfigBtn_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = string.Format("{0} (*.qry)|*.qry|{1} (*.*)|*.*", Strings.Query_files, Strings.All_files);
if (dlg.ShowDialog() == DialogResult.OK)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = string.Format("{0} (*.qry)|*.qry|{1} (*.*)|*.*", Strings.Query_files, Strings.All_files);
if (dlg.ShowDialog() == DialogResult.OK)
{
LoadConfigFromFile(dlg.FileName);
}
}
@@ -269,8 +269,8 @@ namespace ResultsBrowser
private void executeQueryBtn_Click(object sender, EventArgs e)
{
timePeriodStart = new DateTime(0);
timePeriodEnd = new DateTime(0);
timePeriodStart = new DateTime(0);
timePeriodEnd = new DateTime(0);
try
{
@@ -291,11 +291,11 @@ namespace ResultsBrowser
foreach (var filter in filters)
{
if (filter is DateFilter)
{
timePeriodStart = (filter as DateFilter).From;
timePeriodEnd = (filter as DateFilter).To;
}
if (filter is DateFilter)
{
timePeriodStart = (filter as DateFilter).From;
timePeriodEnd = (filter as DateFilter).To;
}
waterMeters2 = filter.ExecuteQuery(sessions, waterMeters);
waterMeters = waterMeters2;
}
@@ -364,10 +364,10 @@ namespace ResultsBrowser
if (dlg.ShowDialog() == DialogResult.OK)
{
try
{
using (TextWriter writer = new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8))
{
try
{
using (TextWriter writer = new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8))
{
for (int i = 0; i < items.Count; i++)
{
writer.Write(items[i].Caption);
@@ -397,10 +397,10 @@ namespace ResultsBrowser
}
}
}
catch (Exception exc)
{
catch (Exception exc)
{
MessageBox.Show(exc.Message, Strings.Error_exporting_results, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
}
@@ -448,11 +448,11 @@ namespace ResultsBrowser
IComponent component = printerFactory.GetComponent(printerCfg, tbfComponents);
IResultsPrinter printer = component as IResultsPrinter;
if (printer == null)
if (printer== null)
{
MessageBox.Show(Strings.No_printer_defined);
return;
}
}
tbfComponents.Clear();
tbfDevices.Clear();
@@ -493,7 +493,7 @@ namespace ResultsBrowser
{
if (waterMeters == null || waterMeters.Count == 0) return;
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
///
/// Statistics options
@@ -529,24 +529,24 @@ namespace ResultsBrowser
}
/// <summary>
/// Updates component factory
/// </summary>
/// <param name="className">Component class name</param>
/// <param name="factory">Reference to a factory</param>
/// <returns>true when factory changed</returns>
IComponentFactory GetFactory(string className)
{
if (!string.IsNullOrEmpty(className))
{
foreach (var fac in TbfComponents.Factories)
{
if (fac.ClassName == className) return fac;
}
}
/// <summary>
/// Updates component factory
/// </summary>
/// <param name="className">Component class name</param>
/// <param name="factory">Reference to a factory</param>
/// <returns>true when factory changed</returns>
IComponentFactory GetFactory(string className)
{
if (!string.IsNullOrEmpty(className))
{
foreach (var fac in TbfComponents.Factories)
{
if (fac.ClassName == className) return fac;
}
}
return null;
}
return null;
}
private void customQueryButton_Click(object sender, EventArgs e)
{
@@ -609,22 +609,12 @@ namespace ResultsBrowser
while (dr.Read())
{
int i = 0;
string queryResult;
try { queryResult = dr.GetString(i++); }
catch { queryResult = string.Empty; }
string queryResult = dr.GetString(i++);
int maxPruefIx = dr.GetInt32(i++);
int testBenchId = maxPruefIx / 100;
maxPruefIx = maxPruefIx % 100;
string prefix;
try { prefix = dr.GetString(i++); }
catch { prefix = string.Empty; }
int sn;
try { sn = dr.GetInt32(i++); }
catch { sn = -1; }
string prefix = dr.GetString(i++);
int sn = dr.GetInt32(i++);
if (sn == -1) continue;
@@ -649,6 +639,7 @@ namespace ResultsBrowser
return;
}
/// Add this test bench to the list of test benches if it was still missing
if (!testBenches.Contains(testBenchId)) testBenches.Add(testBenchId);
}
@@ -739,35 +730,25 @@ namespace ResultsBrowser
double flow = dr.GetDouble(i++); /// Q_WZ
double error = dr.GetDouble(i++); /// Q_FEHLER
bool testPassed = (dr.GetInt32(i++) != 0);
#if true
/// SUEZ specific
switch (testId)
{
case -2: oraD.AdjErrA4 = error; break;
case -1: oraD.AdjErr = error; break;
case 1: oraD.Q1LrErr = error; break;
case 2: oraD.Q2acLrErr = error; break;
case 3: oraD.Q2LrErr = error; break;
case 5: oraD.Q3LrErr = error; break;
case 6: oraD.Q1RlErr = error; break;
case 7: oraD.Q2acRlErr = error; break;
case 8: oraD.Q2RlErr = error; break;
case 10: oraD.Q3RlErr = error; break;
default: break;
case -2:
oraD.AdjErrA4 = error;
break;
case -1:
oraD.AdjErr = error;
break;
case 5:
oraD.Q3LrErr = error;
break;
case 10:
oraD.Q3RlErr = error;
break;
default:
break;
}
#else /// DEWA specific
switch (testId)
{
case -1: oraD.AdjErr = error; break;
case 1: oraD.Q1Err = error; break;
case 2: oraD.Q2Err = error; break;
case 3: oraD.Q2AdjErr = error; break;
case 4: oraD.Q3Err = error; break;
case 5: oraD.Q4Err = error; break;
default: break;
}
#endif
}
dr.Close();
} /// end of foreach (var oraD in OraDatas)
@@ -775,78 +756,6 @@ namespace ResultsBrowser
oracleConnection.Close();
}
else if (dlg.CQCriteria == CQCriteria.BenchAndBatchNr)
{
switch (dlg.IntParameter)
{
case 10: Results.DB.ConnectionString = "SERVER=10.42.130.69; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 11: Results.DB.ConnectionString = "SERVER=10.42.129.27; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 13: Results.DB.ConnectionString = "SERVER=10.42.130.52; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 15: Results.DB.ConnectionString = "SERVER=10.42.130.71; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 14: Results.DB.ConnectionString = "SERVER=10.42.130.72; DATABASE=st-wr14-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 18: Results.DB.ConnectionString = "SERVER=10.42.130.165; DATABASE=st-wr18-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 19: Results.DB.ConnectionString = "SERVER=10.42.128.159; DATABASE=st-wr19-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 20: Results.DB.ConnectionString = "SERVER=10.42.130.76; DATABASE=st-wr20-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 21: Results.DB.ConnectionString = "SERVER=10.42.128.201; DATABASE=st-wr21-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
default: Results.DB.ConnectionString = string.Empty; break;
}
Results.DB.DbType = Users.Entities.DBType.MySql;
string[] fields = dlg.InputList.Split(new char[] { ',' });
int[] batchNrs = new int[fields.Length];
int batchNr;
for (int i = 0; i < batchNrs.Length; i++) if (int.TryParse(fields[i], out batchNr)) batchNrs[i] = batchNr;
IList<WaterMeter> waterMeters = new List<WaterMeter>();
if (!string.IsNullOrEmpty(Results.DB.ConnectionString))
{
ISession session = Results.DB.CreateSession();
for (int i = 0; i < batchNrs.Length; i++)
{
var batches = session.QueryOver<Batch>()
.Where(x => (x.BatchNr == batchNrs[i]))
.List();
if (batches.Count == 1)
{
var wms = session.QueryOver<WaterMeter>()
.Where(x => (x.Batch == batches[0]))
.List();
foreach (var wm in wms) waterMeters.Add(wm);
}
}
}
consoleTextBox.Text += "Collecting water meters\r\n";
foreach (var waterMeter in waterMeters)
{
oracleConnection = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
oracleConnection.Open();
OracleCommand cmd = new OracleCommand("select AUFTRAGSNUMMER, MAX_PRUEFINDEX, PREFIX, ZAEHLERNUMMER from VT_ZAEHLER_PD where VT_FERNUM = :1 AND ANBID = 4 order by ZAEHLERNUMMER", oracleConnection);
cmd.Parameters.Add(new OracleParameter { ParameterName = "1", OracleDbType = OracleDbType.Varchar2, Value = waterMeter.SerialNr });
OracleDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
int i = 0;
string queryResult = dr.GetString(i++);
int maxPruefIx = dr.GetInt32(i++);
int testBenchId = maxPruefIx / 100;
maxPruefIx = maxPruefIx % 100;
string prefix = dr.GetString(i++);
int sn = dr.GetInt32(i++);
if (sn == -1) continue;
/// Create 'OraData' object and add it to 'oraDatas' list
oraDatas.Add(new OraData() { PO = queryResult, PcbNr = waterMeter.SerialNr, TestBenchId = testBenchId, MaxPruefIx = maxPruefIx, Prefix = prefix, SN = sn });
/// Add this test bench to the list of test benches if it was still missing
if (!testBenches.Contains(testBenchId)) testBenches.Add(testBenchId);
}
}
}
else if (dlg.CQCriteria == CQCriteria.WZTypeIdAndTimePeriod)
{
}
@@ -886,19 +795,18 @@ namespace ResultsBrowser
/// Test bench databases
switch (testBenchId)
{
case 5: Results.DB.ConnectionString = "SERVER=10.42.130.69; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 6: Results.DB.ConnectionString = "SERVER=10.42.129.27; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 8: Results.DB.ConnectionString = "SERVER=10.42.130.52; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 9: Results.DB.ConnectionString = "SERVER=10.42.130.71; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 10: Results.DB.ConnectionString = "SERVER=10.42.130.72; DATABASE=st-wr14-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 5: Results.DB.ConnectionString = "SERVER=10.42.130.69; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 6: Results.DB.ConnectionString = "SERVER=10.42.129.27; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 8: Results.DB.ConnectionString = "SERVER=10.42.128.61; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 9: Results.DB.ConnectionString = "SERVER=10.42.130.71; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 10: Results.DB.ConnectionString = "SERVER=10.42.130.72; DATABASE=st-wr14-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 11: Results.DB.ConnectionString = "SERVER=10.42.130.165; DATABASE=st-wr18-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 12: Results.DB.ConnectionString = "SERVER=10.42.128.159; DATABASE=st-wr19-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 13: Results.DB.ConnectionString = "SERVER=10.42.130.76; DATABASE=st-wr20-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 13: Results.DB.ConnectionString = "SERVER=10.42.130.76; DATABASE=st-wr20-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 14: Results.DB.ConnectionString = "SERVER=10.42.128.201; DATABASE=st-wr21-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
default: Results.DB.ConnectionString = string.Empty; break;
}
#endif
Results.DB.DbType = Users.Entities.DBType.MySql;
if (!string.IsNullOrEmpty(Results.DB.ConnectionString))
{
@@ -946,19 +854,18 @@ namespace ResultsBrowser
consoleTextBox.Text += Environment.NewLine;
if (session != null) session.Close();
}
}
}
consoleTextBox.Text += "End reading additional data from MySQL\r\n";
consoleTextBox.Text += "CSV data begin\r\n";
using (TextWriter writer = new StreamWriter(dlg.DestinationFile))
{
#if true
writer.WriteLine(string.Format("PO; prefix; S/N; PcbNr; Bench; Batch; Start; Start; End; End; Pos; AdjA0; AdjA4; Q3RL; Q3LR; Q2RL; Q2LR; Q2acRL; Q2acLR; Q1RL; Q1LR; CalF; CAlF_LNA; HP; Q2cRL; Q2cLR"));
writer.WriteLine(string.Format("PO; prefix; S/N; PcbNr; Bench; Batch; Start; Start; End; End; Pos; AdjA0; AdjA4; Q3RL; Q3LR; CalF; CAlF_LNA; HP; Q2cRL; Q2cLR"));
//Console.WriteLine(string.Format("s/n;PCB nr.;bench;batch;position;Err. at 640 l/h;Err. LNA at 640 l/h;Err. Q3 RL;Err. Q3 LR;Cal.f.;Cal.f.LNA;Q2 corr.f. RL;Q2 corr.f. LR"));
foreach (var oraD in oraDatas)
{
writer.WriteLine(string.Format("{0}; {1}; {2}; =(\"{3}\"); {4}; {5}; {7}; {8}; {9}; {10};{11};{12};{13};{14};{15};{16};{17};{18};{19};{20};{21};{22};{23};{24};{25};{26};{27};{28}",
writer.WriteLine(string.Format("{0}; {1}; {2}; =(\"{3}\"); {4}; {5}; {7}; {8}; {9}; {10};{11};{12};{13};{14};{15};{16};{17};{18};{19};{20}",
//Console.WriteLine(string.Format("{2};=(\"{3}\"); {4};{5};{11};{12};{13};{14};{15};{16};{17};{19};{20}",
/* 0 */ oraD.PO,
/* 1 */ oraD.Prefix,
@@ -972,57 +879,18 @@ namespace ResultsBrowser
/* 9 */ oraD.End.ToShortDateString(),
/* 10 */ oraD.End.ToShortTimeString(),
/* 11 */ oraD.WMPosition,
/* 12 */ oraD.AdjErr.ToString("F3"),
/* 13 */ oraD.AdjErrA4.ToString("F3"),
/* 14 */ oraD.Q3RlErr.ToString("F3"),
/* 15 */ oraD.Q3LrErr.ToString("F3"),
/* 16 */ oraD.Q2RlErr.ToString("F3"),
/* 17 */ oraD.Q2LrErr.ToString("F3"),
/* 18 */ oraD.Q2acRlErr.ToString("F3"),
/* 19 */ oraD.Q2acLrErr.ToString("F3"),
/* 20 */ oraD.Q1RlErr.ToString("F3"),
/* 21 */ oraD.Q1LrErr.ToString("F3"),
/* 22 */ oraD.CalibFactor,
/* 23 */ oraD.CalibFactorLNA,
/* 24 */ oraD.HydrPruefung,
/* 25 */ oraD.Q2CorrectionRl,
/* 26 */ oraD.Q2CorrectionLr,
/* 27 */ oraD.WMTypeId,
/* 28 */ oraD.WMTypeRev));
/* 12 */ oraD.AdjErr.ToString("F2"),
/* 13 */ oraD.AdjErrA4.ToString("F2"),
/* 14 */ oraD.Q3RlErr.ToString("F2"),
/* 15 */ oraD.Q3LrErr.ToString("F2"),
/* 16 */ oraD.CalibFactor,
/* 17 */ oraD.CalibFactorLNA,
/* 18 */ oraD.HydrPruefung,
/* 19 */ oraD.Q2CorrectionRl,
/* 20 */ oraD.Q2CorrectionLr,
/* 21 */ oraD.WMTypeId,
/* 22 */ oraD.WMTypeRev));
}
#else
writer.WriteLine(string.Format("PO; prefix; S/N; PcbNr; Bench; Batch; Start; Start; End; End; Pos; AdjA0; Q4; Q3; Q2Adj; Q2; Q1; CalF; HP; Q2cRL; Q2cLR"));
//Console.WriteLine(string.Format("s/n;PCB nr.;bench;batch;position;Err. at 640 l/h;Err. LNA at 640 l/h;Err. Q3 RL;Err. Q3 LR;Cal.f.;Cal.f.LNA;Q2 corr.f. RL;Q2 corr.f. LR"));
foreach (var oraD in oraDatas)
{
writer.WriteLine(string.Format("{0}; {1}; {2}; =(\"{3}\"); {4}; {5}; {7}; {8}; {9}; {10};{11};{12};{13};{14};{15};{16};{17};{18};{19};{20};{21}",
//Console.WriteLine(string.Format("{2};=(\"{3}\"); {4};{5};{11};{12};{13};{14};{15};{16};{17};{19};{20}",
/* 0 */ oraD.PO,
/* 1 */ oraD.Prefix,
/* 2 */ oraD.SN,
/* 3 */ oraD.PcbNr,
/* 4 */ GetBenchName(oraD.TestBenchId),
/* 5 */ oraD.BatchNr,
/* 6 */ oraD.ProgramVer,
/* 7 */ oraD.Start.ToShortDateString(),
/* 8 */ oraD.Start.ToShortTimeString(),
/* 9 */ oraD.End.ToShortDateString(),
/* 10 */ oraD.End.ToShortTimeString(),
/* 11 */ oraD.WMPosition,
/* 12 */ oraD.AdjErr.ToString("F3"),
/* 13 */ oraD.Q4Err.ToString("F3"),
/* 14 */ oraD.Q3Err.ToString("F3"),
/* 15 */ oraD.Q2AdjErr.ToString("F3"),
/* 16 */ oraD.Q2Err.ToString("F3"),
/* 17 */ oraD.Q1Err.ToString("F3"),
/* 18 */ oraD.CalibFactor,
/* 19 */ oraD.HydrPruefung,
/* 20 */ oraD.Q2CorrectionRl,
/* 21 */ oraD.Q2CorrectionLr,
/* 22 */ oraD.WMTypeId,
/* 23 */ oraD.WMTypeRev));
}
#endif
}
consoleTextBox.Text += "CSV data end\r\n";
-24
View File
@@ -67,10 +67,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventViewer", "EventViewer\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csproj", "{C8939821-BA5C-4988-A3D0-BF53B74865C7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStreamInterface", "DataStreamInterface\DataStreamInterface.csproj", "{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResetBatchNr", "ResetBatchNr\ResetBatchNr.csproj", "{D7F5A111-B2DF-4761-9574-AB730DF573A6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -295,26 +291,6 @@ Global
{C8939821-BA5C-4988-A3D0-BF53B74865C7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{C8939821-BA5C-4988-A3D0-BF53B74865C7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{C8939821-BA5C-4988-A3D0-BF53B74865C7}.Release|x86.ActiveCfg = Release|Any CPU
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Debug|x86.ActiveCfg = Debug|Any CPU
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Release|Any CPU.Build.0 = Release|Any CPU
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Release|x86.ActiveCfg = Release|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|x86.ActiveCfg = Debug|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|Any CPU.Build.0 = Release|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -8,14 +8,13 @@ using log4net;
using Config.Entities;
using TBF.BenchControl;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.DataContainers.BenchInfo.iPerl
{
/// <summary>
/// Holds information identifying the test bench.
/// </summary>
public class Component : ComponentBase, GenericDevices.IBenchInfo, GenericDevices.IHasCalendarEvents
public class Component : ComponentBase, GenericDevices.IBenchInfo
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString() { return string.Format("BenchInfo.iPerl({0})", Cfg.ToString(1)); }
@@ -44,37 +43,5 @@ namespace TBF.BenchControl.DataContainers.BenchInfo.iPerl
Events.DB.SetBenchName(myCfg.TestBenchName);
log.Debug(this.ToString());
}
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
{
DateTime calibrationDue = myCfg.CalibValidDate;
IList<Config.CalendarEvent.ICalendarEvent> calendarEvents = new List<Config.CalendarEvent.ICalendarEvent>();
if (calibrationDue > TBF.UI.Constants.MinDate)
{
/// Calibration due date calendar event
calendarEvents.Add(new TBF.UI.Calendar.CalibrationDueDateEvent(calibrationDue.Date, Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat))));
if (DateTime.Now.Date <= calibrationDue.AddDays(-7))
{
/// Weekly reminders (last 5 weeks)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.Date.AddDays(-35), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
false));
}
if (DateTime.Now.Date <= calibrationDue.Date)
{
/// Daily reminders (last 5 days)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.AddDays(-5), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
true));
}
}
return calendarEvents;
}
}
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2018-2020 Sensus Slovensko a.s.
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.DataContainers.BenchInfo.iPerl
/// <summary>
/// Holds information identifying the test bench - serializable configuration.
/// </summary>
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider, TBF.BenchControl.GenericDevices.ICalibInfoCfg
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -37,27 +37,6 @@ namespace TBF.BenchControl.DataContainers.BenchInfo.iPerl
public Side Side;
public int MaxTestIndex; /// (MaxPruefindex % 100) value when to reject water meters completely if they are NOK
/// Calibration info serialized parameters displayed in Metrology tab page
string calibCertificateNr;
DateTime calibDate;
DateTime calibValidDate;
public string CalibCertificateNr
{
get { return calibCertificateNr; }
set { calibCertificateNr = value; }
}
public DateTime CalibDate
{
get { return calibDate; }
set { calibDate = value; }
}
public DateTime CalibValidDate
{
get { return calibValidDate; }
set { calibValidDate = value; }
}
/// Private parameterless constructor invoked by all other (public) constructors
ComponentCfg() {}
@@ -1,17 +1,15 @@
///
/// Copyright (c) 2019-2020 Sensus Slovensko a.s.
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using TBF.Resources;
namespace TBF.BenchControl.DataContainers.Buoyancy
{
/// <summary>
/// Holds measured (true) buoyancy value.
/// </summary>
public class Component : ComponentBase, GenericDevices.IHasCalendarEvents
public class Component : ComponentBase
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString() { return string.Format("{0}({1})", this.GetType().Namespace.Substring(32), Cfg.ToString(1)); }
@@ -37,36 +35,5 @@ namespace TBF.BenchControl.DataContainers.Buoyancy
log.Debug(this.ToString());
}
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
{
DateTime calibrationDue = myCfg.CalibValidDate;
IList<Config.CalendarEvent.ICalendarEvent> calendarEvents = new List<Config.CalendarEvent.ICalendarEvent>();
if (calibrationDue > TBF.UI.Constants.MinDate)
{
/// Calibration due date calendar event
calendarEvents.Add(new TBF.UI.Calendar.CalibrationDueDateEvent(calibrationDue.Date, Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat))));
if (DateTime.Now.Date <= calibrationDue.AddDays(-7))
{
/// Weekly reminders (last 5 weeks)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.Date.AddDays(-35), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
false));
}
if (DateTime.Now.Date <= calibrationDue.Date)
{
/// Daily reminders (last 5 days)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.AddDays(-5), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
true));
}
}
return calendarEvents;
}
}
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2019-2020 Sensus Slovensko a.s.
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.DataContainers.Buoyancy
/// <summary>
/// Holds backup and security options - serializable configuration.
/// </summary>
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider, TBF.BenchControl.GenericDevices.ICalibInfoCfg
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -24,27 +24,6 @@ namespace TBF.BenchControl.DataContainers.Buoyancy
///
public double Buoyancy;
/// Calibration info serialized parameters displayed in Metrology tab page
string calibCertificateNr;
DateTime calibDate;
DateTime calibValidDate;
public string CalibCertificateNr
{
get { return calibCertificateNr; }
set { calibCertificateNr = value; }
}
public DateTime CalibDate
{
get { return calibDate; }
set { calibDate = value; }
}
public DateTime CalibValidDate
{
get { return calibValidDate; }
set { calibValidDate = value; }
}
/// Private parameterless constructor invoked by all other (public) constructors
ComponentCfg() {}
@@ -1,17 +1,15 @@
///
/// Copyright (c) 2019-2020 Sensus Slovensko a.s.
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using TBF.Resources;
namespace TBF.BenchControl.DataContainers.Density
{
/// <summary>
/// Holds measured (true) density value.
/// </summary>
public class Component : ComponentBase, GenericDevices.IHasCalendarEvents
public class Component : ComponentBase
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString() { return string.Format("{0}({1})", this.GetType().Namespace.Substring(32), Cfg.ToString(1)); }
@@ -40,36 +38,5 @@ namespace TBF.BenchControl.DataContainers.Density
log.Debug(this.ToString());
}
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
{
DateTime calibrationDue = myCfg.CalibValidDate;
IList<Config.CalendarEvent.ICalendarEvent> calendarEvents = new List<Config.CalendarEvent.ICalendarEvent>();
if (calibrationDue > TBF.UI.Constants.MinDate)
{
/// Calibration due date calendar event
calendarEvents.Add(new TBF.UI.Calendar.CalibrationDueDateEvent(calibrationDue.Date, Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat))));
if (DateTime.Now.Date <= calibrationDue.AddDays(-7))
{
/// Weekly reminders (last 5 weeks)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.Date.AddDays(-35), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
false));
}
if (DateTime.Now.Date <= calibrationDue.Date)
{
/// Daily reminders (last 5 days)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.AddDays(-5), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
true));
}
}
return calendarEvents;
}
}
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2019-2020 Sensus Slovensko a.s.
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.DataContainers.Density
/// <summary>
/// Holds backup and security options - serializable configuration.
/// </summary>
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider, TBF.BenchControl.GenericDevices.ICalibInfoCfg
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -25,27 +25,6 @@ namespace TBF.BenchControl.DataContainers.Density
public double RealDensity;
public double AtTemperature;
/// Calibration info serialized parameters displayed in Metrology tab page
string calibCertificateNr;
DateTime calibDate;
DateTime calibValidDate;
public string CalibCertificateNr
{
get { return calibCertificateNr; }
set { calibCertificateNr = value; }
}
public DateTime CalibDate
{
get { return calibDate; }
set { calibDate = value; }
}
public DateTime CalibValidDate
{
get { return calibValidDate; }
set { calibValidDate = value; }
}
/// Private parameterless constructor invoked by all other (public) constructors
ComponentCfg() {}
@@ -1,75 +0,0 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using Config.Entities;
using TBF.BenchControl.GenericDevices;
using TBF.Resources;
namespace TBF.BenchControl.DataContainers.Evaporation
{
public class Component : ComponentBase, IEvaporation, GenericDevices.IHasCalendarEvents
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString()
{
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1));
}
readonly EvaporationCfg myCfg;
/// <summary>
/// For a given temperature in [°C] returns an evaporation rate in [kg/s]
/// </summary>
public double EvaporationRate(double temperature)
{
return Config.Formulas.GetCorrection(temperature, Corrections) / 3600.0; /// Converted from kg/h to kg/s
}
public Component()
{
}
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
myCfg = cfg as EvaporationCfg;
log.Debug(this.ToString());
}
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
{
DateTime calibrationDue = myCfg.CalibValidDate;
IList<Config.CalendarEvent.ICalendarEvent> calendarEvents = new List<Config.CalendarEvent.ICalendarEvent>();
if (calibrationDue > TBF.UI.Constants.MinDate)
{
/// Calibration due date calendar event
calendarEvents.Add(new TBF.UI.Calendar.CalibrationDueDateEvent(calibrationDue.Date, Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat))));
if (DateTime.Now.Date <= calibrationDue.AddDays(-7))
{
/// Weekly reminders (last 5 weeks)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.Date.AddDays(-35), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
false));
}
if (DateTime.Now.Date <= calibrationDue.Date)
{
/// Daily reminders (last 5 days)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.AddDays(-5), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
true));
}
}
return calendarEvents;
}
}
}
@@ -1,58 +0,0 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataContainers.Evaporation
{
/// <summary>
/// Holds backup and security options - serializable configuration.
/// </summary>
public class EvaporationCfg : ComponentCfgBase, Generic.IComponentCfg, TBF.BenchControl.GenericDevices.ICalibInfoCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EvaporationCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new EvaporationCfgCtrl(); }
/// Calibration info serialized parameters displayed in Metrology tab page
string calibCertificateNr;
DateTime calibDate;
DateTime calibValidDate;
public string CalibCertificateNr
{
get { return calibCertificateNr; }
set { calibCertificateNr = value; }
}
public DateTime CalibDate
{
get { return calibDate; }
set { calibDate = value; }
}
public DateTime CalibValidDate
{
get { return calibValidDate; }
set { calibValidDate = value; }
}
/// Private parameterless constructor invoked by all other (public) constructors
EvaporationCfg() {}
public EvaporationCfg(string name, IComponentFactory factory)
: this()
{
Name = name;
Factory = factory;
ParentName = string.Empty;
}
public string ToString(int i)
{
return Name;
}
}
}
@@ -1,69 +0,0 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataContainers.Evaporation
{
public partial class EvaporationCfgCtrl : UserControl, IComponentCfgCtrl
{
public bool ShowMore { get { return false; } }
EvaporationCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as EvaporationCfg;
Redraw();
}
}
public EvaporationCfgCtrl()
{
InitializeComponent();
}
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
{
Redraw();
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
}
public void Unlock()
{
nameTextBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
config.Name = nameTextBox.Text;
return flags;
}
}
}
@@ -1,86 +0,0 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
namespace TBF.BenchControl.DataContainers.Evaporation
{
partial class EvaporationCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(137, 57);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
this.nameTextBox.TabIndex = 5;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(27, 60);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 4;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(134, 33);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 3;
this.classNameLabel.Text = "ComonentName";
//
// BasicPrinterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "BasicPrinterCfgCtrl";
this.Size = new System.Drawing.Size(300, 200);
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
}
}
@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+2 -1
View File
@@ -40,8 +40,9 @@ namespace TBF.BenchControl.Dummy.Balance
public float BuoyancyPress { get { return 1.013f; } }
public float BuoyancyHumi { get { return 50.0f; } }
public IOperation ZeroOp()
public IOperation TaringOp(ref Boxes.DoubleBox tara)
{
tara.Val = 0;
return this;
}
+2 -2
View File
@@ -110,11 +110,11 @@ namespace TBF.BenchControl.Elde
public byte MeretProtocol = 0;
// Array length is the reference flowmeters count plus one
#if DN100 || FUZHOU_150 || FUZHOU_300 || IZRAEL_200 || SENTEC || CEVAK_200
#if DN100 || FUZHOU_150 || FUZHOU_300 || IZRAEL_200 || SLM_150 || SENTEC || CEVAK_200
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[6] { 1, 1, 1, 1, 1, 1 };
#elif PUCHONG_200 || GENESIS || BERLIN || GELSENWASSER || PETERSBURG_200 || RUM_MOB || SLM_150
#elif PUCHONG_200 || GENESIS || BERLIN || GELSENWASSER || PETERSBURG_200 || RUM_MOB
public uint[,] RegValveCalib = new uint[16, 2] { {100,500}, {100,500}, {100,500}, {100,500}, {100,500}, {100,500}, {100,500}, {100,500},
{100,500}, {100,500}, {100,500}, {100,500}, {100,500}, {100,500}, {100,500}, {100,500} };
public byte[] MeretRS485Address = new byte[4];
+66 -102
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -11,7 +11,7 @@ using TBF.Resources;
namespace TBF.BenchControl.Elde.Diverter
{
public class Diverter : ComponentBase, IDevice, GenericDevices.IDiverter, GenericDevices.ISequenceCondition, GenericDevices.IHasCalendarEvents
public class Diverter : ComponentBase, IDevice, GenericDevices.IDiverter, GenericDevices.ISequenceCondition
{
private static readonly ILog log = LogManager.GetLogger(typeof(Diverter));
public override string ToString() { return string.Format("Diverter({0})", Cfg.ToString(1)); }
@@ -69,121 +69,85 @@ namespace TBF.BenchControl.Elde.Diverter
{
diverterCfg = cfg as DiverterCfg;
if (cfg.DebugLevel != Config.Entities.DebugMode.Off)
controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
if (diverterCfg.BitPosition < 0 || diverterCfg.BitPosition >= 64) throw new ArgumentOutOfRangeException("position");
this.mask = (((UInt128)1) << diverterCfg.BitPosition);
switchTimeStart = new FloatBox(diverterCfg.DfltSwithTimeStartMs / 1000.0f);
switchTimeEnd = new FloatBox(diverterCfg.DfltSwithTimeEndMs / 1000.0f);
diverterNr0 = nextIdx++;
///
if (Diverters == null || Diverters.Length < nextIdx)
{
GenericDevices.IDiverter[] divertersSoFar = Diverters;
Diverters = new GenericDevices.IDiverter[nextIdx];
if (divertersSoFar != null)
{
for (int i = 0; i < divertersSoFar.Length; i++) Diverters[i] = divertersSoFar[i];
}
Diverters[nextIdx - 1] = this;
}
/// Prepare arguments of SendCalibData()
if (diverterCfg.AdcNr >= 0 && diverterCfg.AdcNr < controlBoard.RegValveCalib.GetLength(0))
{
controlBoard.RegValveCalib[diverterCfg.AdcNr, 0] = (uint)diverterCfg.AdcValueToSink;
controlBoard.RegValveCalib[diverterCfg.AdcNr, 1] = (uint)diverterCfg.AdcValueToTank;
}
else
{
log.ErrorFormat("Unable to set {0} ADC levels: RegValveCalib array size={1}, diverter AdcNr={2}",
Name, controlBoard.RegValveCalib.GetLength(0), diverterCfg.AdcNr);
}
int divNrFromName;
if (!int.TryParse(Name.Substring(3), out divNrFromName))
{
controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
if (diverterCfg.BitPosition < 0 || diverterCfg.BitPosition >= 64) throw new ArgumentOutOfRangeException("position");
this.mask = (((UInt128)1) << diverterCfg.BitPosition);
switchTimeStart = new FloatBox(diverterCfg.DfltSwithTimeStartMs / 1000.0f);
switchTimeEnd = new FloatBox(diverterCfg.DfltSwithTimeEndMs / 1000.0f);
diverterNr0 = nextIdx++;
///
if (Diverters == null || Diverters.Length < nextIdx)
{
GenericDevices.IDiverter[] divertersSoFar = Diverters;
Diverters = new GenericDevices.IDiverter[nextIdx];
if (divertersSoFar != null)
{
for (int i = 0; i < divertersSoFar.Length; i++) Diverters[i] = divertersSoFar[i];
}
Diverters[nextIdx - 1] = this;
}
/// Prepare arguments of SendCalibData()
if (diverterCfg.AdcNr >= 0 && diverterCfg.AdcNr < controlBoard.RegValveCalib.GetLength(0))
{
controlBoard.RegValveCalib[diverterCfg.AdcNr, 0] = (uint)diverterCfg.AdcValueToSink;
controlBoard.RegValveCalib[diverterCfg.AdcNr, 1] = (uint)diverterCfg.AdcValueToTank;
}
else
{
log.ErrorFormat("Unable to set {0} ADC levels: RegValveCalib array size={1}, diverter AdcNr={2}",
Name, controlBoard.RegValveCalib.GetLength(0), diverterCfg.AdcNr);
}
int divNrFromName;
if (!int.TryParse(Name.Substring(3), out divNrFromName))
{
divNrFromName = nextIdx;
}
#if GENESIS || PETERSBURG_50 || PETERSBURG_200 || FUZHOU_50 || FUZHOU_150 || FUZHOU_300 || ROMA_200 || SLM_150
flowMtrNr4Cmd = divNrFromName + 1;
divNrFromName = nextIdx;
}
#if GENESIS || PETERSBURG_50 || PETERSBURG_200 || FUZHOU_50 || FUZHOU_150 || FUZHOU_300 || ROMA_200
flowMtrNr4Cmd = divNrFromName + 1;
#elif BADGER_STREDNA_TRAT
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : ((divNrFromName == 2) ? 9 : 20);
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : ((divNrFromName == 2) ? 9 : 20);
#elif BADGER_VELKA_TRAT
flowMtrNr4Cmd = ((divNrFromName % 10) == 1) ? 0x11 : (((divNrFromName % 10) == 2) ? 0x22 : 0x33);
flowMtrNr4Cmd = ((divNrFromName % 10) == 1) ? 0x11 : (((divNrFromName % 10) == 2) ? 0x22 : 0x33);
#elif FUZHOU_100
flowMtrNr4Cmd = divNrFromName;
flowMtrNr4Cmd = divNrFromName;
#elif CEVAK_200
flowMtrNr4Cmd = (divNrFromName == 4) ? 5 : divNrFromName;
flowMtrNr4Cmd = (divNrFromName == 4) ? 5 : divNrFromName;
#elif DEWA_300 || PUCHONG_200
flowMtrNr4Cmd = divNrFromName + 2; /// Div1: 1,2,3, Div2: 4, Div3: 5, Div4: 6, Div5: 7
flowMtrNr4Cmd = divNrFromName + 2; /// Div1: 1,2,3, Div2: 4, Div3: 5, Div4: 6, Div5: 7
#elif TURA_IPERL || TURA_IPERL_NEW
flowMtrNr4Cmd = divNrFromName + 16 * divNrFromName;
flowMtrNr4Cmd = divNrFromName + 16 * divNrFromName;
#elif FILIPINY_50
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : 7;
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : 7;
#elif GELSENWASSER
switch (divNrFromName)
{
default:
case 1: flowMtrNr4Cmd = 1; break;
case 2: flowMtrNr4Cmd = 0x12; break;
case 3: flowMtrNr4Cmd = 3; break;
case 4: flowMtrNr4Cmd = 5; break;
}
switch (divNrFromName)
{
default:
case 1: flowMtrNr4Cmd = 1; break;
case 2: flowMtrNr4Cmd = 0x12; break;
case 3: flowMtrNr4Cmd = 3; break;
case 4: flowMtrNr4Cmd = 5; break;
}
#else
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : 3;
#endif
diverterToTankOp = new SwitchDiverterOp(controlBoard, true, flowMtrNr4Cmd);
diverterToSinkOp = new SwitchDiverterOp(controlBoard, false, flowMtrNr4Cmd);
diverterToTankOp = new SwitchDiverterOp(controlBoard, true, flowMtrNr4Cmd);
diverterToSinkOp = new SwitchDiverterOp(controlBoard, false, flowMtrNr4Cmd);
log.Debug(this.ToString());
}
log.Debug(this.ToString());
}
///
/// Calendar support
///
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
{
DateTime calibrationDue = diverterCfg.CalibValidDate;
IList<Config.CalendarEvent.ICalendarEvent> calendarEvents = new List<Config.CalendarEvent.ICalendarEvent>();
if (calibrationDue > TBF.UI.Constants.MinDate)
{
/// Calibration due date calendar event
calendarEvents.Add(new TBF.UI.Calendar.CalibrationDueDateEvent(calibrationDue.Date, Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat))));
if (DateTime.Now.Date <= calibrationDue.AddDays(-7))
{
/// Weekly reminders (last 5 weeks)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.Date.AddDays(-35), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
false));
}
if (DateTime.Now.Date <= calibrationDue.Date)
{
/// Daily reminders (last 5 days)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.AddDays(-5), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
true));
}
}
return calendarEvents;
}
///
/// IDevice interface implementation
+1 -1
View File
@@ -87,7 +87,7 @@ namespace TBF.BenchControl.Elde.FlowMeter
DateTime calibrationDue = flowMeterCfg.CalibValidDate;
IList<Config.CalendarEvent.ICalendarEvent> calendarEvents = new List<Config.CalendarEvent.ICalendarEvent>();
if (calibrationDue > TBF.UI.Constants.MinDate)
if (calibrationDue > DateTime.MinValue.AddDays(36))
{
/// Calibration due date calendar event
calendarEvents.Add(new TBF.UI.Calendar.CalibrationDueDateEvent(calibrationDue.Date, Name,
@@ -1,16 +1,15 @@
///
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using log4net;
using TBF.BenchControl.Generic;
using TBF.Boxes;
using TBF.Resources;
namespace TBF.BenchControl.Elde.PressureMeter
{
public class PressureMeter : ComponentBase, GenericDevices.IPressureMeter, GenericDevices.IHasCalendarEvents
public class PressureMeter : ComponentBase, GenericDevices.IPressureMeter
{
private static readonly ILog log = LogManager.GetLogger(typeof(PressureMeter));
public override string ToString() { return string.Format("PressureMeter({0})", Cfg.ToString(1)); }
@@ -53,38 +52,6 @@ namespace TBF.BenchControl.Elde.PressureMeter
}
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
{
DateTime calibrationDue = pressureMeterCfg.CalibValidDate;
IList<Config.CalendarEvent.ICalendarEvent> calendarEvents = new List<Config.CalendarEvent.ICalendarEvent>();
if (calibrationDue > TBF.UI.Constants.MinDate)
{
/// Calibration due date calendar event
calendarEvents.Add(new TBF.UI.Calendar.CalibrationDueDateEvent(calibrationDue.Date, Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat))));
if (DateTime.Now.Date <= calibrationDue.AddDays(-7))
{
/// Weekly reminders (last 5 weeks)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.Date.AddDays(-35), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
false));
}
if (DateTime.Now.Date <= calibrationDue.Date)
{
/// Daily reminders (last 5 days)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.AddDays(-5), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
true));
}
}
return calendarEvents;
}
/// <summary>
/// Returns the water pressure
/// </summary>
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
/// Copyright (c) 2013-2018 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -10,7 +10,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.PressureMeter
{
public class PressureMeterCfg : ComponentCfgBase, IChildComponentCfg, TBF.BenchControl.GenericDevices.ICalibInfoCfg
public class PressureMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PressureMeterCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -24,26 +24,6 @@ namespace TBF.BenchControl.Elde.PressureMeter
public MeretProtocol Protocol; /// Meret or Modbus
public byte RS485Address; /// 0..255
/// Calibration info serialized parameters displayed in Metrology tab page
string calibCertificateNr;
DateTime calibDate;
DateTime calibValidDate;
public string CalibCertificateNr
{
get { return calibCertificateNr; }
set { calibCertificateNr = value; }
}
public DateTime CalibDate
{
get { return calibDate; }
set { calibDate = value; }
}
public DateTime CalibValidDate
{
get { return calibValidDate; }
set { calibValidDate = value; }
}
/// Private parameterless constructor invoked by all other (public) constructors
PressureMeterCfg()
{
@@ -7,11 +7,10 @@ using System.Collections.Generic;
using log4net;
using TBF.BenchControl.Generic;
using TBF.Boxes;
using TBF.Resources;
namespace TBF.BenchControl.Elde.PressureMeterInternal
{
public class PressureMeter : ComponentBase, GenericDevices.IPressureMeter, GenericDevices.IHasCalendarEvents
public class PressureMeter : ComponentBase, GenericDevices.IPressureMeter
{
private static readonly ILog log = LogManager.GetLogger(typeof(PressureMeter));
public override string ToString() { return string.Format("PressureMeter({0})", Cfg.ToString(1)); }
@@ -45,39 +44,6 @@ namespace TBF.BenchControl.Elde.PressureMeterInternal
log.Debug(this.ToString());
}
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
{
DateTime calibrationDue = pressureMeterCfg.CalibValidDate;
IList<Config.CalendarEvent.ICalendarEvent> calendarEvents = new List<Config.CalendarEvent.ICalendarEvent>();
if (calibrationDue > TBF.UI.Constants.MinDate)
{
/// Calibration due date calendar event
calendarEvents.Add(new TBF.UI.Calendar.CalibrationDueDateEvent(calibrationDue.Date, Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat))));
if (DateTime.Now.Date <= calibrationDue.AddDays(-7))
{
/// Weekly reminders (last 5 weeks)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.Date.AddDays(-35), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
false));
}
if (DateTime.Now.Date <= calibrationDue.Date)
{
/// Daily reminders (last 5 days)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.AddDays(-5), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
true));
}
}
return calendarEvents;
}
/// <summary>
/// Events: PressureDone, Error
/// </summary>
@@ -9,7 +9,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.PressureMeterInternal
{
public class PressureMeterCfg : ComponentCfgBase, IChildComponentCfg, TBF.BenchControl.GenericDevices.ICalibInfoCfg
public class PressureMeterCfg : ComponentCfgBase, IChildComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PressureMeterCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -27,26 +27,6 @@ namespace TBF.BenchControl.Elde.PressureMeterInternal
public float A4;
public float A5;
/// Calibration info serialized parameters displayed in Metrology tab page
string calibCertificateNr;
DateTime calibDate;
DateTime calibValidDate;
public string CalibCertificateNr
{
get { return calibCertificateNr; }
set { calibCertificateNr = value; }
}
public DateTime CalibDate
{
get { return calibDate; }
set { calibDate = value; }
}
public DateTime CalibValidDate
{
get { return calibValidDate; }
set { calibValidDate = value; }
}
/// Private parameterless constructor invoked by all other (public) constructors
PressureMeterCfg()
{
+2 -35
View File
@@ -1,16 +1,15 @@
///
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using log4net;
using TBF.BenchControl.Generic;
using TBF.Boxes;
using TBF.Resources;
namespace TBF.BenchControl.Elde.TempMeter
{
public class TempMeter : ComponentBase, GenericDevices.ITempMeter, GenericDevices.IHasCalendarEvents
public class TempMeter : ComponentBase, GenericDevices.ITempMeter
{
private static readonly ILog log = LogManager.GetLogger(typeof(TempMeter));
public override string ToString() { return string.Format("TempMeter({0})", Cfg.ToString(1)); }
@@ -48,38 +47,6 @@ namespace TBF.BenchControl.Elde.TempMeter
log.Debug(this.ToString());
}
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
{
DateTime calibrationDue = tempMtrCfg.CalibValidDate;
IList<Config.CalendarEvent.ICalendarEvent> calendarEvents = new List<Config.CalendarEvent.ICalendarEvent>();
if (calibrationDue > TBF.UI.Constants.MinDate)
{
/// Calibration due date calendar event
calendarEvents.Add(new TBF.UI.Calendar.CalibrationDueDateEvent(calibrationDue.Date, Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat))));
if (DateTime.Now.Date <= calibrationDue.AddDays(-7))
{
/// Weekly reminders (last 5 weeks)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.Date.AddDays(-35), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
false));
}
if (DateTime.Now.Date <= calibrationDue.Date)
{
/// Daily reminders (last 5 days)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.AddDays(-5), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
true));
}
}
return calendarEvents;
}
public double ReadTemperature()
{
if (Cfg.DebugLevel == Config.Entities.DebugMode.Normal)
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -9,7 +9,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.TempMeter
{
public class TempMeterCfg : ComponentCfgBase, IChildComponentCfg, TBF.BenchControl.GenericDevices.ICalibInfoCfg
public class TempMeterCfg : ComponentCfgBase, IChildComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TempMeterCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -27,26 +27,6 @@ namespace TBF.BenchControl.Elde.TempMeter
public double A5;
public double DefaultTemperature;
/// Calibration info serialized parameters displayed in Metrology tab page
string calibCertificateNr;
DateTime calibDate;
DateTime calibValidDate;
public string CalibCertificateNr
{
get { return calibCertificateNr; }
set { calibCertificateNr = value; }
}
public DateTime CalibDate
{
get { return calibDate; }
set { calibDate = value; }
}
public DateTime CalibValidDate
{
get { return calibValidDate; }
set { calibValidDate = value; }
}
/// Private parameterless constructor invoked by all other (public) constructors
TempMeterCfg()
{
@@ -6,11 +6,10 @@ using System.Collections.Generic;
using log4net;
using TBF.BenchControl.Generic;
using TBF.Boxes;
using TBF.Resources;
namespace TBF.BenchControl.Elde.TempMeterInternal
{
public class TempMeter : ComponentBase, GenericDevices.ITempMeter, GenericDevices.IHasCalendarEvents
public class TempMeter : ComponentBase, GenericDevices.ITempMeter
{
private static readonly ILog log = LogManager.GetLogger(typeof(TempMeter));
public override string ToString() { return string.Format("TempMeter({0})", Cfg.ToString(1)); }
@@ -43,39 +42,6 @@ namespace TBF.BenchControl.Elde.TempMeterInternal
log.Debug(this.ToString());
}
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
{
DateTime calibrationDue = tempMtrCfg.CalibValidDate;
IList<Config.CalendarEvent.ICalendarEvent> calendarEvents = new List<Config.CalendarEvent.ICalendarEvent>();
if (calibrationDue > TBF.UI.Constants.MinDate)
{
/// Calibration due date calendar event
calendarEvents.Add(new TBF.UI.Calendar.CalibrationDueDateEvent(calibrationDue.Date, Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat))));
if (DateTime.Now.Date <= calibrationDue.AddDays(-7))
{
/// Weekly reminders (last 5 weeks)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.Date.AddDays(-35), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
false));
}
if (DateTime.Now.Date <= calibrationDue.Date)
{
/// Daily reminders (last 5 days)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.AddDays(-5), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
true));
}
}
return calendarEvents;
}
public double ReadTemperature()
{
return Config.Formulas.CorrectedValue((double)ControlBoard.Temperature(Idx0), Corrections);
@@ -10,7 +10,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.TempMeterInternal
{
public class TempMeterCfg : ComponentCfgBase, IChildComponentCfg, TBF.BenchControl.GenericDevices.ICalibInfoCfg
public class TempMeterCfg : ComponentCfgBase, IChildComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TempMeterCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -28,27 +28,6 @@ namespace TBF.BenchControl.Elde.TempMeterInternal
public float A4;
public float A5;
/// Calibration info serialized parameters displayed in Metrology tab page
string calibCertificateNr;
DateTime calibDate;
DateTime calibValidDate;
public string CalibCertificateNr
{
get { return calibCertificateNr; }
set { calibCertificateNr = value; }
}
public DateTime CalibDate
{
get { return calibDate; }
set { calibDate = value; }
}
public DateTime CalibValidDate
{
get { return calibValidDate; }
set { calibValidDate = value; }
}
/// Private parameterless constructor invoked by all other (public) constructors
TempMeterCfg()
{
@@ -5,11 +5,10 @@ using System;
using System.Collections.Generic;
using log4net;
using TBF.Boxes;
using TBF.Resources;
namespace TBF.BenchControl.Elde.TempMeterMeret
{
public class TempMeter : ComponentBase, GenericDevices.ITempMeter, GenericDevices.IHasCalendarEvents
public class TempMeter : ComponentBase, GenericDevices.ITempMeter
{
private static readonly ILog log = LogManager.GetLogger(typeof(TempMeter));
public override string ToString() { return string.Format("TempMeter({0})", Cfg.ToString(1)); }
@@ -34,39 +33,6 @@ namespace TBF.BenchControl.Elde.TempMeterMeret
log.Debug(this.ToString());
}
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
{
DateTime calibrationDue = tempMtrCfg.CalibValidDate;
IList<Config.CalendarEvent.ICalendarEvent> calendarEvents = new List<Config.CalendarEvent.ICalendarEvent>();
if (calibrationDue > TBF.UI.Constants.MinDate)
{
/// Calibration due date calendar event
calendarEvents.Add(new TBF.UI.Calendar.CalibrationDueDateEvent(calibrationDue.Date, Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat))));
if (DateTime.Now.Date <= calibrationDue.AddDays(-7))
{
/// Weekly reminders (last 5 weeks)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.Date.AddDays(-35), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
false));
}
if (DateTime.Now.Date <= calibrationDue.Date)
{
/// Daily reminders (last 5 days)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.AddDays(-5), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
true));
}
}
return calendarEvents;
}
public double ReadTemperature()
{
return Config.Formulas.CorrectedValue((double)ControlBoard.Temperature(tempMtrCfg.TempIdx0), Corrections);
@@ -10,7 +10,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.TempMeterMeret
{
public class TempMeterCfg : ComponentCfgBase, IChildComponentCfg, Config.Entities.IParamsProvider, TBF.BenchControl.GenericDevices.ICalibInfoCfg
public class TempMeterCfg : ComponentCfgBase, IChildComponentCfg, Config.Entities.IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TempMeterCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -41,27 +41,6 @@ namespace TBF.BenchControl.Elde.TempMeterMeret
public byte ModbusAddress; /// 1..247
public int MeretIdx0; /// Meter pressure meters count .. (Meter pressure meters count + Meter temperature meters count - 1)
/// Calibration info serialized parameters displayed in Metrology tab page
string calibCertificateNr;
DateTime calibDate;
DateTime calibValidDate;
public string CalibCertificateNr
{
get { return calibCertificateNr; }
set { calibCertificateNr = value; }
}
public DateTime CalibDate
{
get { return calibDate; }
set { calibDate = value; }
}
public DateTime CalibValidDate
{
get { return calibValidDate; }
set { calibValidDate = value; }
}
/// Private parameterless constructor invoked by all other (public) constructors
TempMeterCfg()
{
+1 -4
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
namespace TBF.BenchControl
{
@@ -95,7 +95,6 @@ namespace TBF.BenchControl
TempOutDone,
TempDivDone,
LevelDone,
ConductivityDone,
VolumeDone,
FlowMeasurementDone,
FlowReached,
@@ -155,8 +154,6 @@ namespace TBF.BenchControl
ResultsProcessed, /// Event triggers
ErrorProcessingResults,
StatisticsProcessed, /// Statistics monitoring (Event triggers)
/// Timer events
TimerExpired,
+4 -3
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using TBF.Boxes;
@@ -17,8 +17,9 @@ namespace TBF.BenchControl.GenericDevices
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <returns>ZeroOp instance reference casted to IOperaton</returns>
IOperation ZeroOp();
/// <param name="result">Reference to a variable for 'tara' in kg</param>
/// <returns>TaringOp instance reference casted to IOperaton</returns>
IOperation TaringOp(ref DoubleBox tara);
/// <summary>
/// Events: BalanceDone, Error
@@ -1,21 +0,0 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using Results.Entities;
namespace TBF.BenchControl.GenericDevices
{
public interface IStatisticsMonitoring : IComponent
{
/// <summary>
/// Process recent results and monitor obtained statistics
/// (failure rates of hardware components, etc.)
/// </summary>
/// <param name="lastBatchNr">Number of the last saved batch</param>
/// <returns>Reference to the operation</returns>
IOperation ProcessStatisticsOp(int lastBatchNr);
}
}
+1 -36
View File
@@ -9,14 +9,13 @@ using TBF.BenchControl.Generic;
using TBF.BenchControl.GenericDevices;
using TBF.Boxes;
using TBF.BenchControl.Hart.Common;
using TBF.Resources;
namespace TBF.BenchControl.Hart.Nivotrack
{
/// <summary>
/// Root component for Modbus communication via serial port (RS485)
/// </summary>
public class Nivotrack : ComponentBase, IDevice, ILevelMeter, IOperation, GenericDevices.IHasCalendarEvents
public class Nivotrack : ComponentBase, IDevice, ILevelMeter, IOperation
{
const int StableReadingsCount = 9;
@@ -72,40 +71,6 @@ namespace TBF.BenchControl.Hart.Nivotrack
log.Debug(this.ToString());
}
///
/// Calendar support
///
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
{
DateTime calibrationDue = nivotrackCfg.CalibValidDate;
IList<Config.CalendarEvent.ICalendarEvent> calendarEvents = new List<Config.CalendarEvent.ICalendarEvent>();
if (calibrationDue > TBF.UI.Constants.MinDate)
{
/// Calibration due date calendar event
calendarEvents.Add(new TBF.UI.Calendar.CalibrationDueDateEvent(calibrationDue.Date, Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat))));
if (DateTime.Now.Date <= calibrationDue.AddDays(-7))
{
/// Weekly reminders (last 5 weeks)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.Date.AddDays(-35), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
false));
}
if (DateTime.Now.Date <= calibrationDue.Date)
{
/// Daily reminders (last 5 days)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.AddDays(-5), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
true));
}
}
return calendarEvents;
}
public void Initialize()
{
if (nivotrackCfg.DebugLevel == DebugMode.Simulate) return;
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016-2020 Sensus Metering Systems
/// Copyright (c) 2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -7,11 +7,10 @@ using Config;
using log4net;
using TBF.Boxes;
using TBF.BenchControl.Keithley.Multimeter_2010_RS232;
using TBF.Resources;
namespace TBF.BenchControl.Keithley.TempMeter
{
public class TempMeter : ComponentBase, GenericDevices.ITempMeter, GenericDevices.IHasCalendarEvents
public class TempMeter : ComponentBase, GenericDevices.ITempMeter
{
private static readonly ILog log = LogManager.GetLogger(typeof(TempMeter));
public override string ToString() { return string.Format("Keithley.TempMeter({0})", Cfg.ToString(1)); }
@@ -46,40 +45,6 @@ namespace TBF.BenchControl.Keithley.TempMeter
log.Debug(this.ToString());
}
///
/// Calendar support
///
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
{
DateTime calibrationDue = tempMtrCfg.CalibValidDate;
IList<Config.CalendarEvent.ICalendarEvent> calendarEvents = new List<Config.CalendarEvent.ICalendarEvent>();
if (calibrationDue > TBF.UI.Constants.MinDate)
{
/// Calibration due date calendar event
calendarEvents.Add(new TBF.UI.Calendar.CalibrationDueDateEvent(calibrationDue.Date, Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat))));
if (DateTime.Now.Date <= calibrationDue.AddDays(-7))
{
/// Weekly reminders (last 5 weeks)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.Date.AddDays(-35), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
false));
}
if (DateTime.Now.Date <= calibrationDue.Date)
{
/// Daily reminders (last 5 days)
calendarEvents.Add(new TBF.UI.Calendar.CalibrationReminderEvent(calibrationDue.AddDays(-5), Name,
string.Format(Strings.Calibration_due_date_is_0,
calibrationDue.Date.ToString(TBF.UI.Constants.DateFormat)),
true));
}
}
return calendarEvents;
}
public double ReadTemperature()
{
double resistance = Multimeter.ReadResistance(tempMtrCfg.Channel);
@@ -197,7 +197,7 @@ namespace TBF.BenchControl.MettlerToledo.Multi
{
if (balanceCfg.DebugLevel == DebugMode.Simulate)
{
Masses[balanceNr] = 123.456;
Masses[balanceNr] = TestBenchSim.GetSimMass(balanceNr);
msrmntState = MsrmntState.Valid;
msrmntTimeStamp = StateMachine.Time;
return;
@@ -297,25 +297,15 @@ namespace TBF.BenchControl.MettlerToledo.Multi
public void StopDevice2() { }
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <returns>ZeroOp reference</returns>
public IOperation ZeroOp()
{
return new ZeroOp(this);
}
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <param name="result">Reference to a variable for 'tara' in kg</param>
/// <returns>TaringOp reference</returns>
/// <param name="result">Reference to a variable for 'tara' in kg</param>
/// <returns>TaringOp instance reference casted to IOperaton</returns>
public IOperation TaringOp(ref DoubleBox tara)
{
return new TaringOp(this, ref tara);
}
{
return new TaringOp(this, ref tara);
}
/// <summary>
/// Events: BalanceDone, Error
@@ -1,68 +0,0 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using log4net;
namespace TBF.BenchControl.MettlerToledo.Multi
{
public class ZeroOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ZeroOp));
public override string ToString() { return string.Format("ZeroOp(.,.)"); }
bool done;
/// Set by the constructor
BalanceDev balanceDev;
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <param name="balanceDev">Balance device instance</param>
public ZeroOp(BalanceDev balanceDev)
{
if (balanceDev == null) throw new ArgumentNullException("balanceDev");
this.balanceDev = balanceDev;
log.Debug(this.ToString());
}
/// <summary>Start this operation</summary>
public void Start()
{
done = true;
}
/// <summary>Run this operation</summary>
/// <returns>
/// Event.None
/// Event.BalanceDone
/// Event.Error . . . . . Current.Tick == null
/// </returns>
public Event Run()
{
if (done) return Event.BalanceDone; /// Zero has been done already
if (balanceDev.MsrmntState == MsrmntState.Busy) return Event.Busy;
if (balanceDev.MsrmntState == MsrmntState.Overload)
{
done = true;
return Event.BalanceOverload;
}
if (balanceDev.MsrmntState == MsrmntState.Valid)
{
done = true;
return Event.BalanceDone; /// Zero completed
}
return Event.Busy;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}
@@ -108,7 +108,7 @@ namespace TBF.BenchControl.MettlerToledo.Standard
{
drainValveComboBox.Items.Add(cmpnt.Name);
}
else if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is DataContainers.Evaporation.Factory)
else if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Various.Evaporation.Factory)
{
evaporationComboBox.Items.Add(cmpnt.Name);
}
@@ -78,8 +78,9 @@ namespace TBF.BenchControl.MettlerToledo.Standard
public string Format { get { return balanceCfg.Format; } }
public BalanceDev() { }
public BalanceDev()
{
}
/// <summary>
/// Constructor
@@ -134,7 +135,7 @@ namespace TBF.BenchControl.MettlerToledo.Standard
DateTime calibrationDue = balanceCfg.CalibValidDate;
IList<Config.CalendarEvent.ICalendarEvent> calendarEvents = new List<Config.CalendarEvent.ICalendarEvent>();
if (calibrationDue > TBF.UI.Constants.MinDate)
if (calibrationDue > DateTime.MinValue.AddDays(36))
{
/// Calibration due date calendar event
calendarEvents.Add(new TBF.UI.Calendar.CalibrationDueDateEvent(calibrationDue.Date, Name,
@@ -296,7 +297,7 @@ namespace TBF.BenchControl.MettlerToledo.Standard
if (balanceCfg.DebugLevel == DebugMode.Simulate)
{
Masses[balanceNr] = 123.456;
Masses[balanceNr] = TestBenchSim.GetSimMass(balanceNr);
msrmntState = MsrmntState.Valid;
msrmntTimeStamp = StateMachine.Time;
return;
@@ -512,21 +513,12 @@ namespace TBF.BenchControl.MettlerToledo.Standard
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <returns>ZeroOp reference</returns>
public IOperation ZeroOp()
{
return new ZeroOp(this);
}
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <param name="result">Reference to a variable for 'tara' in kg</param>
/// <returns>TaringOp reference</returns>
/// <param name="result">Reference to a variable for 'tara' in kg</param>
/// <returns>TaringOp instance reference casted to IOperaton</returns>
public IOperation TaringOp(ref DoubleBox tara)
{
return new TaringOp(this, ref tara);
}
{
return new TaringOp(this, ref tara);
}
/// <summary>
/// Events: BalanceDone, Error
@@ -1,74 +0,0 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using log4net;
namespace TBF.BenchControl.MettlerToledo.Standard
{
public class ZeroOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ZeroOp));
public override string ToString() { return string.Format("ZeroOp(.,.)"); }
bool done;
/// Set by the constructor
BalanceDev balanceDev;
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <param name="balanceDev">Balance device instance</param>
/// <param name="result">Reference to variable for 'tara' in kg</param>
public ZeroOp(BalanceDev balanceDev)
{
if (balanceDev == null) throw new ArgumentNullException("balanceDev");
this.balanceDev = balanceDev;
log.Debug(this.ToString());
}
/// <summary>Start this operation</summary>
public void Start()
{
log.DebugFormat("{0} - Start()", balanceDev.Name);
done = false;
balanceDev.ZeroWhenStable();
}
/// <summary>Run this operation</summary>
/// <returns>
/// Event.None
/// Event.BalanceDone
/// Event.Error . . . . . Current.Tick == null
/// </returns>
public Event Run()
{
if (done) return Event.BalanceDone; /// Zeroing has been done already
if (balanceDev.MsrmntState == MsrmntState.Busy) return Event.Busy;
if (balanceDev.MsrmntState == MsrmntState.Overload)
{
done = true;
return Event.BalanceOverload;
}
if (balanceDev.MsrmntState == MsrmntState.Valid)
{
done = true;
return Event.BalanceDone; /// Zeroing completed
}
balanceDev.ZeroWhenStable(); /// Failed -> repeat zeroing
return Event.Busy;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
log.DebugFormat("{0} - Stop()", balanceDev.Name);
}
}
}
@@ -25,10 +25,10 @@ namespace TBF.BenchControl.Modbus.WaterAnalyzer
///
/// Measured values when MsrmntState == MsrmntState.Valid
///
float conductivity; /// [uS/cm] electrical conductivity of water
double temperature; /// [°C] water temperature
double conductivity; /// [???]
double temperature; /// [°C]
public float Conductivity { get { return conductivity; } }
public double Level { get { return conductivity; } }
/// <summary>Measurement time stamp when MsrmntState == MsrmntState.Valid</summary>
int msrmntTimeStamp;
@@ -57,7 +57,7 @@ namespace TBF.BenchControl.Modbus.WaterAnalyzer
{
if (myCfg.DebugLevel == DebugMode.Simulate)
{
conductivity = 0.0F;
conductivity = 0.0;
temperature = 0.0;
msrmntTimeStamp = StateMachine.Time;
@@ -71,10 +71,10 @@ namespace TBF.BenchControl.Modbus.WaterAnalyzer
}
public float ReadConductivity() { return conductivity; } /// Returns electrical conductivity of water in [uS/cm]
public double ReadTemperature() { return temperature; } /// Returns water temperature in [°C]
public double ReadLevel() { return conductivity; } /// Returns water level in mm
public double ReadTemperature() { return temperature; } /// Returns temperature in °C
public ReadConductivityOp ReadConductivityOp(ref FloatBox conduct) { return new ReadConductivityOp(this, ref conduct); }
public ReadConductivityOp ReadLevelOp(ref DoubleBox level) { return new ReadConductivityOp(this, ref level); }
public IOperation ReadTempOp(ref DoubleBox temperature) { return new ReadTempOp(this, ref temperature); }
public IOperation ReadTempOp(ref DoubleBox temperature, Event eventDone) { return new ReadTempOp(this, ref temperature, eventDone); }
@@ -98,11 +98,14 @@ namespace TBF.BenchControl.Modbus.WaterAnalyzer
///
/// Telegram with values
///
byte[] conductBytes = new byte[] { telegram[4], telegram[3], telegram[6], telegram[5] };
conductivity = System.BitConverter.ToSingle(conductBytes, 0);
UpdateProcessData(conductivity);
byte[] conductBytes = new byte[] { telegram[4], telegram[3], telegram[6], telegram[5] };
float _conductivity = System.BitConverter.ToSingle(conductBytes, 0);
string line = string.Format("conductivity = {0} uS/cm", _conductivity);
if (true)
{
conductivity = _conductivity;
}
string line = string.Format("conductivity = {0} uS/cm", conductivity);
log.Debug(line);
Debug.WriteLine(line);
}
@@ -134,10 +137,5 @@ namespace TBF.BenchControl.Modbus.WaterAnalyzer
public void RunDeviceAfter() { }
public void StopDevice() { }
public void StopDevice2() { }
void UpdateProcessData(float conduct)
{
TBF.BenchControl.Sequences.ProcessData.Conductivity.Val = conduct;
}
}
}
}
@@ -16,19 +16,19 @@ namespace TBF.BenchControl.Modbus.WaterAnalyzer
readonly Analyzer analyzer;
/// Measured value
FloatBox conductivity; /// [uS/cm] electrical conductivity of water
DoubleBox conductivity;
/// <summary>
/// Events: LevelDone or Error
/// </summary>
/// <param name="analyzer">Water level meter reference</param>
/// <param name="conduct">Reference to the measured level variable, value is in mm</param>
/// <param name="level">Reference to the measured level variable, value is in mm</param>
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
public ReadConductivityOp(Analyzer analyzer, ref FloatBox conduct)
public ReadConductivityOp(Analyzer analyzer, ref DoubleBox level)
{
if (analyzer == null) throw new ArgumentNullException("analyzer");
this.analyzer = analyzer;
this.conductivity = conduct;
this.conductivity = level;
log.Debug(this.ToString());
}
@@ -37,17 +37,17 @@ namespace TBF.BenchControl.Modbus.WaterAnalyzer
/// <summary>Start this operation</summary>
public void Start()
{
conductivity.Val = analyzer.ReadConductivity();
conductivity.Val = analyzer.ReadLevel();
}
/// <summary>Run this operation</summary>
/// <returns>
/// Event.ConductivityDone
/// Event.LevelDone
/// </returns>
public Event Run()
{
conductivity.Val = analyzer.ReadConductivity();
return Event.ConductivityDone;
conductivity.Val = analyzer.ReadLevel();
return Event.LevelDone;
}
/// <summary>Stop this operation</summary>
@@ -277,7 +277,7 @@ namespace TBF.BenchControl.Network.Camera
public JpegFrame() : base(26) { }
/// <summary>
/// Writes packets to a memory stream and created the default header and quantization tables if necessary.
/// //Writes the packets to a memory stream and created the default header and quantization tables if necessary.
/// </summary>
void ProcessPackets(System.IO.MemoryStream buffer)
{
@@ -9,10 +9,10 @@ namespace TBF.BenchControl.Network.Camera
{
public enum STATE
{
Empty, /// Initial state after being constructed
OK, /// The frame is not empty, but it's not complete yet. It's without any error
Error, /// An error occured
Complete, /// The frame is complete, consequent AddPacket() calls will be ignored
Empty,
OK,
Error,
Complete,
}
public readonly int PayloadType;
@@ -10,7 +10,6 @@ using NHibernate;
using NHibernate.Criterion;
using Config.Entities;
using TracingDB.Entities;
using Events.Entities;
namespace TBF.BenchControl.Output.DB.ProductionTracing
{
@@ -285,56 +284,11 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
log.WarnFormat("{0} : Run() : currentOp = {1}", Name, currentOpState);
opCompleted = true;
if (SaveTracingRecords(batch) != Retv.OK) anyError = true;
if (anyError)
{
try
{
NHibernate.ISession session = Events.DB.CreateSession();
Events.DB.LoadSubscribers(session);
TBF.UiBridge.Bridge.TriggerEvent(session, Name, EventClass.ComputerResources, Severity.Error,
string.Format("Nepodarilo sa uložiť výsledky do sledovacej DB: Číslo dávky={0}", batch.BatchNr),
string.Format("Nepodarilo sa uložiť výsledky do sledovacej DB\r\nČíslo dávky = {0}", batch.BatchNr),
SubscriberGroup.Metrology | SubscriberGroup.Maintenance | SubscriberGroup.Production);
}
catch (Exception exc)
{
log.ErrorFormat("Triggering event(s) failed: {0}", exc.Message);
}
return Event.ErrorProcessingResults;
}
else
{
return Event.ResultsWritten;
}
return anyError ? Event.ErrorProcessingResults : Event.ResultsWritten;
}
else
{
if (anyError)
{
try
{
NHibernate.ISession session = Events.DB.CreateSession();
Events.DB.LoadSubscribers(session);
TBF.UiBridge.Bridge.TriggerEvent(session, Name, EventClass.ComputerResources, Severity.Error,
string.Format("Nepodarilo sa uložiť výsledky do sledovacej DB: Číslo dávky={0}", batch.BatchNr),
string.Format("Nepodarilo sa uložiť výsledky do sledovacej DB\r\nČíslo dávky = {0}", batch.BatchNr),
SubscriberGroup.Metrology | SubscriberGroup.Maintenance | SubscriberGroup.Production);
}
catch (Exception exc)
{
log.ErrorFormat("Triggering event(s) failed: {0}", exc.Message);
}
return Event.ErrorProcessingResults;
}
else
{
return Event.ResultsWritten;
}
return anyError ? Event.ErrorProcessingResults : Event.ResultsWritten;
}
}
else
@@ -11,7 +11,6 @@ using Config;
using Config.Entities;
using Results.Output;
using System.Text;
using Events.Entities;
namespace TBF.BenchControl.Output.DB.SensusOracle
{
@@ -315,29 +314,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
opCompleted = true;
}
if (anyError)
{
try
{
NHibernate.ISession session = Events.DB.CreateSession();
Events.DB.LoadSubscribers(session);
TBF.UiBridge.Bridge.TriggerEvent(session, Name, EventClass.ComputerResources, Severity.Error,
string.Format("Nepodarilo sa uložiť výsledky do Oracle: Číslo dávky={0}", batch.BatchNr),
string.Format("Nepodarilo sa uložiť výsledky do Oracle\r\nČíslo dávky = {0}", batch.BatchNr),
SubscriberGroup.Metrology | SubscriberGroup.Maintenance | SubscriberGroup.Production);
}
catch (Exception exc)
{
log.ErrorFormat("Triggering event(s) failed: {0}", exc.Message);
}
return Event.ErrorProcessingResults;
}
else
{
return Event.ResultsWritten;
}
return anyError ? Event.ErrorProcessingResults : Event.ResultsWritten;
}
else
{
@@ -52,29 +52,24 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
triggerCfg.EventSource = newCfg.EventSource;
triggerCfg.FailedWMsPct = newCfg.FailedWMsPct;
triggerCfg.Mid1Name = newCfg.Mid1Name;
triggerCfg.Mid1ErrAfterCorr = newCfg.Mid1ErrAfterCorr;
triggerCfg.Mid1Err = newCfg.Mid1Err;
triggerCfg.Mid1RelErr = newCfg.Mid1RelErr;
triggerCfg.Mid2Name = newCfg.Mid2Name;
triggerCfg.Mid2ErrAfterCorr = newCfg.Mid2ErrAfterCorr;
triggerCfg.Mid2Err = newCfg.Mid2Err;
triggerCfg.Mid2RelErr = newCfg.Mid2RelErr;
triggerCfg.Mid3Name = newCfg.Mid3Name;
triggerCfg.Mid3ErrAfterCorr = newCfg.Mid3ErrAfterCorr;
triggerCfg.Mid3Err = newCfg.Mid3Err;
triggerCfg.Mid3RelErr = newCfg.Mid3RelErr;
triggerCfg.Mid4Name = newCfg.Mid4Name;
triggerCfg.Mid4ErrAfterCorr = newCfg.Mid4ErrAfterCorr;
triggerCfg.Mid4Err = newCfg.Mid4Err;
triggerCfg.Mid4RelErr = newCfg.Mid4RelErr;
triggerCfg.Mid5Name = newCfg.Mid5Name;
triggerCfg.Mid5ErrAfterCorr = newCfg.Mid5ErrAfterCorr;
triggerCfg.Mid5Err = newCfg.Mid5Err;
triggerCfg.E1 = newCfg.E1;
triggerCfg.E2 = newCfg.E2;
triggerCfg.E3 = newCfg.E3;
triggerCfg.E4 = newCfg.E4;
triggerCfg.E5 = newCfg.E5;
triggerCfg.E6 = newCfg.E6;
triggerCfg.E7 = newCfg.E7;
triggerCfg.E8 = newCfg.E8;
triggerCfg.E9 = newCfg.E9;
triggerCfg.Mid5RelErr = newCfg.Mid5RelErr;
triggerCfg.E1 = newCfg.E1;
triggerCfg.E2 = newCfg.E2;
triggerCfg.E3 = newCfg.E3;
triggerCfg.E4 = newCfg.E4;
triggerCfg.E5 = newCfg.E5;
triggerCfg.E6 = newCfg.E6;
triggerCfg.E7 = newCfg.E7;
triggerCfg.E8 = newCfg.E8;
triggerCfg.E9 = newCfg.E9;
triggerCfg.E10 = newCfg.E10;
triggerCfg.E11 = newCfg.E11;
triggerCfg.E12 = newCfg.E12;
@@ -83,7 +78,6 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
triggerCfg.E15 = newCfg.E15;
triggerCfg.E16 = newCfg.E16;
triggerCfg.E21 = newCfg.E21;
triggerCfg.E36 = newCfg.E36;
#if TURA_IPERL || TURA_SPECIAL
triggerCfg.E26 = newCfg.E26;
triggerCfg.E27 = newCfg.E27;
@@ -168,48 +162,26 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
triggerCfg.Mid3Name,
triggerCfg.Mid4Name,
triggerCfg.Mid5Name };
double[] maxMidErr = new double[] { triggerCfg.Mid1Err,
triggerCfg.Mid2Err,
triggerCfg.Mid3Err,
triggerCfg.Mid4Err,
triggerCfg.Mid5Err };
double[] maxMidErrAfterCorr = new double[] { triggerCfg.Mid1ErrAfterCorr,
triggerCfg.Mid2ErrAfterCorr,
triggerCfg.Mid3ErrAfterCorr,
triggerCfg.Mid4ErrAfterCorr,
triggerCfg.Mid5ErrAfterCorr };
double[] maxMidRelErr = new double[] { triggerCfg.Mid1RelErr,
triggerCfg.Mid2RelErr,
triggerCfg.Mid3RelErr,
triggerCfg.Mid4RelErr,
triggerCfg.Mid5RelErr };
for (int i = 0; i < midName.Length; i++)
{
if (!string.IsNullOrEmpty(midName[i]))
{
/// This MID# enabled
/// MIDx enabled
foreach (var tr in batch.TestRslts)
{
if (tr.RefFlowmeter() == midName[i])
if (tr.RefFlowmeter() == midName[i] && tr.ErrorMaster >= maxMidRelErr[i])
{
/// This test result was obtained using MID#
double midErrAfterCorr = Config.Formulas.ErrorFromVolumes(tr.ConstMasterCorr, tr.ConstMaster);
if (midErrAfterCorr >= maxMidErrAfterCorr[i])
{
TBF.UiBridge.Bridge.TriggerEvent(session, src, EventClass.EquipmentHW, Severity.Error,
string.Format("Príliš veľká chyba merača prietoku {0} po KOREKCII oproti váhe", midName[i]),
string.Format("Číslo dávky: {0}\r\nPrietokomer: {1}\r\nRelatívna chyba po korekcii: {2}%\r\nMax. dovolená chyba: {3}%",
batch.BatchNr, midName[i], Utils.DoubleToStr(midErrAfterCorr, 3), maxMidErrAfterCorr[i]),
SubscriberGroup.Metrology | SubscriberGroup.Maintenance | SubscriberGroup.Production);
}
if (tr.ErrorMaster >= maxMidErr[i])
{
TBF.UiBridge.Bridge.TriggerEvent(session, src, EventClass.EquipmentHW, Severity.Error,
string.Format("Príliš veľká chyba merača prietoku {0} oproti váhe", midName[i]),
string.Format("Číslo dávky: {0}\r\nPrietokomer: {1}\r\nRelatívna chyba: {2}%\r\nMax. dovolená chyba: {3}%",
batch.BatchNr, midName[i], Utils.DoubleToStr(tr.ErrorMaster, 3), maxMidErr[i]),
SubscriberGroup.Metrology | SubscriberGroup.Maintenance | SubscriberGroup.Production);
}
TBF.UiBridge.Bridge.TriggerEvent(session, src, EventClass.EquipmentHW, Severity.Error,
string.Format("Príliš veľká relatívna chyba merača prietoku {0} oproti váhe", midName[i]),
string.Format("Číslo dávky: {0}\r\nPrietokomer: {1}\r\nRelatívna chyba: {2}%\r\nMax. dovolená chyba: {3}%",
batch.BatchNr, midName[i], Utils.DoubleToStr(tr.ErrorMaster, 3), maxMidRelErr[i]),
SubscriberGroup.Metrology | SubscriberGroup.Maintenance | SubscriberGroup.Production);
break; /// For each MID just one event is triggered
}
}
}
@@ -221,15 +193,15 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
long eFlags = batch.ErrorFlags();
long iFlags = batch.InfoFlags();
///
if (triggerCfg.E1) OnExTriggerEvent(session, eFlags, iFlags, 1);
if (triggerCfg.E2) OnExTriggerEvent(session, eFlags, iFlags, 2);
if (triggerCfg.E3) OnExTriggerEvent(session, eFlags, iFlags, 3);
if (triggerCfg.E4) OnExTriggerEvent(session, eFlags, iFlags, 4);
if (triggerCfg.E5) OnExTriggerEvent(session, eFlags, iFlags, 5);
if (triggerCfg.E6) OnExTriggerEvent(session, eFlags, iFlags, 6);
if (triggerCfg.E7) OnExTriggerEvent(session, eFlags, iFlags, 7);
if (triggerCfg.E8) OnExTriggerEvent(session, eFlags, iFlags, 8);
if (triggerCfg.E9) OnExTriggerEvent(session, eFlags, iFlags, 9);
if (triggerCfg.E1) OnExTriggerEvent(session, eFlags, iFlags, 1);
if (triggerCfg.E2) OnExTriggerEvent(session, eFlags, iFlags, 2);
if (triggerCfg.E3) OnExTriggerEvent(session, eFlags, iFlags, 3);
if (triggerCfg.E4) OnExTriggerEvent(session, eFlags, iFlags, 4);
if (triggerCfg.E5) OnExTriggerEvent(session, eFlags, iFlags, 5);
if (triggerCfg.E6) OnExTriggerEvent(session, eFlags, iFlags, 6);
if (triggerCfg.E7) OnExTriggerEvent(session, eFlags, iFlags, 7);
if (triggerCfg.E8) OnExTriggerEvent(session, eFlags, iFlags, 8);
if (triggerCfg.E9) OnExTriggerEvent(session, eFlags, iFlags, 9);
if (triggerCfg.E10) OnExTriggerEvent(session, eFlags, iFlags, 10);
if (triggerCfg.E11) OnExTriggerEvent(session, eFlags, iFlags, 11);
if (triggerCfg.E12) OnExTriggerEvent(session, eFlags, iFlags, 12);
@@ -238,7 +210,6 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
if (triggerCfg.E15) OnExTriggerEvent(session, eFlags, iFlags, 15);
if (triggerCfg.E16) OnExTriggerEvent(session, eFlags, iFlags, 16);
if (triggerCfg.E21) OnExTriggerEvent(session, eFlags, iFlags, 21);
if (triggerCfg.E36) OnExTriggerEvent(session, eFlags, iFlags, 36);
#if TURA_IPERL || TURA_SPECIAL
if (triggerCfg.E26) OnExTriggerEvent(session, eFlags, iFlags, 26);
if (triggerCfg.E27) OnExTriggerEvent(session, eFlags, iFlags, 27);
@@ -24,22 +24,17 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
/// Serialized parameters
///
public string EventSource;
public int FailedWMsPct; /// 0 = off, 1..100% event is triggered when percentage reaches this level
public int FailedWMsPct; /// 0 = off, 1..100% event is triggered when percentage reaches this level
public string Mid1Name;
public double Mid1ErrAfterCorr; /// [%] Event triggered when rel. error of MID1 against a scale after a correction reached this level
public double Mid1Err; /// [%] Event triggered when rel. error of MID1 against a scale reached this level
public string Mid2Name;
public double Mid2ErrAfterCorr; /// [%] Event triggered when rel. error of MID2 against a scale after a correction reached this level
public double Mid2Err; /// [%] Event triggered when rel. error of MID2 against a scale reached this level
public string Mid3Name;
public double Mid3ErrAfterCorr; /// [%] Event triggered when rel. error of MID3 against a scale after a correction reached this level
public double Mid3Err; /// [%] Event triggered when rel. error of MID3 against a scale reached this level
public string Mid4Name;
public double Mid4ErrAfterCorr; /// [%] Event triggered when rel. error of MID4 against a scale after a correction reached this level
public double Mid4Err; /// [%] Event triggered when rel. error of MID4 against a scale reached this level
public string Mid5Name;
public double Mid5ErrAfterCorr; /// [%] Event triggered when rel. error of MID5 against a scale after a correction reached this level
public double Mid5Err; /// [%] Event triggered when rel. error of MID5 against a scale reached this level
public double Mid1RelErr; /// [%] Event is triggered when relative error of reference flowmeter against a scale reaches this level
public string Mid2Name;
public double Mid2RelErr; /// [%] Event is triggered when relative error of reference flowmeter against a scale reaches this level
public string Mid3Name;
public double Mid3RelErr; /// [%] Event is triggered when relative error of reference flowmeter against a scale reaches this level
public string Mid4Name;
public double Mid4RelErr; /// [%] Event is triggered when relative error of reference flowmeter against a scale reaches this level
public string Mid5Name;
public double Mid5RelErr; /// [%] Event is triggered when relative error of reference flowmeter against a scale reaches this level
public bool E1;
public bool E2;
public bool E3;
@@ -62,9 +57,8 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
public bool E27;
public bool E28;
#endif
public bool E36;
/// Private parameterless constructor invoked by all other (public) constructors
/// Private parameterless constructor invoked by all other (public) constructors
TriggerCfg() {}
public TriggerCfg(string name, IComponentFactory factory)
@@ -80,90 +74,78 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
public void InitializeAll()
{
EventSource = "Výsledky"; /// 0
FailedWMsPct = 20; /// 1
Mid1Name = "I1"; /// 2
Mid1ErrAfterCorr = 0.3; /// 3
Mid1Err = 0.6; /// 4
Mid2Name = "I2"; /// 5
Mid2ErrAfterCorr = 0.3; /// 6
Mid2Err = 0.6; /// 7
Mid3Name = "I3"; /// 8
Mid3ErrAfterCorr = 0.3; /// 9
Mid3Err = 0.6; /// 10
Mid4Name = ""; /// 11
Mid4ErrAfterCorr = 0.3; /// 12
Mid4Err = 0.6; /// 13
Mid5Name = ""; /// 14
Mid5ErrAfterCorr = 0.3; /// 15
Mid5Err = 0.6; /// 16
E1 = false; /// 17
E2 = false; /// 18
E3 = false; /// 19
E4 = false; /// 20
E5 = false; /// 21
E6 = false; /// 22
E7 = false; /// 23
E8 = false; /// 24
E9 = false; /// 25
E10 = false; /// 26
E11 = false; /// 27
E12 = false; /// 28
E13 = false; /// 29
E14 = false; /// 30
E15 = false; /// 31
E16 = false; /// 32
E21 = false; /// 33
EventSource = "Results"; /// 0
FailedWMsPct = 20; /// 1
Mid1Name = "I1"; /// 2
Mid1RelErr = 0.5; /// 3
Mid2Name = "I2"; /// 4
Mid2RelErr = 0.5; /// 5
Mid3Name = "I3"; /// 6
Mid3RelErr = 0.5; /// 7
Mid4Name = ""; /// 8
Mid4RelErr = 0.5; /// 9
Mid5Name = ""; /// 10
Mid5RelErr = 0.5; /// 11
E1 = false; /// 12
E2 = false; /// 13
E3 = false; /// 14
E4 = false; /// 15
E5 = false; /// 16
E6 = false; /// 17
E7 = false; /// 18
E8 = false; /// 19
E9 = false; /// 20
E10 = false; /// 21
E11 = false; /// 22
E12 = false; /// 23
E13 = false; /// 24
E14 = false; /// 25
E15 = false; /// 26
E16 = false; /// 27
E21 = false; /// 28
#if TURA_IPERL || TURA_SPECIAL
E26 = false; /// 34
E27 = false; /// 35
E28 = false; /// 36
E26 = false; /// 29
E27 = false; /// 30
E28 = false; /// 31
#endif
E36 = true; /// 34 or 37
}
string[] paramNames = new string[]
{
"Event source", /// 0
"Percentage of failed meters", /// 1
"MID 1 name", /// 2
"MID 1 rel.err.after corr.", /// 3
"MID 1 rel.error", /// 4
"MID 2 name", /// 5
"MID 2 rel.err.after corr.", /// 6
"MID 2 rel.error", /// 7
"MID 3 name", /// 8
"MID 3 rel.err.after corr.", /// 9
"MID 3 rel.error", /// 10
"MID 4 name", /// 11
"MID 4 rel.err.after corr.", /// 12
"MID 4 rel.error", /// 13
"MID 5 name", /// 14
"MID 5 rel.err.after corr.", /// 15
"MID 5 rel.error", /// 16
"E1", /// 17
"E2", /// 18
"E3", /// 19
"E4", /// 20
"E5", /// 21
"E6", /// 22
"E7", /// 23
"E8", /// 24
"E9", /// 25
"E10", /// 26
"E11", /// 27
"E12", /// 28
"E13", /// 29
"E14", /// 30
"E15", /// 31
"E16", /// 32
"E21", /// 33
"Event source", /// 0
"Percentage of failed meters", /// 1
"MID 1 name", /// 2
"MID 1 rel. error", /// 3
"MID 2 name", /// 4
"MID 2 rel. error", /// 5
"MID 3 name", /// 6
"MID 3 rel. error", /// 7
"MID 4 name", /// 8
"MID 4 rel. error", /// 9
"MID 5 name", /// 10
"MID 5 rel. error", /// 11
"E1", /// 12
"E2", /// 13
"E3", /// 14
"E4", /// 15
"E5", /// 16
"E6", /// 17
"E7", /// 18
"E8", /// 19
"E9", /// 20
"E10", /// 21
"E11", /// 22
"E12", /// 23
"E13", /// 24
"E14", /// 25
"E15", /// 26
"E16", /// 27
"E21", /// 28
#if TURA_IPERL || TURA_SPECIAL
"E26", /// 34
"E27", /// 35
"E28", /// 36
"E26", /// 29
"E27", /// 30
"E28", /// 31
#endif
"E36", /// 34 or 37
};
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
@@ -191,44 +173,36 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
case 0: return EventSource;
case 1: return FailedWMsPct.ToString();
case 2: return Mid1Name;
case 3: return Mid1ErrAfterCorr.ToString();
case 4: return Mid1Err.ToString();
case 5: return Mid2Name;
case 6: return Mid2ErrAfterCorr.ToString();
case 7: return Mid2Err.ToString();
case 8: return Mid3Name;
case 9: return Mid3ErrAfterCorr.ToString();
case 10: return Mid3Err.ToString();
case 11: return Mid4Name;
case 12: return Mid4ErrAfterCorr.ToString();
case 13: return Mid4Err.ToString();
case 14: return Mid5Name;
case 15: return Mid5ErrAfterCorr.ToString();
case 16: return Mid5Err.ToString();
case 17: return E1 ? Strings.yes : Strings.no;
case 18: return E2 ? Strings.yes : Strings.no;
case 19: return E3 ? Strings.yes : Strings.no;
case 20: return E4 ? Strings.yes : Strings.no;
case 21: return E5 ? Strings.yes : Strings.no;
case 22: return E6 ? Strings.yes : Strings.no;
case 23: return E7 ? Strings.yes : Strings.no;
case 24: return E8 ? Strings.yes : Strings.no;
case 25: return E9 ? Strings.yes : Strings.no;
case 26: return E10 ? Strings.yes : Strings.no;
case 27: return E11 ? Strings.yes : Strings.no;
case 28: return E12 ? Strings.yes : Strings.no;
case 29: return E13 ? Strings.yes : Strings.no;
case 30: return E14 ? Strings.yes : Strings.no;
case 31: return E15 ? Strings.yes : Strings.no;
case 32: return E16 ? Strings.yes : Strings.no;
case 33: return E21 ? Strings.yes : Strings.no;
case 3: return Mid1RelErr.ToString();
case 4: return Mid2Name;
case 5: return Mid2RelErr.ToString();
case 6: return Mid3Name;
case 7: return Mid3RelErr.ToString();
case 8: return Mid4Name;
case 9: return Mid4RelErr.ToString();
case 10: return Mid5Name;
case 11: return Mid5RelErr.ToString();
case 12: return E1 ? Strings.yes : Strings.no;
case 13: return E2 ? Strings.yes : Strings.no;
case 14: return E3 ? Strings.yes : Strings.no;
case 15: return E4 ? Strings.yes : Strings.no;
case 16: return E5 ? Strings.yes : Strings.no;
case 17: return E6 ? Strings.yes : Strings.no;
case 18: return E7 ? Strings.yes : Strings.no;
case 19: return E8 ? Strings.yes : Strings.no;
case 20: return E9 ? Strings.yes : Strings.no;
case 21: return E10 ? Strings.yes : Strings.no;
case 22: return E11 ? Strings.yes : Strings.no;
case 23: return E12 ? Strings.yes : Strings.no;
case 24: return E13 ? Strings.yes : Strings.no;
case 25: return E14 ? Strings.yes : Strings.no;
case 26: return E15 ? Strings.yes : Strings.no;
case 27: return E16 ? Strings.yes : Strings.no;
case 28: return E21 ? Strings.yes : Strings.no;
#if TURA_IPERL || TURA_SPECIAL
case 34: return E26 ? Strings.yes : Strings.no;
case 35: return E27 ? Strings.yes : Strings.no;
case 36: return E28 ? Strings.yes : Strings.no;
case 37: return E36 ? Strings.yes : Strings.no;
#else
case 34: return E36 ? Strings.yes : Strings.no;
case 29: return E26 ? Strings.yes : Strings.no;
case 30: return E27 ? Strings.yes : Strings.no;
case 31: return E28 ? Strings.yes : Strings.no;
#endif
default: return string.Empty;
}
@@ -238,47 +212,39 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
{
switch (i)
{
case 0: EventSource = strValue; return CfgUpdateFlags.AnyChange;
case 1: FailedWMsPct = int.Parse(strValue); return CfgUpdateFlags.AnyChange;
case 2: Mid1Name = strValue; return CfgUpdateFlags.AnyChange;
case 3: Mid1ErrAfterCorr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 4: Mid1Err = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 5: Mid2Name = strValue; return CfgUpdateFlags.AnyChange;
case 6: Mid2ErrAfterCorr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 7: Mid2Err = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 8: Mid3Name = strValue; return CfgUpdateFlags.AnyChange;
case 9: Mid3ErrAfterCorr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 10: Mid3Err = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 11: Mid4Name = strValue; return CfgUpdateFlags.AnyChange;
case 12: Mid4ErrAfterCorr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 13: Mid4Err = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 14: Mid5Name = strValue; return CfgUpdateFlags.AnyChange;
case 15: Mid5ErrAfterCorr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 16: Mid5Err = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 17: E1 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 18: E2 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 19: E3 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 20: E4 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 21: E5 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 22: E6 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 23: E7 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 24: E8 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 25: E9 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 26: E10 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 27: E11 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 28: E12 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 29: E12 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 30: E14 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 31: E15 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 32: E16 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 33: E21 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 0: EventSource = strValue; return CfgUpdateFlags.AnyChange;
case 1: FailedWMsPct = int.Parse(strValue); return CfgUpdateFlags.AnyChange;
case 2: Mid1Name = strValue; return CfgUpdateFlags.AnyChange;
case 3: Mid1RelErr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 4: Mid2Name = strValue; return CfgUpdateFlags.AnyChange;
case 5: Mid2RelErr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 6: Mid3Name = strValue; return CfgUpdateFlags.AnyChange;
case 7: Mid3RelErr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 8: Mid4Name = strValue; return CfgUpdateFlags.AnyChange;
case 9: Mid4RelErr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 10: Mid5Name = strValue; return CfgUpdateFlags.AnyChange;
case 11: Mid5RelErr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.AnyChange;
case 12: E1 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 13: E2 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 14: E3 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 15: E4 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 16: E5 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 17: E6 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 18: E7 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 19: E8 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 20: E9 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 21: E10 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 22: E11 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 23: E12 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 24: E12 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 25: E14 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 26: E15 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 27: E16 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 28: E21 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
#if TURA_IPERL || TURA_SPECIAL
case 34: E26 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 35: E27 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 36: E28 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 37: E36 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
#else
case 34: E36 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 29: E26 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 30: E27 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 31: E28 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
#endif
default: return CfgUpdateFlags.None;
}
@@ -301,28 +267,28 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
{
case 0:
case 2:
case 5:
case 4:
case 6:
case 8:
case 11:
case 14:
case 10:
return true;
case 1:
if (int.TryParse(strValue, out percentage) && (0 <= percentage) && (percentage <= 100)) return true;
message = "Percentage of failed meters is invalid, should be 1..100, 0 = off";
return false;
case 3:
case 4:
case 6:
case 5:
case 7:
case 9:
case 10:
case 12:
case 13:
case 15:
case 16:
case 11:
if (Utils.TryParseUDouble(strValue, out relError)) return true;
message = "relative error of MID is invalid or less then 0";
return false;
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
@@ -335,16 +301,10 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
case 26:
case 27:
case 28:
#if TURA_IPERL || TURA_SPECIAL
case 29:
case 30:
case 31:
case 32:
case 33:
case 34:
#if TURA_IPERL || TURA_SPECIAL
case 35:
case 36:
case 37:
#endif
if (strValue == Strings.yes || strValue == Strings.no) return true;
break;
@@ -360,46 +320,40 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
void CopyContentTo(TriggerCfg prms)
{
prms.EventSource = this.EventSource; /// 0
prms.FailedWMsPct = this.FailedWMsPct; /// 1
prms.Mid1Name = this.Mid1Name; /// 2
prms.Mid1ErrAfterCorr = this.Mid1ErrAfterCorr; /// 3
prms.Mid1Err = this.Mid1Err; /// 4
prms.Mid2Name = this.Mid2Name; /// 5
prms.Mid2ErrAfterCorr = this.Mid2ErrAfterCorr; /// 6
prms.Mid2Err = this.Mid2Err; /// 7
prms.Mid3Name = this.Mid3Name; /// 8
prms.Mid3ErrAfterCorr = this.Mid3ErrAfterCorr; /// 9
prms.Mid3Err = this.Mid3Err; /// 10
prms.Mid4Name = this.Mid4Name; /// 11
prms.Mid4ErrAfterCorr = this.Mid4ErrAfterCorr; /// 12
prms.Mid4Err = this.Mid4Err; /// 13
prms.Mid5Name = this.Mid5Name; /// 14
prms.Mid5ErrAfterCorr = this.Mid5ErrAfterCorr; /// 15
prms.Mid5Err = this.Mid5Err; /// 16
prms.E1 = this.E1; /// 17
prms.E2 = this.E2; /// 18
prms.E3 = this.E3; /// 19
prms.E4 = this.E4; /// 20
prms.E5 = this.E5; /// 21
prms.E6 = this.E6; /// 22
prms.E7 = this.E7; /// 23
prms.E8 = this.E8; /// 24
prms.E9 = this.E9; /// 25
prms.E10 = this.E10; /// 26
prms.E11 = this.E11; /// 27
prms.E12 = this.E12; /// 28
prms.E13 = this.E13; /// 29
prms.E14 = this.E14; /// 30
prms.E15 = this.E15; /// 31
prms.E16 = this.E16; /// 32
prms.E21 = this.E21; /// 33
prms.EventSource = this.EventSource; /// 0
prms.FailedWMsPct = this.FailedWMsPct; /// 1
prms.Mid1Name = this.Mid1Name; /// 2
prms.Mid1RelErr = this.Mid1RelErr; /// 3
prms.Mid2Name = this.Mid2Name; /// 4
prms.Mid2RelErr = this.Mid2RelErr; /// 5
prms.Mid3Name = this.Mid3Name; /// 6
prms.Mid3RelErr = this.Mid3RelErr; /// 7
prms.Mid4Name = this.Mid4Name; /// 8
prms.Mid4RelErr = this.Mid4RelErr; /// 9
prms.Mid5Name = this.Mid5Name; /// 10
prms.Mid5RelErr = this.Mid5RelErr; /// 11
prms.E1 = this.E1; /// 12
prms.E2 = this.E2; /// 13
prms.E3 = this.E3; /// 14
prms.E4 = this.E4; /// 15
prms.E5 = this.E5; /// 16
prms.E6 = this.E6; /// 17
prms.E7 = this.E7; /// 18
prms.E8 = this.E8; /// 19
prms.E9 = this.E9; /// 20
prms.E10 = this.E10; /// 21
prms.E11 = this.E11; /// 22
prms.E12 = this.E12; /// 23
prms.E13 = this.E13; /// 24
prms.E14 = this.E14; /// 25
prms.E15 = this.E15; /// 26
prms.E16 = this.E16; /// 27
prms.E21 = this.E21; /// 28
#if TURA_IPERL || TURA_SPECIAL
prms.E26 = this.E26; /// 34
prms.E27 = this.E27; /// 35
prms.E28 = this.E28; /// 36
prms.E26 = this.E26; /// 29
prms.E27 = this.E27; /// 30
prms.E28 = this.E28; /// 31
#endif
prms.E36 = this.E36; /// 34 or 37
}
public Config.Entities.IParamsProvider Clone()
@@ -0,0 +1,27 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.EventTriggers.Statistics
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { Trigger.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Trigger(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Trigger(cfg); }
public IComponentCfg DefaultConfig() { return new TriggerCfg(this.GetType().Namespace.Substring(24), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(TriggerCfg.Serializer, component, this);;
}
}
}
@@ -0,0 +1,106 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using log4net;
namespace TBF.BenchControl.Output.EventTriggers.Statistics
{
public class Trigger : ComponentBase, IOperation, GenericDevices.IEventTrigger
{
private static readonly ILog log = LogManager.GetLogger(typeof(Trigger));
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(1)); }
readonly TriggerCfg triggerCfg;
Results.Entities.Batch batch;
public Trigger() {}
public Trigger(Generic.IComponentCfg cfg)
: base(cfg)
{
triggerCfg = cfg as TriggerCfg;
ApplyConfig();
log.Debug(this.ToString());
}
void ApplyConfig()
{
}
#region Configuration Change Handling
public static void OnCfgChange(object sender, CfgChangeArgs args)
{
if (CfgChangeHandler == null) return;
try { CfgChangeHandler(sender, args); }
catch (Exception e) { log.Error("CfgChangeHandler(...) failed", e); }
}
public static event EventHandler<CfgChangeArgs> CfgChangeHandler;
public override void StartChangeHandler()
{
CfgChangeHandler += delegate(object sender, CfgChangeArgs args)
{
TriggerCfg newCfg = args.Cfg as TriggerCfg;
if (newCfg != null && newCfg.Name.Equals(Name))
{
if (args.Command == CfgChangeCmd.CfgChange)
{
triggerCfg.EventSource = newCfg.EventSource;
triggerCfg.Culture = newCfg.Culture;
triggerCfg.EliminateSpaces = newCfg.EliminateSpaces;
triggerCfg.PrintCaption = newCfg.PrintCaption;
ApplyConfig();
}
}
};
}
#endregion Configuration Change Handling
/// <summary>
/// Writes the test cycle results into a file
/// Events:
/// Event.ResultsWritten
/// Event.Busy
/// </summary>
/// <param name="batch">Results to write into a file</param>
/// <returns>Reference to the operation</returns>
public IOperation ProcessResultsOp(Results.Entities.Batch batch)
{
this.batch = batch;
return this;
}
/// <summary>Start this operation</summary>
public void Start()
{
Process(batch);
}
/// <summary>Run this operation</summary>
/// <returns>Event.ResultsProcessed</returns>
public Event Run()
{
return Event.ResultsProcessed;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
void Process(Results.Entities.Batch batch)
{
return;
}
}
}
@@ -0,0 +1,170 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Resources;
using System.Collections.Generic;
namespace TBF.BenchControl.Output.EventTriggers.Statistics
{
/// <summary>
/// Serializable configuration of Output.EventTriggers.Standard component.
/// </summary>
public class TriggerCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TriggerCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
///
/// Serialized parameters
///
public string EventSource;
public Culture Culture;
public bool EliminateSpaces;
public bool PrintCaption;
/// Private parameterless constructor invoked by all other (public) constructors
TriggerCfg() {}
public TriggerCfg(string name, IComponentFactory factory)
: this()
{
Name = name;
Factory = factory;
ParentName = string.Empty;
InitializeAll();
}
public string ComponentName { get { return Name; } }
public void InitializeAll()
{
EventSource = "Štatistiky výsledkov";
Culture = Culture.EN;
EliminateSpaces = false;
PrintCaption = false;
}
string[] paramNames = new string[]
{
"Event source",
"Culture",
"Eliminate spaces",
"Print caption",
};
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public IList<string> ParamValues(int i)
{
IList<string> listOfValues = new List<string>();
if (i == 1)
{
for (Culture cu = 0; cu < Culture.Count; cu++) listOfValues.Add(cu.ToString());
return listOfValues;
}
else if (i == 2)
{
listOfValues.Add(Strings.yes);
listOfValues.Add(Strings.no);
return listOfValues;
}
else
{
return null;
}
}
public string ToString(int i)
{
switch (i)
{
case -1: return string.Format("Name={0}, FNameFmt={1}, NoSpaces={2}", Name, EventSource, EliminateSpaces);
case 0: return EventSource;
case 1: return Culture.ToString();
case 2: return EliminateSpaces ? Strings.yes : Strings.no;
case 3: return PrintCaption ? Strings.yes : Strings.no;
default: return string.Empty;
}
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0: EventSource = strValue; return CfgUpdateFlags.RestartRqrd;
case 1:
for (Culture cu = 0; cu < Culture.Count; cu++)
{
if (strValue == cu.ToString())
{
if (Culture != cu)
{
Culture = cu;
return CfgUpdateFlags.RestartRqrd;
}
else
{
return CfgUpdateFlags.None;
}
}
}
return CfgUpdateFlags.Error;
case 2: EliminateSpaces = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 3: PrintCaption = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
default: return CfgUpdateFlags.None;
}
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
switch (i)
{
case 0: return true;
case 1:
for (Culture cu = 0; cu < Culture.Count; cu++)
{
if (strValue == cu.ToString()) return true;
}
break;
case 2:
case 3:
if (strValue == Strings.yes || strValue == Strings.no) return true;
break;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(TriggerCfg prms)
{
prms.EventSource = this.EventSource;
prms.Culture = this.Culture;
prms.EliminateSpaces = this.EliminateSpaces;
prms.PrintCaption = this.PrintCaption;
}
public Config.Entities.IParamsProvider Clone()
{
TriggerCfg pars = new TriggerCfg();
CopyContentTo(pars);
return pars;
}
public bool UpdateEmbeddedDbEntity()
{
return true; /// =OK, do nothing
}
}
}
@@ -8,7 +8,6 @@ using log4net;
using Config;
using Config.Entities;
using Results.Output;
using Events.Entities;
namespace TBF.BenchControl.Output.FileWriters.IperlLogger
{
@@ -156,28 +155,9 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
}
if (anyError)
{
try
{
NHibernate.ISession session = Events.DB.CreateSession();
Events.DB.LoadSubscribers(session);
TBF.UiBridge.Bridge.TriggerEvent(session, Name, EventClass.ComputerResources, Severity.Error,
string.Format("Nepodarilo sa uložiť logy pre WZ Datenbank: Číslo dávky={0}", batch.BatchNr),
string.Format("Nepodarilo sa uložiť logy pre WZ Datenbank\r\nČíslo dávky = {0}", batch.BatchNr),
SubscriberGroup.Metrology | SubscriberGroup.Maintenance | SubscriberGroup.Production);
}
catch (Exception exc)
{
log.ErrorFormat("Triggering event(s) failed: {0}", exc.Message);
}
return Event.ErrorProcessingResults;
}
else
{
return Event.ResultsWritten;
}
}
else
{
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -102,10 +102,6 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
printerCfg.DocName = newCfg.DocName;
printerCfg.NrOfCopies = newCfg.NrOfCopies;
printerCfg.BarcodeType = newCfg.BarcodeType;
printerCfg.BarcodeWidth = newCfg.BarcodeWidth;
printerCfg.BarcodeHeight = newCfg.BarcodeHeight;
ApplyConfig();
}
}
@@ -195,9 +191,6 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
CommonItems = printerCfg.CommonItems,
TestItems = printerCfg.SelectedItems,
Footer = printerCfg.Footer,
BarcodeType = printerCfg.BarcodeType,
BarcodeWidth = printerCfg.BarcodeWidth,
BarcodeHeight = printerCfg.BarcodeHeight,
};
for (int i = 1; i <= printerCfg.NrOfCopies; i++)

Some files were not shown because too many files have changed in this diff Show More