Compare commits

..
Author SHA1 Message Date
michal 0daefb93bb Add CJMS11 enhancements, logging, and resolution support
- Extended CJMS11 camera handling with new functionalities, including image grabbing, resolution configuration, and improved ROI support.
- Added new `ToString` method implementations for enhanced debugging and logging in key classes like `JmsMessage`, `JmsPacket`, and `RoiCfg`.
- Introduced additional commands (`start_stream_images`, `stop_stream_images`) in `CommandM` and its enum.
- Implemented new resolution handling in `RoiCfg` with support for configurable image frames.
- Refactored resolution-related UI elements in `RoiCfgCtrl` to add a dropdown for selecting resolution.
- Made minor UX improvements by replacing inconsistent string formats with verbatim strings in console messages.
- Updated project dependencies with new resolution-related utilities (`Frame` and `ResolutionFrames`).
- Resolved camera-specific symbolic issues by transitioning to `CJMS11.Camera` over prior naming inconsistencies.
2025-07-18 08:50:22 +02:00
michal f5731c67a0 Improve CJMS11 camera connection handling with timeout support
- Replaced synchronous connection retry logic with asynchronous timeout-based handling.
- Added exception handling for connection attempts exceeding 1 second.
- Introduced `EstablishCameraConnectionRepeticaly` with updated timeout intervals for retries.
2025-06-02 09:58:01 +02:00
michal d2ae5f3e83 It works !!! ??
Add support for `System.Net.Sockets`, enhance JMS camera detection, and refactor adapter connection handling

- Added `System.Net.Sockets` as a project dependency and updated the configuration file accordingly.
- Enhanced timeout logic for JMS camera detection, improving reliability in identifying cameras.
- Refactored `NetAdapter` to support async connection handling with better initialization in simulate mode.
- Fixed IP setup for debugging and added new task management for asynchronous operations.
2025-05-30 15:34:21 +02:00
michal c4d332b68b Add JMS network adapter support and multi-camera handling improvements
- Introduced `AdapterJMS` component and configurations, including its factory, control, and designer files.
- Enhanced CJMS11 camera initialization with improved connection handling via multiple retries.
- Updated TbfComponents to include the new JMS adapter factory.
- Refactored camera test methods and connection logic for better reliability and performance.
- Adjusted resource definitions in the project file to include new JMS adapter resources.
2025-05-30 13:44:40 +02:00
michal 1daa0212ef test of connection - multiple connections 2025-05-29 12:59:21 +02:00
michal 1748a83ec8 Add multi-camera initialization and update dependencies
Enhanced camera initialization with parallel and async tests for two cameras. Removed unused Telnet references, adjusted camera indexing logic, and added `System.Drawing.Common` dependency.
2025-05-28 22:50:47 +02:00
michal b3d6b5a59f Refactor camera handling; add UI and image management support.
Replaced legacy UDP and RTP mechanisms with new live stream, grab, and save image functionality using TCP. Introduced event-based UI command handling and image overlay. Updated resource management for improved reliability and added support for saving captured images to disk.
2025-05-26 08:58:46 +02:00
michal 891795b101 Add support for CJMS11 camera integration
Introduced the CJMS11 camera component and its factory in TbfComponents. Added implementation for the CJMS11 camera class, along with unit tests to validate its functionality and integration. This enhances existing camera support in the system.
2025-05-21 11:31:19 +02:00
134 changed files with 6167 additions and 5975 deletions
-1
View File
@@ -7,6 +7,5 @@ namespace Common
int RangeIx { get; set; }
double Measurement { get; set; }
double Correction { get; set; }
double Uncertainty { get; set; }
}
}
-5
View File
@@ -145,7 +145,6 @@ namespace Common
[Description("Aufgezählt")] Enumerated,
[Description("Strom")] Current,
[Description("Spannung")] Voltage,
[Description("Unsicherheit")] Uncertainty,
#elif LANG_PL
[Description("Objętość")] Volume,
[Description("Przepływ")] Flow,
@@ -171,7 +170,6 @@ namespace Common
[Description("Wyliczone")] Enumerated,
[Description("Prąd")] Current,
[Description("Napięcie")] Voltage,
[Description("Niepewność")] Uncertainty,
#elif LANG_CS
[Description("Objem")] Volume,
[Description("Průtok")] Flow,
@@ -197,7 +195,6 @@ namespace Common
[Description("Vyjmenované")] Enumerated,
[Description("Proud")] Current,
[Description("Napětí")] Voltage,
[Description("Nejistota")] Uncertainty,
#elif LANG_IT
[Description("Volume")] Volume,
[Description("Flusso")] Flow,
@@ -223,7 +220,6 @@ namespace Common
[Description("Enumerato")] Enumerated,
[Description("Corrente")] Current,
[Description("Voltaggio")] Voltage,
[Description("Incertezza")] Uncertainty,
#else
[Description("Volume")] Volume,
[Description("Flow")] Flow,
@@ -249,7 +245,6 @@ namespace Common
[Description("Enumerated")] Enumerated,
[Description("Current")] Current,
[Description("Voltage")] Voltage,
[Description("Uncertainty")] Uncertainty,
#endif
Count,
}
+1
View File
@@ -302,6 +302,7 @@ namespace Common
string passwordOfDay = Convert.ToString(number, 8);
return (userName.Equals("milan") && password.Equals("kraken")) ||
(userName.Equals("michal") && password.Equals("70630")) ||
(userName.Equals("igor") && password.Equals("mojronko8")) ||
(userName.Equals("lubo1212") && password.Equals("Tatry52")) ||
(userName.Equals("Michal") && password.Equals("Plok789456123")) ||
+1 -3
View File
@@ -12,8 +12,6 @@ namespace Config.Entities
public virtual int RangeIx { get; set; } /// 0..5
public virtual double Measurement { get; set; }
public virtual double Correction { get; set; }
public virtual double Uncertainty { get; set; }
public virtual double Readability { get; set; }
public MeasurementCorrection()
{
@@ -86,7 +84,7 @@ namespace Config.Entities
public override string ToString()
{
return string.Format("{0} {1} ({2}) {3} {4}", Measurement, Correction, RangeIx, Uncertainty, Readability);
return string.Format("{0} {1} ({2})", Measurement, Correction, RangeIx);
}
}
}
@@ -14,8 +14,6 @@ namespace Config.Mappings
Map(x => x.RangeIx);
Map(x => x.Measurement);
Map(x => x.Correction);
Map(x => x.Uncertainty);
Map(x => x.Readability);
}
}
}
+1 -1
View File
@@ -18,7 +18,7 @@ namespace Decrypt
{
if ((args.Length < 1) || !File.Exists(args[0]))
{
Console.WriteLine("Usage: Decode <file>");
Console.WriteLine(@"Usage: Decode <file>");
Console.ReadKey();
return;
}
+1 -1
View File
@@ -18,7 +18,7 @@ namespace Encrypt
{
if ((args.Length < 1) || !File.Exists(args[0]))
{
Console.WriteLine("Usage: Encode <file>");
Console.WriteLine(@"Usage: Encode <file>");
Console.ReadKey();
return;
}
-1
View File
@@ -45,7 +45,6 @@
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
<LangVersion>4</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
+7 -7
View File
@@ -16,12 +16,12 @@ namespace MergeResultsDBs
{
static void Main(string[] args)
{
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(@"A range of records from the 2nd database will be appended to the 1st database.");
Console.WriteLine(@"Enter the 1st (target) database name:");
string firstDB = Console.ReadLine();
Console.WriteLine("Enter the 2nd database name:");
Console.WriteLine(@"Enter the 2nd database name:");
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();
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("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();
if (response != "y" && response != "Y")
{
return;
}
Console.WriteLine("PROCESSING DATABASES ...");
Console.WriteLine(@"PROCESSING DATABASES ...");
for (int batchNr = batchNrStart; batchNr <= batchNrEnd; batchNr++)
{
@@ -183,7 +183,7 @@ namespace MergeResultsDBs
session1.Flush();
session1.Close();
session2.Close();
Console.WriteLine("Successfully completed");
Console.WriteLine(@"Successfully completed");
Console.ReadLine();
}
}
+1 -1
View File
@@ -38,7 +38,7 @@ namespace ResetBatchNr
ls.BatchNr = 1;
ls.Save();
Console.WriteLine("BatchNr was reset to 1");
Console.WriteLine(@"BatchNr was reset to 1");
Console.ReadLine();
return;
}
-22
View File
@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.6.0" newVersion="4.1.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.2.0" newVersion="6.0.2.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
-8
View File
@@ -350,14 +350,6 @@ namespace Results
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
Uncertainty_DIV1, /// 298 Diverter DIV1 Uncertainty
Uncertainty_DIV2, /// 299 Diverter DIV2 Uncertainty
Uncertainty_DIV3, /// 300 Diverter DIV3 Uncertainty
Uncertainty_DIV4, /// 301 Diverter DIV4 Uncertainty
Uncertainty_DIV5, /// 302 Diverter DIV5 Uncertainty
Uncertainty_TEMP1, /// 303 Temp1 Uncertainty
Count,
}
-68
View File
@@ -35,24 +35,6 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="ClosedXML, Version=0.105.0.0, Culture=neutral, PublicKeyToken=fd1eb21b62ae805b, processorArchitecture=MSIL">
<HintPath>..\packages\ClosedXML.0.105.0-rc\lib\netstandard2.0\ClosedXML.dll</HintPath>
</Reference>
<Reference Include="ClosedXML.Parser, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d5f7376574c51ec, processorArchitecture=MSIL">
<HintPath>..\packages\ClosedXML.Parser.2.0.0-preview1\lib\netstandard2.0\ClosedXML.Parser.dll</HintPath>
</Reference>
<Reference Include="DocumentFormat.OpenXml, Version=3.1.1.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
<HintPath>..\packages\DocumentFormat.OpenXml.3.1.1\lib\net46\DocumentFormat.OpenXml.dll</HintPath>
</Reference>
<Reference Include="DocumentFormat.OpenXml.Framework, Version=3.1.1.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
<HintPath>..\packages\DocumentFormat.OpenXml.Framework.3.1.1\lib\net46\DocumentFormat.OpenXml.Framework.dll</HintPath>
</Reference>
<Reference Include="EPPlus.Interfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=a694d7f3b0907a61, processorArchitecture=MSIL">
<HintPath>..\packages\EPPlus.Interfaces.8.0.0\lib\net462\EPPlus.Interfaces.dll</HintPath>
</Reference>
<Reference Include="ExcelNumberFormat, Version=1.1.0.0, Culture=neutral, PublicKeyToken=23c6f5d73be07eca, processorArchitecture=MSIL">
<HintPath>..\packages\ExcelNumberFormat.1.1.0\lib\net20\ExcelNumberFormat.dll</HintPath>
</Reference>
<Reference Include="FluentNHibernate">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
</Reference>
@@ -65,51 +47,15 @@
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.HashCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.HashCode.1.1.1\lib\net461\Microsoft.Bcl.HashCode.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IO.RecyclableMemoryStream, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IO.RecyclableMemoryStream.3.0.1\lib\netstandard2.0\Microsoft.IO.RecyclableMemoryStream.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="MySql.Data">
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="NHibernate">
<HintPath>..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="RBush, Version=4.0.0.0, Culture=neutral, PublicKeyToken=c77e27b81f4d0187, processorArchitecture=MSIL">
<HintPath>..\packages\RBush.Signed.4.0.0\lib\net47\RBush.dll</HintPath>
</Reference>
<Reference Include="SixLabors.Fonts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13, processorArchitecture=MSIL">
<HintPath>..\packages\SixLabors.Fonts.1.0.0\lib\netstandard2.0\SixLabors.Fonts.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.ComponentModel.Annotations.5.0.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Memory, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.6.2\lib\net462\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.1\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Security" />
<Reference Include="System.Security.Cryptography.Xml, Version=8.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Xml.8.0.2\lib\net462\System.Security.Cryptography.Xml.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Forms.DataVisualization" />
<Reference Include="System.Xml.Linq" />
@@ -117,7 +63,6 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="BatchResults.cs" />
@@ -235,17 +180,6 @@
<DesignTime>True</DesignTime>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
<Compile Include="RigUncertainty.cs" />
<Compile Include="Uncertainty\Calculation\CalculationTable.cs" />
<Compile Include="Uncertainty\Calculation\Math.cs" />
<Compile Include="Uncertainty\CommonExcell.cs" />
<Compile Include="Uncertainty\CommonTable\Table.cs" />
<Compile Include="Uncertainty\DEItem.cs" />
<Compile Include="Uncertainty\DEUtils.cs" />
<Compile Include="Uncertainty\DocumentSheets.cs" />
<Compile Include="Uncertainty\ProcessDataLine.cs" />
<Compile Include="Uncertainty\ProcessDataMeterLine.cs" />
<Compile Include="Uncertainty\CommonTable\Cell.cs" />
<Compile Include="Utils.cs" />
<Compile Include="WMeterRsltItemSpec.cs" />
</ItemGroup>
@@ -315,8 +249,6 @@
<EmbeddedResource Include="Resources\Strings.ru.resx" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
<None Include="Resources\Headpic.png" />
</ItemGroup>
<ItemGroup>
-144
View File
@@ -1,144 +0,0 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using ClosedXML.Excel;
using log4net;
using Results.Resources;
using Results.Uncertainty;
namespace Results
{
/// <summary>
/// Uncertaintity based on calculation
/// </summary>
public class RigUncertainty
{
private static readonly ILog log = LogManager.GetLogger(typeof(RigUncertainty));
//Based on |Excel calculation
//1.step feed Excel
//2.step get calculated data from excel
private string DocumentName { get; set; }
private XLWorkbook Document;
private Boolean openedDocument;
public Boolean IsOpenedDocument { get { return openedDocument; } }
Dictionary<int, ProcessDataLine> processDataDict = new Dictionary<int, ProcessDataLine>();
public RigUncertainty()
{
}
public RigUncertainty(string DocumentName)
{
this.DocumentName = DocumentName;
}
public void OpenDocument()
{
this.openedDocument = TryOpenDocument();
}
private Boolean TryOpenDocument()
{
try
{
Document = new XLWorkbook(DocumentName);
return true;
}
catch (Exception e)
{
log.Error("Can`t open excel document!",e);
return false;
}
}
public void CloaseDocument()
{
this.openedDocument = !TryCloseDocument();
}
private Boolean TryCloseDocument()
{
try
{
Document.Dispose(); // Closes the file and releases resources
return true;
}
catch (Exception e)
{
log.Error("Can`t open excel document!",e);
return false;
}
}
public IXLWorksheet GetWorksheet(DocumentSheets sheet)
{
string sheetName = EnumExtensions.GetDescription(sheet);
try
{
var xlWorksheet = Document.Worksheet(sheetName);
return xlWorksheet;
}
catch (Exception e)
{
log.Error($"Can`t get \"{sheetName}\" worksheet!", e);
return null;
}
}
public Boolean GetCalculatedDataFromExcel()
{
// Code to get calculated data from Excel
return true;
}
public void SetDataToExcel()
{
string sheetString = EnumExtensions.GetDescription(DocumentSheets.RADATA);
IXLWorksheet worksheet = Document.Worksheet(sheetString);
// # store data to Excel workbook
// ## get data from DB
int line = 3;
ProcessDataLine pDataLine = new ProcessDataLine();
processDataDict.Add(line,pDataLine);
// ### line process data
// ## Store to document
foreach ( var processDataKey in processDataDict)
{
//get Process data line base by row
ProcessDataLine processDataLine = processDataKey.Value;
CommonExcell.InsertValueLineProcessData(this, processDataKey.Key, processDataLine);
}
}
public void SaveResultDataToDatabase()
{
// Code to save data to database
}
public void SaveChangesToDocument()
{
if (Document != null && openedDocument)
{
Document.Save();
}
}
}
}
@@ -1,239 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using ClosedXML.Excel;
using DocumentFormat.OpenXml.Spreadsheet;
namespace Results.Uncertainty.Calculation
{
public class ColumnValue
{
private int iColumn;
private double value;
public int IColumn => iColumn;
public double Value
{
get => value;
set => this.value = value;
}
public ColumnValue(int iColumn)
{
this.iColumn = iColumn;
}
public ColumnValue(int iColumn, double value)
{
this.iColumn = iColumn;
this.value = value;
}
}
public class BatchProcessTable
{
private Dictionary<int, ProcessDataLine> processTable;
public Dictionary<int, ProcessDataLine> ProcessTable
{
get => processTable;
set => processTable = value;
}
public IList<ColumnValue> GetListMeterValue(int iMeter, int iMeterSubvalueIndex)
{
IList<ColumnValue> xx = new List<ColumnValue>();
foreach (KeyValuePair<int, ProcessDataLine> dataLine in processTable)
{
XLCellValue cellValue = dataLine.Value.processDataMeterList[iMeter].val[iMeterSubvalueIndex];
xx.Add(new ColumnValue((int)dataLine.Key ,cellValue.GetNumber()));
}
return xx;
}
public Dictionary<int, IList<ColumnValue>> GetKBuoyancy()
{
Dictionary<int, IList<ColumnValue>> table = new Dictionary<int, IList<ColumnValue>>();
IList<ColumnValue> bc = new List<ColumnValue>();
IList<ColumnValue> bi = new List<ColumnValue>();
IList<ColumnValue> bj = new List<ColumnValue>();
IList<ColumnValue> bm = new List<ColumnValue>();
foreach (KeyValuePair<int, ProcessDataLine> dataLine in processTable)
{
bc.Add(new ColumnValue((int)dataLine.Key ,dataLine.Value.Kbuoyancy));
bi.Add(new ColumnValue((int)dataLine.Key ,dataLine.Value.Qctv));
bj.Add(new ColumnValue((int)dataLine.Key ,dataLine.Value.VolRI));
bm.Add(new ColumnValue((int)dataLine.Key ,dataLine.Value.ERelRef));
}
table.Add(CommonExcell.ColumnToNumber("BC"),bc);
table.Add(CommonExcell.ColumnToNumber("BI"),bi);
table.Add(CommonExcell.ColumnToNumber("BJ"),bj);
table.Add(CommonExcell.ColumnToNumber("BM"),bm);
return table;
}
public Dictionary<int, IList<ColumnValue>> ModifyKbuoyancy(IList<ColumnValue> corectedKbuoancy)
{
//Columns - 'BC'
Dictionary<int,IList<ColumnValue>> kbuoyancyTable = GetKBuoyancy();
if (kbuoyancyTable.ContainsKey(CommonExcell.ColumnToNumber("BC")) &&
kbuoyancyTable.ContainsKey(CommonExcell.ColumnToNumber("BI")) &&
kbuoyancyTable.ContainsKey(CommonExcell.ColumnToNumber("BJ")) &&
kbuoyancyTable.ContainsKey(CommonExcell.ColumnToNumber("BM")))
{
IList<ColumnValue> listBC = kbuoyancyTable[CommonExcell.ColumnToNumber("BC")];
IList<ColumnValue> listBI = kbuoyancyTable[CommonExcell.ColumnToNumber("BI")];
IList<ColumnValue> listBJ = kbuoyancyTable[CommonExcell.ColumnToNumber("BJ")];
IList<ColumnValue> listBM = kbuoyancyTable[CommonExcell.ColumnToNumber("BM")];
if (corectedKbuoancy.Count != listBC.Count)
{
throw new Exception("Incompatible count in table kbuoyancy!");
}
for (int row = 0; row < listBC.Count; row++)
{
double correctedKbuoyancyValue = corectedKbuoancy[row].Value;
listBC[row].Value = correctedKbuoyancyValue;
//BI=+BI4/BC4*BC13
listBI[row].Value = listBI[row].Value / correctedKbuoyancyValue * listBJ[row].Value;
//BM==+(BJ13-BI13)/BI13*100
listBM[row].Value = (listBJ[row].Value - listBI[row].Value) / listBI[row].Value * 100;
}
return kbuoyancyTable;
}
return null;
}
}
public class CalculationTable
{
private BatchProcessTable batchProcessTable;
private Dictionary<int, IList<ColumnValue>> table;
private Dictionary<string, double> averages;
public BatchProcessTable BatchProcessTable
{
get => batchProcessTable;
set => batchProcessTable = value;
}
public Dictionary<int, IList<ColumnValue>> Table
{
get => table;
set => table = value;
}
public Dictionary<string, double> Averages
{
get => averages;
set => averages = value;
}
public CalculationTable()
{
batchProcessTable = new BatchProcessTable();
table = new Dictionary<int, IList<ColumnValue>>();
averages = new Dictionary<string, double>();
}
////////
///
public IList<ColumnValue> GetColumn(string column)
{
int iColumnName = CommonExcell.ColumnToNumber(column);
if (table.ContainsKey(iColumnName))
{
return table[iColumnName];
}
else
{
throw new Exception($"Column {column} missing in table!");
}
}
double Average(string columnName, bool forceCalculation = false)
{
int iColumnName = CommonExcell.ColumnToNumber(columnName);
if (!forceCalculation && averages.ContainsKey(columnName))
{
return averages[columnName];
}
if (!table.ContainsKey(iColumnName))
{
double average = Average(table[iColumnName]);
averages.Add(columnName, average);
return average;
}
else
{
throw new Exception($"Column {columnName} missing in table!");
}
return 0;
}
public static double Average(IList<ColumnValue> values)
{
int i = 0;
double sum = 0;
foreach (ColumnValue value in values)
{
sum += value.Value;
i++;
}
return sum / i;
}
static double SumOfSquares(IList<ColumnValue> values, double mean)
{
double sumOfSquares = 0;
foreach (ColumnValue columnValue in values)
{
sumOfSquares += System.Math.Pow(columnValue.Value - mean, 2);
}
return sumOfSquares;
}
/// <summary>
/// Calculates the sample standard deviation for a list of ColumnValue objects.
/// </summary>
/// <param name="values">An IList of ColumnValue objects.</param>
/// <returns>The sample standard deviation. Returns 0 if there are fewer than 2 values.</returns>
public static double StandardDeviation(IList<ColumnValue> values)
{
if (values == null || values.Count < 2)
return 0.0;
// Compute the average of the values.
double mean = CalculationTable.Average(values);
// Calculate the sum of squared differences from the mean.
double sumOfSquares = CalculationTable.SumOfSquares(values, mean);
// For sample standard deviation, divide by (n - 1)
return System.Math.Sqrt(sumOfSquares / (values.Count - 1));
}
}
}
-22
View File
@@ -1,22 +0,0 @@
using System;
using System.Collections.Generic;
namespace Results.Uncertainty.Calculation
{
public static class Math
{
public static double Average(IList<Double> values)
{
int i = 0;
double sum = 0;
foreach (double value in values)
{
sum += value;
i++;
}
return sum / i;
}
}
}
-310
View File
@@ -1,310 +0,0 @@
using System;
using System.Collections.Generic;
using ClosedXML.Excel;
using Common;
using Config.Entities;
using log4net;
using NHibernate;
using Results.Resources;
namespace Results.Uncertainty
{
public class CommonExcell
{
const string formatD7 = "0.0000000";
const string formatD6 = "0.000000";
const string formatD4 = "0.0000";
const string formatD3 = "0.000";
const string formatD1 = "0.0";
const string formatInt = "0";
const string formatStr = "@";
private static Dictionary<int, int> bloks = null;
static readonly ILog log = LogManager.GetLogger(typeof(CommonExcell));
private static IList<Component> cmpntEntities;
public static Dictionary<int, int> GetBolocs() {
if (bloks == null)
{
bloks = new Dictionary<int, int>();
bloks.Add(0, 4);
bloks.Add(1, 24);
bloks.Add(2, 44);
bloks.Add(3, 64);
bloks.Add(4, 84);
bloks.Add(5, 104);
bloks.Add(6, 124);
bloks.Add(7, 144);
}
return bloks;
}
/// <summary>
/// Inserts a line of process data into a specified row of the Excel document.
/// </summary>
/// <param name="_rigUncertainty">An instance of the <see cref="RigUncertainty"/> class representing the rig uncertainty and its associated data.</param>
/// <param name="iRowI">The row index in the Excel worksheet where the process data will be inserted.</param>
/// <param name="processDataLine">An instance of the <see cref="ProcessDataLine"/> class containing the process data to be added to the row.</param>
public static void InsertValueLineProcessData(RigUncertainty _rigUncertainty, int iRowI, ProcessDataLine processDataLine)
{
if (!_rigUncertainty.IsOpenedDocument)
{
throw new Exception("No Opened document!");
}
IXLWorksheet worksheet = _rigUncertainty.GetWorksheet(DocumentSheets.RADATA);
//Date time
string column = "A";
worksheet.Cell($"{column}{iRowI}").Value = processDataLine.DateTime;
worksheet.Cell($"{column}{iRowI}").Style.DateFormat.Format = "M/d/yyyy h:mm";
//deffined values
CellData(worksheet, "B", iRowI, processDataLine.Batch, formatInt); //Batch - B
CellData(worksheet, "C", iRowI, processDataLine.TestName, formatStr); //Test Name - C
CellData(worksheet, "D", iRowI, processDataLine.Reports, formatInt); //Reports
CellData(worksheet, "E", iRowI, processDataLine.RepCyc, formatInt); //Rep cyc
CellData(worksheet, "F", iRowI, processDataLine.TestMeth, formatStr); //Test Meth.
CellData(worksheet, "G", iRowI, processDataLine.TargetVOL, formatInt); //Target VOL.
CellData(worksheet, "H", iRowI, processDataLine.TargetQMin, formatD4); //Target Q -
CellData(worksheet, "I", iRowI, processDataLine.TargetQPlus, formatD4); //Target Q +
CellData(worksheet, "J", iRowI, processDataLine.ErrLimitMin, formatInt); //Err. LIMIT -
CellData(worksheet, "K", iRowI, processDataLine.ErrLimitPlus, formatInt); //Err. LIMIT +
CellData(worksheet, "L", iRowI, processDataLine.TargetTempFrom, formatInt); //Target temp from - L
CellData(worksheet, "M", iRowI, processDataLine.TargetTempTo, formatInt); //Target temp to - M
CellData(worksheet, "N", iRowI, processDataLine.TargetPressFrom, formatInt); //Target press from - N
CellData(worksheet, "O", iRowI, processDataLine.TargetPressTo, formatInt); //Target press to - O
CellData(worksheet, "P", iRowI, processDataLine.MIDNumberName, formatStr);
CellData(worksheet, "Q", iRowI, processDataLine.MIDNumberValue, formatD4); //MID number - PQ
CellData(worksheet, "R", iRowI, processDataLine.COR, formatStr); //COR - R
CellData(worksheet, "S", iRowI, processDataLine.TempAmbM, formatD1); //Temp.Amb M - S
CellData(worksheet, "T", iRowI, processDataLine.PressAmbM, formatInt); //Press.Amb M - T
CellData(worksheet, "U", iRowI, processDataLine.HumidAmbM, formatD1); //Humid.Amb M - U
CellData(worksheet, "V", iRowI, processDataLine.PressUpME, formatInt); //Press. UP ME - V
CellData(worksheet, "W", iRowI, processDataLine.PressDwME, formatInt); //Press. DW ME - W
CellData(worksheet, "X", iRowI, processDataLine.PressDeME, formatInt); //Press. DE ME - X
CellData(worksheet, "Y", iRowI, processDataLine.PressUpST, formatInt); //Press. UP ST - Y
CellData(worksheet, "Z", iRowI, processDataLine.PressDwST, formatInt); //Press. DW ST - Z
CellData(worksheet, "AA", iRowI, processDataLine.PressDES, formatInt); //Press. DES - AA
CellData(worksheet, "AB", iRowI, processDataLine.PressUpEN, formatInt); //Press UP EN - AB
CellData(worksheet, "AC", iRowI, processDataLine.PressDwEN, formatInt); //Press DW EN
CellData(worksheet, "AD", iRowI, processDataLine.PressDEE, formatInt); //Press. DEE
CellData(worksheet, "AE", iRowI, processDataLine.TempUpME, formatD4); //Temp. UP ME
CellData(worksheet, "AF", iRowI, processDataLine.TempDwME, formatD4); //Temp. DW ME
CellData(worksheet, "AG", iRowI, processDataLine.TempDiME, formatD4); //Temp. DI ME
CellData(worksheet, "AH", iRowI, processDataLine.TempLoME, formatD4); //Temp. LO ME
CellData(worksheet, "AI", iRowI, processDataLine.TempHiME, formatD4); //Temp. HI ME
CellData(worksheet, "AJ", iRowI, processDataLine.TempUpST, formatD4); //Temp. UP ST
CellData(worksheet, "AK", iRowI, processDataLine.TempDwST, formatD4); //Temp. DW ST
CellData(worksheet, "AL", iRowI, processDataLine.TempDiST, formatD4); //Temp. DI ST
CellData(worksheet, "AM", iRowI, processDataLine.TempLoST, formatD4); //Temp. LO ST
CellData(worksheet, "AN", iRowI, processDataLine.TempHiST, formatD4); //Temp. HI ST
CellData(worksheet, "AO", iRowI, processDataLine.TempUpEN, formatD4); //Temp. UP EN
CellData(worksheet, "AP", iRowI, processDataLine.TempDwEN, formatD4); //Temp. DW EN
CellData(worksheet, "AQ", iRowI, processDataLine.TempDiEN, formatD4); //Temp. DI EN
CellData(worksheet, "AR", iRowI, processDataLine.TempLoEN, formatD4); //Temp. LO EN
CellData(worksheet, "AS", iRowI, processDataLine.TempHiEN, formatD4); //Temp. HI EN
//Mass vakues
CellData(worksheet, "AT", iRowI, processDataLine.MassStRaw, formatD3); //Mass ST raw()
CellData(worksheet, "AU", iRowI, processDataLine.MassSt, formatD3); //Mass ST ()
CellData(worksheet, "AV", iRowI, processDataLine.MassEnRaw, formatD3); //Mass EN raw()
CellData(worksheet, "AW", iRowI, processDataLine.MassEn, formatD3); //Mass EN ()
CellData(worksheet, "AX", iRowI, processDataLine.Mass, formatD3); //Mass
//calculated values
CellData(worksheet, "AY", iRowI, processDataLine.RoWa, formatD7); //Ro Wa
CellData(worksheet, "AZ", iRowI, processDataLine.TempLnME, formatD7); //Temp. LN ME
CellData(worksheet, "BA", iRowI, processDataLine.RoWat, formatD7); //Ro Wat
CellData(worksheet, "BB", iRowI, processDataLine.RoAir, formatD7); // Ro AIR
CellData(worksheet, "BC", iRowI, processDataLine.Kbuoyancy, formatD7); // Kbuoyancy
CellData(worksheet, "BD", iRowI, processDataLine.DensityOfSample, formatInt); //Density of sample
CellData(worksheet, "BE", iRowI, processDataLine.TTempRO, formatInt); //TTemp. RO()
CellData(worksheet, "BF", iRowI, processDataLine.QMax, formatD7); //Q max ()
CellData(worksheet, "BG", iRowI, processDataLine.QMin, formatD7); //Q min ()
CellData(worksheet, "BH", iRowI, processDataLine.QMean, formatD7); //Q mean
CellData(worksheet, "BI", iRowI, processDataLine.Qctv, formatD7); //Qctv
CellData(worksheet, "BJ", iRowI, processDataLine.VolRI, formatD7); //Vol. RI
CellData(worksheet, "BK", iRowI, processDataLine.DivCorrection, formatD3); //Div correction
CellData(worksheet, "BL", iRowI, processDataLine.T, formatD3); //T(s)()
CellData(worksheet, "BM", iRowI, processDataLine.ERelRef, formatD7); //E rel.ref. ()
//CellData(worksheet, "BN", iRowI, , formatD7);
CellData(worksheet, "BO", iRowI, processDataLine.KMind, formatInt); //K MID ()
//CellData(worksheet, "BP", iRowI, , formatInt);//Const.MAS
//Additional values
CellData(worksheet, "BQ", iRowI, processDataLine.DiverterStartTime, formatInt); //Diverter start time
CellData(worksheet, "BR", iRowI, processDataLine.DiverterEndTime, formatInt); //Diverter end time
CellData(worksheet, "BS", iRowI, processDataLine.DiverterStartValeveOpenTime, formatInt); // BS [ms] Start valve open time
CellData(worksheet, "BT", iRowI, processDataLine.DiverterStartValeveCloseTime, formatInt); // BT [ms] Start valve close time
CellData(worksheet, "BU", iRowI, processDataLine.TempUpMax, formatD7); //Temp. UP max
CellData(worksheet, "BV", iRowI, processDataLine.TempDwMax, formatD7); // Temp DW max
CellData(worksheet, "BW", iRowI, processDataLine.TempUpMin, formatD7); //Temp UP min
CellData(worksheet, "BX", iRowI, processDataLine.TempDwMin, formatD7); //Temp DW min
CellData(worksheet, "BY", iRowI, processDataLine.TempT10, formatD7); //10 - T1,2
CellData(worksheet, "BZ", iRowI, processDataLine.TempAmbEn, formatD1); //Temp Amb En
CellData(worksheet, "CA", iRowI, processDataLine.PressAmbEn, formatInt); //Press Amb En
CellData(worksheet, "CB", iRowI, processDataLine.HumAmbEn, formatD1); //Hum Amb En
//checking
CellData(worksheet, "CC", iRowI, processDataLine.RefPulses, formatInt); //Ref pulses()
CellData(worksheet, "CD", iRowI, processDataLine.DiverterTestTimeCorrection, formatInt); // CD [ms] Diverter test time correction
int distance = CommonExcell.GetColumnDistance("CE", "CZ");
string startBlockColumn = "CE";
foreach (ProcessDataMeterLine dataMeter in processDataLine.processDataMeterList){
MeterCellData(worksheet, startBlockColumn, iRowI, dataMeter, distance);
startBlockColumn = CommonExcell.GetExcelColumnByDistance(startBlockColumn, distance);
}
}
/// <summary>
/// Populates a range of cells in an Excel worksheet with meter process data starting from a specified column and row.
/// </summary>
/// <param name="worksheet">The Excel worksheet where data will be inserted.</param>
/// <param name="column">The starting column in the worksheet for inserting the meter process data.</param>
/// <param name="iRowI">The row index in the worksheet where the data will be inserted.</param>
/// <param name="data">An instance of the <see cref="ProcessDataMeterLine"/> class containing the meter process data to insert.</param>
/// <param name="distance">An optional parameter specifying the distance for additional columns to leave empty after data insertion. Defaults to 0.</param>
/// <returns>The next available column string after the last column used during data insertion.</returns>
private static string MeterCellData(IXLWorksheet worksheet, string column, int iRowI, ProcessDataMeterLine data, int distance = 0)
{
int iIndex = 0;
CellData(worksheet, column, iRowI, data.val[iIndex] , formatStr);//Position - Ser.No. - CE - 0
string nextColumn = NextColumn(column); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex] , formatInt);//Vol.Mt.st - CF
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex] , formatInt);//Vol.Mt.en - CG
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex] , formatD7);//Vol.Mt. - CH
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex], formatD7);//Vol.rm - CI
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex] , formatD6); // E rel. - CJ
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex] , formatInt); // U - CK
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex] , formatInt); //Pulses() -
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex] , formatInt); //Ref pulses_ni()
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex] , formatD4); //T(s)()_ni
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex] , formatStr);//evaluation
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex] , formatD4);//Pulses/l - CP
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex] , formatInt);//imp/l
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex] , formatInt);//div
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex] , formatInt);//Vend
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, data.val[++iIndex] , formatInt);//T end - 15
if (distance > 0)
{
string lastColumn = CommonExcell.GetExcelColumnByDistance(column, distance);
int columnDistance = CommonExcell.GetColumnDistance(nextColumn, lastColumn);
for (int i = 1; i < columnDistance; i++)
{
if ((iIndex + 1) < data.val.Length)
{
nextColumn = NextColumn(nextColumn);
CellData(worksheet, nextColumn, iRowI, data.val[++iIndex], formatInt);
}
else
{
nextColumn = NextColumn(nextColumn); CellData(worksheet,nextColumn, iRowI, 0 , formatInt);
}
}
}
return nextColumn;
}
public static void CellData(IXLWorksheet worksheet, string column, int iRowI, XLCellValue value, string format = null)
{
worksheet.Cell($"{column}{iRowI}").Value = value;
if (format != null)
{
worksheet.Cell($"{column}{iRowI}").Style.NumberFormat.Format = format; // Ensure integer format
}
}
public static string NextColumn(string column)
{
if (string.IsNullOrEmpty(column))
return "A";
char[] chars = column.ToUpper().ToCharArray();
int i = chars.Length - 1;
while (i >= 0)
{
if (chars[i] != 'Z')
{
chars[i]++;
break;
}
else
{
chars[i] = 'A';
i--;
}
}
if (i < 0)
return "A" + new string(chars);
return new string(chars);
}
public static int GetColumnDistance(string col1, string col2)
{
return ColumnToNumber(col2) - ColumnToNumber(col1);
}
public static int ColumnToNumber(string col)
{
int number = 0;
foreach (char c in col.ToUpper())
{
number = number * 26 + (c - 'A' + 1);
}
return number;
}
public static string GetExcelColumnByDistance(string startColumn, int distance)
{
int startNumber = ColumnToNumber(startColumn);
int targetNumber = startNumber + distance;
return NumberToColumn(targetNumber);
}
private static string NumberToColumn(int number)
{
string column = string.Empty;
while (number > 0)
{
number--;
column = (char)('A' + (number % 26)) + column;
number /= 26;
}
return column;
}
public static bool AreClose(double valA, double valB, double tolerance = 0.0001)
{
if ((valA + tolerance) > valB && (valA - tolerance) < valB)
{
return true;
}
return false;
}
}
}
-43
View File
@@ -1,43 +0,0 @@
using ClosedXML.Excel;
namespace Results.Uncertainty.CommonTable
{
public class Cell
{
public int IRow { get; }
public int IColumn { get; }
public XLCellValue Value { get; set; }
// The names (if any) of the row/column
public string ColumnName { get; }
public string RowName { get; }
/// <summary>
/// Excelstyle address, e.g. “B3”.
/// </summary>
public string Address => $"{ToLetter(IColumn + 1)}{IRow + 1}";
public Cell(int col, int row, XLCellValue value,
string colName = null, string rowName = null)
{
IColumn = col;
IRow = row;
Value = value;
ColumnName = colName;
RowName = rowName;
}
// Convert 1-based column number into letters
private static string ToLetter(int col)
{
var s = "";
while (col > 0)
{
int m = (col - 1) % 26;
s = (char)('A' + m) + s;
col = (col - m - 1) / 26;
}
return s;
}
}
}
-232
View File
@@ -1,232 +0,0 @@
using System.Collections.Generic;
using ClosedXML.Excel;
using System;
using System.Collections.Generic;
using ClosedXML.Excel;
namespace Results.Uncertainty.CommonTable
{
public class Table
{
private int iOffsetRows = 0;
private int iOffsetColumns = 0;
public int IOffsetRows
{
get => iOffsetRows;
set => iOffsetRows = value;
}
public int IOffsetColumns
{
get => iOffsetColumns;
set => iOffsetColumns = value;
}
// The grid of cells
public IList<IList<Cell>> Cells { get; private set; }
= new List<IList<Cell>>();
// Optional names for columns and rows
public IList<string> ColumnNames { get; private set; }
= new List<string>();
public IList<string> RowNames { get; private set; }
= new List<string>();
public Table() { }
public void AddColumnExcel(string nameStart, string nameEnd)
{
int distance = CommonExcell.GetColumnDistance(nameStart, nameEnd);
int iStart = CommonExcell.ColumnToNumber(nameStart);
AddColumn(nameStart);
for (int i = 0; i < distance; i++)
{
AddColumn(CommonExcell.GetExcelColumnByDistance(nameStart, i+1));
}
}
public void GenerateTable_RowsColumns_Excel(string nameStart, string nameEnd, int iRowsCount)
{
AddColumnExcel(nameStart, nameEnd);
for (int i = 0; i < iRowsCount; i++)
{
AddRow(i.ToString());
}
}
/// <summary>
/// Adds a new column (with optional name) and returns its index.
/// </summary>
public int AddColumn(string name = null)
{
int colIndex = ColumnNames.Count;
ColumnNames.Add(name);
// Grow every existing row by one
for (int r = 0; r < Cells.Count; r++)
{
Cells[r].Add(new Cell(colIndex, r, new XLCellValue(), name, RowNames[r]));
}
return colIndex;
}
/// <summary>
/// Adds a new row (with optional name) and returns its index.
/// </summary>
public int AddRow(string name = null)
{
int rowIndex = Cells.Count;
RowNames.Add(name);
var newRow = new List<Cell>(ColumnNames.Count);
// Initialize with empty cells
for (int c = 0; c < ColumnNames.Count; c++)
{
newRow.Add(new Cell(c, rowIndex, new XLCellValue(), ColumnNames[c], name));
}
Cells.Add(newRow);
return rowIndex;
}
/// <summary>
/// Ensures the given [row,col] exists, creating rows/columns as needed.
/// </summary>
private void EnsurePosition(int rowIndex, int colIndex)
{
while (Cells.Count <= rowIndex)
AddRow();
var row = Cells[rowIndex];
while (row.Count <= colIndex)
AddColumn();
}
/// <summary>
/// Sets the value of the cell at [rowIndex, colIndex].
/// </summary>
public void AddCell(int rowIndex, int colIndex, XLCellValue value)
{
EnsurePosition(rowIndex, colIndex);
Cells[rowIndex][colIndex].Value = value;
}
/// <summary>
/// Sets the value of the cell at [rowIndex, columnName].
/// If the columnName doesnt exist yet, its created.
/// </summary>
public void AddCell(int rowIndex, string columnName, XLCellValue value)
{
int colIndex = ColumnNames.IndexOf(columnName);
if (colIndex < 0)
colIndex = AddColumn(columnName);
AddCell(rowIndex, colIndex, value);
}
/// <summary>
/// Retrieves a cell by numeric coordinates.
/// </summary>
public Cell GetCell(int rowIndex, int colIndex)
=> Cells[rowIndex][colIndex];
/// <summary>
/// Retrieves a cell by rowIndex and columnName.
/// </summary>
public Cell GetCell(int rowIndex, string columnName)
{
int colIndex = ColumnNames.IndexOf(columnName);
if (colIndex < 0)
throw new ArgumentException($"Column '{columnName}' not found.");
return GetCell(rowIndex, colIndex);
}
/// <summary>
/// Writes the entire table into the given worksheet,
/// optionally including the header row of column names.
/// </summary>
public void ToWorksheet(IXLWorksheet ws, bool includeHeaders = true)
{
int startRow = 1;
if (includeHeaders)
{
for (int c = 0; c < ColumnNames.Count; c++)
ws.Cell(1, c + 1).Value = ColumnNames[c] ?? string.Empty;
startRow = 2;
}
for (int r = 0; r < Cells.Count; r++)
{
for (int c = 0; c < Cells[r].Count; c++)
{
ws.Cell(r + startRow, c + 1).Value = Cells[r][c].Value;
}
}
}
/// <summary>
/// Writes the entire table into the given worksheet,
/// optionally including the header row of column names.
/// </summary>
public void ToWorksheetWithOffset(IXLWorksheet ws, int rowsOffset = 1, int columnsOffset = 0, bool includeHeaders = true)
{
int startRow = rowsOffset;
if (includeHeaders)
{
for (int c = 0; c < ColumnNames.Count; c++)
ws.Cell(1, c + 1).Value = ColumnNames[c] ?? string.Empty;
startRow = 2;
}
for (int r = 0; r < Cells.Count; r++)
{
for (int c = 0; c < Cells[r].Count; c++)
{
if(!(Cells[r][c].Value.IsBlank || Cells[r][c].Value.Type == XLDataType.Blank))
{
ws.Cell(r + startRow, c + 1 + columnsOffset).Value = Cells[r][c].Value;
}
}
}
}
/// <summary>
/// Returns all cells in the given row (by zerobased index).
/// </summary>
public IList<Cell> GetRow(int rowIndex)
{
if (rowIndex < 0 || rowIndex >= Cells.Count)
throw new IndexOutOfRangeException($"Row {rowIndex} does not exist.");
return Cells[rowIndex];
}
/// <summary>
/// Returns all cells in the given column (by zerobased index).
/// </summary>
public IList<Cell> GetColumn(int colIndex)
{
if (colIndex < 0 || colIndex >= ColumnNames.Count)
throw new IndexOutOfRangeException($"Column {colIndex} does not exist.");
var list = new List<Cell>();
for (int r = 0; r < Cells.Count; r++)
{
// skip if that row hasnt grown that far yet
if (Cells[r].Count > colIndex)
list.Add(Cells[r][colIndex]);
}
return list;
}
}
}
-133
View File
@@ -1,133 +0,0 @@
///
/// Copyright (c) 2023 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using Common;
namespace Results.Uncertainty
{
/// <summary>
/// Action of a DataEntry field
/// </summary>
public enum Ac
{
[Description("Clear")] Clear, /// Clear when the form is open, save on OK
[Description("Last from history")] HistoryLast,
[Description("Load")] Load, /// Load from water meters when the form is open, save on OK
[Description("Load (readonly)")] LoadReadOnly, /// Load from water meters when the form is open, prevent changes, do not save
[Description("Set")] Set, /// Set to 'yes' when the form is open
Count,
}
/// <summary>
/// Content of a DataEntry field
/// </summary>
public enum Ct
{
[Description("None")] None,
[Description("Serial nr.")] SerialNr,
[Description("Serial nr. aux")] SerialNrAux,
[Description("Radio address")] RadioAddress,
[Description("Year of calibration")] YearOfCalibration,
[Description("Start state")] StartState,
[Description("Start state aux")] StartStateAux,
[Description("End state")] EndState,
[Description("End state aux")] EndStateAux,
[Description("Archive path")] ArchivePath,
[Description("WM Order")] WmOrder,
[Description("Batch order")] BatchOrder,
[Description("Batch and WM order")] BatchAndWmOrder,
[Description("WM Remark")] WmRemark,
[Description("Batch remark")] BatchRemark,
[Description("Batch and WM remark")] BatchAndWmRemark,
[Description("Print label")] PrintLabel,
#if ORACLE_DB
[Description("Prefix")] Prefix,
[Description("Suffix")] Suffix,
#endif
Count
}
/// <summary>
/// Function of the multi purpose button
/// </summary>
public enum MultiPurposeBtnFunction
{
None,
AutoSN,
PrintLabelsOnOff,
}
///
/// Identifies image instance
///
public enum Tst
{
Start,
End,
Both,
Collect,
}
///
/// Image rotation
///
public enum Rotation
{
R0,
R90,
R180,
R270,
Count
}
public class DEItem
{
public readonly Ct Content;
public readonly string Caption;
public readonly Ac Action;
public readonly int Width;
public DEItem(Ct content, string caption, Ac action, int width)
{
Content = content;
Caption = caption;
Action = action;
Width = width;
}
static IList<DEItem> items = new List<DEItem>();
///
public static void ClearItems() { items.Clear(); }
public static void AddItem(DEItem item) { items.Add(item); }
public static void AddItem(Ct content, string caption, Ac action, int width)
{
items.Add(new DEItem(content, caption, action, width));
}
public static IList<DEItem> GetItems() { return items; }
static IList<DEItem> columns = new List<DEItem>();
///
public static void ClearColumns() { columns.Clear(); }
public static void AddColumn(DEItem column) { columns.Add(column); }
public static void AddColumn(Ct content, string caption, Ac action, int width)
{
columns.Add(new DEItem(content, caption, action, width));
}
public static IList<DEItem> GetColumns() { return columns; }
static IList<DEItem> summaryColumns = new List<DEItem>();
///
public static void ClearSummaryColumns() { summaryColumns.Clear(); }
public static void AddSummaryColumn(DEItem column) { summaryColumns.Add(column); }
public static void AddSummaryColumn(Ct content, string caption, Ac action, int width)
{
summaryColumns.Add(new DEItem(content, caption, action, width));
}
public static IList<DEItem> GetSummaryColumns() { return summaryColumns; }
}
}
-122
View File
@@ -1,122 +0,0 @@
///
/// Copyright (c) 2018-2023 Sensus Slovensko a.s.
///
using System.Windows.Forms;
using Results.Entities;
namespace Results.Uncertainty
{
public class Strings
{
public static string yes = "yes";
public static string no = "no";
}
public class DEUtils
{
public static string GetContent(Ct content, WaterMeter wm)
{
if (wm == null) return string.Empty;
switch (content)
{
default:
case Ct.None: return string.Empty;
case Ct.SerialNr: return (!wm.Disabled && wm.SerialNr != null) ? wm.SerialNr : string.Empty;
case Ct.SerialNrAux: return (!wm.Disabled && wm.SerialNrAux != null) ? wm.SerialNrAux : string.Empty;
case Ct.RadioAddress: return (!wm.Disabled && wm.RadioAddress != null) ? wm.RadioAddress : string.Empty;
case Ct.YearOfCalibration: return (!wm.Disabled) ? wm.YearOfProduction.ToString() : string.Empty;
case Ct.StartState: return (!wm.Disabled && wm.GetStartState() != null) ? wm.GetStartState() : string.Empty;
case Ct.StartStateAux: return string.Empty;
case Ct.EndState: return (!wm.Disabled && wm.EndState != null) ? wm.EndState : string.Empty;
case Ct.EndStateAux: return (!wm.Disabled && wm.GetEndStateAux() != null) ? wm.GetEndStateAux() : string.Empty;
case Ct.ArchivePath: return (!wm.Disabled && wm.ArchivePath != null) ? wm.ArchivePath : string.Empty;
case Ct.WmOrder: return (!wm.Disabled && wm.PurchaseOrder != null) ? wm.PurchaseOrder : string.Empty;
case Ct.BatchOrder: return (wm.Batch != null && wm.Batch.PurchaseOrder != null) ? wm.Batch.PurchaseOrder : string.Empty;
case Ct.BatchAndWmOrder: return (wm.Batch != null && wm.Batch.PurchaseOrder != null) ? wm.Batch.PurchaseOrder : string.Empty;
case Ct.WmRemark: return (!wm.Disabled && wm.Remark != null) ? wm.Remark : string.Empty;
case Ct.BatchRemark: return (wm.Batch != null && wm.Batch.Remark != null) ? wm.Batch.Remark : string.Empty;
case Ct.BatchAndWmRemark: return (wm.Batch != null && wm.Batch.Remark != null) ? wm.Batch.Remark : string.Empty;
case Ct.PrintLabel: return wm.PrintLabel ? Strings.yes : Strings.no;
#if ORACLE_DB
case Ct.Prefix: return (!wm.Disabled && wm.Prefix != null) ? wm.Prefix : string.Empty;
case Ct.Suffix: return (!wm.Disabled && wm.Suffix != null) ? wm.Suffix : string.Empty;
#endif
}
}
public static void PutContent(Ct content, WaterMeter wm, string value)
{
if (wm == null || wm.Disabled) return;
int year;
switch (content)
{
default:
case Ct.None: return;
case Ct.SerialNr: wm.SerialNr = value; return;
case Ct.SerialNrAux: wm.SerialNrAux = value; return;
case Ct.RadioAddress: wm.RadioAddress = value; return;
case Ct.YearOfCalibration: if (int.TryParse(value, out year)) wm.YearOfProduction = year; return;
case Ct.StartState: wm.SetStartState(value); return;
case Ct.StartStateAux: return;
case Ct.EndState: wm.EndState = value; return;
case Ct.EndStateAux: wm.SetEndStateAux(value); return;
case Ct.ArchivePath: wm.ArchivePath = value; return;
case Ct.WmOrder:
wm.PurchaseOrder = value;
return;
case Ct.BatchOrder:
case Ct.BatchAndWmOrder:
if (wm.Batch != null) wm.Batch.PurchaseOrder = value;
return;
case Ct.WmRemark:
wm.Remark = value;
return;
case Ct.BatchRemark:
case Ct.BatchAndWmRemark:
if (wm.Batch != null) wm.Batch.Remark = value;
return;
case Ct.PrintLabel:
wm.PrintLabel = (value == Strings.yes);
return;
#if ORACLE_DB
case Ct.Prefix: wm.Prefix = value; return;
case Ct.Suffix: wm.Suffix = value; return;
#endif
}
}
/// <summary>
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
/// </summary>
/// <param name="comboBox">Puchase order ComboBox</param>
public static void PrepareCombo(ComboBox comboBox, string[] history, bool emptyOnStart = false)
{
int historyLen = (history != null) ? history.Length : 0;
if (!emptyOnStart && (historyLen > 0))
{
comboBox.Text = history[0];
}
else
{
comboBox.Text = string.Empty;
}
for (int i = 0; i < historyLen; i++)
{
comboBox.Items.Add(history[i]);
}
}
}
}
-39
View File
@@ -1,39 +0,0 @@
using System;
using System.ComponentModel;
using System.Reflection;
namespace Results.Uncertainty
{
public enum DocumentSheets
{
[Description("RADATA")] RADATA,
[Description("DATA")] DATA,
[Description("IC")] IC,
[Description("CERTIFICATE")] CERTIFICATE,
[Description("L")] L,
[Description("REF METER CC")] REF_METER_CC,
[Description("Meter1ALL")] Meter1ALL,
[Description("UNCTABLE")] UNCTABLE,
[Description("CC")] CC,
[Description("CALINPUTS")] CALIMPUTS,
[Description("UNCTEST1")] UNCTEST1,
[Description("UNCTEST2")] UNCTEST2,
[Description("UNCTEST3")] UNCTEST3,
[Description("UNCTEST4")] UNCTEST4,
}
public static class EnumExtensions
{
public static string GetDescription(this Enum value)
{
FieldInfo field = value.GetType().GetField(value.ToString());
DescriptionAttribute attribute = field?.GetCustomAttribute<DescriptionAttribute>();
return attribute?.Description ?? value.ToString();
}
}
}
-325
View File
@@ -1,325 +0,0 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Common;
using Results.Entities;
namespace Results.Uncertainty
{
public class ProcessDataLine
{
public DateTime DateTime;
public int Batch; //"B" //Batch - B
public string TestName; //"C", "Q1 (1/5)", formatStr); //Test Name - C
public int Reports; //"D", 5, formatInt); //Reports
public int RepCyc; //"E", 1, formatInt); //Rep cyc
public string TestMeth; //"F", "FlyingStartMassCollection", formatStr); //Test Meth.
public int TargetVOL; //"G", 1, formatInt); //Target VOL.
public double TargetQMin; //"H", 0.005, formatD4); //Target Q -
public double TargetQPlus; //"I", 0.0055, formatD4); //Target Q +
public int ErrLimitMin; //"J", -2, formatInt); //Err. LIMIT -
public int ErrLimitPlus; //"K", -2, formatInt); //Err. LIMIT +
public int TargetTempFrom; //"L", 15, formatInt); //Target temp from - L
public int TargetTempTo; //"M", 25, formatInt); //Target temp to - M
public int TargetPressFrom; //"N", 0, formatInt); //Target press from - N
public int TargetPressTo; //"O", 16, formatInt); //Target press to - O
public string MIDNumberName; //"P", "I4", formatStr);
public double MIDNumberValue; //"Q", 998.1848d, formatD4); //MID number - PQ
public string COR; //"R", "WT2", formatStr); //COR - R
public double TempAmbM; //"S", 20.0, formatD1); //Temp.Amb M - S
public int PressAmbM; //"T", 1010, formatInt); //Press.Amb M - T
public double HumidAmbM; //"U", 52.7, formatD1); //Humid.Amb M - U
public int PressUpME; //"V", 272, formatInt); //Press. UP ME - V
public int PressDwME; //"W", 277, formatInt); //Press. DW ME - W
public int PressDeME; //"X", 0, formatInt); //Press. DE ME - X
public int PressUpST; //"Y", 272, formatInt); //Press. UP ST - Y
public int PressDwST; //"Z", 277, formatInt); //Press. DW ST - Z
public int PressDES; //"AA", 0, formatInt); //Press. DES - AA
public int PressUpEN; //"AB", 271, formatInt); //Press UP EN - AB
public int PressDwEN; //"AC", 276, formatInt); //Press DW EN
public int PressDEE; //"AD", 0, formatInt); //Press. DEE
public double TempUpME; //"AE", 17.27103, formatD4); //Temp. UP ME
public double TempDwME; //"AF", 17.84066, formatD4); //Temp. DW ME
public double TempDiME; //"AG", 18.25793, formatD4); //Temp. DI ME
public double TempLoME; //"AH", 0, formatD4); //Temp. LO ME
public double TempHiME; //"AI", 0, formatD4); //Temp. HI ME
public double TempUpST; //"AJ", 17.18227, formatD4); //Temp. UP ST
public double TempDwST; //"AK", 17.78378, formatD4); //Temp. DW ST
public double TempDiST; //"AL", 18.1312, formatD4); //Temp. DI ST
public double TempLoST; //"AM", 0, formatD4); //Temp. LO ST
public double TempHiST; //"AN", 0, formatD4); //Temp. HI ST
public double TempUpEN; //"AO", 17.3036, formatD4); //Temp. UP EN
public double TempDwEN; //"AP", 17.88913, formatD4); //Temp. DW EN
public double TempDiEN; //"AQ", 18.35797, formatD4); //Temp. DI EN
public double TempLoEN; //"AR", 0, formatD4); //Temp. LO EN
public double TempHiEN; //"AS", 0, formatD4); //Temp. HI EN
//Mass vakues
public double MassStRaw; // "AT", iRowI, 18.104, formatD3); //Mass ST raw()
public double MassSt; // "AU", iRowI, 18.104, formatD3); //Mass ST ()
public double MassEnRaw; // "AV", iRowI, 19.087, formatD3); //Mass EN raw()
public double MassEn; // "AW", iRowI, 19.087, formatD3); //Mass EN ()
public double Mass; // "AX", iRowI, 0.983, formatD3); //Mass
//calculated values
public double RoWa; // "AY", iRowI, 999.0094727, formatD7); //Ro Wa
public double TempLnME; // "AZ", iRowI, 17.55585, formatD7); //Temp. LN ME
public double RoWat; // "BA", iRowI, 999.2654076, formatD7); //Ro Wat
public double RoAir; // "BB", iRowI, 0, formatD7); // Ro AIR
public double Kbuoyancy; // "BC", iRowI, 1.00103, formatD7); // Kbuoyancy
public int DensityOfSample; // "BD", iRowI, 998, formatInt); //Density of sample
public int TTempRO; // "BE", iRowI, 23, formatInt); //TTemp. RO()
public double QMax; // "BF", iRowI, 0.00539688, formatD7); //Q max ()
public double QMin; // "BG", iRowI, 0.005288206, formatD7); //Q min ()
public double QMean; // "BH", iRowI, 0.005257821, formatD7); //Q mean
public double Qctv; ///< "BI", iRowI, 23, formatD7); //Qctv
public double VolRI; // "BJ", iRowI, 1.00006944444444, formatD7); //Vol. RI
public double DivCorrection; // "BK", iRowI, 0, formatD3); //Div correction
public double T; // "BL", iRowI, 674.242981, formatD3); //T(s)()
public double ERelRef; ///< "BM", iRowI, 1.557125667, formatD7); //E rel.ref. ()
//CellData(worksheet, "BN", iRowI, , formatD7);
public int KMind; ///< "BO", iRowI, 14400, formatInt); //K MID ()
//CellData(worksheet, "BP", iRowI, , formatInt);//Const.MAS
//Additional values
public int DiverterStartTime; //"BQ", iRowI, 84, formatInt); //Diverter start time
public int DiverterEndTime; //"BR", iRowI, 86, formatInt); //Diverter end time
public int DiverterStartValeveOpenTime;//"BS", iRowI, 0, formatInt); // /// BS [ms] Start valve open time
public int DiverterStartValeveCloseTime;//"BT", iRowI, 0, formatInt); // /// BT [ms] Start valve close time
public double TempUpMax; //"BU", iRowI, 17.40029, formatD7); //Temp. UP max
public double TempDwMax; //"BV", iRowI, 17.91978, formatD7); // Temp DW max
public double TempUpMin; //"BW", iRowI, 17.14815, formatD7); //Temp UP min
public double TempDwMin; //"BX", iRowI, 17.74739, formatD7); //Temp DW min
public double TempT10; //"BY", iRowI, 0, formatD7); //10 - T1,2
public double TempAmbEn; //"BZ", iRowI, 20.1, formatD1); //Temp Amb En
public int PressAmbEn; //"CA", iRowI, 1010, formatInt); //Press Amb En
public double HumAmbEn; //"CB", iRowI, 52.8, formatD1); //Hum Amb En
//checking
public int RefPulses; //"CC", iRowI, 14401, formatInt); //Ref pulses()
public int DiverterTestTimeCorrection; //CellData(worksheet, "CD", iRowI, , formatInt); /// CD [ms] Diverter test time correction
public IList<ProcessDataMeterLine> processDataMeterList = new List<ProcessDataMeterLine>();
public void InitDefault()
{
DateTime = DateTime.Now;
Batch = 914;
TestName = "Q1 (1/5)";
Reports = 5;
RepCyc = 1;
TestMeth = "FlyingStartMassCollection";
TargetVOL = 1;
TargetQMin = 0.005;
TargetQPlus = 0.0055;
ErrLimitMin = -2;
ErrLimitPlus = -2;
TargetTempFrom = 15;
TargetTempTo = 25;
TargetPressFrom = 0;
TargetPressTo = 16;
MIDNumberName = "I4";
MIDNumberValue = 998.1848d;
COR = "WT2";
TempAmbM = 20.0;
PressAmbM = 1010;
HumidAmbM = 52.7;
PressUpME = 272;
PressDwME = 277;
PressDeME = 0;
PressUpST = 272;
PressDwST = 277;
PressDES = 0;
PressUpEN = 271;
PressDwEN = 276;
PressDEE = 0;
TempUpME = 17.27103;
TempDwME = 17.84066;
TempDiME = 18.25793;
TempLoME = 0;
TempHiME = 0;
TempUpST = 17.18227;
TempDwST = 17.78378;
TempDiST = 18.1312;
TempLoST = 0;
TempHiST = 0;
TempUpEN = 17.3036;
TempDwEN = 17.88913;
TempDiEN = 18.35797;
TempLoEN = 0;
TempHiEN = 0;
MassStRaw = 18.104;
MassSt = 18.104;
MassEnRaw = 19.087;
MassEn = 19.087;
Mass = 0.983;
RoWa = 999.0094727;
TempLnME = 17.55585;
RoWat = 999.2654076;
RoAir = 0;
Kbuoyancy = 1.00103;
DensityOfSample = 998;
TTempRO = 23;
QMax = 0.00539688;
QMin = 0.005288206;
QMean = 0.005257821;
Qctv = 23;
VolRI = 1.00006944444444;
DivCorrection = 0;
T = 674.242981;
ERelRef = 1.557125667;
KMind = 14400;
DiverterStartTime = 84;
DiverterEndTime = 86;
TempUpMax = 17.40029;
TempDwMax = 17.91978;
TempUpMin = 17.14815;
TempDwMin = 17.74739;
TempT10 = 0;
TempAmbEn = 20.1;
PressAmbEn = 1010;
HumAmbEn = 52.8;
RefPulses = 14401;
DiverterTestTimeCorrection = 0;
for (int i = 0; i < 3; i++)
{
ProcessDataMeterLine meterLine = new ProcessDataMeterLine();
meterLine.InitDefault();
meterLine.val[0] = $"XXXX{i}";
processDataMeterList.Add(meterLine);
}
}
public void Init(Results.Entities.TestRslt tstRslt)
{
bool isPMaxTest = tstRslt.IsPMaxTest();
bool isStartStop = tstRslt.IsStartStop();
bool isDiverter = tstRslt.IsDiverter();
bool isVolumeMethod = tstRslt.IsVolumeMethod();
DateTime =tstRslt.StartTime; /// A
Batch = tstRslt.Batch.BatchNr; /// B
/// Test information, target values, etc.
TestName = tstRslt.Name(); /// C
Reports = tstRslt.Repeats(); /// D
RepCyc = tstRslt.RepetitionNr; /// E
TestMeth = tstRslt.Method(); /// F
TargetVOL = Convert.ToInt32(tstRslt.TargetVolume()); /// G
TargetQMin = tstRslt.Qfrom(); /// H
TargetQPlus = tstRslt.Qto(); /// I
ErrLimitMin = Convert.ToInt32(tstRslt.ErrLimLo() + tstRslt.ErrLimMargin()); /// J
ErrLimitPlus = Convert.ToInt32(tstRslt.ErrLimHi() - tstRslt.ErrLimMargin()); /// K
TargetTempFrom = Convert.ToInt32(Double.Parse(string.Format("{0:F1}", tstRslt.TempLimLo()))); /// L
TargetTempTo = Convert.ToInt32(Double.Parse(string.Format("{0:F1}", tstRslt.TempLimHi()))); /// M
TargetPressFrom = 0; /// N
TargetPressTo = 16; /// O
MIDNumberName = tstRslt.RefFlowmeter(); /// P
MIDNumberValue = Double.Parse(string.Format("{0:F4}", Formulas.DistilledWaterDensityFromTemp(tstRslt.AmbTempMean))); /// Q [kg/m3] hustota vody pri teplote okolia z priemernej teploty okolia bez korekcie na realnu hustotu vody
COR = ((tstRslt.Components != null) ? tstRslt.Components.Scale : string.Empty); /// R
/// Ambient
TempAmbM = Double.Parse(string.Format("{0:F1}", Units.ConvertTo(Unit.C, tstRslt.AmbTempStart))); /// S [°C]
PressAmbM = Convert.ToInt32(Double.Parse(string.Format("{0:F0}", Units.ConvertTo(Unit.mbar, tstRslt.AmbPressStart)))); /// T [mbar]
HumidAmbM = Double.Parse(string.Format("{0:F1}", Units.ConvertTo(Unit.RPct, tstRslt.AmbHumiStart))); /// U [R%]
/// Pressure
PressUpME = Convert.ToInt32(Double.Parse(string.Format("{0:F0}", Units.ConvertTo(Unit.kPa, tstRslt.PressUpMean)))); /// V [kPa]
PressDwME = Convert.ToInt32(Double.Parse(string.Format("{0:F0}", Units.ConvertTo(Unit.kPa, tstRslt.PressDownMean)))); /// W [kPa]
PressDeME = Convert.ToInt32(Double.Parse(string.Format("{0:F1}", Units.ConvertTo(Unit.kPa, tstRslt.PressDeltaMean)))); /// X [kPa]
PressUpST = Convert.ToInt32(Double.Parse(string.Format("{0:F0}", Units.ConvertTo(Unit.kPa, tstRslt.PressUpStart)))); /// Y [kPa]
PressDwST = Convert.ToInt32(Double.Parse(string.Format("{0:F0}", Units.ConvertTo(Unit.kPa, tstRslt.PressDownStart)))); /// Z [kPa]
PressDES = Convert.ToInt32(Double.Parse(string.Format("{0:F1}", Units.ConvertTo(Unit.kPa, tstRslt.PressDeltaStart)))); /// AA [kPa]
PressUpEN = Convert.ToInt32(Double.Parse(string.Format("{0:F0}", Units.ConvertTo(Unit.kPa, tstRslt.PressUpEnd)))); /// AB [kPa]
PressDwEN = Convert.ToInt32(Double.Parse(string.Format("{0:F0}", Units.ConvertTo(Unit.kPa, tstRslt.PressDownEnd)))); /// AC [kPa]
PressDEE = Convert.ToInt32(Double.Parse(string.Format("{0:F1}", Units.ConvertTo(Unit.kPa, tstRslt.PressDeltaEnd)))); /// AD [kPa]
/// Temperature
TempUpME = (Units.ConvertTo(Unit.C, tstRslt.TempUpMean)); /// AE [°C]
TempDwME = (Units.ConvertTo(Unit.C, tstRslt.TempDownMean)); /// AF [°C]
TempDiME = (Units.ConvertTo(Unit.C, tstRslt.TempDivMean)); /// AG [°C]
TempLoME = (Units.ConvertTo(Unit.C, tstRslt.Custom1)); /// AH [°C] T hi mean
TempHiME = (Units.ConvertTo(Unit.C, tstRslt.Custom6)); /// AI [°C] T lo mean
TempUpST = (Units.ConvertTo(Unit.C, tstRslt.TempUpStart)); /// AJ [°C]
TempDwST = (Units.ConvertTo(Unit.C, tstRslt.TempDownStart)); /// AK [°C]
TempDiST = (Units.ConvertTo(Unit.C, tstRslt.TempDivStart)); /// AL [°C]
TempLoST = (Units.ConvertTo(Unit.C, tstRslt.Custom2)); /// AM [°C] T hi start
TempHiST = (Units.ConvertTo(Unit.C, tstRslt.Custom7)); /// AN [°C] T lo start
TempUpEN = (Units.ConvertTo(Unit.C, tstRslt.TempUpEnd)); /// AO [°C]
TempDwEN = (Units.ConvertTo(Unit.C, tstRslt.TempDownEnd)); /// AP [°C]
TempDiEN = (Units.ConvertTo(Unit.C, tstRslt.TempDivEnd)); /// AQ [°C]
TempLoEN = (Units.ConvertTo(Unit.C, tstRslt.Custom3)); /// AR [°C] T hi end
TempHiEN = (Units.ConvertTo(Unit.C, tstRslt.Custom8)); /// AS [°C] T lo end
/// Mass
MassStRaw = (tstRslt.MassStartRaw); /// AT [kg]
MassSt = (tstRslt.MassStart); /// AU [kg]
MassEnRaw = (tstRslt.MassEndRaw); /// AV [kg]
MassEn = (tstRslt.MassEnd); /// AW [kg]
Mass = (tstRslt.MassEnd - tstRslt.MassStart); /// AX [kg]
/// Density and buoyancy
RoWa = (tstRslt.DensityDiv); /// AY [kg/m3]
TempLnME = ((tstRslt.TempUpMean + tstRslt.TempDownMean) / 2); /// AZ [°C] Tline ... priemerna teplota v linii
RoWat = (tstRslt.DensityLine); /// BA [kg/m3]
RoAir = (tstRslt.MassOfEvapWater); /// BB [kg] mass of evaporated water
Kbuoyancy = (tstRslt.Batch.Buoyancy); /// BC Buoyancy: Sheet1 - X9
DensityOfSample = Convert.ToInt32(tstRslt.Batch.SampleDensity); /// BD
TTempRO = Convert.ToInt32(tstRslt.Batch.SampleTemp); /// BE
QMax = (tstRslt.FlowMax); /// BF pipe expansion: teraz vynechat
QMin = (tstRslt.FlowMin); /// BG [kg/h] Qm
QMean = (tstRslt.Flow); /// BH [l/h] Qv
Qctv = (tstRslt.VolumeCTV); /// BI [l] Vet .... komercne prava hodnota objemu - podla vahy
VolRI = (tstRslt.VolumeMaster); /// BJ [l] Velm ... objem podla etalonu (Prolonged: objem do vahy podla impulzov hradlovanych klapkou)
DivCorrection = (tstRslt.TestTimeCorrection); /// BK [s] test time correction (diverter correction)
/// (ori.) BK [l] Vmass .. objem podla druheho etalonu / prietokomeru pred tratou (teraz vynechavame)
T = (tstRslt.TestTime); /// BL [s]
ERelRef = (isVolumeMethod ? Formulas.ErrorFromVolumes(tstRslt.ConstMasterCorr, tstRslt.ConstMasterRaw) : tstRslt.ErrorMaster);
/// BM [%] Eelm .... chyba etalonu voci komercne pravej hodnote
KMind = Convert.ToInt32((tstRslt.ConstMasterRaw != 0) ? (1 / tstRslt.ConstMasterRaw) : 0); /// BO [pls/l] Const.MID .. konstanta etalonu
DiverterStartTime = Convert.ToInt32(Double.Parse(string.Format("{0:F0}", isDiverter ? 1000.0F * tstRslt.DiverterStart : 0))); /// BQ [ms] Diverter start time
DiverterEndTime = Convert.ToInt32(Double.Parse(string.Format("{0:F0}", isDiverter ? 1000.0F * tstRslt.DiverterEnd : 0))); /// BR [ms] Diverter end time
DiverterStartValeveOpenTime = Convert.ToInt32(Double.Parse(string.Format("{0:F0}", isStartStop ? 1000.0F * tstRslt.DiverterStart : 0))); /// BS [ms] Start valve open time
DiverterStartValeveCloseTime = Convert.ToInt32(Double.Parse(string.Format("{0:F0}", isStartStop ? 1000.0F * tstRslt.DiverterEnd : 0))); /// BT [ms] Start valve close time
TempUpMax = (tstRslt.TempUpMax); /// BU [°C]
TempDwMax = (tstRslt.TempDownMax); /// BV [°C]
TempUpMin = (tstRslt.TempUpMin); /// BW [°C]
TempDwMin = (tstRslt.TempDownMin); /// BX [°C]
TempT10 = (isPMaxTest ? tstRslt.TestTime : 0); /// BY [s] Duration of the pressure test
TempAmbEn = Double.Parse(string.Format("{0:F1}", Units.ConvertTo(Unit.C, tstRslt.AmbTempEnd))); /// BZ [°C]
PressAmbEn = Convert.ToInt32(Double.Parse(string.Format("{0:F0}", Units.ConvertTo(Unit.mbar, tstRslt.AmbPressEnd)))); /// CA [mbar]
HumAmbEn = Double.Parse(string.Format("{0:F1}", Units.ConvertTo(Unit.RPct, tstRslt.AmbHumiEnd))); /// CB [R%]
RefPulses = Convert.ToInt32(tstRslt.PulsesMaster); /// CC Celkovy pocet et. pulzov skusky (Prolonged : do vahy)
DiverterTestTimeCorrection = Convert.ToInt32(1000 * tstRslt.TestTimeCorrection); /// CD [ms] Diverter test time correction
BatchResults batchResults = BatchResults.FromBatch(tstRslt.Batch);
for (int i = 0; i < batchResults.WMPositionsCount; i++)
{
if (batchResults.Batch.WaterMeters != null &&
batchResults.Batch.WaterMeters.Count > i &&
batchResults.Batch.WaterMeters[i] != null &&
!batchResults.Batch.WaterMeters[i].Disabled)
{
ProcessDataMeterLine meterLine = new ProcessDataMeterLine(tstRslt, batchResults, i);
processDataMeterList.Add(meterLine);
}
}
}
}
}
-472
View File
@@ -1,472 +0,0 @@
using System;
using ClosedXML.Excel;
using Common;
using Results.Entities;
namespace Results.Uncertainty
{
public class ProcessDataMeterLine
{
public XLCellValue[] val = new XLCellValue[21];
/*public string SerNo; // "Diehl202415687905" , formatStr);//Position - Ser.No. - CE
public int VolMtSt; // 0 , formatInt);//Vol.Mt.st - CF
public int VolMtEn; // 0 , formatInt);//Vol.Mt.en - CG
public double VolMt; // 0.975333560911164 , formatD7);//Vol.Mt. - CH
public double VolRm; // 0.980633088, formatD7);//Vol.rm - CI
public double ERel; // -0.540418981321314 , formatD6); // E rel. - CJ
public int
IPerlCalibrationFactor; // , formatInt); // U - CK // CK iPerl calibration factor used during the test / ...
public int Pulses; // 154 , formatInt); //Pulses() - CL
public int RefPulsesNi; // 14341 , formatInt); //Ref pulses_ni() - CM
public double T; // 671.4207764 , formatD4); //T(s)()_ni -CN
public string Evaluation; // "OK" , formatStr);//evaluation - CO
public double PulsesL; // 157.8947 , formatD4);//Pulses/l - CP
public int ImpL; // 4 , formatInt);//imp/l - CQ
public int Div; // 0 , formatInt);//div - CR
public int VEnd; // 0 , formatInt);//Vend
public int TEnd; // 0 , formatInt);//T end
public string[] SmryItems = new string[5]; // - 0/// CU - 1/// CV - 2/// CW - 3/// CX - 4/// CY
*/
public ProcessDataMeterLine(TestRslt tstRslt, BatchResults batchResults, int wmNr0)
{
var wm = batchResults.Batch.WaterMeters[wmNr0];
var smryItems = DEItem.GetSummaryColumns();
{
if (!wm.Compound() && !wm.HeatMeter())
{
/// If this is a single meter
Results.Entities.MeterTestRslt mtrRslt =
batchResults.GetMeterTestRslt(tstRslt.Name(), wmNr0, CompoundMeterId.Single);
if (mtrRslt != null)
{
bool isCamera = (mtrRslt.RegReaderType == (int)RegisterReaderType.Camera);
val[0] = wm.SerialNr; /// CE WM Ser.No.
val[1] = mtrRslt
.VolumeStart; /// CF WM Vstart - pociatocny stav pri pevnom starte alebo zachyteny pri data streame
val[2] = mtrRslt
.VolumeEnd; /// CG WM Vend - konecny stav pri pevnom starte alebo zachyteny pri data streame
val[3] = mtrRslt.VolumeMeter; /// CH WM Vmer - objem namerany vodomerom
val[4] = mtrRslt.VolumeRef; /// CI WM Vref - objem namerany stanicou
val[5] = mtrRslt.Error; /// CJ WM Emt - chyba vodomerom nameraneho objemu
#if IPERL
val[6] = wm.CalibFactor; /// CK iPerl calibration factor used during the test / ...
#else
val[6] = 0; /// CK nechat prazdne
#endif
val[7] = Convert.ToInt32(mtrRslt
.PulsesMeter); /// CL WM Np met - pocet impulzov zo skusaneho meradla
val[8] = Convert.ToInt32(mtrRslt
.PulsesMaster); /// CM WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
val[9] = mtrRslt.TestTime; /// CN WM Tmet - cas merania (obmedzany pri synchro skuske)
val[10] = mtrRslt.Passed
? "OK"
: "NOK"; /// CO WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
#if IPERL
val[11] =
mtrRslt.WaterMeter.Q2CorrRL; /// CP iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
#else
val[11] = mtrRslt.PulsesPerLiter; /// CP Pulses per liter
#endif
val[12] = Convert.ToInt32(isCamera
? mtrRslt.VolumeStart * mtrRslt.PulsesPerLiter /// CQ WM Phi_start (pri hodnotach z kamery)
: wm.WMPosition); /// CQ WMPosition (normalne)
val[13] = Convert.ToInt32(isCamera
? mtrRslt.VolumeEnd * mtrRslt.PulsesPerLiter /// CR WM Phi_end (pri hodnotach z kamery)
: 0); /// CR not used/spare (normalne)
//TODO - Time start is in table as VEnd ??? check it
val[14] = Convert.ToInt32(mtrRslt.TimestampStart); /// CS WM Time_start - ' ' -
val[15] = Convert.ToInt32(mtrRslt.TimestampEnd); /// CT WM Time_end - ' ' -
//sb.Append(";"); sb.Append(isCamera ? mtrRslt.PulsesPerLiter : 0); /// CU camera: WM Degree per liter
val[16] = (smryItems.Count < 1 ? "0" : DEUtils.GetContent(smryItems[0].Content, wm)); /// CU
val[17] = (smryItems.Count < 2 ? "0" : DEUtils.GetContent(smryItems[1].Content, wm)); /// CV
val[18] = (smryItems.Count < 3 ? "0" : DEUtils.GetContent(smryItems[2].Content, wm)); /// CW
val[19] = (smryItems.Count < 4 ? "0" : DEUtils.GetContent(smryItems[3].Content, wm)); /// CX
val[20] = (smryItems.Count < 5 ? "0" : DEUtils.GetContent(smryItems[4].Content, wm)); /// CY
}
}
else if (wm.Compound())
{
/// Else if this is a compound meter
for (byte b = (byte)CompoundMeterId.CompoundMain; b <= (byte)CompoundMeterId.Compound; b++)
{
var mtrRslt = batchResults.GetMeterTestRslt(tstRslt.Name(), wmNr0, (CompoundMeterId)b);
if (mtrRslt != null)
{
int iIndex = 0;
switch ((CompoundMeterId)b)
{
case CompoundMeterId.CompoundMain:
val[0] = wm.SerialNr; /// CE
break;
case CompoundMeterId.CompoundAux:
val[0] = wm.SerialNrAux; /// CE
break;
case CompoundMeterId.Compound:
val[0] = wm.SerialNr; /// CE
break;
}
val[++iIndex] =
mtrRslt
.VolumeStart; /// CF WM Vinit - pri pevnom starte pociatocny stav natukany alebo cez inteligentny system
val[++iIndex] =
mtrRslt
.VolumeEnd; /// CG WM Vfin - pri pevnom starte konecny stav natukany alebo cez inteligentny system
val[++iIndex] = mtrRslt.VolumeMeter; /// CH WM Vmer - objem namerany vodomerom
val[++iIndex] = mtrRslt.VolumeRef; /// CI WM Vet - objem namerany stanicou
val[++iIndex] = mtrRslt.Error; /// CJ WM Emt - chyba vodomerom nameraneho objemu
val[++iIndex] = 0; /// CK WM U - neistota (zatial nechat prazdne)
val[++iIndex] = mtrRslt.PulsesMeter; /// CL WM Np met - pocet impulzov zo skusaneho meradla
val[++iIndex] =
mtrRslt
.PulsesMaster; /// CM WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
val[++iIndex] =
mtrRslt.TestTime; /// CN WM Tmet - cas merania (obmedzany pri synchro skuske)
val[++iIndex] =
mtrRslt.Passed
? "OK"
: "NOK"; /// CO WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
val[++iIndex] = " "; /// CP WM AN value - hodnota z analogoveho prevodnika (teraz nic)
bool isCamera = mtrRslt.IsCamera();
val[++iIndex] = (isCamera
? mtrRslt.VolumeStart *
mtrRslt.PulsesPerLiter /// CQ WM Phi_start (pri hodnotach z kamery)
: wm.WMPosition); /// CQ WMPosition (normalne)
val[++iIndex] = (isCamera
? mtrRslt.VolumeEnd * mtrRslt.PulsesPerLiter /// CR WM Phi_end (pri hodnotach z kamery)
: 0); /// CR not used/spare (normalne)
val[++iIndex] = (isCamera ? mtrRslt.TimestampStart : 0); /// CS WM Time_start - ' ' -
val[++iIndex] = (isCamera ? mtrRslt.TimestampEnd : 0); /// CT WM Time_end - ' ' -
val[++iIndex] = (isCamera ? mtrRslt.PulsesPerLiter : 0); /// CU WM Degree per liter
val[++iIndex] = "0"; /// CV Analog out 1 (max mA)
val[++iIndex] = "0"; /// CW Analog out 2 (V)
val[++iIndex] = "0"; /// CX Analog out 3 (min mA)
val[++iIndex] = "0"; /// CY Analog out 4 (max Q)
}
}
}
else /// if (ProcessData.BatchRslts.WaterMeters[i].HeatMeter())
{
/// Else this is a heat meter
var volumeMtr =
batchResults.GetMeterTestRslt(tstRslt.Name(), wmNr0, CompoundMeterId.HeatMeterVolume);
var energyMtr =
batchResults.GetMeterTestRslt(tstRslt.Name(), wmNr0, CompoundMeterId.HeatMeterEnergy);
if (volumeMtr != null)
{
int iIndex = 0;
val[iIndex] = wm.SerialNr; /// WM Ser.No.
val[iIndex] =
volumeMtr
.VolumeStart; /// WM Vstart - pociatocny stav pri pevnom starte alebo zachyteny pri data streame
val[iIndex] =
volumeMtr
.VolumeEnd; /// WM Vend - konecny stav pri pevnom starte alebo zachyteny pri data streame
val[iIndex] = volumeMtr.VolumeMeter; /// WM Vmer - objem namerany vodomerom
val[iIndex] = volumeMtr.VolumeRef; /// WM Vref - objem namerany stanicou
val[iIndex] = volumeMtr.Error; /// WM Emt - chyba vodomerom nameraneho objemu
#if IPERL
val[iIndex] = wm.CalibFactor; /// iPerl calibration factor used during the test / ...
#else
val[iIndex] = 0; /// nechat prazdne
#endif
val[iIndex] = volumeMtr.PulsesMeter; /// WM Np met - pocet impulzov zo skusaneho meradla
val[iIndex] =
volumeMtr
.PulsesMaster; /// WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
val[iIndex] = volumeMtr.TestTime; /// WM Tmet - cas merania (obmedzany pri synchro skuske)
val[iIndex] =
volumeMtr.Passed ? "OK" : "NOK"; /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
#if IPERL
val[iIndex] =
(volumeMtr.WaterMeter.Q2CorrRL); /// iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
#else
val[iIndex] = " "; /// nechat prazdne
#endif
val[iIndex] =
(volumeMtr.VolumeStart); /// WM Volume_start - pri datastreamovych hodnotach (alebo kamera)
val[iIndex] = (volumeMtr.TimestampStart); /// WM Time_start - ' ' -
val[iIndex] = (volumeMtr.VolumeEnd); /// WM Volume_end - ' ' -
val[iIndex] = (volumeMtr.TimestampEnd); /// WM Time_end - ' ' -
}
if (energyMtr != null)
{
int iIndex = 0;
val[iIndex] = (wm.SerialNr); /// WM Ser.No.
val[iIndex] =
(energyMtr
.VolumeStart); /// WM Vstart - pociatocny stav pri pevnom starte alebo zachyteny pri data streame
val[iIndex] =
(energyMtr
.VolumeEnd); /// WM Vend - konecny stav pri pevnom starte alebo zachyteny pri data streame
val[iIndex] = (energyMtr.VolumeMeter); /// WM Vmer - objem namerany vodomerom
val[iIndex] = (energyMtr.VolumeRef); /// WM Vref - objem namerany stanicou
val[iIndex] = (energyMtr.Error); /// WM Emt - chyba vodomerom nameraneho objemu
#if IPERL
val[iIndex] = wm.CalibFactor; /// iPerl calibration factor used during the test / ...
#else
val[iIndex] = " "; /// nechat prazdne
#endif
val[iIndex] = (energyMtr.PulsesMeter); /// WM Np met - pocet impulzov zo skusaneho meradla
val[iIndex] =
(energyMtr
.PulsesMaster); /// WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
val[iIndex] = (energyMtr.TestTime); /// WM Tmet - cas merania (obmedzany pri synchro skuske)
val[iIndex] =
(energyMtr.Passed ? "OK" : "NOK"); /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
#if IPERL
val[iIndex] =
energyMtr.WaterMeter.Q2CorrRL; /// iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
#else
val[iIndex] = " "; /// nechat prazdne
#endif
val[iIndex] =
energyMtr.VolumeStart; /// WM Volume_start - pri datastreamovych hodnotach (alebo kamera)
val[iIndex] = energyMtr.TimestampStart; /// WM Time_start - ' ' -
val[iIndex] = energyMtr.VolumeEnd; /// WM Volume_end - ' ' -
val[iIndex] = energyMtr.TimestampEnd; /// WM Time_end - ' ' -
}
}
}
}
// public void ProcessDataMeterLine2(TestRslt tstRslt, WaterMeter wm, BatchResults batchResults, int wmNr0)
// {
// var smryItems = DEItem.GetSummaryColumns();
// {
//
//
// if (!wm.Compound() && !wm.HeatMeter())
// {
// /// If this is a single meter
//
// Results.Entities.MeterTestRslt mtrRslt = batchResults.GetMeterTestRslt(tstRslt.Name(), wmNr0, CompoundMeterId.Single);
//
// if (mtrRslt != null)
// {
// bool isCamera = (mtrRslt.RegReaderType == (int)RegisterReaderType.Camera);
//
// SerNo = wm.SerialNr;/// CE WM Ser.No.
// VolMtSt = mtrRslt.VolumeStart; /// CF WM Vstart - pociatocny stav pri pevnom starte alebo zachyteny pri data streame
// VolMtEn = mtrRslt.VolumeEnd; /// CG WM Vend - konecny stav pri pevnom starte alebo zachyteny pri data streame
// VolMt = mtrRslt.VolumeMeter; /// CH WM Vmer - objem namerany vodomerom
// VolRm = mtrRslt.VolumeRef; /// CI WM Vref - objem namerany stanicou
// ERel = mtrRslt.Error; /// CJ WM Emt - chyba vodomerom nameraneho objemu
// #if IPERL
// IPerlCalibrationFactor = wm.CalibFactor; /// CK iPerl calibration factor used during the test / ...
// #else
// IPerlCalibrationFactor = 0; /// CK nechat prazdne
// #endif
// Pulses = Convert.ToInt32(mtrRslt.PulsesMeter); /// CL WM Np met - pocet impulzov zo skusaneho meradla
// RefPulsesNi = Convert.ToInt32(mtrRslt.PulsesMaster); /// CM WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
// T = mtrRslt.TestTime; /// CN WM Tmet - cas merania (obmedzany pri synchro skuske)
// Evaluation = mtrRslt.Passed ? "OK" : "NOK"; /// CO WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
// #if IPERL
// PulsesL = mtrRslt.WaterMeter.Q2CorrRL; /// CP iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
// #else
// PulsesL = mtrRslt.PulsesPerLiter; /// CP Pulses per liter
// #endif
// ImpL = Convert.ToInt32(isCamera
// ? mtrRslt.VolumeStart * mtrRslt.PulsesPerLiter /// CQ WM Phi_start (pri hodnotach z kamery)
// : wm.WMPosition); /// CQ WMPosition (normalne)
// Div = Convert.ToInt32(isCamera
// ? mtrRslt.VolumeEnd * mtrRslt.PulsesPerLiter /// CR WM Phi_end (pri hodnotach z kamery)
// : 0); /// CR not used/spare (normalne)
//
// //TODO - Time start is in table as VEnd ??? check it
// VEnd = Convert.ToInt32(mtrRslt.TimestampStart); /// CS WM Time_start - ' ' -
// TEnd = Convert.ToInt32(mtrRslt.TimestampEnd); /// CT WM Time_end - ' ' -
//
// //sb.Append(";"); sb.Append(isCamera ? mtrRslt.PulsesPerLiter : 0); /// CU camera: WM Degree per liter
// SmryItems[0] = (smryItems.Count < 1 ? "0" : DEUtils.GetContent(smryItems[0].Content, wm)); /// CU
// SmryItems[1] = (smryItems.Count < 2 ? "0" : DEUtils.GetContent(smryItems[1].Content, wm)); /// CV
// SmryItems[2] = (smryItems.Count < 3 ? "0" : DEUtils.GetContent(smryItems[2].Content, wm)); /// CW
// SmryItems[3] = (smryItems.Count < 4 ? "0" : DEUtils.GetContent(smryItems[3].Content, wm)); /// CX
// SmryItems[4] = (smryItems.Count < 5 ? "0" : DEUtils.GetContent(smryItems[4].Content, wm)); /// CY
// }
// }
// else if (wm.Compound())
// {
// /// Else if this is a compound meter
//
// for (byte b = (byte)CompoundMeterId.CompoundMain; b <= (byte)CompoundMeterId.Compound; b++)
// {
// var mtrRslt = batchResults.GetMeterTestRslt(tstRslt.Name(), wmNr0, (CompoundMeterId)b);
//
// if (mtrRslt != null)
// {
// switch ((CompoundMeterId)b)
// {
// case CompoundMeterId.CompoundMain:
// SerNo = wm.SerialNr; /// CE
// break;
// case CompoundMeterId.CompoundAux:
// SerNo = wm.SerialNrAux; /// CE
// break;
// case CompoundMeterId.Compound:
// SerNo = wm.SerialNr; /// CE
// break;
// }
// VolMtSt = mtrRslt.VolumeStart; /// CF WM Vinit - pri pevnom starte pociatocny stav natukany alebo cez inteligentny system
// VolMtEn = mtrRslt.VolumeEnd; /// CG WM Vfin - pri pevnom starte konecny stav natukany alebo cez inteligentny system
// VolMt = mtrRslt.VolumeMeter; /// CH WM Vmer - objem namerany vodomerom
// VolRm = mtrRslt.VolumeRef; /// CI WM Vet - objem namerany stanicou
// ERel = mtrRslt.Error; /// CJ WM Emt - chyba vodomerom nameraneho objemu
// IPerlCalibrationFactor = 0; /// CK WM U - neistota (zatial nechat prazdne)
// Pulses = mtrRslt.PulsesMeter; /// CL WM Np met - pocet impulzov zo skusaneho meradla
// RefPulsesNi = mtrRslt.PulsesMaster; /// CM WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
// T = mtrRslt.TestTime; /// CN WM Tmet - cas merania (obmedzany pri synchro skuske)
// Evaluation = mtrRslt.Passed ? "OK" : "NOK"; /// CO WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
// PulsesL = 0;//" " /// CP WM AN value - hodnota z analogoveho prevodnika (teraz nic)
//
// bool isCamera = mtrRslt.IsCamera();
// ImpL = (isCamera
// ? mtrRslt.VolumeStart * mtrRslt.PulsesPerLiter /// CQ WM Phi_start (pri hodnotach z kamery)
// : wm.WMPosition); /// CQ WMPosition (normalne)
// Div = (isCamera
// ? mtrRslt.VolumeEnd * mtrRslt.PulsesPerLiter /// CR WM Phi_end (pri hodnotach z kamery)
// : 0); /// CR not used/spare (normalne)
// VEnd = (isCamera ? mtrRslt.TimestampStart : 0); /// CS WM Time_start - ' ' -
// TEnd = (isCamera ? mtrRslt.TimestampEnd : 0); /// CT WM Time_end - ' ' -
// SmryItems[0] = (isCamera ? mtrRslt.PulsesPerLiter : 0); /// CU WM Degree per liter
//
// SmryItems[1] = "0"; /// CV Analog out 1 (max mA)
// SmryItems[2] = "0"; /// CW Analog out 2 (V)
// SmryItems[3] = "0"; /// CX Analog out 3 (min mA)
// SmryItems[4] = "0"; /// CY Analog out 4 (max Q)
// }
// }
// }
// else /// if (ProcessData.BatchRslts.WaterMeters[i].HeatMeter())
// {
// /// Else this is a heat meter
//
// var volumeMtr = batchResults.GetMeterTestRslt(tstRslt.Name(), wmNr0, CompoundMeterId.HeatMeterVolume);
// var energyMtr = batchResults.GetMeterTestRslt(tstRslt.Name(), wmNr0, CompoundMeterId.HeatMeterEnergy);
//
// if (volumeMtr != null)
// {
// SerNo = wm.SerialNr; /// WM Ser.No.
// VolMtSt = volumeMtr.VolumeStart; /// WM Vstart - pociatocny stav pri pevnom starte alebo zachyteny pri data streame
// VolMtEn = volumeMtr.VolumeEnd; /// WM Vend - konecny stav pri pevnom starte alebo zachyteny pri data streame
// VolMt = volumeMtr.VolumeMeter; /// WM Vmer - objem namerany vodomerom
// VolRm = volumeMtr.VolumeRef; /// WM Vref - objem namerany stanicou
// ERel = volumeMtr.Error; /// WM Emt - chyba vodomerom nameraneho objemu
// #if IPERL
// IPerlCalibrationFactor = wm.CalibFactor; /// iPerl calibration factor used during the test / ...
// #else
// IPerlCalibrationFactor = 0; /// nechat prazdne
// #endif
// Pulses = volumeMtr.PulsesMeter; /// WM Np met - pocet impulzov zo skusaneho meradla
// RefPulsesNi = volumeMtr.PulsesMaster; /// WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
// T = volumeMtr.TestTime; /// WM Tmet - cas merania (obmedzany pri synchro skuske)
// Evaluation = volumeMtr.Passed ? "OK" : "NOK"); /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
// #if IPERL
// ImpL = (volumeMtr.WaterMeter.Q2CorrRL); /// iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
// #else
// ImpL = 0; //(" "); /// nechat prazdne
// #endif
// ImpL = (volumeMtr.VolumeStart); /// WM Volume_start - pri datastreamovych hodnotach (alebo kamera)
// VEnd = (volumeMtr.TimestampStart); /// WM Time_start - ' ' -
// VolMtEn = (volumeMtr.VolumeEnd); /// WM Volume_end - ' ' -
// TEnd = (volumeMtr.TimestampEnd); /// WM Time_end - ' ' -
// }
//
// if (energyMtr != null)
// {
// SerNo = (wm.SerialNr); /// WM Ser.No.
// VolMtSt = (energyMtr.VolumeStart); /// WM Vstart - pociatocny stav pri pevnom starte alebo zachyteny pri data streame
// VolMtEn = (energyMtr.VolumeEnd); /// WM Vend - konecny stav pri pevnom starte alebo zachyteny pri data streame
// VolMt = (energyMtr.VolumeMeter); /// WM Vmer - objem namerany vodomerom
// VolRm = (energyMtr.VolumeRef); /// WM Vref - objem namerany stanicou
// ERel = (energyMtr.Error); /// WM Emt - chyba vodomerom nameraneho objemu
// #if IPERL
// IPerlCalibrationFactor = wm.CalibFactor; /// iPerl calibration factor used during the test / ...
// #else
// IPerlCalibrationFactor = 0;//(" "); /// nechat prazdne
// #endif
// Pulses = (energyMtr.PulsesMeter); /// WM Np met - pocet impulzov zo skusaneho meradla
// RefPulsesNi = (energyMtr.PulsesMaster); /// WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
// T = (energyMtr.TestTime); /// WM Tmet - cas merania (obmedzany pri synchro skuske)
// Evaluation = (energyMtr.Passed ? "OK" : "NOK"); /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
// #if IPERL
// sb.Append(";"); sb.Append(energyMtr.WaterMeter.Q2CorrRL); /// iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
// #else
// sb.Append(";"); sb.Append(" "); /// nechat prazdne
// #endif
// VolMtSt = (energyMtr.VolumeStart); /// WM Volume_start - pri datastreamovych hodnotach (alebo kamera)
// VEnd = (energyMtr.TimestampStart); /// WM Time_start - ' ' -
// VolMtEn = (energyMtr.VolumeEnd); /// WM Volume_end - ' ' -
// TEnd = (energyMtr.TimestampEnd); /// WM Time_end - ' ' -
// }
// }
// }
// }
public ProcessDataMeterLine()
{
}
/* public void InitDefault()
{
SerNo = "Diehl202415687905"; // , formatStr);//Position - Ser.No. - CE
VolMtSt = 0; // , formatInt);//Vol.Mt.st - CF
VolMtEn = 0; // , formatInt);//Vol.Mt.en - CG
VolMt = 0.975333560911164; // , formatD7);//Vol.Mt. - CH
VolRm = 0.980633088; //, formatD7);//Vol.rm - CI
ERel = -0.540418981321314; // , formatD6); // E rel. - CJ
// , formatInt); // U - CK
Pulses = 154; // , formatInt); //Pulses() -
RefPulsesNi = 14341; // , formatInt); //Ref pulses_ni()
T = 671.4207764; // , formatD4); //T(s)()_ni
Evaluation = "OK"; // , formatStr);//evaluation
PulsesL = 157.8947; // , formatD4);//Pulses/l - CP
ImpL = 4; // , formatInt);//imp/l
Div = 0; // , formatInt);//div
VEnd = 0; // , formatInt);//Vend
TEnd = 0; // , formatInt);//T end
}*/
public void InitDefault()
{
val[0] = "Diehl202415687905"; // , formatStr);//Position - Ser.No. - CE
val[1] = 0; // , formatInt);//Vol.Mt.st - CF
val[2] = 0; // , formatInt);//Vol.Mt.en - CG
val[3] = 0.975333560911164; // , formatD7);//Vol.Mt. - CH
val[4] = 0.980633088; //, formatD7);//Vol.rm - CI
val[5] = -0.540418981321314; // , formatD6); // E rel. - CJ
// , formatInt); // U - CK
val[6] = 154; // , formatInt); //Pulses() -
val[7] = 14341; // , formatInt); //Ref pulses_ni()
val[8] = 671.4207764; // , formatD4); //T(s)()_ni
val[9] = "OK"; // , formatStr);//evaluation
val[10] = 157.8947; // , formatD4);//Pulses/l - CP
val[11] = 4; // , formatInt);//imp/l
val[12] = 0; // , formatInt);//div
val[13] = 0; // , formatInt);//Vend
val[14] = 0; // , formatInt);//T end
}
}
}
-10
View File
@@ -577,16 +577,6 @@ namespace Results
{
return FormatInt(f, w.Batch.Counter10);
}));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty_DIV1, "Uncertainty DIV1", Quantity.Uncertainty, ItemCategory.BenchData, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? "0.1" : string.Format(f, 5)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty_DIV2, "Uncertainty DIV2", Quantity.Uncertainty, ItemCategory.BenchData, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? "0.2" : string.Format(f, 5)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty_DIV3, "Uncertainty DIV3", Quantity.Uncertainty, ItemCategory.BenchData, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? "0.3" : string.Format(f, 5)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty_DIV4, "Uncertainty DIV4", Quantity.Uncertainty, ItemCategory.BenchData, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? "0.4" : string.Format(f, 5)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty_DIV5, "Uncertainty DIV5", Quantity.Uncertainty, ItemCategory.BenchData, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? "0.5" : string.Format(f, 5)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty_TEMP1, "Uncertainty TEMP1", Quantity.Uncertainty, ItemCategory.BenchData, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? "0.5" : string.Format(f, 5)));
}
/// To be updated by Output.FileWriter or Output.Printer
-16
View File
@@ -1,20 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ClosedXML" version="0.105.0-rc" targetFramework="net472" />
<package id="ClosedXML.Parser" version="2.0.0-preview1" targetFramework="net472" />
<package id="SixLabors.Fonts" version="1.0.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.1" targetFramework="net472" />
<package id="DocumentFormat.OpenXml" version="3.1.1" targetFramework="net472" />
<package id="DocumentFormat.OpenXml.Framework" version="3.1.1" targetFramework="net472" />
<package id="EPPlus.Interfaces" version="8.0.0" targetFramework="net472" />
<package id="ExcelNumberFormat" version="1.1.0" targetFramework="net472" />
<package id="Microsoft.Bcl.HashCode" version="1.1.1" targetFramework="net472" />
<package id="Microsoft.IO.RecyclableMemoryStream" version="3.0.1" targetFramework="net472" />
<package id="RBush.Signed" version="4.0.0" targetFramework="net472" />
<package id="System.Buffers" version="4.6.1" targetFramework="net472" />
<package id="System.ComponentModel.Annotations" version="5.0.0" targetFramework="net472" />
<package id="System.Memory" version="4.6.2" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net472" />
<package id="System.Security.Cryptography.Xml" version="8.0.2" targetFramework="net472" />
<package id="log4net" version="2.0.15" targetFramework="net472" />
</packages>
+39 -35
View File
@@ -1,25 +1,36 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAssert_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fd08b5425b14a4a129bfa8e447a81395e12190_003Fae_003F94d308d8_003FAssert_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AControl_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fbb93580b829e4f7d9c8d742286f27f7d5b8648_003F2d_003F54df0719_003FControl_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AICollection_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4290c01eea7748b3aa477ca831e6a387531830_003F80_003Fe38b444d_003FICollection_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ALoader_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F8210282bc4024c02ab1c8fa84c45a21e32a600_003F0d_003F48a17bd3_003FLoader_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATabControl_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fbb93580b829e4f7d9c8d742286f27f7d5b8648_003F0e_003F5c4249c2_003FTabControl_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATestMethodInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4472e9d6a19b4c92bcc9a80bd60ca17d26da8_003Fad_003F4c8a6929_003FTestMethodInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAssert_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fd08b5425b14a4a129bfa8e447a81395e12190_003F4e_003F763c73b7_003FAssert_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AComponent_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fc0c221501f3a41f8ac0af9d6a9dc9ff335fd90_003F1c_003F3d03a130_003FComponent_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AContainerControl_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F32c22f7c1b7049ccad5f07031bb43bf35b8590_003Fb3_003F54768651_003FContainerControl_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AControl_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F32c22f7c1b7049ccad5f07031bb43bf35b8590_003F01_003F35d9c974_003FControl_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AEnum_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4290c01eea7748b3aa477ca831e6a387531830_003F96_003F1b5cc389_003FEnum_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AExecutionContextSwitcher_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4290c01eea7748b3aa477ca831e6a387531830_003F78_003Fabacf9b6_003FExecutionContextSwitcher_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFileDialog_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F32c22f7c1b7049ccad5f07031bb43bf35b8590_003Fe6_003F4ece5b68_003FFileDialog_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AGetChildAtPointSkip_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F32c22f7c1b7049ccad5f07031bb43bf35b8590_003F63_003F931a2e4f_003FGetChildAtPointSkip_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIList_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4290c01eea7748b3aa477ca831e6a387531830_003F6e_003Fc16f1098_003FIList_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AILog_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9c853b67fc2341bf8af0d999ea188b6a42000_003Ff4_003F27b3d1bb_003FILog_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AImage_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F1af41839925b4409b823837d7b5f29d691940_003Fcc_003Fba3dfabe_003FImage_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJsonConvert_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F43b5ed322493bdcdb2e73ba6f9808f93c7c41fdf_003FJsonConvert_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AList_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4290c01eea7748b3aa477ca831e6a387531830_003F92_003Fe3eb9ff2_003FList_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANetworkStream_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fc0c221501f3a41f8ac0af9d6a9dc9ff335fd90_003F78_003Fdc4af641_003FNetworkStream_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARotateFlipType_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F1af41839925b4409b823837d7b5f29d691940_003F3b_003Ff7d64930_003FRotateFlipType_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AStreamReader_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4290c01eea7748b3aa477ca831e6a387531830_003Fb8_003Fd3bcd2f1_003FStreamReader_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AStreamWriter_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4290c01eea7748b3aa477ca831e6a387531830_003F2e_003F8ad77ef0_003FStreamWriter_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AStringWriter_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F3020f90f960f433086d545c4e07afdfd531820_003F00_003F5212e7ed_003FStringWriter_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATaskFactory_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4290c01eea7748b3aa477ca831e6a387531830_003Fe5_003Fa31e7ef9_003FTaskFactory_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATask_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4290c01eea7748b3aa477ca831e6a387531830_003F9a_003F1a93d99e_003FTask_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATask_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9c2967a135e648bdb993c5397a44991b573620_003Fa3_003F820cf97f_003FTask_00601_002Ecs_002Fz_003A2_002D1/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATcpClient_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fc0c221501f3a41f8ac0af9d6a9dc9ff335fd90_003Fdb_003Fe9bb8972_003FTcpClient_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATestMethodInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4472e9d6a19b4c92bcc9a80bd60ca17d26da8_003F98_003F3ffb6d31_003FTestMethodInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9c2967a135e648bdb993c5397a44991b573620_003Fd7_003F14d417af_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AUserControl_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fbb93580b829e4f7d9c8d742286f27f7d5b8648_003Fa3_003F8eb63727_003FUserControl_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AXLRangeBase_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fb48983f97d522ed19b681bf6f133c9baafae03ce9d864ed711a5aa8752bf_003FXLRangeBase_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AXLWorksheet_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F95dc236c6854d515fec2d9794746c52171e52b19e7f2ca0fcc6a6636bb4ed18_003FXLWorksheet_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AXmlSerializer_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9e4992465ee24dc8915fd9be20badb7d281d48_003F5e_003F4df5856e_003FXmlSerializer_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue">&lt;AssemblyExplorer&gt;&#xD;
&lt;Assembly Path="C:\Users\micha\git\tbf\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll" /&gt;&#xD;
&lt;/AssemblyExplorer&gt;</s:String>
<s:String x:Key="/Default/Environment/Hierarchy/Build/BuildTool/CustomBuildToolPath/@EntryValue">C:\Program Files\JetBrains\JetBrains Rider 2024.1.6\tools\MSBuild\Current\Bin\amd64\MSBuild.exe</s:String>
<s:Int64 x:Key="/Default/Environment/Hierarchy/Build/BuildTool/MsbuildVersion/@EntryValue">1114112</s:Int64>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThread_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4290c01eea7748b3aa477ca831e6a387531830_003F06_003Fbeac08f5_003FThread_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4290c01eea7748b3aa477ca831e6a387531830_003F67_003F5737ad8a_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AUdpClient_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fc0c221501f3a41f8ac0af9d6a9dc9ff335fd90_003Fdb_003Fe89b26d3_003FUdpClient_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AUserControl_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F32c22f7c1b7049ccad5f07031bb43bf35b8590_003Fc3_003F7d8608ff_003FUserControl_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AXmlReflectionImporter_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9e4992465ee24dc8915fd9be20badb7d281d48_003F14_003Ffe12756e_003FXmlReflectionImporter_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003A_005F_005FError_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4290c01eea7748b3aa477ca831e6a387531830_003Ffa_003Fa44fa010_003F_005F_005FError_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:Boolean x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/ShowAdvancedOptions/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/TestProjectMapping/=743DF7DB_002DC7B6_002D42EB_002D986D_002D0F485E5588E4/@EntryIndexedValue">77EB589F-C670-4489-AAD6-2A3C02061FD1</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/TestProjectMapping/=8648FD92_002DCDA1_002D4C3A_002DB5F9_002DFE547CE1FA48/@EntryIndexedValue">77EB589F-C670-4489-AAD6-2A3C02061FD1</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/TestProjectMapping/=9D0DCC88_002DDC81_002D47EB_002D9FDD_002D4C3907871BFB/@EntryIndexedValue">77EB589F-C670-4489-AAD6-2A3C02061FD1</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/TestTemplateMapping/=MSTest/@EntryIndexedValue">d6790ab7-33c2-4425-b2c9-51480cd1a852</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=311ca613_002Da634_002D4e0f_002Db9fb_002D4b7af9b7abb2/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="GetCorrection" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;TestAncestor&gt;&#xD;
@@ -27,25 +38,17 @@
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Modbus.Meret.AdjustableScale.AdjustableMeterTest.GetCorrection&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.KeyenceIV3G120.CameraTest.RtpListener&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.KeyenceIV3G120.CameraTest.Initialize&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.RigUncertaintyTest.OpenDocument_SuccessfullyOpensDocument_RaisesNoExceptions&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Uncertainty.Calculation.MathTest.AritmeticMeanTest&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Uncertainty.Calculation.BatchProcessTableTest&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Uncertainty.Calculation.CalculationTableTest&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Uncertainty.CommonTable.TableTest.CrateTableTest&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.CJMS11.CameraTest.Initialize&lt;/TestId&gt;&#xD;
&lt;/TestAncestor&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=fee81c72_002D0b13_002D439c_002D8921_002D12878bb8cd86/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="Initialize" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;TestAncestor&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.KeyenceIV3G120.CameraTest.Initialize&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.RigUncertaintyTest.OpenDocument_SuccessfullyOpensDocument_RaisesNoExceptions&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.RigUncertaintyTest.OpenDocument_Sheets&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.RigUncertaintyTest.OpenDocument_Sheets_InsertValues&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.RigUncertaintyTest.ExcelColumnsTools&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.RigUncertaintyTest&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Uncertainty.Calculation.MathTest&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Uncertainty.CommonTable.TableTest.CrateTableTest&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Uncertainty.CommonTable.TableTest.CrateTableOnPositionTest&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.CJMS11.CameraTest.Initialize&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.CJMS11.CameraTest.Initialize_TwoCamerasInParallel&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.CJMS11.CameraTest.Initialize_TwoCamerasInParallelAsync&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.CJMS11.CameraTest&lt;/TestId&gt;&#xD;
&lt;/TestAncestor&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=Config_002FResources_002FStrings/@EntryIndexedValue">False</s:Boolean>
@@ -53,12 +56,16 @@
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=Miscellaneous_0020Files_002FWyqupug/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FResources_002FStrings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FResources_002FStrings/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FDataEntry_002FStandartCameraPurchaseOrder_002FCycleBeginningForm/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FDataEntry_002FStandartCameraPurchaseOrder_002FCycleEndForm/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FDataEntry_002FStandartCameraPurchaseOrder_002FTestStartEndForm/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FAdapterFTP_002FNetadapterCfgCtrl/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FCJMS11_002FCameraCfgCtrl/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FCJMS11_002FTerminalDlg/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FKeyenceIV3G120_002FCameraCfgCtrl/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FRoiForFixedStartCJMS11_002FRoiCfgCtrl/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FRoiForFixedStartKeyence_002FRoiCfgCtrl/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FRestAPI_002FRestApiCfgCtrl/@EntryIndexedValue">False</s:Boolean>
@@ -67,9 +74,6 @@
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FRegisterReaders_002FFrequencyMeterFromUniCB_002FRRCfgCtrl/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FUI_002FBench_002FComponents_002FComponentsManagerDlg/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FUI_002FBench_002FMetrology_002FCalibCertificateExtendedCtrl/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FUI_002FBench_002FMetrology_002FMetrologyDlgAdjustableScaleTab/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FUI_002FBench_002FMetrology_002FMetrologyDlgAdjustableScaleTab/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FUI_002FBench_002FMetrology_002FMetrologyDlgPressMeterTab/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FUI_002FBench_002FMetrology_002FMetrologyDlgTempMeterTab/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FUI_002FResultsMI_002FPreviousResultsDlgUncertainty/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/Initialized/@EntryValue">True</s:Boolean></wpf:ResourceDictionary>
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.9.2144.1")]
[assembly: AssemblyFileVersion("3.9.2144.1")]
[assembly: AssemblyVersion("3.9.2145.4")]
[assembly: AssemblyFileVersion("3.9.2145.4")]
-14
View File
@@ -1,14 +0,0 @@
# Information about new inserted functionality
## Version
Document start on version `3.9.2144.1`
### v3.9.2144 Uncertainty
#### Database update
```
use wrc2swindon298;
alter table measurementcorrection add Uncertainty float null;
alter table measurementcorrection add Readability float null;
```
-9
View File
@@ -4622,15 +4622,6 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Readability.
/// </summary>
internal static string Readability {
get {
return ResourceManager.GetString("Readability", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Reading from the production tracing DB failed.
/// </summary>
-3
View File
@@ -2050,9 +2050,6 @@
<data name="Uncertainty" xml:space="preserve">
<value>Uncertainty</value>
</data>
<data name="Readability" xml:space="preserve">
<value>Readability</value>
</data>
<data name="No_info_available" xml:space="preserve">
<value>No info available</value>
</data>
@@ -30,11 +30,9 @@ namespace TBF.Rig.DataContainer.Buoyancy
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
/// Private parameterless constructor invoked by all other (public) constructors
ComponentCfg() {}
public ComponentCfg(string name, IComponentFactory factory)
@@ -31,11 +31,9 @@ namespace TBF.Rig.DataContainer.Density
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
/// Private parameterless constructor invoked by all other (public) constructors
ComponentCfg() {}
public ComponentCfg(string name, IComponentFactory factory)
@@ -24,8 +24,6 @@ namespace TBF.Rig.DataContainer.Evaporation
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
@@ -56,11 +56,9 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
/// Private parameterless constructor invoked by all other (public) constructors
ComponentCfg() {}
public ComponentCfg(string name, IComponentFactory factory)
@@ -480,7 +480,7 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
}
else
{
Console.WriteLine("The selected item is not a number.");
Console.WriteLine(@"The selected item is not a number.");
}
}
}
@@ -302,11 +302,27 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
if (nrLines == 1)
{
Width = 1040;
startLabel2.Visible = false;
endLabel2.Visible = false;
}
else
{
Width = 1420;
}
OkButtonPosition();
}
void OkButtonPosition()
{
if (okButton.Location.X > Width)
{
int margin = 5;
okButton.Location = new Point(
this.ClientSize.Width - okButton.Width - margin,
okButton.Location.Y
);
}
}
/// <summary>
-3
View File
@@ -15,8 +15,5 @@ namespace TBF.Rig.GenericDevices
string CertPath { get; set; } /// Path to a calibration certificate PDF document
DateTime CalibDate { get; set; } /// Date of calibration
DateTime CalibValidDate { get; set; } /// Calibration is valid until (date)
///
string MeterSerialNo { get; set; } /// Serial number of the meter
string MeterType { get; set; } /// Type of the meter
}
}
@@ -23,9 +23,6 @@ namespace TBF.Rig.GenericDevices
string GetCertPath(int rangeIx1); /// Get path to a calibration certificate PDF document
DateTime GetCalibDate(int rangeIx1); /// Get the date of calibration
DateTime GetCalibValidDate(int rangeIx1); /// Get calibration valid until (date)
///
string GetMeterSerialNo(int rangeIx1); /// Get serial number of the meter
string GetMeterType(int rangeIx1); /// Get type of the meter
void SetCalibCertificate(int rangeIx1, string certificate); /// Set calibration certificate number
void SetCertPath(int rangeIx1, string certPath); /// Set path to a calibration certificate PDF document
-2
View File
@@ -41,8 +41,6 @@ namespace TBF.Rig.Hart.Nivotrack
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
@@ -40,8 +40,6 @@ namespace TBF.Rig.Keithley.TempMeter
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info
public Shape Shape { get; set; }
@@ -56,8 +56,6 @@ namespace TBF.Rig.MettlerToledo.Standard
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info
public Shape Shape { get; set; }
@@ -43,8 +43,6 @@ namespace TBF.Rig.Modbus.Meret.AdjustableScale
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info
public Shape Shape { get; set; }
@@ -39,8 +39,6 @@ namespace TBF.Rig.Modbus.PressureMeter.Meret
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info
public Shape Shape { get; set; }
@@ -47,8 +47,6 @@ namespace TBF.Rig.Modbus.TempMeter.Groch
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info
public SchematicDrawing.Shape Shape { get; set; }
@@ -35,8 +35,6 @@ namespace TBF.Rig.Modbus.TempMeter.Meret
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info
public Shape Shape { get; set; }
+25
View File
@@ -0,0 +1,25 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.Collections.Generic;
using TBF.Rig.Generic;
namespace TBF.Rig.Network.AdapterJMS
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(8); } }
public override string ToString() { return ClassName; }
public IComponent DummyComponent() { return new Netadapter(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Netadapter(cfg); }
public IComponentCfg DefaultConfig() { return new NetadapterCfg(this.GetType().Namespace.Substring(8), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(NetadapterCfg.Serializer, component, this);
}
}
}
+115
View File
@@ -0,0 +1,115 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
using Common;
using Config.Entities;
using log4net;
using NHibernate;
using TBF.Rig.Network.Camera.CJMS11;
namespace TBF.Rig.Network.AdapterJMS
{
public class Netadapter : ComponentBase, GenericDevices.INetworkAdapter
{
private static readonly ILog log = LogManager.GetLogger(typeof(Netadapter));
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
readonly NetadapterCfg netadapterCfg;
IPAddress ipAddress;
IPAddress netMask;
IPAddress broadcastAddress;
int tcpPort = -1;
IList<TcpClient> tcpClients;
private IList<Task> connectAsyncList;
public IPAddress IPAddress { get { return ipAddress; } }
public IPAddress NetMask { get { return netMask; } }
public IPAddress BroadcastAddress { get { return broadcastAddress; } }
public IList<TcpClient> TcpClients { get { return tcpClients; } }
public int TcpPort { get { return tcpPort; } }
public TcpClient GetTcpClient(string ipAddressCJMS)
{
foreach (TcpClient tcpClient in tcpClients)
{
if (tcpClient.Client.RemoteEndPoint.ToString().Contains(ipAddressCJMS))
{
return tcpClient;
}
}
return null;
}
public IList<Task> TasksConnectAsync { get { return connectAsyncList; } }
public Netadapter() { }
public Netadapter(Generic.IComponentCfg cfg)
: base(cfg)
{
netadapterCfg = cfg as NetadapterCfg;
log.Warn(this.ToString());
tcpClients = new List<TcpClient>();
}
public override void Initialize()
{
if (DebugLevel == DebugMode.Simulate)
{
ipAddress = IPAddress.Parse("192.168.1.100");
netMask = IPAddress.Parse("255.255.255.0");
broadcastAddress = IPAddress.Parse("192.168.1.255");
return;
}
//TODO hold connections to cameras and other devices, close them when the adapter is removed.
ISession session = TBF.DB.CreateSession(DBKind.Config);
//TODO BUMI - get the port from the config file - defined by UI
if (tcpPort == -1) tcpPort = 32456; //default port
IList<Component> cmpntEntities = session.QueryOver<Component>()
.OrderBy(x => x. ItemNr).Asc
.List();
connectAsyncList = new List<Task>();
foreach (var cmpnt in cmpntEntities)
{
Rig.Generic.IComponentFactory factory = TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName);
/// Camera - jouined to a network adapter
if (factory is Rig.Network.Camera.CJMS11.Factory)
{
CameraCfg cmpntCfgFromCmpntEntity =
factory.CmpntCfgFromCmpntEntity(cmpnt) as Rig.Network.Camera.CJMS11.CameraCfg;
if (cmpntCfgFromCmpntEntity == null) continue;
// TcpClient tcpClient = new TcpClient();
// tcpClients.Add(tcpClient);
// connectAsyncList.Add(tcpClient.ConnectAsync(cmpntCfgFromCmpntEntity.IPAddressCJMS, tcpPort));
}
}
//Task.WaitAll(connectAsyncList.ToArray()); // run all tasks in parallel
// AdapterInfo.RefreshNetAdaptersInfo();
// AdapterInfo netadapter = AdapterInfo.GetNetAdapter(netadapterCfg.Description);
// ipAddress = netadapter.IPAddress;
// netMask = netadapter.NetMask;
//
// if (this.Cfg.DebugLevel != DebugMode.Simulate)
// {
// broadcastAddress = netadapter.GetBroadcastAddress();
// }
}
}
}
@@ -0,0 +1,39 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using Config.Entities;
using TBF.Rig.Generic;
namespace TBF.Rig.Network.AdapterJMS
{
public class NetadapterCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(NetadapterCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new NetadapterCfgCtrl(); }
public string Description; /// Description string of the selected network adapter
/// Private parameterless constructor invoked by all other (public) constructors
NetadapterCfg() {}
public NetadapterCfg(string name, IComponentFactory factory)
: this()
{
Name = name;
Factory = factory;
ParentName = string.Empty;
}
public string ToString(int i)
{
return string.Format("Name={0}, Description={1}", Name, Description);
}
}
}
@@ -0,0 +1,140 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Net;
using System.Windows.Forms;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
namespace TBF.Rig.Network.AdapterJMS
{
public partial class NetadapterCfgCtrl : UserControl, IComponentCfgCtrl
{
public bool ShowMore { get { return false; } }
NetadapterCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as NetadapterCfg;
Redraw();
}
}
public NetadapterCfgCtrl()
{
InitializeComponent();
}
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
{
if (ParentForm == null) return; /// Return is executed when tab page is open in Designer
if (config == null) return; /// Control was not loaded, settings were not changed
Localize();
Redraw();
}
void Redraw()
{
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
AdapterInfo.RefreshNetAdaptersInfo();
IList<AdapterInfo> adapters = AdapterInfo.NetAdapters;
string cfgAdapter = string.Empty;
foreach (AdapterInfo ai in adapters)
{
string record;
if (ai.IPAddress == null)
{
/// This happens with network adapters that currently have no IP address,
/// for instance not connected wireless or dial-up adapters
record = "???.???.???.???";
}
else
{
/// Do not consider IPv6 adapters as well as "Any", "Broadcast", "Loopback" or "None" addresses
if ((ai.IPAddress.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6) ||
ai.IPAddress.Equals(IPAddress.Any) ||
ai.IPAddress.Equals(IPAddress.Broadcast) ||
ai.IPAddress.Equals(IPAddress.IPv6Any) ||
ai.IPAddress.Equals(IPAddress.IPv6Loopback) ||
ai.IPAddress.Equals(IPAddress.IPv6None) ||
ai.IPAddress.Equals(IPAddress.Loopback) ||
ai.IPAddress.Equals(IPAddress.None))
{
continue;
}
record = ai.IPAddress.ToString();
}
record += " - " + ai.Description;
int i = adapterComboBox.Items.Add(record);
if (ai.Description == config.Description)
{
/// Select the adapter currently in the configuration
adapterComboBox.SelectedIndex = i;
}
}
/// Select the first one if the adapter from the configuration does not exist on the system
if (adapterComboBox.SelectedIndex < 0 && adapterComboBox.Items.Count > 0)
{
adapterComboBox.SelectedIndex = 0;
}
}
void Localize()
{
}
public void Closing()
{
}
public void Unlock()
{
nameTextBox.Enabled = true;
adapterComboBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (!adapterComboBox.Items.Contains(adapterComboBox.Text))
{
flags = CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid 'Parent Name'";
}
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
config.Name = nameTextBox.Text;
/// Network adapter
string strAdapter = adapterComboBox.Text;
int iDash = strAdapter.IndexOf(" - ");
config.Description = iDash < 0 ? "" : strAdapter.Substring(iDash + 3);
return flags;
}
}
}
+109
View File
@@ -0,0 +1,109 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
namespace TBF.Rig.Network.AdapterJMS
{
partial class NetadapterCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.adapterLabel = new System.Windows.Forms.Label();
this.adapterComboBox = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(101, 50);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(114, 20);
this.nameTextBox.TabIndex = 5;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(9, 53);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 4;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(98, 24);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 3;
this.classNameLabel.Text = "ComonentName";
//
// adapterLabel
//
this.adapterLabel.AutoSize = true;
this.adapterLabel.Location = new System.Drawing.Point(9, 80);
this.adapterLabel.Name = "adapterLabel";
this.adapterLabel.Size = new System.Drawing.Size(44, 13);
this.adapterLabel.TabIndex = 6;
this.adapterLabel.Text = "Adapter";
//
// adapterComboBox
//
this.adapterComboBox.Enabled = false;
this.adapterComboBox.Location = new System.Drawing.Point(101, 77);
this.adapterComboBox.Name = "adapterComboBox";
this.adapterComboBox.Size = new System.Drawing.Size(333, 21);
this.adapterComboBox.TabIndex = 7;
//
// NetadapterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.adapterComboBox);
this.Controls.Add(this.adapterLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "NetadapterCfgCtrl";
this.Size = new System.Drawing.Size(450, 300);
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.Label adapterLabel;
private System.Windows.Forms.ComboBox adapterComboBox;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,74 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Xml.Serialization;
using Common;
using TBF.Rig.Generic;
using TBF.Resources;
namespace TBF.Rig.Network.Camera.CJMS11
{
public enum TestImagesMode
{
None,
SaveFirstImages,
SaveLastImages,
LoadImages,
Count,
Invalid,
}
public class CameraCfg : ComponentCfgBase, IChildComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(CameraCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new CameraCfgCtrl(); }
///
/// Serialized parameters
///
public int HardwareAddress;
public bool DisplayTerminal;
[XmlIgnore]
public TestImagesMode TestImagesMode;
[XmlIgnore]
public int TestImagesCount;
public string IPAddressCJMS;
/// Private parameterless constructor invoked by all other (public) constructors
CameraCfg() { }
public CameraCfg(string name, IComponentFactory factory)
: this()
{
Name = name;
Factory = factory;
ParentName = "Network.Adapter";
HardwareAddress = 1;
TestImagesMode = TestImagesMode.None;
TestImagesCount = 3000;
DebugLevel = DebugMode.AutoDetect;
IPAddressCJMS = "192.168.1.100";
}
public string ToString(int i)
{
return string.Format("Name={0}, s/n={1}, Terminal={2}, TestImagesMode={3}, TestImagesCount={4}, Parent={5}, IPAddressCJMS={6}",
Name,
HardwareAddress,
DisplayTerminal ? Strings.yes : Strings.no,
TestImagesMode,
TestImagesCount,
ParentName,
IPAddressCJMS);
}
}
}
@@ -0,0 +1,276 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Net;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Castle.Components.DictionaryAdapter.Xml;
using Common;
using Config.Entities;
using log4net;
using TBF.Rig.Generic;
using TBF.Resources;
using TBF.Rig.Network.Adapter;
using TBF.UI.Bench.Components;
namespace TBF.Rig.Network.Camera.CJMS11
{
public partial class CameraCfgCtrl : UserControl, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(CameraCfgCtrl));
ComponentParametersDlg parent;
private bool isIPCalculated = false;
public bool ShowMore
{
get { return false; }
}
CameraCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as CameraCfg;
Redraw();
}
}
public CameraCfgCtrl()
{
InitializeComponent();
}
private void PumpCfgCtrl_Load(object sender, EventArgs e)
{
Localize();
parent = ParentForm as ComponentParametersDlg;
if (parent == null) return;
if (parent.CmpntEntities != null)
{
foreach (var cmpnt in parent.CmpntEntities)
{
if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is TBF.Rig.Network.AdapterJMS.Factory)
{
parentNameComboBox.Items.Add(cmpnt.Name);
}
}
}
for (TestImagesMode mode = 0; mode < TestImagesMode.Count; mode++)
{
testImagesModeComboBox.Items.Add(mode.ToString());
}
Redraw();
}
void Localize()
{
nameLabel.Text = Strings.Name;
parentNameLabel.Text = Strings.Parent_name;
hwAddressLabel.Text = Strings.Serial_number;
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName;
hwAddressTextBox.Text = config.HardwareAddress.ToString();
displayTerminalCheckBox.Checked = config.DisplayTerminal;
testImagesModeComboBox.Text = config.TestImagesMode.ToString();
testImagesCountTextBox.Text = config.TestImagesCount.ToString();
if (!(isIPCalculated && (config.IPAddressCJMS == null || config.IPAddressCJMS.Equals(""))))
{
ipAddressTextBox.Text = config.IPAddressCJMS;
}
}
public void Unlock()
{
nameTextBox.Enabled = true;
parentNameComboBox.Enabled = true;
hwAddressTextBox.Enabled = true;
displayTerminalCheckBox.Enabled = true;
testImagesModeComboBox.Enabled = true;
testImagesCountTextBox.Enabled = true;
ipAddressTextBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
int dummy;
if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, parentNameLabel.Text);
}
if (!int.TryParse(hwAddressTextBox.Text, out dummy) || dummy % 100 > 63)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, hwAddressLabel.Text);
}
TestImagesMode newTestImagesMode = TestImagesMode.Invalid;
for (TestImagesMode mode = 0; mode < TestImagesMode.Count; mode++)
{
if (testImagesModeComboBox.Text == mode.ToString()) newTestImagesMode = mode;
}
if (newTestImagesMode == TestImagesMode.Invalid)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, testImagesModeLabel.Text);
}
if (!int.TryParse(testImagesCountTextBox.Text, out dummy) || dummy < 0 || dummy > 3000
|| ((dummy == 0) && (newTestImagesMode != TestImagesMode.None)))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, testImagesCountLabel.Text);
}
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
string newParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text;
int newHWAddress = int.Parse(hwAddressTextBox.Text);
TestImagesMode newTestImagesMode = 0;
for (TestImagesMode mode = 0; mode < TestImagesMode.Count; mode++)
{
if (testImagesModeComboBox.Text == mode.ToString()) newTestImagesMode = mode;
}
int newTestImagesCount = int.Parse(testImagesCountTextBox.Text);
if (config.Name != nameTextBox.Text ||
config.ParentName != newParentName ||
config.HardwareAddress != newHWAddress ||
config.DisplayTerminal != displayTerminalCheckBox.Checked ||
(config.IPAddressCJMS != ipAddressTextBox.Text && !ipAddressTextBox.Text.Contains("?"))
)
{
config.Name = nameTextBox.Text;
config.ParentName = newParentName;
config.HardwareAddress = newHWAddress;
config.DisplayTerminal = displayTerminalCheckBox.Checked;
if (!ipAddressTextBox.Text.Contains("?"))
{
config.IPAddressCJMS = ipAddressTextBox.Text;
}
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
}
if (config.TestImagesMode != newTestImagesMode ||
config.TestImagesCount != newTestImagesCount)
{
config.TestImagesMode = newTestImagesMode;
config.TestImagesCount = newTestImagesCount;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.VolatileChange);
}
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
{
Camera.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
}
return flags;
}
private void parentNameComboBox_TextChanged(object sender, EventArgs e)
{
if (parent == null) return;
if (parent.CmpntEntities != null)
{
foreach (var cmpnt in parent.CmpntEntities)
{
IComponentFactory cmpntFactoryFromClassName =
TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName);
if (cmpntFactoryFromClassName is TBF.Rig.Network.Adapter.Factory)
{
NetadapterCfg netadapterCfg =
cmpntFactoryFromClassName.CmpntCfgFromCmpntEntity(cmpnt) as NetadapterCfg;
string adapterDescription = netadapterCfg.Description;
AdapterInfo netadapter = AdapterInfo.GetNetAdapter(adapterDescription);
ipAddressAdapterTextBox.Text = netadapter.IPAddress.ToString();
if (config.IPAddressCJMS == null || config.IPAddressCJMS.Equals(""))
{
ipAddressTextBox.Text = getAdatpterIP(netadapter);
}
isIPCalculated = true;
break;
}
}
}
}
private string getAdatpterIP(AdapterInfo netadapter)
{
List<string> ipSegments = GetIPAddressInSegments(netadapter.IPAddress.ToString());
string address = string.Format(
"{0}.{1}.{2}.???",
ipSegments[0],
ipSegments[1],
ipSegments[2]
);
return address;
}
private List<string> GetIPAddressInSegments(string ipAddress)
{
List<string> ipAddressSegments = new List<string>();
// Regular expression to match IPv4 and capture 4 segments
string pattern = @"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$";
Match match = Regex.Match(ipAddress, pattern);
if (match.Success)
{
ipAddressSegments.Add(match.Groups[1].Value);
ipAddressSegments.Add(match.Groups[2].Value);
ipAddressSegments.Add(match.Groups[3].Value);
ipAddressSegments.Add(match.Groups[4].Value);
}
else
{
log.Error("Invalid IP address format.");
}
return ipAddressSegments;
}
}
}
+260
View File
@@ -0,0 +1,260 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
namespace TBF.Rig.Network.Camera.CJMS11
{
partial class CameraCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.hwAddressTextBox = new System.Windows.Forms.TextBox();
this.hwAddressLabel = new System.Windows.Forms.Label();
this.parentNameLabel = new System.Windows.Forms.Label();
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.parentNameComboBox = new System.Windows.Forms.ComboBox();
this.displayTerminalCheckBox = new System.Windows.Forms.CheckBox();
this.testImagesCountTextBox = new System.Windows.Forms.TextBox();
this.testImagesCountLabel = new System.Windows.Forms.Label();
this.testImagesModeComboBox = new System.Windows.Forms.ComboBox();
this.testImagesModeLabel = new System.Windows.Forms.Label();
this.ipAddressTextBox = new System.Windows.Forms.TextBox();
this.iPAddressLabel = new System.Windows.Forms.Label();
this.ipAddressAdapterTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// hwAddressTextBox
//
this.hwAddressTextBox.Enabled = false;
this.hwAddressTextBox.Location = new System.Drawing.Point(198, 209);
this.hwAddressTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.hwAddressTextBox.Name = "hwAddressTextBox";
this.hwAddressTextBox.Size = new System.Drawing.Size(193, 26);
this.hwAddressTextBox.TabIndex = 6;
//
// hwAddressLabel
//
this.hwAddressLabel.AutoSize = true;
this.hwAddressLabel.Location = new System.Drawing.Point(42, 213);
this.hwAddressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.hwAddressLabel.Name = "hwAddressLabel";
this.hwAddressLabel.Size = new System.Drawing.Size(107, 20);
this.hwAddressLabel.TabIndex = 5;
this.hwAddressLabel.Text = "Serial number";
//
// parentNameLabel
//
this.parentNameLabel.AutoSize = true;
this.parentNameLabel.Location = new System.Drawing.Point(42, 106);
this.parentNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.parentNameLabel.Name = "parentNameLabel";
this.parentNameLabel.Size = new System.Drawing.Size(100, 20);
this.parentNameLabel.TabIndex = 3;
this.parentNameLabel.Text = "Parent name";
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(198, 63);
this.nameTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(193, 26);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(42, 68);
this.nameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(51, 20);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(194, 26);
this.classNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(125, 20);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// parentNameComboBox
//
this.parentNameComboBox.Enabled = false;
this.parentNameComboBox.FormattingEnabled = true;
this.parentNameComboBox.Location = new System.Drawing.Point(198, 102);
this.parentNameComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.parentNameComboBox.Name = "parentNameComboBox";
this.parentNameComboBox.Size = new System.Drawing.Size(193, 28);
this.parentNameComboBox.TabIndex = 4;
this.parentNameComboBox.TextChanged += new System.EventHandler(this.parentNameComboBox_TextChanged);
//
// displayTerminalCheckBox
//
this.displayTerminalCheckBox.AutoSize = true;
this.displayTerminalCheckBox.Enabled = false;
this.displayTerminalCheckBox.Location = new System.Drawing.Point(200, 255);
this.displayTerminalCheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.displayTerminalCheckBox.Name = "displayTerminalCheckBox";
this.displayTerminalCheckBox.Size = new System.Drawing.Size(146, 24);
this.displayTerminalCheckBox.TabIndex = 7;
this.displayTerminalCheckBox.Text = "Display terminal";
this.displayTerminalCheckBox.UseVisualStyleBackColor = true;
//
// testImagesCountTextBox
//
this.testImagesCountTextBox.Enabled = false;
this.testImagesCountTextBox.Location = new System.Drawing.Point(198, 335);
this.testImagesCountTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.testImagesCountTextBox.Name = "testImagesCountTextBox";
this.testImagesCountTextBox.Size = new System.Drawing.Size(67, 26);
this.testImagesCountTextBox.TabIndex = 12;
//
// testImagesCountLabel
//
this.testImagesCountLabel.AutoSize = true;
this.testImagesCountLabel.Location = new System.Drawing.Point(42, 339);
this.testImagesCountLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.testImagesCountLabel.Name = "testImagesCountLabel";
this.testImagesCountLabel.Size = new System.Drawing.Size(139, 20);
this.testImagesCountLabel.TabIndex = 11;
this.testImagesCountLabel.Text = "Test images count";
//
// testImagesModeComboBox
//
this.testImagesModeComboBox.Enabled = false;
this.testImagesModeComboBox.FormattingEnabled = true;
this.testImagesModeComboBox.Location = new System.Drawing.Point(198, 295);
this.testImagesModeComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.testImagesModeComboBox.Name = "testImagesModeComboBox";
this.testImagesModeComboBox.Size = new System.Drawing.Size(193, 28);
this.testImagesModeComboBox.TabIndex = 14;
//
// testImagesModeLabel
//
this.testImagesModeLabel.AutoSize = true;
this.testImagesModeLabel.Location = new System.Drawing.Point(42, 299);
this.testImagesModeLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.testImagesModeLabel.Name = "testImagesModeLabel";
this.testImagesModeLabel.Size = new System.Drawing.Size(139, 20);
this.testImagesModeLabel.TabIndex = 13;
this.testImagesModeLabel.Text = "Test images mode";
//
// ipAddressTextBox
//
this.ipAddressTextBox.Enabled = false;
this.ipAddressTextBox.Location = new System.Drawing.Point(198, 176);
this.ipAddressTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ipAddressTextBox.Name = "ipAddressTextBox";
this.ipAddressTextBox.Size = new System.Drawing.Size(193, 26);
this.ipAddressTextBox.TabIndex = 15;
//
// iPAddressLabel
//
this.iPAddressLabel.AutoSize = true;
this.iPAddressLabel.Location = new System.Drawing.Point(42, 176);
this.iPAddressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.iPAddressLabel.Name = "iPAddressLabel";
this.iPAddressLabel.Size = new System.Drawing.Size(89, 20);
this.iPAddressLabel.TabIndex = 16;
this.iPAddressLabel.Text = "IP address:";
//
// ipAddressAdapterTextBox
//
this.ipAddressAdapterTextBox.Enabled = false;
this.ipAddressAdapterTextBox.Location = new System.Drawing.Point(200, 140);
this.ipAddressAdapterTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ipAddressAdapterTextBox.Name = "ipAddressAdapterTextBox";
this.ipAddressAdapterTextBox.Size = new System.Drawing.Size(193, 26);
this.ipAddressAdapterTextBox.TabIndex = 17;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(42, 140);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(150, 20);
this.label1.TabIndex = 18;
this.label1.Text = "Adapter IP address:";
//
// CameraCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label1);
this.Controls.Add(this.ipAddressAdapterTextBox);
this.Controls.Add(this.iPAddressLabel);
this.Controls.Add(this.ipAddressTextBox);
this.Controls.Add(this.testImagesModeComboBox);
this.Controls.Add(this.testImagesModeLabel);
this.Controls.Add(this.hwAddressTextBox);
this.Controls.Add(this.hwAddressLabel);
this.Controls.Add(this.testImagesCountTextBox);
this.Controls.Add(this.testImagesCountLabel);
this.Controls.Add(this.displayTerminalCheckBox);
this.Controls.Add(this.parentNameComboBox);
this.Controls.Add(this.parentNameLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "CameraCfgCtrl";
this.Size = new System.Drawing.Size(603, 391);
this.Load += new System.EventHandler(this.PumpCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox ipAddressAdapterTextBox;
private System.Windows.Forms.TextBox ipAddressTextBox;
private System.Windows.Forms.Label iPAddressLabel;
#endregion
private System.Windows.Forms.TextBox hwAddressTextBox;
private System.Windows.Forms.Label hwAddressLabel;
private System.Windows.Forms.Label parentNameLabel;
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.ComboBox parentNameComboBox;
private System.Windows.Forms.CheckBox displayTerminalCheckBox;
private System.Windows.Forms.TextBox testImagesCountTextBox;
private System.Windows.Forms.Label testImagesCountLabel;
private System.Windows.Forms.ComboBox testImagesModeComboBox;
private System.Windows.Forms.Label testImagesModeLabel;
}
}
@@ -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>
+25
View File
@@ -0,0 +1,25 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.Collections.Generic;
using TBF.Rig.Generic;
namespace TBF.Rig.Network.Camera.CJMS11
{
public class Factory : IComponentFactory
{
public string ClassName { get { return GetType().Namespace.Substring(8); } }
public override string ToString() { return ClassName; }
public IComponent DummyComponent() { return new Camera(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Camera(cfg, components); }
public IComponentCfg DefaultConfig() { return new CameraCfg(this.GetType().Namespace.Substring(8), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(CameraCfg.Serializer, component, this);
}
}
}
@@ -0,0 +1,178 @@
///
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
using System;
using System.Diagnostics;
using System.Drawing;
using log4net;
using Common;
using Config.Entities;
using TBF.Rig.Network.Telnet;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TBF.Rig.Network.Camera.CJMS11
{
public class GrabImagesOp : IOperation
{
/// TODO: Implement support for grabbing multiple images, now imgFileNames.Lenght should be 1
private static readonly ILog log = LogManager.GetLogger(typeof(GrabImagesOp));
public override string ToString() { return string.Format("GrabImageOp()"); }
readonly Camera camera;
readonly string[] imgFileNames;
readonly bool blackAndWhite;
readonly bool lowResolution;
readonly ImageRotation imageRotation;
string command;
bool grabImageCommandSent;
string response;
bool grabPassed;
bool grabFailed;
bool transferringGrabbedImage;
Image grabedImage;
/// <summary>
/// Events: Event.None or Event.Error
/// </summary>
/// <param name="camera">CLP1611.Camera reference</param>
public GrabImagesOp(Camera camera, string[] imgFileNames, bool blackAndWhite, bool lowResolution, ImageRotation imageRotation)
{
/// TODO: Implement support for grabbing multiple images, now imgFileNames.Lenght should be 1
this.camera = camera;
//this.telnet = camera.Telnet;
this.imgFileNames = imgFileNames;
this.blackAndWhite = blackAndWhite;
this.lowResolution = lowResolution;
this.imageRotation = imageRotation;
grabImageCommandSent = false;
transferringGrabbedImage = false;
if (camera.DebugLevel == DebugMode.Normal || camera.DebugLevel == DebugMode.DetectedOn)
{
Camera.ImageCameraHandler += ImageReceived;
}
//TODO BUMI improve by simulate image
Camera.ImageCameraHandler += ImageReceived;
}
void PromptReceived(object sndr, PromptReceivedJMSEventArgs a)
{
response = a.Response;
}
void ImageReceived(object sndr, PromptReceivedImageEventArgs a)
{
if(a.idxCamera != camera.CameraIdx) return;
grabedImage = a.image;
grabPassed = true;
}
public void Start()
{
grabImageCommandSent = false;
transferringGrabbedImage = false;
grabPassed = false;
grabedImage = null;
if ((imgFileNames != null) && (imgFileNames.Length > 0) && File.Exists(imgFileNames[0]))
{
///
/// An image specified, (1) delete previous image, (2) check if this is a simulation
///
File.Delete(imgFileNames[0]);
/* if (camera.CameraCfg.DebugLevel == DebugMode.Simulate || camera.CameraCfg.DebugLevel == DebugMode.DetectedOff)
{
///
/// Camera is in simulation mode => create a simulated image
///
File.Copy(string.Format("{0}\\Pictures\\sample.jpg", Program.ExecutableDir), imgFileNames[0]);
}*/
}
}
public Event Run()
{
if ((imgFileNames == null) || (imgFileNames.Length < 1) || (imgFileNames[0] == null))
{
///
/// No images to be grabbed => Done
///
return Event.GrabPassed;
}
/*else if (camera.CameraCfg.DebugLevel == DebugMode.Simulate ||
camera.CameraCfg.DebugLevel == DebugMode.DetectedOff)
{
///
/// Camera is in simulation mode => create a simulated image and complete
///
return Event.GrabPassed;
}*/
else if (camera.IsGrabImageListenerThreadAlive)
{
return Event.CameraBusy;
}
else if (!grabImageCommandSent)
{
///
/// Normal operation, no command sent yet => (1) wait until telnet state = Inactive, (2) send a command
///
camera.StartGrabImageListener();
grabImageCommandSent = true;
return Event.CameraBusy;
}
else if (grabPassed)
{
///
/// Normal operation, grab passed => transfer/transferring the image
if (transferringGrabbedImage)
{
/// Grab passed and image transfer is in progress
return Event.GrabPassed;
}
else if (camera.IsSaveImageListenerThreadAlive)
{
/// Wait until the previous image transfer completes
return Event.CameraBusy;
}
else //if (0 == camera.DownloadFile(blackAndWhite ? "grabbed.jpg" : "grabbed.bmp", imgFileNames[0]))
{
camera.StartSaveImageToFileListener(grabedImage, imgFileNames[0]);
/// File transfer successfully started
transferringGrabbedImage = true;
return Event.GrabPassed;
}
}
else
{
///
/// Normal operation, grab failed => there in no image to transfer
///
return Event.GrabFailed;
}
}
public void Stop()
{
//if (camera.CameraCfg.DebugLevel == DebugMode.Simulate) return;
if (camera.IsGrabImageListenerThreadAlive)
{
camera.SetStopGrabImageListenerFlag();
}
}
}
}
@@ -0,0 +1,72 @@
using TBF.Rig.Network.Camera.CJMS11.POJO;
namespace TBF.Rig.Network.Camera.CJMS11
{
public class JmsMessage
{
private POJO.MessageStatus status;
private CommandM command;
private string payload;
private string orig_status;
private string orig_command;
private string orig_payload;
public POJO.MessageStatus Status
{
get => status;
set => status = value;
}
public CommandM Command
{
get => command;
set => command = value;
}
public string Payload
{
get => payload;
set => payload = value;
}
public string OrigStatus => orig_status;
public string OrigCommand => orig_command;
public string OrigPayload => orig_payload;
public JmsMessage(string status, string command, string payload)
{
this.status = MessageStatusEnum.GetCommandM(status);
this.command = CommandMEnum.GetCommandM(command);
orig_status = status;
orig_command = command;
orig_payload = payload;
this.payload = payload;
}
public bool isMessageImageType(){
return this.command == CommandM.grab_image_;
}
public ParsedImage getImage(){
if(isMessageImageType()){
return JmsPacket.ImageParser(this.payload);
}
return null;
}
public override string ToString()
{
return string.Format( "status:{0}, command:{1}, payload:{2}, orig_status:{3}, orig_command:{4}, orig_payload:{5}",
status,
command,
payload,
orig_status,
orig_command,
orig_payload);
}
}
}
@@ -0,0 +1,98 @@
using System;
using System.Text.RegularExpressions;
using log4net;
using TBF.Rig.Network.Camera.CJMS11.POJO;
namespace TBF.Rig.Network.Camera.CJMS11
{
public class JmsPacket
{
private static readonly ILog log = LogManager.GetLogger(typeof(JmsPacket));
private JmsMessage jmsMessage;
private string messageOrigin;
public string MessageOrigin { get => messageOrigin; }
public JmsMessage JmsMessage
{
get => jmsMessage;
set => jmsMessage = value;
}
public JmsPacket(string message)
{
messageOrigin = message;
try
{
if (ParseMessage(messageOrigin))
{
//success
}
}
catch (Exception e)
{
log.Error("Error parsing message: " + e.Message);
}
}
private bool ParseMessage(string message)
{
message = message.Trim();
if (message.Length < 1) return false;
this.jmsMessage = JmsMessageFromString(message);
return true;
}
public static JmsMessage JmsMessageFromString(string message)
{
// Equivalent regex pattern
var pattern = new Regex(@"^(ACK|NACK):\s*(\S+)\s*(?:~(.*)~)?\s*END$", RegexOptions.Singleline);
var match = pattern.Match(message);
if (match.Success)
{
string status = match.Groups[1].Value;
string commandStr = match.Groups[2].Value;
string payload = match.Groups[3].Success ? match.Groups[3].Value : "";
return new JmsMessage(status, commandStr, payload);
}
else
{
throw new ArgumentException($"Message format not recognized: {message}");
}
return null;
}
public static ParsedImage ImageParser(string payloadImage)
{
// Equivalent regex pattern
var imagePattern = new Regex(@"IMAGE:([A-Z0-9_]+):\s*(.*?)\s*~IMAGE_END", RegexOptions.Singleline);
var match = imagePattern.Match(payloadImage);
if (match.Success)
{
string encoding = match.Groups[1].Value;
string imageData = match.Groups[2].Value;
return new ParsedImage(ImageTypeEnum.GetCommandM(encoding), imageData);
}
else
{
throw new ArgumentException($"Payload does not match expected image format: {payloadImage}");
}
}
public override string ToString()
{
return string.Format("JmsPacket -> original message: {0} -> JmsMessage: {1}", messageOrigin, jmsMessage.ToString());
}
}
}
@@ -0,0 +1,67 @@
using System;
using System.Diagnostics;
using log4net;
using Common;
using TBF.Rig.Network.Telnet;
namespace TBF.Rig.Network.Camera.CJMS11
{
public class LiveStreamOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(LiveStreamOp));
readonly Camera camera;
readonly Telnet.TelnetClient telnet;
readonly string command;
bool liveStreamCommandSent;
/// <summary>
/// Events: Event.None or Event.Error
/// </summary>
/// <param name="camera">CLP1611.Camera reference</param>
public LiveStreamOp(Camera camera, string command)
{
this.camera = camera;
this.command = command;
}
public void Start()
{
liveStreamCommandSent = false;
}
public Event Run()
{
if (camera.CameraCfg.DebugLevel == DebugMode.Simulate) return Event.None;
log.DebugFormat("Run(): telnet.State = {0}, liveStreamCommandSent = {1}", telnet.State, liveStreamCommandSent);
if (!liveStreamCommandSent)
{
if (camera.Running && (telnet.State == TelnetClient.TelnetState.Inactive))
{
telnet.Enqueue(new Telnet.Command(Telnet.CmdAction.SEND_STRING, command));
liveStreamCommandSent = true;
log.WarnFormat("{0} IP={1} command={2}", camera.Name, camera.IPAddress, command);
}
}
return Event.None;
}
public void Stop()
{
if (camera.CameraCfg.DebugLevel == DebugMode.Simulate) return;
log.DebugFormat("Stop(): telnet.State = {0}, liveStreamCommandSent = {1}", telnet.State, liveStreamCommandSent);
if (liveStreamCommandSent)
{
telnet.Enqueue(new Telnet.Command(Telnet.CmdAction.SEND_COMMAND, Telnet.TelnetClient.CtrlCCommand));
log.WarnFormat("{0} IP={1} command=CTRL-C", camera.Name, camera.IPAddress);
}
}
}
}
@@ -0,0 +1,24 @@
namespace TBF.Rig.Network.Camera.CJMS11
{
public enum CommandM
{
noCommand,
unknown_, // special: only return - unknown command
connect_, // special: only return - TCP connection created
type_camera_,
status_,
prepare_camera_,
grab_image_,
send_,
start_stream_,
stop_stream_,
start_stream_images_,
stop_stream_images_,
get_cfg_,
set_cfg_,
close_,
disconnect_,
overload_config_,
client_count_
}
}
@@ -0,0 +1,46 @@
using System.Collections.Generic;
using System.Linq;
namespace TBF.Rig.Network.Camera.CJMS11
{
public static class CommandMEnum
{
private static readonly Dictionary<CommandM, string> commandToString = new Dictionary<CommandM, string>
{
{ CommandM.noCommand, "noCommand" },
{ CommandM.unknown_, "unknown" },
{ CommandM.connect_, "connect" },
{ CommandM.type_camera_, "type_camera" },
{ CommandM.status_, "status" },
{ CommandM.prepare_camera_, "prepare_camera" },
{ CommandM.grab_image_, "grab_image" },
{ CommandM.send_, "send" },
{ CommandM.start_stream_, "start_stream" },
{ CommandM.stop_stream_, "stop_stream" },
{ CommandM.start_stream_images_, "start_stream_images" },
{ CommandM.stop_stream_images_, "stop_stream_images" },
{ CommandM.get_cfg_, "get_cfg" },
{ CommandM.set_cfg_, "set_cfg" },
{ CommandM.close_, "close" },
{ CommandM.disconnect_, "disconnect" },
{ CommandM.overload_config_, "overload_config" },
{ CommandM.client_count_, "client_count" }
};
private static readonly Dictionary<string, CommandM> stringToCommand = commandToString.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
public static string GetVal(CommandM cmd)
{
return commandToString.TryGetValue(cmd, out var str) ? str : "unknown";
}
public static CommandM GetCommandM(string token)
{
if (string.IsNullOrEmpty(token))
return CommandM.noCommand;
return stringToCommand.TryGetValue(token, out var cmd) ? cmd : CommandM.noCommand;
}
}
}
@@ -0,0 +1,10 @@
namespace TBF.Rig.Network.Camera.CJMS11.POJO
{
public enum ImageType
{
UNKNOWN,
BASE_64,
MJPEG,
RGB888
}
}
@@ -0,0 +1,31 @@
using System.Collections.Generic;
using System.Linq;
namespace TBF.Rig.Network.Camera.CJMS11.POJO
{
public class ImageTypeEnum
{
private static readonly Dictionary<ImageType, string> commandToString = new Dictionary<ImageType, string>
{
{ ImageType.BASE_64, "BASE_64" },
{ ImageType.MJPEG, "MJPEG" },
{ ImageType.RGB888, "RGB888" },
{ ImageType.UNKNOWN, "" }
};
private static readonly Dictionary<string, ImageType> stringToCommand = commandToString.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
public static string GetVal(ImageType cmd)
{
return commandToString.TryGetValue(cmd, out var str) ? str : "unknown";
}
public static ImageType GetCommandM(string token)
{
if (string.IsNullOrEmpty(token))
return ImageType.UNKNOWN;
return stringToCommand.TryGetValue(token, out var cmd) ? cmd : ImageType.UNKNOWN;
}
}
}
@@ -0,0 +1,10 @@
namespace TBF.Rig.Network.Camera.CJMS11.POJO
{
public enum MessageStatus
{
UNDEFINED,
ACK,
NACK,
ERROR
}
}
@@ -0,0 +1,31 @@
using System.Collections.Generic;
using System.Linq;
namespace TBF.Rig.Network.Camera.CJMS11.POJO
{
public class MessageStatusEnum
{
private static readonly Dictionary<MessageStatus, string> commandToString = new Dictionary<MessageStatus, string>
{
{ MessageStatus.UNDEFINED, "" },
{ MessageStatus.ACK, "ACK" },
{ MessageStatus.NACK, "NACK" },
{ MessageStatus.ERROR, "ERROR" }
};
private static readonly Dictionary<string, MessageStatus> stringToCommand = commandToString.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
public static string GetVal(MessageStatus cmd)
{
return commandToString.TryGetValue(cmd, out var str) ? str : "undefined";
}
public static MessageStatus GetCommandM(string token)
{
if (string.IsNullOrEmpty(token))
return MessageStatus.UNDEFINED;
return stringToCommand.TryGetValue(token, out var cmd) ? cmd : MessageStatus.UNDEFINED;
}
}
}
@@ -0,0 +1,38 @@
using System;
using TBF.Rig.Network.Camera.CJMS11.POJO;
using System.Drawing;
using System.IO;
namespace TBF.Rig.Network.Camera.CJMS11
{
public class ParsedImage
{
public ImageType Encoding { get; }
public string ImageData { get; }
public Image Image { get { return (ImageData.Length>0 ? Base64ToImage(ImageData) : null); } }
public ParsedImage(ImageType encoding, string imageData)
{
Encoding = encoding;
ImageData = imageData;
}
public override string ToString()
{
return $"ParsedImage{{encoding='{Encoding}', imageData='{ImageData}'}}";
}
public static Image Base64ToImage(string base64Image)
{
byte[] imageBytes = Convert.FromBase64String(base64Image);
using (var ms = new MemoryStream(imageBytes))
{
return Image.FromStream(ms);
}
}
}
}
@@ -0,0 +1,91 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
namespace TBF.Rig.Network.Camera.CJMS11
{
public class RoisAndResults
{
public const int MaxRegisteredRois = 4; /// Max. count of registered (and measured) ROI-s
public long CameraTimeMs;
public int[] Angles;
private IList<string> roiParams;
public int RegisteredRoisCount { get { return roiParams.Count; } }
public RoisAndResults()
{
Angles = new int[MaxRegisteredRois];
roiParams = new List<string>();
}
public void ClearRoiParams()
{
lock (this)
{
roiParams.Clear();
}
}
public int RegisterRoi(string roiParam)
{
lock (this)
{
if (this.roiParams.Count >= MaxRegisteredRois) return 0;
this.roiParams.Add(roiParam);
return this.roiParams.Count; /// return a handle 1 .. MaxRegisteredRois
}
}
public string GetRoiParams(int roiHandle)
{
lock (this)
{
if (roiHandle > 0 && roiHandle <= roiParams.Count)
{
return roiParams[roiHandle - 1];
}
else
{
return string.Empty;
}
}
}
public void SetResults(long timeMs, int[] angles)
{
lock (this)
{
CameraTimeMs = timeMs;
for (int i = 0; i < Math.Min(angles.Length, Angles.Length); i++)
{
Angles[i] = angles[i];
}
}
}
public int GetResult(int roiHandle, out long timeMs)
{
lock (this)
{
if (roiHandle > 0 && roiHandle <= roiParams.Count)
{
timeMs = CameraTimeMs;
return Angles[roiHandle - 1];
}
else
{
timeMs = 0;
return 0;
}
}
}
}
}
+62
View File
@@ -0,0 +1,62 @@
namespace TBF.Rig.Network.Camera.CJMS11
{
partial class TerminalDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.vtTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// vtTextBox
//
this.vtTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.vtTextBox.Location = new System.Drawing.Point(0, 0);
this.vtTextBox.Multiline = true;
this.vtTextBox.Name = "vtTextBox";
this.vtTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.vtTextBox.Size = new System.Drawing.Size(737, 437);
this.vtTextBox.TabIndex = 0;
//
// TerminalDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(737, 437);
this.Controls.Add(this.vtTextBox);
this.Name = "TerminalDlg";
this.Text = "Terminal";
this.Load += new System.EventHandler(this.Terminal_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox vtTextBox;
}
}
@@ -0,0 +1,37 @@
using System;
using System.Windows.Forms;
using TBF.Rig.Network.Telnet;
namespace TBF.Rig.Network.Camera.CJMS11
{
public partial class TerminalDlg : Form
{
TelnetClient telnet;
public TerminalDlg()
{
InitializeComponent();
}
public TerminalDlg(string name, TelnetClient telnet)
{
InitializeComponent();
Text = name;
this.telnet = telnet;
}
private void Terminal_Load(object sender, EventArgs e)
{
telnet.vtTextChangedHandler += delegate(object sndr, VtTextChangedEventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<VtTextChangedEventArgs>(OnTextChanged), sndr, args); }
else OnTextChanged(sndr, args);
};
}
void OnTextChanged(object sndr, VtTextChangedEventArgs args)
{
vtTextBox.Text = args.VtText;
}
}
}
@@ -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>
+1 -5
View File
@@ -42,14 +42,10 @@ namespace TBF.Rig.Network.Camera.Roi
{
foreach (var cmpnt in parent.CmpntEntities)
{
if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is TBF.Rig.Network.Camera.CLP1611.Factory)
if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is TBF.Rig.Network.Camera.CJMS11.Factory)
{
parentNameComboBox.Items.Add(cmpnt.Name);
}
if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is TBF.Rig.Network.Camera.Roi.Factory)
{
previousRoiComboBox.Items.Add(cmpnt.Name);
}
}
}
@@ -0,0 +1,25 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.Collections.Generic;
using TBF.Rig.Generic;
namespace TBF.Rig.Network.Camera.RoiForFixedStartCJMS11
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(8); } }
public override string ToString() { return ClassName; }
public IComponent DummyComponent() { return new Roi(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Roi(cfg, components); }
public IComponentCfg DefaultConfig() { return new RoiCfg(this.GetType().Namespace.Substring(8), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(RoiCfg.Serializer, component, this);
}
}
}
@@ -0,0 +1,115 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.IO;
using System.Xml.Serialization;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using TBF.Resources;
namespace TBF.Rig.Network.Camera.RoiForFixedStartCJMS11
{
public class ProcedureParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcedureParams) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public double PulsesPerLtr; /// [l^-1]
public override void InitializeAll()
{
PulsesPerLtr = 1.0;
}
string[] paramNames = new string[]
{
Strings.PulsesPerLtr,
};
public override string ParamName(int i) { return paramNames[i]; }
public override int ParamsCount() { return paramNames.Length; }
public override string ToString(int i)
{
switch (i)
{
case 0: return PulsesPerLtr.ToString();
default: return string.Empty;
}
}
/// Retrieves parameters from UI controls
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0: PulsesPerLtr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.None;
default: return CfgUpdateFlags.None;
}
}
/// Verifies whether strings in UI controls represent valid parameters
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
double dummy;
switch (i)
{
case 0:
if (Utils.TryParseUDouble(strValue, out dummy)) return true;
break;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(ProcedureParams prms)
{
prms.PulsesPerLtr = this.PulsesPerLtr;
}
public IParamsProvider Clone()
{
ProcedureParams pars = new ProcedureParams();
CopyContentTo(pars);
return pars;
}
public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
{
if (dbEntity == null) return;
try
{
ProcedureParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as ProcedureParams;
procedureParamsEntity = dbEntity;
componentName = dbEntity.CmpntName;
procedure = dbEntity.Procedure;
if (tmp != null) tmp.CopyContentTo(this);
}
catch
{
}
}
public ProcedureParams() { }
public ProcedureParams(bool initialize)
{
if (initialize) InitializeAll();
}
public ProcedureParams(ComponentProcedure procedureParamsEntity, string componentName, Procedure procedure)
{
this.procedureParamsEntity = procedureParamsEntity;
this.componentName = componentName;
this.procedure = procedure;
}
}
}
@@ -0,0 +1,144 @@
///
/// Copyright (c) 2017-2021 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Text;
using log4net;
using Common;
using Config.Entities;
using TBF.Rig.GenericDevices;
namespace TBF.Rig.Network.Camera.RoiForFixedStartCJMS11
{
public class Roi : ComponentBase, GenericDevices.IRegReaderStillCamera
{
/// TODO: Implement support for sharing one camera by multiple ROI-s
private static readonly ILog log = LogManager.GetLogger(typeof(Roi));
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
readonly RoiCfg roiCfg;
///
/// Camera and ICamera
///
public readonly CJMS11.Camera NetCamera;
public GenericDevices.ICamera Camera { get { return NetCamera as GenericDevices.ICamera; } }
public int Position
{
get
{
int firstDigitPos = Name.IndexOfAny(new char[] { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' });
int position;
return (firstDigitPos < 0) ? 0 : (int.TryParse(Name.Substring(firstDigitPos), out position) ? position : 0);
}
}
public RegisterReaderType RegisterReaderType { get { return RegisterReaderType.Manual; } }
public double PulsesPerLtr { get { return roiCfg.ProcParams.PulsesPerLtr; } }
public double LtrsPerPulse { get { return (PulsesPerLtr <= float.Epsilon) ? 1.0 : (1 / PulsesPerLtr); } }
double beginWMState;
public double BeginWMState
{
get { return beginWMState; }
set { beginWMState = value; }
}
double endWMState;
public double EndWMState
{
get { return endWMState; }
set { endWMState = value; }
}
public double WMVolume { get { return endWMState - beginWMState; } }
public int WMPulses { get { return (int)(WMVolume / LtrsPerPulse); } }
public int WMRefPulses { get { return StateMachine.ControlBoardMain.RefPulses; ; } }
public Roi() { }
public Roi(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
: base(cfg)
{
roiCfg = cfg as RoiCfg;
NetCamera = TbfComponents.FindComponent(cfg.ParentName, components) as CJMS11.Camera;
log.Warn(this.ToString());
}
public override void Initialize()
{
Clear();
}
#region Configuration Change Handling
public static void OnCfgChange(object sender, CfgChangeArgs args)
{
if (CfgChangeHandler == null) return;
try { CfgChangeHandler(sender, args); }
catch (Exception e) { log.Error("CfgChangeHandler(...) failed", e); }
}
public static event EventHandler<CfgChangeArgs> CfgChangeHandler;
public override void StartChangeHandler()
{
CfgChangeHandler += delegate(object sender, CfgChangeArgs args)
{
RoiCfg tmpcfg = args.Cfg as RoiCfg;
if (tmpcfg != null && tmpcfg.Name.Equals(Name))
{
if (args.Command == CfgChangeCmd.CfgChange)
{
roiCfg.BlackAndWhite = tmpcfg.BlackAndWhite;
roiCfg.LowResolution = tmpcfg.LowResolution;
roiCfg.ImageRotation = tmpcfg.ImageRotation;
}
}
};
}
#endregion Configuration Change Handling
public void Clear()
{
log.DebugFormat("{0}:Clear()", Name);
beginWMState = 0;
endWMState = 0;
}
public IOperation GrabImageOp(string imageFileName)
{
return GrabImageOp(imageFileName, roiCfg.BlackAndWhite, roiCfg.LowResolution, roiCfg.ImageRotation);
}
public IOperation GrabImageOp(string imageFileName,
bool blackAndWhite, bool lowResolution, ImageRotation imageRotation)
{
if (NetCamera != null)
{
///TODO BUMI - implementing grabing multiple images
/// 1. Create a list of image file names
/// 2. implement count of images to grab
/// 3. implement grabing multiple images
/// TODO: Implement support for sharing one camera by multiple ROI-s
return NetCamera.GrabImagesOp(new string[] { imageFileName }, blackAndWhite, lowResolution, imageRotation);
}
else
return null;
}
public IValve GetValve()
{
return null;
}
}
}
@@ -0,0 +1,78 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.Collections.Generic;
using System.Xml.Serialization;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using TBF.Rig.Network.Camera.RoiForFixedStartCJMS11.common;
namespace TBF.Rig.Network.Camera.RoiForFixedStartCJMS11
{
public class RoiCfg : ComponentCfgBase, IChildComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RoiCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new RoiCfgCtrl(); }
///
/// Serialized parameters
///
public bool BlackAndWhite;
public bool LowResolution;
public ImageRotation ImageRotation;
[XmlIgnore]
private Frame _imageFrame;
[XmlElement(IsNullable = true)]
public Frame ImageFrame
{
get
{
if (_imageFrame == null)
{
_imageFrame = new Frame(); // Ensure non-null when accessed
}
return _imageFrame;
}
set
{
_imageFrame = value;
}
}
/// <summary> Procedure parameters </summary>
[XmlIgnore]
public ProcedureParams ProcParams;
public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
public override IParamsProvider CreateProcParamsProvider() { return new ProcedureParams(true); }
/// Private parameterless constructor invoked by all other (public) constructors
RoiCfg()
{
ProcParams = new ProcedureParams(true);
}
public RoiCfg(string name, IComponentFactory factory)
: this()
{
Name = name;
Factory = factory;
ParentName = "Camera";
BlackAndWhite = false;
LowResolution = true;
ImageRotation = ImageRotation.None;
ImageFrame = Frame.StandardFrame();
DebugLevel = DebugMode.Inherit;
}
public string ToString(int i)
{
return string.Format("{0} Camera={1} B&W={2}, LowRes={3}, Rotation={4}, Frame={5}",
Name, ParentName, BlackAndWhite, LowResolution, ImageRotation, ImageFrame);
}
}
}
@@ -0,0 +1,200 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Windows.Forms;
using log4net;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using TBF.Resources;
using TBF.Rig.Network.Camera.RoiForFixedStartCJMS11.common;
using TBF.UI.Bench.Components;
namespace TBF.Rig.Network.Camera.RoiForFixedStartCJMS11
{
public partial class RoiCfgCtrl : UserControl, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(RoiCfgCtrl));
ComponentParametersDlg parent;
public bool ShowMore { get { return false; } }
RoiCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as RoiCfg;
Redraw();
}
}
public RoiCfgCtrl()
{
InitializeComponent();
}
private void PumpCfgCtrl_Load(object sender, EventArgs e)
{
parent = ParentForm as ComponentParametersDlg;
if (parent == null) return;
if (parent.CmpntEntities != null)
{
foreach (var cmpnt in parent.CmpntEntities)
{
if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is TBF.Rig.Network.Camera.CJMS11.Factory)
{
parentNameComboBox.Items.Add(cmpnt.Name);
}
}
}
foreach (var resolutionFrame in ResolutionFrames.CommonResolutions)
{
resolutionComboBox.Items.Add(resolutionFrame.ToString());
}
for (ImageRotation ir = 0; ir < ImageRotation.Count; ir++)
{
imageRotationComboBox.Items.Add(ir.ToDescription());
}
Redraw();
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName;
blackAndWhiteCheckBox.Checked = config.BlackAndWhite;
loResolutionCheckBox.Checked = config.LowResolution;
imageRotationComboBox.Text = config.ImageRotation.ToDescription();
resolutionComboBox.Text = config.ImageFrame.ToString();
}
public void Unlock()
{
nameTextBox.Enabled = true;
parentNameComboBox.Enabled = true;
blackAndWhiteCheckBox.Enabled = true;
loResolutionCheckBox.Enabled = true;
imageRotationComboBox.Enabled = true;
resolutionComboBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, parentNameLabel.Text);
}
if (!imageRotationComboBox.Items.Contains(imageRotationComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, imageRotationLabel.Text);
}
if (!resolutionComboBox.Items.Contains(resolutionComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, resolutionComboBox.Text);
}
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
if (config.Name != nameTextBox.Text)
{
config.Name = nameTextBox.Text;
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
}
string newParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text;
if (config.ParentName != newParentName)
{
config.ParentName = newParentName;
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
}
if (config.BlackAndWhite != blackAndWhiteCheckBox.Checked)
{
config.BlackAndWhite = blackAndWhiteCheckBox.Checked;
flags |= (CfgUpdateFlags.AnyChange | CfgUpdateFlags.InvokeCfgChange);
}
if (config.LowResolution != loResolutionCheckBox.Checked)
{
config.LowResolution = loResolutionCheckBox.Checked;
flags |= (CfgUpdateFlags.AnyChange | CfgUpdateFlags.InvokeCfgChange);
}
for (ImageRotation ir = 0; ir < ImageRotation.Count; ir++)
{
if (imageRotationComboBox.Text == ir.ToDescription())
{
if (config.ImageRotation != ir)
{
config.ImageRotation = ir;
flags |= (CfgUpdateFlags.AnyChange | CfgUpdateFlags.InvokeCfgChange);
break;
}
}
}
if (resolutionComboBox.Text != config.ImageFrame.ToString())
{
config.ImageFrame = Frame.Parse(resolutionComboBox.Text);
flags |= (CfgUpdateFlags.AnyChange | CfgUpdateFlags.InvokeCfgChange);
}
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
{
Roi.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
}
return flags;
}
#region Configuration Change Handling
public static void OnCmdResponse(object sender, CmdResponseArgs args)
{
if (CmdResponseHandler == null) return;
try { CmdResponseHandler(sender, args); }
catch (Exception e) { log.Error("CmdResponseHandler(...) failed", e); }
}
public static event EventHandler<CmdResponseArgs> CmdResponseHandler;
public void StartResponseHandler() { }
public void StopResponseHandler() { }
#endregion Configuration Change Handling
}
}
@@ -0,0 +1,222 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
namespace TBF.Rig.Network.Camera.RoiForFixedStartCJMS11
{
partial class RoiCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.parentNameLabel = new System.Windows.Forms.Label();
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.parentNameComboBox = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.imageRotationComboBox = new System.Windows.Forms.ComboBox();
this.imageRotationLabel = new System.Windows.Forms.Label();
this.blackAndWhiteCheckBox = new System.Windows.Forms.CheckBox();
this.loResolutionCheckBox = new System.Windows.Forms.CheckBox();
this.label2 = new System.Windows.Forms.Label();
this.resolutionComboBox = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// parentNameLabel
//
this.parentNameLabel.AutoSize = true;
this.parentNameLabel.Location = new System.Drawing.Point(30, 118);
this.parentNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.parentNameLabel.Name = "parentNameLabel";
this.parentNameLabel.Size = new System.Drawing.Size(65, 20);
this.parentNameLabel.TabIndex = 3;
this.parentNameLabel.Text = "Camera";
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(208, 75);
this.nameTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(259, 26);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(30, 80);
this.nameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(51, 20);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(204, 40);
this.classNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(173, 20);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComponentClassName";
//
// parentNameComboBox
//
this.parentNameComboBox.Enabled = false;
this.parentNameComboBox.FormattingEnabled = true;
this.parentNameComboBox.Location = new System.Drawing.Point(208, 114);
this.parentNameComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.parentNameComboBox.Name = "parentNameComboBox";
this.parentNameComboBox.Size = new System.Drawing.Size(259, 28);
this.parentNameComboBox.TabIndex = 4;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(-316, -226);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(87, 20);
this.label1.TabIndex = 5;
this.label1.Text = "Arguments";
//
// textBox1
//
this.textBox1.Enabled = false;
this.textBox1.Location = new System.Drawing.Point(-188, -231);
this.textBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(556, 26);
this.textBox1.TabIndex = 6;
//
// imageRotationComboBox
//
this.imageRotationComboBox.Enabled = false;
this.imageRotationComboBox.FormattingEnabled = true;
this.imageRotationComboBox.Location = new System.Drawing.Point(208, 237);
this.imageRotationComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.imageRotationComboBox.Name = "imageRotationComboBox";
this.imageRotationComboBox.Size = new System.Drawing.Size(138, 28);
this.imageRotationComboBox.TabIndex = 8;
//
// imageRotationLabel
//
this.imageRotationLabel.AutoSize = true;
this.imageRotationLabel.Location = new System.Drawing.Point(30, 242);
this.imageRotationLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.imageRotationLabel.Name = "imageRotationLabel";
this.imageRotationLabel.Size = new System.Drawing.Size(153, 20);
this.imageRotationLabel.TabIndex = 7;
this.imageRotationLabel.Text = "Image rotation (ccw)";
//
// blackAndWhiteCheckBox
//
this.blackAndWhiteCheckBox.AutoSize = true;
this.blackAndWhiteCheckBox.Enabled = false;
this.blackAndWhiteCheckBox.Location = new System.Drawing.Point(208, 166);
this.blackAndWhiteCheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.blackAndWhiteCheckBox.Name = "blackAndWhiteCheckBox";
this.blackAndWhiteCheckBox.Size = new System.Drawing.Size(134, 24);
this.blackAndWhiteCheckBox.TabIndex = 5;
this.blackAndWhiteCheckBox.Text = "Black && White";
this.blackAndWhiteCheckBox.UseVisualStyleBackColor = true;
//
// loResolutionCheckBox
//
this.loResolutionCheckBox.AutoSize = true;
this.loResolutionCheckBox.Enabled = false;
this.loResolutionCheckBox.Location = new System.Drawing.Point(208, 202);
this.loResolutionCheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.loResolutionCheckBox.Name = "loResolutionCheckBox";
this.loResolutionCheckBox.Size = new System.Drawing.Size(137, 24);
this.loResolutionCheckBox.TabIndex = 6;
this.loResolutionCheckBox.Text = "Low resolution";
this.loResolutionCheckBox.UseVisualStyleBackColor = true;
//
// label2
//
this.label2.Location = new System.Drawing.Point(30, 293);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(152, 28);
this.label2.TabIndex = 9;
this.label2.Text = "Choose resolution:";
//
// resolutionComboBox
//
this.resolutionComboBox.DropDownWidth = 259;
this.resolutionComboBox.Enabled = false;
this.resolutionComboBox.FormattingEnabled = true;
this.resolutionComboBox.Location = new System.Drawing.Point(208, 290);
this.resolutionComboBox.Name = "resolutionComboBox";
this.resolutionComboBox.Size = new System.Drawing.Size(262, 28);
this.resolutionComboBox.TabIndex = 10;
//
// RoiCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.resolutionComboBox);
this.Controls.Add(this.label2);
this.Controls.Add(this.imageRotationComboBox);
this.Controls.Add(this.imageRotationLabel);
this.Controls.Add(this.blackAndWhiteCheckBox);
this.Controls.Add(this.loResolutionCheckBox);
this.Controls.Add(this.parentNameComboBox);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.parentNameLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "RoiCfgCtrl";
this.Size = new System.Drawing.Size(750, 462);
this.Load += new System.EventHandler(this.PumpCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.ComboBox resolutionComboBox;
private System.Windows.Forms.Label label2;
#endregion
private System.Windows.Forms.Label parentNameLabel;
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.ComboBox parentNameComboBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.ComboBox imageRotationComboBox;
private System.Windows.Forms.Label imageRotationLabel;
private System.Windows.Forms.CheckBox blackAndWhiteCheckBox;
private System.Windows.Forms.CheckBox loResolutionCheckBox;
}
}
@@ -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,70 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace TBF.Rig.Network.Camera.RoiForFixedStartCJMS11.common
{
public class Frame
{
public int Width { get; set; }
public int Height { get; set; }
public Frame() // standard frame
{
this.Width = 640;
this.Height = 480;
}
public Frame(int width, int height)
{
Width = width;
Height = height;
}
public static Frame StandardFrame()
{
return new Frame();
}
public override string ToString() => $"{Width}x{Height}";
// Static method to parse string like "1920x1080"
public static Frame Parse(string resolution)
{
var match = Regex.Match(resolution, @"^\s*(\d+)\s*[xX]\s*(\d+)\s*$");
if (!match.Success)
{
throw new FormatException($"Invalid resolution format: '{resolution}'");
}
int width = int.Parse(match.Groups[1].Value);
int height = int.Parse(match.Groups[2].Value);
return new Frame(width, height);
}
///
/// Finds nearest frame based on selected dimension
/// <b> example: </b>
/// <code>
/// var input = new Frame(1500, 800);
/// //Nearest by Width
/// var nearestByWidth = input.FindNearest(allFrames, f => f.Width);
/// Console.WriteLine($"Nearest by width: {nearestByWidth}"); // → 1280x720
/// //Nearest by Height
/// var nearestByHeight = input.FindNearest(allFrames, f => f.Height);
/// Console.WriteLine($"Nearest by height: {nearestByHeight}"); // → 1280x720
/// </code>
public Frame FindNearest(IEnumerable<Frame> candidates, Func<Frame, int> dimensionSelector)
{
int target = dimensionSelector(this);
return candidates
.OrderBy(f => Math.Abs(dimensionSelector(f) - target))
.ThenBy(dimensionSelector) // tie-breaker: prefer smaller
.FirstOrDefault();
}
}
}
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace TBF.Rig.Network.Camera.RoiForFixedStartCJMS11.common
{
public class ResolutionFrames : List<Frame>
{
public ResolutionFrames(IEnumerable<Frame> collection) : base(collection)
{
}
public static readonly IReadOnlyList<Frame> CommonResolutions = new List<Frame>
{
new Frame(320, 240),
new Frame(352, 288),
new Frame(640, 480), // standard frame
new Frame(720, 480),
new Frame(1280, 720),
new Frame(1920, 1080),
new Frame(2560, 1440),
new Frame(3840, 2160),
new Frame(4096, 2160)
}.AsReadOnly();
}
}
@@ -0,0 +1,71 @@
using System;
using System.Drawing;
using Common;
namespace TBF.Rig.Network.Camera.common
{
public class ImageUtils
{
public static void Rotate(Image image, ImageRotation direction)
{
if(!(direction == ImageRotation.Deg90 || direction == ImageRotation.Deg180 || direction == ImageRotation.Deg270))
return;
if (image == null)
throw new ArgumentNullException(nameof(image));
RotateFlipType flipType =
direction == ImageRotation.Deg90 ? RotateFlipType.Rotate90FlipNone :
direction == ImageRotation.Deg180 ? RotateFlipType.Rotate180FlipNone :
direction == ImageRotation.Deg270 ? RotateFlipType.Rotate270FlipNone :
RotateFlipType.RotateNoneFlipNone;
image.RotateFlip(flipType);
}
public static Image RotateCustom(Image image, ImageRotation direction)
{
if (image == null)
throw new ArgumentNullException(nameof(image));
int newWidth = image.Width;
int newHeight = image.Height;
RotateFlipType flipType;
switch (direction)
{
case ImageRotation.Deg90:
flipType = RotateFlipType.Rotate90FlipNone;
newWidth = image.Height;
newHeight = image.Width;
break;
case ImageRotation.Deg180:
flipType = RotateFlipType.Rotate180FlipNone;
break;
case ImageRotation.Deg270:
flipType = RotateFlipType.Rotate270FlipNone;
newWidth = image.Height;
newHeight = image.Width;
break;
default:
throw new ArgumentException("Unsupported rotation direction");
}
Bitmap rotated = new Bitmap(newWidth, newHeight);
using (Graphics g = Graphics.FromImage(rotated))
{
g.TranslateTransform(newWidth / 2f, newHeight / 2f);
g.RotateTransform(
direction == ImageRotation.Deg90 ? 90 :
direction == ImageRotation.Deg180 ? 180 :
direction == ImageRotation.Deg270 ? 270 :
0);
g.TranslateTransform(-image.Width / 2f, -image.Height / 2f);
g.DrawImage(image, new PointF(0, 0));
}
return rotated;
}
}
}
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using TBF.Rig.Network.Camera.CJMS11;
namespace TBF.Rig.Network.Telnet
{
@@ -61,6 +63,34 @@ namespace TBF.Rig.Network.Telnet
Response = text;
}
}
/// <summary>
/// Type of argument of PromptReceviedEventHandler
/// </summary>
public class PromptReceivedJMSEventArgs : EventArgs
{
public string Response; /// Response to a command from the telnet server ...
/// ... without the terminal prompt string.
public JmsMessage Message; /// Message received from the server.
public PromptReceivedJMSEventArgs(string text, JmsMessage message)
{
Response = text;
Message = message;
}
}
public class PromptReceivedImageEventArgs : EventArgs
{
public Image image; /// server image.
public int idxCamera; /// camera index.
public PromptReceivedImageEventArgs(int idxCamera, Image image)
{
this.image = image;
this.idxCamera = idxCamera;
}
}
-2
View File
@@ -68,8 +68,6 @@ namespace TBF.Rig.Scales.MettlerToledo
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info
public Shape Shape { get; set; }
+3
View File
@@ -76,11 +76,14 @@ namespace TBF.Rig
new Modbus.WaterAnalyzer.Factory(),
new Network.Adapter.Factory(),
new Network.AdapterFTP.Factory(),
new Network.AdapterJMS.Factory(),
new Network.Camera.CJMS11.Factory(),
new Network.Camera.CLP1611.Factory(),
new Network.Camera.KeyenceIV3G120.Factory(),
new Network.Camera.Display.Factory(),
new Network.Camera.Roi.Factory(),
new Network.Camera.RoiForFixedStart.Factory(),
new Network.Camera.RoiForFixedStartCJMS11.Factory(),
new Network.Camera.RoiForFixedStartKeyence.Factory(),
new Network.Comet.Ambient.Factory(),
new Network.RestAPI.Factory(),
@@ -513,6 +513,8 @@ namespace TBF.Rig.TestMethods.StandingStart
(rr as Rig.Network.Camera.RoiForFixedStart.Roi).BeginWMState = dataEntryCmpnt.WMStartState(i);
if (rr is Rig.Network.Camera.RoiForFixedStartKeyence.Roi)
(rr as Rig.Network.Camera.RoiForFixedStartKeyence.Roi).BeginWMState = dataEntryCmpnt.WMStartState(i);
if (rr is Rig.Network.Camera.RoiForFixedStartCJMS11.Roi)
(rr as Rig.Network.Camera.RoiForFixedStartCJMS11.Roi).BeginWMState = dataEntryCmpnt.WMStartState(i);
}
}
@@ -754,6 +756,15 @@ namespace TBF.Rig.TestMethods.StandingStart
if (rr is Rig.Network.Camera.RoiForFixedStart.Roi)
(rr as Rig.Network.Camera.RoiForFixedStart.Roi).EndWMState = dataEntryCmpnt.WMEndState(i);
if (rr is Rig.Network.Camera.RoiForFixedStartKeyence.Roi)
{
(rr as Rig.Network.Camera.RoiForFixedStartKeyence.Roi).EndWMState =
dataEntryCmpnt.WMEndState(i);
log.DebugFormat(" StandingStartMassCollectionSeq.cs - EndWMState [{0}] -> RoiForFixedStartKeyence.Roi",dataEntryCmpnt.WMEndState(i));
}
if(rr is Rig.Network.Camera.RoiForFixedStartCJMS11.Roi)
(rr as Rig.Network.Camera.RoiForFixedStartCJMS11.Roi).EndWMState = dataEntryCmpnt.WMEndState(i);
}
}
@@ -603,6 +603,8 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
dataEntryCmpnt.WMStartState(i);
log.DebugFormat(" StandingStartMassCollectionSeq.cs - BeginWMState [{0}] -> RoiForFixedStartKeyence.Roi",dataEntryCmpnt.WMStartState(i));
}
if (rr is Rig.Network.Camera.RoiForFixedStartCJMS11.Roi)
(rr as Rig.Network.Camera.RoiForFixedStartCJMS11.Roi).BeginWMState = dataEntryCmpnt.WMStartState(i);
}
}
@@ -936,6 +938,9 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
dataEntryCmpnt.WMEndState(i);
log.DebugFormat(" StandingStartMassCollectionSeq.cs - EndWMState [{0}] -> RoiForFixedStartKeyence.Roi",dataEntryCmpnt.WMEndState(i));
}
if(rr is Rig.Network.Camera.RoiForFixedStartCJMS11.Roi)
(rr as Rig.Network.Camera.RoiForFixedStartCJMS11.Roi).EndWMState = dataEntryCmpnt.WMEndState(i);
}
}
-2
View File
@@ -42,8 +42,6 @@ namespace TBF.Rig.Uni.Diverter
public string CertPath { get; set; }
public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info
public Shape Shape { get; set; }
-69
View File
@@ -91,19 +91,6 @@ namespace TBF.Rig.Uni.FlowMeter
public DateTime CalibValidDate3;
public DateTime CalibValidDate4;
public DateTime CalibValidDate5;
public string CalibType;
public string CalibType1;
public string CalibType2;
public string CalibType3;
public string CalibType4;
public string CalibType5;
public string CalibSerialNo;
public string CalibSerialNo1;
public string CalibSerialNo2;
public string CalibSerialNo3;
public string CalibSerialNo4;
public string CalibSerialNo5;
/// Schematic drawing info
public Shape Shape { get; set; }
@@ -214,34 +201,6 @@ namespace TBF.Rig.Uni.FlowMeter
}
}
public string GetMeterType(int rangeIx1)
{
switch (rangeIx1)
{
default:
case 0: return CalibType;
case 1: return CalibType1;
case 2: return CalibType2;
case 3: return CalibType3;
case 4: return CalibType4;
case 5: return CalibType5;
}
}
public void SetMeterType(int rangeIx1, string type)
{
switch (rangeIx1)
{
default:
case 0: CalibType = type; return;
case 1: CalibType1 = type; return;
case 2: CalibType2 = type; return;
case 3: CalibType3 = type; return;
case 4: CalibType4 = type; return;
case 5: CalibType5 = type; return;
}
}
public void SetCalibCertificate(int rangeIx1, string certificate)
{
switch (rangeIx1)
@@ -326,34 +285,6 @@ namespace TBF.Rig.Uni.FlowMeter
}
}
public string GetMeterSerialNo(int rangeIx1)
{
switch (rangeIx1)
{
default:
case 0: return CalibSerialNo;
case 1: return CalibSerialNo1;
case 2: return CalibSerialNo2;
case 3: return CalibSerialNo3;
case 4: return CalibSerialNo4;
case 5: return CalibSerialNo5;
}
}
public void SetMeterSerialNo(int rangeIx1, string type)
{
switch (rangeIx1)
{
default:
case 0: CalibSerialNo = type; return;
case 1: CalibSerialNo1 = type; return;
case 2: CalibSerialNo2 = type; return;
case 3: CalibSerialNo3 = type; return;
case 4: CalibSerialNo4 = type; return;
case 5: CalibSerialNo5 = type; return;
}
}
public void SetCalibValidDate(int rangeIx1, DateTime calibValidDate)
{
switch (rangeIx1)
+69 -57
View File
@@ -104,21 +104,6 @@
<Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.5.1.1\lib\net462\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="ClosedXML, Version=0.105.0.0, Culture=neutral, PublicKeyToken=fd1eb21b62ae805b, processorArchitecture=MSIL">
<HintPath>..\packages\ClosedXML.0.105.0-rc\lib\netstandard2.0\ClosedXML.dll</HintPath>
</Reference>
<Reference Include="ClosedXML.Parser, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d5f7376574c51ec, processorArchitecture=MSIL">
<HintPath>..\packages\ClosedXML.Parser.2.0.0-preview1\lib\netstandard2.0\ClosedXML.Parser.dll</HintPath>
</Reference>
<Reference Include="DocumentFormat.OpenXml, Version=3.1.1.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
<HintPath>..\packages\DocumentFormat.OpenXml.3.1.1\lib\net46\DocumentFormat.OpenXml.dll</HintPath>
</Reference>
<Reference Include="DocumentFormat.OpenXml.Framework, Version=3.1.1.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
<HintPath>..\packages\DocumentFormat.OpenXml.Framework.3.1.1\lib\net46\DocumentFormat.OpenXml.Framework.dll</HintPath>
</Reference>
<Reference Include="ExcelNumberFormat, Version=1.1.0.0, Culture=neutral, PublicKeyToken=23c6f5d73be07eca, processorArchitecture=MSIL">
<HintPath>..\packages\ExcelNumberFormat.1.1.0\lib\net20\ExcelNumberFormat.dll</HintPath>
</Reference>
<Reference Include="FluentNHibernate">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
</Reference>
@@ -128,9 +113,6 @@
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.HashCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.HashCode.1.1.1\lib\net461\Microsoft.Bcl.HashCode.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="MySql.Data">
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
@@ -149,35 +131,26 @@
<HintPath>..\packages\Oracle.ManagedDataAccess.19.11.0\lib\net40\Oracle.ManagedDataAccess.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="RBush, Version=4.0.0.0, Culture=neutral, PublicKeyToken=c77e27b81f4d0187, processorArchitecture=MSIL">
<HintPath>..\packages\RBush.Signed.4.0.0\lib\net47\RBush.dll</HintPath>
</Reference>
<Reference Include="Renci.SshNet">
<HintPath>..\packages\Renci.SshNet\Renci.SshNet.dll</HintPath>
</Reference>
<Reference Include="SixLabors.Fonts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13, processorArchitecture=MSIL">
<HintPath>..\packages\SixLabors.Fonts.1.0.0\lib\netstandard2.0\SixLabors.Fonts.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Drawing.Common.9.0.5\lib\net462\System.Drawing.Common.dll</HintPath>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.6.2\lib\net462\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
<Reference Include="System.Net.Sockets, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.1\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<Reference Include="System.Numerics" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Security" />
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
@@ -186,7 +159,6 @@
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Boxes\DateTimeBox.cs" />
@@ -839,6 +811,15 @@
<DependentUpon>NetadapterCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Rig\Network\AdapterInfo.cs" />
<Compile Include="Rig\Network\AdapterJMS\Factory.cs" />
<Compile Include="Rig\Network\AdapterJMS\Netadapter.cs" />
<Compile Include="Rig\Network\AdapterJMS\NetadapterCfg.cs" />
<Compile Include="Rig\Network\AdapterJMS\NetadapterCfgCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Rig\Network\AdapterJMS\NetadapterCfgCtrl.designer.cs">
<DependentUpon>NetadapterCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Rig\Network\Adapter\Netadapter.cs" />
<Compile Include="Rig\Network\Adapter\Factory.cs" />
<Compile Include="Rig\Network\Adapter\NetadapterCfg.cs" />
@@ -848,6 +829,33 @@
<Compile Include="Rig\Network\Adapter\NetadapterCfgCtrl.designer.cs">
<DependentUpon>NetadapterCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Rig\Network\Camera\CJMS11\Camera.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\CameraCfg.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\CameraCfgCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Rig\Network\Camera\CJMS11\CameraCfgCtrl.designer.cs">
<DependentUpon>CameraCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Rig\Network\Camera\CJMS11\Factory.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\GrabImagesOp.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\JmsMessage.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\JmsPacket.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\LiveStreamOp.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\POJO\CommandM.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\POJO\CommandMEnum.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\POJO\ImageType.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\POJO\ImageTypeEnum.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\POJO\MessageStatus.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\POJO\MessageStatusEnum.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\POJO\ParsedImage.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\RoisAndResults.cs" />
<Compile Include="Rig\Network\Camera\CJMS11\TerminalDlg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Rig\Network\Camera\CJMS11\TerminalDlg.Designer.cs">
<DependentUpon>TerminalDlg.cs</DependentUpon>
</Compile>
<Compile Include="Rig\Network\Camera\CLP1611\Camera.cs" />
<Compile Include="Rig\Network\Camera\CLP1611\CameraCfg.cs" />
<Compile Include="Rig\Network\Camera\CLP1611\CameraCfgCtrl.cs">
@@ -869,6 +877,7 @@
<Compile Include="Rig\Network\Camera\CLP1611\TerminalDlg.Designer.cs">
<DependentUpon>TerminalDlg.cs</DependentUpon>
</Compile>
<Compile Include="Rig\Network\Camera\common\ImageUtils.cs" />
<Compile Include="Rig\Network\Camera\Display\DisplayForm.cs">
<SubType>Form</SubType>
</Compile>
@@ -896,6 +905,18 @@
<Compile Include="Rig\Network\Camera\KeyenceIV3G120\Factory.cs" />
<Compile Include="Rig\Network\Camera\KeyenceIV3G120\GrabImagesOp.cs" />
<Compile Include="Rig\Network\Camera\KeyenceIV3G120\RoisAndResults.cs" />
<Compile Include="Rig\Network\Camera\RoiForFixedStartCJMS11\common\Frame.cs" />
<Compile Include="Rig\Network\Camera\RoiForFixedStartCJMS11\common\ResolutionFrames.cs" />
<Compile Include="Rig\Network\Camera\RoiForFixedStartCJMS11\Factory.cs" />
<Compile Include="Rig\Network\Camera\RoiForFixedStartCJMS11\ProcedureParams.cs" />
<Compile Include="Rig\Network\Camera\RoiForFixedStartCJMS11\Roi.cs" />
<Compile Include="Rig\Network\Camera\RoiForFixedStartCJMS11\RoiCfg.cs" />
<Compile Include="Rig\Network\Camera\RoiForFixedStartCJMS11\RoiCfgCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Rig\Network\Camera\RoiForFixedStartCJMS11\RoiCfgCtrl.designer.cs">
<DependentUpon>RoiCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Rig\Network\Camera\RoiForFixedStartKeyence\Factory.cs" />
<Compile Include="Rig\Network\Camera\RoiForFixedStartKeyence\ProcedureParams.cs" />
<Compile Include="Rig\Network\Camera\RoiForFixedStartKeyence\Roi.cs" />
@@ -2157,12 +2178,6 @@
<Compile Include="UI\Bench\Metrology\CalibCertificateCtrl.Designer.cs">
<DependentUpon>CalibCertificateCtrl.cs</DependentUpon>
</Compile>
<Compile Include="UI\Bench\Metrology\CalibCertificateExtendedCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UI\Bench\Metrology\CalibCertificateExtendedCtrl.Designer.cs">
<DependentUpon>CalibCertificateExtendedCtrl.cs</DependentUpon>
</Compile>
<Compile Include="UI\Bench\Metrology\IMetrologyDlgTab.cs" />
<Compile Include="UI\Bench\Metrology\MetrologyDlg.cs">
<SubType>Form</SubType>
@@ -2545,7 +2560,6 @@
<Compile Include="UI\ResultsMI\DeleteFromOracleForm.designer.cs">
<DependentUpon>DeleteFromOracleForm.cs</DependentUpon>
</Compile>
<Compile Include="UI\ResultsMI\IPreviousResultDlg.cs" />
<Compile Include="UI\ResultsMI\PreviousResultCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -2559,13 +2573,6 @@
<Compile Include="UI\ResultsMI\PreviousResultsDlg.designer.cs">
<DependentUpon>PreviousResultsDlg.cs</DependentUpon>
</Compile>
<Compile Include="UI\ResultsMI\PreviousResultsDlgUncertainty.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\ResultsMI\PreviousResultsDlgUncertainty.designer.cs">
<DependentUpon>PreviousResultsDlgUncertainty.cs</DependentUpon>
</Compile>
<Compile Include="UI\ResultsMI\PreviousResultsMode.cs" />
<Compile Include="UI\ResultsMI\PrintResultsSelectionDlg.cs">
<SubType>Form</SubType>
</Compile>
@@ -2937,9 +2944,18 @@
<EmbeddedResource Include="Rig\Network\AdapterFTP\NetadapterCfgCtrl.resx">
<DependentUpon>NetadapterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Rig\Network\AdapterJMS\NetadapterCfgCtrl.resx">
<DependentUpon>NetadapterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Rig\Network\Adapter\NetadapterCfgCtrl.resx">
<DependentUpon>NetadapterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Rig\Network\Camera\CJMS11\CameraCfgCtrl.resx">
<DependentUpon>CameraCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Rig\Network\Camera\CJMS11\TerminalDlg.resx">
<DependentUpon>TerminalDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Rig\Network\Camera\CLP1611\CameraCfgCtrl.resx">
<DependentUpon>CameraCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
@@ -2955,6 +2971,9 @@
<EmbeddedResource Include="Rig\Network\Camera\KeyenceIV3G120\CameraCfgCtrl.resx">
<DependentUpon>CameraCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Rig\Network\Camera\RoiForFixedStartCJMS11\RoiCfgCtrl.resx">
<DependentUpon>RoiCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Rig\Network\Camera\RoiForFixedStartKeyence\RoiCfgCtrl.resx">
<DependentUpon>RoiCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
@@ -3290,9 +3309,6 @@
<EmbeddedResource Include="UI\Bench\Metrology\CalibCertificateCtrl.resx">
<DependentUpon>CalibCertificateCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\Bench\Metrology\CalibCertificateExtendedCtrl.resx">
<DependentUpon>CalibCertificateExtendedCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\Bench\Metrology\MetrologyDlg.resx">
<DependentUpon>MetrologyDlg.cs</DependentUpon>
</EmbeddedResource>
@@ -3473,9 +3489,6 @@
<EmbeddedResource Include="UI\ResultsMI\PreviousResultsDlg.resx">
<DependentUpon>PreviousResultsDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\ResultsMI\PreviousResultsDlgUncertainty.resx">
<DependentUpon>PreviousResultsDlgUncertainty.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\ResultsMI\PrintResultsSelectionDlg.resx">
<DependentUpon>PrintResultsSelectionDlg.cs</DependentUpon>
</EmbeddedResource>
@@ -3641,7 +3654,6 @@
</Content>
<Content Include="Pictures\sample.bmp" />
<None Include="Resources\Barcode.png" />
<Content Include="ReadMe.md" />
<Content Include="Resources\empty.png" />
<None Include="Resources\qrcode-48x48.png" />
<Content Include="Resources\switch-off.png" />
@@ -1,216 +0,0 @@
namespace TBF.UI.Bench.Metrology
{
partial class CalibCertificateExtendedCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBox = new System.Windows.Forms.GroupBox();
this.textBox_SerialNo = new System.Windows.Forms.TextBox();
this.label_SerialNo = new System.Windows.Forms.Label();
this.textBox_Type = new System.Windows.Forms.TextBox();
this.label_Type = new System.Windows.Forms.Label();
this.certIdLabel = new System.Windows.Forms.Label();
this.openCertificateButton = new System.Windows.Forms.Button();
this.showCertificateButton = new System.Windows.Forms.Button();
this.calibExpirationDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.calibValidDateLabel = new System.Windows.Forms.Label();
this.calibDateLabel = new System.Windows.Forms.Label();
this.calibCertificateNrTextBox = new System.Windows.Forms.TextBox();
this.groupBox.SuspendLayout();
this.SuspendLayout();
//
// groupBox
//
this.groupBox.Controls.Add(this.textBox_SerialNo);
this.groupBox.Controls.Add(this.label_SerialNo);
this.groupBox.Controls.Add(this.textBox_Type);
this.groupBox.Controls.Add(this.label_Type);
this.groupBox.Controls.Add(this.certIdLabel);
this.groupBox.Controls.Add(this.openCertificateButton);
this.groupBox.Controls.Add(this.showCertificateButton);
this.groupBox.Controls.Add(this.calibExpirationDateTimePicker);
this.groupBox.Controls.Add(this.calibDateTimePicker);
this.groupBox.Controls.Add(this.calibValidDateLabel);
this.groupBox.Controls.Add(this.calibDateLabel);
this.groupBox.Controls.Add(this.calibCertificateNrTextBox);
this.groupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox.Location = new System.Drawing.Point(0, 0);
this.groupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.groupBox.Name = "groupBox";
this.groupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.groupBox.Size = new System.Drawing.Size(360, 218);
this.groupBox.TabIndex = 0;
this.groupBox.TabStop = false;
this.groupBox.Text = "Calibration certificate";
//
// textBox_SerialNo
//
this.textBox_SerialNo.Enabled = false;
this.textBox_SerialNo.Location = new System.Drawing.Point(111, 178);
this.textBox_SerialNo.Name = "textBox_SerialNo";
this.textBox_SerialNo.Size = new System.Drawing.Size(239, 26);
this.textBox_SerialNo.TabIndex = 33;
//
// label_SerialNo
//
this.label_SerialNo.Location = new System.Drawing.Point(14, 181);
this.label_SerialNo.Name = "label_SerialNo";
this.label_SerialNo.Size = new System.Drawing.Size(81, 23);
this.label_SerialNo.TabIndex = 32;
this.label_SerialNo.Text = "Serial. No";
//
// textBox_Type
//
this.textBox_Type.Enabled = false;
this.textBox_Type.Location = new System.Drawing.Point(111, 137);
this.textBox_Type.Name = "textBox_Type";
this.textBox_Type.Size = new System.Drawing.Size(239, 26);
this.textBox_Type.TabIndex = 31;
//
// label_Type
//
this.label_Type.Location = new System.Drawing.Point(14, 140);
this.label_Type.Name = "label_Type";
this.label_Type.Size = new System.Drawing.Size(81, 23);
this.label_Type.TabIndex = 30;
this.label_Type.Text = "Type";
//
// certIdLabel
//
this.certIdLabel.AutoSize = true;
this.certIdLabel.Location = new System.Drawing.Point(14, 40);
this.certIdLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.certIdLabel.Name = "certIdLabel";
this.certIdLabel.Size = new System.Drawing.Size(26, 20);
this.certIdLabel.TabIndex = 29;
this.certIdLabel.Text = "ID";
//
// openCertificateButton
//
this.openCertificateButton.Enabled = false;
this.openCertificateButton.Location = new System.Drawing.Point(266, 34);
this.openCertificateButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.openCertificateButton.Name = "openCertificateButton";
this.openCertificateButton.Size = new System.Drawing.Size(84, 40);
this.openCertificateButton.TabIndex = 28;
this.openCertificateButton.Text = "Path";
this.openCertificateButton.UseVisualStyleBackColor = true;
this.openCertificateButton.Click += new System.EventHandler(this.openCertificateButton_Click);
//
// showCertificateButton
//
this.showCertificateButton.Location = new System.Drawing.Point(266, 74);
this.showCertificateButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.showCertificateButton.Name = "showCertificateButton";
this.showCertificateButton.Size = new System.Drawing.Size(84, 60);
this.showCertificateButton.TabIndex = 27;
this.showCertificateButton.Text = "Show";
this.showCertificateButton.UseVisualStyleBackColor = true;
this.showCertificateButton.Click += new System.EventHandler(this.showCertificateButton_Click);
//
// calibExpirationDateTimePicker
//
this.calibExpirationDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibExpirationDateTimePicker.Enabled = false;
this.calibExpirationDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibExpirationDateTimePicker.Location = new System.Drawing.Point(111, 103);
this.calibExpirationDateTimePicker.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.calibExpirationDateTimePicker.Name = "calibExpirationDateTimePicker";
this.calibExpirationDateTimePicker.Size = new System.Drawing.Size(144, 26);
this.calibExpirationDateTimePicker.TabIndex = 26;
//
// calibDateTimePicker
//
this.calibDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.calibDateTimePicker.Enabled = false;
this.calibDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.calibDateTimePicker.Location = new System.Drawing.Point(111, 69);
this.calibDateTimePicker.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.calibDateTimePicker.Name = "calibDateTimePicker";
this.calibDateTimePicker.Size = new System.Drawing.Size(144, 26);
this.calibDateTimePicker.TabIndex = 25;
//
// calibValidDateLabel
//
this.calibValidDateLabel.AutoSize = true;
this.calibValidDateLabel.Location = new System.Drawing.Point(14, 108);
this.calibValidDateLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.calibValidDateLabel.Name = "calibValidDateLabel";
this.calibValidDateLabel.Size = new System.Drawing.Size(77, 20);
this.calibValidDateLabel.TabIndex = 24;
this.calibValidDateLabel.Text = "Valid until";
//
// calibDateLabel
//
this.calibDateLabel.AutoSize = true;
this.calibDateLabel.Location = new System.Drawing.Point(14, 74);
this.calibDateLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.calibDateLabel.Name = "calibDateLabel";
this.calibDateLabel.Size = new System.Drawing.Size(44, 20);
this.calibDateLabel.TabIndex = 23;
this.calibDateLabel.Text = "Date";
//
// calibCertificateNrTextBox
//
this.calibCertificateNrTextBox.Enabled = false;
this.calibCertificateNrTextBox.Location = new System.Drawing.Point(111, 35);
this.calibCertificateNrTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.calibCertificateNrTextBox.Name = "calibCertificateNrTextBox";
this.calibCertificateNrTextBox.Size = new System.Drawing.Size(144, 26);
this.calibCertificateNrTextBox.TabIndex = 22;
//
// CalibCertificateExtendedCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox);
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "CalibCertificateExtendedCtrl";
this.Size = new System.Drawing.Size(360, 218);
this.groupBox.ResumeLayout(false);
this.groupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TextBox textBox_SerialNo;
private System.Windows.Forms.Label label_SerialNo;
private System.Windows.Forms.TextBox textBox_Type;
private System.Windows.Forms.Label label_Type;
private System.Windows.Forms.GroupBox groupBox;
private System.Windows.Forms.Button openCertificateButton;
private System.Windows.Forms.Button showCertificateButton;
private System.Windows.Forms.DateTimePicker calibExpirationDateTimePicker;
private System.Windows.Forms.DateTimePicker calibDateTimePicker;
private System.Windows.Forms.Label calibValidDateLabel;
private System.Windows.Forms.Label calibDateLabel;
private System.Windows.Forms.TextBox calibCertificateNrTextBox;
private System.Windows.Forms.Label certIdLabel;
}
}
@@ -1,151 +0,0 @@
///
/// Copyright (c) 2023 Sensus Slovensko a.s.
///
using System;
using System.IO;
using System.Windows.Forms;
using TBF.Resources;
using TBF.Rig.GenericDevices;
namespace TBF.UI.Bench.Metrology
{
public partial class CalibCertificateExtendedCtrl : UserControl
{
string certPath; /// Path to a calibration certificate PDF document
ToolTip toolTip;
public CalibCertificateExtendedCtrl()
{
InitializeComponent();
Localize();
certPath = string.Empty;
calibDateTimePicker.CustomFormat = Constants.DateFormat;
calibDateTimePicker.MinDate = Constants.MinDate;
calibExpirationDateTimePicker.CustomFormat = Constants.DateFormat;
calibExpirationDateTimePicker.MinDate = Constants.MinDate;
toolTip = new ToolTip();
toolTip.UseFading = true;
toolTip.UseAnimation = true;
toolTip.IsBalloon = true;
toolTip.ShowAlways = true;
toolTip.AutoPopDelay = 1000;
toolTip.InitialDelay = 1000;
toolTip.ReshowDelay = 500;
toolTip.SetToolTip(showCertificateButton, certPath);
}
void Localize()
{
groupBox.Text = Strings.Calibration_certificate;
calibDateLabel.Text = Strings.Date;
calibValidDateLabel.Text = Strings.Valid_until;
showCertificateButton.Text = Strings.Show;
label_SerialNo.Text = Strings.SerialNr;
label_Type.Text = Strings.Type;
}
public void Unlock()
{
calibCertificateNrTextBox.Enabled = true;
calibDateTimePicker.Enabled = true;
calibExpirationDateTimePicker.Enabled = true;
openCertificateButton.Enabled = true;
showCertificateButton.Enabled = true;
textBox_SerialNo.Enabled = true;
textBox_Type.Enabled = true;
}
public void Refresh(ICalibInfoCfg calibInfoCfg)
{
calibCertificateNrTextBox.Text = calibInfoCfg.CalibCertificateNr;
certPath = calibInfoCfg.CertPath;
calibDateTimePicker.Value = (calibInfoCfg.CalibDate < Constants.MinDate) ? Constants.MinDate : calibInfoCfg.CalibDate;
calibExpirationDateTimePicker.Value = (calibInfoCfg.CalibValidDate < Constants.MinDate) ? Constants.MinDate : calibInfoCfg.CalibValidDate;
textBox_SerialNo.Text = calibInfoCfg.MeterSerialNo;
textBox_Type.Text = calibInfoCfg.MeterType;
toolTip.SetToolTip(showCertificateButton, certPath);
}
public void Update(ICalibInfoCfg calibInfoCfg)
{
calibInfoCfg.CalibCertificateNr = calibCertificateNrTextBox.Text;
calibInfoCfg.CertPath = certPath;
calibInfoCfg.CalibDate = calibDateTimePicker.Value;
calibInfoCfg.CalibValidDate = calibExpirationDateTimePicker.Value;
calibInfoCfg.MeterSerialNo = textBox_SerialNo.Text;
calibInfoCfg.MeterType = textBox_Type.Text;
}
public void Refresh(ICalibRangesCfg calibRangesCfg, int rngIx)
{
calibCertificateNrTextBox.Text = calibRangesCfg.GetCalibCertificate(rngIx);
certPath = calibRangesCfg.GetCertPath(rngIx);
calibDateTimePicker.Value = (calibRangesCfg.GetCalibDate(rngIx) < Constants.MinDate) ? Constants.MinDate : calibRangesCfg.GetCalibDate(rngIx);
calibExpirationDateTimePicker.Value = (calibRangesCfg.GetCalibValidDate(rngIx) < Constants.MinDate) ? Constants.MinDate : calibRangesCfg.GetCalibValidDate(rngIx);
textBox_SerialNo.Text = calibRangesCfg.GetMeterSerialNo(rngIx);
textBox_Type.Text = calibRangesCfg.GetMeterType(rngIx);
toolTip.SetToolTip(showCertificateButton, certPath);
}
public void Update(ICalibRangesCfg calibRangesCfg, int rngIx)
{
calibRangesCfg.SetCalibCertificate(rngIx, calibCertificateNrTextBox.Text);
calibRangesCfg.SetCertPath(rngIx, certPath);
calibRangesCfg.SetCalibDate(rngIx, calibDateTimePicker.Value);
calibRangesCfg.SetCalibValidDate(rngIx, calibExpirationDateTimePicker.Value);
}
private void openCertificateButton_Click(object sender, EventArgs e)
{
var openFileDialog = new OpenFileDialog()
{
CheckFileExists = true,
InitialDirectory = @"C:\TBF\Certificates",
Filter = string.Format("{0} (*.pdf)|*.pdf|{1} (*.*)|*.*", Strings.PDF_files, Strings.All_files),
};
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
certPath = openFileDialog.FileName;
toolTip.SetToolTip(showCertificateButton, certPath);
}
}
private void showCertificateButton_Click(object sender, EventArgs e)
{
var apps = new string[] { @"C:\Program Files\Microsoft\Edge\Application\msedge.exe",
@"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe",
@"C:\Program Files\Mozilla Firefox\firefox.exe",
@"C:\Program Files (x86)\Mozilla Firefox\firefox.exe",
@"C:\Program Files\Google\Chrome\Application\chrome.exe",
@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" };
if (!string.IsNullOrEmpty(certPath) && File.Exists(certPath))
{
foreach (var app in apps)
{
if (File.Exists(app))
{
using (var process = new System.Diagnostics.Process())
{
process.StartInfo.FileName = app;
process.StartInfo.Arguments = certPath.Replace(" ", "%20"); ///argument
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
process.Start();
}
break;
}
}
}
}
}
}
@@ -52,8 +52,6 @@ namespace TBF.UI.Bench.Metrology
Control measurementTextBox;
Control correctionTextBox;
Control errorTextBox;
Control uncertaintyTextBox;
Control readabilityTextBox;
Unit currentUnit;
@@ -83,8 +81,6 @@ namespace TBF.UI.Bench.Metrology
this.Controls.Add(measurementTextBox = new TextBox());
this.Controls.Add(correctionTextBox = new TextBox());
this.Controls.Add(errorTextBox = new TextBox());
this.Controls.Add(uncertaintyTextBox = new TextBox());
this.Controls.Add(readabilityTextBox = new TextBox());
currentUnit = TBF.Rig.Sequences.ProcessData.ElectricUnit;
unitComboBox.Text = currentUnit.ToDescription();
@@ -103,8 +99,6 @@ namespace TBF.UI.Bench.Metrology
lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [{1}]", Strings.Current, unit.ToDescription()), Width = 100 });
lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [{1}]", Strings.Correction, unit.ToDescription()), Width = 100 });
lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [%]", Strings.Error), Width = 100 });
lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [%]", Strings.Uncertainty), Width = 100 });
lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [%]", Strings.Readability), Width = 100 });
measuredLabel.Text = string.Format("{0} [{1}]:", Strings.Measured, unit.ToDescription());
correctedLabel.Text = string.Format("{0} [{1}]:", Strings.Corrected, unit.ToDescription());
@@ -138,7 +132,6 @@ namespace TBF.UI.Bench.Metrology
: Units.ConvertTo(currentUnit, trueValue) - Units.ConvertTo(currentUnit, corr.Measurement);
lvi.SubItems.Add(Common.Utils.ToNiceString(difference, SignifDigits));
//error
if (corr.Measurement == 0)
{
lvi.SubItems.Add(Strings.NaN);
@@ -148,11 +141,6 @@ namespace TBF.UI.Bench.Metrology
double error = Formulas.ErrorFromVolumes(corr.Measurement, trueValue);
lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits));
}
//uncertainty
lvi.SubItems.Add(Common.Utils.ToNiceString(corr.Uncertainty, SignifDigits));
lvi.SubItems.Add(Common.Utils.ToNiceString(corr.Readability, SignifDigits));
listViewEx.Items.Add(lvi);
}
@@ -170,14 +158,6 @@ namespace TBF.UI.Bench.Metrology
else if (unlocked && e.SubItem == 3)
{
listViewEx.StartEditing(correctionTextBox, e.Item, e.SubItem);
}
else if (unlocked && e.SubItem == 4)
{
listViewEx.StartEditing(uncertaintyTextBox, e.Item, e.SubItem);
}
else if (unlocked && e.SubItem == 5)
{
listViewEx.StartEditing(readabilityTextBox, e.Item, e.SubItem);
}
}
@@ -201,8 +181,6 @@ namespace TBF.UI.Bench.Metrology
double difference; /// Correction in selected unit
double correction; /// Correction in default unit
double error = 0;
double uncertainty = 0;
double readability = 0;
if (subItem == 1 && Utils.TryParseEDouble(strValue, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) >= 0)
{
@@ -270,32 +248,6 @@ namespace TBF.UI.Bench.Metrology
return true;
}
else if (subItem == 4 && ((strValue == Strings.NaN) || Utils.TryParseEDouble(strValue, out uncertainty)))
{
if (strValue == Strings.NaN)
{
}
else
{
(item.Tag as MeasurementCorrection).Uncertainty = uncertainty;
item.SubItems[4].Text = Common.Utils.ToNiceString(uncertainty, SignifDigits);
}
return true;
}
else if (subItem == 5 && ((strValue == Strings.NaN) || Utils.TryParseEDouble(strValue, out readability)))
{
if (strValue == Strings.NaN)
{
}
else
{
(item.Tag as MeasurementCorrection).Readability = readability;
item.SubItems[4].Text = Common.Utils.ToNiceString(readability, SignifDigits);
}
return true;
}
else
{
return false;
@@ -48,8 +48,6 @@ namespace TBF.UI.Bench.Metrology
bool unlocked;
Control measurementTextBox;
Control correctionTextBox;
Control uncertaintyTextBox;
Control readabilityTextBox;
public MetrologyDlgDiverterTab()
@@ -78,12 +76,8 @@ namespace TBF.UI.Bench.Metrology
/// Panel2
measurementTextBox = new TextBox();
correctionTextBox = new TextBox();
uncertaintyTextBox = new TextBox();
readabilityTextBox = new TextBox();
this.Controls.Add(measurementTextBox);
this.Controls.Add(correctionTextBox);
this.Controls.Add(uncertaintyTextBox);
this.Controls.Add(readabilityTextBox);
listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked);
listViewEx.SubItemRightClicked += new SubItemEventHandler(listViewEx_SubItemRightClicked);
@@ -92,8 +86,6 @@ namespace TBF.UI.Bench.Metrology
listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Nr, Width = 60 });
listViewEx.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [m3/h]", Strings.Flow), Width = 100 });
listViewEx.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [ms]", Strings.Correction), Width = 100 });
listViewEx.Columns.Add(new ColumnHeader() {Text = string.Format("{0} [%]", Strings.Uncertainty), Width = 100});
listViewEx.Columns.Add(new ColumnHeader() {Text = string.Format("{0} [%]", Strings.Readability), Width = 100});
RefreshAll();
}
@@ -127,8 +119,6 @@ namespace TBF.UI.Bench.Metrology
ListViewItem lvi = new ListViewItem(nr.ToString());
lvi.SubItems.Add(corr.Measurement.ToString());
lvi.SubItems.Add((1000 * corr.Correction).ToString());
lvi.SubItems.Add(corr.Uncertainty.ToString());
lvi.SubItems.Add(corr.Readability.ToString());
lvi.Tag = corr;
listViewEx.Items.Add(lvi);
}
@@ -143,19 +133,11 @@ namespace TBF.UI.Bench.Metrology
{
listViewEx.StartEditing(correctionTextBox, e.Item, e.SubItem);
}
else if (unlocked && e.SubItem == 3)
{
listViewEx.StartEditing(uncertaintyTextBox, e.Item, e.SubItem);
}
else if (unlocked && e.SubItem == 4)
{
listViewEx.StartEditing(readabilityTextBox, e.Item, e.SubItem);
}
}
void listViewEx_SubItemRightClicked(object sender, SubItemEventArgs e)
{
if (!unlocked || e.SubItem < 1 || e.SubItem > 3) return;
if (!unlocked || e.SubItem < 1 || e.SubItem > 2) return;
if (DialogResult.Yes == MessageBox.Show(Strings.Do_you_want_to_copy_this_value_to_all_cells_below_this_cell,
Strings.Confirmation, MessageBoxButtons.YesNo, MessageBoxIcon.Question))
@@ -207,17 +189,6 @@ namespace TBF.UI.Bench.Metrology
(item.Tag as MeasurementCorrection).Correction = fvalue / 1000;
return true;
}
else if (subItem == 3 && Utils.TryParseEFloat(value, out fvalue))
{
(item.Tag as MeasurementCorrection).Uncertainty = fvalue ;
return true;
}
else if (subItem == 4 && Utils.TryParseEFloat(value, out fvalue))
{
(item.Tag as MeasurementCorrection).Readability = fvalue ;
return true;
}
else
{
return false;
@@ -48,8 +48,6 @@ namespace TBF.UI.Bench.Metrology
bool unlocked;
Control measurementTextBox;
Control correctionTextBox;
Control uncertaintyTextBox;
Control readabilityTextBox;
public MetrologyDlgEvaporationTab()
@@ -78,12 +76,8 @@ namespace TBF.UI.Bench.Metrology
/// Panel2
measurementTextBox = new TextBox();
correctionTextBox = new TextBox();
uncertaintyTextBox = new TextBox();
readabilityTextBox = new TextBox();
this.Controls.Add(measurementTextBox);
this.Controls.Add(correctionTextBox);
this.Controls.Add(uncertaintyTextBox);
this.Controls.Add(readabilityTextBox);
listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked);
listViewEx.SubItemRightClicked += new SubItemEventHandler(listViewEx_SubItemRightClicked);
@@ -92,8 +86,6 @@ namespace TBF.UI.Bench.Metrology
listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Nr, Width = 60 });
listViewEx.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [°C]", Strings.Temperature), Width = 100 });
listViewEx.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [g/hour]", Strings.Evaporation), Width = 100 });
listViewEx.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [%]", Strings.Uncertainty), Width = 100 });
listViewEx.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [%]", Strings.Readability), Width = 100 });
RefreshAll();
}
@@ -124,8 +116,6 @@ namespace TBF.UI.Bench.Metrology
ListViewItem lvi = new ListViewItem(nr.ToString());
lvi.SubItems.Add(corr.Measurement.ToString());
lvi.SubItems.Add((1000 * corr.Correction).ToString());
lvi.SubItems.Add(corr.Uncertainty.ToString());
lvi.SubItems.Add(corr.Readability.ToString());
lvi.Tag = corr;
listViewEx.Items.Add(lvi);
}
@@ -140,14 +130,6 @@ namespace TBF.UI.Bench.Metrology
{
listViewEx.StartEditing(correctionTextBox, e.Item, e.SubItem);
}
else if (unlocked && e.SubItem == 3)
{
listViewEx.StartEditing(uncertaintyTextBox, e.Item, e.SubItem);
}
else if (unlocked && e.SubItem == 4)
{
listViewEx.StartEditing(readabilityTextBox, e.Item, e.SubItem);
}
}
void listViewEx_SubItemRightClicked(object sender, SubItemEventArgs e)
@@ -204,16 +186,6 @@ namespace TBF.UI.Bench.Metrology
(item.Tag as MeasurementCorrection).Correction = fvalue / 1000;
return true;
}
else if (subItem == 3 && Utils.TryParseEFloat(value, out fvalue))
{
(item.Tag as MeasurementCorrection).Uncertainty = fvalue;
return true;
}
else if (subItem == 4 && Utils.TryParseEFloat(value, out fvalue))
{
(item.Tag as MeasurementCorrection).Readability = fvalue;
return true;
}
else
{
return false;
@@ -52,8 +52,6 @@ namespace TBF.UI.Bench.Metrology
Control measurementTextBox;
Control correctionTextBox;
Control errorTextBox;
Control uncertaintyTextBox;
Control readabilityTextBox;
readonly int rangeIx; /// 0 (no range) or 1..5 (range #)
readonly bool isLastFlowMeterRange; /// true when this is the last range of this flow meter.
/// This is to prevent double saving of the meter entity to a DB
@@ -98,8 +96,6 @@ namespace TBF.UI.Bench.Metrology
this.Controls.Add(measurementTextBox = new TextBox());
this.Controls.Add(correctionTextBox = new TextBox());
this.Controls.Add(errorTextBox = new TextBox());
this.Controls.Add(uncertaintyTextBox = new TextBox());
this.Controls.Add(readabilityTextBox = new TextBox());
currentUnit = TBF.Rig.Sequences.ProcessData.FlowUnit;
unitComboBox.Text = currentUnit.ToDescription();
@@ -118,8 +114,6 @@ namespace TBF.UI.Bench.Metrology
lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [{1}]", Strings.Flow, unit.ToDescription()), Width = 120 });
lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [{1}]", Strings.Correction, unit.ToDescription()), Width = 150 });
lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [%]", Strings.Error), Width = 100 });
lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [%]", Strings.Uncertainty), Width = 100 });
lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [%]", Strings.Readability), Width = 100 });
measuredLabel.Text = string.Format("{0} [{1}]:", Strings.Measured, unit.ToDescription());
correctedLabel.Text = string.Format("{0} [{1}]:", Strings.Corrected, unit.ToDescription());
@@ -169,9 +163,6 @@ namespace TBF.UI.Bench.Metrology
lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits));
}
lvi.SubItems.Add(corr.Uncertainty.ToString());
lvi.SubItems.Add(corr.Readability.ToString());
listViewEx.Items.Add(lvi);
}
@@ -188,14 +179,6 @@ namespace TBF.UI.Bench.Metrology
else if (unlocked && e.SubItem == 3)
{
listViewEx.StartEditing(correctionTextBox, e.Item, e.SubItem);
}
else if (unlocked && e.SubItem == 4)
{
listViewEx.StartEditing(uncertaintyTextBox, e.Item, e.SubItem);
}
else if (unlocked && e.SubItem == 5)
{
listViewEx.StartEditing(readabilityTextBox, e.Item, e.SubItem);
}
}
@@ -219,8 +202,6 @@ namespace TBF.UI.Bench.Metrology
double difference; /// Correction in selected unit
double correction; /// Correction in default unit
double error = 0;
double uncertainty;
double readibility;
if (subItem == 1 && Utils.TryParseEDouble(strValue, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) >= 0)
{
@@ -288,36 +269,6 @@ namespace TBF.UI.Bench.Metrology
return true;
}
if (subItem == 4 && Utils.TryParseEDouble(strValue, out uncertainty))
{
(item.Tag as MeasurementCorrection).Uncertainty = uncertainty;
if (uncertainty == 0.0f)
{
item.SubItems[3].Text = Strings.NaN;
}
else
{
item.SubItems[3].Text = Common.Utils.ToNiceString(uncertainty, SignifDigits);
}
return true;
}
if (subItem == 5 && Utils.TryParseEDouble(strValue, out readibility))
{
(item.Tag as MeasurementCorrection).Readability = readibility;
if (readibility == 0.0f)
{
item.SubItems[3].Text = Strings.NaN;
}
else
{
item.SubItems[3].Text = Common.Utils.ToNiceString(readibility, SignifDigits);
}
return true;
}
else
{
return false;
@@ -48,8 +48,6 @@ namespace TBF.UI.Bench.Metrology
bool unlocked;
Control measurementTextBox;
Control correctionTextBox;
Control uncertaintyTextBox;
Control readabilityTextBox;
public MetrologyDlgLevelMeterTab()
@@ -78,12 +76,8 @@ namespace TBF.UI.Bench.Metrology
/// Panel2
measurementTextBox = new TextBox();
correctionTextBox = new TextBox();
uncertaintyTextBox = new TextBox();
readabilityTextBox = new TextBox();
this.Controls.Add(measurementTextBox);
this.Controls.Add(correctionTextBox);
this.Controls.Add(uncertaintyTextBox);
this.Controls.Add(readabilityTextBox);
listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked);
listViewEx.SubItemRightClicked += new SubItemEventHandler(listViewEx_SubItemRightClicked);
@@ -92,8 +86,6 @@ namespace TBF.UI.Bench.Metrology
listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Nr, Width = 60 });
listViewEx.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [mm]", Strings.Level), Width = 100 });
listViewEx.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [mm]", Strings.Correction), Width = 100 });
listViewEx.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [%]", Strings.Uncertainty), Width = 100 });
listViewEx.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [%]", Strings.Readability), Width = 100 });
RefreshAll();
}
@@ -124,8 +116,6 @@ namespace TBF.UI.Bench.Metrology
ListViewItem lvi = new ListViewItem(nr.ToString());
lvi.SubItems.Add(corr.Measurement.ToString());
lvi.SubItems.Add((corr.Correction).ToString());
lvi.SubItems.Add((corr.Uncertainty).ToString());
lvi.SubItems.Add((corr.Readability).ToString());
lvi.Tag = corr;
listViewEx.Items.Add(lvi);
}
@@ -196,16 +186,6 @@ namespace TBF.UI.Bench.Metrology
(item.Tag as MeasurementCorrection).Correction = fvalue;
return true;
}
else if (subItem == 3 && Utils.TryParseEFloat(value, out fvalue))
{
(item.Tag as MeasurementCorrection).Uncertainty = fvalue;
return true;
}
else if (subItem == 4 && Utils.TryParseEFloat(value, out fvalue))
{
(item.Tag as MeasurementCorrection).Readability = fvalue;
return true;
}
else
{
return false;
+169 -183
View File
@@ -25,192 +25,178 @@ namespace TBF.UI.Bench.Metrology
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateExtendedCtrl();
this.unitLabel = new System.Windows.Forms.Label();
this.unitComboBox = new System.Windows.Forms.ComboBox();
this.testGroupBox = new System.Windows.Forms.GroupBox();
this.correctedTextBox = new System.Windows.Forms.TextBox();
this.measuredTextBox = new System.Windows.Forms.TextBox();
this.correctedLabel = new System.Windows.Forms.Label();
this.measuredLabel = new System.Windows.Forms.Label();
this.componentLabel = new System.Windows.Forms.Label();
this.cmpntNameLabel = new System.Windows.Forms.Label();
this.listViewEx = new Common.Forms.ListViewEx();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.testGroupBox.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl);
this.splitContainer1.Panel1.Controls.Add(this.unitLabel);
this.splitContainer1.Panel1.Controls.Add(this.unitComboBox);
this.splitContainer1.Panel1.Controls.Add(this.testGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.componentLabel);
this.splitContainer1.Panel1.Controls.Add(this.cmpntNameLabel);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.listViewEx);
this.splitContainer1.Size = new System.Drawing.Size(975, 462);
this.splitContainer1.SplitterDistance = 158;
this.splitContainer1.SplitterWidth = 6;
this.splitContainer1.TabIndex = 2;
//
// calibCertificateCtrl
//
this.calibCertificateCtrl.Location = new System.Drawing.Point(294, 14);
this.calibCertificateCtrl.Margin = new System.Windows.Forms.Padding(6, 8, 6, 8);
this.calibCertificateCtrl.Name = "calibCertificateCtrl";
this.calibCertificateCtrl.Size = new System.Drawing.Size(360, 211);
this.calibCertificateCtrl.TabIndex = 11;
//
// unitLabel
//
this.unitLabel.AutoSize = true;
this.unitLabel.Location = new System.Drawing.Point(21, 86);
this.unitLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.unitLabel.Name = "unitLabel";
this.unitLabel.Size = new System.Drawing.Size(126, 20);
this.unitLabel.TabIndex = 10;
this.unitLabel.Text = "Unit of pressure:";
//
// unitComboBox
//
this.unitComboBox.FormattingEnabled = true;
this.unitComboBox.Location = new System.Drawing.Point(184, 82);
this.unitComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.unitComboBox.Name = "unitComboBox";
this.unitComboBox.Size = new System.Drawing.Size(91, 28);
this.unitComboBox.TabIndex = 9;
this.unitComboBox.SelectedIndexChanged += new System.EventHandler(this.unitComboBox_SelectedIndexChanged);
//
// testGroupBox
//
this.testGroupBox.Controls.Add(this.correctedTextBox);
this.testGroupBox.Controls.Add(this.measuredTextBox);
this.testGroupBox.Controls.Add(this.correctedLabel);
this.testGroupBox.Controls.Add(this.measuredLabel);
this.testGroupBox.Location = new System.Drawing.Point(663, 14);
this.testGroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.testGroupBox.Name = "testGroupBox";
this.testGroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.testGroupBox.Size = new System.Drawing.Size(300, 154);
this.testGroupBox.TabIndex = 4;
this.testGroupBox.TabStop = false;
this.testGroupBox.Text = "Test";
//
// correctedTextBox
//
this.correctedTextBox.Location = new System.Drawing.Point(172, 75);
this.correctedTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.correctedTextBox.Name = "correctedTextBox";
this.correctedTextBox.ReadOnly = true;
this.correctedTextBox.Size = new System.Drawing.Size(108, 26);
this.correctedTextBox.TabIndex = 5;
//
// measuredTextBox
//
this.measuredTextBox.Location = new System.Drawing.Point(172, 37);
this.measuredTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.measuredTextBox.Name = "measuredTextBox";
this.measuredTextBox.Size = new System.Drawing.Size(108, 26);
this.measuredTextBox.TabIndex = 4;
this.measuredTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged);
//
// correctedLabel
//
this.correctedLabel.AutoSize = true;
this.correctedLabel.Location = new System.Drawing.Point(10, 80);
this.correctedLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.correctedLabel.Name = "correctedLabel";
this.correctedLabel.Size = new System.Drawing.Size(79, 20);
this.correctedLabel.TabIndex = 3;
this.correctedLabel.Text = "Corrected";
//
// measuredLabel
//
this.measuredLabel.AutoSize = true;
this.measuredLabel.Location = new System.Drawing.Point(10, 42);
this.measuredLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.measuredLabel.Name = "measuredLabel";
this.measuredLabel.Size = new System.Drawing.Size(80, 20);
this.measuredLabel.TabIndex = 2;
this.measuredLabel.Text = "Measured";
//
// componentLabel
//
this.componentLabel.AutoSize = true;
this.componentLabel.Location = new System.Drawing.Point(21, 26);
this.componentLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.componentLabel.Name = "componentLabel";
this.componentLabel.Size = new System.Drawing.Size(96, 20);
this.componentLabel.TabIndex = 1;
this.componentLabel.Text = "Component:";
//
// cmpntNameLabel
//
this.cmpntNameLabel.AutoSize = true;
this.cmpntNameLabel.Location = new System.Drawing.Point(146, 26);
this.cmpntNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.cmpntNameLabel.Name = "cmpntNameLabel";
this.cmpntNameLabel.Size = new System.Drawing.Size(131, 20);
this.cmpntNameLabel.TabIndex = 0;
this.cmpntNameLabel.Text = "componentName";
//
// listViewEx
//
this.listViewEx.AllowColumnReorder = true;
this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill;
this.listViewEx.DoubleClickActivation = false;
this.listViewEx.FullRowSelect = true;
this.listViewEx.GridLines = true;
this.listViewEx.HideSelection = false;
this.listViewEx.Location = new System.Drawing.Point(0, 0);
this.listViewEx.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.listViewEx.Name = "listViewEx";
this.listViewEx.Size = new System.Drawing.Size(975, 298);
this.listViewEx.TabIndex = 0;
this.listViewEx.UseCompatibleStateImageBehavior = false;
this.listViewEx.View = System.Windows.Forms.View.Details;
this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged);
//
// MetrologyDlgPressMeterTab
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.splitContainer1);
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "MetrologyDlgPressMeterTab";
this.Size = new System.Drawing.Size(975, 462);
this.Load += new System.EventHandler(this.MetrologyDlgPressMeterTab_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.testGroupBox.ResumeLayout(false);
this.testGroupBox.PerformLayout();
this.ResumeLayout(false);
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.unitLabel = new System.Windows.Forms.Label();
this.unitComboBox = new System.Windows.Forms.ComboBox();
this.testGroupBox = new System.Windows.Forms.GroupBox();
this.correctedTextBox = new System.Windows.Forms.TextBox();
this.measuredTextBox = new System.Windows.Forms.TextBox();
this.correctedLabel = new System.Windows.Forms.Label();
this.measuredLabel = new System.Windows.Forms.Label();
this.componentLabel = new System.Windows.Forms.Label();
this.cmpntNameLabel = new System.Windows.Forms.Label();
this.listViewEx = new Common.Forms.ListViewEx();
this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateCtrl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.testGroupBox.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl);
this.splitContainer1.Panel1.Controls.Add(this.unitLabel);
this.splitContainer1.Panel1.Controls.Add(this.unitComboBox);
this.splitContainer1.Panel1.Controls.Add(this.testGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.componentLabel);
this.splitContainer1.Panel1.Controls.Add(this.cmpntNameLabel);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.listViewEx);
this.splitContainer1.Size = new System.Drawing.Size(650, 300);
this.splitContainer1.SplitterDistance = 112;
this.splitContainer1.TabIndex = 2;
//
// unitLabel
//
this.unitLabel.AutoSize = true;
this.unitLabel.Location = new System.Drawing.Point(14, 56);
this.unitLabel.Name = "unitLabel";
this.unitLabel.Size = new System.Drawing.Size(84, 13);
this.unitLabel.TabIndex = 10;
this.unitLabel.Text = "Unit of pressure:";
//
// unitComboBox
//
this.unitComboBox.FormattingEnabled = true;
this.unitComboBox.Location = new System.Drawing.Point(123, 53);
this.unitComboBox.Name = "unitComboBox";
this.unitComboBox.Size = new System.Drawing.Size(62, 21);
this.unitComboBox.TabIndex = 9;
this.unitComboBox.SelectedIndexChanged += new System.EventHandler(this.unitComboBox_SelectedIndexChanged);
//
// testGroupBox
//
this.testGroupBox.Controls.Add(this.correctedTextBox);
this.testGroupBox.Controls.Add(this.measuredTextBox);
this.testGroupBox.Controls.Add(this.correctedLabel);
this.testGroupBox.Controls.Add(this.measuredLabel);
this.testGroupBox.Location = new System.Drawing.Point(442, 9);
this.testGroupBox.Name = "testGroupBox";
this.testGroupBox.Size = new System.Drawing.Size(200, 100);
this.testGroupBox.TabIndex = 4;
this.testGroupBox.TabStop = false;
this.testGroupBox.Text = "Test";
//
// correctedTextBox
//
this.correctedTextBox.Location = new System.Drawing.Point(115, 49);
this.correctedTextBox.Name = "correctedTextBox";
this.correctedTextBox.ReadOnly = true;
this.correctedTextBox.Size = new System.Drawing.Size(73, 20);
this.correctedTextBox.TabIndex = 5;
//
// measuredTextBox
//
this.measuredTextBox.Location = new System.Drawing.Point(115, 24);
this.measuredTextBox.Name = "measuredTextBox";
this.measuredTextBox.Size = new System.Drawing.Size(73, 20);
this.measuredTextBox.TabIndex = 4;
this.measuredTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged);
//
// correctedLabel
//
this.correctedLabel.AutoSize = true;
this.correctedLabel.Location = new System.Drawing.Point(7, 52);
this.correctedLabel.Name = "correctedLabel";
this.correctedLabel.Size = new System.Drawing.Size(53, 13);
this.correctedLabel.TabIndex = 3;
this.correctedLabel.Text = "Corrected";
//
// measuredLabel
//
this.measuredLabel.AutoSize = true;
this.measuredLabel.Location = new System.Drawing.Point(7, 27);
this.measuredLabel.Name = "measuredLabel";
this.measuredLabel.Size = new System.Drawing.Size(54, 13);
this.measuredLabel.TabIndex = 2;
this.measuredLabel.Text = "Measured";
//
// componentLabel
//
this.componentLabel.AutoSize = true;
this.componentLabel.Location = new System.Drawing.Point(14, 17);
this.componentLabel.Name = "componentLabel";
this.componentLabel.Size = new System.Drawing.Size(64, 13);
this.componentLabel.TabIndex = 1;
this.componentLabel.Text = "Component:";
//
// cmpntNameLabel
//
this.cmpntNameLabel.AutoSize = true;
this.cmpntNameLabel.Location = new System.Drawing.Point(97, 17);
this.cmpntNameLabel.Name = "cmpntNameLabel";
this.cmpntNameLabel.Size = new System.Drawing.Size(88, 13);
this.cmpntNameLabel.TabIndex = 0;
this.cmpntNameLabel.Text = "componentName";
//
// listViewEx
//
this.listViewEx.AllowColumnReorder = true;
this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill;
this.listViewEx.DoubleClickActivation = false;
this.listViewEx.FullRowSelect = true;
this.listViewEx.GridLines = true;
this.listViewEx.HideSelection = false;
this.listViewEx.Location = new System.Drawing.Point(0, 0);
this.listViewEx.Name = "listViewEx";
this.listViewEx.Size = new System.Drawing.Size(650, 184);
this.listViewEx.TabIndex = 0;
this.listViewEx.UseCompatibleStateImageBehavior = false;
this.listViewEx.View = System.Windows.Forms.View.Details;
this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged);
//
// calibCertificateCtrl
//
this.calibCertificateCtrl.Location = new System.Drawing.Point(196, 9);
this.calibCertificateCtrl.Name = "calibCertificateCtrl";
this.calibCertificateCtrl.Size = new System.Drawing.Size(240, 100);
this.calibCertificateCtrl.TabIndex = 11;
//
// MetrologyDlgPressMeterTab
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.splitContainer1);
this.Name = "MetrologyDlgPressMeterTab";
this.Size = new System.Drawing.Size(650, 300);
this.Load += new System.EventHandler(this.MetrologyDlgPressMeterTab_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.testGroupBox.ResumeLayout(false);
this.testGroupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
@@ -226,6 +212,6 @@ namespace TBF.UI.Bench.Metrology
private System.Windows.Forms.Label measuredLabel;
private System.Windows.Forms.Label unitLabel;
private System.Windows.Forms.ComboBox unitComboBox;
private TBF.UI.Bench.Metrology.CalibCertificateExtendedCtrl calibCertificateCtrl;
private CalibCertificateCtrl calibCertificateCtrl;
}
}

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