Compare commits

...
Author SHA1 Message Date
michal 5fa9fcaeff Metrology:
- KBuoyancy calculation
- Readability column
Excel export:
- shape CC, for WT,T,Pr
2025-05-13 10:53:31 +02:00
michal df5924663a Remove obsolete license and metadata files. Added Extended CalibCertificateExtendedCtrl.cs
Deleted outdated license, third-party notices, and related metadata files for cleanup. Updated associated code configurations and UI components, including `MetrologyDlgTempMeterTab` and configuration models such as `BalanceCfg` and `TempMeterCfg`, with new fields for meter details.
2025-04-27 11:58:17 +02:00
michal 1e1f8bf8e6 Refactor uncertainty calculations and update UI functionality
Streamline uncertainty handling by modifying data structures and methods, replacing `SerNo` with a generic `val` array. Introduce `PreviousResultsDlgUncertainty` for expanded result management, and incorporate Excel template handling for uncertainty calculations. Ensure backward compatibility while refining code for clarity and efficiency.
2025-04-17 12:17:01 +02:00
michal 0d7fe67cd6 Add uncertainty handling and Excel process integration
This commit introduces uncertainty-related functionality with new items in `WMeterRsltItemSpec`, additional document sheet handling (`DocumentSheets`), and Excel processing via `CommonExcell`. Added tests ensure proper usage of uncertainty data and support for Excel files in `RigUncertaintyTest`.
2025-04-09 13:42:41 +02:00
michal 78bc9e264b Add uncertainty field to measurement corrections
Introduce a new "uncertainty" field to measurement correction entities and integrate it across various UI tabs and database structures. This includes adding uncertainty input fields, handling editing and display logic, updating configurations, and adjusting mappings. Additionally, add a ReadMe file with instructions for the database update.
2025-03-26 10:30:39 +01:00
80 changed files with 6080 additions and 1030 deletions
+1
View File
@@ -7,5 +7,6 @@ namespace Common
int RangeIx { get; set; } int RangeIx { get; set; }
double Measurement { get; set; } double Measurement { get; set; }
double Correction { get; set; } double Correction { get; set; }
double Uncertainty { get; set; }
} }
} }
+5
View File
@@ -145,6 +145,7 @@ namespace Common
[Description("Aufgezählt")] Enumerated, [Description("Aufgezählt")] Enumerated,
[Description("Strom")] Current, [Description("Strom")] Current,
[Description("Spannung")] Voltage, [Description("Spannung")] Voltage,
[Description("Unsicherheit")] Uncertainty,
#elif LANG_PL #elif LANG_PL
[Description("Objętość")] Volume, [Description("Objętość")] Volume,
[Description("Przepływ")] Flow, [Description("Przepływ")] Flow,
@@ -170,6 +171,7 @@ namespace Common
[Description("Wyliczone")] Enumerated, [Description("Wyliczone")] Enumerated,
[Description("Prąd")] Current, [Description("Prąd")] Current,
[Description("Napięcie")] Voltage, [Description("Napięcie")] Voltage,
[Description("Niepewność")] Uncertainty,
#elif LANG_CS #elif LANG_CS
[Description("Objem")] Volume, [Description("Objem")] Volume,
[Description("Průtok")] Flow, [Description("Průtok")] Flow,
@@ -195,6 +197,7 @@ namespace Common
[Description("Vyjmenované")] Enumerated, [Description("Vyjmenované")] Enumerated,
[Description("Proud")] Current, [Description("Proud")] Current,
[Description("Napětí")] Voltage, [Description("Napětí")] Voltage,
[Description("Nejistota")] Uncertainty,
#elif LANG_IT #elif LANG_IT
[Description("Volume")] Volume, [Description("Volume")] Volume,
[Description("Flusso")] Flow, [Description("Flusso")] Flow,
@@ -220,6 +223,7 @@ namespace Common
[Description("Enumerato")] Enumerated, [Description("Enumerato")] Enumerated,
[Description("Corrente")] Current, [Description("Corrente")] Current,
[Description("Voltaggio")] Voltage, [Description("Voltaggio")] Voltage,
[Description("Incertezza")] Uncertainty,
#else #else
[Description("Volume")] Volume, [Description("Volume")] Volume,
[Description("Flow")] Flow, [Description("Flow")] Flow,
@@ -245,6 +249,7 @@ namespace Common
[Description("Enumerated")] Enumerated, [Description("Enumerated")] Enumerated,
[Description("Current")] Current, [Description("Current")] Current,
[Description("Voltage")] Voltage, [Description("Voltage")] Voltage,
[Description("Uncertainty")] Uncertainty,
#endif #endif
Count, Count,
} }
+3 -1
View File
@@ -12,6 +12,8 @@ namespace Config.Entities
public virtual int RangeIx { get; set; } /// 0..5 public virtual int RangeIx { get; set; } /// 0..5
public virtual double Measurement { get; set; } public virtual double Measurement { get; set; }
public virtual double Correction { get; set; } public virtual double Correction { get; set; }
public virtual double Uncertainty { get; set; }
public virtual double Readability { get; set; }
public MeasurementCorrection() public MeasurementCorrection()
{ {
@@ -84,7 +86,7 @@ namespace Config.Entities
public override string ToString() public override string ToString()
{ {
return string.Format("{0} {1} ({2})", Measurement, Correction, RangeIx); return string.Format("{0} {1} ({2}) {3} {4}", Measurement, Correction, RangeIx, Uncertainty, Readability);
} }
} }
} }
@@ -14,6 +14,8 @@ namespace Config.Mappings
Map(x => x.RangeIx); Map(x => x.RangeIx);
Map(x => x.Measurement); Map(x => x.Measurement);
Map(x => x.Correction); Map(x => x.Correction);
Map(x => x.Uncertainty);
Map(x => x.Readability);
} }
} }
} }
+1
View File
@@ -45,6 +45,7 @@
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<LangVersion>4</LangVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
+22
View File
@@ -0,0 +1,22 @@
<?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
@@ -351,6 +351,14 @@ namespace Results
Failed_meters_countE15, /// 297 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, Count,
} }
} }
+68
View File
@@ -35,6 +35,24 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <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"> <Reference Include="FluentNHibernate">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath> <HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
</Reference> </Reference>
@@ -47,15 +65,51 @@
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <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> <HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
</Reference> </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"> <Reference Include="MySql.Data">
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath> <HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
</Reference> </Reference>
<Reference Include="NHibernate"> <Reference Include="NHibernate">
<HintPath>..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.dll</HintPath> <HintPath>..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.dll</HintPath>
</Reference> </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" />
<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.Core" />
<Reference Include="System.Drawing" /> <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" />
<Reference Include="System.Windows.Forms.DataVisualization" /> <Reference Include="System.Windows.Forms.DataVisualization" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
@@ -63,6 +117,7 @@
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="BatchResults.cs" /> <Compile Include="BatchResults.cs" />
@@ -180,6 +235,17 @@
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
<DependentUpon>Strings.resx</DependentUpon> <DependentUpon>Strings.resx</DependentUpon>
</Compile> </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="Utils.cs" />
<Compile Include="WMeterRsltItemSpec.cs" /> <Compile Include="WMeterRsltItemSpec.cs" />
</ItemGroup> </ItemGroup>
@@ -249,6 +315,8 @@
<EmbeddedResource Include="Resources\Strings.ru.resx" /> <EmbeddedResource Include="Resources\Strings.ru.resx" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
<None Include="Resources\Headpic.png" /> <None Include="Resources\Headpic.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
+144
View File
@@ -0,0 +1,144 @@
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();
}
}
}
}
@@ -0,0 +1,239 @@
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
@@ -0,0 +1,22 @@
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
@@ -0,0 +1,310 @@
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
@@ -0,0 +1,43 @@
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
@@ -0,0 +1,232 @@
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
@@ -0,0 +1,133 @@
///
/// 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
@@ -0,0 +1,122 @@
///
/// 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
@@ -0,0 +1,39 @@
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
@@ -0,0 +1,325 @@
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
@@ -0,0 +1,472 @@
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,6 +577,16 @@ namespace Results
{ {
return FormatInt(f, w.Batch.Counter10); 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 /// To be updated by Output.FileWriter or Output.Printer
+16
View File
@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <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" /> <package id="log4net" version="2.0.15" targetFramework="net472" />
</packages> </packages>
+41 -7
View File
@@ -1,7 +1,25 @@
<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"> <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_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:Boolean x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/ShowAdvancedOptions/@EntryValue">True</s:Boolean> <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/=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/=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/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; <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; &lt;TestAncestor&gt;&#xD;
@@ -9,12 +27,25 @@
&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.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.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.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;/TestAncestor&gt;&#xD; &lt;/TestAncestor&gt;&#xD;
&lt;/SessionState&gt;</s:String> &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; <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;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.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;/TestAncestor&gt;&#xD; &lt;/TestAncestor&gt;&#xD;
&lt;/SessionState&gt;</s:String> &lt;/SessionState&gt;</s:String>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=Config_002FResources_002FStrings/@EntryIndexedValue">False</s:Boolean> <s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=Config_002FResources_002FStrings/@EntryIndexedValue">False</s:Boolean>
@@ -24,18 +55,21 @@
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=Miscellaneous_0020Files_002FWyqupug/@EntryIndexedValue">False</s:Boolean> <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">True</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_002FCycleBeginningForm/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FDataEntry_002FStandartCameraPurchaseOrder_002FCycleEndForm/@EntryIndexedValue">True</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_002FDataEntry_002FStandartCameraPurchaseOrder_002FTestStartEndForm/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FAdapterFTP_002FNetadapterCfgCtrl/@EntryIndexedValue">True</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_002FKeyenceIV3G120_002FCameraCfgCtrl/@EntryIndexedValue">True</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_002FRoiForFixedStartKeyence_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">True</s:Boolean> <s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FRestAPI_002FRestApiCfgCtrl/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FOutput_002FPrinters_002FGroupPrinting_002FSingle_002FPrinterCfgCtrl/@EntryIndexedValue">False</s:Boolean> <s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FOutput_002FPrinters_002FGroupPrinting_002FSingle_002FPrinterCfgCtrl/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FOutput_002FPrinters_002FGroupPrinting_002FSingle_002FPrinterTestBenchComponentSelectorDlg/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FOutput_002FPrinters_002FGroupPrinting_002FSingle_002FPrinterTestBenchComponentSelectorDlg/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FRegisterReaders_002FFrequencyMeterFromUniCB_002FRRCfgCtrl/@EntryIndexedValue">True</s:Boolean> <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_002FComponents_002FComponentsManagerDlg/@EntryIndexedValue">False</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_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_002FMetrologyDlgPressMeterTab/@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> <s:Boolean x:Key="/Default/ResxEditorPersonal/Initialized/@EntryValue">True</s:Boolean></wpf:ResourceDictionary>
+14
View File
@@ -0,0 +1,14 @@
# 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,6 +4622,15 @@ namespace TBF.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Readability.
/// </summary>
internal static string Readability {
get {
return ResourceManager.GetString("Readability", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Reading from the production tracing DB failed. /// Looks up a localized string similar to Reading from the production tracing DB failed.
/// </summary> /// </summary>
+3
View File
@@ -2050,6 +2050,9 @@
<data name="Uncertainty" xml:space="preserve"> <data name="Uncertainty" xml:space="preserve">
<value>Uncertainty</value> <value>Uncertainty</value>
</data> </data>
<data name="Readability" xml:space="preserve">
<value>Readability</value>
</data>
<data name="No_info_available" xml:space="preserve"> <data name="No_info_available" xml:space="preserve">
<value>No info available</value> <value>No info available</value>
</data> </data>
@@ -30,9 +30,11 @@ namespace TBF.Rig.DataContainer.Buoyancy
public string CertPath { get; set; } public string CertPath { get; set; }
public DateTime CalibDate { get; set; } public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { 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() {} ComponentCfg() {}
public ComponentCfg(string name, IComponentFactory factory) public ComponentCfg(string name, IComponentFactory factory)
@@ -31,9 +31,11 @@ namespace TBF.Rig.DataContainer.Density
public string CertPath { get; set; } public string CertPath { get; set; }
public DateTime CalibDate { get; set; } public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { 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() {} ComponentCfg() {}
public ComponentCfg(string name, IComponentFactory factory) public ComponentCfg(string name, IComponentFactory factory)
@@ -24,6 +24,8 @@ namespace TBF.Rig.DataContainer.Evaporation
public string CertPath { get; set; } public string CertPath { get; set; }
public DateTime CalibDate { get; set; } public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { 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
@@ -56,9 +56,11 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
public string CertPath { get; set; } public string CertPath { get; set; }
public DateTime CalibDate { get; set; } public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { 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() {} ComponentCfg() {}
public ComponentCfg(string name, IComponentFactory factory) public ComponentCfg(string name, IComponentFactory factory)
+3
View File
@@ -15,5 +15,8 @@ namespace TBF.Rig.GenericDevices
string CertPath { get; set; } /// Path to a calibration certificate PDF document string CertPath { get; set; } /// Path to a calibration certificate PDF document
DateTime CalibDate { get; set; } /// Date of calibration DateTime CalibDate { get; set; } /// Date of calibration
DateTime CalibValidDate { get; set; } /// Calibration is valid until (date) 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,6 +23,9 @@ namespace TBF.Rig.GenericDevices
string GetCertPath(int rangeIx1); /// Get path to a calibration certificate PDF document string GetCertPath(int rangeIx1); /// Get path to a calibration certificate PDF document
DateTime GetCalibDate(int rangeIx1); /// Get the date of calibration DateTime GetCalibDate(int rangeIx1); /// Get the date of calibration
DateTime GetCalibValidDate(int rangeIx1); /// Get calibration valid until (date) 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 SetCalibCertificate(int rangeIx1, string certificate); /// Set calibration certificate number
void SetCertPath(int rangeIx1, string certPath); /// Set path to a calibration certificate PDF document void SetCertPath(int rangeIx1, string certPath); /// Set path to a calibration certificate PDF document
+2
View File
@@ -41,6 +41,8 @@ namespace TBF.Rig.Hart.Nivotrack
public string CertPath { get; set; } public string CertPath { get; set; }
public DateTime CalibDate { get; set; } public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { 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
@@ -40,6 +40,8 @@ namespace TBF.Rig.Keithley.TempMeter
public string CertPath { get; set; } public string CertPath { get; set; }
public DateTime CalibDate { get; set; } public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; } public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info /// Schematic drawing info
public Shape Shape { get; set; } public Shape Shape { get; set; }
@@ -56,6 +56,8 @@ namespace TBF.Rig.MettlerToledo.Standard
public string CertPath { get; set; } public string CertPath { get; set; }
public DateTime CalibDate { get; set; } public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; } public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info /// Schematic drawing info
public Shape Shape { get; set; } public Shape Shape { get; set; }
@@ -43,6 +43,8 @@ namespace TBF.Rig.Modbus.Meret.AdjustableScale
public string CertPath { get; set; } public string CertPath { get; set; }
public DateTime CalibDate { get; set; } public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; } public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info /// Schematic drawing info
public Shape Shape { get; set; } public Shape Shape { get; set; }
@@ -39,6 +39,8 @@ namespace TBF.Rig.Modbus.PressureMeter.Meret
public string CertPath { get; set; } public string CertPath { get; set; }
public DateTime CalibDate { get; set; } public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; } public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info /// Schematic drawing info
public Shape Shape { get; set; } public Shape Shape { get; set; }
@@ -47,6 +47,8 @@ namespace TBF.Rig.Modbus.TempMeter.Groch
public string CertPath { get; set; } public string CertPath { get; set; }
public DateTime CalibDate { get; set; } public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; } public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info /// Schematic drawing info
public SchematicDrawing.Shape Shape { get; set; } public SchematicDrawing.Shape Shape { get; set; }
@@ -35,6 +35,8 @@ namespace TBF.Rig.Modbus.TempMeter.Meret
public string CertPath { get; set; } public string CertPath { get; set; }
public DateTime CalibDate { get; set; } public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; } public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info /// Schematic drawing info
public Shape Shape { get; set; } public Shape Shape { get; set; }
+2
View File
@@ -68,6 +68,8 @@ namespace TBF.Rig.Scales.MettlerToledo
public string CertPath { get; set; } public string CertPath { get; set; }
public DateTime CalibDate { get; set; } public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; } public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info /// Schematic drawing info
public Shape Shape { get; set; } public Shape Shape { get; set; }
+2
View File
@@ -42,6 +42,8 @@ namespace TBF.Rig.Uni.Diverter
public string CertPath { get; set; } public string CertPath { get; set; }
public DateTime CalibDate { get; set; } public DateTime CalibDate { get; set; }
public DateTime CalibValidDate { get; set; } public DateTime CalibValidDate { get; set; }
public string MeterSerialNo { get; set; }
public string MeterType { get; set; }
/// Schematic drawing info /// Schematic drawing info
public Shape Shape { get; set; } public Shape Shape { get; set; }
+69
View File
@@ -92,6 +92,19 @@ namespace TBF.Rig.Uni.FlowMeter
public DateTime CalibValidDate4; public DateTime CalibValidDate4;
public DateTime CalibValidDate5; 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 /// Schematic drawing info
public Shape Shape { get; set; } public Shape Shape { get; set; }
public int X { get; set; } public int X { get; set; }
@@ -201,6 +214,34 @@ 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) public void SetCalibCertificate(int rangeIx1, string certificate)
{ {
switch (rangeIx1) switch (rangeIx1)
@@ -285,6 +326,34 @@ 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) public void SetCalibValidDate(int rangeIx1, DateTime calibValidDate)
{ {
switch (rangeIx1) switch (rangeIx1)
+58 -2
View File
@@ -104,6 +104,21 @@
<Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> <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> <HintPath>..\packages\Castle.Core.5.1.1\lib\net462\Castle.Core.dll</HintPath>
</Reference> </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"> <Reference Include="FluentNHibernate">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath> <HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
</Reference> </Reference>
@@ -113,6 +128,10 @@
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <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> <HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
</Reference> </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"> <Reference Include="MySql.Data">
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath> <HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
</Reference> </Reference>
@@ -130,20 +149,35 @@
<HintPath>..\packages\Oracle.ManagedDataAccess.19.11.0\lib\net40\Oracle.ManagedDataAccess.dll</HintPath> <HintPath>..\packages\Oracle.ManagedDataAccess.19.11.0\lib\net40\Oracle.ManagedDataAccess.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </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"> <Reference Include="Renci.SshNet">
<HintPath>..\packages\Renci.SshNet\Renci.SshNet.dll</HintPath> <HintPath>..\packages\Renci.SshNet\Renci.SshNet.dll</HintPath>
</Reference> </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" />
<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.ComponentModel.Composition" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Deployment" /> <Reference Include="System.Deployment" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Management" /> <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.Net.Http" />
<Reference Include="System.Numerics" /> <Reference Include="System.Numerics" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <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>
<Reference Include="System.Security" /> <Reference Include="System.Security" />
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
@@ -152,6 +186,7 @@
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Boxes\DateTimeBox.cs" /> <Compile Include="Boxes\DateTimeBox.cs" />
@@ -2122,6 +2157,12 @@
<Compile Include="UI\Bench\Metrology\CalibCertificateCtrl.Designer.cs"> <Compile Include="UI\Bench\Metrology\CalibCertificateCtrl.Designer.cs">
<DependentUpon>CalibCertificateCtrl.cs</DependentUpon> <DependentUpon>CalibCertificateCtrl.cs</DependentUpon>
</Compile> </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\IMetrologyDlgTab.cs" />
<Compile Include="UI\Bench\Metrology\MetrologyDlg.cs"> <Compile Include="UI\Bench\Metrology\MetrologyDlg.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
@@ -2504,6 +2545,7 @@
<Compile Include="UI\ResultsMI\DeleteFromOracleForm.designer.cs"> <Compile Include="UI\ResultsMI\DeleteFromOracleForm.designer.cs">
<DependentUpon>DeleteFromOracleForm.cs</DependentUpon> <DependentUpon>DeleteFromOracleForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UI\ResultsMI\IPreviousResultDlg.cs" />
<Compile Include="UI\ResultsMI\PreviousResultCtrl.cs"> <Compile Include="UI\ResultsMI\PreviousResultCtrl.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
@@ -2517,6 +2559,13 @@
<Compile Include="UI\ResultsMI\PreviousResultsDlg.designer.cs"> <Compile Include="UI\ResultsMI\PreviousResultsDlg.designer.cs">
<DependentUpon>PreviousResultsDlg.cs</DependentUpon> <DependentUpon>PreviousResultsDlg.cs</DependentUpon>
</Compile> </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"> <Compile Include="UI\ResultsMI\PrintResultsSelectionDlg.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@@ -3241,6 +3290,9 @@
<EmbeddedResource Include="UI\Bench\Metrology\CalibCertificateCtrl.resx"> <EmbeddedResource Include="UI\Bench\Metrology\CalibCertificateCtrl.resx">
<DependentUpon>CalibCertificateCtrl.cs</DependentUpon> <DependentUpon>CalibCertificateCtrl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UI\Bench\Metrology\CalibCertificateExtendedCtrl.resx">
<DependentUpon>CalibCertificateExtendedCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\Bench\Metrology\MetrologyDlg.resx"> <EmbeddedResource Include="UI\Bench\Metrology\MetrologyDlg.resx">
<DependentUpon>MetrologyDlg.cs</DependentUpon> <DependentUpon>MetrologyDlg.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@@ -3421,6 +3473,9 @@
<EmbeddedResource Include="UI\ResultsMI\PreviousResultsDlg.resx"> <EmbeddedResource Include="UI\ResultsMI\PreviousResultsDlg.resx">
<DependentUpon>PreviousResultsDlg.cs</DependentUpon> <DependentUpon>PreviousResultsDlg.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UI\ResultsMI\PreviousResultsDlgUncertainty.resx">
<DependentUpon>PreviousResultsDlgUncertainty.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\ResultsMI\PrintResultsSelectionDlg.resx"> <EmbeddedResource Include="UI\ResultsMI\PrintResultsSelectionDlg.resx">
<DependentUpon>PrintResultsSelectionDlg.cs</DependentUpon> <DependentUpon>PrintResultsSelectionDlg.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@@ -3586,6 +3641,7 @@
</Content> </Content>
<Content Include="Pictures\sample.bmp" /> <Content Include="Pictures\sample.bmp" />
<None Include="Resources\Barcode.png" /> <None Include="Resources\Barcode.png" />
<Content Include="ReadMe.md" />
<Content Include="Resources\empty.png" /> <Content Include="Resources\empty.png" />
<None Include="Resources\qrcode-48x48.png" /> <None Include="Resources\qrcode-48x48.png" />
<Content Include="Resources\switch-off.png" /> <Content Include="Resources\switch-off.png" />
@@ -0,0 +1,216 @@
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;
}
}
@@ -0,0 +1,151 @@
///
/// 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;
}
}
}
}
}
}
@@ -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>
@@ -52,6 +52,8 @@ namespace TBF.UI.Bench.Metrology
Control measurementTextBox; Control measurementTextBox;
Control correctionTextBox; Control correctionTextBox;
Control errorTextBox; Control errorTextBox;
Control uncertaintyTextBox;
Control readabilityTextBox;
Unit currentUnit; Unit currentUnit;
@@ -81,6 +83,8 @@ namespace TBF.UI.Bench.Metrology
this.Controls.Add(measurementTextBox = new TextBox()); this.Controls.Add(measurementTextBox = new TextBox());
this.Controls.Add(correctionTextBox = new TextBox()); this.Controls.Add(correctionTextBox = new TextBox());
this.Controls.Add(errorTextBox = 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; currentUnit = TBF.Rig.Sequences.ProcessData.ElectricUnit;
unitComboBox.Text = currentUnit.ToDescription(); unitComboBox.Text = currentUnit.ToDescription();
@@ -99,6 +103,8 @@ 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.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} [{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.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()); measuredLabel.Text = string.Format("{0} [{1}]:", Strings.Measured, unit.ToDescription());
correctedLabel.Text = string.Format("{0} [{1}]:", Strings.Corrected, unit.ToDescription()); correctedLabel.Text = string.Format("{0} [{1}]:", Strings.Corrected, unit.ToDescription());
@@ -132,6 +138,7 @@ namespace TBF.UI.Bench.Metrology
: Units.ConvertTo(currentUnit, trueValue) - Units.ConvertTo(currentUnit, corr.Measurement); : Units.ConvertTo(currentUnit, trueValue) - Units.ConvertTo(currentUnit, corr.Measurement);
lvi.SubItems.Add(Common.Utils.ToNiceString(difference, SignifDigits)); lvi.SubItems.Add(Common.Utils.ToNiceString(difference, SignifDigits));
//error
if (corr.Measurement == 0) if (corr.Measurement == 0)
{ {
lvi.SubItems.Add(Strings.NaN); lvi.SubItems.Add(Strings.NaN);
@@ -142,6 +149,11 @@ namespace TBF.UI.Bench.Metrology
lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits)); 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); listViewEx.Items.Add(lvi);
} }
@@ -158,6 +170,14 @@ namespace TBF.UI.Bench.Metrology
else if (unlocked && e.SubItem == 3) else if (unlocked && e.SubItem == 3)
{ {
listViewEx.StartEditing(correctionTextBox, e.Item, e.SubItem); 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);
} }
} }
@@ -181,6 +201,8 @@ namespace TBF.UI.Bench.Metrology
double difference; /// Correction in selected unit double difference; /// Correction in selected unit
double correction; /// Correction in default unit double correction; /// Correction in default unit
double error = 0; double error = 0;
double uncertainty = 0;
double readability = 0;
if (subItem == 1 && Utils.TryParseEDouble(strValue, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) >= 0) if (subItem == 1 && Utils.TryParseEDouble(strValue, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) >= 0)
{ {
@@ -248,6 +270,32 @@ namespace TBF.UI.Bench.Metrology
return true; 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 else
{ {
return false; return false;
@@ -48,6 +48,8 @@ namespace TBF.UI.Bench.Metrology
bool unlocked; bool unlocked;
Control measurementTextBox; Control measurementTextBox;
Control correctionTextBox; Control correctionTextBox;
Control uncertaintyTextBox;
Control readabilityTextBox;
public MetrologyDlgDiverterTab() public MetrologyDlgDiverterTab()
@@ -76,8 +78,12 @@ namespace TBF.UI.Bench.Metrology
/// Panel2 /// Panel2
measurementTextBox = new TextBox(); measurementTextBox = new TextBox();
correctionTextBox = new TextBox(); correctionTextBox = new TextBox();
uncertaintyTextBox = new TextBox();
readabilityTextBox = new TextBox();
this.Controls.Add(measurementTextBox); this.Controls.Add(measurementTextBox);
this.Controls.Add(correctionTextBox); this.Controls.Add(correctionTextBox);
this.Controls.Add(uncertaintyTextBox);
this.Controls.Add(readabilityTextBox);
listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked);
listViewEx.SubItemRightClicked += new SubItemEventHandler(listViewEx_SubItemRightClicked); listViewEx.SubItemRightClicked += new SubItemEventHandler(listViewEx_SubItemRightClicked);
@@ -86,6 +92,8 @@ namespace TBF.UI.Bench.Metrology
listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Nr, Width = 60 }); 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} [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} [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(); RefreshAll();
} }
@@ -119,6 +127,8 @@ namespace TBF.UI.Bench.Metrology
ListViewItem lvi = new ListViewItem(nr.ToString()); ListViewItem lvi = new ListViewItem(nr.ToString());
lvi.SubItems.Add(corr.Measurement.ToString()); lvi.SubItems.Add(corr.Measurement.ToString());
lvi.SubItems.Add((1000 * corr.Correction).ToString()); lvi.SubItems.Add((1000 * corr.Correction).ToString());
lvi.SubItems.Add(corr.Uncertainty.ToString());
lvi.SubItems.Add(corr.Readability.ToString());
lvi.Tag = corr; lvi.Tag = corr;
listViewEx.Items.Add(lvi); listViewEx.Items.Add(lvi);
} }
@@ -133,11 +143,19 @@ namespace TBF.UI.Bench.Metrology
{ {
listViewEx.StartEditing(correctionTextBox, e.Item, e.SubItem); 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) void listViewEx_SubItemRightClicked(object sender, SubItemEventArgs e)
{ {
if (!unlocked || e.SubItem < 1 || e.SubItem > 2) return; if (!unlocked || e.SubItem < 1 || e.SubItem > 3) return;
if (DialogResult.Yes == MessageBox.Show(Strings.Do_you_want_to_copy_this_value_to_all_cells_below_this_cell, 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)) Strings.Confirmation, MessageBoxButtons.YesNo, MessageBoxIcon.Question))
@@ -189,6 +207,17 @@ namespace TBF.UI.Bench.Metrology
(item.Tag as MeasurementCorrection).Correction = fvalue / 1000; (item.Tag as MeasurementCorrection).Correction = fvalue / 1000;
return true; 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 else
{ {
return false; return false;
@@ -48,6 +48,8 @@ namespace TBF.UI.Bench.Metrology
bool unlocked; bool unlocked;
Control measurementTextBox; Control measurementTextBox;
Control correctionTextBox; Control correctionTextBox;
Control uncertaintyTextBox;
Control readabilityTextBox;
public MetrologyDlgEvaporationTab() public MetrologyDlgEvaporationTab()
@@ -76,8 +78,12 @@ namespace TBF.UI.Bench.Metrology
/// Panel2 /// Panel2
measurementTextBox = new TextBox(); measurementTextBox = new TextBox();
correctionTextBox = new TextBox(); correctionTextBox = new TextBox();
uncertaintyTextBox = new TextBox();
readabilityTextBox = new TextBox();
this.Controls.Add(measurementTextBox); this.Controls.Add(measurementTextBox);
this.Controls.Add(correctionTextBox); this.Controls.Add(correctionTextBox);
this.Controls.Add(uncertaintyTextBox);
this.Controls.Add(readabilityTextBox);
listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked);
listViewEx.SubItemRightClicked += new SubItemEventHandler(listViewEx_SubItemRightClicked); listViewEx.SubItemRightClicked += new SubItemEventHandler(listViewEx_SubItemRightClicked);
@@ -86,6 +92,8 @@ namespace TBF.UI.Bench.Metrology
listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Nr, Width = 60 }); 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} [°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} [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(); RefreshAll();
} }
@@ -116,6 +124,8 @@ namespace TBF.UI.Bench.Metrology
ListViewItem lvi = new ListViewItem(nr.ToString()); ListViewItem lvi = new ListViewItem(nr.ToString());
lvi.SubItems.Add(corr.Measurement.ToString()); lvi.SubItems.Add(corr.Measurement.ToString());
lvi.SubItems.Add((1000 * corr.Correction).ToString()); lvi.SubItems.Add((1000 * corr.Correction).ToString());
lvi.SubItems.Add(corr.Uncertainty.ToString());
lvi.SubItems.Add(corr.Readability.ToString());
lvi.Tag = corr; lvi.Tag = corr;
listViewEx.Items.Add(lvi); listViewEx.Items.Add(lvi);
} }
@@ -130,6 +140,14 @@ namespace TBF.UI.Bench.Metrology
{ {
listViewEx.StartEditing(correctionTextBox, e.Item, e.SubItem); 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) void listViewEx_SubItemRightClicked(object sender, SubItemEventArgs e)
@@ -186,6 +204,16 @@ namespace TBF.UI.Bench.Metrology
(item.Tag as MeasurementCorrection).Correction = fvalue / 1000; (item.Tag as MeasurementCorrection).Correction = fvalue / 1000;
return true; 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 else
{ {
return false; return false;
@@ -52,6 +52,8 @@ namespace TBF.UI.Bench.Metrology
Control measurementTextBox; Control measurementTextBox;
Control correctionTextBox; Control correctionTextBox;
Control errorTextBox; Control errorTextBox;
Control uncertaintyTextBox;
Control readabilityTextBox;
readonly int rangeIx; /// 0 (no range) or 1..5 (range #) readonly int rangeIx; /// 0 (no range) or 1..5 (range #)
readonly bool isLastFlowMeterRange; /// true when this is the last range of this flow meter. 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 /// This is to prevent double saving of the meter entity to a DB
@@ -96,6 +98,8 @@ namespace TBF.UI.Bench.Metrology
this.Controls.Add(measurementTextBox = new TextBox()); this.Controls.Add(measurementTextBox = new TextBox());
this.Controls.Add(correctionTextBox = new TextBox()); this.Controls.Add(correctionTextBox = new TextBox());
this.Controls.Add(errorTextBox = 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; currentUnit = TBF.Rig.Sequences.ProcessData.FlowUnit;
unitComboBox.Text = currentUnit.ToDescription(); unitComboBox.Text = currentUnit.ToDescription();
@@ -114,6 +118,8 @@ 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.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} [{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.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()); measuredLabel.Text = string.Format("{0} [{1}]:", Strings.Measured, unit.ToDescription());
correctedLabel.Text = string.Format("{0} [{1}]:", Strings.Corrected, unit.ToDescription()); correctedLabel.Text = string.Format("{0} [{1}]:", Strings.Corrected, unit.ToDescription());
@@ -163,6 +169,9 @@ namespace TBF.UI.Bench.Metrology
lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits)); lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits));
} }
lvi.SubItems.Add(corr.Uncertainty.ToString());
lvi.SubItems.Add(corr.Readability.ToString());
listViewEx.Items.Add(lvi); listViewEx.Items.Add(lvi);
} }
@@ -179,6 +188,14 @@ namespace TBF.UI.Bench.Metrology
else if (unlocked && e.SubItem == 3) else if (unlocked && e.SubItem == 3)
{ {
listViewEx.StartEditing(correctionTextBox, e.Item, e.SubItem); 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);
} }
} }
@@ -202,6 +219,8 @@ namespace TBF.UI.Bench.Metrology
double difference; /// Correction in selected unit double difference; /// Correction in selected unit
double correction; /// Correction in default unit double correction; /// Correction in default unit
double error = 0; double error = 0;
double uncertainty;
double readibility;
if (subItem == 1 && Utils.TryParseEDouble(strValue, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) >= 0) if (subItem == 1 && Utils.TryParseEDouble(strValue, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) >= 0)
{ {
@@ -269,6 +288,36 @@ namespace TBF.UI.Bench.Metrology
return true; 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 else
{ {
return false; return false;
@@ -48,6 +48,8 @@ namespace TBF.UI.Bench.Metrology
bool unlocked; bool unlocked;
Control measurementTextBox; Control measurementTextBox;
Control correctionTextBox; Control correctionTextBox;
Control uncertaintyTextBox;
Control readabilityTextBox;
public MetrologyDlgLevelMeterTab() public MetrologyDlgLevelMeterTab()
@@ -76,8 +78,12 @@ namespace TBF.UI.Bench.Metrology
/// Panel2 /// Panel2
measurementTextBox = new TextBox(); measurementTextBox = new TextBox();
correctionTextBox = new TextBox(); correctionTextBox = new TextBox();
uncertaintyTextBox = new TextBox();
readabilityTextBox = new TextBox();
this.Controls.Add(measurementTextBox); this.Controls.Add(measurementTextBox);
this.Controls.Add(correctionTextBox); this.Controls.Add(correctionTextBox);
this.Controls.Add(uncertaintyTextBox);
this.Controls.Add(readabilityTextBox);
listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked);
listViewEx.SubItemRightClicked += new SubItemEventHandler(listViewEx_SubItemRightClicked); listViewEx.SubItemRightClicked += new SubItemEventHandler(listViewEx_SubItemRightClicked);
@@ -86,6 +92,8 @@ namespace TBF.UI.Bench.Metrology
listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Nr, Width = 60 }); 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.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} [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(); RefreshAll();
} }
@@ -116,6 +124,8 @@ namespace TBF.UI.Bench.Metrology
ListViewItem lvi = new ListViewItem(nr.ToString()); ListViewItem lvi = new ListViewItem(nr.ToString());
lvi.SubItems.Add(corr.Measurement.ToString()); lvi.SubItems.Add(corr.Measurement.ToString());
lvi.SubItems.Add((corr.Correction).ToString()); lvi.SubItems.Add((corr.Correction).ToString());
lvi.SubItems.Add((corr.Uncertainty).ToString());
lvi.SubItems.Add((corr.Readability).ToString());
lvi.Tag = corr; lvi.Tag = corr;
listViewEx.Items.Add(lvi); listViewEx.Items.Add(lvi);
} }
@@ -186,6 +196,16 @@ namespace TBF.UI.Bench.Metrology
(item.Tag as MeasurementCorrection).Correction = fvalue; (item.Tag as MeasurementCorrection).Correction = fvalue;
return true; 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 else
{ {
return false; return false;
+181 -167
View File
@@ -31,172 +31,186 @@ namespace TBF.UI.Bench.Metrology
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.unitLabel = new System.Windows.Forms.Label(); this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateExtendedCtrl();
this.unitComboBox = new System.Windows.Forms.ComboBox(); this.unitLabel = new System.Windows.Forms.Label();
this.testGroupBox = new System.Windows.Forms.GroupBox(); this.unitComboBox = new System.Windows.Forms.ComboBox();
this.correctedTextBox = new System.Windows.Forms.TextBox(); this.testGroupBox = new System.Windows.Forms.GroupBox();
this.measuredTextBox = new System.Windows.Forms.TextBox(); this.correctedTextBox = new System.Windows.Forms.TextBox();
this.correctedLabel = new System.Windows.Forms.Label(); this.measuredTextBox = new System.Windows.Forms.TextBox();
this.measuredLabel = new System.Windows.Forms.Label(); this.correctedLabel = new System.Windows.Forms.Label();
this.componentLabel = new System.Windows.Forms.Label(); this.measuredLabel = new System.Windows.Forms.Label();
this.cmpntNameLabel = new System.Windows.Forms.Label(); this.componentLabel = new System.Windows.Forms.Label();
this.listViewEx = new Common.Forms.ListViewEx(); this.cmpntNameLabel = new System.Windows.Forms.Label();
this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateCtrl(); this.listViewEx = new Common.Forms.ListViewEx();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout(); this.splitContainer1.SuspendLayout();
this.testGroupBox.SuspendLayout(); this.testGroupBox.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// splitContainer1 // splitContainer1
// //
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(0, 0); this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1"; this.splitContainer1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; this.splitContainer1.Name = "splitContainer1";
// this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
// splitContainer1.Panel1 //
// // splitContainer1.Panel1
this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl); //
this.splitContainer1.Panel1.Controls.Add(this.unitLabel); this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl);
this.splitContainer1.Panel1.Controls.Add(this.unitComboBox); this.splitContainer1.Panel1.Controls.Add(this.unitLabel);
this.splitContainer1.Panel1.Controls.Add(this.testGroupBox); this.splitContainer1.Panel1.Controls.Add(this.unitComboBox);
this.splitContainer1.Panel1.Controls.Add(this.componentLabel); this.splitContainer1.Panel1.Controls.Add(this.testGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.cmpntNameLabel); this.splitContainer1.Panel1.Controls.Add(this.componentLabel);
// this.splitContainer1.Panel1.Controls.Add(this.cmpntNameLabel);
// splitContainer1.Panel2 //
// // splitContainer1.Panel2
this.splitContainer1.Panel2.Controls.Add(this.listViewEx); //
this.splitContainer1.Size = new System.Drawing.Size(650, 300); this.splitContainer1.Panel2.Controls.Add(this.listViewEx);
this.splitContainer1.SplitterDistance = 112; this.splitContainer1.Size = new System.Drawing.Size(975, 462);
this.splitContainer1.TabIndex = 2; this.splitContainer1.SplitterDistance = 158;
// this.splitContainer1.SplitterWidth = 6;
// unitLabel this.splitContainer1.TabIndex = 2;
// //
this.unitLabel.AutoSize = true; // calibCertificateCtrl
this.unitLabel.Location = new System.Drawing.Point(14, 56); //
this.unitLabel.Name = "unitLabel"; this.calibCertificateCtrl.Location = new System.Drawing.Point(294, 14);
this.unitLabel.Size = new System.Drawing.Size(84, 13); this.calibCertificateCtrl.Margin = new System.Windows.Forms.Padding(6, 8, 6, 8);
this.unitLabel.TabIndex = 10; this.calibCertificateCtrl.Name = "calibCertificateCtrl";
this.unitLabel.Text = "Unit of pressure:"; this.calibCertificateCtrl.Size = new System.Drawing.Size(360, 211);
// this.calibCertificateCtrl.TabIndex = 11;
// unitComboBox //
// // unitLabel
this.unitComboBox.FormattingEnabled = true; //
this.unitComboBox.Location = new System.Drawing.Point(123, 53); this.unitLabel.AutoSize = true;
this.unitComboBox.Name = "unitComboBox"; this.unitLabel.Location = new System.Drawing.Point(21, 86);
this.unitComboBox.Size = new System.Drawing.Size(62, 21); this.unitLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.unitComboBox.TabIndex = 9; this.unitLabel.Name = "unitLabel";
this.unitComboBox.SelectedIndexChanged += new System.EventHandler(this.unitComboBox_SelectedIndexChanged); this.unitLabel.Size = new System.Drawing.Size(126, 20);
// this.unitLabel.TabIndex = 10;
// testGroupBox this.unitLabel.Text = "Unit of pressure:";
// //
this.testGroupBox.Controls.Add(this.correctedTextBox); // unitComboBox
this.testGroupBox.Controls.Add(this.measuredTextBox); //
this.testGroupBox.Controls.Add(this.correctedLabel); this.unitComboBox.FormattingEnabled = true;
this.testGroupBox.Controls.Add(this.measuredLabel); this.unitComboBox.Location = new System.Drawing.Point(184, 82);
this.testGroupBox.Location = new System.Drawing.Point(442, 9); this.unitComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.testGroupBox.Name = "testGroupBox"; this.unitComboBox.Name = "unitComboBox";
this.testGroupBox.Size = new System.Drawing.Size(200, 100); this.unitComboBox.Size = new System.Drawing.Size(91, 28);
this.testGroupBox.TabIndex = 4; this.unitComboBox.TabIndex = 9;
this.testGroupBox.TabStop = false; this.unitComboBox.SelectedIndexChanged += new System.EventHandler(this.unitComboBox_SelectedIndexChanged);
this.testGroupBox.Text = "Test"; //
// // testGroupBox
// correctedTextBox //
// this.testGroupBox.Controls.Add(this.correctedTextBox);
this.correctedTextBox.Location = new System.Drawing.Point(115, 49); this.testGroupBox.Controls.Add(this.measuredTextBox);
this.correctedTextBox.Name = "correctedTextBox"; this.testGroupBox.Controls.Add(this.correctedLabel);
this.correctedTextBox.ReadOnly = true; this.testGroupBox.Controls.Add(this.measuredLabel);
this.correctedTextBox.Size = new System.Drawing.Size(73, 20); this.testGroupBox.Location = new System.Drawing.Point(663, 14);
this.correctedTextBox.TabIndex = 5; this.testGroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
// this.testGroupBox.Name = "testGroupBox";
// measuredTextBox this.testGroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
// this.testGroupBox.Size = new System.Drawing.Size(300, 154);
this.measuredTextBox.Location = new System.Drawing.Point(115, 24); this.testGroupBox.TabIndex = 4;
this.measuredTextBox.Name = "measuredTextBox"; this.testGroupBox.TabStop = false;
this.measuredTextBox.Size = new System.Drawing.Size(73, 20); this.testGroupBox.Text = "Test";
this.measuredTextBox.TabIndex = 4; //
this.measuredTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged); // correctedTextBox
// //
// correctedLabel this.correctedTextBox.Location = new System.Drawing.Point(172, 75);
// this.correctedTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.correctedLabel.AutoSize = true; this.correctedTextBox.Name = "correctedTextBox";
this.correctedLabel.Location = new System.Drawing.Point(7, 52); this.correctedTextBox.ReadOnly = true;
this.correctedLabel.Name = "correctedLabel"; this.correctedTextBox.Size = new System.Drawing.Size(108, 26);
this.correctedLabel.Size = new System.Drawing.Size(53, 13); this.correctedTextBox.TabIndex = 5;
this.correctedLabel.TabIndex = 3; //
this.correctedLabel.Text = "Corrected"; // measuredTextBox
// //
// measuredLabel this.measuredTextBox.Location = new System.Drawing.Point(172, 37);
// this.measuredTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.measuredLabel.AutoSize = true; this.measuredTextBox.Name = "measuredTextBox";
this.measuredLabel.Location = new System.Drawing.Point(7, 27); this.measuredTextBox.Size = new System.Drawing.Size(108, 26);
this.measuredLabel.Name = "measuredLabel"; this.measuredTextBox.TabIndex = 4;
this.measuredLabel.Size = new System.Drawing.Size(54, 13); this.measuredTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged);
this.measuredLabel.TabIndex = 2; //
this.measuredLabel.Text = "Measured"; // correctedLabel
// //
// componentLabel this.correctedLabel.AutoSize = true;
// this.correctedLabel.Location = new System.Drawing.Point(10, 80);
this.componentLabel.AutoSize = true; this.correctedLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.componentLabel.Location = new System.Drawing.Point(14, 17); this.correctedLabel.Name = "correctedLabel";
this.componentLabel.Name = "componentLabel"; this.correctedLabel.Size = new System.Drawing.Size(79, 20);
this.componentLabel.Size = new System.Drawing.Size(64, 13); this.correctedLabel.TabIndex = 3;
this.componentLabel.TabIndex = 1; this.correctedLabel.Text = "Corrected";
this.componentLabel.Text = "Component:"; //
// // measuredLabel
// cmpntNameLabel //
// this.measuredLabel.AutoSize = true;
this.cmpntNameLabel.AutoSize = true; this.measuredLabel.Location = new System.Drawing.Point(10, 42);
this.cmpntNameLabel.Location = new System.Drawing.Point(97, 17); this.measuredLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.cmpntNameLabel.Name = "cmpntNameLabel"; this.measuredLabel.Name = "measuredLabel";
this.cmpntNameLabel.Size = new System.Drawing.Size(88, 13); this.measuredLabel.Size = new System.Drawing.Size(80, 20);
this.cmpntNameLabel.TabIndex = 0; this.measuredLabel.TabIndex = 2;
this.cmpntNameLabel.Text = "componentName"; this.measuredLabel.Text = "Measured";
// //
// listViewEx // componentLabel
// //
this.listViewEx.AllowColumnReorder = true; this.componentLabel.AutoSize = true;
this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill; this.componentLabel.Location = new System.Drawing.Point(21, 26);
this.listViewEx.DoubleClickActivation = false; this.componentLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.listViewEx.FullRowSelect = true; this.componentLabel.Name = "componentLabel";
this.listViewEx.GridLines = true; this.componentLabel.Size = new System.Drawing.Size(96, 20);
this.listViewEx.HideSelection = false; this.componentLabel.TabIndex = 1;
this.listViewEx.Location = new System.Drawing.Point(0, 0); this.componentLabel.Text = "Component:";
this.listViewEx.Name = "listViewEx"; //
this.listViewEx.Size = new System.Drawing.Size(650, 184); // cmpntNameLabel
this.listViewEx.TabIndex = 0; //
this.listViewEx.UseCompatibleStateImageBehavior = false; this.cmpntNameLabel.AutoSize = true;
this.listViewEx.View = System.Windows.Forms.View.Details; this.cmpntNameLabel.Location = new System.Drawing.Point(146, 26);
this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged); this.cmpntNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
// this.cmpntNameLabel.Name = "cmpntNameLabel";
// calibCertificateCtrl this.cmpntNameLabel.Size = new System.Drawing.Size(131, 20);
// this.cmpntNameLabel.TabIndex = 0;
this.calibCertificateCtrl.Location = new System.Drawing.Point(196, 9); this.cmpntNameLabel.Text = "componentName";
this.calibCertificateCtrl.Name = "calibCertificateCtrl"; //
this.calibCertificateCtrl.Size = new System.Drawing.Size(240, 100); // listViewEx
this.calibCertificateCtrl.TabIndex = 11; //
// this.listViewEx.AllowColumnReorder = true;
// MetrologyDlgPressMeterTab this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill;
// this.listViewEx.DoubleClickActivation = false;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.listViewEx.FullRowSelect = true;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.listViewEx.GridLines = true;
this.Controls.Add(this.splitContainer1); this.listViewEx.HideSelection = false;
this.Name = "MetrologyDlgPressMeterTab"; this.listViewEx.Location = new System.Drawing.Point(0, 0);
this.Size = new System.Drawing.Size(650, 300); this.listViewEx.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Load += new System.EventHandler(this.MetrologyDlgPressMeterTab_Load); this.listViewEx.Name = "listViewEx";
this.splitContainer1.Panel1.ResumeLayout(false); this.listViewEx.Size = new System.Drawing.Size(975, 298);
this.splitContainer1.Panel1.PerformLayout(); this.listViewEx.TabIndex = 0;
this.splitContainer1.Panel2.ResumeLayout(false); this.listViewEx.UseCompatibleStateImageBehavior = false;
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.listViewEx.View = System.Windows.Forms.View.Details;
this.splitContainer1.ResumeLayout(false); this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged);
this.testGroupBox.ResumeLayout(false); //
this.testGroupBox.PerformLayout(); // MetrologyDlgPressMeterTab
this.ResumeLayout(false); //
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);
} }
#endregion #endregion
@@ -212,6 +226,6 @@ namespace TBF.UI.Bench.Metrology
private System.Windows.Forms.Label measuredLabel; private System.Windows.Forms.Label measuredLabel;
private System.Windows.Forms.Label unitLabel; private System.Windows.Forms.Label unitLabel;
private System.Windows.Forms.ComboBox unitComboBox; private System.Windows.Forms.ComboBox unitComboBox;
private CalibCertificateCtrl calibCertificateCtrl; private TBF.UI.Bench.Metrology.CalibCertificateExtendedCtrl calibCertificateCtrl;
} }
} }
@@ -52,6 +52,8 @@ namespace TBF.UI.Bench.Metrology
Control measurementTextBox; Control measurementTextBox;
Control correctionTextBox; Control correctionTextBox;
Control errorTextBox; Control errorTextBox;
Control uncertaintyTextBox;
Control readabilityTextBox;
Unit currentUnit; Unit currentUnit;
@@ -81,6 +83,8 @@ namespace TBF.UI.Bench.Metrology
this.Controls.Add(measurementTextBox = new TextBox()); this.Controls.Add(measurementTextBox = new TextBox());
this.Controls.Add(correctionTextBox = new TextBox()); this.Controls.Add(correctionTextBox = new TextBox());
this.Controls.Add(errorTextBox = 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.PressUnit; currentUnit = TBF.Rig.Sequences.ProcessData.PressUnit;
unitComboBox.Text = currentUnit.ToDescription(); unitComboBox.Text = currentUnit.ToDescription();
@@ -99,6 +103,8 @@ namespace TBF.UI.Bench.Metrology
lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [{1}]", Strings.Pressure, unit.ToDescription()), Width = 100 }); lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [{1}]", Strings.Pressure, 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} [{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.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()); measuredLabel.Text = string.Format("{0} [{1}]:", Strings.Measured, unit.ToDescription());
correctedLabel.Text = string.Format("{0} [{1}]:", Strings.Corrected, unit.ToDescription()); correctedLabel.Text = string.Format("{0} [{1}]:", Strings.Corrected, unit.ToDescription());
@@ -132,6 +138,7 @@ namespace TBF.UI.Bench.Metrology
: Units.ConvertTo(currentUnit, trueValue) - Units.ConvertTo(currentUnit, corr.Measurement); : Units.ConvertTo(currentUnit, trueValue) - Units.ConvertTo(currentUnit, corr.Measurement);
lvi.SubItems.Add(Common.Utils.ToNiceString(difference, SignifDigits)); lvi.SubItems.Add(Common.Utils.ToNiceString(difference, SignifDigits));
//error
if (corr.Measurement == 0) if (corr.Measurement == 0)
{ {
lvi.SubItems.Add(Strings.NaN); lvi.SubItems.Add(Strings.NaN);
@@ -142,6 +149,12 @@ namespace TBF.UI.Bench.Metrology
lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits)); lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits));
} }
//uncertainty
lvi.SubItems.Add(Common.Utils.ToNiceString(corr.Uncertainty, SignifDigits));
//Readability
lvi.SubItems.Add(Common.Utils.ToNiceString(corr.Readability, SignifDigits));
listViewEx.Items.Add(lvi); listViewEx.Items.Add(lvi);
} }
@@ -158,6 +171,14 @@ namespace TBF.UI.Bench.Metrology
else if (unlocked && e.SubItem == 3) else if (unlocked && e.SubItem == 3)
{ {
listViewEx.StartEditing(correctionTextBox, e.Item, e.SubItem); 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);
} }
} }
@@ -181,6 +202,8 @@ namespace TBF.UI.Bench.Metrology
double difference; /// Correction in selected unit double difference; /// Correction in selected unit
double correction; /// Correction in default unit double correction; /// Correction in default unit
double error = 0; double error = 0;
double uncertaitity;
double readability;
if (subItem == 1 && Utils.TryParseEDouble(strValue, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) >= 0) if (subItem == 1 && Utils.TryParseEDouble(strValue, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) >= 0)
{ {
@@ -248,6 +271,32 @@ namespace TBF.UI.Bench.Metrology
return true; return true;
} }
else if (subItem == 4 && (Utils.TryParseEDouble(strValue, out uncertaitity)))
{
if (strValue == Strings.NaN)
{
}
else
{
(item.Tag as MeasurementCorrection).Uncertainty = uncertaitity;
item.SubItems[4].Text = Common.Utils.ToNiceString(uncertaitity, SignifDigits);
}
return true;
}
else if (subItem == 5 && (Utils.TryParseEDouble(strValue, out readability)))
{
if (strValue == Strings.NaN)
{
}
else
{
(item.Tag as MeasurementCorrection).Readability = readability;
item.SubItems[5].Text = Common.Utils.ToNiceString(readability, SignifDigits);
}
return true;
}
else else
{ {
return false; return false;
+100 -5
View File
@@ -4,15 +4,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using log4net; using log4net;
using Common; using Common;
using Common.Forms; using Common.Forms;
using Config.Entities; using Config.Entities;
using TBF.Resources; using TBF.Resources;
using TBF.Rig.GenericDevices;
using TBF.Rig.MettlerToledo.Standard;
using TBF.UI.Shared; using TBF.UI.Shared;
using static System.Net.Mime.MediaTypeNames;
namespace TBF.UI.Bench.Metrology namespace TBF.UI.Bench.Metrology
{ {
@@ -53,6 +53,8 @@ namespace TBF.UI.Bench.Metrology
Control measurementTextBox; Control measurementTextBox;
Control correctionTextBox; Control correctionTextBox;
Control errorTextBox; Control errorTextBox;
Control uncertaintyTextBox;
Control readabilityTextBox;
Unit currentUnit; Unit currentUnit;
@@ -82,6 +84,8 @@ namespace TBF.UI.Bench.Metrology
this.Controls.Add(measurementTextBox = new TextBox()); this.Controls.Add(measurementTextBox = new TextBox());
this.Controls.Add(correctionTextBox = new TextBox()); this.Controls.Add(correctionTextBox = new TextBox());
this.Controls.Add(errorTextBox = 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.MassUnit; currentUnit = TBF.Rig.Sequences.ProcessData.MassUnit;
unitComboBox.Text = currentUnit.ToDescription(); unitComboBox.Text = currentUnit.ToDescription();
@@ -100,6 +104,8 @@ namespace TBF.UI.Bench.Metrology
lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [{1}]", Strings.Mass, unit.ToDescription()), Width = 120 }); lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [{1}]", Strings.Mass, 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} [{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.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()); measuredLabel.Text = string.Format("{0} [{1}]:", Strings.Measured, unit.ToDescription());
correctedLabel.Text = string.Format("{0} [{1}]:", Strings.Corrected, unit.ToDescription()); correctedLabel.Text = string.Format("{0} [{1}]:", Strings.Corrected, unit.ToDescription());
@@ -127,7 +133,7 @@ namespace TBF.UI.Bench.Metrology
buoyancyTempTextBox.Text = BalanceCfg.BuoyancyTemp.ToString("F2"); buoyancyTempTextBox.Text = BalanceCfg.BuoyancyTemp.ToString("F2");
buoyancyPressTextBox.Text = BalanceCfg.BuoyancyPress.ToString("F4"); buoyancyPressTextBox.Text = BalanceCfg.BuoyancyPress.ToString("F4");
buoyancyHumiTextBox.Text = BalanceCfg.BuoyancyHumi.ToString("F1"); buoyancyHumiTextBox.Text = BalanceCfg.BuoyancyHumi.ToString("F1");
/// airDensityTextBox.Text = //calculate air density airDensityTextBox.Text = CalculateAirDetsity(BalanceCfg).ToString("F4");
weightStandardDensityTextBox.Text = BalanceCfg.WeightStandardDensity.ToString("F1"); weightStandardDensityTextBox.Text = BalanceCfg.WeightStandardDensity.ToString("F1");
} }
@@ -135,6 +141,27 @@ namespace TBF.UI.Bench.Metrology
foreach (var corr in MeterEntity.Corrections) AddOneLVI(corr); foreach (var corr in MeterEntity.Corrections) AddOneLVI(corr);
} }
double CalculateAirDetsity(IScaleCfg scaleCfg)//, double temperature, double pressure, double humidity)
{
double temperature = scaleCfg.BuoyancyTemp;
double humidity = scaleCfg.BuoyancyHumi;
double pressure = Units.ConvertTo(Unit.mbar, scaleCfg.BuoyancyPress);
double t = 273.15 + temperature;
double F6 =
(1.2811805 / 100000) * Math.Pow(t, 2)
- (1.950987 / 100) * t
+ 34.04926034
- (6.353631 * 1000) / t;
double G6 = Math.Exp(F6);
double H6 = scaleCfg.BuoyancyHumi/100*G6/pressure;
double airDensityE = (((3.48353 / 1000) * pressure * (1 - (0.378 * H6))) / t )/ 1000;
return (airDensityE * 1000);
}
void AddOneLVI(MeasurementCorrection corr) void AddOneLVI(MeasurementCorrection corr)
{ {
int nr = listViewEx.Items.Count + 1; int nr = listViewEx.Items.Count + 1;
@@ -157,6 +184,9 @@ namespace TBF.UI.Bench.Metrology
lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits)); lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits));
} }
lvi.SubItems.Add(corr.Uncertainty.ToString());
lvi.SubItems.Add(corr.Readability.ToString());
listViewEx.Items.Add(lvi); listViewEx.Items.Add(lvi);
} }
@@ -173,6 +203,14 @@ namespace TBF.UI.Bench.Metrology
else if (unlocked && e.SubItem == 3) else if (unlocked && e.SubItem == 3)
{ {
listViewEx.StartEditing(correctionTextBox, e.Item, e.SubItem); 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);
} }
} }
@@ -196,9 +234,12 @@ namespace TBF.UI.Bench.Metrology
double difference; /// Correction in selected unit double difference; /// Correction in selected unit
double correction; /// Correction in default unit double correction; /// Correction in default unit
double error = 0; double error = 0;
double uncertainty;
double readability = 0;
if (subItem == 1 && Utils.TryParseEDouble(strValue, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) >= 0) if (subItem == 1 && Utils.TryParseEDouble(strValue, out oriMeasurement))
{ {
measurement = Units.ConvertFrom(currentUnit, oriMeasurement);
(item.Tag as MeasurementCorrection).Measurement = measurement; (item.Tag as MeasurementCorrection).Measurement = measurement;
/// Update error (if possible) /// Update error (if possible)
@@ -263,6 +304,34 @@ namespace TBF.UI.Bench.Metrology
return true; return true;
} }
else if (subItem == 4 && Utils.TryParseEDouble(strValue, out uncertainty))
{
(item.Tag as MeasurementCorrection).Uncertainty = uncertainty;
if (uncertainty != 0)
{
item.SubItems[4].Text = Common.Utils.ToNiceString(uncertainty, SignifDigits);
}
else
{
item.SubItems[4].Text = Strings.NaN;
}
return true;
}
else if (subItem == 5 && Utils.TryParseEDouble(strValue, out readability))
{
(item.Tag as MeasurementCorrection).Readability = readability;
if (readability != 0)
{
item.SubItems[5].Text = Common.Utils.ToNiceString(readability, SignifDigits);
}
else
{
item.SubItems[5].Text = Strings.NaN;
}
return true;
}
else else
{ {
return false; return false;
@@ -439,5 +508,31 @@ namespace TBF.UI.Bench.Metrology
InitializeColumns(listViewEx, currentUnit); InitializeColumns(listViewEx, currentUnit);
RefreshAll(); RefreshAll();
} }
}
private void buoyancy_TextChanged(object sender, EventArgs e)
{
var cfg = new BalanceCfg(null);
cfg.BuoyancyTemp = Utils.ParseSFloat(buoyancyTempTextBox.Text);
cfg.BuoyancyPress =Utils.ParseUFloat(buoyancyPressTextBox.Text);
cfg.BuoyancyHumi = Utils.ParseUFloat(buoyancyHumiTextBox.Text);
airDensityTextBox.Text = CalculateAirDetsity(cfg).ToString("F4");
}
private void buoyancyHumiTextBox_TextChanged(object sender, EventArgs e)
{
buoyancy_TextChanged(sender, e);
}
private void buoyancyPressTextBox_TextChanged(object sender, EventArgs e)
{
buoyancy_TextChanged(sender, e);
}
private void buoyancyTempTextBox_TextChanged(object sender, EventArgs e)
{
buoyancy_TextChanged(sender, e);
}
}
} }
+319 -289
View File
@@ -31,294 +31,324 @@ namespace TBF.UI.Bench.Metrology
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.cmpntNameLabel = new System.Windows.Forms.Label(); this.cmpntNameLabel = new System.Windows.Forms.Label();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.unitLabel = new System.Windows.Forms.Label(); this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateExtendedCtrl();
this.unitComboBox = new System.Windows.Forms.ComboBox(); this.unitLabel = new System.Windows.Forms.Label();
this.buoancyGroupBox = new System.Windows.Forms.GroupBox(); this.unitComboBox = new System.Windows.Forms.ComboBox();
this.weightStandardDensityTextBox = new System.Windows.Forms.TextBox(); this.buoancyGroupBox = new System.Windows.Forms.GroupBox();
this.weightStandardDensityLabel = new System.Windows.Forms.Label(); this.weightStandardDensityTextBox = new System.Windows.Forms.TextBox();
this.airDensityTextBox = new System.Windows.Forms.TextBox(); this.weightStandardDensityLabel = new System.Windows.Forms.Label();
this.airDensityLabel = new System.Windows.Forms.Label(); this.airDensityTextBox = new System.Windows.Forms.TextBox();
this.buoyancyHumiTextBox = new System.Windows.Forms.TextBox(); this.airDensityLabel = new System.Windows.Forms.Label();
this.buoyancyPressTextBox = new System.Windows.Forms.TextBox(); this.buoyancyHumiTextBox = new System.Windows.Forms.TextBox();
this.buoyancyTempTextBox = new System.Windows.Forms.TextBox(); this.buoyancyPressTextBox = new System.Windows.Forms.TextBox();
this.buoyancyHumiLabel = new System.Windows.Forms.Label(); this.buoyancyTempTextBox = new System.Windows.Forms.TextBox();
this.buoyancyPressLabel = new System.Windows.Forms.Label(); this.buoyancyHumiLabel = new System.Windows.Forms.Label();
this.buoyancyTempLabel = new System.Windows.Forms.Label(); this.buoyancyPressLabel = new System.Windows.Forms.Label();
this.nameGroupBox = new System.Windows.Forms.GroupBox(); this.buoyancyTempLabel = new System.Windows.Forms.Label();
this.testGroupBox = new System.Windows.Forms.GroupBox(); this.nameGroupBox = new System.Windows.Forms.GroupBox();
this.correctedTextBox = new System.Windows.Forms.TextBox(); this.testGroupBox = new System.Windows.Forms.GroupBox();
this.measuredTextBox = new System.Windows.Forms.TextBox(); this.correctedTextBox = new System.Windows.Forms.TextBox();
this.correctedLabel = new System.Windows.Forms.Label(); this.measuredTextBox = new System.Windows.Forms.TextBox();
this.measuredLabel = new System.Windows.Forms.Label(); this.correctedLabel = new System.Windows.Forms.Label();
this.listViewEx = new Common.Forms.ListViewEx(); this.measuredLabel = new System.Windows.Forms.Label();
this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateCtrl(); this.listViewEx = new Common.Forms.ListViewEx();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout(); this.splitContainer1.SuspendLayout();
this.buoancyGroupBox.SuspendLayout(); this.buoancyGroupBox.SuspendLayout();
this.nameGroupBox.SuspendLayout(); this.nameGroupBox.SuspendLayout();
this.testGroupBox.SuspendLayout(); this.testGroupBox.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// cmpntNameLabel // cmpntNameLabel
// //
this.cmpntNameLabel.AutoSize = true; this.cmpntNameLabel.AutoSize = true;
this.cmpntNameLabel.Location = new System.Drawing.Point(69, 16); this.cmpntNameLabel.Location = new System.Drawing.Point(104, 25);
this.cmpntNameLabel.Name = "cmpntNameLabel"; this.cmpntNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.cmpntNameLabel.Size = new System.Drawing.Size(64, 13); this.cmpntNameLabel.Name = "cmpntNameLabel";
this.cmpntNameLabel.TabIndex = 0; this.cmpntNameLabel.Size = new System.Drawing.Size(95, 20);
this.cmpntNameLabel.Text = "cmpntName"; this.cmpntNameLabel.TabIndex = 0;
// this.cmpntNameLabel.Text = "cmpntName";
// splitContainer1 //
// // splitContainer1
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; //
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0); this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Name = "splitContainer1"; this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; this.splitContainer1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
// this.splitContainer1.Name = "splitContainer1";
// splitContainer1.Panel1 this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
// //
this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl); // splitContainer1.Panel1
this.splitContainer1.Panel1.Controls.Add(this.unitLabel); //
this.splitContainer1.Panel1.Controls.Add(this.unitComboBox); this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl);
this.splitContainer1.Panel1.Controls.Add(this.buoancyGroupBox); this.splitContainer1.Panel1.Controls.Add(this.unitLabel);
this.splitContainer1.Panel1.Controls.Add(this.nameGroupBox); this.splitContainer1.Panel1.Controls.Add(this.unitComboBox);
this.splitContainer1.Panel1.Controls.Add(this.testGroupBox); this.splitContainer1.Panel1.Controls.Add(this.buoancyGroupBox);
// this.splitContainer1.Panel1.Controls.Add(this.nameGroupBox);
// splitContainer1.Panel2 this.splitContainer1.Panel1.Controls.Add(this.testGroupBox);
// //
this.splitContainer1.Panel2.Controls.Add(this.listViewEx); // splitContainer1.Panel2
this.splitContainer1.Size = new System.Drawing.Size(700, 400); //
this.splitContainer1.SplitterDistance = 160; this.splitContainer1.Panel2.Controls.Add(this.listViewEx);
this.splitContainer1.TabIndex = 1; this.splitContainer1.Size = new System.Drawing.Size(1050, 615);
// this.splitContainer1.SplitterDistance = 238;
// unitLabel this.splitContainer1.SplitterWidth = 6;
// this.splitContainer1.TabIndex = 1;
this.unitLabel.AutoSize = true; //
this.unitLabel.Location = new System.Drawing.Point(537, 121); // calibCertificateCtrl
this.unitLabel.Name = "unitLabel"; //
this.unitLabel.Size = new System.Drawing.Size(68, 13); this.calibCertificateCtrl.Location = new System.Drawing.Point(23, 83);
this.unitLabel.TabIndex = 12; this.calibCertificateCtrl.Margin = new System.Windows.Forms.Padding(6, 8, 6, 8);
this.unitLabel.Text = "Unit of mass:"; this.calibCertificateCtrl.Name = "calibCertificateCtrl";
// this.calibCertificateCtrl.Size = new System.Drawing.Size(360, 263);
// unitComboBox this.calibCertificateCtrl.TabIndex = 13;
// //
this.unitComboBox.FormattingEnabled = true; // unitLabel
this.unitComboBox.Location = new System.Drawing.Point(622, 118); //
this.unitComboBox.Name = "unitComboBox"; this.unitLabel.AutoSize = true;
this.unitComboBox.Size = new System.Drawing.Size(62, 21); this.unitLabel.Location = new System.Drawing.Point(806, 186);
this.unitComboBox.TabIndex = 11; this.unitLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.unitComboBox.SelectedIndexChanged += new System.EventHandler(this.unitComboBox_SelectedIndexChanged); this.unitLabel.Name = "unitLabel";
// this.unitLabel.Size = new System.Drawing.Size(102, 20);
// buoancyGroupBox this.unitLabel.TabIndex = 12;
// this.unitLabel.Text = "Unit of mass:";
this.buoancyGroupBox.Controls.Add(this.weightStandardDensityTextBox); //
this.buoancyGroupBox.Controls.Add(this.weightStandardDensityLabel); // unitComboBox
this.buoancyGroupBox.Controls.Add(this.airDensityTextBox); //
this.buoancyGroupBox.Controls.Add(this.airDensityLabel); this.unitComboBox.FormattingEnabled = true;
this.buoancyGroupBox.Controls.Add(this.buoyancyHumiTextBox); this.unitComboBox.Location = new System.Drawing.Point(933, 182);
this.buoancyGroupBox.Controls.Add(this.buoyancyPressTextBox); this.unitComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.buoancyGroupBox.Controls.Add(this.buoyancyTempTextBox); this.unitComboBox.Name = "unitComboBox";
this.buoancyGroupBox.Controls.Add(this.buoyancyHumiLabel); this.unitComboBox.Size = new System.Drawing.Size(91, 28);
this.buoancyGroupBox.Controls.Add(this.buoyancyPressLabel); this.unitComboBox.TabIndex = 11;
this.buoancyGroupBox.Controls.Add(this.buoyancyTempLabel); this.unitComboBox.SelectedIndexChanged += new System.EventHandler(this.unitComboBox_SelectedIndexChanged);
this.buoancyGroupBox.Location = new System.Drawing.Point(262, 10); //
this.buoancyGroupBox.Name = "buoancyGroupBox"; // buoancyGroupBox
this.buoancyGroupBox.Size = new System.Drawing.Size(248, 146); //
this.buoancyGroupBox.TabIndex = 5; this.buoancyGroupBox.Controls.Add(this.weightStandardDensityTextBox);
this.buoancyGroupBox.TabStop = false; this.buoancyGroupBox.Controls.Add(this.weightStandardDensityLabel);
this.buoancyGroupBox.Text = "Buoyancy"; this.buoancyGroupBox.Controls.Add(this.airDensityTextBox);
// this.buoancyGroupBox.Controls.Add(this.airDensityLabel);
// weightStandardDensityTextBox this.buoancyGroupBox.Controls.Add(this.buoyancyHumiTextBox);
// this.buoancyGroupBox.Controls.Add(this.buoyancyPressTextBox);
this.weightStandardDensityTextBox.Enabled = false; this.buoancyGroupBox.Controls.Add(this.buoyancyTempTextBox);
this.weightStandardDensityTextBox.Location = new System.Drawing.Point(156, 107); this.buoancyGroupBox.Controls.Add(this.buoyancyHumiLabel);
this.weightStandardDensityTextBox.Name = "weightStandardDensityTextBox"; this.buoancyGroupBox.Controls.Add(this.buoyancyPressLabel);
this.weightStandardDensityTextBox.Size = new System.Drawing.Size(82, 20); this.buoancyGroupBox.Controls.Add(this.buoyancyTempLabel);
this.weightStandardDensityTextBox.TabIndex = 9; this.buoancyGroupBox.Location = new System.Drawing.Point(393, 15);
// this.buoancyGroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
// weightStandardDensityLabel this.buoancyGroupBox.Name = "buoancyGroupBox";
// this.buoancyGroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.weightStandardDensityLabel.AutoSize = true; this.buoancyGroupBox.Size = new System.Drawing.Size(372, 225);
this.weightStandardDensityLabel.Location = new System.Drawing.Point(13, 110); this.buoancyGroupBox.TabIndex = 5;
this.weightStandardDensityLabel.Name = "weightStandardDensityLabel"; this.buoancyGroupBox.TabStop = false;
this.weightStandardDensityLabel.Size = new System.Drawing.Size(133, 13); this.buoancyGroupBox.Text = "Buoyancy";
this.weightStandardDensityLabel.TabIndex = 8; //
this.weightStandardDensityLabel.Text = "Ref. mass density [kg/m3]:"; // weightStandardDensityTextBox
// //
// airDensityTextBox this.weightStandardDensityTextBox.Enabled = false;
// this.weightStandardDensityTextBox.Location = new System.Drawing.Point(234, 165);
this.airDensityTextBox.Enabled = false; this.weightStandardDensityTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.airDensityTextBox.Location = new System.Drawing.Point(156, 85); this.weightStandardDensityTextBox.Name = "weightStandardDensityTextBox";
this.airDensityTextBox.Name = "airDensityTextBox"; this.weightStandardDensityTextBox.Size = new System.Drawing.Size(121, 26);
this.airDensityTextBox.Size = new System.Drawing.Size(82, 20); this.weightStandardDensityTextBox.TabIndex = 9;
this.airDensityTextBox.TabIndex = 7; //
// // weightStandardDensityLabel
// airDensityLabel //
// this.weightStandardDensityLabel.AutoSize = true;
this.airDensityLabel.AutoSize = true; this.weightStandardDensityLabel.Location = new System.Drawing.Point(20, 169);
this.airDensityLabel.Location = new System.Drawing.Point(13, 88); this.weightStandardDensityLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.airDensityLabel.Name = "airDensityLabel"; this.weightStandardDensityLabel.Name = "weightStandardDensityLabel";
this.airDensityLabel.Size = new System.Drawing.Size(95, 13); this.weightStandardDensityLabel.Size = new System.Drawing.Size(194, 20);
this.airDensityLabel.TabIndex = 6; this.weightStandardDensityLabel.TabIndex = 8;
this.airDensityLabel.Text = "Air density [kg/m3]"; this.weightStandardDensityLabel.Text = "Ref. mass density [kg/m3]:";
// //
// buoyancyHumiTextBox // airDensityTextBox
// //
this.buoyancyHumiTextBox.Enabled = false; this.airDensityTextBox.Enabled = false;
this.buoyancyHumiTextBox.Location = new System.Drawing.Point(156, 63); this.airDensityTextBox.Location = new System.Drawing.Point(234, 131);
this.buoyancyHumiTextBox.Name = "buoyancyHumiTextBox"; this.airDensityTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.buoyancyHumiTextBox.Size = new System.Drawing.Size(82, 20); this.airDensityTextBox.Name = "airDensityTextBox";
this.buoyancyHumiTextBox.TabIndex = 5; this.airDensityTextBox.Size = new System.Drawing.Size(121, 26);
// this.airDensityTextBox.TabIndex = 7;
// buoyancyPressTextBox //
// // airDensityLabel
this.buoyancyPressTextBox.Enabled = false; //
this.buoyancyPressTextBox.Location = new System.Drawing.Point(156, 41); this.airDensityLabel.AutoSize = true;
this.buoyancyPressTextBox.Name = "buoyancyPressTextBox"; this.airDensityLabel.Location = new System.Drawing.Point(20, 135);
this.buoyancyPressTextBox.Size = new System.Drawing.Size(82, 20); this.airDensityLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.buoyancyPressTextBox.TabIndex = 4; this.airDensityLabel.Name = "airDensityLabel";
// this.airDensityLabel.Size = new System.Drawing.Size(137, 20);
// buoyancyTempTextBox this.airDensityLabel.TabIndex = 6;
// this.airDensityLabel.Text = "Air density [kg/m3]";
this.buoyancyTempTextBox.Enabled = false; //
this.buoyancyTempTextBox.Location = new System.Drawing.Point(156, 19); // buoyancyHumiTextBox
this.buoyancyTempTextBox.Name = "buoyancyTempTextBox"; //
this.buoyancyTempTextBox.Size = new System.Drawing.Size(82, 20); this.buoyancyHumiTextBox.Enabled = false;
this.buoyancyTempTextBox.TabIndex = 3; this.buoyancyHumiTextBox.Location = new System.Drawing.Point(234, 97);
// this.buoyancyHumiTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
// buoyancyHumiLabel this.buoyancyHumiTextBox.Name = "buoyancyHumiTextBox";
// this.buoyancyHumiTextBox.Size = new System.Drawing.Size(121, 26);
this.buoyancyHumiLabel.AutoSize = true; this.buoyancyHumiTextBox.TabIndex = 5;
this.buoyancyHumiLabel.Location = new System.Drawing.Point(13, 66); this.buoyancyHumiTextBox.TextChanged += new System.EventHandler(this.buoyancyHumiTextBox_TextChanged);
this.buoyancyHumiLabel.Name = "buoyancyHumiLabel"; //
this.buoyancyHumiLabel.Size = new System.Drawing.Size(72, 13); // buoyancyPressTextBox
this.buoyancyHumiLabel.TabIndex = 2; //
this.buoyancyHumiLabel.Text = "Humidity [R%]"; this.buoyancyPressTextBox.Enabled = false;
// this.buoyancyPressTextBox.Location = new System.Drawing.Point(234, 63);
// buoyancyPressLabel this.buoyancyPressTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
// this.buoyancyPressTextBox.Name = "buoyancyPressTextBox";
this.buoyancyPressLabel.AutoSize = true; this.buoyancyPressTextBox.Size = new System.Drawing.Size(121, 26);
this.buoyancyPressLabel.Location = new System.Drawing.Point(13, 44); this.buoyancyPressTextBox.TabIndex = 4;
this.buoyancyPressLabel.Name = "buoyancyPressLabel"; this.buoyancyPressTextBox.TextChanged += new System.EventHandler(this.buoyancyPressTextBox_TextChanged);
this.buoyancyPressLabel.Size = new System.Drawing.Size(76, 13); //
this.buoyancyPressLabel.TabIndex = 1; // buoyancyTempTextBox
this.buoyancyPressLabel.Text = "Pressure [hPa]"; //
// this.buoyancyTempTextBox.Enabled = false;
// buoyancyTempLabel this.buoyancyTempTextBox.Location = new System.Drawing.Point(234, 29);
// this.buoyancyTempTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.buoyancyTempLabel.AutoSize = true; this.buoyancyTempTextBox.Name = "buoyancyTempTextBox";
this.buoyancyTempLabel.Location = new System.Drawing.Point(13, 22); this.buoyancyTempTextBox.Size = new System.Drawing.Size(121, 26);
this.buoyancyTempLabel.Name = "buoyancyTempLabel"; this.buoyancyTempTextBox.TabIndex = 3;
this.buoyancyTempLabel.Size = new System.Drawing.Size(83, 13); this.buoyancyTempTextBox.TextChanged += new System.EventHandler(this.buoyancyTempTextBox_TextChanged);
this.buoyancyTempLabel.TabIndex = 0; //
this.buoyancyTempLabel.Text = "Temperature [C]"; // buoyancyHumiLabel
// //
// nameGroupBox this.buoyancyHumiLabel.AutoSize = true;
// this.buoyancyHumiLabel.Location = new System.Drawing.Point(20, 102);
this.nameGroupBox.Controls.Add(this.cmpntNameLabel); this.buoyancyHumiLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.nameGroupBox.Location = new System.Drawing.Point(16, 10); this.buoyancyHumiLabel.Name = "buoyancyHumiLabel";
this.nameGroupBox.Name = "nameGroupBox"; this.buoyancyHumiLabel.Size = new System.Drawing.Size(108, 20);
this.nameGroupBox.Size = new System.Drawing.Size(240, 40); this.buoyancyHumiLabel.TabIndex = 2;
this.nameGroupBox.TabIndex = 4; this.buoyancyHumiLabel.Text = "Humidity [R%]";
this.nameGroupBox.TabStop = false; //
this.nameGroupBox.Text = "Component"; // buoyancyPressLabel
// //
// testGroupBox this.buoyancyPressLabel.AutoSize = true;
// this.buoyancyPressLabel.Location = new System.Drawing.Point(20, 68);
this.testGroupBox.Controls.Add(this.correctedTextBox); this.buoyancyPressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.testGroupBox.Controls.Add(this.measuredTextBox); this.buoyancyPressLabel.Name = "buoyancyPressLabel";
this.testGroupBox.Controls.Add(this.correctedLabel); this.buoyancyPressLabel.Size = new System.Drawing.Size(112, 20);
this.testGroupBox.Controls.Add(this.measuredLabel); this.buoyancyPressLabel.TabIndex = 1;
this.testGroupBox.Location = new System.Drawing.Point(516, 10); this.buoyancyPressLabel.Text = "Pressure [hPa]";
this.testGroupBox.Name = "testGroupBox"; //
this.testGroupBox.Size = new System.Drawing.Size(170, 88); // buoyancyTempLabel
this.testGroupBox.TabIndex = 3; //
this.testGroupBox.TabStop = false; this.buoyancyTempLabel.AutoSize = true;
this.testGroupBox.Text = "Correction test"; this.buoyancyTempLabel.Location = new System.Drawing.Point(20, 34);
// this.buoyancyTempLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
// correctedTextBox this.buoyancyTempLabel.Name = "buoyancyTempLabel";
// this.buoyancyTempLabel.Size = new System.Drawing.Size(123, 20);
this.correctedTextBox.Location = new System.Drawing.Point(91, 47); this.buoyancyTempLabel.TabIndex = 0;
this.correctedTextBox.Name = "correctedTextBox"; this.buoyancyTempLabel.Text = "Temperature [C]";
this.correctedTextBox.ReadOnly = true; //
this.correctedTextBox.Size = new System.Drawing.Size(73, 20); // nameGroupBox
this.correctedTextBox.TabIndex = 5; //
// this.nameGroupBox.Controls.Add(this.cmpntNameLabel);
// measuredTextBox this.nameGroupBox.Location = new System.Drawing.Point(24, 15);
// this.nameGroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.measuredTextBox.Location = new System.Drawing.Point(91, 19); this.nameGroupBox.Name = "nameGroupBox";
this.measuredTextBox.Name = "measuredTextBox"; this.nameGroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.measuredTextBox.Size = new System.Drawing.Size(73, 20); this.nameGroupBox.Size = new System.Drawing.Size(360, 62);
this.measuredTextBox.TabIndex = 4; this.nameGroupBox.TabIndex = 4;
this.measuredTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged); this.nameGroupBox.TabStop = false;
// this.nameGroupBox.Text = "Component";
// correctedLabel //
// // testGroupBox
this.correctedLabel.AutoSize = true; //
this.correctedLabel.Location = new System.Drawing.Point(11, 50); this.testGroupBox.Controls.Add(this.correctedTextBox);
this.correctedLabel.Name = "correctedLabel"; this.testGroupBox.Controls.Add(this.measuredTextBox);
this.correctedLabel.Size = new System.Drawing.Size(53, 13); this.testGroupBox.Controls.Add(this.correctedLabel);
this.correctedLabel.TabIndex = 3; this.testGroupBox.Controls.Add(this.measuredLabel);
this.correctedLabel.Text = "Corrected"; this.testGroupBox.Location = new System.Drawing.Point(774, 15);
// this.testGroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
// measuredLabel this.testGroupBox.Name = "testGroupBox";
// this.testGroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.measuredLabel.AutoSize = true; this.testGroupBox.Size = new System.Drawing.Size(255, 135);
this.measuredLabel.Location = new System.Drawing.Point(11, 22); this.testGroupBox.TabIndex = 3;
this.measuredLabel.Name = "measuredLabel"; this.testGroupBox.TabStop = false;
this.measuredLabel.Size = new System.Drawing.Size(54, 13); this.testGroupBox.Text = "Correction test";
this.measuredLabel.TabIndex = 2; //
this.measuredLabel.Text = "Measured"; // correctedTextBox
// //
// listViewEx this.correctedTextBox.Location = new System.Drawing.Point(136, 72);
// this.correctedTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.listViewEx.AllowColumnReorder = true; this.correctedTextBox.Name = "correctedTextBox";
this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill; this.correctedTextBox.ReadOnly = true;
this.listViewEx.DoubleClickActivation = false; this.correctedTextBox.Size = new System.Drawing.Size(108, 26);
this.listViewEx.FullRowSelect = true; this.correctedTextBox.TabIndex = 5;
this.listViewEx.GridLines = true; //
this.listViewEx.HideSelection = false; // measuredTextBox
this.listViewEx.Location = new System.Drawing.Point(0, 0); //
this.listViewEx.Name = "listViewEx"; this.measuredTextBox.Location = new System.Drawing.Point(136, 29);
this.listViewEx.Size = new System.Drawing.Size(700, 236); this.measuredTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.listViewEx.TabIndex = 0; this.measuredTextBox.Name = "measuredTextBox";
this.listViewEx.UseCompatibleStateImageBehavior = false; this.measuredTextBox.Size = new System.Drawing.Size(108, 26);
this.listViewEx.View = System.Windows.Forms.View.Details; this.measuredTextBox.TabIndex = 4;
this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged); this.measuredTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged);
// //
// calibCertificateCtrl // correctedLabel
// //
this.calibCertificateCtrl.Location = new System.Drawing.Point(16, 56); this.correctedLabel.AutoSize = true;
this.calibCertificateCtrl.Name = "calibCertificateCtrl"; this.correctedLabel.Location = new System.Drawing.Point(16, 77);
this.calibCertificateCtrl.Size = new System.Drawing.Size(240, 100); this.correctedLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.calibCertificateCtrl.TabIndex = 13; this.correctedLabel.Name = "correctedLabel";
// this.correctedLabel.Size = new System.Drawing.Size(79, 20);
// MetrologyDlgScaleTab this.correctedLabel.TabIndex = 3;
// this.correctedLabel.Text = "Corrected";
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; // measuredLabel
this.Controls.Add(this.splitContainer1); //
this.Name = "MetrologyDlgScaleTab"; this.measuredLabel.AutoSize = true;
this.Size = new System.Drawing.Size(700, 400); this.measuredLabel.Location = new System.Drawing.Point(16, 34);
this.Load += new System.EventHandler(this.MetrologyDlgBalanceTab_Load); this.measuredLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.splitContainer1.Panel1.ResumeLayout(false); this.measuredLabel.Name = "measuredLabel";
this.splitContainer1.Panel1.PerformLayout(); this.measuredLabel.Size = new System.Drawing.Size(80, 20);
this.splitContainer1.Panel2.ResumeLayout(false); this.measuredLabel.TabIndex = 2;
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.measuredLabel.Text = "Measured";
this.splitContainer1.ResumeLayout(false); //
this.buoancyGroupBox.ResumeLayout(false); // listViewEx
this.buoancyGroupBox.PerformLayout(); //
this.nameGroupBox.ResumeLayout(false); this.listViewEx.AllowColumnReorder = true;
this.nameGroupBox.PerformLayout(); this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill;
this.testGroupBox.ResumeLayout(false); this.listViewEx.DoubleClickActivation = false;
this.testGroupBox.PerformLayout(); this.listViewEx.FullRowSelect = true;
this.ResumeLayout(false); 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(1050, 371);
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);
//
// MetrologyDlgScaleTab
//
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 = "MetrologyDlgScaleTab";
this.Size = new System.Drawing.Size(1050, 615);
this.Load += new System.EventHandler(this.MetrologyDlgBalanceTab_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.buoancyGroupBox.ResumeLayout(false);
this.buoancyGroupBox.PerformLayout();
this.nameGroupBox.ResumeLayout(false);
this.nameGroupBox.PerformLayout();
this.testGroupBox.ResumeLayout(false);
this.testGroupBox.PerformLayout();
this.ResumeLayout(false);
} }
#endregion #endregion
@@ -345,6 +375,6 @@ namespace TBF.UI.Bench.Metrology
private System.Windows.Forms.Label airDensityLabel; private System.Windows.Forms.Label airDensityLabel;
private System.Windows.Forms.Label unitLabel; private System.Windows.Forms.Label unitLabel;
private System.Windows.Forms.ComboBox unitComboBox; private System.Windows.Forms.ComboBox unitComboBox;
private CalibCertificateCtrl calibCertificateCtrl; private TBF.UI.Bench.Metrology.CalibCertificateExtendedCtrl calibCertificateCtrl;
} }
} }
+180 -166
View File
@@ -31,171 +31,185 @@ namespace TBF.UI.Bench.Metrology
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateCtrl(); this.calibCertificateCtrl = new TBF.UI.Bench.Metrology.CalibCertificateExtendedCtrl();
this.unitLabel = new System.Windows.Forms.Label(); this.unitLabel = new System.Windows.Forms.Label();
this.unitComboBox = new System.Windows.Forms.ComboBox(); this.unitComboBox = new System.Windows.Forms.ComboBox();
this.testGroupBox = new System.Windows.Forms.GroupBox(); this.testGroupBox = new System.Windows.Forms.GroupBox();
this.correctedTextBox = new System.Windows.Forms.TextBox(); this.correctedTextBox = new System.Windows.Forms.TextBox();
this.measuredTextBox = new System.Windows.Forms.TextBox(); this.measuredTextBox = new System.Windows.Forms.TextBox();
this.correctedLabel = new System.Windows.Forms.Label(); this.correctedLabel = new System.Windows.Forms.Label();
this.measuredLabel = new System.Windows.Forms.Label(); this.measuredLabel = new System.Windows.Forms.Label();
this.componentLabel = new System.Windows.Forms.Label(); this.componentLabel = new System.Windows.Forms.Label();
this.cmpntNameLabel = new System.Windows.Forms.Label(); this.cmpntNameLabel = new System.Windows.Forms.Label();
this.listViewEx = new Common.Forms.ListViewEx(); this.listViewEx = new Common.Forms.ListViewEx();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout(); this.splitContainer1.SuspendLayout();
this.testGroupBox.SuspendLayout(); this.testGroupBox.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// splitContainer1 // splitContainer1
// //
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(0, 0); this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1"; this.splitContainer1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; this.splitContainer1.Name = "splitContainer1";
// this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
// splitContainer1.Panel1 //
// // splitContainer1.Panel1
this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl); //
this.splitContainer1.Panel1.Controls.Add(this.unitLabel); this.splitContainer1.Panel1.Controls.Add(this.calibCertificateCtrl);
this.splitContainer1.Panel1.Controls.Add(this.unitComboBox); this.splitContainer1.Panel1.Controls.Add(this.unitLabel);
this.splitContainer1.Panel1.Controls.Add(this.testGroupBox); this.splitContainer1.Panel1.Controls.Add(this.unitComboBox);
this.splitContainer1.Panel1.Controls.Add(this.componentLabel); this.splitContainer1.Panel1.Controls.Add(this.testGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.cmpntNameLabel); this.splitContainer1.Panel1.Controls.Add(this.componentLabel);
// this.splitContainer1.Panel1.Controls.Add(this.cmpntNameLabel);
// splitContainer1.Panel2 //
// // splitContainer1.Panel2
this.splitContainer1.Panel2.Controls.Add(this.listViewEx); //
this.splitContainer1.Size = new System.Drawing.Size(650, 300); this.splitContainer1.Panel2.Controls.Add(this.listViewEx);
this.splitContainer1.SplitterDistance = 112; this.splitContainer1.Size = new System.Drawing.Size(975, 462);
this.splitContainer1.TabIndex = 2; this.splitContainer1.SplitterDistance = 146;
// this.splitContainer1.SplitterWidth = 6;
// calibCertificateCtrl this.splitContainer1.TabIndex = 2;
// //
this.calibCertificateCtrl.Location = new System.Drawing.Point(195, 7); // calibCertificateCtrl
this.calibCertificateCtrl.Name = "calibCertificateCtrl"; //
this.calibCertificateCtrl.Size = new System.Drawing.Size(240, 100); this.calibCertificateCtrl.Location = new System.Drawing.Point(292, 11);
this.calibCertificateCtrl.TabIndex = 9; this.calibCertificateCtrl.Margin = new System.Windows.Forms.Padding(6, 8, 6, 8);
// this.calibCertificateCtrl.Name = "calibCertificateCtrl";
// unitLabel this.calibCertificateCtrl.Size = new System.Drawing.Size(360, 233);
// this.calibCertificateCtrl.TabIndex = 9;
this.unitLabel.AutoSize = true; //
this.unitLabel.Location = new System.Drawing.Point(14, 60); // unitLabel
this.unitLabel.Name = "unitLabel"; //
this.unitLabel.Size = new System.Drawing.Size(100, 13); this.unitLabel.AutoSize = true;
this.unitLabel.TabIndex = 8; this.unitLabel.Location = new System.Drawing.Point(21, 92);
this.unitLabel.Text = "Unit of temperature:"; this.unitLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
// this.unitLabel.Name = "unitLabel";
// unitComboBox this.unitLabel.Size = new System.Drawing.Size(151, 20);
// this.unitLabel.TabIndex = 8;
this.unitComboBox.FormattingEnabled = true; this.unitLabel.Text = "Unit of temperature:";
this.unitComboBox.Location = new System.Drawing.Point(121, 57); //
this.unitComboBox.Name = "unitComboBox"; // unitComboBox
this.unitComboBox.Size = new System.Drawing.Size(62, 21); //
this.unitComboBox.TabIndex = 1; this.unitComboBox.FormattingEnabled = true;
// this.unitComboBox.Location = new System.Drawing.Point(182, 88);
// testGroupBox this.unitComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
// this.unitComboBox.Name = "unitComboBox";
this.testGroupBox.Controls.Add(this.correctedTextBox); this.unitComboBox.Size = new System.Drawing.Size(91, 28);
this.testGroupBox.Controls.Add(this.measuredTextBox); this.unitComboBox.TabIndex = 1;
this.testGroupBox.Controls.Add(this.correctedLabel); //
this.testGroupBox.Controls.Add(this.measuredLabel); // testGroupBox
this.testGroupBox.Location = new System.Drawing.Point(441, 7); //
this.testGroupBox.Name = "testGroupBox"; this.testGroupBox.Controls.Add(this.correctedTextBox);
this.testGroupBox.Size = new System.Drawing.Size(200, 100); this.testGroupBox.Controls.Add(this.measuredTextBox);
this.testGroupBox.TabIndex = 4; this.testGroupBox.Controls.Add(this.correctedLabel);
this.testGroupBox.TabStop = false; this.testGroupBox.Controls.Add(this.measuredLabel);
this.testGroupBox.Text = "Test"; this.testGroupBox.Location = new System.Drawing.Point(662, 11);
// this.testGroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
// correctedTextBox this.testGroupBox.Name = "testGroupBox";
// this.testGroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.correctedTextBox.Location = new System.Drawing.Point(115, 49); this.testGroupBox.Size = new System.Drawing.Size(300, 154);
this.correctedTextBox.Name = "correctedTextBox"; this.testGroupBox.TabIndex = 4;
this.correctedTextBox.ReadOnly = true; this.testGroupBox.TabStop = false;
this.correctedTextBox.Size = new System.Drawing.Size(73, 20); this.testGroupBox.Text = "Test";
this.correctedTextBox.TabIndex = 5; //
// // correctedTextBox
// measuredTextBox //
// this.correctedTextBox.Location = new System.Drawing.Point(172, 75);
this.measuredTextBox.Location = new System.Drawing.Point(115, 24); this.correctedTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.measuredTextBox.Name = "measuredTextBox"; this.correctedTextBox.Name = "correctedTextBox";
this.measuredTextBox.Size = new System.Drawing.Size(73, 20); this.correctedTextBox.ReadOnly = true;
this.measuredTextBox.TabIndex = 4; this.correctedTextBox.Size = new System.Drawing.Size(108, 26);
this.measuredTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged); this.correctedTextBox.TabIndex = 5;
// //
// correctedLabel // measuredTextBox
// //
this.correctedLabel.AutoSize = true; this.measuredTextBox.Location = new System.Drawing.Point(172, 37);
this.correctedLabel.Location = new System.Drawing.Point(7, 52); this.measuredTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.correctedLabel.Name = "correctedLabel"; this.measuredTextBox.Name = "measuredTextBox";
this.correctedLabel.Size = new System.Drawing.Size(53, 13); this.measuredTextBox.Size = new System.Drawing.Size(108, 26);
this.correctedLabel.TabIndex = 3; this.measuredTextBox.TabIndex = 4;
this.correctedLabel.Text = "Corrected"; this.measuredTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged);
// //
// measuredLabel // correctedLabel
// //
this.measuredLabel.AutoSize = true; this.correctedLabel.AutoSize = true;
this.measuredLabel.Location = new System.Drawing.Point(7, 27); this.correctedLabel.Location = new System.Drawing.Point(10, 80);
this.measuredLabel.Name = "measuredLabel"; this.correctedLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.measuredLabel.Size = new System.Drawing.Size(54, 13); this.correctedLabel.Name = "correctedLabel";
this.measuredLabel.TabIndex = 2; this.correctedLabel.Size = new System.Drawing.Size(79, 20);
this.measuredLabel.Text = "Measured"; this.correctedLabel.TabIndex = 3;
// this.correctedLabel.Text = "Corrected";
// componentLabel //
// // measuredLabel
this.componentLabel.AutoSize = true; //
this.componentLabel.Location = new System.Drawing.Point(14, 17); this.measuredLabel.AutoSize = true;
this.componentLabel.Name = "componentLabel"; this.measuredLabel.Location = new System.Drawing.Point(10, 42);
this.componentLabel.Size = new System.Drawing.Size(64, 13); this.measuredLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.componentLabel.TabIndex = 1; this.measuredLabel.Name = "measuredLabel";
this.componentLabel.Text = "Component:"; this.measuredLabel.Size = new System.Drawing.Size(80, 20);
// this.measuredLabel.TabIndex = 2;
// cmpntNameLabel this.measuredLabel.Text = "Measured";
// //
this.cmpntNameLabel.AutoSize = true; // componentLabel
this.cmpntNameLabel.Location = new System.Drawing.Point(97, 17); //
this.cmpntNameLabel.Name = "cmpntNameLabel"; this.componentLabel.AutoSize = true;
this.cmpntNameLabel.Size = new System.Drawing.Size(88, 13); this.componentLabel.Location = new System.Drawing.Point(21, 26);
this.cmpntNameLabel.TabIndex = 0; this.componentLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.cmpntNameLabel.Text = "componentName"; this.componentLabel.Name = "componentLabel";
// this.componentLabel.Size = new System.Drawing.Size(96, 20);
// listViewEx this.componentLabel.TabIndex = 1;
// this.componentLabel.Text = "Component:";
this.listViewEx.AllowColumnReorder = true; //
this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill; // cmpntNameLabel
this.listViewEx.DoubleClickActivation = false; //
this.listViewEx.FullRowSelect = true; this.cmpntNameLabel.AutoSize = true;
this.listViewEx.GridLines = true; this.cmpntNameLabel.Location = new System.Drawing.Point(146, 26);
this.listViewEx.HideSelection = false; this.cmpntNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.listViewEx.Location = new System.Drawing.Point(0, 0); this.cmpntNameLabel.Name = "cmpntNameLabel";
this.listViewEx.Name = "listViewEx"; this.cmpntNameLabel.Size = new System.Drawing.Size(131, 20);
this.listViewEx.Size = new System.Drawing.Size(650, 184); this.cmpntNameLabel.TabIndex = 0;
this.listViewEx.TabIndex = 0; this.cmpntNameLabel.Text = "componentName";
this.listViewEx.UseCompatibleStateImageBehavior = false; //
this.listViewEx.View = System.Windows.Forms.View.Details; // listViewEx
this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged); //
// this.listViewEx.AllowColumnReorder = true;
// MetrologyDlgTempMeterTab this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill;
// this.listViewEx.DoubleClickActivation = false;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.listViewEx.FullRowSelect = true;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.listViewEx.GridLines = true;
this.Controls.Add(this.splitContainer1); this.listViewEx.HideSelection = false;
this.Name = "MetrologyDlgTempMeterTab"; this.listViewEx.Location = new System.Drawing.Point(0, 0);
this.Size = new System.Drawing.Size(650, 300); this.listViewEx.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Load += new System.EventHandler(this.MetrologyDlgTempMeterTab_Load); this.listViewEx.Name = "listViewEx";
this.splitContainer1.Panel1.ResumeLayout(false); this.listViewEx.Size = new System.Drawing.Size(975, 310);
this.splitContainer1.Panel1.PerformLayout(); this.listViewEx.TabIndex = 0;
this.splitContainer1.Panel2.ResumeLayout(false); this.listViewEx.UseCompatibleStateImageBehavior = false;
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.listViewEx.View = System.Windows.Forms.View.Details;
this.splitContainer1.ResumeLayout(false); this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged);
this.testGroupBox.ResumeLayout(false); //
this.testGroupBox.PerformLayout(); // MetrologyDlgTempMeterTab
this.ResumeLayout(false); //
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 = "MetrologyDlgTempMeterTab";
this.Size = new System.Drawing.Size(975, 462);
this.Load += new System.EventHandler(this.MetrologyDlgTempMeterTab_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 #endregion
@@ -211,6 +225,6 @@ namespace TBF.UI.Bench.Metrology
private System.Windows.Forms.Label measuredLabel; private System.Windows.Forms.Label measuredLabel;
private System.Windows.Forms.Label unitLabel; private System.Windows.Forms.Label unitLabel;
private System.Windows.Forms.ComboBox unitComboBox; private System.Windows.Forms.ComboBox unitComboBox;
private CalibCertificateCtrl calibCertificateCtrl; private TBF.UI.Bench.Metrology.CalibCertificateExtendedCtrl calibCertificateCtrl;
} }
} }
@@ -52,6 +52,8 @@ namespace TBF.UI.Bench.Metrology
Control measurementTextBox; Control measurementTextBox;
Control correctionTextBox; Control correctionTextBox;
Control errorTextBox; Control errorTextBox;
Control uncertaintyTextBox;
Control readabilityTextBox;
Unit currentUnit; Unit currentUnit;
@@ -81,6 +83,8 @@ namespace TBF.UI.Bench.Metrology
this.Controls.Add(measurementTextBox = new TextBox()); this.Controls.Add(measurementTextBox = new TextBox());
this.Controls.Add(correctionTextBox = new TextBox()); this.Controls.Add(correctionTextBox = new TextBox());
this.Controls.Add(errorTextBox = 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.TempUnit; currentUnit = TBF.Rig.Sequences.ProcessData.TempUnit;
unitComboBox.Text = currentUnit.ToDescription(); unitComboBox.Text = currentUnit.ToDescription();
@@ -99,6 +103,8 @@ namespace TBF.UI.Bench.Metrology
lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [{1}]", Strings.Temperature, unit.ToDescription()), Width = 120 }); lv.Columns.Add(new ColumnHeader() { Text = string.Format("{0} [{1}]", Strings.Temperature, 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} [{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.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()); measuredLabel.Text = string.Format("{0} [{1}]:", Strings.Measured, unit.ToDescription());
correctedLabel.Text = string.Format("{0} [{1}]:", Strings.Corrected, unit.ToDescription()); correctedLabel.Text = string.Format("{0} [{1}]:", Strings.Corrected, unit.ToDescription());
@@ -144,6 +150,8 @@ namespace TBF.UI.Bench.Metrology
double error = Formulas.ErrorFromVolumes(corr.Measurement, trueValue); double error = Formulas.ErrorFromVolumes(corr.Measurement, trueValue);
lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits)); lvi.SubItems.Add(Common.Utils.ToNiceString(error, SignifDigits));
} }
lvi.SubItems.Add(corr.Uncertainty.ToString());
lvi.SubItems.Add(corr.Readability.ToString());
listViewEx.Items.Add(lvi); listViewEx.Items.Add(lvi);
} }
@@ -161,6 +169,14 @@ namespace TBF.UI.Bench.Metrology
else if (unlocked && e.SubItem == 3) else if (unlocked && e.SubItem == 3)
{ {
listViewEx.StartEditing(correctionTextBox, e.Item, e.SubItem); 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);
} }
} }
@@ -184,6 +200,8 @@ namespace TBF.UI.Bench.Metrology
double difference; /// Correction in selected unit double difference; /// Correction in selected unit
double correction; /// Correction in default unit double correction; /// Correction in default unit
double error = 0; double error = 0;
double uncertainty;
double readability;
if (subItem == 1 && Utils.TryParseEDouble(strValue, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) >= 0) if (subItem == 1 && Utils.TryParseEDouble(strValue, out oriMeasurement) && (measurement = Units.ConvertFrom(currentUnit, oriMeasurement)) >= 0)
{ {
@@ -251,6 +269,34 @@ namespace TBF.UI.Bench.Metrology
return true; return true;
} }
else if (subItem == 4 && Utils.TryParseEDouble(strValue, out uncertainty))
{
(item.Tag as MeasurementCorrection).Uncertainty = uncertainty;
if (strValue == Strings.NaN)
{
}
else
{
item.SubItems[4].Text = Common.Utils.ToNiceString(uncertainty, SignifDigits);
}
return true;
}
else if (subItem == 5 && Utils.TryParseEDouble(strValue, out readability))
{
(item.Tag as MeasurementCorrection).Readability = readability;
if (strValue == Strings.NaN)
{
}
else
{
item.SubItems[5].Text = Common.Utils.ToNiceString(readability, SignifDigits);
}
return true;
}
else else
{ {
return false; return false;
+12
View File
@@ -0,0 +1,12 @@
namespace TBF.UI.ResultsMI
{
public interface IPreviousResultDlg
{
void OnShowResults(object sender, PreviousResultIdEventArgs data);
void OnPrint(object sender, PreviousResultIdEventArgs data);
void OnSendAgain(object sender, PreviousResultIdEventArgs data);
void OnReload(object sender, PreviousResultIdEventArgs data);
string getSendReloadButtonText();
}
}
+3 -3
View File
@@ -11,7 +11,7 @@ namespace TBF.UI.ResultsMI
{ {
public partial class PreviousResultCtrl : UserControl public partial class PreviousResultCtrl : UserControl
{ {
readonly PreviousResultsDlg parent; readonly IPreviousResultDlg parent;
readonly PreviousResultsMode mode; readonly PreviousResultsMode mode;
readonly bool sendBtnIsPrint; readonly bool sendBtnIsPrint;
@@ -31,7 +31,7 @@ namespace TBF.UI.ResultsMI
InitializeComponent(); InitializeComponent();
} }
public PreviousResultCtrl(PreviousResultsDlg parent, int bnr, DateTime s, DateTime e, public PreviousResultCtrl(IPreviousResultDlg parent, int bnr, DateTime s, DateTime e,
string ver, string proc, string pOrd, int passCnt, int failCnt, string ver, string proc, string pOrd, int passCnt, int failCnt,
bool sent, PreviousResultsMode mode, IList<string> serialNrs = null) bool sent, PreviousResultsMode mode, IList<string> serialNrs = null)
: this() : this()
@@ -75,7 +75,7 @@ namespace TBF.UI.ResultsMI
sendReloadButton.Text = Strings.Save_again; sendReloadButton.Text = Strings.Save_again;
#else #else
sendReloadButton.Enabled = true; /// 'Print' function always available sendReloadButton.Enabled = true; /// 'Print' function always available
sendReloadButton.Text = Strings.Print; sendReloadButton.Text = parent.getSendReloadButtonText();
sendBtnIsPrint = true; sendBtnIsPrint = true;
#endif #endif
break; break;
+7 -9
View File
@@ -22,14 +22,7 @@ using TBF.Rig.Sequences;
namespace TBF.UI.ResultsMI namespace TBF.UI.ResultsMI
{ {
public enum PreviousResultsMode public partial class PreviousResultsDlg : Form, IPreviousResultDlg
{
Show,
Reload,
Fix,
}
public partial class PreviousResultsDlg : Form
{ {
static readonly ILog log = LogManager.GetLogger(typeof(PreviousResultsDlg)); static readonly ILog log = LogManager.GetLogger(typeof(PreviousResultsDlg));
@@ -195,8 +188,13 @@ namespace TBF.UI.ResultsMI
Close(); Close();
} }
public string getSendReloadButtonText()
{
return Strings.Print;
}
public void OnReloadAndFix(object sender, PreviousResultIdEventArgs data)
public void OnReloadAndFix(object sender, PreviousResultIdEventArgs data)
{ {
foreach (var batch in batches) foreach (var batch in batches)
{ {
@@ -0,0 +1,965 @@
///
/// Copyright (c) 2016-2021 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using ClosedXML.Excel;
using log4net;
using NHibernate;
#if MANAGED
using Oracle.ManagedDataAccess.Client;
#else
using Oracle.DataAccess.Client;
#endif
using Common;
using Config.Entities;
using Results;
using Results.Entities;
using Results.Uncertainty;
using Results.Uncertainty.CommonTable;
using TBF.Rig;
using TBF.Rig.Generic;
using TBF.Rig.GenericDevices;
using TBF.Rig.Keithley.TempMeter;
using TBF.Rig.Output.DB.SensusOracle;
using TBF.Rig.Sequences;
using Strings = TBF.Resources.Strings;
namespace TBF.UI.ResultsMI
{
public partial class PreviousResultsDlgUncertainty : Form, IPreviousResultDlg
{
static readonly ILog log = LogManager.GetLogger(typeof(PreviousResultsDlgUncertainty));
ISession session;
ISession sessionDBConfig;
private static IList<Component> cmpntEntities;
int currentBatchNr;
IList<Batch> batches;
/// A list of batches selected from all batches using criteria entered in UI
IList<string> serialNrs;
/// Display only watermeters with these serial numbers (null = display all)
int lastDisplayedIx;
/// Index of the last displayed batch from the list 'batches'
const int LinesCount = 25;
/// Number of batches displayed on one screen
PreviousResultsMode mode;
public PreviousResultsDlgUncertainty(PreviousResultsMode mode)
{
InitializeComponent();
this.mode = mode;
currentBatchNr = Program.LocalSettings.BatchNr;
PrintHandler += delegate(object sndr, PreviousResultIdEventArgs args)
{
if (InvokeRequired)
{
Invoke(new EventHandler<PreviousResultIdEventArgs>(DoAddListUncertainty), sndr, args);
}
else DoAddListUncertainty(sndr, args);
};
SendAgainHandler += delegate(object sndr, PreviousResultIdEventArgs args)
{
if (InvokeRequired)
{
Invoke(new EventHandler<PreviousResultIdEventArgs>(DoSendAgain), sndr, args);
}
else DoSendAgain(sndr, args);
};
ShowResultsHandler += delegate(object sndr, PreviousResultIdEventArgs args)
{
if (InvokeRequired)
{
Invoke(new EventHandler<PreviousResultIdEventArgs>(DoShowResults), sndr, args);
}
else DoShowResults(sndr, args);
};
}
public PreviousResultsDlgUncertainty()
: this(PreviousResultsMode.Show)
{
}
private void PreviousResultsDlgUncertainty_Load(object sender, EventArgs e)
{
Localize();
fromDateTimePicker.MinDate = Constants.MinDate;
fromDateTimePicker.MaxDate = DateTime.Today;
fromDateTimePicker.Value = Constants.MinDate;
fromDateTimePicker.CustomFormat = Constants.DateFormat;
fromDateTimePicker.ShowUpDown = true;
toDateTimePicker.MinDate = Constants.MinDate;
toDateTimePicker.MaxDate = DateTime.Today;
toDateTimePicker.Value = DateTime.Today;
toDateTimePicker.CustomFormat = Constants.DateFormat;
toDateTimePicker.ShowUpDown = true;
try
{
session = Results.DB.CreateSession();
}
catch (Exception exc)
{
session = null;
log.ErrorFormat("Opening Results DB failed: {0}", exc.Message);
}
batches = GetFilteredBatches(out lastDisplayedIx, out serialNrs);
UpdateButtons();
Redraw();
}
void Localize()
{
Text = Strings.Previous_results;
closeButton.Text = TBF.Resources.Strings.CloseBtnText;
previousButton.Text = TBF.Resources.Strings.Previous;
nextButton.Text = TBF.Resources.Strings.Next;
fromLabel.Text = Strings.from;
toLabel.Text = Strings.to;
procedureLabel.Text = Strings.Procedure;
listView1.Columns[0].Text = Strings.Nr;
listView1.Columns[1].Text = Strings.Name;
}
/// <summary>
/// Returns a list of batches selected using criteria entered in UI
/// </summary>
/// <returns>List of batches</returns>
IList<Batch> GetFilteredBatches(out int lastIx, out IList<string> serialNrs)
{
IList<Batch> rslt;
try
{
if (string.IsNullOrEmpty(procedureTextBox.Text) && string.IsNullOrEmpty(snTextBox.Text))
{
rslt = session.QueryOver<Batch>()
.Where(x => (x.StartTime >= fromDateTimePicker.Value))
.And(x => (x.StartTime < toDateTimePicker.Value.AddDays(1)))
.OrderBy(x => x.BatchNr).Asc
.List();
}
else if (string.IsNullOrEmpty(snTextBox.Text))
{
rslt = session.QueryOver<Batch>()
.Where(x => (x.StartTime >= fromDateTimePicker.Value))
.And(x => (x.StartTime < toDateTimePicker.Value.AddDays(1)))
.And(x => (x.ProcedureName == procedureTextBox.Text))
.OrderBy(x => x.BatchNr).Asc
.List();
}
else if (string.IsNullOrEmpty(procedureTextBox.Text))
{
rslt = session.QueryOver<Batch>()
.Where(x => (x.StartTime >= fromDateTimePicker.Value))
.And(x => (x.StartTime < toDateTimePicker.Value.AddDays(1)))
.OrderBy(x => x.BatchNr).Asc
.JoinQueryOver<WaterMeter>(b => b.WaterMeters)
.Where(wm => (wm.SerialNr == snTextBox.Text))
.List<Batch>();
}
else
{
rslt = session.QueryOver<Batch>()
.Where(x => (x.StartTime >= fromDateTimePicker.Value))
.And(x => (x.StartTime < toDateTimePicker.Value.AddDays(1)))
.And(x => (x.ProcedureName == procedureTextBox.Text))
.OrderBy(x => x.BatchNr).Asc
.JoinQueryOver<WaterMeter>(b => b.WaterMeters)
.Where(wm => (wm.SerialNr == snTextBox.Text))
.List<Batch>();
}
}
catch (Exception exc)
{
rslt = new List<Batch>();
log.ErrorFormat("Reading batches from Results DB failed: {0}", exc.Message);
}
serialNrs = string.IsNullOrEmpty(snTextBox.Text) ? null : new List<string> { snTextBox.Text };
lastIx = rslt.Count - 1;
return rslt;
}
public void OnReload(object sender, PreviousResultIdEventArgs data)
{
foreach (var batch in batches)
{
if (batch.BatchNr == data.BatchNr)
{
TBF.UiBridge.Bridge.BatchNr = batch.BatchNr;
Program.MainWnd.ReloadProcedureComboBoxItems(batch.ProcedureName);
TBF.UiBridge.Bridge.Ui2Bench(TBF.UiBridge.UI2BenchCmd.ReloadBatch);
break;
}
}
DialogResult = DialogResult.Cancel;
Close();
}
public string getSendReloadButtonText()
{
return Strings.Add;
}
public void OnReloadAndFix(object sender, PreviousResultIdEventArgs data)
{
foreach (var batch in batches)
{
if (batch.BatchNr == data.BatchNr)
{
TBF.UiBridge.Bridge.BatchNr = batch.BatchNr;
Program.MainWnd.ReloadProcedureComboBoxItems(batch.ProcedureName);
TBF.UiBridge.Bridge.Ui2Bench(TBF.UiBridge.UI2BenchCmd.ReloadAndFixBatch);
break;
}
}
DialogResult = DialogResult.Cancel;
Close();
}
public event EventHandler<PreviousResultIdEventArgs> PrintHandler;
/// <summary>
/// Called from PreviousResultCtrl when 'Print' button pressed.
/// </summary>
public void OnPrint(object sender, PreviousResultIdEventArgs data)
{
if (PrintHandler == null) return;
try
{
PrintHandler(sender, data);
}
catch (Exception e)
{
log.Error("PrintHandler(...) failed", e);
}
}
public void DoAddListUncertainty(object sender, PreviousResultIdEventArgs data)
{
foreach (var b in batches)
{
if (b.BatchNr == data.BatchNr)
{
ListViewItem item1 = new ListViewItem(data.BatchNr.ToString());
item1.SubItems.Add(b.ProcedureName);
listView1.Items.Add(item1);
break;
}
}
}
public event EventHandler<PreviousResultIdEventArgs> SendAgainHandler;
/// <summary>
/// Called from PreviousResultCtrl when 'Send again' button pressed.
/// </summary>
public void OnSendAgain(object sender, PreviousResultIdEventArgs data)
{
if (SendAgainHandler == null) return;
try
{
SendAgainHandler(sender, data);
}
catch (Exception e)
{
log.Error("SendAgainHandler(...) failed", e);
}
}
public void DoSendAgain(object sender, PreviousResultIdEventArgs data)
{
foreach (var b in batches)
{
if (b.BatchNr == data.BatchNr)
{
#if ORACLE_DB
if (ProcessData.OracleDB == null)
{
MessageBox.Show("No database");
return;
}
var dlg = new SendAgainDBAndWMSelectionForm();
if (dlg.ShowDialog() != DialogResult.OK) return;
OracleConnection conn;
switch (dlg.SelectedDB)
{
default:
case DBUsed.Production: conn = ProcessData.OracleDB.ProductionDB; break;
case DBUsed.Quality: conn = ProcessData.OracleDB.QualityDB; break;
case DBUsed.Test: conn = ProcessData.OracleDB.TestDB; break;
}
if (ProcessData.OracleDB.WriteResultsToDB(conn, b, dlg.SelectedWM, true) == Retv.OK)
{
b.RsltsSent = true; /// Result was successfully sent
session.SaveOrUpdate(b); /// Update MySQL DB
session.Flush();
(sender as PreviousResultCtrl).Sent = true; /// Update UI
Redraw();
}
#endif
}
}
}
public event EventHandler<PreviousResultIdEventArgs> ShowResultsHandler;
/// <summary>
/// Called from PreviousResultCtrl when 'Show' button pressed.
/// </summary>
public void OnShowResults(object sender, PreviousResultIdEventArgs data)
{
if (ShowResultsHandler == null) return;
try
{
ShowResultsHandler(sender, data);
}
catch (Exception e)
{
log.Error("ShowResultsHandler(...) failed", e);
}
}
public void DoShowResults(object sender, PreviousResultIdEventArgs data)
{
foreach (var b in batches)
{
if (b.BatchNr == data.BatchNr)
{
if (b.WaterMeters == null || b.WaterMeters.Count == 0)
{
return; /// No water meters in the selected batch
}
/// Prepare result items
IList<WMeterRsltItemSpec> items = null;
foreach (var wm in b.WaterMeters)
{
if (!wm.Disabled && wm.WaterMeterData != null)
{
if (wm.WaterMeterData.Compound)
{
items = WMeterRsltItemSpec.FromStrArray(Program.LocalSettings
.RsltItems_Screen_CombinedWM);
}
else if (wm.WaterMeterData.HeatMeter)
{
items = WMeterRsltItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_HeatM);
}
else
{
items = WMeterRsltItemSpec.FromStrArray(Program.LocalSettings
.RsltItems_Screen_SingleWM);
}
break;
}
}
if (items == null) items = new List<WMeterRsltItemSpec>();
/// Show dialog with results
Results.Forms.BatchResultsDlg dlg = new Results.Forms.BatchResultsDlg
{
Text = string.Format(Strings.Results_of_batch_0, b.BatchNr),
Results = BatchResults.FromBatch(b),
Items = items,
PopupResultsLeft = Program.LocalSettings.PopupResultsLeft,
PopupResultsTop = Program.LocalSettings.PopupResultsTop,
PopupResultsWidth = Program.LocalSettings.PopupResultsWidth,
PopupResultsHeight = Program.LocalSettings.PopupResultsHeight,
MetersArrangement = Program.LocalSettings.ResultsConfigMeters,
TestsArrangement = Program.LocalSettings.ResultsConfigTests,
NrMetersInOneGroup = Math.Max(1, Program.LocalSettings.ResultsConfigMetersInOneGroup),
ShowDisabledPositions = Program.LocalSettings.ShowDisabledPositions,
MinWidth = Program.LocalSettings.ResultsConfigMinWidth,
MinHeight = Program.LocalSettings.ResultsConfigMinHeight,
RsltsClmnWidths = Program.LocalSettings.RsltsClmnWidths,
SerialNrs = data.SerialNrs,
};
dlg.Show();
break;
}
}
}
/// <summary>
/// Redraws list of batches.
/// Uses member variables 'batches' and 'lastDisplayedIx'
/// </summary>
void Redraw()
{
SuspendLayout();
flowLayoutPanel1.FlowDirection = FlowDirection.TopDown;
flowLayoutPanel1.Controls.Clear();
if (batches == null || batches.Count == 0) return;
for (int i = Math.Max(0, lastDisplayedIx - LinesCount + 1); i <= lastDisplayedIx; i++)
{
var b = batches[i];
int passedCount = 0;
int failedCount = 0;
foreach (var wm in b.WaterMeters)
{
if ((wm != null) && wm.Passed)
{
passedCount++;
}
else
{
failedCount++;
}
}
if (passedCount + failedCount == 0) continue;
flowLayoutPanel1.Controls.Add(new PreviousResultCtrl(this,
b.BatchNr,
b.StartTime,
b.EndTime,
b.ProgramVersion,
b.ProcedureName,
b.WaterMeters[0].PurchaseOrder,
passedCount,
failedCount,
b.RsltsSent,
mode,
serialNrs));
}
ResumeLayout();
}
private void closeButton_Click(object sender, EventArgs e)
{
if (session != null) session.Close();
DialogResult = DialogResult.Cancel;
Close();
}
private void previousButton_Click(object sender, EventArgs e)
{
lastDisplayedIx = Math.Max(lastDisplayedIx - LinesCount, LinesCount - 1);
Redraw();
UpdateButtons();
}
private void nextButton_Click(object sender, EventArgs e)
{
lastDisplayedIx = Math.Min(lastDisplayedIx + LinesCount, batches.Count - 1);
Redraw();
UpdateButtons();
}
private void UpdateButtons()
{
nextButton.Enabled = (lastDisplayedIx < batches.Count - 1);
previousButton.Enabled = (lastDisplayedIx > LinesCount - 1);
}
private void reloadButton_Click(object sender, EventArgs e)
{
batches = GetFilteredBatches(out lastDisplayedIx, out serialNrs);
UpdateButtons();
Redraw();
}
private void PreviousResultsDlgUncertainty_FormClosing(object sender, FormClosingEventArgs e)
{
if (CurrentUser.Restore(this)) Program.MainWnd.UpdateUser();
}
public class Pair
{
int offsetRows;
public int OffsetRows
{
get => offsetRows;
set => offsetRows = value;
}
public int OffsetColumns
{
get => offsetColumns;
set => offsetColumns = value;
}
int offsetColumns;
public Pair(int offsetRows, int offsetColumns)
{
this.offsetRows = offsetRows;
this.offsetColumns = offsetColumns;
}
}
Pair GetTableCC_WT_Offsets(int iTable)
{
switch (iTable)
{
case 0: return new Pair(0, 0);
case 1: return new Pair(20, 0);
case 2: return new Pair(40, 0);
case 3: return new Pair(56, 0);
default: return new Pair(0, 0);
}
}
Pair GetTableCC_Tempers_Offsets(int iTable)
{
switch (iTable)
{
case 0: return new Pair(56, 0);
case 1: return new Pair(76, 0);
case 2: return new Pair(96, 0);
case 3: return new Pair(116, 0);
case 4: return new Pair(206, 0);
case 5: return new Pair(226, 0);
case 6: return new Pair(246, 0);
case 7: return new Pair(266, 0);
case 8: return new Pair(286, 0);
default: return new Pair(56, 0);
}
}
Pair GetTableCC_Press_Offsets(int iTable)
{
switch (iTable)
{
case 0: return new Pair(326, 0);
case 1: return new Pair(346, 0);
case 2: return new Pair(366, 0);
default: return new Pair(326, 0);
}
}
Pair GetTableCC_Diverter_Offsets(int iTable)
{
switch (iTable)
{
case 0: return new Pair(146, 0);
case 1: return new Pair(158, 0);
case 2: return new Pair(170, 0);
case 3: return new Pair(182, 0);
case 4: return new Pair(194, 0);
default: return new Pair(146, 0);
}
}
private void uncertainty_button_Click(object sender, EventArgs data)
{
//get list
if (listView1.Items.Count < 1)
{
MessageBox.Show("No selected results to calculate uncertainty!");
return;
}
IList<Batch> selectedBatches = new List<Batch>();
foreach (ListViewItem item in listView1.Items)
{
int iBatch = Int32.Parse(item.Text);
foreach (Batch b in batches)
{
if (b.BatchNr == iBatch)
{
selectedBatches.Add(b);
break;
}
}
}
if (selectedBatches.Count == 0)
{
MessageBox.Show("Selected results no fit with results to calculate uncertainty!");
return;
}
RigUncertainty rigUncertainty = null;
try
{
string pathToTemplateExcel = Path.Combine("C:\\Users\\micha\\Downloads", "Uncertainty_template.xlsx");
string pathToTestExcel = Path.Combine("C:\\Users\\micha\\Downloads", "Uncertainty_generated.xlsx");
CopyTemplate(pathToTemplateExcel, pathToTestExcel);
rigUncertainty = new RigUncertainty(pathToTestExcel);
rigUncertainty.OpenDocument();
if (!rigUncertainty.IsOpenedDocument)
{
throw new Exception("Problem with open document!");
}
//Insert Data to worksheet Excel
int iBlock = 0;
foreach (Batch b in selectedBatches)
{
int iRow = 0;
int iStart = CommonExcell.GetBolocs()[iBlock];
//calculate
foreach (TestRslt testRslt in b.TestRslts)
{
if (!testRslt.TestDone)
{
continue;
}
ProcessDataLine processDataLine = new ProcessDataLine();
processDataLine.Init(testRslt);
CommonExcell.InsertValueLineProcessData(rigUncertainty, iStart + iRow, processDataLine);
iRow++;
if (iRow > 16) // Max count
{
break;
}
}
iBlock++;
}
//Insert Metrology Data to worksheet Excel
//Get r.Batch => s.BatchPaths
sessionDBConfig = TBF.DB.CreateSession(DBKind.Config);
cmpntEntities = sessionDBConfig.QueryOver<Component>()
.OrderBy(x => x.ItemNr).Asc
.List();
IList<Table> tables = new List<Table>();
int iTable_WT = 0;
int tempMetersCount = 0;
int divertersCount = 0;
foreach (var cmpnt in cmpntEntities)
{
Rig.Generic.IComponentFactory factory = TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName);
/// Tab-pages for scales
if (factory is Rig.Scales.MettlerToledo.Factory ||
factory is Rig.MettlerToledo.Standard.BalanceFactory ||
factory is Rig.MettlerToledo.Standard.BalanceOldFactory ||
factory is Rig.MettlerToledo.Standard.BalanceNewFactory)
{
IScaleCfg BalanceCfg =
factory.CmpntCfgFromCmpntEntity(cmpnt) as IScaleCfg;
Pair pair = GetTableCC_WT_Offsets(iTable_WT);
tables.Add(InsertMetrologyDataWT(BalanceCfg,pair));
iTable_WT++;
}
/// Tab-pages for temperature meters
else if (factory is Rig.Modbus.TempMeter.Groch.Factory ||
factory is Rig.Modbus.TempMeter.Meret.Factory ||
factory is Rig.Keithley.TempMeter.Factory)
{
ICalibInfoCfg calibInfoCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as ICalibInfoCfg;
Pair pair = GetTableCC_Tempers_Offsets(tempMetersCount);
tables.Add(InsertMetrologyDataTemper(calibInfoCfg,pair));
tempMetersCount++;
}
/// Tab-pages for diverters
else if (factory is Rig.Uni.Diverter.Factory)
{
ICalibInfoCfg calibInfoCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as Rig.GenericDevices.ICalibInfoCfg;
Pair pair = GetTableCC_Diverter_Offsets(divertersCount);
tables.Add(InsertMetrologyDataDiverter(calibInfoCfg,pair));
divertersCount++;
}
}
IXLWorksheet worksheet = rigUncertainty.GetWorksheet(DocumentSheets.CC);
foreach (Table table in tables)
{
table.ToWorksheetWithOffset(worksheet, table.IOffsetRows, table.IOffsetColumns,false);
}
sessionDBConfig.Close();
}
catch (Exception e)
{
MessageBox.Show("Proble in process calculate uncertainty! Detail: " + e.Message);
return;
}
finally
{
if (rigUncertainty != null)
{
rigUncertainty.SaveChangesToDocument();
rigUncertainty.CloaseDocument();
MessageBox.Show("Uncertainty document generated!");
}
}
}
private void CopyTemplate(string pathToTemplateExcel, string pathToTestExcel)
{
try
{
File.Copy(pathToTemplateExcel, pathToTestExcel, true);
log.Info("Template File copied.");
}
catch (IOException ex)
{
log.Error("IO error: " + ex.Message);
}
catch (UnauthorizedAccessException ex)
{
log.Error("Access denied: " + ex.Message);
}
}
private void uncertainty_clear_button_Click(object sender, EventArgs e)
{
listView1.Items.Clear();
}
/// <summary>
/// Inserts metrology 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 the associated document.</param>
/// <param name="balanceCfg"></param>
/// <param name="iRowI">The row index in the Excel worksheet where the data will be inserted.</param>
/// <param name="processDataLine">An instance of the <see cref="ProcessDataLine"/> class containing the metrology data to be inserted.</param>
public static Results.Uncertainty.CommonTable.Table InsertMetrologyDataWT(IScaleCfg balanceCfg, Pair offsetPair)
{
//Define Scale meters 3x
var table = new Results.Uncertainty.CommonTable.Table();
table.IOffsetRows = offsetPair.OffsetRows;
table.IOffsetColumns = offsetPair.OffsetColumns;
string Column = "A";
table.AddColumn(Column);
for (int i = 0; i < 12; i++) //generate B - M Columns
{
Column = CommonExcell.NextColumn(Column);
table.AddColumn(Column);
}
for (int i = 0; i < 14; i++) //generate 14 rows
{
table.AddRow((i + 1).ToString());
}
//Set cell values
table.AddCell(1, "B", "C"); // Uncertainty type
table.AddCell(1, "D", balanceCfg.MeterType); //"ISNJ"); //Type
table.AddCell(1, "F", balanceCfg.MeterSerialNo); //Serial Nr
table.AddCell(1, "J", 3000); //balanceCfg.); //J - range [kg]
//Set cell values
table.AddCell(2, "B", balanceCfg.Name); // Scale Name
table.AddCell(2, "D", balanceCfg.CalibCertificateNr); //Cal. Cert
table.AddCell(2, "F", balanceCfg.CalibCertificateNr); //Nr
table.AddCell(2, "I", balanceCfg.BuoyancyTemp); //I - Amb.T
table.AddCell(2, "K", balanceCfg.BuoyancyHumi); //I - Amb.H
table.AddCell(2, "M", balanceCfg.BuoyancyPress); //I - Amb.P
//Set cell values
table.AddCell(3, "C", balanceCfg.CalibDate); // Date - datetime - format
//Load, Error, Readability, Uncertainty
//Set cell values
string columnName = "B";
foreach (var correction in balanceCfg.Corrections)
{
if (correction != null)
{
table.AddCell(4, columnName, correction.Measurement); // Load
double error = Formulas.ErrorFromVolumes(correction.Measurement,
correction.Measurement + correction.Correction);
table.AddCell(5, columnName, error); // ERROR
table.AddCell(7, columnName, correction.Readability); // Readability
table.AddCell(8, columnName, correction.Uncertainty); // Uncertainty
columnName = CommonExcell.NextColumn(columnName);
}
if (columnName == "L") // maximum column
{
break;
}
}
return table;
}
/// <summary>
/// Inserts metrology 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 the associated document.</param>
/// <param name="balanceCfg"></param>
/// <param name="iRowI">The row index in the Excel worksheet where the data will be inserted.</param>
/// <param name="processDataLine">An instance of the <see cref="ProcessDataLine"/> class containing the metrology data to be inserted.</param>
public static Results.Uncertainty.CommonTable.Table InsertMetrologyDataTemper(ICalibInfoCfg calibInfoCfg, Pair offsetPair)
{
//Define Temper meter table
var table = new Results.Uncertainty.CommonTable.Table();
table.IOffsetRows = offsetPair.OffsetRows;
table.IOffsetColumns = offsetPair.OffsetColumns;
string Column = "A";
table.AddColumn(Column);
for (int i = 0; i < 12; i++) //generate B - M Columns
{
Column = CommonExcell.NextColumn(Column);
table.AddColumn(Column);
}
for (int i = 0; i < 14; i++) //generate 14 rows
{
table.AddRow((i + 1).ToString());
}
//Set cell values
table.AddCell(1, "B", "N"); // Uncertainty type
table.AddCell(1, "D", calibInfoCfg.MeterType); //"ISNJ"); //Type
table.AddCell(1, "F", calibInfoCfg.MeterSerialNo); //Serial Nr
try
{
if (calibInfoCfg is TBF.Rig.Keithley.TempMeter.TempMeterCfg)
{
table.AddCell(1, "G", string.Format("Ch{0}",
(calibInfoCfg as TBF.Rig.Keithley.TempMeter.TempMeterCfg)
.Channel)); //J -chanel
}
else if (calibInfoCfg is TBF.Rig.Modbus.TempMeter.Groch.TempMeterCfg)
{
table.AddCell(1, "G", string.Format("Ch{0}",
(calibInfoCfg as TBF.Rig.Modbus.TempMeter.Groch.TempMeterCfg)
.Channel)); //J -chanel
}
else if (calibInfoCfg is TBF.Rig.Modbus.TempMeter.Meret.TempMeterCfg)
{
table.AddCell(1, "G", string.Format("Addr{0}",
(calibInfoCfg as TBF.Rig.Modbus.TempMeter.Meret.TempMeterCfg)
.ModbusAddress)); //balanceCfg.); //J -chanel
}
}
catch (Exception e)
{
log.Error("Chanel info failed! Detail: " + e.Message);
return null;
}
//Set cell values
table.AddCell(2, "A", calibInfoCfg.Name); // Scale Name
table.AddCell(2, "C", calibInfoCfg.CalibDate); // Date - datetime - format
table.AddCell(2, "F", calibInfoCfg.CalibCertificateNr); //Cal. Cert
//Load, Error, Readability, Uncertainty
//Set cell values
string columnName = "B";
foreach (var correction in calibInfoCfg.Corrections)
{
if (correction != null)
{
table.AddCell(4, columnName, correction.Measurement); // Load
double error = Formulas.ErrorFromVolumes(correction.Measurement,
correction.Measurement + correction.Correction);
table.AddCell(5, columnName, error); // ERROR
table.AddCell(7, columnName, correction.Readability); // Readability
table.AddCell(8, columnName, correction.Uncertainty); // Uncertainty
columnName = CommonExcell.NextColumn(columnName);
}
if (columnName == "L") // maximum column
{
break;
}
}
return table;
}
public static Results.Uncertainty.CommonTable.Table InsertMetrologyDataDiverter(ICalibInfoCfg calibInfoCfg, Pair offsetPair)
{
//Define Temper meter table
var table = new Results.Uncertainty.CommonTable.Table();
table.IOffsetRows = offsetPair.OffsetRows;
table.IOffsetColumns = offsetPair.OffsetColumns;
string Column = "A";
table.AddColumn(Column);
for (int i = 0; i < 6; i++) //generate B - F Columns
{
Column = CommonExcell.NextColumn(Column);
table.AddColumn(Column);
}
for (int i = 0; i < 2; i++) //generate 2 rows
{
table.AddRow((i + 1).ToString());
}
//Load, Error, Readability, Uncertainty
//Set cell values
string columnName = "B";
foreach (var correction in calibInfoCfg.Corrections)
{
if (correction != null)
{
table.AddCell(1, columnName, correction.Measurement); // Load
double error = Formulas.ErrorFromVolumes(correction.Measurement,
correction.Measurement + correction.Correction);
table.AddCell(2, columnName, error); // ERROR
//table.AddCell(7, columnName, correction.Readability); // Readability
//table.AddCell(8, columnName, correction.Uncertainty); // Uncertainty
columnName = CommonExcell.NextColumn(columnName);
}
if (columnName == "L") // maximum column
{
break;
}
}
return table;
}
}
}
+369
View File
@@ -0,0 +1,369 @@
using System.Windows.Forms;
namespace TBF.UI.ResultsMI
{
partial class PreviousResultsDlgUncertainty
{
/// <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.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.closeButton = new System.Windows.Forms.Button();
this.previousButton = new System.Windows.Forms.Button();
this.nextButton = new System.Windows.Forms.Button();
this.vertSplitContainer = new System.Windows.Forms.SplitContainer();
this.horizSplitContainer = new System.Windows.Forms.SplitContainer();
this.filterGroupBox = new System.Windows.Forms.GroupBox();
this.snLabel = new System.Windows.Forms.Label();
this.snTextBox = new System.Windows.Forms.TextBox();
this.reloadButton = new System.Windows.Forms.Button();
this.procedureTextBox = new System.Windows.Forms.TextBox();
this.procedureLabel = new System.Windows.Forms.Label();
this.toLabel = new System.Windows.Forms.Label();
this.fromLabel = new System.Windows.Forms.Label();
this.toDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.fromDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.uncertainty_button = new System.Windows.Forms.Button();
this.listView1 = new System.Windows.Forms.ListView();
this.columnHeaderNo = new System.Windows.Forms.ColumnHeader();
this.columnHeaderName = new System.Windows.Forms.ColumnHeader();
this.uncertainty_clear_button = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.vertSplitContainer)).BeginInit();
this.vertSplitContainer.Panel1.SuspendLayout();
this.vertSplitContainer.Panel2.SuspendLayout();
this.vertSplitContainer.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit();
this.horizSplitContainer.Panel1.SuspendLayout();
this.horizSplitContainer.Panel2.SuspendLayout();
this.horizSplitContainer.SuspendLayout();
this.filterGroupBox.SuspendLayout();
this.SuspendLayout();
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.AutoScroll = true;
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(1721, 1306);
this.flowLayoutPanel1.TabIndex = 0;
//
// closeButton
//
this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.closeButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.closeButton.Location = new System.Drawing.Point(-47, 38);
this.closeButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.closeButton.Name = "closeButton";
this.closeButton.Size = new System.Drawing.Size(154, 57);
this.closeButton.TabIndex = 1;
this.closeButton.Text = "Close";
this.closeButton.UseVisualStyleBackColor = true;
this.closeButton.Click += new System.EventHandler(this.closeButton_Click);
//
// previousButton
//
this.previousButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.previousButton.Location = new System.Drawing.Point(-47, 146);
this.previousButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.previousButton.Name = "previousButton";
this.previousButton.Size = new System.Drawing.Size(154, 57);
this.previousButton.TabIndex = 2;
this.previousButton.Text = "Previous";
this.previousButton.UseVisualStyleBackColor = true;
this.previousButton.Click += new System.EventHandler(this.previousButton_Click);
//
// nextButton
//
this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.nextButton.Location = new System.Drawing.Point(-47, 212);
this.nextButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.nextButton.Name = "nextButton";
this.nextButton.Size = new System.Drawing.Size(154, 57);
this.nextButton.TabIndex = 3;
this.nextButton.Text = "Next";
this.nextButton.UseVisualStyleBackColor = true;
this.nextButton.Click += new System.EventHandler(this.nextButton_Click);
//
// vertSplitContainer
//
this.vertSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.vertSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.vertSplitContainer.IsSplitterFixed = true;
this.vertSplitContainer.Location = new System.Drawing.Point(0, 0);
this.vertSplitContainer.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.vertSplitContainer.Name = "vertSplitContainer";
//
// vertSplitContainer.Panel1
//
this.vertSplitContainer.Panel1.Controls.Add(this.horizSplitContainer);
//
// vertSplitContainer.Panel2
//
this.vertSplitContainer.Panel2.Controls.Add(this.uncertainty_clear_button);
this.vertSplitContainer.Panel2.Controls.Add(this.uncertainty_button);
this.vertSplitContainer.Panel2.Controls.Add(this.listView1);
this.vertSplitContainer.Panel2.Controls.Add(this.closeButton);
this.vertSplitContainer.Panel2.Controls.Add(this.nextButton);
this.vertSplitContainer.Panel2.Controls.Add(this.previousButton);
this.vertSplitContainer.Size = new System.Drawing.Size(1873, 1372);
this.vertSplitContainer.SplitterDistance = 1721;
this.vertSplitContainer.SplitterWidth = 6;
this.vertSplitContainer.TabIndex = 4;
//
// horizSplitContainer
//
this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.horizSplitContainer.Location = new System.Drawing.Point(0, 0);
this.horizSplitContainer.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.horizSplitContainer.Name = "horizSplitContainer";
this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// horizSplitContainer.Panel1
//
this.horizSplitContainer.Panel1.Controls.Add(this.filterGroupBox);
//
// horizSplitContainer.Panel2
//
this.horizSplitContainer.Panel2.Controls.Add(this.flowLayoutPanel1);
this.horizSplitContainer.Size = new System.Drawing.Size(1721, 1372);
this.horizSplitContainer.SplitterDistance = 60;
this.horizSplitContainer.SplitterWidth = 6;
this.horizSplitContainer.TabIndex = 0;
//
// filterGroupBox
//
this.filterGroupBox.Controls.Add(this.snLabel);
this.filterGroupBox.Controls.Add(this.snTextBox);
this.filterGroupBox.Controls.Add(this.reloadButton);
this.filterGroupBox.Controls.Add(this.procedureTextBox);
this.filterGroupBox.Controls.Add(this.procedureLabel);
this.filterGroupBox.Controls.Add(this.toLabel);
this.filterGroupBox.Controls.Add(this.fromLabel);
this.filterGroupBox.Controls.Add(this.toDateTimePicker);
this.filterGroupBox.Controls.Add(this.fromDateTimePicker);
this.filterGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.filterGroupBox.Location = new System.Drawing.Point(0, 0);
this.filterGroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.filterGroupBox.Name = "filterGroupBox";
this.filterGroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.filterGroupBox.Size = new System.Drawing.Size(1721, 60);
this.filterGroupBox.TabIndex = 0;
this.filterGroupBox.TabStop = false;
this.filterGroupBox.Text = "Filter";
//
// snLabel
//
this.snLabel.AutoSize = true;
this.snLabel.Location = new System.Drawing.Point(404, 45);
this.snLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.snLabel.Name = "snLabel";
this.snLabel.Size = new System.Drawing.Size(30, 20);
this.snLabel.TabIndex = 24;
this.snLabel.Text = "s/n";
//
// snTextBox
//
this.snTextBox.Location = new System.Drawing.Point(442, 38);
this.snTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.snTextBox.Name = "snTextBox";
this.snTextBox.Size = new System.Drawing.Size(148, 26);
this.snTextBox.TabIndex = 23;
//
// reloadButton
//
this.reloadButton.Location = new System.Drawing.Point(1514, 35);
this.reloadButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.reloadButton.Name = "reloadButton";
this.reloadButton.Size = new System.Drawing.Size(56, 35);
this.reloadButton.TabIndex = 0;
this.reloadButton.Text = "@";
this.reloadButton.UseVisualStyleBackColor = true;
this.reloadButton.Click += new System.EventHandler(this.reloadButton_Click);
//
// procedureTextBox
//
this.procedureTextBox.Location = new System.Drawing.Point(708, 38);
this.procedureTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.procedureTextBox.Name = "procedureTextBox";
this.procedureTextBox.Size = new System.Drawing.Size(782, 26);
this.procedureTextBox.TabIndex = 22;
//
// procedureLabel
//
this.procedureLabel.AutoSize = true;
this.procedureLabel.Location = new System.Drawing.Point(618, 46);
this.procedureLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.procedureLabel.Name = "procedureLabel";
this.procedureLabel.Size = new System.Drawing.Size(82, 20);
this.procedureLabel.TabIndex = 21;
this.procedureLabel.Text = "Procedure";
//
// toLabel
//
this.toLabel.AutoSize = true;
this.toLabel.Location = new System.Drawing.Point(226, 48);
this.toLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.toLabel.Name = "toLabel";
this.toLabel.Size = new System.Drawing.Size(23, 20);
this.toLabel.TabIndex = 20;
this.toLabel.Text = "to";
//
// fromLabel
//
this.fromLabel.AutoSize = true;
this.fromLabel.Location = new System.Drawing.Point(24, 48);
this.fromLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.fromLabel.Name = "fromLabel";
this.fromLabel.Size = new System.Drawing.Size(41, 20);
this.fromLabel.TabIndex = 19;
this.fromLabel.Text = "from";
//
// toDateTimePicker
//
this.toDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.toDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.toDateTimePicker.Location = new System.Drawing.Point(261, 38);
this.toDateTimePicker.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.toDateTimePicker.Name = "toDateTimePicker";
this.toDateTimePicker.Size = new System.Drawing.Size(121, 26);
this.toDateTimePicker.TabIndex = 18;
//
// fromDateTimePicker
//
this.fromDateTimePicker.CustomFormat = "dd.MM.yyyy";
this.fromDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.fromDateTimePicker.Location = new System.Drawing.Point(80, 38);
this.fromDateTimePicker.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.fromDateTimePicker.Name = "fromDateTimePicker";
this.fromDateTimePicker.Size = new System.Drawing.Size(121, 26);
this.fromDateTimePicker.TabIndex = 17;
//
// uncertainty_button
//
this.uncertainty_button.Location = new System.Drawing.Point(4, 461);
this.uncertainty_button.Name = "uncertainty_button";
this.uncertainty_button.Size = new System.Drawing.Size(116, 49);
this.uncertainty_button.TabIndex = 5;
this.uncertainty_button.Text = "Calculate";
this.uncertainty_button.UseVisualStyleBackColor = true;
this.uncertainty_button.Click += new System.EventHandler(this.uncertainty_button_Click);
//
// listView1
//
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeaderNo, this.columnHeaderName });
this.listView1.FullRowSelect = true;
this.listView1.GridLines = true;
this.listView1.HideSelection = false;
this.listView1.Location = new System.Drawing.Point(4, 314);
this.listView1.Name = "listView1";
this.listView1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.listView1.Size = new System.Drawing.Size(116, 141);
this.listView1.TabIndex = 4;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
//
// columnHeaderNo
//
this.columnHeaderNo.Text = "No";
this.columnHeaderNo.Width = 47;
//
// columnHeaderName
//
this.columnHeaderName.Text = "Name";
this.columnHeaderName.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.columnHeaderName.Width = 71;
//
// uncertainty_clear_button
//
this.uncertainty_clear_button.Location = new System.Drawing.Point(4, 516);
this.uncertainty_clear_button.Name = "uncertainty_clear_button";
this.uncertainty_clear_button.Size = new System.Drawing.Size(116, 52);
this.uncertainty_clear_button.TabIndex = 6;
this.uncertainty_clear_button.Text = "Clear";
this.uncertainty_clear_button.UseVisualStyleBackColor = true;
this.uncertainty_clear_button.Click += new System.EventHandler(this.uncertainty_clear_button_Click);
//
// PreviousResultsDlgUncertainty
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.closeButton;
this.ClientSize = new System.Drawing.Size(1873, 1372);
this.Controls.Add(this.vertSplitContainer);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.MaximizeBox = false;
this.Name = "PreviousResultsDlgUncertainty";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Previous results";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.PreviousResultsDlgUncertainty_FormClosing);
this.Load += new System.EventHandler(this.PreviousResultsDlgUncertainty_Load);
this.vertSplitContainer.Panel1.ResumeLayout(false);
this.vertSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.vertSplitContainer)).EndInit();
this.vertSplitContainer.ResumeLayout(false);
this.horizSplitContainer.Panel1.ResumeLayout(false);
this.horizSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit();
this.horizSplitContainer.ResumeLayout(false);
this.filterGroupBox.ResumeLayout(false);
this.filterGroupBox.PerformLayout();
this.ResumeLayout(false);
}
private System.Windows.Forms.Button uncertainty_clear_button;
private System.Windows.Forms.Button uncertainty_button;
private System.Windows.Forms.ColumnHeader columnHeaderNo;
private System.Windows.Forms.ColumnHeader columnHeaderName;
private System.Windows.Forms.ListView listView1;
#endregion
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.Button closeButton;
private System.Windows.Forms.Button previousButton;
private System.Windows.Forms.Button nextButton;
private System.Windows.Forms.SplitContainer vertSplitContainer;
private System.Windows.Forms.SplitContainer horizSplitContainer;
private System.Windows.Forms.GroupBox filterGroupBox;
private System.Windows.Forms.Label toLabel;
private System.Windows.Forms.Label fromLabel;
private System.Windows.Forms.DateTimePicker toDateTimePicker;
private System.Windows.Forms.DateTimePicker fromDateTimePicker;
private System.Windows.Forms.Label procedureLabel;
private System.Windows.Forms.TextBox procedureTextBox;
private System.Windows.Forms.Button reloadButton;
private System.Windows.Forms.Label snLabel;
private System.Windows.Forms.TextBox snTextBox;
}
}
@@ -0,0 +1,125 @@
<?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>
+9
View File
@@ -0,0 +1,9 @@
namespace TBF.UI.ResultsMI
{
public enum PreviousResultsMode
{
Show,
Reload,
Fix,
}
}
+2 -1
View File
@@ -313,7 +313,8 @@ namespace TBF.UI.ResultsMI
/// ///
private void showPreviousResultsButton_Click(object sender, EventArgs e) private void showPreviousResultsButton_Click(object sender, EventArgs e)
{ {
new PreviousResultsDlg().ShowDialog(); //TODO BUMI return back - PreviousResultsDlgUncertainty => PreviousResultsDlg add list for Uncertainty
new PreviousResultsDlgUncertainty().ShowDialog();
} }
private void reloadPreviousResultsButton_Click(object sender, EventArgs e) private void reloadPreviousResultsButton_Click(object sender, EventArgs e)
{ {
+24 -10
View File
@@ -1,32 +1,46 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<section name="oracle.manageddataaccess.client" <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
</configSections> </configSections>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup> </startup>
<system.data> <system.data>
<DbProviderFactories> <DbProviderFactories>
<remove invariant="Oracle.ManagedDataAccess.Client"/> <remove invariant="Oracle.ManagedDataAccess.Client" />
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
</DbProviderFactories> </DbProviderFactories>
</system.data> </system.data>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<publisherPolicy apply="no"/> <publisherPolicy apply="no" />
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/> <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
<bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.19.1"/> <bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.19.1" />
</dependentAssembly>
<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> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<oracle.manageddataaccess.client> <oracle.manageddataaccess.client>
<version number="*"> <version number="*">
<dataSources> <dataSources>
<dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) "/> <dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
</dataSources> </dataSources>
</version> </version>
</oracle.manageddataaccess.client> </oracle.manageddataaccess.client>
+12 -1
View File
@@ -1,14 +1,25 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Castle.Core" version="5.1.1" targetFramework="net472" /> <package id="Castle.Core" version="5.1.1" targetFramework="net472" />
<package id="ClosedXML" version="0.105.0-rc" targetFramework="net472" />
<package id="ClosedXML.Parser" version="2.0.0-preview1" 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="ExcelNumberFormat" version="1.1.0" targetFramework="net472" />
<package id="FluentNHibernate" version="2.0.3.0" targetFramework="net40" /> <package id="FluentNHibernate" version="2.0.3.0" targetFramework="net40" />
<package id="Iesi.Collections" version="4.0.0.4000" targetFramework="net40" /> <package id="Iesi.Collections" version="4.0.0.4000" targetFramework="net40" />
<package id="Microsoft.Bcl.HashCode" version="1.1.1" targetFramework="net472" />
<package id="MySql.Data" version="6.6.5" targetFramework="net20" /> <package id="MySql.Data" version="6.6.5" targetFramework="net20" />
<package id="NHibernate" version="4.0.4.4000" targetFramework="net40" /> <package id="NHibernate" version="4.0.4.4000" targetFramework="net40" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net472" /> <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net472" />
<package id="Oracle.ManagedDataAccess" version="19.11.0" targetFramework="net472" /> <package id="Oracle.ManagedDataAccess" version="19.11.0" targetFramework="net472" />
<package id="RBush.Signed" version="4.0.0" targetFramework="net472" />
<package id="SixLabors.Fonts" version="1.0.0" targetFramework="net472" />
<package id="System.Buffers" version="4.6.1" targetFramework="net472" />
<package id="System.Data.SQLite" version="1.0.90.0" targetFramework="net40" /> <package id="System.Data.SQLite" version="1.0.90.0" targetFramework="net40" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" 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.Runtime.CompilerServices.Unsafe" version="6.1.1" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" /> <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
<package id="log4net" version="2.0.15" targetFramework="net472" /> <package id="log4net" version="2.0.15" targetFramework="net472" />
</packages> </packages>
+158
View File
@@ -0,0 +1,158 @@
using System;
using System.IO;
using ClosedXML.Excel;
using DocumentFormat.OpenXml;
using JetBrains.Annotations;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Results;
using Results.Uncertainty;
namespace TBFTests
{
[TestClass]
[TestSubject(typeof(RigUncertainty))]
public class RigUncertaintyTest
{
private RigUncertainty _rigUncertainty;
[TestInitialize]
public void Setup()
{
string pathToTestExcel = Path.Combine("C:\\Users\\micha\\Downloads", "Uncertainty_template.xlsx");
_rigUncertainty = new RigUncertainty(pathToTestExcel);
}
[TestMethod]
public void OpenDocument_SuccessfullyOpensDocument_RaisesNoExceptions()
{
//Arrange
// Act
_rigUncertainty.OpenDocument();
Assert.IsTrue(_rigUncertainty.IsOpenedDocument);
_rigUncertainty.CloaseDocument();
Assert.IsFalse(_rigUncertainty.IsOpenedDocument);
}
[TestMethod]
public void OpenDocument_Sheets()
{
_rigUncertainty.OpenDocument();
Assert.IsTrue(_rigUncertainty.IsOpenedDocument);
IXLWorksheet worksheet = _rigUncertainty.GetWorksheet(DocumentSheets.RADATA);
int iRow = 4;
int Batch = worksheet.Cell($"B{iRow}").GetValue<int>();
Assert.AreEqual(914, Batch);
string TestName = worksheet.Cell($"C{iRow}").GetValue<string>();
Assert.AreEqual("Q1 (1/5)", TestName);
string TestMeth = worksheet.Cell($"F{iRow}").GetValue<string>();
Assert.AreEqual("FlyingStartMassCollection", TestMeth);
double TargetQPlus = worksheet.Cell($"I{iRow}").GetValue<double>();
Assert.IsTrue(CommonExcell.AreClose(0.0055d,TargetQPlus)); // in tolerance
_rigUncertainty.CloaseDocument();
Assert.IsFalse(_rigUncertainty.IsOpenedDocument);
}
[TestMethod]
public void OpenDocument_Sheets_InsertValues()
{
_rigUncertainty.OpenDocument();
Assert.IsTrue(_rigUncertainty.IsOpenedDocument);
int iRowI = 11;
ProcessDataLine processDataLine = new ProcessDataLine();
processDataLine.InitDefault();
CommonExcell.InsertValueLineProcessData(_rigUncertainty,iRowI, processDataLine);
//check inserted data
int iRow = 11;
IXLWorksheet worksheet = _rigUncertainty.GetWorksheet(DocumentSheets.RADATA);
int Batch = worksheet.Cell($"B{iRow}").GetValue<int>();
Assert.AreEqual(914, Batch);
string TestName = worksheet.Cell($"C{iRow}").GetValue<string>();
Assert.AreEqual("Q1 (1/5)", TestName);
string TestMeth = worksheet.Cell($"F{iRow}").GetValue<string>();
Assert.AreEqual("FlyingStartMassCollection", TestMeth);
double TargetQPlus = worksheet.Cell($"I{iRow}").GetValue<double>();
Assert.IsTrue(CommonExcell.AreClose(0.0055d,TargetQPlus));
_rigUncertainty.CloaseDocument();
Assert.IsFalse(_rigUncertainty.IsOpenedDocument);
}
[TestMethod]
public void ExcelColumnsTools()
{
Assert.AreEqual("A", CommonExcell.NextColumn(""));
Assert.AreEqual("B", CommonExcell.NextColumn("A"));
Assert.AreEqual("AA", CommonExcell.NextColumn("Z"));
Assert.AreEqual("BA", CommonExcell.NextColumn("AZ"));
Assert.AreEqual("ZD", CommonExcell.NextColumn("ZC"));
Assert.AreEqual("CG", CommonExcell.NextColumn("CF"));
Assert.AreEqual(5, CommonExcell.GetColumnDistance("A", "F"));
Assert.AreEqual(5, CommonExcell.GetColumnDistance("AA", "AF"));
Assert.AreEqual(-21, CommonExcell.GetColumnDistance("AA", "F"));
Assert.AreEqual(31, CommonExcell.GetColumnDistance("AA", "BF"));
Assert.AreEqual("F", CommonExcell.GetExcelColumnByDistance("A", 5));
Assert.AreEqual("AF", CommonExcell.GetExcelColumnByDistance("AA", 5));
Assert.AreEqual("F", CommonExcell.GetExcelColumnByDistance("AA", -21));
Assert.AreEqual("BF", CommonExcell.GetExcelColumnByDistance("AA", 31));
}
[TestMethod]
public void OpenDocument_Sheets_LoadFromDB()
{
_rigUncertainty.OpenDocument();
Assert.IsTrue(_rigUncertainty.IsOpenedDocument);
int iRowI = 11;
ProcessDataLine processDataLine = new ProcessDataLine();
processDataLine.InitDefault();
CommonExcell.InsertValueLineProcessData(_rigUncertainty,iRowI, processDataLine);
//check inserted data
int iRow = 11;
IXLWorksheet worksheet = _rigUncertainty.GetWorksheet(DocumentSheets.RADATA);
int Batch = worksheet.Cell($"B{iRow}").GetValue<int>();
Assert.AreEqual(914, Batch);
string TestName = worksheet.Cell($"C{iRow}").GetValue<string>();
Assert.AreEqual("Q1 (1/5)", TestName);
string TestMeth = worksheet.Cell($"F{iRow}").GetValue<string>();
Assert.AreEqual("FlyingStartMassCollection", TestMeth);
double TargetQPlus = worksheet.Cell($"I{iRow}").GetValue<double>();
Assert.IsTrue(CommonExcell.AreClose(0.0055d,TargetQPlus));
_rigUncertainty.CloaseDocument();
Assert.IsFalse(_rigUncertainty.IsOpenedDocument);
}
}
}
+44 -8
View File
@@ -41,12 +41,30 @@
<Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> <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> <HintPath>..\packages\Castle.Core.5.1.1\lib\net462\Castle.Core.dll</HintPath>
</Reference> </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="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL"> <Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.2023.3.0\lib\net20\JetBrains.Annotations.dll</HintPath> <HintPath>..\packages\JetBrains.Annotations.2023.3.0\lib\net20\JetBrains.Annotations.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <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> <HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
</Reference> </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.Extensions.Configuration.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Configuration.Abstractions.5.0.0\lib\net461\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.Configuration.Abstractions.5.0.0\lib\net461\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
</Reference> </Reference>
@@ -62,20 +80,28 @@
<Reference Include="Moq, Version=4.20.70.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL"> <Reference Include="Moq, Version=4.20.70.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.20.70\lib\net462\Moq.dll</HintPath> <HintPath>..\packages\Moq.4.20.70\lib\net462\Moq.dll</HintPath>
</Reference> </Reference>
<Reference Include="mscorlib" />
<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" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath> <HintPath>..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Data" />
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath> <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>
<Reference Include="System.Numerics" /> <Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath> <HintPath>..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.1\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath> <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
@@ -85,6 +111,7 @@
</Reference> </Reference>
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<Choose> <Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'"> <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
@@ -97,8 +124,13 @@
<ItemGroup> <ItemGroup>
<Compile Include="Entities\MeasurementCorrectionTest.cs" /> <Compile Include="Entities\MeasurementCorrectionTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RigUncertaintyTest.cs" />
<Compile Include="Rig\Network\Camera\KeyenceIV3G120\CameraTest.cs" /> <Compile Include="Rig\Network\Camera\KeyenceIV3G120\CameraTest.cs" />
<Compile Include="Rig\Network\Camera\RoiForFixedStartKeyence\RoiTest.cs" /> <Compile Include="Rig\Network\Camera\RoiForFixedStartKeyence\RoiTest.cs" />
<Compile Include="Uncertainty\Calculation\BatchProcessTableTest.cs" />
<Compile Include="Uncertainty\Calculation\CalculationTableTest.cs" />
<Compile Include="Uncertainty\Calculation\MathTest.cs" />
<Compile Include="Uncertainty\CommonTable\TableTest.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" /> <None Include="app.config" />
@@ -109,6 +141,10 @@
<Project>{743df7db-c7b6-42eb-986d-0f485e5588e4}</Project> <Project>{743df7db-c7b6-42eb-986d-0f485e5588e4}</Project>
<Name>Config</Name> <Name>Config</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\Results\Results.csproj">
<Project>{9d0dcc88-dc81-47eb-9fdd-4c3907871bfb}</Project>
<Name>Results</Name>
</ProjectReference>
<ProjectReference Include="..\TBF\TBF.csproj"> <ProjectReference Include="..\TBF\TBF.csproj">
<Project>{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}</Project> <Project>{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}</Project>
<Name>TBF</Name> <Name>TBF</Name>
@@ -0,0 +1,117 @@
using System.Collections.Generic;
using JetBrains.Annotations;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Results.Uncertainty;
using Results.Uncertainty.Calculation;
namespace TBFTests.Uncertainty.Calculation
{
[TestClass]
[TestSubject(typeof(BatchProcessTable))]
public class BatchProcessTableTest
{
[TestMethod]
public void ModifyKbuoyancyTest()
{
BatchProcessTable batchTable = new BatchProcessTable();
batchTable.ProcessTable = new Dictionary<int, ProcessDataLine>();
ProcessDataLine processDataLine = new ProcessDataLine();
processDataLine.InitDefault();
batchTable.ProcessTable.Add(1, processDataLine);
processDataLine = new ProcessDataLine();
processDataLine.InitDefault();
batchTable.ProcessTable.Add(2, processDataLine);
processDataLine = new ProcessDataLine();
processDataLine.InitDefault();
batchTable.ProcessTable.Add(3, processDataLine);
processDataLine = new ProcessDataLine();
processDataLine.InitDefault();
batchTable.ProcessTable.Add(4, processDataLine);
List<ColumnValue> correctedBuoyancy = new List<ColumnValue>();
double correctedK = processDataLine.Kbuoyancy + 0.001;
for (int i = 0; i < batchTable.ProcessTable.Count; i++)
{
correctedBuoyancy.Add(new ColumnValue(i, correctedK ));
}
Dictionary<int, IList<ColumnValue>> modifiedKbuoyancy = batchTable.ModifyKbuoyancy(correctedBuoyancy);
Assert.IsTrue(modifiedKbuoyancy.ContainsKey(CommonExcell.ColumnToNumber("BC")));
Assert.IsTrue(modifiedKbuoyancy.ContainsKey(CommonExcell.ColumnToNumber("BI")));
Assert.IsTrue(modifiedKbuoyancy.ContainsKey(CommonExcell.ColumnToNumber("BJ")));
Assert.IsTrue(modifiedKbuoyancy.ContainsKey(CommonExcell.ColumnToNumber("BM")));
Assert.AreEqual(correctedK, modifiedKbuoyancy[CommonExcell.ColumnToNumber("BC")][0].Value);
Assert.AreEqual(correctedK, modifiedKbuoyancy[CommonExcell.ColumnToNumber("BC")][1].Value);
Assert.AreEqual(correctedK, modifiedKbuoyancy[CommonExcell.ColumnToNumber("BC")][2].Value);
Assert.AreEqual(correctedK, modifiedKbuoyancy[CommonExcell.ColumnToNumber("BC")][3].Value);
Assert.AreNotEqual(processDataLine.Qctv, modifiedKbuoyancy[CommonExcell.ColumnToNumber("BI")][2].Value);
Assert.IsTrue(CommonExcell.AreClose(processDataLine.VolRI, modifiedKbuoyancy[CommonExcell.ColumnToNumber("BJ")][0].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.VolRI, modifiedKbuoyancy[CommonExcell.ColumnToNumber("BJ")][1].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.VolRI, modifiedKbuoyancy[CommonExcell.ColumnToNumber("BJ")][2].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.VolRI, modifiedKbuoyancy[CommonExcell.ColumnToNumber("BJ")][3].Value));
Assert.AreNotEqual(processDataLine.ERelRef, modifiedKbuoyancy[CommonExcell.ColumnToNumber("BM")][3].Value);
}
[TestMethod]
public void GetKBuoyancyTest()
{
BatchProcessTable batchTable = new BatchProcessTable();
batchTable.ProcessTable = new Dictionary<int, ProcessDataLine>();
ProcessDataLine processDataLine = new ProcessDataLine();
processDataLine.InitDefault();
batchTable.ProcessTable.Add(1, processDataLine);
processDataLine = new ProcessDataLine();
processDataLine.InitDefault();
batchTable.ProcessTable.Add(2, processDataLine);
processDataLine = new ProcessDataLine();
processDataLine.InitDefault();
batchTable.ProcessTable.Add(3, processDataLine);
processDataLine = new ProcessDataLine();
processDataLine.InitDefault();
batchTable.ProcessTable.Add(4, processDataLine);
Dictionary<int, IList<ColumnValue>> tableKbuoyancy = batchTable.GetKBuoyancy();
Assert.IsTrue(tableKbuoyancy.ContainsKey(CommonExcell.ColumnToNumber("BC")));
Assert.IsTrue(tableKbuoyancy.ContainsKey(CommonExcell.ColumnToNumber("BI")));
Assert.IsTrue(tableKbuoyancy.ContainsKey(CommonExcell.ColumnToNumber("BJ")));
Assert.IsTrue(tableKbuoyancy.ContainsKey(CommonExcell.ColumnToNumber("BM")));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.Kbuoyancy, tableKbuoyancy[CommonExcell.ColumnToNumber("BC")][0].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.Kbuoyancy, tableKbuoyancy[CommonExcell.ColumnToNumber("BC")][1].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.Kbuoyancy, tableKbuoyancy[CommonExcell.ColumnToNumber("BC")][2].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.Kbuoyancy, tableKbuoyancy[CommonExcell.ColumnToNumber("BC")][3].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.Qctv, tableKbuoyancy[CommonExcell.ColumnToNumber("BI")][0].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.Qctv, tableKbuoyancy[CommonExcell.ColumnToNumber("BI")][1].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.Qctv, tableKbuoyancy[CommonExcell.ColumnToNumber("BI")][2].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.Qctv, tableKbuoyancy[CommonExcell.ColumnToNumber("BI")][3].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.VolRI, tableKbuoyancy[CommonExcell.ColumnToNumber("BJ")][0].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.VolRI, tableKbuoyancy[CommonExcell.ColumnToNumber("BJ")][1].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.VolRI, tableKbuoyancy[CommonExcell.ColumnToNumber("BJ")][2].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.VolRI, tableKbuoyancy[CommonExcell.ColumnToNumber("BJ")][3].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.ERelRef, tableKbuoyancy[CommonExcell.ColumnToNumber("BM")][0].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.ERelRef, tableKbuoyancy[CommonExcell.ColumnToNumber("BM")][1].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.ERelRef, tableKbuoyancy[CommonExcell.ColumnToNumber("BM")][2].Value));
Assert.IsTrue(CommonExcell.AreClose(processDataLine.ERelRef, tableKbuoyancy[CommonExcell.ColumnToNumber("BM")][3].Value));
}
}
}
@@ -0,0 +1,48 @@
using System.Collections.Generic;
using JetBrains.Annotations;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Results.Uncertainty;
using Results.Uncertainty.Calculation;
using TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl;
namespace TBFTests.Uncertainty.Calculation
{
[TestClass]
[TestSubject(typeof(CalculationTable))]
public class CalculationTableTest
{
[TestMethod]
public void StandardDeviationTest()
{
CalculationTable calculationTable = new CalculationTable();
List<ColumnValue> columnValues = new List<ColumnValue>();
CalculationTable.StandardDeviation(columnValues);
BatchProcessTable batchTable = calculationTable.BatchProcessTable;
batchTable.ProcessTable = new Dictionary<int, ProcessDataLine>();
ProcessDataLine processDataLine = new ProcessDataLine();
processDataLine.InitDefault();
batchTable.ProcessTable.Add(1, processDataLine);
processDataLine = new ProcessDataLine();
processDataLine.InitDefault();
batchTable.ProcessTable.Add(2, processDataLine);
processDataLine = new ProcessDataLine();
processDataLine.InitDefault();
batchTable.ProcessTable.Add(3, processDataLine);
processDataLine = new ProcessDataLine();
processDataLine.InitDefault();
batchTable.ProcessTable.Add(4, processDataLine);
IList<ColumnValue> listMeterValue = batchTable.GetListMeterValue(0, 5);
double standardDeviation = CalculationTable.StandardDeviation(listMeterValue);
//because all are the same shoud be 0
Assert.IsTrue(CommonExcell.AreClose(0, standardDeviation));
}
}
}
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using JetBrains.Annotations;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Math = Results.Uncertainty.Calculation.Math;
namespace TBFTests.Uncertainty.Calculation
{
[TestClass]
[TestSubject(typeof(Math))]
public class MathTest
{
[TestMethod]
public void AritmeticMeanTest()
{
IList<double> list = new List<double>(){1,2,3,4,5};
double result = Math.Average(list);
Assert.AreEqual(3.0d, result);
}
}
}
@@ -0,0 +1,108 @@
using ClosedXML.Excel;
using JetBrains.Annotations;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Results.Uncertainty;
using Results.Uncertainty.CommonTable;
namespace TBFTests.Uncertainty.CommonTable
{
[TestClass]
[TestSubject(typeof(Table))]
public class TableTest
{
[TestMethod]
public void CrateTableTest()
{
var wb = new XLWorkbook();
var ws = wb.AddWorksheet("Demo");
var table = new Table();
// name your columns up front (optional)
table.AddColumn("Product");
table.AddColumn("Price");
// add a row
int row0 = table.AddRow();
table.AddCell(row0, "Product", "Widget");
table.AddCell(row0, "Price", 9.99);
// another row
int row1 = table.AddRow("Second row");
table.AddCell(row1, 0, "Gadget"); // by index
table.AddCell(row1, 1, 19.49);
// dump into sheet (with headers)
table.ToWorksheet(ws, includeHeaders: true);
// sheet check:
ws.Cell(2, 1).Value.Equals(table.GetCell(row0,0).Value); // A2
ws.Cell(3, 2).Value.Equals(table.GetCell(row1,1).Value); // B2
}
[TestMethod]
public void CrateTableOnPositionTest()
{
var wb = new XLWorkbook();
var ws = wb.AddWorksheet("Demo");
var table = new Table();
// name your columns up front (optional)
string Column = "A";
table.AddColumn(Column);
Column = CommonExcell.NextColumn(Column);
table.AddColumn(Column);
Column = CommonExcell.NextColumn(Column);
table.AddColumn(Column);
// add a row
int row0 = table.AddRow();
table.AddCell(row0, "A", "Widget");
table.AddCell(row0, "B", 9.99);
table.AddCell(row0, "C", 89.93);
// add a row
int row1 = table.AddRow();
table.AddCell(row0, "A", "Temp");
table.AddCell(row0, "B", 169.99);
table.AddCell(row0, "C", 88.01);
// another row by index
int row2 = table.AddRow("Another row");
table.AddCell(row1, 0, "Gadget"); // by index
table.AddCell(row1, 1, 19.49);
table.AddCell(row1, 2, 21.49);
// dump into sheet (with headers)
table.ToWorksheet(ws, includeHeaders: true);
// sheet check:
ws.Cell(2, 1).Value.Equals(table.GetCell(row0,0).Value); // A2
ws.Cell(3, 2).Value.Equals(table.GetCell(row1,1).Value); // B3
ws.Cell(4, 3).Value.Equals(table.GetCell(row2,2).Value); // C4
table.ToWorksheet(ws, includeHeaders: false);
// sheet check:
ws.Cell(1, 1).Value.Equals(table.GetCell(row0,0).Value); // A2
ws.Cell(2, 2).Value.Equals(table.GetCell(row1,1).Value); // B3
ws.Cell(3, 3).Value.Equals(table.GetCell(row2,2).Value); // C4
int iOffsetRow = 10;
int iOffsetCol = 2;
table.ToWorksheetWithOffset(ws, iOffsetRow, iOffsetCol, includeHeaders: false);
// sheet check:
ws.Cell(1 + iOffsetRow, 1 + iOffsetCol).Value.Equals(table.GetCell(row0,0).Value); // A2 + offset
ws.Cell(2 + iOffsetRow, 2 + iOffsetCol).Value.Equals(table.GetCell(row1,1).Value); // B3 + offset
ws.Cell(3 + iOffsetRow, 3 + iOffsetCol).Value.Equals(table.GetCell(row2,2).Value); // C4 + offset
}
}
}
+13 -1
View File
@@ -8,7 +8,19 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-6.0.2.0" newVersion="6.0.2.0" />
</dependentAssembly>
<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>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
+24 -10
View File
@@ -1,32 +1,46 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<section name="oracle.manageddataaccess.client" <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
</configSections> </configSections>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup> </startup>
<system.data> <system.data>
<DbProviderFactories> <DbProviderFactories>
<remove invariant="Oracle.ManagedDataAccess.Client"/> <remove invariant="Oracle.ManagedDataAccess.Client" />
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
</DbProviderFactories> </DbProviderFactories>
</system.data> </system.data>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<publisherPolicy apply="no"/> <publisherPolicy apply="no" />
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/> <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
<bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.19.1"/> <bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.19.1" />
</dependentAssembly>
<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> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<oracle.manageddataaccess.client> <oracle.manageddataaccess.client>
<version number="*"> <version number="*">
<dataSources> <dataSources>
<dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) "/> <dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
</dataSources> </dataSources>
</version> </version>
</oracle.manageddataaccess.client> </oracle.manageddataaccess.client>
+13 -1
View File
@@ -8,7 +8,19 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-6.0.2.0" newVersion="6.0.2.0" />
</dependentAssembly>
<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>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
+12 -4
View File
@@ -1,16 +1,24 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Castle.Core" version="5.1.1" targetFramework="net472" /> <package id="Castle.Core" version="5.1.1" targetFramework="net472" />
<package id="ClosedXML" version="0.105.0-rc" targetFramework="net472" />
<package id="ClosedXML.Parser" version="2.0.0-preview1" 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="ExcelNumberFormat" version="1.1.0" targetFramework="net472" />
<package id="JetBrains.Annotations" version="2023.3.0" targetFramework="net472" /> <package id="JetBrains.Annotations" version="2023.3.0" targetFramework="net472" />
<package id="Microsoft.Bcl.HashCode" version="1.1.1" targetFramework="net472" />
<package id="Microsoft.Extensions.Configuration.Abstractions" version="5.0.0" targetFramework="net472" /> <package id="Microsoft.Extensions.Configuration.Abstractions" version="5.0.0" targetFramework="net472" />
<package id="Microsoft.Extensions.Primitives" version="5.0.0" targetFramework="net472" /> <package id="Microsoft.Extensions.Primitives" version="5.0.0" targetFramework="net472" />
<package id="Moq" version="4.20.70" targetFramework="net472" /> <package id="Moq" version="4.20.70" targetFramework="net472" />
<package id="MSTest.TestAdapter" version="2.2.10" targetFramework="net472" /> <package id="MSTest.TestAdapter" version="2.2.10" targetFramework="net472" />
<package id="MSTest.TestFramework" version="2.2.10" targetFramework="net472" /> <package id="MSTest.TestFramework" version="2.2.10" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" /> <package id="RBush.Signed" version="4.0.0" targetFramework="net472" />
<package id="System.Memory" version="4.5.4" targetFramework="net472" /> <package id="SixLabors.Fonts" version="1.0.0" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" /> <package id="System.Buffers" version="4.6.1" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" 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.Runtime.CompilerServices.Unsafe" version="6.1.1" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" /> <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" /> <package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
<package id="log4net" version="2.0.15" targetFramework="net472" /> <package id="log4net" version="2.0.15" targetFramework="net472" />
@@ -1,23 +0,0 @@
The MIT License (MIT)
Copyright (c) .NET Foundation and Contributors
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -1,309 +0,0 @@
.NET Core uses third-party libraries or other resources that may be
distributed under licenses different than the .NET Core software.
In the event that we accidentally failed to list a required notice, please
bring it to our attention. Post an issue or email us:
dotnet@microsoft.com
The attached notices are provided for information only.
License notice for Slicing-by-8
-------------------------------
http://sourceforge.net/projects/slicing-by-8/
Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved
This software program is licensed subject to the BSD License, available at
http://www.opensource.org/licenses/bsd-license.html.
License notice for Unicode data
-------------------------------
http://www.unicode.org/copyright.html#License
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
License notice for Zlib
-----------------------
https://github.com/madler/zlib
http://zlib.net/zlib_license.html
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.11, January 15th, 2017
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
*/
License notice for Mono
-------------------------------
http://www.mono-project.com/docs/about-mono/
Copyright (c) .NET Foundation Contributors
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the Software), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License notice for International Organization for Standardization
-----------------------------------------------------------------
Portions (C) International Organization for Standardization 1986:
Permission to copy in any form is granted for use with
conforming SGML systems and applications as defined in
ISO 8879, provided this notice is included in all copies.
License notice for Intel
------------------------
"Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License notice for Xamarin and Novell
-------------------------------------
Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Copyright (c) 2011 Novell, Inc (http://www.novell.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Third party notice for W3C
--------------------------
"W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE
Status: This license takes effect 13 May, 2015.
This work is being provided by the copyright holders under the following license.
License
By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the work or portions thereof, including modifications:
The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included.
Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)."
Disclaimers
THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT.
The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders."
License notice for Bit Twiddling Hacks
--------------------------------------
Bit Twiddling Hacks
By Sean Eron Anderson
seander@cs.stanford.edu
Individually, the code snippets here are in the public domain (unless otherwise
noted) — feel free to use them however you please. The aggregate collection and
descriptions are © 1997-2005 Sean Eron Anderson. The code and descriptions are
distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY and
without even the implied warranty of merchantability or fitness for a particular
purpose.
License notice for Brotli
--------------------------------------
Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
compress_fragment.c:
Copyright (c) 2011, Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
decode_fuzzer.c:
Copyright (c) 2015 The Chromium Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
@@ -1 +0,0 @@
7601f4f6225089ffb291dc7d58293c7bbf5c5d4f