Compare commits
138
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2276c086c | ||
|
|
4fa462661c | ||
|
|
2b30d0cf34 | ||
|
|
df2c56e6c4 | ||
|
|
a997c3d7be | ||
|
|
3c964f2aab | ||
|
|
c445b3e098 | ||
|
|
2ea2a2592e | ||
|
|
27072598cd | ||
|
|
4a2d4772d7 | ||
|
|
2bf00606d3 | ||
|
|
3773e1d96c | ||
|
|
19ddc753c7 | ||
|
|
0c41c750e8 | ||
|
|
4bfd5c8e11 | ||
|
|
f0fb70e38b | ||
|
|
6e5bcafec0 | ||
|
|
d5cb18c910 | ||
|
|
3a2069b255 | ||
|
|
80c651dbfd | ||
|
|
5a3b9b57c4 | ||
|
|
ead350eef3 | ||
|
|
b43657a4db | ||
|
|
8fffb9e366 | ||
|
|
0fdd229141 | ||
|
|
2f1ada3f5b | ||
|
|
988a8c6642 | ||
|
|
42ee9eaee3 | ||
|
|
3f28051d79 | ||
|
|
65f13cc868 | ||
|
|
cd8ba3cda3 | ||
|
|
a5936c8f19 | ||
|
|
2842425673 | ||
|
|
06a401a1ff | ||
|
|
3a2fc50fec | ||
|
|
38a58ed8b7 | ||
|
|
c7cba20de0 | ||
|
|
6311df49c3 | ||
|
|
f1d32a39ba | ||
|
|
224b53f774 | ||
|
|
1e2777c5e7 | ||
|
|
c3c21649fb | ||
|
|
99ccabc142 | ||
|
|
f1e6e94450 | ||
|
|
320cddb177 | ||
|
|
42002e3fa4 | ||
|
|
77cabfd712 | ||
|
|
c933e2d759 | ||
|
|
f3f0a46627 | ||
|
|
b5fb4c2947 | ||
|
|
f6cce9df3c | ||
|
|
c0385c0782 | ||
|
|
db43bdb652 | ||
|
|
6bdc10f4a7 | ||
|
|
9692dc7f4f | ||
|
|
6795793858 | ||
|
|
a2c564d789 | ||
|
|
3bc9e731e8 | ||
|
|
95c5f09238 | ||
|
|
0a45d66c0b | ||
|
|
96408eaef3 | ||
|
|
cae3ca7cdf | ||
|
|
c8adc093e0 | ||
|
|
4395516216 | ||
|
|
9281b52464 | ||
|
|
6571de7c32 | ||
|
|
a75d66e028 | ||
|
|
e839148a6f | ||
|
|
65b502a9b1 | ||
|
|
9cde62b2e2 | ||
|
|
cc86c38246 | ||
|
|
357df87f49 | ||
|
|
4b33da565c | ||
|
|
d11f855325 | ||
|
|
eef1f31a21 | ||
|
|
b878ee96a5 | ||
|
|
97eed27458 | ||
|
|
fe08550dc3 | ||
|
|
8a0ae8080f | ||
|
|
ab4025e55f | ||
|
|
22fffe602c | ||
|
|
e4c0219783 | ||
|
|
3362fdfaff | ||
|
|
6093db4502 | ||
|
|
5e7598667b | ||
|
|
4fe8729b85 | ||
|
|
b1dd6666f1 | ||
|
|
a3613889e1 | ||
|
|
7b87d63531 | ||
|
|
d838c78a8a | ||
|
|
7a8bef501a | ||
|
|
9863b54bc8 | ||
|
|
e57c6a6a02 | ||
|
|
afa215534c | ||
|
|
780d44166e | ||
|
|
35e4078dda | ||
|
|
47e09584f2 | ||
|
|
fc8e82c0e8 | ||
|
|
b729b08da2 | ||
|
|
3209ff303c | ||
|
|
41693d9c83 | ||
|
|
8f02f4ff31 | ||
|
|
1525bb7c1a | ||
|
|
2aeaf42325 | ||
|
|
bf4fb469da | ||
|
|
efd0515295 | ||
|
|
be8ac28bc7 | ||
|
|
56dc89ac82 | ||
|
|
62ffc94c49 | ||
|
|
50a38bc557 | ||
|
|
3e643854bc | ||
|
|
0daefb93bb | ||
|
|
f5731c67a0 | ||
|
|
d2ae5f3e83 | ||
|
|
c4d332b68b | ||
|
|
1daa0212ef | ||
|
|
1748a83ec8 | ||
|
|
b3d6b5a59f | ||
|
|
891795b101 | ||
|
|
a20b0761fd | ||
|
|
3b9e8d754d | ||
|
|
fed3281525 | ||
|
|
c1d966d86a | ||
|
|
b2d2f8c13b | ||
|
|
4e5e3d63e1 | ||
|
|
25602fb914 | ||
|
|
602d0d5308 | ||
|
|
f95198e40e | ||
|
|
d2b2bbb94b | ||
|
|
a4246c7ea4 | ||
|
|
498fc21412 | ||
|
|
3f07a506ad | ||
|
|
3a2290570d | ||
|
|
3b68e3f9fd | ||
|
|
3184b1da8e | ||
|
|
b70a10e697 | ||
|
|
203c2498ac | ||
|
|
2023ea5221 |
+15
-4
@@ -1,3 +1,5 @@
|
|||||||
|
AppDiagnostic/bin/
|
||||||
|
AppDiagnostic/obj/
|
||||||
Common/bin/
|
Common/bin/
|
||||||
Common/obj/
|
Common/obj/
|
||||||
Config/bin/
|
Config/bin/
|
||||||
@@ -30,6 +32,10 @@ LabelPrinting/bin/
|
|||||||
LabelPrinting/obj/
|
LabelPrinting/obj/
|
||||||
MergeResultsDBs/bin/
|
MergeResultsDBs/bin/
|
||||||
MergeResultsDBs/obj/
|
MergeResultsDBs/obj/
|
||||||
|
NfcC7_Dll/bin/
|
||||||
|
NfcC7_Dll/obj/
|
||||||
|
NfcC7_DLL.Tests/bin/
|
||||||
|
NfcC7_DLL.Tests/obj/
|
||||||
OrderManagement/bin/
|
OrderManagement/bin/
|
||||||
OrderManagement/obj/
|
OrderManagement/obj/
|
||||||
ProductionTracing/bin/
|
ProductionTracing/bin/
|
||||||
@@ -48,14 +54,18 @@ ResultsParser/bin/
|
|||||||
ResultsParser/obj/
|
ResultsParser/obj/
|
||||||
S640TestApp/bin/
|
S640TestApp/bin/
|
||||||
S640TestApp/obj/
|
S640TestApp/obj/
|
||||||
SharedDatabase/bin
|
SharedComponents/bin/
|
||||||
SharedDatabase/obj
|
SharedComponents/obj/
|
||||||
SchematicDrawing/bin
|
SharedDatabase/bin/
|
||||||
SchematicDrawing/obj
|
SharedDatabase/obj/
|
||||||
|
SchematicDrawing/bin/
|
||||||
|
SchematicDrawing/obj/
|
||||||
Statistics/bin/
|
Statistics/bin/
|
||||||
Statistics/obj/
|
Statistics/obj/
|
||||||
TBF/bin/
|
TBF/bin/
|
||||||
TBF/obj/
|
TBF/obj/
|
||||||
|
TBFTests/bin/
|
||||||
|
TBFTests/obj/
|
||||||
ToFirstMonitor/bin/
|
ToFirstMonitor/bin/
|
||||||
ToFirstMonitor/obj/
|
ToFirstMonitor/obj/
|
||||||
ToSecondMonitor/bin/
|
ToSecondMonitor/bin/
|
||||||
@@ -80,3 +90,4 @@ Users/obj/
|
|||||||
.idea/
|
.idea/
|
||||||
*.suo
|
*.suo
|
||||||
*.bak
|
*.bak
|
||||||
|
TBF.sln.DotSettings.user
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
|
</startup>
|
||||||
|
<log4net>
|
||||||
|
<appender name="LogCacheAppender" type="Namespace.LogCacheAppender, AssemblyName">
|
||||||
|
<param name="Cache" value="YourCacheInstance" />
|
||||||
|
<layout type="log4net.Layout.PatternLayout">
|
||||||
|
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
|
||||||
|
</layout>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<root>
|
||||||
|
<level value="DEBUG" />
|
||||||
|
<appender-ref ref="LogCacheAppender" />
|
||||||
|
</root>
|
||||||
|
</log4net>
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{FA9ABAD1-7184-4295-ADE8-D44F2E3DE6B2}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>AppDiagnostic</RootNamespace>
|
||||||
|
<AssemblyName>AppDiagnostic</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</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="log4net, Version=3.0.3.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\log4net.3.0.3\lib\net462\log4net.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Configuration" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Web" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Deployment" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="BufferedListView.cs">
|
||||||
|
<SubType>Component</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DiagApi.cs" />
|
||||||
|
<Compile Include="LogAdapter.cs" />
|
||||||
|
<Compile Include="LogFilter.cs" />
|
||||||
|
<Compile Include="MainForm.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="MainForm.Designer.cs">
|
||||||
|
<DependentUpon>MainForm.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<EmbeddedResource Include="MainForm.resx">
|
||||||
|
<DependentUpon>MainForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
</Compile>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\SharedComponents\SharedComponents.csproj">
|
||||||
|
<Project>{8f942729-f454-4c99-ba6c-746962065ae3}</Project>
|
||||||
|
<Name>SharedComponents</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Resources\TBF_icon.ico" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
public class BufferedListView : ListView
|
||||||
|
{
|
||||||
|
public BufferedListView()
|
||||||
|
{
|
||||||
|
// Zapne dvojité bufferovanie pre ListView
|
||||||
|
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
|
||||||
|
this.UpdateStyles();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace AppDiagnostic
|
||||||
|
{
|
||||||
|
public class DiagApi
|
||||||
|
{
|
||||||
|
private static MainForm diagWindow; // Udržiava referenciu na existujúce okno
|
||||||
|
|
||||||
|
public DiagApi()
|
||||||
|
{
|
||||||
|
if (diagWindow == null || diagWindow.IsDisposed) // Ak okno neexistuje, vytvoríme ho
|
||||||
|
{
|
||||||
|
diagWindow = new MainForm();
|
||||||
|
diagWindow.FormClosing += (s, e) =>
|
||||||
|
{
|
||||||
|
diagWindow = null; // Keď sa zavrie, vyčistíme referenciu
|
||||||
|
};
|
||||||
|
diagWindow.Show();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
diagWindow.BringToFront(); // Ak už beží, len ho presunieme na vrch
|
||||||
|
diagWindow.WindowState = FormWindowState.Normal; // Ak je minimalizované, obnovíme ho
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,174 @@
|
|||||||
|
using SharedComponents;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace AppDiagnostic
|
||||||
|
{
|
||||||
|
public class LogAdapter
|
||||||
|
{
|
||||||
|
private ListView _listView;
|
||||||
|
public string _filterText = string.Empty;
|
||||||
|
private bool _isUserScrolling = false; // Indikátor, že používateľ manuálne scrolluje
|
||||||
|
private bool _autoScrollEnabled = true; // Indikátor, že automatické scrollovanie je povolené
|
||||||
|
private Timer _refreshTimer;
|
||||||
|
private const int RefreshInterval = 1000;
|
||||||
|
|
||||||
|
public LogAdapter(ListView listView)
|
||||||
|
{
|
||||||
|
_listView = listView;
|
||||||
|
|
||||||
|
// Nastavenie ListView
|
||||||
|
_listView.View = View.Details;
|
||||||
|
_listView.Columns.Clear();
|
||||||
|
_listView.Columns.Add("Logs");
|
||||||
|
|
||||||
|
_listView.Scrollable = true;
|
||||||
|
|
||||||
|
// Nastavenie šírky stĺpca na celú šírku ListView
|
||||||
|
AdjustColumnWidth();
|
||||||
|
|
||||||
|
// Udalosť pre dynamickú zmenu veľkosti stĺpca pri zmene veľkosti ListView
|
||||||
|
_listView.Resize += (sender, args) => AdjustColumnWidth();
|
||||||
|
|
||||||
|
// Pridanie udalosti pre manuálne skrolovanie
|
||||||
|
_listView.MouseWheel += ListView_MouseWheel;
|
||||||
|
|
||||||
|
// Inicializácia časovača na pravidelný refresh
|
||||||
|
_refreshTimer = new Timer { Interval = RefreshInterval };
|
||||||
|
_refreshTimer.Tick += (sender, args) => RefreshListView();
|
||||||
|
_refreshTimer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ListView_MouseWheel(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
_isUserScrolling = true;
|
||||||
|
|
||||||
|
// Ak sa manuálnym scrollovaním používateľ dostane na koniec, obnovíme automatické scrollovanie
|
||||||
|
if (IsOnLastItem())
|
||||||
|
{
|
||||||
|
_isUserScrolling = false;
|
||||||
|
_autoScrollEnabled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_autoScrollEnabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RefreshListView()
|
||||||
|
{
|
||||||
|
//LiveLogCache.Instance.AddLog(string.Format("-------------------------------RunDeviceAfter()-------------------------------"));
|
||||||
|
|
||||||
|
if (_listView.InvokeRequired)
|
||||||
|
{
|
||||||
|
_listView.Invoke(new Action(RefreshListView));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_listView.BeginUpdate();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Získanie pozície prvého viditeľného prvku pre stabilizáciu scrollovania
|
||||||
|
int topIndexBeforeRefresh = _listView.TopItem?.Index ?? 0;
|
||||||
|
|
||||||
|
// Pred pridaním nových položiek si pamätáme, či bol používateľ na poslednej položke
|
||||||
|
bool wasOnLastItem = IsOnLastItem();
|
||||||
|
|
||||||
|
// Uchovanie aktuálne označených položiek (indexov)
|
||||||
|
var selectedIndices = _listView.SelectedIndices.Cast<int>().ToList();
|
||||||
|
|
||||||
|
// Načítanie logov
|
||||||
|
var logs = LiveLogCache.Instance.GetLogs(0, LiveLogCache.Instance.GetCount())
|
||||||
|
.Where(log => string.IsNullOrEmpty(_filterText) ||
|
||||||
|
log.IndexOf(_filterText, StringComparison.OrdinalIgnoreCase) >= 0)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
// Vymazanie existujúcich položiek a pridanie nových
|
||||||
|
_listView.Items.Clear();
|
||||||
|
|
||||||
|
foreach (var log in logs)
|
||||||
|
{
|
||||||
|
var item = new ListViewItem(log)
|
||||||
|
{
|
||||||
|
BackColor = _listView.Items.Count % 2 == 0 ? Color.White : Color.FromArgb(240, 240, 240)
|
||||||
|
};
|
||||||
|
_listView.Items.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Obnovenie označených položiek
|
||||||
|
foreach (var index in selectedIndices)
|
||||||
|
{
|
||||||
|
if (index < _listView.Items.Count)
|
||||||
|
{
|
||||||
|
_listView.Items[index].Selected = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ak bol používateľ na poslednom prvku, nastavíme focus a scroll na posledný prvok
|
||||||
|
if (_autoScrollEnabled && wasOnLastItem && _listView.Items.Count > 0)
|
||||||
|
{
|
||||||
|
var lastItemIndex = _listView.Items.Count - 1;
|
||||||
|
_listView.EnsureVisible(lastItemIndex);
|
||||||
|
_listView.Items[lastItemIndex].Focused = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Ak používateľ nebol na spodku, vrátime sa na predchádzajúcu pozíciu scrollu
|
||||||
|
if (topIndexBeforeRefresh < _listView.Items.Count)
|
||||||
|
{
|
||||||
|
_listView.TopItem = _listView.Items[topIndexBeforeRefresh];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_listView.EndUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void ApplyFilter(string filterText)
|
||||||
|
{
|
||||||
|
_filterText = filterText?.Trim() ?? string.Empty;
|
||||||
|
RefreshListView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool IsOnLastItem()
|
||||||
|
{
|
||||||
|
if (_listView.Items.Count == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Získame poslednú položku
|
||||||
|
int lastItemIndex = _listView.Items.Count - 1;
|
||||||
|
var lastItem = _listView.Items[lastItemIndex];
|
||||||
|
|
||||||
|
// Overíme, či je posledná položka úplne viditeľná
|
||||||
|
return lastItem.Bounds.Bottom <= _listView.ClientRectangle.Bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void EnableAutoScroll()
|
||||||
|
{
|
||||||
|
_autoScrollEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DisableAutoScroll()
|
||||||
|
{
|
||||||
|
_autoScrollEnabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AdjustColumnWidth()
|
||||||
|
{
|
||||||
|
if (_listView.Columns.Count > 0)
|
||||||
|
{
|
||||||
|
_listView.Columns[0].Width = _listView.ClientSize.Width;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
using SharedComponents;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace AppDiagnostic
|
||||||
|
{
|
||||||
|
public class LogFilter
|
||||||
|
{
|
||||||
|
private ListView _listView;
|
||||||
|
private string _filterText = string.Empty; // Pre uloženie aktuálneho filtrovaného reťazca
|
||||||
|
|
||||||
|
// Konstruktor
|
||||||
|
public LogFilter(ListView listView)
|
||||||
|
{
|
||||||
|
_listView = listView;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Metóda na aplikovanie filtra na ListView
|
||||||
|
public void ApplyFilter(string filterText)
|
||||||
|
{
|
||||||
|
_filterText = filterText.ToLower(); // Ukladáme text filtra bez ohľadu na veľkosť písmen
|
||||||
|
|
||||||
|
// Po aplikovaní filtra obnovíme zobrazenie
|
||||||
|
RefreshListView();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RefreshListView()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Skontrolujeme, či sme na hlavnom vlákne a v prípade potreby použijeme Invoke
|
||||||
|
if (_listView.InvokeRequired)
|
||||||
|
{
|
||||||
|
// Použijeme Invoke, ak nie sme na hlavnom vlákne
|
||||||
|
_listView.Invoke(new Action(RefreshListView));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Vymazanie existujúcich položiek
|
||||||
|
_listView.Items.Clear();
|
||||||
|
|
||||||
|
// Načítame všetky logy (ideálne z cache alebo databázy)
|
||||||
|
var logs = LiveLogCache.Instance.GetLogs(0, LiveLogCache.Instance.Logs.Count);
|
||||||
|
|
||||||
|
// Pridáme len tie logy, ktoré spĺňajú filter
|
||||||
|
foreach (var log in logs)
|
||||||
|
{
|
||||||
|
if (log.ToLower().Contains(_filterText)) // Kontrola, či log obsahuje filter text
|
||||||
|
{
|
||||||
|
var listViewItem = new ListViewItem(log);
|
||||||
|
|
||||||
|
// Striedanie farieb riadkov
|
||||||
|
if (_listView.Items.Count % 2 == 0) // Párny index => biela
|
||||||
|
{
|
||||||
|
listViewItem.BackColor = Color.White;
|
||||||
|
}
|
||||||
|
else // Nepárny index => svetlá sivá
|
||||||
|
{
|
||||||
|
listViewItem.BackColor = Color.FromArgb(240, 240, 240); // Veľmi svetlá sivá
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pridanie efektu pre novú položku
|
||||||
|
ApplyNewItemEffect(listViewItem);
|
||||||
|
|
||||||
|
// Pridanie položky do ListView
|
||||||
|
_listView.Items.Add(listViewItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
// Zachytíme výnimku, ak sa niečo pokazí, a zobrazíme ju užívateľovi
|
||||||
|
MessageBox.Show($"An error occurred while refreshing the log view: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Môžete pridať ďalšie metódy na zobrazenie alebo efekt pre nové položky, ak je to potrebné
|
||||||
|
private void ApplyNewItemEffect(ListViewItem item)
|
||||||
|
{
|
||||||
|
// Prípadný efekt pre nový pridaný log
|
||||||
|
// Môžete pridať animáciu alebo zmenu farby atď.
|
||||||
|
item.ForeColor = Color.Green; // Napríklad zmeníme farbu písma na zelenú
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+278
@@ -0,0 +1,278 @@
|
|||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace AppDiagnostic
|
||||||
|
{
|
||||||
|
partial class MainForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
//private BufferedListView memoListView;
|
||||||
|
private System.Windows.Forms.ColumnHeader columnHeaderTime;
|
||||||
|
private System.Windows.Forms.ColumnHeader columnHeaderMessage;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.columnHeaderTime = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
|
this.columnHeaderMessage = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
|
this.panel1 = new System.Windows.Forms.Panel();
|
||||||
|
this.refreshMemoButton = new System.Windows.Forms.Button();
|
||||||
|
this.button6 = new System.Windows.Forms.Button();
|
||||||
|
this.button7 = new System.Windows.Forms.Button();
|
||||||
|
this.filterManagementPanel = new System.Windows.Forms.Panel();
|
||||||
|
this.button5 = new System.Windows.Forms.Button();
|
||||||
|
this.filterButton = new System.Windows.Forms.Button();
|
||||||
|
this.filterTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.wndControlPanel = new System.Windows.Forms.Panel();
|
||||||
|
this.button2 = new System.Windows.Forms.Button();
|
||||||
|
this.flowControlsPanel = new System.Windows.Forms.Panel();
|
||||||
|
this.runButton = new System.Windows.Forms.Button();
|
||||||
|
this.stopButton = new System.Windows.Forms.Button();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.memoListView = new BufferedListView();
|
||||||
|
this.panel1.SuspendLayout();
|
||||||
|
this.filterManagementPanel.SuspendLayout();
|
||||||
|
this.wndControlPanel.SuspendLayout();
|
||||||
|
this.flowControlsPanel.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// columnHeaderTime
|
||||||
|
//
|
||||||
|
this.columnHeaderTime.Text = "Time";
|
||||||
|
this.columnHeaderTime.Width = 150;
|
||||||
|
//
|
||||||
|
// columnHeaderMessage
|
||||||
|
//
|
||||||
|
this.columnHeaderMessage.Text = "Message";
|
||||||
|
this.columnHeaderMessage.Width = 350;
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.panel1.Controls.Add(this.refreshMemoButton);
|
||||||
|
this.panel1.Controls.Add(this.button6);
|
||||||
|
this.panel1.Controls.Add(this.button7);
|
||||||
|
this.panel1.Location = new System.Drawing.Point(189, 356);
|
||||||
|
this.panel1.Name = "panel1";
|
||||||
|
this.panel1.Size = new System.Drawing.Size(283, 26);
|
||||||
|
this.panel1.TabIndex = 16;
|
||||||
|
//
|
||||||
|
// refreshMemoButton
|
||||||
|
//
|
||||||
|
this.refreshMemoButton.Location = new System.Drawing.Point(108, 0);
|
||||||
|
this.refreshMemoButton.Name = "refreshMemoButton";
|
||||||
|
this.refreshMemoButton.Size = new System.Drawing.Size(84, 26);
|
||||||
|
this.refreshMemoButton.TabIndex = 17;
|
||||||
|
this.refreshMemoButton.Text = "Refresh memo";
|
||||||
|
this.refreshMemoButton.UseVisualStyleBackColor = true;
|
||||||
|
this.refreshMemoButton.Click += new System.EventHandler(this.refreshMemoButton_Click);
|
||||||
|
//
|
||||||
|
// button6
|
||||||
|
//
|
||||||
|
this.button6.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.button6.Name = "button6";
|
||||||
|
this.button6.Size = new System.Drawing.Size(102, 26);
|
||||||
|
this.button6.TabIndex = 4;
|
||||||
|
this.button6.Text = "Clean diag cache";
|
||||||
|
this.button6.UseVisualStyleBackColor = true;
|
||||||
|
this.button6.Click += new System.EventHandler(this.button6_Click);
|
||||||
|
//
|
||||||
|
// button7
|
||||||
|
//
|
||||||
|
this.button7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.button7.Location = new System.Drawing.Point(198, 0);
|
||||||
|
this.button7.Name = "button7";
|
||||||
|
this.button7.Size = new System.Drawing.Size(72, 26);
|
||||||
|
this.button7.TabIndex = 5;
|
||||||
|
this.button7.Text = "Save logs";
|
||||||
|
this.button7.UseVisualStyleBackColor = true;
|
||||||
|
this.button7.Click += new System.EventHandler(this.button7_Click);
|
||||||
|
//
|
||||||
|
// filterManagementPanel
|
||||||
|
//
|
||||||
|
this.filterManagementPanel.Controls.Add(this.button5);
|
||||||
|
this.filterManagementPanel.Controls.Add(this.filterButton);
|
||||||
|
this.filterManagementPanel.Controls.Add(this.filterTextBox);
|
||||||
|
this.filterManagementPanel.Controls.Add(this.label2);
|
||||||
|
this.filterManagementPanel.Location = new System.Drawing.Point(127, 6);
|
||||||
|
this.filterManagementPanel.Name = "filterManagementPanel";
|
||||||
|
this.filterManagementPanel.Size = new System.Drawing.Size(393, 26);
|
||||||
|
this.filterManagementPanel.TabIndex = 15;
|
||||||
|
//
|
||||||
|
// button5
|
||||||
|
//
|
||||||
|
this.button5.Enabled = false;
|
||||||
|
this.button5.Location = new System.Drawing.Point(294, 4);
|
||||||
|
this.button5.Name = "button5";
|
||||||
|
this.button5.Size = new System.Drawing.Size(81, 20);
|
||||||
|
this.button5.TabIndex = 11;
|
||||||
|
this.button5.Text = "Add new filter";
|
||||||
|
this.button5.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// filterButton
|
||||||
|
//
|
||||||
|
this.filterButton.Location = new System.Drawing.Point(225, 4);
|
||||||
|
this.filterButton.Name = "filterButton";
|
||||||
|
this.filterButton.Size = new System.Drawing.Size(64, 20);
|
||||||
|
this.filterButton.TabIndex = 10;
|
||||||
|
this.filterButton.Text = "Set filter";
|
||||||
|
this.filterButton.UseVisualStyleBackColor = true;
|
||||||
|
this.filterButton.Click += new System.EventHandler(this.filterButton_Click_1);
|
||||||
|
//
|
||||||
|
// filterTextBox
|
||||||
|
//
|
||||||
|
this.filterTextBox.Location = new System.Drawing.Point(33, 4);
|
||||||
|
this.filterTextBox.Name = "filterTextBox";
|
||||||
|
this.filterTextBox.Size = new System.Drawing.Size(187, 20);
|
||||||
|
this.filterTextBox.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(3, 8);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(29, 13);
|
||||||
|
this.label2.TabIndex = 6;
|
||||||
|
this.label2.Text = "Filter";
|
||||||
|
//
|
||||||
|
// wndControlPanel
|
||||||
|
//
|
||||||
|
this.wndControlPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.wndControlPanel.Controls.Add(this.button2);
|
||||||
|
this.wndControlPanel.Location = new System.Drawing.Point(831, 356);
|
||||||
|
this.wndControlPanel.Name = "wndControlPanel";
|
||||||
|
this.wndControlPanel.Size = new System.Drawing.Size(70, 26);
|
||||||
|
this.wndControlPanel.TabIndex = 14;
|
||||||
|
//
|
||||||
|
// button2
|
||||||
|
//
|
||||||
|
this.button2.Location = new System.Drawing.Point(3, 0);
|
||||||
|
this.button2.Name = "button2";
|
||||||
|
this.button2.Size = new System.Drawing.Size(64, 26);
|
||||||
|
this.button2.TabIndex = 2;
|
||||||
|
this.button2.Text = "Close";
|
||||||
|
this.button2.UseVisualStyleBackColor = true;
|
||||||
|
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||||
|
//
|
||||||
|
// flowControlsPanel
|
||||||
|
//
|
||||||
|
this.flowControlsPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.flowControlsPanel.Controls.Add(this.runButton);
|
||||||
|
this.flowControlsPanel.Controls.Add(this.stopButton);
|
||||||
|
this.flowControlsPanel.Location = new System.Drawing.Point(12, 356);
|
||||||
|
this.flowControlsPanel.Name = "flowControlsPanel";
|
||||||
|
this.flowControlsPanel.Size = new System.Drawing.Size(133, 26);
|
||||||
|
this.flowControlsPanel.TabIndex = 13;
|
||||||
|
//
|
||||||
|
// runButton
|
||||||
|
//
|
||||||
|
this.runButton.Enabled = false;
|
||||||
|
this.runButton.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.runButton.Name = "runButton";
|
||||||
|
this.runButton.Size = new System.Drawing.Size(64, 26);
|
||||||
|
this.runButton.TabIndex = 4;
|
||||||
|
this.runButton.Text = "Run";
|
||||||
|
this.runButton.UseVisualStyleBackColor = true;
|
||||||
|
this.runButton.Click += new System.EventHandler(this.runButton_Click);
|
||||||
|
//
|
||||||
|
// stopButton
|
||||||
|
//
|
||||||
|
this.stopButton.Location = new System.Drawing.Point(69, 0);
|
||||||
|
this.stopButton.Name = "stopButton";
|
||||||
|
this.stopButton.Size = new System.Drawing.Size(64, 26);
|
||||||
|
this.stopButton.TabIndex = 5;
|
||||||
|
this.stopButton.Text = "Stop";
|
||||||
|
this.stopButton.UseVisualStyleBackColor = true;
|
||||||
|
this.stopButton.Click += new System.EventHandler(this.stopButton_Click);
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(12, 19);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(76, 13);
|
||||||
|
this.label1.TabIndex = 12;
|
||||||
|
this.label1.Text = "Flow of events";
|
||||||
|
//
|
||||||
|
// memoListView
|
||||||
|
//
|
||||||
|
this.memoListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.memoListView.FullRowSelect = true;
|
||||||
|
this.memoListView.GridLines = true;
|
||||||
|
this.memoListView.HideSelection = false;
|
||||||
|
this.memoListView.Location = new System.Drawing.Point(12, 38);
|
||||||
|
this.memoListView.Name = "memoListView";
|
||||||
|
this.memoListView.Size = new System.Drawing.Size(889, 312);
|
||||||
|
this.memoListView.TabIndex = 0;
|
||||||
|
this.memoListView.UseCompatibleStateImageBehavior = false;
|
||||||
|
this.memoListView.View = System.Windows.Forms.View.Details;
|
||||||
|
|
||||||
|
this.memoListView.DoubleClick += new System.EventHandler(this.MemoListView_DoubleClick);
|
||||||
|
//
|
||||||
|
// MainForm
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(913, 388);
|
||||||
|
this.Controls.Add(this.memoListView);
|
||||||
|
this.Controls.Add(this.panel1);
|
||||||
|
this.Controls.Add(this.filterManagementPanel);
|
||||||
|
this.Controls.Add(this.wndControlPanel);
|
||||||
|
this.Controls.Add(this.flowControlsPanel);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Name = "MainForm";
|
||||||
|
this.Text = "Application live diagnostic";
|
||||||
|
this.panel1.ResumeLayout(false);
|
||||||
|
this.filterManagementPanel.ResumeLayout(false);
|
||||||
|
this.filterManagementPanel.PerformLayout();
|
||||||
|
this.wndControlPanel.ResumeLayout(false);
|
||||||
|
this.flowControlsPanel.ResumeLayout(false);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Panel panel1;
|
||||||
|
private System.Windows.Forms.Button button6;
|
||||||
|
private System.Windows.Forms.Button button7;
|
||||||
|
private System.Windows.Forms.Panel filterManagementPanel;
|
||||||
|
private System.Windows.Forms.Button button5;
|
||||||
|
private System.Windows.Forms.Button filterButton;
|
||||||
|
private System.Windows.Forms.TextBox filterTextBox;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.Panel wndControlPanel;
|
||||||
|
private System.Windows.Forms.Button button2;
|
||||||
|
private System.Windows.Forms.Panel flowControlsPanel;
|
||||||
|
private System.Windows.Forms.Button runButton;
|
||||||
|
private System.Windows.Forms.Button stopButton;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.Button refreshMemoButton;
|
||||||
|
private BufferedListView memoListView;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,268 @@
|
|||||||
|
using log4net.Config;
|
||||||
|
using log4net;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using log4net.Appender;
|
||||||
|
using SharedComponents;
|
||||||
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||||
|
using System.IO; // Pre File.WriteAllLines a prácu so súbormi
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace AppDiagnostic
|
||||||
|
{
|
||||||
|
public partial class MainForm : Form
|
||||||
|
{
|
||||||
|
private bool stopUpdate = false; // Premenná na zastavenie aktualizácie
|
||||||
|
private int lastDisplayedLogIndex = 0;
|
||||||
|
private bool autoScrollEnabled = true; // Automatický posun, predvolene povolený
|
||||||
|
private MainForm appDiagnosticForm;
|
||||||
|
private Timer refreshTimer;
|
||||||
|
private LogAdapter _logAdapter; // Pre LogAdapter
|
||||||
|
private LogFilter _logFilter; // LogFilter objekt pre filtráciu
|
||||||
|
|
||||||
|
public MainForm()
|
||||||
|
{
|
||||||
|
this.Icon = Properties.Resources.TBF_icon;
|
||||||
|
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
// Inicializujeme LogAdapter a priradíme ho k memoListView
|
||||||
|
_logAdapter = new LogAdapter(memoListView);
|
||||||
|
|
||||||
|
RefreshLogView();
|
||||||
|
|
||||||
|
// Pripojenie na udalosť pri pridaní nového logu
|
||||||
|
// nakoľko sa memo refreshuje cyklicky, tak refresh na udalosť nepotrebujem
|
||||||
|
//LiveLogCache.Instance.LogAdded += OnLogAdded;
|
||||||
|
|
||||||
|
// Vytvoríme LogFilter objekt
|
||||||
|
//_logFilter = new LogFilter(memoListView);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnLogAdded(string log)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
RefreshLogView();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Error in OnLogAdded: {ex.Message}");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RefreshLogView()
|
||||||
|
{
|
||||||
|
// Skontrolujte, či voláme z iného vlákna
|
||||||
|
if (InvokeRequired)
|
||||||
|
{
|
||||||
|
Invoke((Action)RefreshLogView);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
memoListView.BeginUpdate(); // Zabraňuje vizuálnym aktualizáciám počas vykresľovania
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Skontrolujte, či je užívateľ na poslednom viditeľnom zázname
|
||||||
|
if (memoListView.Items.Count > 0)
|
||||||
|
{
|
||||||
|
var lastVisibleIndex = memoListView.TopItem.Index + memoListView.ClientRectangle.Height / memoListView.Items[0].Bounds.Height;
|
||||||
|
autoScrollEnabled = lastVisibleIndex >= memoListView.Items.Count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Získajte nové logy od posledného indexu
|
||||||
|
var logs = LiveLogCache.Instance.GetLogs(lastDisplayedLogIndex, LiveLogCache.Instance.Logs.Count - lastDisplayedLogIndex);
|
||||||
|
|
||||||
|
// Pridajte len nové logy
|
||||||
|
foreach (var log in logs)
|
||||||
|
{
|
||||||
|
memoListView.Items.Add(new ListViewItem(log));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Aktualizujte posledný zobrazený index
|
||||||
|
lastDisplayedLogIndex = LiveLogCache.Instance.Logs.Count;
|
||||||
|
|
||||||
|
// Ak je autoScrollEnabled, posuňte sa na posledný záznam
|
||||||
|
if (autoScrollEnabled && memoListView.Items.Count > 0)
|
||||||
|
{
|
||||||
|
memoListView.EnsureVisible(memoListView.Items.Count - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
memoListView.EndUpdate(); // Umožní vizuálne aktualizácie
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Táto metóda sa spustí pri scrollovaní v memoListView (tzn. ak sa používateľ dostane na spodok listu)
|
||||||
|
private void memoListView_Scroll(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Skontrolujte, či používateľ dosiahol spodok ListView
|
||||||
|
if (memoListView.Items.Count > 0 &&
|
||||||
|
memoListView.Items[memoListView.Items.Count - 1].Bounds.Bottom <= memoListView.ClientSize.Height)
|
||||||
|
{
|
||||||
|
// Ak áno, načítame ďalšie logy
|
||||||
|
RefreshLogView();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button6_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//LiveLogCache.Instance.AddLog("Nový log z hlavnej aplikácie");
|
||||||
|
|
||||||
|
LiveLogCache.Instance.ClearLogs();
|
||||||
|
ClearListView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void runButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (stopUpdate) // Ak je časovač zastavený, spustíme ho
|
||||||
|
{
|
||||||
|
stopUpdate = false; // Zastav aktualizáciu
|
||||||
|
runButton.Enabled = false; // Zakážeme tlačidlo Start počas behu
|
||||||
|
stopButton.Enabled = true; // Povolenie tlačidla Stop
|
||||||
|
refreshTimer.Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void stopButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!stopUpdate) // Ak časovač beží, môžeme ho zastaviť
|
||||||
|
{
|
||||||
|
stopUpdate = true; // Spusti aktualizáciu
|
||||||
|
runButton.Enabled = true; // Povolenie tlačidla Start
|
||||||
|
stopButton.Enabled = false; // Zakážeme tlačidlo Stop
|
||||||
|
refreshTimer.Stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClearListView()
|
||||||
|
{
|
||||||
|
if (InvokeRequired)
|
||||||
|
{
|
||||||
|
Invoke(new Action(ClearListView));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
memoListView.Items.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshMemoButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button7_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SaveLogsToFile();
|
||||||
|
//LiveLogCache.Instance.AddLog("Toto je nový log.");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnFormClosing(FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
// Odpojenie udalosti, keď sa okno zatvára, inak môže po opätovnom spustení okna a pridaní nového itemu do listu zhhodiť program
|
||||||
|
// nakoľko sa memo refreshuje cyklicky, tak refresh na udalosť nepotrebujem
|
||||||
|
//LiveLogCache.Instance.LogAdded -= OnLogAdded;
|
||||||
|
|
||||||
|
_logAdapter = null;
|
||||||
|
|
||||||
|
base.OnFormClosing(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void filterButton_Click_1(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Aplikujeme filter na základe textu z filterTextBox
|
||||||
|
string filterText = filterTextBox.Text;
|
||||||
|
//_logFilter.ApplyFilter(filterText); // Aplikovanie filtra
|
||||||
|
_logAdapter.ApplyFilter(filterText);
|
||||||
|
}
|
||||||
|
private void SubForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Vaša logika pri uzatváraní formy
|
||||||
|
// this.Hide(); // Podforma sa len skryje
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
// Ošetrenie výnimky
|
||||||
|
MessageBox.Show("Chyba pri zatváraní pod-aplikácie: " + ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SaveLogsToFile()
|
||||||
|
{
|
||||||
|
using (SaveFileDialog saveFileDialog = new SaveFileDialog())
|
||||||
|
{
|
||||||
|
saveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
|
||||||
|
saveFileDialog.Title = "Save TBF live logs";
|
||||||
|
saveFileDialog.DefaultExt = "txt";
|
||||||
|
saveFileDialog.FileName = "TBFLiveLogs.txt";
|
||||||
|
|
||||||
|
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Načítanie všetkých logov z LiveLogCache
|
||||||
|
var logs = LiveLogCache.Instance.GetLogs(0, LiveLogCache.Instance.GetCount());
|
||||||
|
|
||||||
|
// Uloženie logov do vybraného súboru
|
||||||
|
File.WriteAllLines(saveFileDialog.FileName, logs);
|
||||||
|
|
||||||
|
MessageBox.Show("Logs saved successfully.", "Save TBF live logs", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"An error occurred while saving TBF live logs: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button2_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.Close();
|
||||||
|
//this.Hide(); // Podforma sa len skryje
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MemoListView_DoubleClick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (memoListView.SelectedItems.Count > 0)
|
||||||
|
{
|
||||||
|
var selectedItem = memoListView.SelectedItems[0];
|
||||||
|
int selectedIndex = memoListView.Items.IndexOf(selectedItem);
|
||||||
|
|
||||||
|
if (selectedIndex >= 0)
|
||||||
|
{
|
||||||
|
// Zrušenie filtra
|
||||||
|
_logAdapter._filterText = string.Empty;
|
||||||
|
|
||||||
|
// Načítanie logov od indexu vybraného riadku
|
||||||
|
var logs = LiveLogCache.Instance.GetLogs(selectedIndex, LiveLogCache.Instance.GetCount() - selectedIndex);
|
||||||
|
|
||||||
|
// Obnovenie ListView s novými údajmi
|
||||||
|
memoListView.BeginUpdate();
|
||||||
|
memoListView.Items.Clear();
|
||||||
|
foreach (var log in logs)
|
||||||
|
{
|
||||||
|
var item = new ListViewItem(log)
|
||||||
|
{
|
||||||
|
BackColor = memoListView.Items.Count % 2 == 0 ? Color.White : Color.FromArgb(240, 240, 240)
|
||||||
|
};
|
||||||
|
memoListView.Items.Add(item);
|
||||||
|
}
|
||||||
|
memoListView.EndUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace AppDiagnostic
|
||||||
|
{
|
||||||
|
internal static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The main entry point for the application.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.Run(new MainForm());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("AppDiagnostic")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("AppDiagnostic")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||||
|
[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("fa9abad1-7184-4295-ade8-d44f2e3de6b2")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
+73
@@ -0,0 +1,73 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace AppDiagnostic.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
/// </summary>
|
||||||
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
|
// class via a tool like ResGen or Visual Studio.
|
||||||
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
|
// with the /str option, or rebuild your VS project.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AppDiagnostic.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
|
/// resource lookups using this strongly typed resource class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Icon TBF_icon {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("TBF_icon", resourceCulture);
|
||||||
|
return ((System.Drawing.Icon)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
<?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>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="TBF_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\TBF_icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace AppDiagnostic.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="log4net" version="3.0.3" targetFramework="net472" />
|
||||||
|
</packages>
|
||||||
+21
-2
@@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Common
|
namespace Common
|
||||||
{
|
{
|
||||||
@@ -289,11 +290,20 @@ namespace Common
|
|||||||
CompoundAux,
|
CompoundAux,
|
||||||
Compound,
|
Compound,
|
||||||
HeatMeterVolume,
|
HeatMeterVolume,
|
||||||
HeatMeterEnergy,
|
HeatMeterMass,//...MF
|
||||||
|
HeatMeterEnergy,
|
||||||
SingleOrCompound, /// Only used when querying results
|
SingleOrCompound, /// Only used when querying results
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Medium
|
public enum PulsesTypeByQuantity : short
|
||||||
|
{
|
||||||
|
[Description("dm3")] Volume_dm3,
|
||||||
|
[Description("kg")] Mass_kg,
|
||||||
|
|
||||||
|
Count
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum Medium
|
||||||
{
|
{
|
||||||
[Description("")] NotSpecified,
|
[Description("")] NotSpecified,
|
||||||
#if LANG_PL
|
#if LANG_PL
|
||||||
@@ -829,6 +839,15 @@ namespace Common
|
|||||||
E63 = (1L << 62),
|
E63 = (1L << 62),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//...MF
|
||||||
|
public enum FlowType : int
|
||||||
|
{
|
||||||
|
none,
|
||||||
|
volume,
|
||||||
|
mass,
|
||||||
|
Count,
|
||||||
|
}
|
||||||
|
|
||||||
#region iPERL enums
|
#region iPERL enums
|
||||||
|
|
||||||
public enum Side
|
public enum Side
|
||||||
|
|||||||
+67
-2
@@ -33,6 +33,20 @@ namespace Common
|
|||||||
[Description("m3/m")] m3pm, /// 1 m3/m = 60 m3/h
|
[Description("m3/m")] m3pm, /// 1 m3/m = 60 m3/h
|
||||||
[Description("cf/s")] cfs, /// 1 cubic foot per second = 101.9406477312 m3/h
|
[Description("cf/s")] cfs, /// 1 cubic foot per second = 101.9406477312 m3/h
|
||||||
|
|
||||||
|
|
||||||
|
[Description("g/s")] gps, /// 1 g/s = 0.0036 t/h
|
||||||
|
[Description("g/min")] gpm, /// 1 g/min = 0.00006 t/h
|
||||||
|
[Description("g/h")] gph, /// 1 g/h = 0.000001 t/h
|
||||||
|
[Description("kg/s")] kgps, /// 1 kg/s = 3.6 t/h
|
||||||
|
[Description("kg/min")] kgpm, /// 1 kg/min = 0.06 t/h
|
||||||
|
[Description("kg/h")] kgph, /// 1 kg/h = 0.001 t/h
|
||||||
|
[Description("t/s")] tps, /// 1 t/s = 3600 t/h
|
||||||
|
[Description("t/min")] tpm, /// 1 t/min = 60 t/h
|
||||||
|
[Description("t/h")] tph, /// 1 t/h = 1 t/h
|
||||||
|
[Description("lb/s")] lbps, /// 1 lb/s ≈ 1.633 t/h
|
||||||
|
[Description("lb/min")] lbpm, /// 1 lb/min ≈ 0.027216 t/h
|
||||||
|
[Description("lb/h")] lbph, /// 1 lb/h ≈ 0.0004536 t/h
|
||||||
|
|
||||||
[Description("g")] g, /// 0.001 kg
|
[Description("g")] g, /// 0.001 kg
|
||||||
[Description("oz")] oz, /// 0.0283495231 kg
|
[Description("oz")] oz, /// 0.0283495231 kg
|
||||||
[Description("lb")] lb, /// 0.45359237 kg
|
[Description("lb")] lb, /// 0.45359237 kg
|
||||||
@@ -221,9 +235,13 @@ namespace Common
|
|||||||
[Description("Corrente")] Current,
|
[Description("Corrente")] Current,
|
||||||
[Description("Voltaggio")] Voltage,
|
[Description("Voltaggio")] Voltage,
|
||||||
#else
|
#else
|
||||||
|
[Description("RegisterReader")] RegisterReader,
|
||||||
|
[Description("MultiFunctionalVariables")] MultiFunctionalVariables,
|
||||||
|
[Description("VolumeFlow")] VolumeFlow,
|
||||||
[Description("Volume")] Volume,
|
[Description("Volume")] Volume,
|
||||||
[Description("Flow")] Flow,
|
[Description("Flow")] Flow,
|
||||||
[Description("Mass")] Mass,
|
[Description("MassFlow")] MassFlow,
|
||||||
|
[Description("Mass")] Mass,
|
||||||
[Description("Time")] Time,
|
[Description("Time")] Time,
|
||||||
[Description("Temperature")] Temperature,
|
[Description("Temperature")] Temperature,
|
||||||
[Description("Pressure")] Pressure,
|
[Description("Pressure")] Pressure,
|
||||||
@@ -234,6 +252,8 @@ namespace Common
|
|||||||
[Description("Energy")] Energy,
|
[Description("Energy")] Energy,
|
||||||
[Description("Pulses")] Pulses,
|
[Description("Pulses")] Pulses,
|
||||||
[Description("Pulses/liter")] PulsePerLtr,
|
[Description("Pulses/liter")] PulsePerLtr,
|
||||||
|
[Description("Pulses/kg")] PulsePerKilogram, //...MF
|
||||||
|
[Description("Pulses/Unit")] PulsePerUnit,//...MF
|
||||||
[Description("Pulses/kWh")] PulsePerKWh,
|
[Description("Pulses/kWh")] PulsePerKWh,
|
||||||
[Description("Conductivity")] Conductivity,
|
[Description("Conductivity")] Conductivity,
|
||||||
|
|
||||||
@@ -278,29 +298,72 @@ namespace Common
|
|||||||
return Quantity.Pulses;
|
return Quantity.Pulses;
|
||||||
|
|
||||||
case Unit.ml:
|
case Unit.ml:
|
||||||
|
return Quantity.Volume;
|
||||||
case Unit.l:
|
case Unit.l:
|
||||||
|
return Quantity.Volume;
|
||||||
case Unit.dm3:
|
case Unit.dm3:
|
||||||
|
return Quantity.Volume;
|
||||||
case Unit.USgal:
|
case Unit.USgal:
|
||||||
|
return Quantity.Volume;
|
||||||
case Unit.UKgal:
|
case Unit.UKgal:
|
||||||
|
return Quantity.Volume;
|
||||||
case Unit.cf:
|
case Unit.cf:
|
||||||
|
return Quantity.Volume;
|
||||||
case Unit.m3:
|
case Unit.m3:
|
||||||
return Quantity.Volume;
|
return Quantity.Volume;
|
||||||
|
|
||||||
case Unit.lph:
|
case Unit.lph:
|
||||||
|
return Quantity.Flow;
|
||||||
case Unit.cfph:
|
case Unit.cfph:
|
||||||
|
return Quantity.Flow;
|
||||||
case Unit.lpm:
|
case Unit.lpm:
|
||||||
|
return Quantity.Flow;
|
||||||
case Unit.USgalpm:
|
case Unit.USgalpm:
|
||||||
|
return Quantity.Flow;
|
||||||
case Unit.m3ph:
|
case Unit.m3ph:
|
||||||
|
return Quantity.Flow;
|
||||||
case Unit.lps:
|
case Unit.lps:
|
||||||
|
return Quantity.Flow;
|
||||||
case Unit.USgalps:
|
case Unit.USgalps:
|
||||||
|
return Quantity.Flow;
|
||||||
case Unit.m3pm:
|
case Unit.m3pm:
|
||||||
|
return Quantity.Flow;
|
||||||
case Unit.cfs:
|
case Unit.cfs:
|
||||||
return Quantity.Flow;
|
return Quantity.Flow;
|
||||||
|
|
||||||
|
case Unit.gps:
|
||||||
|
return Quantity.MassFlow;
|
||||||
|
case Unit.gpm:
|
||||||
|
return Quantity.MassFlow;
|
||||||
|
case Unit.gph:
|
||||||
|
return Quantity.MassFlow;
|
||||||
|
case Unit.kgps:
|
||||||
|
return Quantity.MassFlow;
|
||||||
|
case Unit.kgpm:
|
||||||
|
return Quantity.MassFlow;
|
||||||
|
case Unit.kgph:
|
||||||
|
return Quantity.MassFlow;
|
||||||
|
case Unit.tps:
|
||||||
|
return Quantity.MassFlow;
|
||||||
|
case Unit.tpm:
|
||||||
|
return Quantity.MassFlow;
|
||||||
|
case Unit.tph:
|
||||||
|
return Quantity.MassFlow;
|
||||||
|
case Unit.lbps:
|
||||||
|
return Quantity.MassFlow;
|
||||||
|
case Unit.lbpm:
|
||||||
|
return Quantity.MassFlow;
|
||||||
|
case Unit.lbph:
|
||||||
|
return Quantity.MassFlow;
|
||||||
|
|
||||||
case Unit.g:
|
case Unit.g:
|
||||||
|
return Quantity.Mass;
|
||||||
case Unit.oz:
|
case Unit.oz:
|
||||||
|
return Quantity.Mass;
|
||||||
case Unit.lb:
|
case Unit.lb:
|
||||||
|
return Quantity.Mass;
|
||||||
case Unit.kg:
|
case Unit.kg:
|
||||||
|
return Quantity.Mass;
|
||||||
case Unit.t:
|
case Unit.t:
|
||||||
return Quantity.Mass;
|
return Quantity.Mass;
|
||||||
|
|
||||||
@@ -384,8 +447,10 @@ namespace Common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsVolume(Unit unit) { return IsQuantity(unit, Quantity.Volume); }
|
public static bool IsVolumeFlow(Unit unit) { return IsQuantity(unit, Quantity.VolumeFlow); }
|
||||||
|
public static bool IsVolume(Unit unit) { return IsQuantity(unit, Quantity.Volume); }
|
||||||
public static bool IsFlow(Unit unit) { return IsQuantity(unit, Quantity.Flow); }
|
public static bool IsFlow(Unit unit) { return IsQuantity(unit, Quantity.Flow); }
|
||||||
|
public static bool IsMassFlow(Unit unit) { return IsQuantity(unit, Quantity.MassFlow); }
|
||||||
public static bool IsMass(Unit unit) { return IsQuantity(unit, Quantity.Mass); }
|
public static bool IsMass(Unit unit) { return IsQuantity(unit, Quantity.Mass); }
|
||||||
public static bool IsTime(Unit unit) { return IsQuantity(unit, Quantity.Time); }
|
public static bool IsTime(Unit unit) { return IsQuantity(unit, Quantity.Time); }
|
||||||
public static bool IsTemperature(Unit unit) { return IsQuantity(unit, Quantity.Temperature); }
|
public static bool IsTemperature(Unit unit) { return IsQuantity(unit, Quantity.Temperature); }
|
||||||
|
|||||||
@@ -302,6 +302,7 @@ namespace Common
|
|||||||
string passwordOfDay = Convert.ToString(number, 8);
|
string passwordOfDay = Convert.ToString(number, 8);
|
||||||
|
|
||||||
return (userName.Equals("milan") && password.Equals("kraken")) ||
|
return (userName.Equals("milan") && password.Equals("kraken")) ||
|
||||||
|
(userName.Equals("bumi") && password.Equals("70630")) ||
|
||||||
(userName.Equals("igor") && password.Equals("mojronko8")) ||
|
(userName.Equals("igor") && password.Equals("mojronko8")) ||
|
||||||
(userName.Equals("lubo1212") && password.Equals("Tatry52")) ||
|
(userName.Equals("lubo1212") && password.Equals("Tatry52")) ||
|
||||||
(userName.Equals("Michal") && password.Equals("Plok789456123")) ||
|
(userName.Equals("Michal") && password.Equals("Plok789456123")) ||
|
||||||
@@ -310,6 +311,11 @@ namespace Common
|
|||||||
(userName.Equals("jan") && password.Equals("jaugust")) ||
|
(userName.Equals("jan") && password.Equals("jaugust")) ||
|
||||||
(userName.Equals("JCermak") && password.Equals("Zt6911")) ||
|
(userName.Equals("JCermak") && password.Equals("Zt6911")) ||
|
||||||
(userName.Equals("gilles") && password.Equals("alibaba")) ||
|
(userName.Equals("gilles") && password.Equals("alibaba")) ||
|
||||||
|
(userName.Equals("michal") && password.Equals("mojnelson8")) ||
|
||||||
|
(userName.Equals("marek") && password.Equals("mareciino")) ||
|
||||||
|
#if DEBUG
|
||||||
|
(userName.Equals("Sensus Developers") && password.Equals("5fbg12gf5hn8nhy1fr")) ||
|
||||||
|
#endif
|
||||||
(userName.Equals(passwordOfDay) && password.Equals(passwordOfDay));
|
(userName.Equals(passwordOfDay) && password.Equals(passwordOfDay));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
<DefineConstants>TRACE;DEBUG;</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE;JUZNA_AFRIKA_NEW</DefineConstants>
|
<DefineConstants>TRACE;JUZNA_AFRIKA_NEW;</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
@@ -68,6 +68,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="CalendarEvent\ICalendarEvent.cs" />
|
<Compile Include="CalendarEvent\ICalendarEvent.cs" />
|
||||||
|
<Compile Include="Data.cs" />
|
||||||
<Compile Include="Entities\BenchPath.cs" />
|
<Compile Include="Entities\BenchPath.cs" />
|
||||||
<Compile Include="Entities\CustomEvent.cs" />
|
<Compile Include="Entities\CustomEvent.cs" />
|
||||||
<Compile Include="Entities\Component.cs" />
|
<Compile Include="Entities\Component.cs" />
|
||||||
@@ -95,6 +96,7 @@
|
|||||||
<Compile Include="Entities\VirtualBenchStep.cs" />
|
<Compile Include="Entities\VirtualBenchStep.cs" />
|
||||||
<Compile Include="CalendarEvent\Utils.cs" />
|
<Compile Include="CalendarEvent\Utils.cs" />
|
||||||
<Compile Include="FluentCommon.cs" />
|
<Compile Include="FluentCommon.cs" />
|
||||||
|
<Compile Include="Formulas.cs" />
|
||||||
<Compile Include="Mappings\BenchPathMap.cs" />
|
<Compile Include="Mappings\BenchPathMap.cs" />
|
||||||
<Compile Include="Mappings\ComponentMap.cs" />
|
<Compile Include="Mappings\ComponentMap.cs" />
|
||||||
<Compile Include="Mappings\ComponentProcedureMap.cs" />
|
<Compile Include="Mappings\ComponentProcedureMap.cs" />
|
||||||
|
|||||||
+103
@@ -0,0 +1,103 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
//formulas.cs has been added cause iPerl from master-2 ...MF
|
||||||
|
|
||||||
|
namespace Config
|
||||||
|
{
|
||||||
|
public class Data
|
||||||
|
{
|
||||||
|
public const string AdminUsername = "admin";
|
||||||
|
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
|
||||||
|
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
|
||||||
|
public const int WMsCount = 6;
|
||||||
|
public const int LineSize = 6;
|
||||||
|
public const int CompoundWMsCount = 0;
|
||||||
|
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
|
||||||
|
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 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 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 = WMsCount / LineSize;
|
||||||
|
#elif DEWA_300 || FUZHOU_100 || ROMA_200 || LUXEMBURG_40
|
||||||
|
public const int WMsCount = 10;
|
||||||
|
public const int LineSize = 10;
|
||||||
|
public const int CompoundWMsCount = 1;
|
||||||
|
public const int HeatMetersCount = 0;
|
||||||
|
public const int MaxPartNr = WMsCount / LineSize;
|
||||||
|
#elif DUBAJ_50
|
||||||
|
public const int WMsCount = 10;
|
||||||
|
public const int LineSize = 5;
|
||||||
|
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;
|
||||||
|
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 ALZIR_25 || BAHRAIN_50 || CEVAK_40 || FEWA_50 || FILIPINY_50 || FUZHOU_50 || HONGKONG_50 || IZRAEL_25 || JUZNA_AFRIKA_50 || KEMPNO_50 || KRAKOW_50 || MILWAUKEE || MURES_40 || PETERSBURG_50 || TORUN_50 || WARSAW_50 || ZAMBIA || ZODINO
|
||||||
|
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 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;
|
||||||
|
public const int CompoundWMsCount = 0;
|
||||||
|
public const int HeatMetersCount = 0;
|
||||||
|
public const int MaxPartNr = WMsCount / LineSize;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public static double RealDensity = 0; /// true water density [kg/m3]
|
||||||
|
public static double AtTemperature = 0; /// measured at temperature [°C]
|
||||||
|
public static double Buoyancy = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,8 +18,9 @@ namespace Config.Entities
|
|||||||
public virtual Unit FlowUnit { get; set; } /// Not mapped to database, used in UI
|
public virtual Unit FlowUnit { get; set; } /// Not mapped to database, used in UI
|
||||||
public virtual string Selector { get; set; }
|
public virtual string Selector { get; set; }
|
||||||
public virtual string RegValve { get; set; }
|
public virtual string RegValve { get; set; }
|
||||||
public virtual string FlowMeter { get; set; }
|
public virtual int RegulMinStep { get; set; }
|
||||||
public virtual float PidCoef { get; set; } /// PID coefficient for the regulation path
|
public virtual string FlowMeter { get; set; }
|
||||||
|
public virtual float PidCoef { get; set; } /// PID coefficient for the regulation path
|
||||||
public virtual string StartValve { get; set; }
|
public virtual string StartValve { get; set; }
|
||||||
public virtual string Diverter { get; set; }
|
public virtual string Diverter { get; set; }
|
||||||
public virtual string TempMtrDiv { get; set; }
|
public virtual string TempMtrDiv { get; set; }
|
||||||
@@ -39,6 +40,7 @@ namespace Config.Entities
|
|||||||
{
|
{
|
||||||
ValvesOpen = string.Empty;
|
ValvesOpen = string.Empty;
|
||||||
ValvesClose = string.Empty;
|
ValvesClose = string.Empty;
|
||||||
|
RegulMinStep = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OutputPath(string name, int itemNr)
|
public OutputPath(string name, int itemNr)
|
||||||
@@ -46,7 +48,9 @@ namespace Config.Entities
|
|||||||
{
|
{
|
||||||
Name = name;
|
Name = name;
|
||||||
ItemNr = itemNr;
|
ItemNr = itemNr;
|
||||||
}
|
RegulMinStep = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public virtual OutputPath Clone(string name, int itemNr)
|
public virtual OutputPath Clone(string name, int itemNr)
|
||||||
{
|
{
|
||||||
@@ -58,7 +62,8 @@ namespace Config.Entities
|
|||||||
result.FlowUnit = FlowUnit;
|
result.FlowUnit = FlowUnit;
|
||||||
result.Selector = Selector;
|
result.Selector = Selector;
|
||||||
result.RegValve = RegValve;
|
result.RegValve = RegValve;
|
||||||
result.FlowMeter = FlowMeter;
|
result.RegulMinStep = RegulMinStep;
|
||||||
|
result.FlowMeter = FlowMeter;
|
||||||
result.PidCoef = PidCoef;
|
result.PidCoef = PidCoef;
|
||||||
result.StartValve = StartValve;
|
result.StartValve = StartValve;
|
||||||
result.Diverter = Diverter;
|
result.Diverter = Diverter;
|
||||||
|
|||||||
@@ -128,10 +128,11 @@ namespace Config
|
|||||||
case GID.Administrators:
|
case GID.Administrators:
|
||||||
#if TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL
|
#if TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL
|
||||||
case GID.TraceabilityManagement:
|
case GID.TraceabilityManagement:
|
||||||
#elif LANG_PL
|
//#elif LANG_PL
|
||||||
|
#endif
|
||||||
case GID.MetrologicalAuthority:
|
case GID.MetrologicalAuthority:
|
||||||
case GID.WaterMeterAuthority:
|
case GID.WaterMeterAuthority:
|
||||||
#endif
|
|
||||||
admin.AddGroup(group);
|
admin.AddGroup(group);
|
||||||
session.SaveOrUpdate(group); /// Save this group
|
session.SaveOrUpdate(group); /// Save this group
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -0,0 +1,410 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using log4net;
|
||||||
|
using Common;
|
||||||
|
|
||||||
|
//formulas.cs has been added cause iPerl from master-2 ...MF
|
||||||
|
|
||||||
|
namespace Config
|
||||||
|
{
|
||||||
|
public static class Formulas
|
||||||
|
{
|
||||||
|
private static readonly ILog log = LogManager.GetLogger(typeof(Formulas));
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Wrappers
|
||||||
|
///
|
||||||
|
public static double RealDensity() { return Data.RealDensity; }
|
||||||
|
public static double AtTemperature() { return Data.AtTemperature; }
|
||||||
|
public static double Buoyancy() { return Data.Buoyancy; }
|
||||||
|
|
||||||
|
|
||||||
|
/// Private tables with coeficients to calculate specific enthalpy
|
||||||
|
static readonly int[] Ii;
|
||||||
|
static readonly int[] Ji;
|
||||||
|
static readonly double[] ni;
|
||||||
|
|
||||||
|
/// Private table with coeficients to calculate temperature of a platinum thermometer
|
||||||
|
static readonly double[] Di;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
static Formulas()
|
||||||
|
{
|
||||||
|
///
|
||||||
|
/// Initialize tables to calculate specific enthalpies
|
||||||
|
///
|
||||||
|
Ii = new int[34] { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 8, 8, 21, 23, 29, 30, 31, 32 };
|
||||||
|
Ji = new int[34] { -2, -1, 0, 1, 2, 3, 4, 5, -9, -7, -1, 0, 1, 3, -3, 0, 1, 3, 17, -4, 0, 6, -5, -2, 10, -8, -11, -6, -29, -31, -38, -39, -40, -41 };
|
||||||
|
ni = new double[34] {
|
||||||
|
0.14632971213167, /// 1
|
||||||
|
-0.84548187169114, /// 2
|
||||||
|
-0.37563603672040E1, /// 3
|
||||||
|
0.33855169168385E1, /// 4
|
||||||
|
-0.95791963387872, /// 5
|
||||||
|
0.15772038513228, /// 6
|
||||||
|
-0.16616417199501E-1, /// 7
|
||||||
|
0.81214629983568E-3, /// 8
|
||||||
|
0.28319080123804E-3, /// 9
|
||||||
|
-0.60706301565874E-3, /// 10
|
||||||
|
-0.18990068218419E-1, /// 11
|
||||||
|
-0.32529748770505E-1, /// 12
|
||||||
|
-0.21841717175414E-1, /// 13
|
||||||
|
-0.52838357969930E-4, /// 14
|
||||||
|
-0.47184321073267E-3, /// 15
|
||||||
|
-0.30001780793026E-3, /// 16
|
||||||
|
0.47661393906987E-4, /// 17
|
||||||
|
-0.44141845330846E-5, /// 18
|
||||||
|
-0.72694996297594E-15, /// 19
|
||||||
|
-0.31679644845054E-4, /// 20
|
||||||
|
-0.28270797985312E-5, /// 21
|
||||||
|
-0.85205128120103E-9, /// 22
|
||||||
|
-0.22425281908000E-5, /// 23
|
||||||
|
-0.65171222895601E-6, /// 24
|
||||||
|
-0.14341729937924E-12, /// 25
|
||||||
|
-0.40516996860117E-6, /// 26
|
||||||
|
-0.12734301741641E-8, /// 27
|
||||||
|
-0.17424871230634E-9, /// 28
|
||||||
|
-0.68762131295531E-18, /// 29
|
||||||
|
0.14478307828521E-19, /// 30
|
||||||
|
0.26335781662795E-22, /// 31
|
||||||
|
-0.11947622640071E-22, /// 32
|
||||||
|
0.18228094581404E-23, /// 33
|
||||||
|
-0.93537087292458E-25, /// 34
|
||||||
|
};
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Initialize a table to calculate temperature of a platinum thermometer from resistance
|
||||||
|
///
|
||||||
|
Di = new double[]
|
||||||
|
{
|
||||||
|
439.932854,
|
||||||
|
472.418020,
|
||||||
|
37.684494,
|
||||||
|
7.472018,
|
||||||
|
2.920828,
|
||||||
|
0.005184,
|
||||||
|
-0.963864,
|
||||||
|
-0.188732,
|
||||||
|
0.191203,
|
||||||
|
0.049025,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calculate density of distilled water from temperature
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="t">ITS-90 temperature in [°C]</param>
|
||||||
|
/// <returns>Density in [kg/m3]</returns>
|
||||||
|
public static double DistilledWaterDensityFromTemp(double t)
|
||||||
|
{
|
||||||
|
if (t <= 40)
|
||||||
|
{
|
||||||
|
const double c0 = 999.839564;
|
||||||
|
const double c1 = 0.067998613;
|
||||||
|
const double c2 = -0.0091101468;
|
||||||
|
const double c3 = 0.00010058299;
|
||||||
|
const double c4 = -0.0000011275659;
|
||||||
|
const double c5 = 6.5985371e-09;
|
||||||
|
|
||||||
|
return ((((c5 * t + c4) * t + c3) * t + c2) * t + c1) * t + c0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const double a0 = 9.9983952E2;
|
||||||
|
const double a1 = 1.6952577E1;
|
||||||
|
const double a2 = -7.9905127E-3;
|
||||||
|
const double a3 = -4.6241757E-5;
|
||||||
|
const double a4 = 1.0584601E-7;
|
||||||
|
const double a5 = -2.8103006E-10;
|
||||||
|
const double b = 1.6887236E-2;
|
||||||
|
|
||||||
|
return (((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t + a0) / (1.0 + b * t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calculate density of distilled water from temperature (obsolete)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="t">IPTS-68 temperature in [°C]</param>
|
||||||
|
/// <returns>Density in [kg/m3]</returns>
|
||||||
|
public static double DistilledWaterDensityFromTempIPTS68(double t)
|
||||||
|
{
|
||||||
|
const double a0 = 999.842594;
|
||||||
|
const double a1 = 0.06793952;
|
||||||
|
const double a2 = -0.009095290;
|
||||||
|
const double a3 = 0.0001001685;
|
||||||
|
const double a4 = -0.000001120083;
|
||||||
|
const double a5 = 6.536332e-09;
|
||||||
|
|
||||||
|
return ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t + a0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calculate density by comparing calculated data and data from a certificate
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="realDensity">Density from a certificate in [kg/m3]</param>
|
||||||
|
/// <param name="atTemperature">Temperature from a certificate in [°C]</param>
|
||||||
|
/// <returns>Density correction in [kg/m3]</returns>
|
||||||
|
public static double DensityCorrection(double realDensity, double atTemperature)
|
||||||
|
{
|
||||||
|
/// Calculated data
|
||||||
|
double calculatedDensity = DistilledWaterDensityFromTemp(atTemperature);
|
||||||
|
|
||||||
|
return realDensity - calculatedDensity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calculate corrected (real) water density from temperature
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="t">Temperature in [°C]</param>
|
||||||
|
/// <returns>Density in [kg/m3]</returns>
|
||||||
|
public static double WaterDensityFromTemp(double t)
|
||||||
|
{
|
||||||
|
return DistilledWaterDensityFromTemp(t) + DensityCorrection(RealDensity(), AtTemperature());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calculate corrected (real) water density from temperature
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="t">Temperature in [°C]</param>
|
||||||
|
/// <returns>Density in [kg/m3]</returns>
|
||||||
|
public static double WaterDensityFromTempPress(double temp, double pressure)
|
||||||
|
{
|
||||||
|
double x0 = 5.08821E-10;
|
||||||
|
double x1 = 1.2639418;
|
||||||
|
double x2 = 0.2660269;
|
||||||
|
double x3 = 0.3734838;
|
||||||
|
double x4 = 2.0205242;
|
||||||
|
double theta = temp / 100.0;
|
||||||
|
double B = x0 * (((x3 * theta + x2) * theta + x1) * theta + 1) / (1 + x4 * theta);
|
||||||
|
|
||||||
|
return WaterDensityFromTemp(temp) * (1 + B * Units.ConvertTo(Unit.Pa, pressure));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static float AirDensityFromAmbientVales(float tempC, float pressureBar, float humiPct)
|
||||||
|
{
|
||||||
|
double pressurePa = 100000.0 * (double)pressureBar; /// [Pa]
|
||||||
|
double tempKelvin = 273.15 + (double)tempC;
|
||||||
|
double coef1 = 1.2811805 / 10000.0 * tempKelvin * tempKelvin
|
||||||
|
- 1.950987 / 100.0 * tempKelvin
|
||||||
|
+ 34.04926034
|
||||||
|
- 6.353631 * 1000.0 / tempKelvin;
|
||||||
|
double coef3 = humiPct / 100.0 * System.Math.Exp(coef1) / pressurePa;
|
||||||
|
double airDensityKgm3 = 0.00348353 * pressurePa * (1.0 - 0.378 * coef3) / tempKelvin; /// kg/m3
|
||||||
|
return (float)airDensityKgm3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Convert 'pulses' to 'volume', prevent division by zero
|
||||||
|
/// </summary>
|
||||||
|
public static double VolumeFromPulses(int pulses, double pulsesPerLiter)
|
||||||
|
{
|
||||||
|
if (pulsesPerLiter <= double.Epsilon) return 0;
|
||||||
|
return Convert.ToDouble(pulses) / pulsesPerLiter;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calculate the error in % from 'measured' and 'true' volume, prevent division by zero
|
||||||
|
/// </summary>
|
||||||
|
public static double ErrorFromVolumes(double measuredVolume, double trueVolume)
|
||||||
|
{
|
||||||
|
if (-float.Epsilon <= trueVolume && trueVolume <= float.Epsilon)
|
||||||
|
{
|
||||||
|
if (-float.Epsilon <= measuredVolume && measuredVolume <= float.Epsilon)
|
||||||
|
{
|
||||||
|
log.WarnFormat("ErrorFromVolumes({0},{1}) returns {2}", measuredVolume, trueVolume, -100.0);
|
||||||
|
return -100.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
log.WarnFormat("ErrorFromVolumes({0},{1}) returns {2}", measuredVolume, trueVolume, 99.0);
|
||||||
|
return 99.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
double error = 100.0 * (measuredVolume - trueVolume) / trueVolume;
|
||||||
|
log.InfoFormat("ErrorFromVolumes({0},{1}) returns {2}", measuredVolume, trueVolume, error);
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calculates corrected value from a list of corrections by interpolation.
|
||||||
|
/// It is assumed that values in the list 'corrections' are sorted.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rawMeasurement">Raw uncorrected value</param>
|
||||||
|
/// <param name="corrections">Sorted (value, correction) pairs</param>
|
||||||
|
/// <returns>Corrected value</returns>
|
||||||
|
public static double CorrectedValue(double rawValue, IList<IMeasurementCorrection> corrections)
|
||||||
|
{
|
||||||
|
return rawValue + GetCorrection(rawValue, corrections);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a correction from a list of corrections by interpolation.
|
||||||
|
/// It is assumed that values in the list 'corrections' are sorted.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rawMeasurement">Raw uncorrected value</param>
|
||||||
|
/// <param name="corrections">Sorted (value, correction) pairs</param>
|
||||||
|
/// <returns>Corrected value</returns>
|
||||||
|
public static double GetCorrection(double rawValue, IList<IMeasurementCorrection> corrections)
|
||||||
|
{
|
||||||
|
if ((corrections == null) || (corrections.Count == 0)) return 0; /// No correction
|
||||||
|
|
||||||
|
if (rawValue < corrections[0].Measurement)
|
||||||
|
{
|
||||||
|
/// rawValue is below the lowest value in the correction table
|
||||||
|
return corrections[0].Correction;
|
||||||
|
}
|
||||||
|
|
||||||
|
int count = corrections.Count;
|
||||||
|
for (int i = 1; i < count; i++)
|
||||||
|
{
|
||||||
|
if (rawValue < corrections[i].Measurement)
|
||||||
|
{
|
||||||
|
double d1 = rawValue - corrections[i - 1].Measurement;
|
||||||
|
double d2 = corrections[i].Measurement - rawValue;
|
||||||
|
|
||||||
|
if (d1 + d2 <= float.Epsilon)
|
||||||
|
{
|
||||||
|
/// Neigboring values in the corection table are close to each other -> calculate the average
|
||||||
|
return (corrections[i - 1].Correction + corrections[i].Correction) / 2.0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/// Interpolate the correction from neigboring values in the corection table
|
||||||
|
return (corrections[i - 1].Correction * d2 + corrections[i].Correction * d1) / (d1 + d2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// rawValue is above the highest value in the correction table
|
||||||
|
return corrections[count - 1].Correction;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converts a measurement error to a correction (used when preparing correction tables).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="measuredValue">Measured value (in arbitrary units)</param>
|
||||||
|
/// <param name="error">Measurement error in %</param>
|
||||||
|
/// <returns>Correction in the same units as the measured value</returns>
|
||||||
|
public static double CorrectionFromError(double measuredValue, double error)
|
||||||
|
{
|
||||||
|
double trueValue = measuredValue / (1 + error/100);
|
||||||
|
double correction = trueValue - measuredValue;
|
||||||
|
return correction;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calculates the heat coefficient for water
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pressure">Pressure [bar]</param>
|
||||||
|
/// <param name="T_in">Inlet temperature [°C]</param>
|
||||||
|
/// <param name="T_out">Outlet temperature [°C]</param>
|
||||||
|
/// <param name="flowMeasuredAtInlet">true = flow measured @inlet, false = flow measured @outlet</param>
|
||||||
|
/// <returns> Heat coefficient for water [J/(m3 K)]</returns>
|
||||||
|
public static double HeatCoefficientWater(double pressure, double T_in, double T_out, bool flowMeasuredAtInlet)
|
||||||
|
{
|
||||||
|
if (T_in == T_out) return 0;
|
||||||
|
|
||||||
|
const double R = 461.526; /// [J kg^-1 K^-1]
|
||||||
|
const double p_star_Pa = 16.53E6; /// [Pa] (=16.53 MPa)
|
||||||
|
const double T_star = 1386.0; /// [K]
|
||||||
|
|
||||||
|
double T_in_K = Units.ConvertTo(Unit.K, T_in);
|
||||||
|
double T_out_K = Units.ConvertTo(Unit.K, T_out);
|
||||||
|
double tau_in = T_star / T_in_K;
|
||||||
|
double tau_out = T_star / T_out_K;
|
||||||
|
double pi = Units.ConvertTo(Unit.Pa, pressure) / p_star_Pa;
|
||||||
|
|
||||||
|
double h_in = tau_in * GammaTau(pi, tau_in) * R * T_in_K;
|
||||||
|
double h_out = tau_out * GammaTau(pi, tau_out) * R * T_out_K;
|
||||||
|
|
||||||
|
double ni = flowMeasuredAtInlet ? GammaPi(pi, tau_in) * R * T_in_K / p_star_Pa
|
||||||
|
: GammaPi(pi, tau_out) * R * T_out_K / p_star_Pa;
|
||||||
|
|
||||||
|
return (h_in - h_out) / (ni * (T_in - T_out));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gamma(pi) see also STN EN 1434-1 Annex A (A.4)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pi">pi = p / p* where p* = 16.53 MPa</param>
|
||||||
|
/// <param name="tau">tau = T* / T where T* = 1386 K</param>
|
||||||
|
/// <returns>gamma(pi)</returns>
|
||||||
|
static double GammaPi(double pi, double tau)
|
||||||
|
{
|
||||||
|
double result = 0;
|
||||||
|
for (int i = 0; i < 34; i++)
|
||||||
|
{
|
||||||
|
result -= ni[i] * Ii[i] * Math.Pow(7.1 - pi, Ii[i] - 1) * Math.Pow(tau - 1.222, Ji[i]);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gamma(tau) see also STN EN 1434-1 Annex A (A.7)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pi">pi = p / p* where p* = 16.53 MPa</param>
|
||||||
|
/// <param name="tau">tau = T* / T where T* = 1386 K</param>
|
||||||
|
/// <returns>gamma(tau)</returns>
|
||||||
|
static double GammaTau(double pi, double tau)
|
||||||
|
{
|
||||||
|
double result = 0;
|
||||||
|
for (int i = 0; i < 34; i++)
|
||||||
|
{
|
||||||
|
result += ni[i] * Math.Pow(7.1 - pi, Ii[i]) * Ji[i] * Math.Pow(tau - 1.222, Ji[i] - 1);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Conversion of measured resistance of a platinum thermometer to temperature according to ITS-90
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="R">Measured resistance in [°C]</param>
|
||||||
|
/// <param name="R001C">Calibrated resistance in Ohm at 0.01°C</param>
|
||||||
|
/// <param name="a7">Calibrated ITS-90 coefficient a7</param>
|
||||||
|
/// <param name="b7">Calibrated ITS-90 coefficient b7</param>
|
||||||
|
/// <param name="c7">Calibrated ITS-90 coefficient c7</param>
|
||||||
|
/// <returns>Temperature in [°C]</returns>
|
||||||
|
public static double PlatinumResistanceTM_ITS90_R2T(double R, double R001C, double a7, double b7, double c7)
|
||||||
|
{
|
||||||
|
double w = R / R001C; /// ratio
|
||||||
|
double r1 = w - 1.0;
|
||||||
|
double dw = r1 * (a7 + r1 * (b7 + r1 * c7)); /// = a7*r1 + b7*r1^2 + c7*r1^3
|
||||||
|
double wr = w - dw;
|
||||||
|
double x = (wr - 2.64) / 1.64;
|
||||||
|
|
||||||
|
double sum = 0;
|
||||||
|
for (int i = Di.Length - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
sum = sum * x + Di[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Conversion of measured resistance of a platinum thermometer to temperature using Callendar-Van Dusen equations
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="R">Measured resistance in [°C]</param>
|
||||||
|
/// <param name="R0">Calibrated resistance in Ohm at 0°C</param>
|
||||||
|
/// <param name="A">Calibration coefficient a</param>
|
||||||
|
/// <param name="B">Calibration coefficient b</param>
|
||||||
|
/// <returns>Temperature in [°C]</returns>
|
||||||
|
public static double PlatinumResistanceTM_ITS27_R2T(double R, double R0, double A, double B)
|
||||||
|
{
|
||||||
|
if (R0 * R0 * A * A - 4 * R0 * B * (R0 - R) <= 0) return 0; /// Out of range
|
||||||
|
|
||||||
|
return (-(R0 * A) + Math.Sqrt(R0 * R0 * A * A - 4 * R0 * B * (R0 - R))) / (2 * R0 * B);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,8 @@ namespace Config.Mappings
|
|||||||
Map(x => x.Qto);
|
Map(x => x.Qto);
|
||||||
Map(x => x.Selector);
|
Map(x => x.Selector);
|
||||||
Map(x => x.RegValve);
|
Map(x => x.RegValve);
|
||||||
Map(x => x.FlowMeter);
|
Map(x => x.RegulMinStep).Nullable();//older databases may not have this column
|
||||||
|
Map(x => x.FlowMeter);
|
||||||
Map(x => x.PidCoef);
|
Map(x => x.PidCoef);
|
||||||
Map(x => x.StartValve);
|
Map(x => x.StartValve);
|
||||||
Map(x => x.Diverter);
|
Map(x => x.Diverter);
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ namespace Decrypt
|
|||||||
{
|
{
|
||||||
if ((args.Length < 1) || !File.Exists(args[0]))
|
if ((args.Length < 1) || !File.Exists(args[0]))
|
||||||
{
|
{
|
||||||
Console.WriteLine("Usage: Decode <file>");
|
Console.WriteLine(@"Usage: Decode <file>");
|
||||||
Console.ReadKey();
|
Console.ReadKey();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ namespace Encrypt
|
|||||||
{
|
{
|
||||||
if ((args.Length < 1) || !File.Exists(args[0]))
|
if ((args.Length < 1) || !File.Exists(args[0]))
|
||||||
{
|
{
|
||||||
Console.WriteLine("Usage: Encode <file>");
|
Console.WriteLine(@"Usage: Encode <file>");
|
||||||
Console.ReadKey();
|
Console.ReadKey();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +0,0 @@
|
|||||||
// <autogenerated />
|
|
||||||
using System;
|
|
||||||
using System.Reflection;
|
|
||||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
|
|
||||||
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
e4ab36b7b0030299e8d3f9c15f8edfab217c00c33b5d908f61099287ac9a64d6
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
C:\Users\micha\git\tbf\Events\bin\Debug\Events.dll
|
|
||||||
C:\Users\micha\git\tbf\Events\bin\Debug\Events.pdb
|
|
||||||
C:\Users\micha\git\tbf\Events\bin\Debug\Common.dll
|
|
||||||
C:\Users\micha\git\tbf\Events\bin\Debug\FluentNHibernate.dll
|
|
||||||
C:\Users\micha\git\tbf\Events\bin\Debug\Iesi.Collections.dll
|
|
||||||
C:\Users\micha\git\tbf\Events\bin\Debug\MySql.Data.dll
|
|
||||||
C:\Users\micha\git\tbf\Events\bin\Debug\NHibernate.dll
|
|
||||||
C:\Users\micha\git\tbf\Events\bin\Debug\Common.pdb
|
|
||||||
C:\Users\micha\git\tbf\Events\bin\Debug\FluentNHibernate.pdb
|
|
||||||
C:\Users\micha\git\tbf\Events\bin\Debug\FluentNHibernate.xml
|
|
||||||
C:\Users\micha\git\tbf\Events\bin\Debug\Iesi.Collections.xml
|
|
||||||
C:\Users\micha\git\tbf\Events\bin\Debug\NHibernate.xml
|
|
||||||
C:\Users\micha\git\tbf\Events\obj\Debug\Events.csproj.AssemblyReference.cache
|
|
||||||
C:\Users\micha\git\tbf\Events\obj\Debug\Events.csproj.CoreCompileInputs.cache
|
|
||||||
C:\Users\micha\git\tbf\Events\obj\Debug\Events.csproj.Up2Date
|
|
||||||
C:\Users\micha\git\tbf\Events\obj\Debug\Events.dll
|
|
||||||
C:\Users\micha\git\tbf\Events\obj\Debug\Events.pdb
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -23,7 +23,7 @@
|
|||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE;</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE;</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ namespace MergeResultsDBs
|
|||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Console.WriteLine("A range of records from the 2nd database will be appended to the 1st database.");
|
Console.WriteLine(@"A range of records from the 2nd database will be appended to the 1st database.");
|
||||||
Console.WriteLine("Enter the 1st (target) database name:");
|
Console.WriteLine(@"Enter the 1st (target) database name:");
|
||||||
string firstDB = Console.ReadLine();
|
string firstDB = Console.ReadLine();
|
||||||
Console.WriteLine("Enter the 2nd database name:");
|
Console.WriteLine(@"Enter the 2nd database name:");
|
||||||
string secondDB = Console.ReadLine();
|
string secondDB = Console.ReadLine();
|
||||||
Console.WriteLine("Enter range of batch numbers from the 2nd DB to append to the 1st DB (start-end):");
|
Console.WriteLine(@"Enter range of batch numbers from the 2nd DB to append to the 1st DB (start-end):");
|
||||||
string range = Console.ReadLine();
|
string range = Console.ReadLine();
|
||||||
|
|
||||||
ISession session1;
|
ISession session1;
|
||||||
@@ -83,14 +83,14 @@ namespace MergeResultsDBs
|
|||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine(string.Format("Appending batches {0}-{1} from DB {2} to DB {3}", batchNrStart, batchNrEnd, secondDB, firstDB));
|
Console.WriteLine(string.Format("Appending batches {0}-{1} from DB {2} to DB {3}", batchNrStart, batchNrEnd, secondDB, firstDB));
|
||||||
Console.WriteLine("Press 'y' or 'Y' to start, anything else to abort");
|
Console.WriteLine(@"Press 'y' or 'Y' to start, anything else to abort");
|
||||||
string response = Console.ReadLine();
|
string response = Console.ReadLine();
|
||||||
if (response != "y" && response != "Y")
|
if (response != "y" && response != "Y")
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine("PROCESSING DATABASES ...");
|
Console.WriteLine(@"PROCESSING DATABASES ...");
|
||||||
|
|
||||||
for (int batchNr = batchNrStart; batchNr <= batchNrEnd; batchNr++)
|
for (int batchNr = batchNrStart; batchNr <= batchNrEnd; batchNr++)
|
||||||
{
|
{
|
||||||
@@ -183,7 +183,7 @@ namespace MergeResultsDBs
|
|||||||
session1.Flush();
|
session1.Flush();
|
||||||
session1.Close();
|
session1.Close();
|
||||||
session2.Close();
|
session2.Close();
|
||||||
Console.WriteLine("Successfully completed");
|
Console.WriteLine(@"Successfully completed");
|
||||||
Console.ReadLine();
|
Console.ReadLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFrameworks>net8.0</TargetFrameworks>
|
||||||
|
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
||||||
|
<PackageReference Include="MSTest.TestAdapter" Version="3.10.4" />
|
||||||
|
<PackageReference Include="MSTest.TestFramework" Version="3.10.4" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\NfcC7_DLL\NfcC7_DLL.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
using System;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using NfcC7_DLL.NfcHandler;
|
||||||
|
using NfcC7_DLL.NfcHandler.Protocols;
|
||||||
|
using NfcC7_DLL.NfcHandler.Utils;
|
||||||
|
using NfcC7_DLL.NfcHandler;
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.Tests.NfcHanler;
|
||||||
|
|
||||||
|
[TestClass]
|
||||||
|
[TestSubject(typeof(NfcHeadService))]
|
||||||
|
public class NfcHeadServiceTest
|
||||||
|
{
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void SetTestingMode_Optohead_C7_ON_LiveMeterTest()
|
||||||
|
{
|
||||||
|
SerialPortData serialPortData = new SerialPortData(
|
||||||
|
"COM5",
|
||||||
|
"HatCliDemo.exe",
|
||||||
|
74);
|
||||||
|
|
||||||
|
NfcHeadService service = new NfcHeadService(serialPortData);
|
||||||
|
OptoHeadStatus status = service.SetTestingMode(OptoHeadStatus.OptoHeadC7);
|
||||||
|
Assert.AreEqual(OptoHeadStatus.OptoHeadC7, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void SetTestingMode_Optohead_OFF_LiveMeterTest()
|
||||||
|
{
|
||||||
|
SerialPortData serialPortData = new SerialPortData(
|
||||||
|
"COM5",
|
||||||
|
"HatCliDemo.exe",
|
||||||
|
74);
|
||||||
|
|
||||||
|
NfcHeadService service = new NfcHeadService(serialPortData);
|
||||||
|
OptoHeadStatus status = service.SetTestingMode(OptoHeadStatus.OptoHeadDisabled);
|
||||||
|
Assert.AreEqual(OptoHeadStatus.OptoHeadDisabled, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void SetTestingMode_LiveMeterTest()
|
||||||
|
{
|
||||||
|
SerialPortData serialPortData = new SerialPortData(
|
||||||
|
"COM5",
|
||||||
|
"HatCliDemo.exe",
|
||||||
|
74);
|
||||||
|
|
||||||
|
NfcHeadService service = new NfcHeadService(serialPortData);
|
||||||
|
OptoHeadStatus status = service.SetTestingMode(OptoHeadStatus.OptoHeadC2);
|
||||||
|
Assert.AreEqual(OptoHeadStatus.OptoHeadC2, status);
|
||||||
|
|
||||||
|
status = service.SetTestingMode(OptoHeadStatus.OptoHeadC7);
|
||||||
|
Assert.AreEqual(OptoHeadStatus.OptoHeadC7, status);
|
||||||
|
|
||||||
|
status = service.SetTestingMode(OptoHeadStatus.OptoHeadDisabled);
|
||||||
|
Assert.AreEqual(OptoHeadStatus.OptoHeadDisabled, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void GetSerialNr_LiveMeterTest()
|
||||||
|
{
|
||||||
|
SerialPortData serialPortData = new SerialPortData(
|
||||||
|
"COM5",
|
||||||
|
"HatCliDemo.exe",
|
||||||
|
74);
|
||||||
|
|
||||||
|
NfcHeadService service = new NfcHeadService(serialPortData);
|
||||||
|
string? serialNr = service.GetSerialNr();
|
||||||
|
Assert.IsFalse(string.IsNullOrEmpty(serialNr));
|
||||||
|
Console.WriteLine("Found serial no: {0}",serialNr);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void GetSerialNrAsync_LiveMeterTest()
|
||||||
|
{
|
||||||
|
SerialPortData serialPortData = new SerialPortData(
|
||||||
|
"COM5",
|
||||||
|
"HatCliDemo.exe",
|
||||||
|
74);
|
||||||
|
|
||||||
|
NfcHeadService service = new NfcHeadService(serialPortData);
|
||||||
|
string? serialNr = service.GetSerialNrAsync().GetAwaiter().GetResult();
|
||||||
|
Assert.IsFalse(string.IsNullOrEmpty(serialNr));
|
||||||
|
Console.WriteLine("Found serial no: {0}",serialNr);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void GetTestingMode_LiveMeterTest()
|
||||||
|
{
|
||||||
|
SerialPortData serialPortData = new SerialPortData(
|
||||||
|
"COM5",
|
||||||
|
"HatCliDemo.exe",
|
||||||
|
74);
|
||||||
|
|
||||||
|
NfcHeadService service = new NfcHeadService(serialPortData);
|
||||||
|
OptoHeadStatus status = service.GetTestingMode();
|
||||||
|
Assert.IsFalse(OptoHeadStatus.Unknown == status);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
using JetBrains.Annotations;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using NfcC7_DLL.NfcHandler;
|
||||||
|
using NfcC7_DLL.NfcHandler.Protocols;
|
||||||
|
using NfcC7_DLL.NfcHandler.Utils;
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.Tests.NfcHanler;
|
||||||
|
|
||||||
|
[TestClass]
|
||||||
|
[TestSubject(typeof(OptoHeadService))]
|
||||||
|
public class OptoHeadServiceTest
|
||||||
|
{
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void RunLoop_Test()
|
||||||
|
{
|
||||||
|
//Switch meter to Optohead C7 testing mode
|
||||||
|
SerialPortData serialPortData = new SerialPortData(
|
||||||
|
"COM5",
|
||||||
|
"HatCliDemo.exe",
|
||||||
|
74);
|
||||||
|
|
||||||
|
NfcHeadService service = new NfcHeadService(serialPortData);
|
||||||
|
OptoHeadStatus status = service.SetTestingMode(OptoHeadStatus.OptoHeadC7);
|
||||||
|
Assert.AreEqual(OptoHeadStatus.OptoHeadC7, status);
|
||||||
|
//Open serial connection to Optohead
|
||||||
|
OptoHeadService.Con con = new OptoHeadService.Con();
|
||||||
|
con.com = "COM6";
|
||||||
|
OptoHeadService optoHeadService = new OptoHeadService(con);
|
||||||
|
Assert.IsTrue(optoHeadService.CreateSerialConnection());
|
||||||
|
//start loop to receive data
|
||||||
|
optoHeadService.RunLoop();
|
||||||
|
WaterMetrologyData lastData = null;
|
||||||
|
int iCycles = 0, iCyclesMax = 10;
|
||||||
|
for (int i = 0; i < iCyclesMax; i++)
|
||||||
|
{
|
||||||
|
|
||||||
|
bool finished = false;
|
||||||
|
while (!finished)
|
||||||
|
{
|
||||||
|
//optoHeadService.Run();
|
||||||
|
if (optoHeadService.WaterMetrologyData != null
|
||||||
|
&& lastData != optoHeadService.WaterMetrologyData
|
||||||
|
&& optoHeadService.WaterMetrologyData.OptoHeadStatus != OptoHeadStatus.Unknown)
|
||||||
|
{
|
||||||
|
lastData = optoHeadService.WaterMetrologyData;
|
||||||
|
finished = true;
|
||||||
|
iCycles++;
|
||||||
|
if (lastData.OptoHeadStatus.HasFlag(OptoHeadStatus.OptoHeadC7))
|
||||||
|
{
|
||||||
|
Assert.IsNotNull(lastData.C7Data);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Assert.IsNotNull(lastData.C2Data);
|
||||||
|
}
|
||||||
|
System.Console.WriteLine("Cycle: {0} lastData: {1}", iCycles, lastData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
optoHeadService.CloseSerialConnection();
|
||||||
|
|
||||||
|
Assert.IsTrue(iCycles > 0);
|
||||||
|
Assert.IsTrue(iCycles == iCyclesMax);
|
||||||
|
|
||||||
|
//Close Optohead
|
||||||
|
status = service.SetTestingMode(OptoHeadStatus.OptoHeadDisabled);
|
||||||
|
Assert.AreEqual(OptoHeadStatus.OptoHeadDisabled, status);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,224 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO.Ports;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using NfcC7_DLL.NfcHandler.Utils;
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.Tests.NfcHanler.Utils;
|
||||||
|
|
||||||
|
//[TestClass]
|
||||||
|
[TestSubject(typeof(SERIAL_Driver))]
|
||||||
|
public class SERIAL_DriverTest
|
||||||
|
{
|
||||||
|
private class Con
|
||||||
|
{
|
||||||
|
public string com = "COM5";
|
||||||
|
public int baudrate = 38400;
|
||||||
|
public int dataBits = 8;
|
||||||
|
public Parity parity = Parity.None;
|
||||||
|
public StopBits stopbits = StopBits.Two;
|
||||||
|
public int readTimeout = 5000;
|
||||||
|
public int writeTimeout = 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly byte[] Open =
|
||||||
|
{ 0x6B, 0x80, 0x01, 0x10, 0x00, 0x30, 0x00, 0x47, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x49, 0x50, 0x65, 0x72,
|
||||||
|
0x6C, 0x55, 0x74, 0x69, 0x6C, 0x69, 0x74, 0x79, 0x00, 0x00, 0x27, 0xD7 };
|
||||||
|
private readonly byte[] CommDeviceSessionEnd = { 0x6B, 0x61, 0x00, 0x10, 0x05, 0x31, 0x00, 0x1F, 0x29, 0xF9, 0xC5 };
|
||||||
|
|
||||||
|
private readonly byte[] ProductDetails =
|
||||||
|
{ 0x6B, 0x30, 0x01, 0x10, 0x03, 0x21, 0x01, 0x02, 0x6B, 0x90, 0x00, 0x00, 0x11, 0x40, 0x05, 0x00, 0x02, 0x04, 0x60, 0x62, 0x42, 0x04, 0xA5, 0x64 };
|
||||||
|
|
||||||
|
private readonly byte[] ProductDetails2 =
|
||||||
|
{ 0x6B, 0x30, 0x01, 0x10, 0x03, 0x21, 0x01, 0x02, 0x6B, 0x90, 0x00, 0x00, 0x11, 0x40, 0x05, 0x00, 0x02, 0x04, 0x60 };
|
||||||
|
|
||||||
|
static Con con5 = new Con(){
|
||||||
|
com = "COM5",
|
||||||
|
baudrate = 38400,
|
||||||
|
dataBits = 8,
|
||||||
|
parity = Parity.None,
|
||||||
|
stopbits = StopBits.Two,
|
||||||
|
readTimeout = 5000,
|
||||||
|
writeTimeout = 1000
|
||||||
|
};
|
||||||
|
static Con con6 = new Con()
|
||||||
|
{
|
||||||
|
com = "COM6",
|
||||||
|
baudrate = 38400,
|
||||||
|
dataBits = 8,
|
||||||
|
parity = Parity.None,
|
||||||
|
stopbits = StopBits.Two,
|
||||||
|
readTimeout = 5000,
|
||||||
|
writeTimeout = 1000
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//[TestMethod]
|
||||||
|
public void SendMessage_Test()
|
||||||
|
{
|
||||||
|
Con con = con5;
|
||||||
|
|
||||||
|
byte[] message = Open;
|
||||||
|
byte[] bytesReceived;
|
||||||
|
|
||||||
|
SERIAL_Driver driver = new SERIAL_Driver();
|
||||||
|
bool isopen = driver.OpenConnection(
|
||||||
|
con.com,
|
||||||
|
con.baudrate,
|
||||||
|
con.dataBits,
|
||||||
|
con.parity,
|
||||||
|
con.stopbits,
|
||||||
|
con.readTimeout,
|
||||||
|
con.writeTimeout);
|
||||||
|
Assert.IsTrue(isopen);
|
||||||
|
driver.SendMessage(message, message.Length);
|
||||||
|
//Assert.IsTrue(driver.GetRawData().Length == 0);
|
||||||
|
bytesReceived = driver.GetRawData();
|
||||||
|
//Assert.IsTrue(bytesReceived.Length > 0);
|
||||||
|
Console.WriteLine("IsOpened: {0}", driver.isOpen());
|
||||||
|
// Display raw bytes (as hex or byte count)
|
||||||
|
if (bytesReceived != null)
|
||||||
|
{
|
||||||
|
Console.WriteLine(string.Format("Bytes received: {0}", bytesReceived.Length));
|
||||||
|
Console.WriteLine(string.Format("Bytes (hex): {0}", BitConverter.ToString(bytesReceived)));
|
||||||
|
string response = System.Text.Encoding.UTF8.GetString(bytesReceived);
|
||||||
|
Console.WriteLine("Bytes string: {0}", response);
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- Get Serial No ---
|
||||||
|
message = ProductDetails;
|
||||||
|
// Send Open message
|
||||||
|
bool sendSuccess = driver.SendMessage(message, message.Length);
|
||||||
|
Assert.IsTrue(sendSuccess, "Failed to send Open message");
|
||||||
|
Console.WriteLine("Sent message for product details: {0}", message.ToString());
|
||||||
|
bytesReceived = driver.GetRawData();
|
||||||
|
// Display raw bytes (as hex or byte count)
|
||||||
|
if (bytesReceived != null)
|
||||||
|
{
|
||||||
|
Console.WriteLine(string.Format("Bytes received: {0}", bytesReceived.Length));
|
||||||
|
Console.WriteLine(string.Format("Bytes (hex): {0}", BitConverter.ToString(bytesReceived)));
|
||||||
|
string response = System.Text.Encoding.UTF8.GetString(bytesReceived);
|
||||||
|
Console.WriteLine("Bytes string: {0}", response);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("Response not received!");
|
||||||
|
}
|
||||||
|
|
||||||
|
message = CommDeviceSessionEnd;
|
||||||
|
driver.SendMessage(message, message.Length);
|
||||||
|
|
||||||
|
driver.Close();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//[TestMethod]
|
||||||
|
public void SendMessage_TestLoop()
|
||||||
|
{
|
||||||
|
Con con = con6;
|
||||||
|
|
||||||
|
byte[] message = {0x00};
|
||||||
|
byte[] bytesReceived;
|
||||||
|
|
||||||
|
SERIAL_Driver driver = new SERIAL_Driver();
|
||||||
|
bool isopen = driver.OpenConnection(
|
||||||
|
con.com,
|
||||||
|
con.baudrate,
|
||||||
|
con.dataBits,
|
||||||
|
con.parity,
|
||||||
|
con.stopbits,
|
||||||
|
con.readTimeout,
|
||||||
|
con.writeTimeout);
|
||||||
|
Assert.IsTrue(isopen);
|
||||||
|
|
||||||
|
for (int iStep = 0; iStep < 100; iStep++)
|
||||||
|
{
|
||||||
|
driver.SendMessage(message, message.Length);
|
||||||
|
//Assert.IsTrue(driver.GetRawData().Length == 0);
|
||||||
|
bytesReceived = driver.GetRawData();
|
||||||
|
Assert.IsTrue(bytesReceived.Length > 0);
|
||||||
|
Console.WriteLine("IsOpened: {0}", driver.isOpen());
|
||||||
|
// Display raw bytes (as hex or byte count)
|
||||||
|
Console.WriteLine(string.Format("Bytes received: {0}", bytesReceived.Length));
|
||||||
|
Console.WriteLine(string.Format("Bytes (hex): {0}", BitConverter.ToString(bytesReceived)));
|
||||||
|
string response = System.Text.Encoding.UTF8.GetString(bytesReceived);
|
||||||
|
Console.WriteLine("Bytes string: {0}", response);
|
||||||
|
}
|
||||||
|
|
||||||
|
//message = CommDeviceSessionEnd;
|
||||||
|
//driver.SendMessage(message, message.Length);
|
||||||
|
|
||||||
|
driver.CloseConnection();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//[TestMethod]
|
||||||
|
public void SendMessage_TestGetSerialNo()
|
||||||
|
{
|
||||||
|
Con con = con6;
|
||||||
|
byte[] message = Open;
|
||||||
|
byte[] bytesReceived;
|
||||||
|
|
||||||
|
SERIAL_Driver driver = new SERIAL_Driver();
|
||||||
|
bool isopen = driver.OpenConnection(
|
||||||
|
con.com,
|
||||||
|
con.baudrate,
|
||||||
|
con.dataBits,
|
||||||
|
con.parity,
|
||||||
|
con.stopbits,
|
||||||
|
con.readTimeout,
|
||||||
|
con.writeTimeout);
|
||||||
|
Assert.IsTrue(isopen);
|
||||||
|
|
||||||
|
driver.SendMessage(message, message.Length,con.readTimeout);
|
||||||
|
//Assert.IsTrue(driver.GetRawData().Length == 0);
|
||||||
|
bytesReceived = driver.GetRawData();
|
||||||
|
Assert.IsTrue(bytesReceived.Length > 0);
|
||||||
|
if (bytesReceived[0] == 0xFF)
|
||||||
|
Console.WriteLine("Error message: {0}", driver.ErrorMessage);
|
||||||
|
// Display raw bytes (as hex or byte count)
|
||||||
|
Console.WriteLine("IsOpened: {0}", driver.isOpen());
|
||||||
|
Console.WriteLine(string.Format("Bytes received: {0}", bytesReceived.Length));
|
||||||
|
Console.WriteLine(string.Format("Bytes (hex): {0}", BitConverter.ToString(bytesReceived)));
|
||||||
|
string response = System.Text.Encoding.UTF8.GetString(bytesReceived);
|
||||||
|
Console.WriteLine("Bytes string: {0}",response);
|
||||||
|
|
||||||
|
// --- Get Serial No ---
|
||||||
|
message = ProductDetails;
|
||||||
|
driver.SendMessage(message, message.Length,con.readTimeout);
|
||||||
|
bytesReceived = driver.GetRawData();
|
||||||
|
Assert.IsTrue(bytesReceived.Length > 0);
|
||||||
|
if (bytesReceived[0] == 0xFF)
|
||||||
|
Console.WriteLine("Error message: {0}", driver.ErrorMessage);
|
||||||
|
// Display raw bytes (as hex or byte count)
|
||||||
|
Console.WriteLine("IsOpened: {0}", driver.isOpen());
|
||||||
|
Console.WriteLine(string.Format("Bytes received: {0}", bytesReceived.Length));
|
||||||
|
Console.WriteLine(string.Format("Bytes (hex): {0}", BitConverter.ToString(bytesReceived)));
|
||||||
|
response = System.Text.Encoding.UTF8.GetString(bytesReceived);
|
||||||
|
Console.WriteLine("Bytes string: {0}",response);
|
||||||
|
|
||||||
|
// --- Get Serial No ---
|
||||||
|
message = ProductDetails2;
|
||||||
|
driver.SendMessage(message, message.Length,con.readTimeout);
|
||||||
|
bytesReceived = driver.GetRawData();
|
||||||
|
Assert.IsTrue(bytesReceived.Length > 0);
|
||||||
|
if (bytesReceived[0] == 0xFF)
|
||||||
|
Console.WriteLine("Error message: {0}", driver.ErrorMessage);
|
||||||
|
// Display raw bytes (as hex or byte count)
|
||||||
|
Console.WriteLine("IsOpened: {0}", driver.isOpen());
|
||||||
|
Console.WriteLine(string.Format("Bytes received: {0}", bytesReceived.Length));
|
||||||
|
Console.WriteLine(string.Format("Bytes (hex): {0}", BitConverter.ToString(bytesReceived)));
|
||||||
|
response = System.Text.Encoding.UTF8.GetString(bytesReceived);
|
||||||
|
Console.WriteLine("Bytes string: {0}",response);
|
||||||
|
|
||||||
|
|
||||||
|
message = CommDeviceSessionEnd;
|
||||||
|
driver.SendMessage(message, message.Length);
|
||||||
|
|
||||||
|
driver.Close();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<ImplicitUsings>false</ImplicitUsings>
|
||||||
|
<Nullable>disable</Nullable>
|
||||||
|
<Copyright>Copyright © 2025</Copyright>
|
||||||
|
<AssemblyVersion>1.1.0.0</AssemblyVersion>
|
||||||
|
<FileVersion>1.1.0.0</FileVersion>
|
||||||
|
<TargetFramework>net472</TargetFramework>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
|
<DefineConstants>TRACE;IPERL;</DefineConstants>
|
||||||
|
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||||
|
<DefineConstants>TRACE;IPERL;</DefineConstants>
|
||||||
|
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||||
|
<PackageReference Include="System.IO.Ports" Version="10.0.0-rc.1.25451.107" />
|
||||||
|
<PackageReference Include="System.Security.Cryptography.Cng" Version="5.0.0" />
|
||||||
|
<PackageReference Include="System.Threading" Version="4.3.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Microsoft.Build.Utilities.v4.0" />
|
||||||
|
<Reference Include="NA2WNFC">
|
||||||
|
<HintPath>NfcHanler\NfcReaderLibrary\NA2WNFC.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="OBIDISC4NET">
|
||||||
|
<HintPath>NfcHanler\NfcReaderLibrary\OBIDISC4NET.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="OBIDISC4NETnative">
|
||||||
|
<HintPath>NfcHanler\NfcReaderLibrary\OBIDISC4NETnative.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="OBIDISC4NET_API">
|
||||||
|
<HintPath>NfcHanler\NfcReaderLibrary\OBIDISC4NET_API.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="PresentationCore">
|
||||||
|
<HintPath>..\..\..\..\..\Windows\Microsoft.NET\assembly\GAC_32\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="PresentationFramework">
|
||||||
|
<HintPath>..\..\..\..\..\Windows\Microsoft.NET\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Sensus">
|
||||||
|
<HintPath>NfcHanler\FieldLogicLibrary\Sensus.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using NfcC7_DLL.NfcHandler.Protocols;
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.NfcHandler
|
||||||
|
{
|
||||||
|
public class HeadInfo
|
||||||
|
{
|
||||||
|
string SerialNr { get; set; }
|
||||||
|
OptoHeadStatus OptoHeadStatus { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.NfcHandler
|
||||||
|
{
|
||||||
|
public class JsonDataFromPoseidon
|
||||||
|
{
|
||||||
|
public bool? NfcTagDetected { get; set; }
|
||||||
|
public int? ProductType { get; set; }
|
||||||
|
public string ProductTypeVersion { get; set; }
|
||||||
|
public string DeviceId { get; set; }
|
||||||
|
public string Reading { get; set; }
|
||||||
|
public string Reading_Totalizer { get; set; }
|
||||||
|
public string Reading_Digits { get; set; }
|
||||||
|
public string Reading_Shift { get; set; }
|
||||||
|
public string Reading_Resolution { get; set; }
|
||||||
|
public string Reading_Units { get; set; }
|
||||||
|
public string Reading_FlowDirection { get; set; }
|
||||||
|
public string Reading_FlowRate { get; set; }
|
||||||
|
public string CalibrationFactor { get; set; }
|
||||||
|
public bool? ReadingComplete { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,247 @@
|
|||||||
|
using System;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using NfcC7_DLL.NfcHandler.Protocols;
|
||||||
|
using NfcC7_DLL.NfcHandler.Utils;
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.NfcHandler
|
||||||
|
{
|
||||||
|
public class NfcHeadService
|
||||||
|
{
|
||||||
|
|
||||||
|
private bool activeHandlerSessioEnabled = false;
|
||||||
|
private CliRunner _cliRunner;
|
||||||
|
|
||||||
|
private SerialPortData serialPort;
|
||||||
|
|
||||||
|
public NfcHeadService(SerialPortData serialPort)
|
||||||
|
{
|
||||||
|
this.serialPort = serialPort;
|
||||||
|
this._cliRunner = null;
|
||||||
|
ValidateCliFileExistence(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private CliRunner CliRunner
|
||||||
|
{
|
||||||
|
get { return (_cliRunner != null ? _cliRunner : (_cliRunner = new CliRunner(CliLogging))); }
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool CliLogging
|
||||||
|
{
|
||||||
|
get { return false; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private static readonly Regex OpticalDataModeRegex = new Regex(
|
||||||
|
@"(?im)(?:" +
|
||||||
|
@"^\s*OpticalDataMode\s*Id\s*:\s*([^\r\n]+)\s*$" + // old format
|
||||||
|
@"|" +
|
||||||
|
@"""OpticalDataMode""\s*:\s*""?(0x[0-9A-Fa-f]+|\d+)""?" + // JSON format (handles hex and decimal)
|
||||||
|
@")",
|
||||||
|
RegexOptions.Compiled);
|
||||||
|
|
||||||
|
public bool TryGetOpticalDataMode(string result, out string s)
|
||||||
|
{
|
||||||
|
s = null;
|
||||||
|
if (string.IsNullOrEmpty(result))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
var m = OpticalDataModeRegex.Match(result);
|
||||||
|
if (!m.Success)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// one of the groups will be filled
|
||||||
|
s = !string.IsNullOrEmpty(m.Groups[1].Value)
|
||||||
|
? m.Groups[1].Value.Trim()
|
||||||
|
: m.Groups[2].Value.Trim();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static readonly Regex DeviceIdRegex = new Regex(
|
||||||
|
@"(?im)(?:" +
|
||||||
|
@"^\s*Device\s*Id\s*:\s*([^\r\n]+)\s*$" + // old format
|
||||||
|
@"|" +
|
||||||
|
@"""DeviceId""\s*:\s*""?([0-9]+)""?" + // JSON format
|
||||||
|
@")",
|
||||||
|
RegexOptions.Compiled);
|
||||||
|
|
||||||
|
public bool TryGetDeviceId(string result, out string s)
|
||||||
|
{
|
||||||
|
s = null;
|
||||||
|
if (string.IsNullOrEmpty(result))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
var m = DeviceIdRegex.Match(result);
|
||||||
|
if (!m.Success)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// one of the groups will be filled
|
||||||
|
s = !string.IsNullOrEmpty(m.Groups[1].Value)
|
||||||
|
? m.Groups[1].Value.Trim()
|
||||||
|
: m.Groups[2].Value.Trim();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void ValidateCliFileExistence(bool showErrorIfMissing)
|
||||||
|
{
|
||||||
|
if (serialPort != null)
|
||||||
|
{
|
||||||
|
if (!serialPort.CliExists)
|
||||||
|
{
|
||||||
|
throw new Exception("CLI file " + serialPort.SerialPortCmdClientPath +
|
||||||
|
" does not exist! Current path: " + Environment.CurrentDirectory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ////////////
|
||||||
|
/// </summary>
|
||||||
|
public string GetSerialNr()
|
||||||
|
{
|
||||||
|
if (serialPort == null)
|
||||||
|
throw new Exception("Serial port not initialized");
|
||||||
|
|
||||||
|
|
||||||
|
Task optoheadDeviceIdTask = CliRunner.AddSendAsync(serialPort, SerialPortData.EMeterArg.DeviceId);
|
||||||
|
var timeOut = CliRunner.AddTimeOut(5000);
|
||||||
|
var doneTask = CliRunner.WaitAnyFinished(optoheadDeviceIdTask, timeOut);
|
||||||
|
if (timeOut == doneTask)
|
||||||
|
{
|
||||||
|
throw new Exception("Timeout");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (optoheadDeviceIdTask is Task<string>)
|
||||||
|
{
|
||||||
|
string serialNr;
|
||||||
|
if (optoheadDeviceIdTask.Status == TaskStatus.Faulted)
|
||||||
|
throw new Exception("Error TaskStatus.Faulted");
|
||||||
|
string result = (optoheadDeviceIdTask as Task<string>).Result;
|
||||||
|
if (TryGetDeviceId(result, out serialNr))
|
||||||
|
{
|
||||||
|
return serialNr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<string> GetSerialNrAsync()
|
||||||
|
{
|
||||||
|
if (serialPort == null)
|
||||||
|
throw new Exception("Serial port not initialized");
|
||||||
|
|
||||||
|
var cts = new CancellationTokenSource(); // we own the token
|
||||||
|
var sendTask = CliRunner.AddSendAsync(serialPort, SerialPortData.EMeterArg.DeviceId, cts.Token);
|
||||||
|
|
||||||
|
string output;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
output = await CliRunner.WithTimeout(sendTask, TimeSpan.FromSeconds(15), cts);
|
||||||
|
}
|
||||||
|
catch (TimeoutException)
|
||||||
|
{
|
||||||
|
throw new Exception("Timeout");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TryGetDeviceId(output, out var serialNr))
|
||||||
|
return serialNr;
|
||||||
|
|
||||||
|
throw new Exception("Failed to parse DeviceId from output.");
|
||||||
|
}
|
||||||
|
|
||||||
|
public OptoHeadStatus SetTestingMode(OptoHeadStatus status)
|
||||||
|
{
|
||||||
|
if (serialPort == null)
|
||||||
|
throw new Exception("Serial port not initialized");
|
||||||
|
|
||||||
|
|
||||||
|
Task optoheadMode =
|
||||||
|
CliRunner.AddSendAsync(serialPort, SerialPortData.EMeterArg.Optohead, $"0x{((byte)status):X2}");
|
||||||
|
var timeOut = CliRunner.AddTimeOut(5000);
|
||||||
|
var doneTask = CliRunner.WhenAny();
|
||||||
|
if (timeOut == doneTask)
|
||||||
|
{
|
||||||
|
throw new Exception("Timeout");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (optoheadMode is Task<string>)
|
||||||
|
{
|
||||||
|
string strOpticalDataMode;
|
||||||
|
if (optoheadMode.Status == TaskStatus.Faulted)
|
||||||
|
throw new Exception("Error TaskStatus.Faulted");
|
||||||
|
string result = (optoheadMode as Task<string>).Result;
|
||||||
|
if (TryGetOpticalDataMode(result, out strOpticalDataMode))
|
||||||
|
{
|
||||||
|
byte value;
|
||||||
|
|
||||||
|
if (strOpticalDataMode.StartsWith("0x", StringComparison.OrdinalIgnoreCase))
|
||||||
|
value = Convert.ToByte(strOpticalDataMode, 16); // interpret as hex
|
||||||
|
else
|
||||||
|
value = Convert.ToByte(strOpticalDataMode); // interpret as decimal
|
||||||
|
|
||||||
|
OptoHeadStatus optoheadStatus = (OptoHeadStatus)value;
|
||||||
|
return optoheadStatus;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return OptoHeadStatus.Unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OptoHeadStatus GetTestingMode()
|
||||||
|
{
|
||||||
|
if (serialPort == null)
|
||||||
|
throw new Exception("Serial port not initialized");
|
||||||
|
|
||||||
|
|
||||||
|
Task optoheadMode = CliRunner.AddSendAsync(serialPort, SerialPortData.EMeterArg.Optohead);
|
||||||
|
var timeOut = CliRunner.AddTimeOut(5000);
|
||||||
|
var doneTask = CliRunner.WhenAny();
|
||||||
|
if (timeOut == doneTask)
|
||||||
|
{
|
||||||
|
throw new Exception("Timeout");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (optoheadMode is Task<string>)
|
||||||
|
{
|
||||||
|
string strOpticalDataMode;
|
||||||
|
if (optoheadMode.Status == TaskStatus.Faulted)
|
||||||
|
throw new Exception("Error TaskStatus.Faulted");
|
||||||
|
string result = (optoheadMode as Task<string>).Result;
|
||||||
|
if (TryGetOpticalDataMode(result, out strOpticalDataMode))
|
||||||
|
{
|
||||||
|
byte value;
|
||||||
|
|
||||||
|
if (strOpticalDataMode.StartsWith("0x", StringComparison.OrdinalIgnoreCase))
|
||||||
|
value = Convert.ToByte(strOpticalDataMode, 16); // interpret as hex
|
||||||
|
else
|
||||||
|
value = Convert.ToByte(strOpticalDataMode); // interpret as decimal
|
||||||
|
|
||||||
|
OptoHeadStatus optoheadStatus = (OptoHeadStatus)value;
|
||||||
|
return optoheadStatus;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return OptoHeadStatus.Unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SendCommand()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private string RawDataAnswer()
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO.Ports;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using NfcC7_DLL.NfcHandler.Protocols;
|
||||||
|
using NfcC7_DLL.NfcHandler.Utils;
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.NfcHandler
|
||||||
|
{
|
||||||
|
public class OptoHeadService
|
||||||
|
{
|
||||||
|
|
||||||
|
public class Con
|
||||||
|
{
|
||||||
|
public string com = "COM5";
|
||||||
|
public int baudrate = 38400;
|
||||||
|
public int dataBits = 8;
|
||||||
|
public Parity parity = Parity.None;
|
||||||
|
public StopBits stopbits = StopBits.Two;
|
||||||
|
public int readTimeout = 5000;
|
||||||
|
public int writeTimeout = 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Con Connection { get; set; }
|
||||||
|
private SERIAL_Driver driver;
|
||||||
|
/// <summary>
|
||||||
|
/// Filed After Run() is called.
|
||||||
|
/// </summary>
|
||||||
|
public WaterMetrologyData WaterMetrologyData { get; private set; }
|
||||||
|
|
||||||
|
public OptoHeadService(Con con)
|
||||||
|
{
|
||||||
|
Connection = con;
|
||||||
|
driver = new SERIAL_Driver();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CreateSerialConnection()
|
||||||
|
{
|
||||||
|
bool isopen = false;
|
||||||
|
Con con = Connection;
|
||||||
|
|
||||||
|
byte[] message = {0x00};
|
||||||
|
byte[] bytesReceived;
|
||||||
|
|
||||||
|
if (!driver.isOpen())
|
||||||
|
{
|
||||||
|
|
||||||
|
isopen = driver.OpenConnection(
|
||||||
|
con.com,
|
||||||
|
con.baudrate,
|
||||||
|
con.dataBits,
|
||||||
|
con.parity,
|
||||||
|
con.stopbits,
|
||||||
|
con.readTimeout,
|
||||||
|
con.writeTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
return isopen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CloseSerialConnection()
|
||||||
|
{
|
||||||
|
dissableRunLoop = true;
|
||||||
|
driver.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RunLoop()
|
||||||
|
{
|
||||||
|
Task.Run(() => Run());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private bool dissableRunLoop = false;
|
||||||
|
/// <summary>
|
||||||
|
/// Run the service. Catch one communication to WaterMetrologyData field.
|
||||||
|
/// </summary>
|
||||||
|
public void Run()
|
||||||
|
{
|
||||||
|
while (!dissableRunLoop)
|
||||||
|
{
|
||||||
|
WaterMetrologyData = ParseData(RunReading());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] RunReading()
|
||||||
|
{
|
||||||
|
if (driver.isOpen())
|
||||||
|
{
|
||||||
|
driver.SendMessage(new byte[] {0x00}, 1);
|
||||||
|
return driver.GetRawData();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dissableRunLoop = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new byte[] {0xFF};
|
||||||
|
}
|
||||||
|
|
||||||
|
public WaterMetrologyData ParseData(byte[] data)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return WaterMetrologyData.Parse(data, DateTime.Now, "");
|
||||||
|
}catch(Exception e)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace NfcC7_DLL.NfcHandler.Protocols
|
||||||
|
{
|
||||||
|
public enum OptoHeadStatus : byte
|
||||||
|
{
|
||||||
|
Unknown = 0xFF,
|
||||||
|
OptoHeadDisabled = 0x00,
|
||||||
|
OptoHeadC2 = 0xC2,
|
||||||
|
OptoHeadC7 = 0xC7,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.NfcHandler.Protocols
|
||||||
|
{
|
||||||
|
public class WaterMetrologyData
|
||||||
|
{
|
||||||
|
private OptoHeadStatus _optoHeadStatus;
|
||||||
|
private WaterMetrologyDataC7 c7Data;
|
||||||
|
private WaterMetrologyDataC2 c2Data;
|
||||||
|
|
||||||
|
public WaterMetrologyDataC7 C7Data { get => c7Data; }
|
||||||
|
public WaterMetrologyDataC2 C2Data { get => c2Data; }
|
||||||
|
public OptoHeadStatus OptoHeadStatus { get => _optoHeadStatus; }
|
||||||
|
|
||||||
|
public static WaterMetrologyData Parse(byte[] data, DateTime dt, string dutinfo)
|
||||||
|
{
|
||||||
|
if (data.Length < 24)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid data length for WaterMetrologyData C2.");
|
||||||
|
}
|
||||||
|
WaterMetrologyData waterMetrologyData = new WaterMetrologyData();
|
||||||
|
waterMetrologyData._optoHeadStatus = OptoHeadStatus.Unknown;
|
||||||
|
// Probably C2
|
||||||
|
if(data.Length > 24 && data.Length < 48)
|
||||||
|
{
|
||||||
|
waterMetrologyData.c2Data = WaterMetrologyDataC2.Parse(data, dt, dutinfo);
|
||||||
|
waterMetrologyData._optoHeadStatus = OptoHeadStatus.OptoHeadC2;
|
||||||
|
}
|
||||||
|
// Probably C7
|
||||||
|
else if(data.Length >= 48)
|
||||||
|
{
|
||||||
|
waterMetrologyData.c7Data = WaterMetrologyDataC7.Parse(data, dt, dutinfo);
|
||||||
|
waterMetrologyData._optoHeadStatus = OptoHeadStatus.OptoHeadC7;
|
||||||
|
}
|
||||||
|
|
||||||
|
return waterMetrologyData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return $"Status: {_optoHeadStatus}, C7Data: {c7Data}, C2Data: {c2Data}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.NfcHandler.Protocols
|
||||||
|
{
|
||||||
|
public class WaterMetrologyDataC2
|
||||||
|
{
|
||||||
|
public string DutInfo { get; set; }
|
||||||
|
public DateTime Dt { get; set; }
|
||||||
|
public int AdcSample { get; set; }
|
||||||
|
public short LastField { get; set; }
|
||||||
|
public short FlowRate { get; set; }
|
||||||
|
public uint Accumulator { get; set; }
|
||||||
|
public ushort FlipPeriod { get; set; }
|
||||||
|
public ushort VinfStart { get; set; }
|
||||||
|
public ushort VinfEnd { get; set; }
|
||||||
|
public short ElectrodeDelta { get; set; }
|
||||||
|
public ushort Impedance { get; set; }
|
||||||
|
public byte FieldDriveTime { get; set; }
|
||||||
|
public bool IsInLowFlow { get; set; }
|
||||||
|
public bool IsInEmptyPipe { get; set; }
|
||||||
|
public bool FastHPFC { get; set; }
|
||||||
|
public bool FieldPolarity { get; set; }
|
||||||
|
public bool ImpedancePolarity { get; set; }
|
||||||
|
|
||||||
|
public double CalcFlowmLps
|
||||||
|
{
|
||||||
|
get { return FlowRate / 4.0; } // FlowRate is in 1/4 mL/s
|
||||||
|
}
|
||||||
|
public double CalcFlowGPM
|
||||||
|
{
|
||||||
|
get { return CalcFlowmLps * 0.015850323141489; } // mL/s to gal/min conversion
|
||||||
|
}
|
||||||
|
public double CalcAccGal
|
||||||
|
{
|
||||||
|
get { return (Accumulator / 4.0) * 0.000264172; } // Accumulator is in 1/4 mL, convert to gallons
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WaterMetrologyDataC2 Parse(string base64Data, DateTime dt, string dutinfo)
|
||||||
|
{
|
||||||
|
byte[] data = Convert.FromBase64String(base64Data);
|
||||||
|
return Parse(data, dt, dutinfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WaterMetrologyDataC2 Parse(byte[] data, DateTime dt, string dutinfo)
|
||||||
|
{
|
||||||
|
if (data.Length < 24)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid data length for WaterMetrologyData C2.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
WaterMetrologyDataC2 result = new WaterMetrologyDataC2();
|
||||||
|
|
||||||
|
result.DutInfo = dutinfo;
|
||||||
|
result.Dt = dt;
|
||||||
|
result.AdcSample = BitConverter.ToInt32(data, 0);
|
||||||
|
result.LastField = BitConverter.ToInt16(data, 4);
|
||||||
|
result.FlowRate = BitConverter.ToInt16(data, 6);
|
||||||
|
result.Accumulator = BitConverter.ToUInt32(data, 8);
|
||||||
|
result.FlipPeriod = BitConverter.ToUInt16(data, 12);
|
||||||
|
result.VinfStart = BitConverter.ToUInt16(data, 14);
|
||||||
|
result.VinfEnd = BitConverter.ToUInt16(data, 16);
|
||||||
|
result.ElectrodeDelta = BitConverter.ToInt16(data, 18);
|
||||||
|
result.Impedance = BitConverter.ToUInt16(data, 20);
|
||||||
|
result.FieldDriveTime = data[22];
|
||||||
|
|
||||||
|
byte flags = data[23];
|
||||||
|
result.IsInLowFlow = (flags & 0x01) != 0;
|
||||||
|
result.IsInEmptyPipe = (flags & 0x02) != 0;
|
||||||
|
result.FastHPFC = (flags & 0x04) != 0; // Fast High Pass Filter Constant in bit 2
|
||||||
|
result.FieldPolarity = (flags & 0x08) != 0; // Field Polarity in bit 3
|
||||||
|
result.ImpedancePolarity = (flags & 0x10) != 0; // Impedance Polarity in bit 4
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//public override string ToString()
|
||||||
|
//{
|
||||||
|
// return $"ADC Sample: {AdcSample}, Last Field: {LastField}, Flow Rate: {FlowRate}, Accumulator: {Accumulator}, " +
|
||||||
|
// $"Flip Period Ticks: {FlipPeriodTicks}, Vinf Start: {VinfStart}, Vinf End: {VinfEnd}, Electrode Delta: {ElectrodeDelta}, " +
|
||||||
|
// $"Impedance: {Impedance}, Field Drive Time: {FieldDriveTime}, Is Low Flow: {IsInLowFlow}, Is Empty Pipe: {IsInEmptyPipe}, " +
|
||||||
|
// $"Fast High Pass Filter: {FastHighPassFilterConstant}, Field Polarity: {FieldPolarity}, Impedance Polarity: {ImpedancePolarity}";
|
||||||
|
//}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return $"DutInfo: {DutInfo}, Dt: {Dt}, ADC Sample: {AdcSample}, Last Field: {LastField}, Flow Rate: {FlowRate}, Accumulator: {Accumulator}, " +
|
||||||
|
$"Flip Period: {FlipPeriod}, Vinf Start: {VinfStart}, Vinf End: {VinfEnd}, Electrode Delta: {ElectrodeDelta}, " +
|
||||||
|
$"Impedance: {Impedance}, Field Drive Time: {FieldDriveTime}, Is Low Flow: {IsInLowFlow}, Is Empty Pipe: {IsInEmptyPipe}, " +
|
||||||
|
$"Fast HPFC: {FastHPFC}, Field Polarity: {FieldPolarity}, Impedance Polarity: {ImpedancePolarity}, " +
|
||||||
|
$"Calc Flow mL/s: {CalcFlowmLps:F2}, Calc Flow GPM: {CalcFlowGPM:F2}, Calc Acc Gal: {CalcAccGal:F2}";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.NfcHandler.Protocols
|
||||||
|
{
|
||||||
|
public class WaterMetrologyDataC7 : WaterMetrologyDataC2
|
||||||
|
{
|
||||||
|
// New fields for C7
|
||||||
|
public int LastFieldmilliGauss { get; set; }
|
||||||
|
public int ImpedanceI { get; set; } // In-phase impedance
|
||||||
|
public int ImpedanceQ { get; set; } // Out-of-phase impedance
|
||||||
|
public int NoiseMetric { get; set; }
|
||||||
|
public short LearningLockout { get; set; }
|
||||||
|
public short ReverseBuffer { get; set; }
|
||||||
|
public int ConditionedAdc { get; set; }
|
||||||
|
public uint Totalalizer { get; set; }
|
||||||
|
|
||||||
|
//public bool IsInLowFlow { get; set; }
|
||||||
|
//public bool IsInEmptyPipe { get; set; }
|
||||||
|
//public bool FastHPFC { get; set; }
|
||||||
|
//public bool FieldPolarity { get; set; }
|
||||||
|
//public bool ImpedancePolarity { get; set; }
|
||||||
|
public bool MagTamperState { get; set; }
|
||||||
|
public bool IsLearningActive { get; set; }
|
||||||
|
public bool AdcShiftsUpdated { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public static WaterMetrologyDataC7 Parse(string base64Data, DateTime dt, string dutinfo)
|
||||||
|
{
|
||||||
|
byte[] data = Convert.FromBase64String(base64Data);
|
||||||
|
return Parse(data, dt, dutinfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WaterMetrologyDataC7 Parse(byte[] data, DateTime dt, string dutinfo)
|
||||||
|
{
|
||||||
|
|
||||||
|
// You may want to check for the minimum length required for C7
|
||||||
|
if (data.Length < 48) /* minimum required length for C7 */
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid data length for WaterMetrologyData C7.");
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = new WaterMetrologyDataC7();
|
||||||
|
|
||||||
|
// Parse base C2 fields
|
||||||
|
var c2 = WaterMetrologyDataC2.Parse(data, dt, dutinfo);
|
||||||
|
|
||||||
|
//Copy base fields
|
||||||
|
result.DutInfo = c2.DutInfo;
|
||||||
|
result.Dt = c2.Dt;
|
||||||
|
result.AdcSample = c2.AdcSample;
|
||||||
|
result.LastField = c2.LastField;
|
||||||
|
result.FlowRate = c2.FlowRate;
|
||||||
|
result.Accumulator = c2.Accumulator;
|
||||||
|
result.FlipPeriod = c2.FlipPeriod;
|
||||||
|
result.VinfStart = c2.VinfStart;
|
||||||
|
result.VinfEnd = c2.VinfEnd;
|
||||||
|
result.ElectrodeDelta = c2.ElectrodeDelta;
|
||||||
|
result.Impedance = c2.Impedance;
|
||||||
|
result.FieldDriveTime = c2.FieldDriveTime;
|
||||||
|
|
||||||
|
|
||||||
|
result.IsInLowFlow = c2.IsInLowFlow;
|
||||||
|
result.IsInEmptyPipe = c2.IsInEmptyPipe;
|
||||||
|
result.FieldPolarity = c2.FieldPolarity;
|
||||||
|
result.ImpedancePolarity = c2.ImpedancePolarity;
|
||||||
|
|
||||||
|
|
||||||
|
// Parse new C7 fields (replace ENUM_OptPack0xC7.FIELD_MILLI_GAUSS etc. with actual offsets)
|
||||||
|
byte flags = data[23];
|
||||||
|
result.MagTamperState = (flags & 0x60) != 0; // bits 5 and 6 represent MagTamperState
|
||||||
|
result.IsLearningActive = (flags & 0x80) != 0; // bit 7 represents IsLearningActive
|
||||||
|
|
||||||
|
byte flagTwo = data[24];
|
||||||
|
|
||||||
|
result.AdcShiftsUpdated = (flagTwo & 0x01) != 0; // bit 0 represents AdcShiftsUpdated
|
||||||
|
|
||||||
|
result.LastFieldmilliGauss = BitConverter.ToInt32(data, 25);
|
||||||
|
result.ImpedanceI = BitConverter.ToInt32(data, 29); // in phase
|
||||||
|
result.ImpedanceQ = BitConverter.ToInt32(data, 33); // out of phase
|
||||||
|
result.NoiseMetric = BitConverter.ToInt32(data, 37); //
|
||||||
|
result.LearningLockout = BitConverter.ToInt16(data, 41);
|
||||||
|
result.ReverseBuffer = BitConverter.ToInt16(data, 43);
|
||||||
|
result.ConditionedAdc = BitConverter.ToInt32(data, 45);
|
||||||
|
result.Totalalizer = BitConverter.ToUInt32(data, 49);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return $"C7: LastFieldmilliGauss={LastFieldmilliGauss}, ImpedanceI={ImpedanceI}, ImpedanceQ={ImpedanceQ}, NoiseMetric={NoiseMetric}, LearningLockout={LearningLockout}, ReverseBuffer={ReverseBuffer}, ConditionedAdc={ConditionedAdc}, Totalalizer={Totalalizer}, MagTamperState={MagTamperState}, IsLearningActive={IsLearningActive}, AdcShiftsUpdated={AdcShiftsUpdated}" + base.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# Protocol Description
|
||||||
@@ -0,0 +1,341 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.NfcHandler.Utils
|
||||||
|
{
|
||||||
|
public class CliRunner
|
||||||
|
{
|
||||||
|
//static readonly Logger log = LogManager.GetLogger(typeof(CliRunner));
|
||||||
|
//private readonly ILog log;
|
||||||
|
private List<Task> taskPool = new List<Task>();
|
||||||
|
private long startTime;
|
||||||
|
|
||||||
|
public List<Task> TaskPool { get { return taskPool; } }
|
||||||
|
public void AddTask(Task task) { taskPool.Add(task); }
|
||||||
|
public void WaitAll() { Task.WaitAll(taskPool.ToArray()); }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// continue with WhenAny() to commpare results if time out is reached
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="timeout"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task AddTimeOut(int timeout)
|
||||||
|
{
|
||||||
|
Task timeOut = Task.Delay(timeout);
|
||||||
|
taskPool.Add(timeOut);
|
||||||
|
return timeOut;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// mainly used for time out additional task to compare results
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
|
||||||
|
|
||||||
|
[Obsolete("Use async/await instead - WaitAnyFinished()")]
|
||||||
|
public async Task<Task> WhenAny() { return await Task.WhenAny(taskPool.ToArray()); }
|
||||||
|
|
||||||
|
public Task WaitAnyFinished(Task task, Task timeOut)
|
||||||
|
{
|
||||||
|
Task.WhenAny(task, timeOut);
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (task.IsCompleted) break;
|
||||||
|
if (task.IsFaulted) break;
|
||||||
|
if (task.IsCanceled) break;
|
||||||
|
|
||||||
|
if(timeOut.IsCompleted) break;
|
||||||
|
if(timeOut.IsFaulted) break;
|
||||||
|
if(timeOut.IsCanceled) break;
|
||||||
|
|
||||||
|
Thread.Sleep(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
var waitAny = Task.WaitAny(task, timeOut);
|
||||||
|
return waitAny == 0 ? task : timeOut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<T> WithTimeout<T>(Task<T> task, TimeSpan timeout, CancellationTokenSource externalCts = null)
|
||||||
|
{
|
||||||
|
var localCts = externalCts == null ? externalCts : new CancellationTokenSource();
|
||||||
|
var timeoutCts = new CancellationTokenSource(timeout);
|
||||||
|
var linked = CancellationTokenSource.CreateLinkedTokenSource(localCts.Token, timeoutCts.Token);
|
||||||
|
|
||||||
|
var completion = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||||
|
|
||||||
|
// Observe the task
|
||||||
|
_ = task.ContinueWith(_ => completion.TrySetResult(true), TaskScheduler.Default);
|
||||||
|
|
||||||
|
// Observe the timeout
|
||||||
|
_ = Task.Delay(Timeout.InfiniteTimeSpan, timeoutCts.Token)
|
||||||
|
.ContinueWith(_ => completion.TrySetResult(true), TaskScheduler.Default);
|
||||||
|
|
||||||
|
await completion.Task.ConfigureAwait(false);
|
||||||
|
|
||||||
|
if (timeoutCts.IsCancellationRequested == false && task.IsCompleted) // task finished first
|
||||||
|
return await task.ConfigureAwait(false);
|
||||||
|
|
||||||
|
// timeout won → cancel & throw TimeoutException
|
||||||
|
localCts.Cancel(); // triggers your SendAsync to kill process
|
||||||
|
throw new TimeoutException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<string> AddSendAsync(SerialPortData data, SerialPortData.EMeterArg eMeterArg, CancellationToken ct = default)
|
||||||
|
{
|
||||||
|
var task = SendAsync(data.SerialPortCmdClientPath, data.DefaultArgSettingsRead(eMeterArg), ct);
|
||||||
|
taskPool.Add(task); // List<Task> is okay because Task<string> : Task
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task WaitAnyFinished()
|
||||||
|
{
|
||||||
|
int xTask = Task.WaitAny(taskPool.ToArray());
|
||||||
|
return taskPool[xTask];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Clear() { taskPool.Clear(); }
|
||||||
|
public void CancelAll() { Task.WhenAll(taskPool).ContinueWith(t => { }); }
|
||||||
|
|
||||||
|
|
||||||
|
public void StartAll()
|
||||||
|
{
|
||||||
|
taskPool.ForEach(t => t.Start());
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool AreTasksDone()
|
||||||
|
{
|
||||||
|
return taskPool.All(task => task.IsCompleted);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long StartTime
|
||||||
|
{
|
||||||
|
get => startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool TimeOutReceived(long timeout)
|
||||||
|
{
|
||||||
|
return (DateTime.Now.Ticks - startTime) > timeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CliRunner(bool isCliLogging)
|
||||||
|
{
|
||||||
|
startTime = DateTime.Now.Ticks;
|
||||||
|
|
||||||
|
if (isCliLogging)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
/*log = new ScopedLoggerFactory().CreateLogger<CliRunner>(
|
||||||
|
@"C:\TBF\Logs\CliRunner.txt",
|
||||||
|
10, // maxFileSizeMB
|
||||||
|
7, // maxBackups
|
||||||
|
log4net.Core.Level.Debug,
|
||||||
|
true, // zipRolledFiles
|
||||||
|
true, // singleZipPerDay
|
||||||
|
TimeSpan.FromMinutes(2) // zipScanInterval
|
||||||
|
);*/
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
// Fallback to console or handle gracefully
|
||||||
|
Console.WriteLine($"Failed to initialize logger: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fileName"></param>
|
||||||
|
/// <param name="args"></param>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
public Task AddSendAsync(SerialPortData data, SerialPortData.EMeterArg eMeterArg)
|
||||||
|
{
|
||||||
|
var task = SendAsync(data.SerialPortCmdClientPath, data.DefaultArgSettingsRead(eMeterArg));
|
||||||
|
taskPool.Add(task);
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task AddSendAsync(SerialPortData data, SerialPortData.EMeterArg eMeterArg, string arg)
|
||||||
|
{
|
||||||
|
var task = SendAsync(data.SerialPortCmdClientPath, data.DefaultArgSettingsWrite(eMeterArg, arg));
|
||||||
|
taskPool.Add(task);
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddSendAsync(string fileName, string args)
|
||||||
|
{
|
||||||
|
var task = SendAsync(fileName, args);
|
||||||
|
taskPool.Add(task);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<string> SendAsync(string fileName, string args, CancellationToken ct = default)
|
||||||
|
{
|
||||||
|
var psi = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = fileName,
|
||||||
|
Arguments = args,
|
||||||
|
RedirectStandardOutput = true,
|
||||||
|
RedirectStandardError = true,
|
||||||
|
UseShellExecute = false,
|
||||||
|
CreateNoWindow = true
|
||||||
|
};
|
||||||
|
|
||||||
|
var process = new Process { StartInfo = psi, EnableRaisingEvents = true };
|
||||||
|
try
|
||||||
|
{
|
||||||
|
process.Start();
|
||||||
|
|
||||||
|
Task<string> stdOutTask = process.StandardOutput.ReadToEndAsync();
|
||||||
|
Task<string> stdErrTask = process.StandardError.ReadToEndAsync();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Task.WhenAll(stdOutTask, stdErrTask, process.WaitForExitAsync(ct));
|
||||||
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
|
{
|
||||||
|
if (!process.HasExited)
|
||||||
|
{
|
||||||
|
process.Kill();
|
||||||
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
|
string allOutput = (stdOutTask.Result ?? "") + (stdErrTask.Result ?? "");
|
||||||
|
//log?.Debug(allOutput);
|
||||||
|
return allOutput;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
process?.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<T> AddRunAndCaptureJsonAsync<T>(SerialPortData data, SerialPortData.EMeterArg eMeterArg) where T : new()
|
||||||
|
{
|
||||||
|
var task = RunAndCaptureJsonAsync<T>(data.SerialPortCmdClientPath, data.DefaultArgSettingsRead(eMeterArg));
|
||||||
|
taskPool.Add(task);
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<T> RunAndCaptureJsonAsync<T>(string fileName, string args, CancellationToken ct = default) where T : new()
|
||||||
|
{
|
||||||
|
var psi = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = fileName,
|
||||||
|
Arguments = args,
|
||||||
|
RedirectStandardOutput = true,
|
||||||
|
RedirectStandardError = true,
|
||||||
|
UseShellExecute = false,
|
||||||
|
CreateNoWindow = true
|
||||||
|
};
|
||||||
|
|
||||||
|
var process = new Process { StartInfo = psi, EnableRaisingEvents = true };
|
||||||
|
try
|
||||||
|
{
|
||||||
|
process.Start();
|
||||||
|
|
||||||
|
var stdoutTask = process.StandardOutput.ReadToEndAsync();
|
||||||
|
var stderrTask = process.StandardError.ReadToEndAsync();
|
||||||
|
|
||||||
|
await Task.WhenAll(stdoutTask, stderrTask, process.WaitForExitAsync(ct));
|
||||||
|
|
||||||
|
string allOutput = (stdoutTask.Result ?? "") + (stderrTask.Result ?? "");
|
||||||
|
//log?.Debug(allOutput);
|
||||||
|
|
||||||
|
string json = ExtractJson(allOutput);
|
||||||
|
if (TryJsonStringDeserialize(json, out T result)) return result;
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
process?.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool TryJsonStringDeserialize<T>(string json, out T runAndCaptureJsonAsync) where T : new()
|
||||||
|
{
|
||||||
|
if (json != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
runAndCaptureJsonAsync = JsonConvert.DeserializeObject<T>(json);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
// log.Debug(ex.Message);
|
||||||
|
runAndCaptureJsonAsync = TryConvert<T>(json);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
runAndCaptureJsonAsync = default;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static T TryConvert<T>(string json) where T : new()
|
||||||
|
{
|
||||||
|
|
||||||
|
T obj = new T();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
JObject jObject = JObject.Parse(json);
|
||||||
|
|
||||||
|
foreach (PropertyInfo prop in typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance))
|
||||||
|
{
|
||||||
|
if (!prop.CanWrite) continue;
|
||||||
|
|
||||||
|
JToken token;
|
||||||
|
if (jObject.TryGetValue(prop.Name, StringComparison.OrdinalIgnoreCase, out token))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
object value = token.ToObject(prop.PropertyType);
|
||||||
|
prop.SetValue(obj, value);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// leave default if conversion fails
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// else → keep default value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"TryConvert failed: {ex.Message}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ExtractJson(string text)
|
||||||
|
{
|
||||||
|
int start = text.IndexOf('{');
|
||||||
|
int end = text.LastIndexOf('}');
|
||||||
|
|
||||||
|
if (start >= 0 && end > start)
|
||||||
|
{
|
||||||
|
return text.Substring(start, end - start + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.NfcHandler.Utils
|
||||||
|
{
|
||||||
|
public static class ProcessExtensions
|
||||||
|
{
|
||||||
|
public static Task<object> WaitForExitAsync(this Process process, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
if (process == null) throw new ArgumentNullException(nameof(process));
|
||||||
|
if (process.HasExited) return Task.FromResult<object>(null);
|
||||||
|
|
||||||
|
var tcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||||
|
|
||||||
|
EventHandler handler = null;
|
||||||
|
handler = (s, e) =>
|
||||||
|
{
|
||||||
|
try { tcs.TrySetResult(null); }
|
||||||
|
finally { process.Exited -= handler; }
|
||||||
|
};
|
||||||
|
|
||||||
|
process.EnableRaisingEvents = true;
|
||||||
|
process.Exited += handler;
|
||||||
|
|
||||||
|
if (cancellationToken.CanBeCanceled)
|
||||||
|
{
|
||||||
|
cancellationToken.Register(() =>
|
||||||
|
{
|
||||||
|
tcs.TrySetCanceled(cancellationToken);
|
||||||
|
process.Exited -= handler;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return tcs.Task;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,171 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO.Ports;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
//*****************************************************************************
|
||||||
|
// Copyright 2020 Sensus GmbH Ludwigshafen. All rights reserved.
|
||||||
|
// Author: Venkat, Rajeshwar
|
||||||
|
//*****************************************************************************
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.NfcHandler.Utils
|
||||||
|
{
|
||||||
|
public class SERIAL_Driver
|
||||||
|
{
|
||||||
|
public string ErrorMessage { get; private set; }
|
||||||
|
public Collection<byte> SerialPortReadBuffer = new Collection<byte>();
|
||||||
|
private SerialPort _serialPort;
|
||||||
|
|
||||||
|
private List<byte[]> _binMessages = new List<byte[]>();
|
||||||
|
private bool _isReading;
|
||||||
|
private Parity Parity { get; set; }
|
||||||
|
private StopBits StopBits { get; set; }
|
||||||
|
|
||||||
|
public SERIAL_Driver()
|
||||||
|
{
|
||||||
|
_serialPort = new SerialPort();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool OpenConnection(string comPort, int baudrate, int dataBits, Parity parity, StopBits stopbits, int readTimeout=1000, int writeTimeout = 1000)
|
||||||
|
{
|
||||||
|
lock (this)
|
||||||
|
{
|
||||||
|
if ((_serialPort != null) && (_serialPort.IsOpen))
|
||||||
|
{
|
||||||
|
_serialPort.DataReceived -= DataReceivedHandler;
|
||||||
|
_serialPort.Close();
|
||||||
|
_serialPort.Dispose();
|
||||||
|
_serialPort = null;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ErrorMessage = "";
|
||||||
|
//_serialPort = new SerialPort(comPort, 57600, Parity.None, 8, StopBits.Two);
|
||||||
|
_serialPort = new SerialPort(comPort, baudrate, parity, dataBits, stopbits);
|
||||||
|
_serialPort.ReadTimeout = readTimeout;
|
||||||
|
_serialPort.WriteTimeout = writeTimeout;
|
||||||
|
_serialPort.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler);
|
||||||
|
_serialPort.Open();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ErrorMessage = String.Format("COM error: Open failed {0}.{1}", comPort, ex.Message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_serialPort.IsOpen)
|
||||||
|
{
|
||||||
|
ErrorMessage = String.Format("COM error: Can't Open {0}.", comPort);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}//End Lock
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public bool SendMessage(byte[] sendDataBytes, int length, int readTimeout = 1000, int writeTimeout=1000)
|
||||||
|
{
|
||||||
|
if (!isOpen()) return false;
|
||||||
|
if (sendDataBytes.Length == 0) return true; // nothing to send - no error
|
||||||
|
try
|
||||||
|
{
|
||||||
|
PrepareReading(); //clear read buffer etc.
|
||||||
|
_serialPort.WriteTimeout = writeTimeout;
|
||||||
|
_serialPort.ReadTimeout = readTimeout;
|
||||||
|
_serialPort.Write(sendDataBytes, 0, length);
|
||||||
|
_isReading = true;
|
||||||
|
Thread.Sleep(100);
|
||||||
|
var stopWatch = Stopwatch.StartNew(); //start stop watch for data recevie timeout
|
||||||
|
while (_isReading) //wait until reading finishes or timeout occur
|
||||||
|
{
|
||||||
|
if (stopWatch.ElapsedMilliseconds > readTimeout)
|
||||||
|
{
|
||||||
|
stopWatch.Stop();
|
||||||
|
ErrorMessage = "COM error: Receive timeout";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ErrorMessage = String.Format("COM error: Transmit timeout {0}.{1}", _serialPort.PortName, ex.Message);
|
||||||
|
return false; // Exception in send function
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
private void PrepareReading()
|
||||||
|
{
|
||||||
|
_serialPort.DiscardInBuffer();
|
||||||
|
if(_binMessages != null) _binMessages.Clear();
|
||||||
|
_isReading = true;
|
||||||
|
}
|
||||||
|
public byte[] GetRawData()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_binMessages.Count > 0)
|
||||||
|
return _binMessages[0].ToArray();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception)
|
||||||
|
{
|
||||||
|
byte[] err = { 0xFF };
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e)
|
||||||
|
{
|
||||||
|
if (!_serialPort.IsOpen) return;
|
||||||
|
lock (this)
|
||||||
|
{
|
||||||
|
Thread.Sleep(100);
|
||||||
|
if (!_serialPort.IsOpen) return;
|
||||||
|
SerialPortReadBuffer = new Collection<byte>();
|
||||||
|
while (_serialPort.BytesToRead > 0)
|
||||||
|
{
|
||||||
|
SerialPortReadBuffer.Add((byte)_serialPort.ReadByte());
|
||||||
|
}
|
||||||
|
|
||||||
|
_binMessages.Add(SerialPortReadBuffer.ToArray());
|
||||||
|
_isReading = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CloseConnection()
|
||||||
|
{
|
||||||
|
if ((_serialPort != null) && (_serialPort.IsOpen))
|
||||||
|
{
|
||||||
|
_serialPort.DataReceived -= DataReceivedHandler;
|
||||||
|
_serialPort.Close();
|
||||||
|
_serialPort.Dispose();
|
||||||
|
_serialPort = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Close()
|
||||||
|
{
|
||||||
|
if (isOpen())
|
||||||
|
{
|
||||||
|
_serialPort.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if (_serialPort != null)
|
||||||
|
{
|
||||||
|
_serialPort.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bool isOpen()
|
||||||
|
{
|
||||||
|
if(_serialPort != null)
|
||||||
|
return _serialPort.IsOpen;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.NfcHandler.Utils
|
||||||
|
{
|
||||||
|
public class SerialPortData
|
||||||
|
{
|
||||||
|
private Boolean? _cliExists;
|
||||||
|
public bool CliExists { get {
|
||||||
|
if (_cliExists == null || !_cliExists.HasValue)
|
||||||
|
{
|
||||||
|
_cliExists = File.Exists(SerialPortCmdClientPath);
|
||||||
|
}
|
||||||
|
return _cliExists.Value;
|
||||||
|
} }
|
||||||
|
public string SerialPortCmdClientPath {
|
||||||
|
get {
|
||||||
|
#if DEBUG
|
||||||
|
return Path.Combine("C:\\","TBF","Cli", CmdClientName);
|
||||||
|
#else
|
||||||
|
return Path.Combine("..","Cli", CmdClientName);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string CmdClientName { get; set; } = "HalCli.exe";
|
||||||
|
public string PortName { get; set; }
|
||||||
|
public int MeterType { get; set; }
|
||||||
|
public string MeterTypeStr { get; set; }
|
||||||
|
|
||||||
|
public enum EMeterArg {
|
||||||
|
Calibration = 0,
|
||||||
|
AllParams = 2,
|
||||||
|
DeviceId = 3,
|
||||||
|
Optohead = 4,
|
||||||
|
}
|
||||||
|
EMeterArg _eMeterArg = EMeterArg.AllParams;
|
||||||
|
|
||||||
|
public string DefaultArgSettingsRead(EMeterArg eMeterArg)
|
||||||
|
{
|
||||||
|
string meterTypeInsert = !string.IsNullOrEmpty(MeterTypeStr) ? MeterTypeStr : MeterType.ToString();
|
||||||
|
switch (eMeterArg)
|
||||||
|
{
|
||||||
|
case EMeterArg.AllParams:
|
||||||
|
return $"-p {PortName} -m {meterTypeInsert} --operation readall";
|
||||||
|
case EMeterArg.DeviceId:
|
||||||
|
return $"-p {PortName} -m {meterTypeInsert} --operation read --parameter DeviceId";
|
||||||
|
case EMeterArg.Optohead:
|
||||||
|
return $"-p {PortName} -m {meterTypeInsert} --operation read --parameter \"OpticalDataMode\"";
|
||||||
|
default:
|
||||||
|
throw new Exception("Not implemented correct command!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string DefaultArgSettingsWrite(EMeterArg eMeterArg, string arg)
|
||||||
|
{
|
||||||
|
string meterTypeInsert = !string.IsNullOrEmpty(MeterTypeStr) ? MeterTypeStr : MeterType.ToString();
|
||||||
|
switch (eMeterArg)
|
||||||
|
{
|
||||||
|
case EMeterArg.Calibration:
|
||||||
|
return $"-p {PortName} -m {meterTypeInsert} --operation write --parameter Calibration --value {arg}";
|
||||||
|
case EMeterArg.Optohead:
|
||||||
|
return $"-p {PortName} -m {meterTypeInsert} --operation write --parameter \"OpticalDataMode\" --value {arg}";
|
||||||
|
default:
|
||||||
|
throw new Exception("Not implemented correct command!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public SerialPortData(
|
||||||
|
string portName,
|
||||||
|
string cmdClientName,
|
||||||
|
int meterType)
|
||||||
|
{
|
||||||
|
PortName = portName;
|
||||||
|
CmdClientName = cmdClientName;
|
||||||
|
MeterType = meterType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SerialPortData(
|
||||||
|
string portName,
|
||||||
|
string cmdClientName,
|
||||||
|
string meterType)
|
||||||
|
{
|
||||||
|
PortName = portName;
|
||||||
|
CmdClientName = cmdClientName;
|
||||||
|
MeterTypeStr = meterType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,158 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
//*****************************************************************************
|
||||||
|
// Copyright 2020 Sensus GmbH Ludwigshafen. All rights reserved.
|
||||||
|
// Author: Venkat, Rajeshwar
|
||||||
|
//*****************************************************************************
|
||||||
|
|
||||||
|
namespace NfcC7_DLL.NfcHandler.Utils
|
||||||
|
{
|
||||||
|
public static class Tools
|
||||||
|
{
|
||||||
|
public static bool ByteArrayCompare(byte[] a1, byte[] a2)
|
||||||
|
{
|
||||||
|
// thanks to https://stackoverflow.com/questions/43289/comparing-two-byte-arrays-in-net
|
||||||
|
if (a1.Length != a2.Length)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (int i = 0; i < a1.Length; i++)
|
||||||
|
if (a1[i] != a2[i])
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public static string SwapHex(string sHex)
|
||||||
|
{
|
||||||
|
string sResult = "";
|
||||||
|
int iPos = sHex.Length - 2;
|
||||||
|
while (iPos >= 0)
|
||||||
|
{
|
||||||
|
sResult += sHex.Substring(iPos, 2);
|
||||||
|
sHex = sHex.Remove(iPos, 2);
|
||||||
|
iPos = sHex.Length - 2;
|
||||||
|
}
|
||||||
|
return sResult;
|
||||||
|
}
|
||||||
|
public static string DecimalToHexString(string value, int size = 1)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
long Lval = long.Parse(value);
|
||||||
|
if (size == 1) return Lval.ToString("X2");
|
||||||
|
if (size == 2) return Lval.ToString("X4");
|
||||||
|
if (size == 4) return Lval.ToString("X8");
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
if (size == 1) return "00";
|
||||||
|
if (size == 2) return "0000";
|
||||||
|
if (size == 4) return "00000000";
|
||||||
|
}
|
||||||
|
return "00";
|
||||||
|
}
|
||||||
|
public static string ByteToHexString(byte data)
|
||||||
|
{
|
||||||
|
List<byte> val = new List<byte>();
|
||||||
|
val.Add(data);
|
||||||
|
byte[] arr = val.ToArray();
|
||||||
|
return BytesToHex(arr);
|
||||||
|
}
|
||||||
|
public static string BytesToHex(byte[] data)
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
foreach (byte b in data)
|
||||||
|
sb.Append(b.ToString("X2"));
|
||||||
|
|
||||||
|
return sb.ToString();
|
||||||
|
|
||||||
|
}
|
||||||
|
public static byte[] HexStringToByteArray(String hexString)
|
||||||
|
{
|
||||||
|
int numberChars = hexString.Length;
|
||||||
|
byte[] bytes = new byte[numberChars / 2];
|
||||||
|
for (int i = 0; i < numberChars; i += 2)
|
||||||
|
{
|
||||||
|
bytes[i / 2] = Convert.ToByte(hexString.Substring(i, 2), 16);
|
||||||
|
}
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
public enum InitialCrcValue
|
||||||
|
{
|
||||||
|
Zeros,
|
||||||
|
NonZero1 = 0xffff,
|
||||||
|
NonZero2 = 0x1D0F
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Crc16Ccitt
|
||||||
|
{
|
||||||
|
private const ushort poly = 0x1021;
|
||||||
|
ushort[] table = new ushort[256];
|
||||||
|
ushort initialValue = 0;
|
||||||
|
|
||||||
|
public ushort ComputeChecksum(byte[] bytes)
|
||||||
|
{
|
||||||
|
ushort crc = this.initialValue;
|
||||||
|
for (int i = 0; i < bytes.Length; ++i)
|
||||||
|
{
|
||||||
|
crc = (ushort)((crc << 8) ^ table[((crc >> 8) ^ (0xff & bytes[i]))]);
|
||||||
|
}
|
||||||
|
return crc;
|
||||||
|
}
|
||||||
|
public byte[] ComputeChecksumBytes(byte[] bytes)
|
||||||
|
{
|
||||||
|
ushort crc = ComputeChecksum(bytes);
|
||||||
|
return BitConverter.GetBytes(crc);
|
||||||
|
}
|
||||||
|
public Crc16Ccitt(InitialCrcValue initialValue)
|
||||||
|
{
|
||||||
|
this.initialValue = (ushort) initialValue;
|
||||||
|
ushort temp, a;
|
||||||
|
for (int i = 0; i < table.Length; ++i)
|
||||||
|
{
|
||||||
|
temp = 0;
|
||||||
|
a = (ushort) (i << 8);
|
||||||
|
for (int j = 0; j < 8; ++j)
|
||||||
|
{
|
||||||
|
if (((temp ^ a) & 0x8000) != 0)
|
||||||
|
{
|
||||||
|
temp = (ushort) ((temp << 1) ^ poly);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
temp <<= 1;
|
||||||
|
}
|
||||||
|
a <<= 1;
|
||||||
|
}
|
||||||
|
table[i] = temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public byte[] calcCRCfromMessage(byte[] message)
|
||||||
|
{
|
||||||
|
// CRC calculation goes from MessageID to Password
|
||||||
|
// For Read this means MsgID (1) + Offset (2) + PayloadLength (1) + Password (2) = 6
|
||||||
|
// for write the length of the payload comes on top.
|
||||||
|
// STX(1), length(1), CRC(2) and ETX(1) are excluded, in total 5 bytes.
|
||||||
|
//
|
||||||
|
// the method works both for sending messages (where the CRC and ETX are not in message)
|
||||||
|
// and for receiving messages (where the CRC and ETX are included at the end)
|
||||||
|
byte[] crc_msg = new byte[message[1]]; // message length is 2nd byte
|
||||||
|
Array.Copy(message, 2, crc_msg, 0, crc_msg.Length);
|
||||||
|
return ComputeChecksumBytes(crc_msg);
|
||||||
|
}
|
||||||
|
public string commentCRC(byte[] crc_meter, byte[] crc_computed)
|
||||||
|
{
|
||||||
|
bool crc_do_match = Tools.ByteArrayCompare(crc_meter, crc_computed);
|
||||||
|
string crcComment = crc_do_match ? "ok." : "CRC DOESN'T MATCH!!";
|
||||||
|
return "CRC Meter: " + Tools.BytesToHex(crc_meter) + (crc_do_match ? " == " : " != ")
|
||||||
|
+ "CRC Computed: " + Tools.BytesToHex(crc_computed) + ". " + crcComment;
|
||||||
|
}
|
||||||
|
public bool crc_do_match(byte[] a, byte[] b)
|
||||||
|
{
|
||||||
|
return ByteArrayCompare(a, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,7 +38,7 @@ namespace ResetBatchNr
|
|||||||
ls.BatchNr = 1;
|
ls.BatchNr = 1;
|
||||||
ls.Save();
|
ls.Save();
|
||||||
|
|
||||||
Console.WriteLine("BatchNr was reset to 1");
|
Console.WriteLine(@"BatchNr was reset to 1");
|
||||||
Console.ReadLine();
|
Console.ReadLine();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,6 +181,18 @@ namespace Results.Entities
|
|||||||
return WaterMeters.Count - PassedMetersCount();
|
return WaterMeters.Count - PassedMetersCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public virtual int PassedMetersCountE15()
|
||||||
|
{
|
||||||
|
int count = 0;
|
||||||
|
foreach (var mtr in WaterMeters) if (mtr.PassedFromTestsE15()) count++;
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
public virtual int FailedMetersCountE15()
|
||||||
|
{
|
||||||
|
return WaterMeters.Count - PassedMetersCountE15();
|
||||||
|
}
|
||||||
|
|
||||||
public virtual long ErrorFlags()
|
public virtual long ErrorFlags()
|
||||||
{
|
{
|
||||||
long result = 0;
|
long result = 0;
|
||||||
|
|||||||
@@ -16,21 +16,31 @@ namespace Results.Entities
|
|||||||
public virtual double PulsesMeter { get; set; } /// # of water meter or heat meter pulses
|
public virtual double PulsesMeter { get; set; } /// # of water meter or heat meter pulses
|
||||||
public virtual double PulsesMaster { get; set; } /// # of reference flowmeter pulses (gated by this water meter pulses)
|
public virtual double PulsesMaster { get; set; } /// # of reference flowmeter pulses (gated by this water meter pulses)
|
||||||
public virtual double PulsesPerLiter { get; set; } /// [l ^ -1], in case of heat meters (CompoundMeterId==5) pulses per kWh in [kWh ^ -1]
|
public virtual double PulsesPerLiter { get; set; } /// [l ^ -1], in case of heat meters (CompoundMeterId==5) pulses per kWh in [kWh ^ -1]
|
||||||
|
public virtual double PulsesPerKilogram { get; set; } /// [kg ^ -1]
|
||||||
public virtual double VolumeStart { get; set; } /// Volume or energy (CompoundMeterId==5) on test start in [l] or [J]
|
public virtual double VolumeStart { get; set; } /// Volume or energy (CompoundMeterId==5) on test start in [l] or [J]
|
||||||
public virtual double VolumeEnd { get; set; } /// Volume or energy (CompoundMeterId==5) on test end in [l] or [J]
|
public virtual double VolumeEnd { get; set; } /// Volume or energy (CompoundMeterId==5) on test end in [l] or [J]
|
||||||
public virtual double VolumeMeter { get; set; } /// Measured volume or energy (CompoundMeterId==5) in [l] or [J]
|
public virtual double VolumeMeter { get; set; } /// Measured volume or energy (CompoundMeterId==5) in [l] or [J]
|
||||||
public virtual double VolumeRef { get; set; } /// Reference volume or energy (CompoundMeterId==5) in [l] or [J]
|
public virtual double MassMeter { get; set; } /// Measured mass or energy (CompoundMeterId==5) in [kg] or [J]
|
||||||
|
public virtual double VolumeRef { get; set; } /// Reference volume or energy (CompoundMeterId==5) in [l] or [J]
|
||||||
|
public virtual double MassRef { get; set; } /// Reference mass or energy (CompoundMeterId==5) in [kg] or [J]
|
||||||
public virtual double TimestampStart { get; set; } /// [s]
|
public virtual double TimestampStart { get; set; } /// [s]
|
||||||
public virtual double TimestampEnd { get; set; } /// [s]
|
public virtual double TimestampEnd { get; set; } /// [s]
|
||||||
public virtual double TestTime { get; set; } /// [s]
|
public virtual double TestTime { get; set; } /// [s]
|
||||||
|
|
||||||
/// Main result
|
/// Main result
|
||||||
public virtual double Error { get; set; } /// [%]
|
public virtual double Error { get; set; } /// [%] for volume register reader
|
||||||
|
public virtual double ErrorMass { get; set; } /// [%] for mass register reader
|
||||||
public virtual long ErrorIndicators { get; set; } /// Not mapped to DB !!!, bit24=E25, bit25=E26, bit26=E27, bit27=E28 (error flags)
|
public virtual long ErrorIndicators { get; set; } /// Not mapped to DB !!!, bit24=E25, bit25=E26, bit26=E27, bit27=E28 (error flags)
|
||||||
public virtual long InfoIndicators { get; set; } /// Not mapped to DB !!!, bit24=E25, bit25=E26, bit26=E27, bit27=E28 (info flags)
|
public virtual long InfoIndicators { get; set; } /// Not mapped to DB !!!, bit24=E25, bit25=E26, bit26=E27, bit27=E28 (info flags)
|
||||||
public virtual bool TestDone { get; set; } /// true = test was completed
|
public virtual bool TestDone { get; set; } /// true = test was completed
|
||||||
public virtual bool Passed { get; set; } /// true = test passed, water meter is OK
|
public virtual bool Passed { get; set; } /// true = test passed, water meter is OK for Volume RegisterReader
|
||||||
|
public virtual bool PassedMass { get; set; } /// true = test passed, water meter is OK for Mass RegisterReader
|
||||||
|
public virtual string QuantityUnits { get; set; } /// dm3, kg, etc. - this value defined the quantity of meter, its decisive for distinction of pulse types
|
||||||
#if IPERL
|
#if IPERL
|
||||||
|
public virtual int CalibFactor { get; set; }
|
||||||
|
public virtual int CalibFactorLNA { get; set; }
|
||||||
|
public virtual int Q2CorrRL { get; set; }
|
||||||
|
public virtual int Q2CorrLR { get; set; }
|
||||||
public virtual string ExtraDataPath { get; set; } /// Relative path to a file with opto-data/raw-data
|
public virtual string ExtraDataPath { get; set; } /// Relative path to a file with opto-data/raw-data
|
||||||
public virtual float X1 { get; set; }
|
public virtual float X1 { get; set; }
|
||||||
public virtual float X2 { get; set; }
|
public virtual float X2 { get; set; }
|
||||||
@@ -119,6 +129,33 @@ namespace Results.Entities
|
|||||||
return Passed ? yesNo[0] : ((yesNo.Length >= 2) ? yesNo[1] : Results.Resources.Strings.No);
|
return Passed ? yesNo[0] : ((yesNo.Length >= 2) ? yesNo[1] : Results.Resources.Strings.No);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public virtual string PassedMassColorStr(string yesNoFormatOrEmpty)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(yesNoFormatOrEmpty))
|
||||||
|
{
|
||||||
|
return Utils.PassedColorStr(PassedMass, Evaluate());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string[] yesNo = yesNoFormatOrEmpty.Split(new char[] { '~' });
|
||||||
|
return PassedMass ? yesNo[0] : ((yesNo.Length >= 2) ? yesNo[1] : Results.Resources.Strings.No);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual string GetQuantityFromUnits()
|
||||||
|
{
|
||||||
|
|
||||||
|
if (QuantityUnits == "kg")
|
||||||
|
{
|
||||||
|
return "Mass";
|
||||||
|
}
|
||||||
|
else if (QuantityUnits == "dm3")
|
||||||
|
{
|
||||||
|
return "Volume";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "Volume";
|
||||||
|
}
|
||||||
|
|
||||||
public MeterTestRslt()
|
public MeterTestRslt()
|
||||||
{
|
{
|
||||||
@@ -166,6 +203,10 @@ namespace Results.Entities
|
|||||||
TestDone = src.TestDone;
|
TestDone = src.TestDone;
|
||||||
Passed = src.Passed;
|
Passed = src.Passed;
|
||||||
#if IPERL
|
#if IPERL
|
||||||
|
CalibFactor = src.CalibFactor;
|
||||||
|
CalibFactorLNA = src.CalibFactorLNA;
|
||||||
|
Q2CorrRL = src.Q2CorrRL;
|
||||||
|
Q2CorrLR = src.Q2CorrLR;
|
||||||
ExtraDataPath = src.ExtraDataPath;
|
ExtraDataPath = src.ExtraDataPath;
|
||||||
X1 = src.X1;
|
X1 = src.X1;
|
||||||
X2 = src.X2;
|
X2 = src.X2;
|
||||||
@@ -209,6 +250,10 @@ namespace Results.Entities
|
|||||||
writer.Write(TestDone);
|
writer.Write(TestDone);
|
||||||
writer.Write(Passed);
|
writer.Write(Passed);
|
||||||
#if IPERL
|
#if IPERL
|
||||||
|
writer.Write(CalibFactor);
|
||||||
|
writer.Write(CalibFactorLNA);
|
||||||
|
writer.Write(Q2CorrRL);
|
||||||
|
writer.Write(Q2CorrLR);
|
||||||
writer.Write((ExtraDataPath != null) ? ExtraDataPath : string.Empty);
|
writer.Write((ExtraDataPath != null) ? ExtraDataPath : string.Empty);
|
||||||
writer.Write(X1);
|
writer.Write(X1);
|
||||||
writer.Write(X2);
|
writer.Write(X2);
|
||||||
@@ -249,6 +294,10 @@ namespace Results.Entities
|
|||||||
TestDone = reader.ReadBoolean();
|
TestDone = reader.ReadBoolean();
|
||||||
Passed = reader.ReadBoolean();
|
Passed = reader.ReadBoolean();
|
||||||
#if IPERL
|
#if IPERL
|
||||||
|
CalibFactor = reader.ReadInt32();
|
||||||
|
CalibFactorLNA = reader.ReadInt32();
|
||||||
|
Q2CorrRL = reader.ReadInt32();
|
||||||
|
Q2CorrLR = reader.ReadInt32();
|
||||||
ExtraDataPath = reader.ReadString();
|
ExtraDataPath = reader.ReadString();
|
||||||
X1 = reader.ReadSingle();
|
X1 = reader.ReadSingle();
|
||||||
X2 = reader.ReadSingle();
|
X2 = reader.ReadSingle();
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ namespace Results.Entities
|
|||||||
public virtual double ConstMasterCorr { get; set; } /// [l/pls] Liters per pulse of the master flow meter corrected by a correction table.
|
public virtual double ConstMasterCorr { get; set; } /// [l/pls] Liters per pulse of the master flow meter corrected by a correction table.
|
||||||
public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter calculated from a mass measurement.
|
public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter calculated from a mass measurement.
|
||||||
/// When mass measurement is not available, corrected by a correction table.
|
/// When mass measurement is not available, corrected by a correction table.
|
||||||
|
public virtual double MassConstMaster { get; set; } /// [kg/pls] kilograms per pulse of the master flow meter calculated from a mass measurement.
|
||||||
|
/// When mass measurement is not available, corrected by a correction table.
|
||||||
public virtual double MassStartRaw { get; set; } /// [kg]
|
public virtual double MassStartRaw { get; set; } /// [kg]
|
||||||
public virtual double MassStart { get; set; } /// [kg]
|
public virtual double MassStart { get; set; } /// [kg]
|
||||||
public virtual double MassEndRaw { get; set; } /// [kg]
|
public virtual double MassEndRaw { get; set; } /// [kg]
|
||||||
@@ -48,7 +50,11 @@ namespace Results.Entities
|
|||||||
public virtual double Flow { get; set; } /// [m3/h] calculated from conventional true value
|
public virtual double Flow { get; set; } /// [m3/h] calculated from conventional true value
|
||||||
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
|
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
|
||||||
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
|
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
|
||||||
public virtual double ErrorMaster { get; set; } /// [%] Error of the master flow meter
|
public virtual double ErrorMaster { get; set; } /// [%] Error of the master flow meter
|
||||||
|
public virtual double MassFlow { get; set; } /// [t/h] calculated from conventional true value
|
||||||
|
public virtual double MassCTV { get; set; } /// [kg] Volume conventional true value
|
||||||
|
public virtual double MassMaster { get; set; } /// [kg] Volume from the master flow meter
|
||||||
|
public virtual double MassErrorMaster { get; set; } /// [%] Error of the master flow meter
|
||||||
|
|
||||||
public virtual float DiverterStart { get; set; } /// [s] Diverter switch time or a start/stop valve open time when the test starts
|
public virtual float DiverterStart { get; set; } /// [s] Diverter switch time or a start/stop valve open time when the test starts
|
||||||
public virtual float DivStart10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
|
public virtual float DivStart10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
|
||||||
|
|||||||
@@ -189,6 +189,12 @@ namespace Results.Entities
|
|||||||
{
|
{
|
||||||
return ErrorFlagsFromTests() | ErrorFlags;
|
return ErrorFlagsFromTests() | ErrorFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual long ErrorFlagsFromTestsAndWMByFlag(ErrorFlagMask errorFlagsQuestion)
|
||||||
|
{
|
||||||
|
long errorFlagsMask = (long)errorFlagsQuestion;
|
||||||
|
return ErrorFlagsFromTests() & errorFlagsMask;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Convert combined errorFlags of all tests to string
|
/// Convert combined errorFlags of all tests to string
|
||||||
@@ -270,6 +276,24 @@ namespace Results.Entities
|
|||||||
|
|
||||||
return passed;
|
return passed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual bool PassedFromTestsE15()
|
||||||
|
{
|
||||||
|
//TODO BUMI this will just let us is E15
|
||||||
|
bool passed = (ErrorFlagsFromTestsAndWMByFlag(ErrorFlagMask.E15) == 0);
|
||||||
|
|
||||||
|
//TODO BUMI Check This may be not needed ?
|
||||||
|
foreach (var mtr in MeterTestRslts)
|
||||||
|
{
|
||||||
|
if (mtr.Evaluate() && (!mtr.TestDone))
|
||||||
|
{
|
||||||
|
passed = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return passed;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Three state test results and/or water meter result (Algeria PT25 requirement).
|
/// Three state test results and/or water meter result (Algeria PT25 requirement).
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ namespace Results.Entities
|
|||||||
public virtual string ApprovalInfo { get; set; }
|
public virtual string ApprovalInfo { get; set; }
|
||||||
public virtual string Certificate { get; set; }
|
public virtual string Certificate { get; set; }
|
||||||
public virtual double PulsesPerLtr { get; set; }
|
public virtual double PulsesPerLtr { get; set; }
|
||||||
|
public virtual double PulsesPerKilogram { get; set; }
|
||||||
|
|
||||||
/// Concerns compound water meters
|
/// Concerns compound water meters
|
||||||
public virtual string ProducerAux { get; set; }
|
public virtual string ProducerAux { get; set; }
|
||||||
public virtual double Q3_Qn_Aux { get; set; } /// [m3/h]
|
public virtual double Q3_Qn_Aux { get; set; } /// [m3/h]
|
||||||
@@ -85,6 +86,7 @@ namespace Results.Entities
|
|||||||
ApprovalInfo = oriWMData.ApprovalInfo;
|
ApprovalInfo = oriWMData.ApprovalInfo;
|
||||||
Certificate = oriWMData.Certificate;
|
Certificate = oriWMData.Certificate;
|
||||||
PulsesPerLtr = oriWMData.PulsesPerLtr;
|
PulsesPerLtr = oriWMData.PulsesPerLtr;
|
||||||
|
PulsesPerKilogram = oriWMData.PulsesPerKilogram;
|
||||||
ProducerAux = oriWMData.ProducerAux;
|
ProducerAux = oriWMData.ProducerAux;
|
||||||
Q3_Qn_Aux = oriWMData.Q3_Qn_Aux;
|
Q3_Qn_Aux = oriWMData.Q3_Qn_Aux;
|
||||||
MetrologicalClassAux = oriWMData.MetrologicalClassAux;
|
MetrologicalClassAux = oriWMData.MetrologicalClassAux;
|
||||||
@@ -129,6 +131,7 @@ namespace Results.Entities
|
|||||||
if (ApprovalInfo != wmd.ApprovalInfo) return false;
|
if (ApprovalInfo != wmd.ApprovalInfo) return false;
|
||||||
if (Certificate != wmd.Certificate) return false;
|
if (Certificate != wmd.Certificate) return false;
|
||||||
if (PulsesPerLtr != wmd.PulsesPerLtr) return false;
|
if (PulsesPerLtr != wmd.PulsesPerLtr) return false;
|
||||||
|
if (PulsesPerKilogram != wmd.PulsesPerKilogram) return false;
|
||||||
if (ProducerAux != wmd.ProducerAux) return false;
|
if (ProducerAux != wmd.ProducerAux) return false;
|
||||||
if (Q3_Qn_Aux != wmd.Q3_Qn_Aux) return false;
|
if (Q3_Qn_Aux != wmd.Q3_Qn_Aux) return false;
|
||||||
if (MetrologicalClassAux != wmd.MetrologicalClassAux) return false;
|
if (MetrologicalClassAux != wmd.MetrologicalClassAux) return false;
|
||||||
@@ -188,6 +191,7 @@ namespace Results.Entities
|
|||||||
writer.Write((ApprovalInfo != null) ? ApprovalInfo : string.Empty);
|
writer.Write((ApprovalInfo != null) ? ApprovalInfo : string.Empty);
|
||||||
writer.Write((Certificate != null) ? Certificate : string.Empty);
|
writer.Write((Certificate != null) ? Certificate : string.Empty);
|
||||||
writer.Write(PulsesPerLtr);
|
writer.Write(PulsesPerLtr);
|
||||||
|
writer.Write(PulsesPerKilogram);
|
||||||
writer.Write((ProducerAux != null) ? ProducerAux : string.Empty);
|
writer.Write((ProducerAux != null) ? ProducerAux : string.Empty);
|
||||||
writer.Write(Q3_Qn_Aux);
|
writer.Write(Q3_Qn_Aux);
|
||||||
writer.Write((MetrologicalClassAux != null) ? MetrologicalClassAux : string.Empty);
|
writer.Write((MetrologicalClassAux != null) ? MetrologicalClassAux : string.Empty);
|
||||||
@@ -227,6 +231,7 @@ namespace Results.Entities
|
|||||||
ApprovalInfo = reader.ReadString();
|
ApprovalInfo = reader.ReadString();
|
||||||
Certificate = reader.ReadString();
|
Certificate = reader.ReadString();
|
||||||
PulsesPerLtr = reader.ReadDouble();
|
PulsesPerLtr = reader.ReadDouble();
|
||||||
|
PulsesPerKilogram = reader.ReadDouble();
|
||||||
ProducerAux = reader.ReadString();
|
ProducerAux = reader.ReadString();
|
||||||
Q3_Qn_Aux = reader.ReadDouble();
|
Q3_Qn_Aux = reader.ReadDouble();
|
||||||
MetrologicalClassAux = reader.ReadString();
|
MetrologicalClassAux = reader.ReadString();
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ namespace Results.Forms
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
this.Icon = Properties.Resources.TBF_icon;
|
||||||
|
|
||||||
firstEnabledControl = null;
|
firstEnabledControl = null;
|
||||||
lastSizeChange = DateTime.Now;
|
lastSizeChange = DateTime.Now;
|
||||||
nrGroups = 1;
|
nrGroups = 1;
|
||||||
|
|||||||
@@ -24,7 +24,10 @@ namespace Results.Forms
|
|||||||
public ManualEntryConfigDlg()
|
public ManualEntryConfigDlg()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
manualEntryConfigCtrl.Unlocked = true;
|
|
||||||
|
this.Icon = Properties.Resources.TBF_icon;
|
||||||
|
|
||||||
|
manualEntryConfigCtrl.Unlocked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ namespace Results.Forms
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
this.Icon = Properties.Resources.TBF_icon;
|
||||||
|
|
||||||
Localize();
|
Localize();
|
||||||
|
|
||||||
ShowAllResults(wm);
|
ShowAllResults(wm);
|
||||||
|
|||||||
@@ -35,7 +35,10 @@ namespace Results.Forms
|
|||||||
public ResultsConfigDlg()
|
public ResultsConfigDlg()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
resultsConfigCtrl.Unlocked = true;
|
|
||||||
|
this.Icon = Properties.Resources.TBF_icon;
|
||||||
|
|
||||||
|
resultsConfigCtrl.Unlocked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -349,6 +349,18 @@ namespace Results
|
|||||||
Pulses_main, /// 295 Compound main meter pulses (recalculated so that the gated ref. pulses for this meter are equal to the total ref. pulses)
|
Pulses_main, /// 295 Compound main meter pulses (recalculated so that the gated ref. pulses for this meter are equal to the total ref. pulses)
|
||||||
Pulses_aux, /// 296 Compound aux meter pulses (recalculated so that the gated ref. pulses for this meter are equal to the total ref. pulses)
|
Pulses_aux, /// 296 Compound aux meter pulses (recalculated so that the gated ref. pulses for this meter are equal to the total ref. pulses)
|
||||||
|
|
||||||
|
Failed_meters_countE15, /// 297
|
||||||
|
|
||||||
|
Quantity, /// 298
|
||||||
|
Reference_quantity, /// 299
|
||||||
|
Start_quantity, /// 300
|
||||||
|
End_quantity, /// 301
|
||||||
|
RR_Quantity, /// 302
|
||||||
|
RR_Units, /// 303
|
||||||
|
MassCTV, /// 304
|
||||||
|
Unit_per_pulse_Read, /// 305
|
||||||
|
Pulses_per_unit, /// 306
|
||||||
|
|
||||||
Count,
|
Count,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,16 +16,22 @@ namespace Results.Mappings
|
|||||||
Map(x => x.PulsesMeter);
|
Map(x => x.PulsesMeter);
|
||||||
Map(x => x.PulsesMaster);
|
Map(x => x.PulsesMaster);
|
||||||
Map(x => x.PulsesPerLiter);
|
Map(x => x.PulsesPerLiter);
|
||||||
Map(x => x.VolumeStart);
|
Map(x => x.PulsesPerKilogram);
|
||||||
|
Map(x => x.VolumeStart);
|
||||||
Map(x => x.VolumeEnd);
|
Map(x => x.VolumeEnd);
|
||||||
Map(x => x.VolumeMeter);
|
Map(x => x.VolumeMeter);
|
||||||
Map(x => x.VolumeRef);
|
Map(x => x.VolumeRef);
|
||||||
Map(x => x.TimestampStart);
|
Map(x => x.MassMeter);
|
||||||
|
Map(x => x.MassRef);
|
||||||
|
Map(x => x.TimestampStart);
|
||||||
Map(x => x.TimestampEnd);
|
Map(x => x.TimestampEnd);
|
||||||
Map(x => x.TestTime);
|
Map(x => x.TestTime);
|
||||||
Map(x => x.Error);
|
Map(x => x.Error);
|
||||||
|
Map(x => x.ErrorMass);
|
||||||
Map(x => x.TestDone);
|
Map(x => x.TestDone);
|
||||||
Map(x => x.Passed);
|
Map(x => x.Passed);
|
||||||
|
Map(x => x.PassedMass);
|
||||||
|
Map(x => x.QuantityUnits);
|
||||||
#if IPERL
|
#if IPERL
|
||||||
Map(x => x.ExtraDataPath);
|
Map(x => x.ExtraDataPath);
|
||||||
Map(x => x.X1);
|
Map(x => x.X1);
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ namespace Results.Mappings
|
|||||||
Map(x => x.VolumeCTV);
|
Map(x => x.VolumeCTV);
|
||||||
Map(x => x.VolumeMaster);
|
Map(x => x.VolumeMaster);
|
||||||
Map(x => x.ErrorMaster);
|
Map(x => x.ErrorMaster);
|
||||||
|
Map(x => x.MassFlow).Column("MassFlow");
|
||||||
|
Map(x => x.MassCTV);
|
||||||
|
Map(x => x.MassMaster);
|
||||||
|
Map(x => x.MassErrorMaster);
|
||||||
Map(x => x.DiverterStart);
|
Map(x => x.DiverterStart);
|
||||||
Map(x => x.DiverterEnd);
|
Map(x => x.DiverterEnd);
|
||||||
Map(x => x.ErrorFlags);
|
Map(x => x.ErrorFlags);
|
||||||
|
|||||||
+68
-1
@@ -224,15 +224,18 @@ namespace Results.Output
|
|||||||
/// Calculate Y-coordinate taking into account cell merging
|
/// Calculate Y-coordinate taking into account cell merging
|
||||||
float mergedRowPos = rowPos[rowIx];
|
float mergedRowPos = rowPos[rowIx];
|
||||||
mergedCellsCount = 1;
|
mergedCellsCount = 1;
|
||||||
|
List<string> texts = new List<string>();
|
||||||
|
texts.Add(Cells[rowIx][colIx].Text);
|
||||||
for (int rowIx2 = rowIx - 1; rowIx2 >= 0 && Cells[rowIx2][colIx].BottomMerge; rowIx2--)
|
for (int rowIx2 = rowIx - 1; rowIx2 >= 0 && Cells[rowIx2][colIx].BottomMerge; rowIx2--)
|
||||||
{
|
{
|
||||||
mergedRowPos += rowPos[rowIx2];
|
mergedRowPos += rowPos[rowIx2];
|
||||||
mergedCellsCount++;
|
mergedCellsCount++;
|
||||||
|
texts.Add(Cells[rowIx2][colIx].Text);
|
||||||
}
|
}
|
||||||
mergedRowPos /= mergedCellsCount;
|
mergedRowPos /= mergedCellsCount;
|
||||||
|
|
||||||
/// Print the text at the calculated position
|
/// Print the text at the calculated position
|
||||||
Common.Printers.PrintersCommon.PrintAt(e, Cells[rowIx][colIx].Text,
|
Common.Printers.PrintersCommon.PrintAt(e, mergedCellsCount == 1 ? Cells[rowIx][colIx].Text : GetMergedCellStringAsNegativeOrPositive(texts),
|
||||||
Cells[rowIx][colIx].Font,
|
Cells[rowIx][colIx].Font,
|
||||||
left + mergedColPos,
|
left + mergedColPos,
|
||||||
top + mergedRowPos,
|
top + mergedRowPos,
|
||||||
@@ -309,6 +312,70 @@ namespace Results.Output
|
|||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetMergedCellStringAsNegativeOrPositive(List<string> texts)
|
||||||
|
{
|
||||||
|
if (texts.Count < 1)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
bool firstIsHead = false;
|
||||||
|
bool hasNegativeAll = true;
|
||||||
|
bool hasPositiveAll = true;
|
||||||
|
bool hasMixed = false;
|
||||||
|
string lastRowText = null;
|
||||||
|
|
||||||
|
//check if is a header
|
||||||
|
|
||||||
|
foreach (string text in texts)
|
||||||
|
{
|
||||||
|
if (text != "-")
|
||||||
|
{
|
||||||
|
hasNegativeAll = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (text != "+")
|
||||||
|
{
|
||||||
|
hasPositiveAll = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasMixed)
|
||||||
|
{
|
||||||
|
if (lastRowText == null)
|
||||||
|
{
|
||||||
|
lastRowText = text;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (lastRowText != text)
|
||||||
|
{
|
||||||
|
hasMixed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
lastRowText = text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasMixed)
|
||||||
|
{
|
||||||
|
//merge as negative
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
|
else if (hasPositiveAll)
|
||||||
|
{
|
||||||
|
//merge as positive
|
||||||
|
return "+";
|
||||||
|
}
|
||||||
|
else if (hasNegativeAll)
|
||||||
|
{
|
||||||
|
//merge as negative
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
|
|
||||||
|
return texts[0];
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a table where tests are in columns.
|
/// Create a table where tests are in columns.
|
||||||
/// Left column contains item (or row) captions.
|
/// Left column contains item (or row) captions.
|
||||||
|
|||||||
Generated
+11
-1
@@ -19,7 +19,7 @@ namespace Results.Properties {
|
|||||||
// class via a tool like ResGen or Visual Studio.
|
// class via a tool like ResGen or Visual Studio.
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
// with the /str option, or rebuild your VS project.
|
// with the /str option, or rebuild your VS project.
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Resources {
|
internal class Resources {
|
||||||
@@ -69,5 +69,15 @@ namespace Results.Properties {
|
|||||||
return ((System.Drawing.Bitmap)(obj));
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Icon TBF_icon {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("TBF_icon", resourceCulture);
|
||||||
|
return ((System.Drawing.Icon)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,4 +121,7 @@
|
|||||||
<data name="Headpic" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="Headpic" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\Headpic.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\Headpic.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TBF_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\TBF_icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Generated
+36
@@ -294,6 +294,15 @@ namespace Results.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to End quantity.
|
||||||
|
/// </summary>
|
||||||
|
internal static string End_quantity {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("End_quantity", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to End state.
|
/// Looks up a localized string similar to End state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -897,6 +906,15 @@ namespace Results.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Pulses/Unit.
|
||||||
|
/// </summary>
|
||||||
|
internal static string PulsesUnit {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("PulsesUnit", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Q fall.
|
/// Looks up a localized string similar to Q fall.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1131,6 +1149,15 @@ namespace Results.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Start quantity.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Start_quantity {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Start_quantity", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Start volume.
|
/// Looks up a localized string similar to Start volume.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2103,6 +2130,15 @@ namespace Results.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Quant..
|
||||||
|
/// </summary>
|
||||||
|
internal static string VName_Quantity {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("VName_Quantity", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Temp..
|
/// Looks up a localized string similar to Temp..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -123,9 +123,18 @@
|
|||||||
<data name="Alignment" xml:space="preserve">
|
<data name="Alignment" xml:space="preserve">
|
||||||
<value>Zarovnání</value>
|
<value>Zarovnání</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Approval" xml:space="preserve">
|
||||||
|
<value>Schválení</value>
|
||||||
|
</data>
|
||||||
<data name="Available_results" xml:space="preserve">
|
<data name="Available_results" xml:space="preserve">
|
||||||
<value>Dostupné výsledky</value>
|
<value>Dostupné výsledky</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Batch_nr" xml:space="preserve">
|
||||||
|
<value>Číslo dávky</value>
|
||||||
|
</data>
|
||||||
|
<data name="Bench" xml:space="preserve">
|
||||||
|
<value>Stanice</value>
|
||||||
|
</data>
|
||||||
<data name="CancelBtnText" xml:space="preserve">
|
<data name="CancelBtnText" xml:space="preserve">
|
||||||
<value>Zrušit</value>
|
<value>Zrušit</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -135,9 +144,21 @@
|
|||||||
<data name="Configuration" xml:space="preserve">
|
<data name="Configuration" xml:space="preserve">
|
||||||
<value>Konfigurace</value>
|
<value>Konfigurace</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Density" xml:space="preserve">
|
||||||
|
<value>Hustota</value>
|
||||||
|
</data>
|
||||||
<data name="DownBtnText" xml:space="preserve">
|
<data name="DownBtnText" xml:space="preserve">
|
||||||
<value>Dolů</value>
|
<value>Dolů</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="End" xml:space="preserve">
|
||||||
|
<value>Konec</value>
|
||||||
|
</data>
|
||||||
|
<data name="Error" xml:space="preserve">
|
||||||
|
<value>Chyba</value>
|
||||||
|
</data>
|
||||||
|
<data name="Flow" xml:space="preserve">
|
||||||
|
<value>Průtok</value>
|
||||||
|
</data>
|
||||||
<data name="Format" xml:space="preserve">
|
<data name="Format" xml:space="preserve">
|
||||||
<value>Formát</value>
|
<value>Formát</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -150,8 +171,8 @@
|
|||||||
<data name="Precision" xml:space="preserve">
|
<data name="Precision" xml:space="preserve">
|
||||||
<value>Přesnost</value>
|
<value>Přesnost</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Remark" xml:space="preserve">
|
<data name="Procedure" xml:space="preserve">
|
||||||
<value>Poznámka</value>
|
<value>Procedura</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Remove" xml:space="preserve">
|
<data name="Remove" xml:space="preserve">
|
||||||
<value>< Odebrat</value>
|
<value>< Odebrat</value>
|
||||||
@@ -162,15 +183,15 @@
|
|||||||
<data name="Result" xml:space="preserve">
|
<data name="Result" xml:space="preserve">
|
||||||
<value>Výsledek</value>
|
<value>Výsledek</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Results" xml:space="preserve">
|
|
||||||
<value>Výsledky</value>
|
|
||||||
</data>
|
|
||||||
<data name="Result_code" xml:space="preserve">
|
|
||||||
<value>Kód výsledku</value>
|
|
||||||
</data>
|
|
||||||
<data name="Selected_results" xml:space="preserve">
|
<data name="Selected_results" xml:space="preserve">
|
||||||
<value>Vybrané výsledky</value>
|
<value>Vybrané výsledky</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="sn" xml:space="preserve">
|
||||||
|
<value>sériové číslo</value>
|
||||||
|
</data>
|
||||||
|
<data name="Start" xml:space="preserve">
|
||||||
|
<value>Začátek</value>
|
||||||
|
</data>
|
||||||
<data name="Test_ID" xml:space="preserve">
|
<data name="Test_ID" xml:space="preserve">
|
||||||
<value>Test</value>
|
<value>Test</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -180,9 +201,21 @@
|
|||||||
<data name="UpBtnText" xml:space="preserve">
|
<data name="UpBtnText" xml:space="preserve">
|
||||||
<value>Nahoru</value>
|
<value>Nahoru</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="User" xml:space="preserve">
|
||||||
|
<value>Uživatel</value>
|
||||||
|
</data>
|
||||||
<data name="Width" xml:space="preserve">
|
<data name="Width" xml:space="preserve">
|
||||||
<value>Šířka</value>
|
<value>Šířka</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Results" xml:space="preserve">
|
||||||
|
<value>Výsledky</value>
|
||||||
|
</data>
|
||||||
|
<data name="Remark" xml:space="preserve">
|
||||||
|
<value>Poznámka</value>
|
||||||
|
</data>
|
||||||
|
<data name="Result_code" xml:space="preserve">
|
||||||
|
<value>Kód výsledku</value>
|
||||||
|
</data>
|
||||||
<data name="Mounting" xml:space="preserve">
|
<data name="Mounting" xml:space="preserve">
|
||||||
<value>Montáž</value>
|
<value>Montáž</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -195,54 +228,27 @@
|
|||||||
<data name="Quantity" xml:space="preserve">
|
<data name="Quantity" xml:space="preserve">
|
||||||
<value>Veličina</value>
|
<value>Veličina</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="sn" xml:space="preserve">
|
|
||||||
<value>sériové číslo</value>
|
|
||||||
</data>
|
|
||||||
<data name="Water_Meter" xml:space="preserve">
|
<data name="Water_Meter" xml:space="preserve">
|
||||||
<value>Vodoměr</value>
|
<value>Vodoměr</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Batch_nr" xml:space="preserve">
|
|
||||||
<value>Číslo dávky</value>
|
|
||||||
</data>
|
|
||||||
<data name="from" xml:space="preserve">
|
<data name="from" xml:space="preserve">
|
||||||
<value>od</value>
|
<value>od</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="to" xml:space="preserve">
|
<data name="to" xml:space="preserve">
|
||||||
<value>do</value>
|
<value>do</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Unit" xml:space="preserve">
|
|
||||||
<value>Jednotka</value>
|
|
||||||
</data>
|
|
||||||
<data name="Approval" xml:space="preserve">
|
|
||||||
<value>Schválení</value>
|
|
||||||
</data>
|
|
||||||
<data name="Bench" xml:space="preserve">
|
|
||||||
<value>Stanice</value>
|
|
||||||
</data>
|
|
||||||
<data name="Density" xml:space="preserve">
|
|
||||||
<value>Hustota</value>
|
|
||||||
</data>
|
|
||||||
<data name="Density_correction" xml:space="preserve">
|
<data name="Density_correction" xml:space="preserve">
|
||||||
<value>Korekce hustoty</value>
|
<value>Korekce hustoty</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="End" xml:space="preserve">
|
<data name="User_description" xml:space="preserve">
|
||||||
<value>Konec</value>
|
<value>Popis uživatele</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Procedure" xml:space="preserve">
|
<data name="Unit" xml:space="preserve">
|
||||||
<value>Procedura</value>
|
<value>Jednotka</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Procedure_description" xml:space="preserve">
|
<data name="Procedure_description" xml:space="preserve">
|
||||||
<value>Popis procedury</value>
|
<value>Popis procedury</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Start" xml:space="preserve">
|
|
||||||
<value>Začátek</value>
|
|
||||||
</data>
|
|
||||||
<data name="User" xml:space="preserve">
|
|
||||||
<value>Uživatel</value>
|
|
||||||
</data>
|
|
||||||
<data name="User_description" xml:space="preserve">
|
|
||||||
<value>Popis uživatele</value>
|
|
||||||
</data>
|
|
||||||
<data name="Bench_ID" xml:space="preserve">
|
<data name="Bench_ID" xml:space="preserve">
|
||||||
<value>ID stanice</value>
|
<value>ID stanice</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -315,9 +321,6 @@
|
|||||||
<data name="Serial_number_is_missing" xml:space="preserve">
|
<data name="Serial_number_is_missing" xml:space="preserve">
|
||||||
<value>Chybí sériové číslo</value>
|
<value>Chybí sériové číslo</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Error" xml:space="preserve">
|
|
||||||
<value>Chyba</value>
|
|
||||||
</data>
|
|
||||||
<data name="Lower_limit" xml:space="preserve">
|
<data name="Lower_limit" xml:space="preserve">
|
||||||
<value>Dolní hranice</value>
|
<value>Dolní hranice</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -330,9 +333,6 @@
|
|||||||
<data name="Relative_error" xml:space="preserve">
|
<data name="Relative_error" xml:space="preserve">
|
||||||
<value>Relativní chyba</value>
|
<value>Relativní chyba</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Flow" xml:space="preserve">
|
|
||||||
<value>Průtok</value>
|
|
||||||
</data>
|
|
||||||
<data name="This_position_is_disabled" xml:space="preserve">
|
<data name="This_position_is_disabled" xml:space="preserve">
|
||||||
<value>Taro pozice je vypnuta</value>
|
<value>Taro pozice je vypnuta</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -351,4 +351,16 @@
|
|||||||
<data name="Merge" xml:space="preserve">
|
<data name="Merge" xml:space="preserve">
|
||||||
<value>Spojit</value>
|
<value>Spojit</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="PulsesUnit" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="VName_Quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="Start_quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="End_quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -210,6 +210,9 @@
|
|||||||
<data name="Procedure" xml:space="preserve">
|
<data name="Procedure" xml:space="preserve">
|
||||||
<value>Prüfvorlage</value>
|
<value>Prüfvorlage</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Producer" xml:space="preserve">
|
||||||
|
<value>Hersteller</value>
|
||||||
|
</data>
|
||||||
<data name="Protocol" xml:space="preserve">
|
<data name="Protocol" xml:space="preserve">
|
||||||
<value>Protokoll</value>
|
<value>Protokoll</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -360,57 +363,6 @@
|
|||||||
<data name="Mounting" xml:space="preserve">
|
<data name="Mounting" xml:space="preserve">
|
||||||
<value>Montage</value>
|
<value>Montage</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Producer" xml:space="preserve">
|
|
||||||
<value>Hersteller</value>
|
|
||||||
</data>
|
|
||||||
<data name="Meter_type" xml:space="preserve">
|
|
||||||
<value>WZ-Typ</value>
|
|
||||||
</data>
|
|
||||||
<data name="Compound" xml:space="preserve">
|
|
||||||
<value>Verbundzähler</value>
|
|
||||||
</data>
|
|
||||||
<data name="Heat_meter" xml:space="preserve">
|
|
||||||
<value>Wärmezähler</value>
|
|
||||||
</data>
|
|
||||||
<data name="Single" xml:space="preserve">
|
|
||||||
<value>Einzel</value>
|
|
||||||
</data>
|
|
||||||
<data name="Category" xml:space="preserve">
|
|
||||||
<value>Kategorie</value>
|
|
||||||
</data>
|
|
||||||
<data name="Quantity" xml:space="preserve">
|
|
||||||
<value>Größe</value>
|
|
||||||
</data>
|
|
||||||
<data name="Page" xml:space="preserve">
|
|
||||||
<value>Seite</value>
|
|
||||||
</data>
|
|
||||||
<data name="Water_Meter" xml:space="preserve">
|
|
||||||
<value>Wasserzähler</value>
|
|
||||||
</data>
|
|
||||||
<data name="aux" xml:space="preserve">
|
|
||||||
<value>Nebenzähler</value>
|
|
||||||
</data>
|
|
||||||
<data name="main" xml:space="preserve">
|
|
||||||
<value>Hauptzähler</value>
|
|
||||||
</data>
|
|
||||||
<data name="fall" xml:space="preserve">
|
|
||||||
<value>fall</value>
|
|
||||||
</data>
|
|
||||||
<data name="from" xml:space="preserve">
|
|
||||||
<value>von</value>
|
|
||||||
</data>
|
|
||||||
<data name="rise" xml:space="preserve">
|
|
||||||
<value>steig</value>
|
|
||||||
</data>
|
|
||||||
<data name="to" xml:space="preserve">
|
|
||||||
<value>bis</value>
|
|
||||||
</data>
|
|
||||||
<data name="VName_Mass" xml:space="preserve">
|
|
||||||
<value>Masse</value>
|
|
||||||
</data>
|
|
||||||
<data name="Density_correction" xml:space="preserve">
|
|
||||||
<value>Dichtekorrektur</value>
|
|
||||||
</data>
|
|
||||||
<data name="Energy" xml:space="preserve">
|
<data name="Energy" xml:space="preserve">
|
||||||
<value>Energie</value>
|
<value>Energie</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -429,6 +381,21 @@
|
|||||||
<data name="P_delta_start" xml:space="preserve">
|
<data name="P_delta_start" xml:space="preserve">
|
||||||
<value>Druckdifferenz Beginn Prüfung</value>
|
<value>Druckdifferenz Beginn Prüfung</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Meter_type" xml:space="preserve">
|
||||||
|
<value>WZ-Typ</value>
|
||||||
|
</data>
|
||||||
|
<data name="Compound" xml:space="preserve">
|
||||||
|
<value>Verbundzähler</value>
|
||||||
|
</data>
|
||||||
|
<data name="Heat_meter" xml:space="preserve">
|
||||||
|
<value>Wärmezähler</value>
|
||||||
|
</data>
|
||||||
|
<data name="Single" xml:space="preserve">
|
||||||
|
<value>Einzel</value>
|
||||||
|
</data>
|
||||||
|
<data name="Page" xml:space="preserve">
|
||||||
|
<value>Seite</value>
|
||||||
|
</data>
|
||||||
<data name="End_volume" xml:space="preserve">
|
<data name="End_volume" xml:space="preserve">
|
||||||
<value>Ende Volumen</value>
|
<value>Ende Volumen</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -459,6 +426,15 @@
|
|||||||
<data name="Start_mass" xml:space="preserve">
|
<data name="Start_mass" xml:space="preserve">
|
||||||
<value>Start Prüfung</value>
|
<value>Start Prüfung</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Category" xml:space="preserve">
|
||||||
|
<value>Kategorie</value>
|
||||||
|
</data>
|
||||||
|
<data name="Quantity" xml:space="preserve">
|
||||||
|
<value>Größe</value>
|
||||||
|
</data>
|
||||||
|
<data name="Water_Meter" xml:space="preserve">
|
||||||
|
<value>Wasserzähler</value>
|
||||||
|
</data>
|
||||||
<data name="VName_Flow" xml:space="preserve">
|
<data name="VName_Flow" xml:space="preserve">
|
||||||
<value>Q</value>
|
<value>Q</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -474,6 +450,9 @@
|
|||||||
<data name="VName_Humi" xml:space="preserve">
|
<data name="VName_Humi" xml:space="preserve">
|
||||||
<value>Hu</value>
|
<value>Hu</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="VName_Mass" xml:space="preserve">
|
||||||
|
<value>Masse</value>
|
||||||
|
</data>
|
||||||
<data name="VName_TstTime" xml:space="preserve">
|
<data name="VName_TstTime" xml:space="preserve">
|
||||||
<value>Tau</value>
|
<value>Tau</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -582,6 +561,12 @@
|
|||||||
<data name="Tooltip_T_up_st" xml:space="preserve">
|
<data name="Tooltip_T_up_st" xml:space="preserve">
|
||||||
<value>Temperatur Prüstreckeneingang am Prüfungsbeginn (4 Messungen nach Beginn)</value>
|
<value>Temperatur Prüstreckeneingang am Prüfungsbeginn (4 Messungen nach Beginn)</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="aux" xml:space="preserve">
|
||||||
|
<value>Nebenzähler</value>
|
||||||
|
</data>
|
||||||
|
<data name="main" xml:space="preserve">
|
||||||
|
<value>Hauptzähler</value>
|
||||||
|
</data>
|
||||||
<data name="Tooltip_E_rel" xml:space="preserve">
|
<data name="Tooltip_E_rel" xml:space="preserve">
|
||||||
<value>Relative Messabweichung eines WZ</value>
|
<value>Relative Messabweichung eines WZ</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -606,6 +591,18 @@
|
|||||||
<data name="VName_Error" xml:space="preserve">
|
<data name="VName_Error" xml:space="preserve">
|
||||||
<value>E</value>
|
<value>E</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="fall" xml:space="preserve">
|
||||||
|
<value>fall</value>
|
||||||
|
</data>
|
||||||
|
<data name="from" xml:space="preserve">
|
||||||
|
<value>von</value>
|
||||||
|
</data>
|
||||||
|
<data name="rise" xml:space="preserve">
|
||||||
|
<value>steig</value>
|
||||||
|
</data>
|
||||||
|
<data name="to" xml:space="preserve">
|
||||||
|
<value>bis</value>
|
||||||
|
</data>
|
||||||
<data name="Tooltip_Hu_Amb_M" xml:space="preserve">
|
<data name="Tooltip_Hu_Amb_M" xml:space="preserve">
|
||||||
<value>Umgebungs-Luftfeuchtigkeit während der Prüfung</value>
|
<value>Umgebungs-Luftfeuchtigkeit während der Prüfung</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -627,6 +624,9 @@
|
|||||||
<data name="Yes" xml:space="preserve">
|
<data name="Yes" xml:space="preserve">
|
||||||
<value>Ja</value>
|
<value>Ja</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Density_correction" xml:space="preserve">
|
||||||
|
<value>Dichtekorrektur</value>
|
||||||
|
</data>
|
||||||
<data name="Error_flags" xml:space="preserve">
|
<data name="Error_flags" xml:space="preserve">
|
||||||
<value>Fehlerflags</value>
|
<value>Fehlerflags</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -825,4 +825,16 @@
|
|||||||
<data name="Selected_items" xml:space="preserve">
|
<data name="Selected_items" xml:space="preserve">
|
||||||
<value>Ausgewählte Objekte</value>
|
<value>Ausgewählte Objekte</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="PulsesUnit" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="VName_Quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="Start_quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="End_quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -804,4 +804,16 @@
|
|||||||
<data name="Serial_number_is_missing" xml:space="preserve">
|
<data name="Serial_number_is_missing" xml:space="preserve">
|
||||||
<value>Numérotation en série</value>
|
<value>Numérotation en série</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="PulsesUnit" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="VName_Quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="Start_quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="End_quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -537,4 +537,16 @@
|
|||||||
<data name="Yes" xml:space="preserve">
|
<data name="Yes" xml:space="preserve">
|
||||||
<value>Sì</value>
|
<value>Sì</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="PulsesUnit" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="VName_Quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="Start_quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="End_quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -441,4 +441,16 @@
|
|||||||
<data name="Unit" xml:space="preserve">
|
<data name="Unit" xml:space="preserve">
|
||||||
<value>Jednostka</value>
|
<value>Jednostka</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="PulsesUnit" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="VName_Quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="Start_quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="End_quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -852,4 +852,16 @@
|
|||||||
<data name="Merge" xml:space="preserve">
|
<data name="Merge" xml:space="preserve">
|
||||||
<value>Merge</value>
|
<value>Merge</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="PulsesUnit" xml:space="preserve">
|
||||||
|
<value>Pulses/Unit</value>
|
||||||
|
</data>
|
||||||
|
<data name="VName_Quantity" xml:space="preserve">
|
||||||
|
<value>Quant.</value>
|
||||||
|
</data>
|
||||||
|
<data name="Start_quantity" xml:space="preserve">
|
||||||
|
<value>Start quantity</value>
|
||||||
|
</data>
|
||||||
|
<data name="End_quantity" xml:space="preserve">
|
||||||
|
<value>End quantity</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -420,22 +420,34 @@
|
|||||||
<data name="Volume_main" xml:space="preserve">
|
<data name="Volume_main" xml:space="preserve">
|
||||||
<value>Объем главн.</value>
|
<value>Объем главн.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Water_Meter" xml:space="preserve">
|
||||||
|
<value>Счетчик воды</value>
|
||||||
|
</data>
|
||||||
|
<data name="VName_Vol" xml:space="preserve">
|
||||||
|
<value>Объем</value>
|
||||||
|
</data>
|
||||||
<data name="aux" xml:space="preserve">
|
<data name="aux" xml:space="preserve">
|
||||||
<value>доп.</value>
|
<value>доп.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="main" xml:space="preserve">
|
<data name="main" xml:space="preserve">
|
||||||
<value>главн.</value>
|
<value>главн.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="VName_Vol" xml:space="preserve">
|
|
||||||
<value>Объем</value>
|
|
||||||
</data>
|
|
||||||
<data name="No" xml:space="preserve">
|
<data name="No" xml:space="preserve">
|
||||||
<value>Нет</value>
|
<value>Нет</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Yes" xml:space="preserve">
|
<data name="Yes" xml:space="preserve">
|
||||||
<value>Да</value>
|
<value>Да</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Water_Meter" xml:space="preserve">
|
<data name="PulsesUnit" xml:space="preserve">
|
||||||
<value>Счетчик воды</value>
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="VName_Quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="Start_quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="End_quantity" xml:space="preserve">
|
||||||
|
<value />
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
@@ -19,7 +19,7 @@
|
|||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
<DefineConstants>TRACE;DEBUG;IPERL;</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE;IPERL;</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
@@ -241,7 +241,9 @@
|
|||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Resources\Strings.fr.resx" />
|
<EmbeddedResource Include="Resources\Strings.fr.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.it.resx" />
|
<EmbeddedResource Include="Resources\Strings.it.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.pl.resx" />
|
<EmbeddedResource Include="Resources\Strings.pl.resx">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Resources\Strings.resx">
|
<EmbeddedResource Include="Resources\Strings.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
|
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
|
||||||
@@ -254,6 +256,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Entities\PurchaseEntities\createPurchaseTables.sql" />
|
<Content Include="Entities\PurchaseEntities\createPurchaseTables.sql" />
|
||||||
<Content Include="Entities\PurchaseEntities\ImportPurchaseOrderTestData.sql" />
|
<Content Include="Entities\PurchaseEntities\ImportPurchaseOrderTestData.sql" />
|
||||||
|
<None Include="Resources\TBF_icon.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
|||||||
@@ -131,6 +131,12 @@ namespace Results
|
|||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.String, "String", "", Quantity.String, ItemCategory.Other, (w,t,u,f,p) => f));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.String, "String", "", Quantity.String, ItemCategory.Other, (w,t,u,f,p) => f));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Separator, "Separator", "", Quantity.String, ItemCategory.Other, (w,t,u,f,p) => string.Empty));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Separator, "Separator", "", Quantity.String, ItemCategory.Other, (w,t,u,f,p) => string.Empty));
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Register reader
|
||||||
|
///
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.RR_Quantity, "RR Quantity", "", Quantity.RegisterReader, ItemCategory.Other, (w,t,u,f,p) => (w.GetMeterTestRslt(t) != null) ? FormatStr(f, w.GetMeterTestRslt(t).GetQuantityFromUnits()) : string.Empty));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.RR_Units, "RR Units", "", Quantity.RegisterReader, ItemCategory.Other, (w,t,u,f,p) => (w.GetMeterTestRslt(t) != null) ? FormatStr(f, w.GetMeterTestRslt(t).QuantityUnits) : string.Empty));
|
||||||
|
|
||||||
/// Common
|
/// Common
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_name, Strings.Test + "()", Quantity.String, ItemCategory.TestData, (w,t,u,f,p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Name())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_name, Strings.Test + "()", Quantity.String, ItemCategory.TestData, (w,t,u,f,p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Name())));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Procedure_name, Strings.Procedure, Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, w.ProcedureName())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Procedure_name, Strings.Procedure, Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, w.ProcedureName())));
|
||||||
@@ -155,21 +161,22 @@ namespace Results
|
|||||||
///
|
///
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).TargetVolume())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).TargetVolume())));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.VolumeCTV, string.Format("{0} CTV ()", Strings.VName_Vol), Quantity.Volume, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).VolumeCTV)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.VolumeCTV, string.Format("{0} CTV ()", Strings.VName_Vol), Quantity.Volume, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).VolumeCTV)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, string.Format("{0} Mt. ()", Strings.VName_Vol), Strings.Tooltip_Vol_Mt, Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeMeter) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u,f,p, "V4", w.GetMeterTestRslt(t).VolumeMeter) : string.Empty)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Quantity, string.Format("{0} Mt. ()", Strings.VName_Quantity), Strings.Tooltip_Vol_Mt, Quantity.MultiFunctionalVariables, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", (w.GetMeterTestRslt(t).GetQuantityFromUnits() == "Mass" ? w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).MassMeter : w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeMeter)) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", (w.GetMeterTestRslt(t).GetQuantityFromUnits() == "Mass" ? w.GetMeterTestRslt(t).MassMeter : w.GetMeterTestRslt(t).VolumeMeter)) : string.Empty)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_volume, string.Format("{0} rm ()", Strings.VName_Vol), Strings.Tooltip_Vol_rm, Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeRef) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u,f,p, "V4", w.GetMeterTestRslt(t).VolumeRef) : string.Empty)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_quantity,string.Format("{0} rm ()", Strings.VName_Quantity), Strings.Tooltip_Vol_rm, Quantity.MultiFunctionalVariables, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", (w.GetMeterTestRslt(t).GetQuantityFromUnits() == "Mass" ? w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).MassRef : w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeRef)) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", (w.GetMeterTestRslt(t).GetQuantityFromUnits() == "Mass" ? w.GetMeterTestRslt(t).MassRef : w.GetMeterTestRslt(t).VolumeRef)) : string.Empty)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.main), Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeMeter) : string.Empty));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.main), Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeMeter) : string.Empty));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.aux), Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeMeter) : string.Empty));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.aux), Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeMeter) : string.Empty));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeStart) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u,f,p, "V4", w.GetMeterTestRslt(t).VolumeStart) : string.Empty)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_quantity, Strings.Start_quantity + "()", Quantity.MultiFunctionalVariables, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeStart) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart) : string.Empty)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_main, Strings.Start_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeStart) : string.Empty));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_main, Strings.Start_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeStart) : string.Empty));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeStart) : string.Empty));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeStart) : string.Empty));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeEnd) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u,f,p, "V4", w.GetMeterTestRslt(t).VolumeEnd) : string.Empty)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_quantity, Strings.End_quantity + "()", Quantity.MultiFunctionalVariables, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeEnd) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeEnd) : string.Empty)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeEnd) : string.Empty));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeEnd) : string.Empty));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeEnd) : string.Empty));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeEnd) : string.Empty));
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Mass
|
/// Mass
|
||||||
///
|
///
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_start_raw, string.Format("{0} ST raw ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).MassStartRaw)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.MassCTV, string.Format("{0} CTV ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).MassCTV)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_start_raw, string.Format("{0} ST raw ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).MassStartRaw)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_start, string.Format("{0} ST ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).MassStart)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_start, string.Format("{0} ST ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).MassStart)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_end_raw, string.Format("{0} EN raw ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).MassEndRaw)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_end_raw, string.Format("{0} EN raw ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).MassEndRaw)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_end, string.Format("{0} EN ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).MassEnd)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_end, string.Format("{0} EN ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).MassEnd)));
|
||||||
@@ -374,10 +381,11 @@ namespace Results
|
|||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Camera_angle_start, "Start angle ()", "Start angle measured by a camera",Quantity.Pulses, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? string.Empty : FormatDbl(u,f,p, "F0", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).VolumeStart * w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Camera_angle_start, "Start angle ()", "Start angle measured by a camera",Quantity.Pulses, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? string.Empty : FormatDbl(u,f,p, "F0", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).VolumeStart * w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Camera_angle_end, "End angle ()", "End angle measured by a camera", Quantity.Pulses, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? string.Empty : FormatDbl(u,f,p, "F0", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).VolumeEnd * w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Camera_angle_end, "End angle ()", "End angle measured by a camera", Quantity.Pulses, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? string.Empty : FormatDbl(u,f,p, "F0", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).VolumeEnd * w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
|
||||||
|
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses_per_liter, Strings.PulsesLiter, Quantity.PulsePerLtr, ItemCategory.MeterData, (w,t,u,f,p) => FormatDbl(u, f, p, "V4", w.WaterMeterData.PulsesPerLtr)));
|
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pls_per_ltr_aux, Strings.PulsesLiter + " aux", Quantity.PulsePerLtr, ItemCategory.MeterData, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", w.WaterMeterData.PulsesPerLtrAux)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses_per_unit, Strings.PulsesUnit, Quantity.PulsePerUnit, ItemCategory.MeterData, (w,t,u,f,p) => FormatDbl(u, f, p, "V4", w.WaterMeterData.PulsesPerLtr)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulse__liter, Strings.PulsesLiter + "()", Quantity.PulsePerLtr, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? string.Empty : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).IsCamera() ? 0 : w.GetMeterTestRslt(t).PulsesPerLiter)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pls_per_ltr_aux, Strings.PulsesUnit + " aux", Quantity.PulsePerUnit, ItemCategory.MeterData, (w,t,u,f,p) => FormatDbl(u, f, p, "V4", w.WaterMeterData.PulsesPerLtrAux)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Degree__liter, "Degree per liter ()", Quantity.PulsePerLtr, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? string.Empty : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulse__liter, Strings.PulsesUnit + "()", Quantity.PulsePerUnit, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? string.Empty : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).IsCamera() ? 0 : w.GetMeterTestRslt(t).PulsesPerLiter)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Degree__liter, "Degree per unit ()", Quantity.PulsePerUnit, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? string.Empty : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
|
||||||
|
|
||||||
/// Water meters results (combined)
|
/// Water meters results (combined)
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses_main, Strings.Pulses + " " + Strings.main + "()", Quantity.Pulses, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? string.Empty : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).IsPulses() ? w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).PulsesMeter : 0)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses_main, Strings.Pulses + " " + Strings.main + "()", Quantity.Pulses, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? string.Empty : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).IsPulses() ? w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).PulsesMeter : 0)));
|
||||||
@@ -405,9 +413,10 @@ namespace Results
|
|||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeters, Strings.WMs, Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, w.Batch.WatermetersStr)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeters, Strings.WMs, Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, w.Batch.WatermetersStr)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_start_time, Strings.Start, Quantity.DateTime, ItemCategory.Other, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? w.Batch.StartTime.ToString() : string.Format(f, w.Batch.StartTime)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_start_time, Strings.Start, Quantity.DateTime, ItemCategory.Other, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? w.Batch.StartTime.ToString() : string.Format(f, w.Batch.StartTime)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_end_time, Strings.End, Quantity.DateTime, ItemCategory.Other, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? w.Batch.EndTime.ToString() : string.Format(f, w.Batch.EndTime)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_end_time, Strings.End, Quantity.DateTime, ItemCategory.Other, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? w.Batch.EndTime.ToString() : string.Format(f, w.Batch.EndTime)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Lite_per_pulse_Read, "1 / PlsPerLtr_Read", Quantity.PulsePerLtr, ItemCategory.Other, (w,t,u,f,p) => FormatDbl(u, f, p, "V4", (w.WaterMeterData.PulsesPerLtr != 0) ? 1/w.WaterMeterData.PulsesPerLtr : 0)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Unit_per_pulse_Read, "1 / PlsPerUnit_Read", Quantity.PulsePerUnit,ItemCategory.Other, (w,t,u,f,p) => FormatDbl(u, f, p, "V4", (w.WaterMeterData.PulsesPerLtr != 0) ? 1 / w.WaterMeterData.PulsesPerLtr : 0)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_meters_count, Strings.Passed_meters_count, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.PassedMetersCount())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_meters_count, Strings.Passed_meters_count, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.PassedMetersCount())));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Failed_meters_count, Strings.Failed_meters_count, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.FailedMetersCount())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Failed_meters_count, Strings.Failed_meters_count, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.FailedMetersCount())));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Failed_meters_countE15, Strings.Failed_meters_count + "E15", Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.FailedMetersCountE15())));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_seals_count, "Seals count of passed meters", Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.PassedMetersCount() * int.Parse(w.WaterMeterData.Text5))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_seals_count, "Seals count of passed meters", Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.PassedMetersCount() * int.Parse(w.WaterMeterData.Text5))));
|
||||||
|
|
||||||
/// Extra water meter data
|
/// Extra water meter data
|
||||||
|
|||||||
@@ -378,6 +378,40 @@ namespace SchematicDrawing
|
|||||||
Properties.Resources.Valve_XL_closed,
|
Properties.Resources.Valve_XL_closed,
|
||||||
Properties.Resources.Valve_XL_vacuum,
|
Properties.Resources.Valve_XL_vacuum,
|
||||||
Properties.Resources.Valve_XL_open_dry);
|
Properties.Resources.Valve_XL_open_dry);
|
||||||
|
/// ValveSw
|
||||||
|
Shapes[DrShIx(Shape.ValveSw, Sz.S)] = new DrawingShape(Shape.ValveSw, Sz.S, 2, 2,
|
||||||
|
new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) },
|
||||||
|
new Edge[] { new Edge(0, 1, 20, RouteCouple.OpenWhen1), new Edge(1, 0, 20, RouteCouple.OpenWhen1) },
|
||||||
|
0, 0, 20, 20,
|
||||||
|
Properties.Resources.ValveSw_S_open,
|
||||||
|
Properties.Resources.ValveSw_S_closed,
|
||||||
|
Properties.Resources.ValveSw_S_vacuum,
|
||||||
|
Properties.Resources.ValveSw_S_open_dry);
|
||||||
|
Shapes[DrShIx(Shape.ValveSw, Sz.M)] = new DrawingShape(Shape.ValveSw, Sz.M, 3, 4,
|
||||||
|
new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) },
|
||||||
|
new Edge[] { new Edge(0, 1, 30, RouteCouple.OpenWhen1), new Edge(1, 0, 30, RouteCouple.OpenWhen1) },
|
||||||
|
0, 5, 30, 30,
|
||||||
|
Properties.Resources.ValveSw_M_open,
|
||||||
|
Properties.Resources.ValveSw_M_closed,
|
||||||
|
Properties.Resources.ValveSw_M_vacuum,
|
||||||
|
Properties.Resources.ValveSw_M_open_dry);
|
||||||
|
Shapes[DrShIx(Shape.ValveSw, Sz.L)] = new DrawingShape(Shape.ValveSw, Sz.L, 4, 4,
|
||||||
|
new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) },
|
||||||
|
new Edge[] { new Edge(0, 1, 40, RouteCouple.OpenWhen1), new Edge(1, 0, 40, RouteCouple.OpenWhen1) },
|
||||||
|
0, 0, 40, 40,
|
||||||
|
Properties.Resources.ValveSw_L_open,
|
||||||
|
Properties.Resources.ValveSw_L_closed,
|
||||||
|
Properties.Resources.ValveSw_L_vacuum,
|
||||||
|
Properties.Resources.ValveSw_L_open_dry);
|
||||||
|
Shapes[DrShIx(Shape.ValveSw, Sz.XL)] = new DrawingShape(Shape.ValveSw, Sz.XL, 5, 6,
|
||||||
|
new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) },
|
||||||
|
new Edge[] { new Edge(0, 1, 50, RouteCouple.OpenWhen1), new Edge(1, 0, 50, RouteCouple.OpenWhen1) },
|
||||||
|
0, 5, 50, 50,
|
||||||
|
Properties.Resources.ValveSw_XL_open,
|
||||||
|
Properties.Resources.ValveSw_XL_closed,
|
||||||
|
Properties.Resources.ValveSw_XL_vacuum,
|
||||||
|
Properties.Resources.ValveSw_XL_open_dry);
|
||||||
|
|
||||||
/// Diverter
|
/// Diverter
|
||||||
Shapes[DrShIx(Shape.Div, Sz.S)] = new DrawingShape(Shape.Div, Sz.S, 2, 2,
|
Shapes[DrShIx(Shape.Div, Sz.S)] = new DrawingShape(Shape.Div, Sz.S, 2, 2,
|
||||||
new Node[] { new Node(2, 0, Orient.Up), new Node(1, 2, Orient.Dn), new Node(3, 2, Orient.Dn) },
|
new Node[] { new Node(2, 0, Orient.Up), new Node(1, 2, Orient.Dn), new Node(3, 2, Orient.Dn) },
|
||||||
@@ -523,12 +557,18 @@ namespace SchematicDrawing
|
|||||||
Shapes[DrShIx(Shape.Scale, Sz.L)] = new DrawingShape(Shape.Scale, Sz.L, 12, 11, new Node[] { new Node(6, 11, Orient.Dn) }, null, 0, 0, 120, 110, Properties.Resources.Scale_L);
|
Shapes[DrShIx(Shape.Scale, Sz.L)] = new DrawingShape(Shape.Scale, Sz.L, 12, 11, new Node[] { new Node(6, 11, Orient.Dn) }, null, 0, 0, 120, 110, Properties.Resources.Scale_L);
|
||||||
Shapes[DrShIx(Shape.Scale, Sz.XL)] = new DrawingShape(Shape.Scale, Sz.XL, 16, 13, new Node[] { new Node(8, 13, Orient.Dn) }, null, 0, 0, 160, 130, Properties.Resources.Scale_XL);
|
Shapes[DrShIx(Shape.Scale, Sz.XL)] = new DrawingShape(Shape.Scale, Sz.XL, 16, 13, new Node[] { new Node(8, 13, Orient.Dn) }, null, 0, 0, 160, 130, Properties.Resources.Scale_XL);
|
||||||
|
|
||||||
/// Tank
|
/// Tank uni
|
||||||
Shapes[DrShIx(Shape.Tank, Sz.S)] = new DrawingShape(Shape.Tank, Sz.S, 10, 8, new Node[] { new Node(0, 6, Orient.L) }, null, 0, 0, 100, 80, Properties.Resources.Tank_S);
|
Shapes[DrShIx(Shape.Tank, Sz.S)] = new DrawingShape(Shape.Tank, Sz.S, 10, 8, new Node[] { new Node(0, 6, Orient.L) }, null, 0, 0, 100, 80, Properties.Resources.Tank_S);
|
||||||
Shapes[DrShIx(Shape.Tank, Sz.M)] = new DrawingShape(Shape.Tank, Sz.M, 12, 9, new Node[] { new Node(0, 7, Orient.L) }, null, 0, 0, 120, 90, Properties.Resources.Tank_M);
|
Shapes[DrShIx(Shape.Tank, Sz.M)] = new DrawingShape(Shape.Tank, Sz.M, 12, 9, new Node[] { new Node(0, 7, Orient.L) }, null, 0, 0, 120, 90, Properties.Resources.Tank_M);
|
||||||
Shapes[DrShIx(Shape.Tank, Sz.L)] = new DrawingShape(Shape.Tank, Sz.L, 15, 11, new Node[] { new Node(0, 9, Orient.L) }, null, 0, 0, 150, 110, Properties.Resources.Tank_L);
|
Shapes[DrShIx(Shape.Tank, Sz.L)] = new DrawingShape(Shape.Tank, Sz.L, 15, 11, new Node[] { new Node(0, 9, Orient.L) }, null, 0, 0, 150, 110, Properties.Resources.Tank_L);
|
||||||
Shapes[DrShIx(Shape.Tank, Sz.XL)] = new DrawingShape(Shape.Tank, Sz.XL, 20, 13, new Node[] { new Node(0, 11, Orient.L) }, null, 0, 0, 200, 130, Properties.Resources.Tank_XL);
|
Shapes[DrShIx(Shape.Tank, Sz.XL)] = new DrawingShape(Shape.Tank, Sz.XL, 20, 13, new Node[] { new Node(0, 11, Orient.L) }, null, 0, 0, 200, 130, Properties.Resources.Tank_XL);
|
||||||
|
|
||||||
|
/// Tank hot
|
||||||
|
Shapes[DrShIx(Shape.TankHot, Sz.S)] = new DrawingShape(Shape.TankHot, Sz.S, 10, 8, new Node[] { new Node(0, 6, Orient.L) }, null, 0, 0, 100, 80, Properties.Resources.Tank_S_hot);
|
||||||
|
Shapes[DrShIx(Shape.TankHot, Sz.M)] = new DrawingShape(Shape.TankHot, Sz.M, 12, 9, new Node[] { new Node(0, 7, Orient.L) }, null, 0, 0, 120, 90, Properties.Resources.Tank_M_hot);
|
||||||
|
Shapes[DrShIx(Shape.TankHot, Sz.L)] = new DrawingShape(Shape.TankHot, Sz.L, 15, 11, new Node[] { new Node(0, 9, Orient.L) }, null, 0, 0, 150, 110, Properties.Resources.Tank_L_hot);
|
||||||
|
Shapes[DrShIx(Shape.TankHot, Sz.XL)] = new DrawingShape(Shape.TankHot, Sz.XL, 20, 13, new Node[] { new Node(0, 11, Orient.L) }, null, 0, 0, 200, 130, Properties.Resources.Tank_XL_hot);
|
||||||
|
|
||||||
/// Junction
|
/// Junction
|
||||||
Shapes[DrShIx(Shape.Junction, Sz.None)] = new DrawingShape(Shape.Junction, Sz.None, 0, 0, new Node[] { new Node(0, 0, Orient.R) });
|
Shapes[DrShIx(Shape.Junction, Sz.None)] = new DrawingShape(Shape.Junction, Sz.None, 0, 0, new Node[] { new Node(0, 0, Orient.R) });
|
||||||
Shapes[DrShIx(Shape.Junction, Sz.S)] = new DrawingShape(Shape.Junction, Sz.S, 2, 2,
|
Shapes[DrShIx(Shape.Junction, Sz.S)] = new DrawingShape(Shape.Junction, Sz.S, 2, 2,
|
||||||
|
|||||||
@@ -45,11 +45,13 @@ namespace SchematicDrawing
|
|||||||
Scale,
|
Scale,
|
||||||
Sink,
|
Sink,
|
||||||
Tank,
|
Tank,
|
||||||
|
TankHot,
|
||||||
Tee,
|
Tee,
|
||||||
TempM,
|
TempM,
|
||||||
UniCB,
|
UniCB,
|
||||||
Vacuum,
|
Vacuum,
|
||||||
Valve,
|
Valve,
|
||||||
|
ValveSw,
|
||||||
WaterM,
|
WaterM,
|
||||||
ElectricM,
|
ElectricM,
|
||||||
|
|
||||||
|
|||||||
@@ -13,5 +13,6 @@ namespace SchematicDrawing
|
|||||||
Common.Unit MsrdUnit { get; }
|
Common.Unit MsrdUnit { get; }
|
||||||
double MsrdValLimLo { get; }
|
double MsrdValLimLo { get; }
|
||||||
double MsrdValLimHi { get; }
|
double MsrdValLimHi { get; }
|
||||||
|
bool IsOffline { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 842 B |
Binary file not shown.
|
After Width: | Height: | Size: 768 B |
Binary file not shown.
|
After Width: | Height: | Size: 746 B |
Binary file not shown.
|
After Width: | Height: | Size: 894 B |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user