Compare commits

..
Author SHA1 Message Date
Milan Hanajik a6a87cccae DB ver. 2. 15 consolidated, Procedure.ProtocolTitle removed 2017-07-24 22:14:10 +03:00
Milan Hanajik 1d7a2e4a0c ValveEx change reverted, RegisterReader-s fixed : Clear() should not be used in default constructor. 2017-07-24 22:14:05 +03:00
Milan Hanajik 9ac237a377 Alternative procedure - UI implemented. 2017-07-23 21:54:03 +03:00
Milan Hanajik 74d5688936 FileWriters.ImageArchiver, FileWriters.OneFilePerMeter and Printers.OnePagePerMeter components added. 2017-07-23 21:51:22 +03:00
Milan Hanajik 534baa7aa3 Camera serial number used in UI, HardwareAddress % 100 used in DetectCamera(...) function call. 2017-07-23 11:47:31 +03:00
Milan Hanajik b11d55c2c7 Basic GrabImage support, ver. 2.14.619 2017-07-23 11:04:27 +03:00
Milan Hanajik 8fb27fc4f1 Petersburg-PT200 component updated (170718), ver. 2.14.618 2017-07-21 16:56:30 +03:00
Milan Hanajik 7332bc2a71 RRoute displayed in the status bar, ver. 2.14.617 2017-07-21 16:40:25 +03:00
Milan Hanajik ae0ebd15f7 (1) RegValveCalib array pre-initialized, (2) Test ID column supressed in ResultsArrangementDlg, (3) ValveEx fixed, ver. 2.14.616 2017-07-21 15:34:28 +03:00
Milan Hanajik b8ade55096 Changes for PETERSBURG_200, ver. 2.14.615 2017-07-21 11:08:16 +03:00
Milan Hanajik acc5b2fecd Communication with scales at the beginning (s/n, command I4) retreded 3 times. 2017-07-21 09:24:01 +03:00
Milan Hanajik e76c2afa08 Camera.Display.DisplayForm.CloseForm(sender, args) added, no conflict with other modeless forms, ver. 2.14.613 2017-07-20 20:05:44 +03:00
Milan Hanajik 8d249a96f4 Fixes in Buoyancy calculation, ver. 2.14.612 2017-07-20 19:54:33 +03:00
Milan Hanajik 229bec30cc Diverter ADC value updated in DiverterCfgCtrl (More button). 2017-07-20 14:49:16 +03:00
Milan Hanajik 5552a28925 ver. 2.14.609 2017-07-19 16:52:29 +03:00
Milan Hanajik 3bd5d0e7d3 MainSeq changes, BenchControlPanel 'disabled btn' color, Russian enum-descriptions, ver. 2.14.608 2017-07-19 16:39:34 +03:00
Milan Hanajik 218a14acca PETERBURG_xy -> PETERSBURG_xy 2017-07-19 16:39:01 +03:00
Milan Hanajik 1f978844c0 Draining can be stopped by drain buttons, not by STOP button. 2017-07-19 16:38:46 +03:00
Milan Hanajik ca80c1e49d BenchControlPanel supports Drain buttons highlighting (3 states). 2017-07-19 08:00:51 +02:00
Milan Hanajik 9bf66f651a Buoyancy is 1.00103, not 1001.03 2017-07-19 07:53:52 +02:00
Milan Hanajik a94ebc747a ver. 2.14.604 2017-07-18 10:00:31 +02:00
Milan Hanajik 77a6aff593 iPerl communication changes (completed as in branch 12 - Greece). 2017-07-18 08:43:16 +02:00
Milan Hanajik f58bc38450 ver. 2.14.603 2017-07-16 19:42:50 +02:00
Milan Hanajik bb962ad3b7 iPerl communication changes (in progress). 2017-07-14 17:13:07 +02:00
Milan Hanajik dbdbda77b3 Something 2017-07-14 17:13:01 +02:00
Milan Hanajik cafdffd647 (1) LU-logging changes, (2) Oracle DB changes for Greece - saving average results from multiple tests. 2017-07-14 16:31:05 +02:00
Milan Hanajik e076410d71 Style and minor changes. 2017-07-14 16:28:55 +02:00
Milan Hanajik 0862b265bd Procedure and Test 'Compare' in progress. 2017-07-14 16:28:18 +02:00
Milan Hanajik 803bea960d Bug fix in MettlerToledo.Standard.GetSerNumOp, ver. 2.14.602 2017-07-14 14:37:12 +02:00
Milan Hanajik 1a2c64db84 ver. 2.14.601 2017-07-12 16:38:35 +02:00
Milan Hanajik 179e673104 ver. 2.14.600 2017-07-06 14:17:53 +02:00
Milan Hanajik 3ba579e4a0 Modifications for BAHRAIN_50 2017-07-04 11:28:02 +02:00
Milan Hanajik 00a2289e92 Evaluation of Results.Entities.TestRslt.TestDone, Results.Entities.Batch.Buoyancy() etc. fixed, ver. 2.14.599 2017-07-04 11:19:05 +02:00
Milan Hanajik 34ad6f040d WMeterRsltItemSpec : Q_rise Q_fall fixed 2017-07-04 05:16:51 +02:00
Milan Hanajik 0c827d7167 Buoyancy WMeterRsltItemSpec fixed, evaluated also for a complete batch, ver. 2.14.598 2017-07-03 12:41:37 +02:00
Milan Hanajik 178af644d0 Camera detection improvement. 2017-07-03 12:40:20 +02:00
Milan Hanajik 2ea5454707 Output.FileWriters.Enhanced uses font properties, ver. 2.14.597 2017-06-30 16:42:30 +02:00
Milan Hanajik f5c5569482 Results config - new tab order, Output.Printer.Enhanced - font properties (UI) 2017-06-30 14:15:26 +02:00
Milan Hanajik a250556f9b Output.FileWriters.Xml does not use separate threads. 2017-06-30 12:43:00 +02:00
Milan Hanajik dac91b094e MainSeq modification : Purging End does not leave a measurement session, ver. 2.14.596 2017-06-30 12:04:55 +02:00
Milan Hanajik 1ef666be9e ver. 2.14.595 2017-06-29 23:10:35 +02:00
Milan Hanajik e71795bfe5 Masses, Buoyancy, Density corr. added to results, Buoyancy -> TestRslt, Dens.corr. -> Batch, MetrologyDlgDensityTab, etc. 2017-06-29 23:04:17 +02:00
Milan Hanajik 0d6a8b272a When saving a new or modified procedure there is a test of the Name uniqueness 2017-06-29 22:57:21 +02:00
Milan Hanajik 5d0b929593 Communication with scales is verified on program startup. 2017-06-29 22:57:16 +02:00
Milan Hanajik 94e5e906b1 Results.Entities.MeterTestRslt.IsPilotRslt() added to control output protocol generation. 2017-06-29 22:57:11 +02:00
Milan Hanajik 38b985c75f DataEntry.Combined.EntryForm fixed, all data entry forms simplified. 2017-06-29 11:37:18 +02:00
Milan Hanajik 49fa937074 MainSeq : CreateNewBatchResults( ) fixed for compound meters, extra checks added. Config.Data changed for BERLIN. 2017-06-29 09:21:22 +02:00
Milan Hanajik 85ead0b69e WMeterRsltItemSpec : iPerl FW Version added. 2017-06-27 14:05:17 +02:00
Milan Hanajik 22c8d6ed9d 'BatchNr' from MySQL DB used in offline mode (IsRealbench = false) 2017-06-27 11:29:52 +02:00
Milan Hanajik 7449456d55 Mettler-Toledo improvements, SerialPort.Encoding = ASCII, etc., ver. 2.14.589 2017-06-26 15:34:31 +02:00
Milan Hanajik 2fb1c44ff2 All scales support GetSerNumOp (however some return null). Reading S/N of all scales on program startup, ver. 2.14.588 2017-06-26 13:22:36 +02:00
Milan Hanajik 71e1cf47df Output.Printers.Enhanced.Printer uses a correct CultureInfo (Torino), etc., ver. 2.14.587 2017-06-23 13:40:44 +02:00
Milan Hanajik 13ddcac646 TestDone and TestPassed results items added, ver. 2.14.586 2017-06-23 12:37:10 +02:00
Milan Hanajik 3a3dc59275 Multiple file writers temporary bug fix, ver. 2.14.585 2017-06-23 10:53:01 +02:00
Milan Hanajik 76a841bc84 Output.PrintersEnhanced.EnhancedPrintDocument updated. 2017-06-23 10:52:02 +02:00
Milan Hanajik 628efe83ca Italian language fixes, ver. 2.14.584 2017-06-23 08:47:39 +02:00
Milan Hanajik 17f6f7c3be XmlSerializers created by XmlSerializer.FromType(new[] {typeof(...)})[0]; This prevents throwing an exception => better debugging. 2017-06-22 21:37:05 +02:00
Milan Hanajik 7ad8c986d7 Multi-threading bug fix in Output.FileWriters. 2017-06-22 21:36:46 +02:00
Milan Hanajik 470fc6fd07 Italian resources added. 2017-06-21 18:55:49 +02:00
Milan Hanajik b1f1c6f932 TestMethods.Adjustment forms have the control box in the upper-right corner hidden. 2017-06-21 18:29:36 +02:00
Milan Hanajik 902d596c63 RsltItems_Screen_xxx lists in ResultsTabPageCtrl initialized earlier (in the constructor), possible Torino50 bug fix). 2017-06-21 18:29:22 +02:00
Milan Hanajik cf5307d2e2 ver. 2.14.582 2017-06-21 16:04:16 +02:00
Milan Hanajik 9c663b34c7 PETERBURG_50 and KEMPNO_50 if / elif-s fixed (20 water meters instead of 6), ver. 2.14.581 2017-06-20 17:11:28 +02:00
Milan Hanajik 2ac97aa809 commonBackColor for ListView-s in ResultsTabPage, CompletedFromTests() method in Results.Entities.WaterMeter 2017-06-16 15:36:27 +02:00
Milan Hanajik ddebe7f8d5 iPerlCommunication/iPerlEnums.cs (enum Q2CorrType) added 2017-06-15 19:08:26 +02:00
Milan Hanajik 6773624cb4 MySQL DB changes for IPERL : FWVersion and FlowMean added, no conflict with FlowMin. 2017-06-15 18:59:05 +02:00
Milan Hanajik 1bf118bdb9 Generic improvements 2017-06-15 18:58:51 +02:00
Milan Hanajik c31c19ba02 Code update for STABLE_MASS_EXTRAS. 2017-06-13 09:05:53 +02:00
Milan Hanajik 05200c437e Kempno_50 component added, if/elif for KEMPNO_50 added, ver. 2.14.577 2017-06-13 08:49:06 +02:00
Milan Hanajik 750122e6ea Easytherm : temperature setpoint = 0 ... not communicated to the Easytherm (= no change) ... is the default value, ver. 2.14.576 2017-06-11 13:13:18 +02:00
Milan Hanajik 8d5c13f6d7 ITempMeter iface added to Modbus.Easytherm.Easytherm, SetReservoirTemp() added to IControlCom and used by Easytherm, Modbus uses queues, sends 1 telegram/s, ver. 2.14.575 2017-06-11 12:07:53 +02:00
Milan Hanajik 1dd399bdb9 Component upgraded : Zavretie VL11 a VL13 pri otvorenom upinaci, etc. 2017-06-11 12:02:16 +02:00
Milan Hanajik beba64242d DB bug fix. 2017-06-08 22:54:30 +02:00
Milan Hanajik 3be28f8a11 Performance improvement of automated renaming of paths and sequences. 2017-06-08 22:49:44 +02:00
Milan Hanajik d2b745dd8e Temperature Tup and Tdown can be checked in Adjustment, Endurance, FlyingStart, FlyingStartMassCollection and FixedStart methods, ver. 2.14.573 2017-06-08 16:55:24 +02:00
Milan Hanajik db55f5b3fd DB entities, mappings and UI added for 'Control water temp.', 'Temp. lim. lo' and 'Temp. lim. hi'. 2017-06-08 16:06:48 +02:00
Milan Hanajik 420c194f04 resources cleanup : Error_ removed, Control_water_temp_chdr, Temp_lim_lo_chdr, Temp_lim_hi_chdr added, etc. 2017-06-08 15:41:18 +02:00
Milan Hanajik 5cb3955903 Code cleanup : Config.Entities.TestResult, Config.Entities.MeterTestResult, ResultsPrinters.Zapiska.Printer, etc. removed. 2017-06-08 15:37:52 +02:00
Milan Hanajik 420d016ee8 Q_from and Q_to removed from three Procedure tabs. 2017-06-08 11:28:10 +02:00
Milan Hanajik f803d27882 More changes, bug fix in ResultsBrowser. 2017-06-08 10:40:52 +02:00
Milan Hanajik 21016a1500 iPerl and iPerlHead separated, iPerl removed (WaterMeter should be used instead). 2017-06-08 09:14:30 +02:00
Milan Hanajik 8a4ad1c2d4 (1) flow calculation for Start/Stop method fixed, (2) iPerl checks the new factor before writing 2017-06-07 16:22:18 +02:00
Milan Hanajik 62e562c245 DB changes : TestRslt table : TestDone, Remark, both FlowMean an FlowMin, ver. 2.14.572 2017-06-07 15:55:47 +02:00
Milan Hanajik d8c389541c Ambient values of a procedure fixed. Mean value calculated using tests times as weights. 2017-06-02 14:48:38 +02:00
Milan Hanajik f13529b339 It is not possible anymore to configure the same FileWriter or ResultsPrinter twice (Torino50 bug fix) 2017-06-01 12:40:03 +02:00
Milan Hanajik 8b195bd6a9 iPerl : signed/unsigned bug-fix : q2CorrRFlow, q2CorrLFlow 2017-06-01 12:39:59 +02:00
Milan Hanajik 082166fc78 Automated renaming of paths and transitions, part 5 (bug fix). 2017-05-30 13:26:44 +02:00
Milan Hanajik be6240bf28 Automated renaming of paths and transitions, parts 2,3,4. 2017-05-29 15:15:03 +02:00
Milan Hanajik c776cbcdf1 Previous results display fixed. 2017-05-25 17:04:13 +02:00
Milan Hanajik 294cc73e36 tstRslt.FlowMin evaluated, saved to Oracle DB only. 2017-05-25 14:06:05 +02:00
Milan Hanajik 3deb24f89a Automated renaming of paths and transition sequences, part 1. 2017-05-25 12:39:24 +02:00
Milan Hanajik 65124248cd Czech BenchControlPanel changes. 2017-05-25 10:39:39 +02:00
Milan Hanajik 750ec031d9 Results items : Tooltips added. 2017-05-24 14:58:35 +02:00
Milan Hanajik 91b750e1a0 On screen results use new style of configuration, part 2: ResultsConfigCtrl added. 2017-05-24 11:35:34 +02:00
Milan Hanajik b92d9f5a9c On screen results use new style of configuration. 2017-05-19 14:41:48 +02:00
Milan Hanajik bcaf1b4830 Old style ResultsPrinters.Basic removed. 2017-05-19 11:25:44 +02:00
Milan Hanajik 71613cba5d Q_ref_mean and many other result items added. 2017-05-19 11:25:24 +02:00
Milan Hanajik d2c21bcca4 Results, ResultsBrowser: iPerl specific results added, Passed item fixed for a water meter (it was correct only for a test). 2017-05-16 19:39:54 +02:00
Milan Hanajik d756af52d8 ver. 2.13.560 2017-05-16 13:22:41 +02:00
Milan Hanajik a6cc2cc325 PETERBURG_200 if/elif/endif-s fixed. 2017-05-16 13:14:44 +02:00
Milan Hanajik ee89de9621 Both components for Peterburg upgraded. 2017-05-16 13:08:45 +02:00
Milan Hanajik e21d9102a2 ComponentsManager: Creation of FlowMeters, TempMeters, PressureMeters, RegisterReaders and WaterMeters from a script file added. 2017-05-16 13:06:48 +02:00
Milan Hanajik c4d736b7cc Bug fix: Missing 'using' for ORACLE_DB 2017-05-16 10:01:08 +02:00
Milan Hanajik 5ed7049900 ComponentsManager : Creation of Valves, RegisterReaders and FixedStartRegisterReaders from a script file. 2017-05-15 14:03:07 +02:00
Milan Hanajik 6f6112a77c ver. 2.13.559 2017-05-12 15:06:54 +02:00
Milan Hanajik cb38a7fe5e ver. 2.13.558 2017-05-11 16:52:02 +02:00
Milan Hanajik 4c1daf55f2 SLM_PT150, PETERBURG_50, PETERBURG_200 symbols, components added, ver. 2.13.557 2017-05-11 16:41:03 +02:00
Milan Hanajik 6cace280c9 SequenceBase.LogProcessDataHeader() added. 2017-05-10 13:54:38 +02:00
Milan Hanajik 847a4d74d6 UpdateTempPressDensAmb(tstRslt) function added to SequenceBase, used by all sequences. 2017-05-10 10:43:33 +02:00
Milan Hanajik 53c3a51b47 German language, etc. 2017-05-10 09:50:16 +02:00
Milan Hanajik b557658760 PrecedureDlg : Protected check box is enabled only for a Metrologist. 2017-05-09 16:55:32 +02:00
Milan Hanajik 7d03fd4674 Procedure.Protected, Procedure.MustBeComplete Procedure.ManualCtrlDisabled, Batch.Dirty and string WaterMeter.Remark added.
ProcedureDlg implements them, ver. 2.13.555.
2017-05-05 22:25:52 +02:00
Milan Hanajik 01ad1993f1 More CoverTest, avoid interference with DataEntry forms, 'bypass' logging. 2017-05-05 22:25:45 +02:00
Milan Hanajik f0140e2bd1 TankDraining sequence conditions added (MettlerToledo scales). 2017-05-05 14:18:49 +02:00
Milan Hanajik ed83ae57c5 Progress bars are not displayed as 'completed' when a test was aborted. 2017-05-05 12:46:37 +02:00
Milan Hanajik e746d0179f BenchControlPanel modifications/layout changes. 2017-05-05 12:46:16 +02:00
Milan Hanajik 6ba2a663b4 More CoverTest (inversion, login dialog when bypasing, default values). 2017-05-05 12:45:25 +02:00
Milan Hanajik 95f14f9879 Bug fixes in: (1) Output.FileWriters, (2) MainSeq and TestProgressControls, more logging in CoverTest. 2017-05-04 22:13:33 +02:00
Milan Hanajik 2933bd24e7 CoverTest introduced. 2017-05-04 17:13:11 +02:00
Milan Hanajik 73eefe6649 Improvement: Prevents to click 'x' on YesNoForm and MessageBoxForm 2017-05-04 16:34:17 +02:00
Milan Hanajik 0f7ff301c4 Output.Printers.Enhanced component added. 2017-05-04 16:34:03 +02:00
Milan Hanajik 17c685148e (1) Flow selection in New Test Wizard extended, (2) MainSeq and BencControlPael modified, etc. 2017-05-03 22:24:25 +02:00
Milan Hanajik 54a6c1e402 ProcedureDlg ROI wizard fixed, creates Roi.ProcedureParams. 2017-05-01 16:03:47 +02:00
Milan Hanajik fa57c51786 ProcedureParams initialization/constructors modified. ProcedureParamsBase modified. 2017-05-01 16:03:45 +02:00
Milan Hanajik 8a9eba9e76 Bug when creating a new Config database fixed. 2017-05-01 11:16:23 +02:00
Milan Hanajik 59392d8bdc MakeSimulated fixed when there are multiple test repetitions, ver. 2.12.555 2017-05-01 10:28:43 +02:00
Milan Hanajik 45d35ec108 'X' button disabled on all DataEntry forms. 2017-04-28 13:04:09 +02:00
Milan Hanajik a773e42fca iPerl type checked after reading Calibration structure. 2017-04-28 12:59:02 +02:00
509 changed files with 20544 additions and 10216 deletions
+2 -4
View File
@@ -75,15 +75,14 @@
<Compile Include="Entities\Group.cs" />
<Compile Include="Entities\HeatMetersPath.cs" />
<Compile Include="Entities\IHasItemNr.cs" />
<Compile Include="Entities\IHasName.cs" />
<Compile Include="Entities\IHasValves.cs" />
<Compile Include="Entities\MeasurementCorrection.cs" />
<Compile Include="Entities\MetersPath.cs" />
<Compile Include="Entities\MeterTestResult.cs" />
<Compile Include="Entities\OutputPath.cs" />
<Compile Include="Entities\Procedure.cs" />
<Compile Include="Entities\ProcedureHistory.cs" />
<Compile Include="Entities\Test.cs" />
<Compile Include="Entities\TestResult.cs" />
<Compile Include="Entities\TransitionSequence.cs" />
<Compile Include="Entities\TransitionStep.cs" />
<Compile Include="Entities\User.cs" />
@@ -101,11 +100,9 @@
<Compile Include="Mappings\HeatMetersPathMap.cs" />
<Compile Include="Mappings\MeasurementCorrectionMap.cs" />
<Compile Include="Mappings\MetersPathMap.cs" />
<Compile Include="Mappings\MeterTestResultMap.cs" />
<Compile Include="Mappings\OutputPathMap.cs" />
<Compile Include="Mappings\ProcedureMap.cs" />
<Compile Include="Mappings\TestMap.cs" />
<Compile Include="Mappings\TestResultMap.cs" />
<Compile Include="Mappings\TransitionSequenceMap.cs" />
<Compile Include="Mappings\TransitionStepMap.cs" />
<Compile Include="Mappings\UserMap.cs" />
@@ -124,6 +121,7 @@
<ItemGroup>
<EmbeddedResource Include="Resources\Strings.cs.resx" />
<EmbeddedResource Include="Resources\Strings.de.resx" />
<EmbeddedResource Include="Resources\Strings.it.resx" />
<EmbeddedResource Include="Resources\Strings.pl.resx" />
<EmbeddedResource Include="Resources\Strings.resx">
<SubType>Designer</SubType>
+4 -4
View File
@@ -20,20 +20,20 @@ namespace Config
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU300 || FUZHOU150 || PT200IL || PUCHONG_PT200 || GENESIS || BERLIN
#elif FUZHOU300 || FUZHOU150 || PT200IL || PUCHONG_PT200 || GENESIS || SLM_150 || PETERSBURG_200
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 3;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif TORINO50 || BADGER_MALA_TRAT
#elif TORINO50 || BADGER_MALA_TRAT || BERLIN
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
#elif TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40
public const int WMsCount = 20;
#elif TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50
public const int WMsCount = 20;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
+5 -4
View File
@@ -1,18 +1,19 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
namespace Config.Entities
{
public class BenchPath : IHasItemNr, IHasValves
public class BenchPath : IHasName, IHasItemNr, IHasValves
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string TempMtrUp { get; set; }
public virtual string TempMtrDown { get; set; }
public virtual string PressMtrUp { get; set; }
+1 -1
View File
@@ -6,7 +6,7 @@ using System.Collections.Generic;
namespace Config.Entities
{
public class Component : IHasItemNr
public class Component : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
+28 -12
View File
@@ -42,16 +42,25 @@ namespace Config.Entities
{
Active,
History,
Template,
Count,
}
/// <summary> Kind of meters for the procedure / test </summary>
public enum MetersKind
{
Single,
Combined,
HeatMeter,
#if LANG_DE
[Description("Wasserzähler")] Single,
[Description("Verbundwasserzähler")] Combined,
[Description("Wärmezähler")] HeatMeter,
#elif LANG_CS
[Description("Vodoměry")] Single,
[Description("Kombinované vodoměry")] Combined,
[Description("Měřiče tepla")] HeatMeter,
#else
[Description("Water meters")] Single,
[Description("Compound water meters")] Combined,
[Description("Heat meters")] HeatMeter,
#endif
}
public enum CompoundMeterId : byte
@@ -158,31 +167,38 @@ namespace Config.Entities
public enum Publish : sbyte
{
#if LANG_DE
/// nemecky
/// german
[Description("nie")] Never = 0,
[Description("immer")] Always = 1,
[Description("Bildschirm")] OnScreen = 2,
[Description("intern")] Internal = 3,
#elif LANG_CS
/// cesky
/// czech
[Description("nikdy")] Never = 0,
[Description("vždy")] Always = 1,
[Description("na obrazovku")] OnScreen = 2,
[Description("interně")] Internal = 3,
#elif LANG_SK
/// slovensky
/// slovak
[Description("nikdy")] Never = 0,
[Description("vždy")] Always = 1,
[Description("na obrazovku")] OnScreen = 2,
[Description("interne")] Internal = 3,
#elif LANG_PL
/// polsky
/// polish
[Description("nigdy")] Never = 0,
[Description("zawsze")] Always = 1,
[Description("na ekranie")] OnScreen = 2,
[Description("wewnętrznie")] Internal = 3,
#elif LANG_RU
/// russian
[Description("никогда")] Never = 0,
[Description("всегда")] Always = 1,
[Description("толька экран")] OnScreen = 2,
[Description("внутренно")] Internal = 3,
#else
[Description("Never")] Never = 0,
/// english
[Description("Never")] Never = 0,
[Description("Always")] Always = 1,
[Description("On screen")] OnScreen = 2,
[Description("Internal")] Internal = 3,
@@ -227,10 +243,11 @@ namespace Config.Entities
public enum Progress
{
JustStarted,
TransitionBefore,
TransitionBefore,
SwitchingFlowDetection,
FlowSetting,
Test,
Aborted, /// Use as an argument when a test was aborted
Test,
TransitionAfter,
Completed,
Count,
@@ -354,4 +371,3 @@ namespace Config.Entities
Count
}
}
+3 -2
View File
@@ -1,16 +1,17 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
namespace Config.Entities
{
public class FeedingPath : IHasItemNr, IHasValves
public class FeedingPath : IHasName, IHasItemNr, IHasValves
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string Pump { get; set; }
+12 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
@@ -10,5 +10,15 @@ namespace Config.Entities
public virtual int Id { get; protected set; }
public virtual int Gid { get; set; }
public virtual string Name { get; set; }
}
public Group()
{
}
public Group(int gid, string name)
{
Gid = gid;
Name = name;
}
}
}
+3 -2
View File
@@ -1,15 +1,16 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
/// Copyright (c) 2016-2017 Sensus Metering Systems
///
using System;
namespace Config.Entities
{
public class HeatMetersPath : IHasItemNr
public class HeatMetersPath : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float TempWarmFrom { get; set; } /// Warm temperature range from [°C]
public virtual float TempWarmTo { get; set; } /// Warm temperature range to [°C]
+11
View File
@@ -0,0 +1,11 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
namespace Config.Entities
{
public interface IHasName
{
int Id { get; }
string Name { get; set; }
}
}
-67
View File
@@ -1,67 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
namespace Config.Entities
{
public class MeterTestResult
{
public virtual int Id { get; protected set; }
public virtual TestResult TestResult { get; set; } /// reference to the TestResult entity
public virtual bool Disabled { get; set; } /// true = this meter was disabled and the results should be disregarded
public virtual string SerialNr { get; set; }
public virtual string EndState { get; set; }
public virtual float VolumeStart { get; set; } /// liter
public virtual float VolumeEnd { get; set; } /// liter
public virtual float VolumeMeter { get; set; } /// liter
public virtual float VolumeRef { get; set; } /// liter
public virtual float VolumeErrorPct { get; set; } /// %
public virtual float PulsesMeter { get; set; } /// # of pulses
public virtual float PulsesPerLiter { get; set; } /// Pulses per liter
public virtual float PulsesMaster { get; set; }
public virtual float Time { get; set; } /// sec.
public virtual float TimeStart { get; set; } /// sec. - Not mapped to DB !!!
public virtual float TimeEnd { get; set; } /// sec. - Not mapped to DB !!!
public virtual int CalibFactor { get; set; } /// iPerl calibration factor used during the test - Not mapped to DB !!!
public virtual double Q2Correction { get; set; } /// iPerl Q2 correction used during the test - Not mapped to DB !!!
public virtual bool Passed { get; set; } /// true=test passed - Not mapped to DB !!!
public MeterTestResult()
{
PulsesPerLiter = 1.0f;
}
public MeterTestResult(TestResult testResult)
: this()
{
TestResult = testResult;
}
public virtual MeterTestResult Clone(TestResult testResult)
{
MeterTestResult result = new MeterTestResult(testResult);
result.Disabled = Disabled;
result.SerialNr = SerialNr;
result.EndState = EndState;
result.VolumeStart = VolumeStart;
result.VolumeEnd = VolumeEnd;
result.VolumeMeter = VolumeMeter;
result.VolumeRef = VolumeRef;
result.VolumeErrorPct = VolumeErrorPct;
result.PulsesMeter = PulsesMeter;
result.PulsesPerLiter = PulsesPerLiter;
result.PulsesMaster = PulsesMaster;
result.Time = Time;
result.TimeStart = TimeStart;
result.TimeEnd = TimeEnd;
result.CalibFactor = CalibFactor;
result.Q2Correction = Q2Correction;
result.Passed = Passed;
return result;
}
}
}
+3 -2
View File
@@ -1,16 +1,17 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
namespace Config.Entities
{
public class MetersPath : IHasItemNr
public class MetersPath : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string OriName { get; set; } /// Not mapped to database
/// Sensors
public virtual string Sensor1 { get; set; }
+3 -2
View File
@@ -1,16 +1,17 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
namespace Config.Entities
{
public class OutputPath : IHasItemNr, IHasValves
public class OutputPath : IHasName, IHasItemNr, IHasValves
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string RegulValve { get; set; }
+66 -11
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -11,7 +11,7 @@ namespace Config.Entities
/// <summary>
/// Stores one test procedure, supports revisions and history log
/// </summary>
public class Procedure : IHasItemNr
public class Procedure : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
@@ -27,11 +27,13 @@ namespace Config.Entities
public virtual ProcedureState ProcedureState { get; set; }
public virtual int Revision { get; set; }
public virtual int PredecessorId { get; set; }
public virtual bool ObtainedByCopy { get; set; }
///
public virtual MetersKind MetersKind { get; set; }
public virtual bool ObtainedByCopy { get; set; } /// Initial version of this procedure was a copy of another procedure
///
public virtual MetersKind MetersKind { get; set; } /// single / compound / heat meters
public virtual string Watermeters { get; set; } /// Water meter name or Id
public virtual string ProtocolTitle { get; set; } /// Title of the printed and saved protocol
public virtual bool Protected { get; set; } /// true = procedure cannot be changed by a testing specialist
public virtual bool MustBeComplete { get; set; } /// true = procedure can be finished just when all tests were finished
public virtual bool ManualCtrlDisabled { get; set; } /// true = manual control of valves, etc. is disabled
public virtual string DataEntry { get; set; } /// Component to use for data entry
public virtual string ResultsPrinter { get; set; } /// Component to use for printing the results
@@ -39,6 +41,9 @@ namespace Config.Entities
public virtual string TransitionStart { get; set; }
public virtual string TransitionEnd { get; set; }
public virtual string AltProcName { get; set; } /// Alternative procedure name (null or string.Empty = no alt. procedure)
public virtual int AltProcPeriod { get; set; } /// Period of alternative procedures (0 = no alt. procedure)
public virtual IList<ComponentProcedure> MoreParams { get; set; }
public virtual IList<Test> Tests { get; set; }
@@ -57,7 +62,9 @@ namespace Config.Entities
LastChgUser = CreationUser;
LastChgTime = CreationTime;
MetersKind = Entities.MetersKind.Single;
ProtocolTitle = "Watermeter test protocol";
Watermeters = string.Empty;
Description = string.Empty;
LongDescription = string.Empty;
}
public Procedure(string name, int itemNr)
@@ -87,8 +94,9 @@ namespace Config.Entities
result.MetersKind = MetersKind;
result.Watermeters = Watermeters;
result.ProtocolTitle = ProtocolTitle;
result.Protected = Protected;
result.MustBeComplete = MustBeComplete;
result.ManualCtrlDisabled = ManualCtrlDisabled;
result.DataEntry = DataEntry;
result.ResultsPrinter = ResultsPrinter;
result.ResultsWriter = ResultsWriter;
@@ -112,7 +120,9 @@ namespace Config.Entities
output.WriteLine(LastChgTime.ToString(CultureInfo.InvariantCulture));
output.WriteLine(MetersKind.ToString());
output.WriteLine(Watermeters);
output.WriteLine(ProtocolTitle);
output.WriteLine(Protected.ToString());
output.WriteLine(MustBeComplete.ToString());
output.WriteLine(ManualCtrlDisabled.ToString());
output.WriteLine(DataEntry);
output.WriteLine(ResultsPrinter);
output.WriteLine(ResultsWriter);
@@ -142,7 +152,9 @@ namespace Config.Entities
string line = input.ReadLine();
result.MetersKind = line.Equals(MetersKind.Single.ToString()) ? MetersKind.Single : (line.Equals(MetersKind.Combined.ToString()) ? MetersKind.Combined : MetersKind.HeatMeter);
result.Watermeters = input.ReadLine();
result.ProtocolTitle = input.ReadLine();
result.Protected = bool.Parse(input.ReadLine());
result.MustBeComplete = bool.Parse(input.ReadLine());
result.ManualCtrlDisabled = bool.Parse(input.ReadLine());
result.DataEntry = input.ReadLine();
result.ResultsPrinter = input.ReadLine();
result.ResultsWriter = input.ReadLine();
@@ -170,6 +182,49 @@ namespace Config.Entities
return result;
}
public virtual string Compare(StreamReader inp)
{
System.Text.StringBuilder diff = new System.Text.StringBuilder();
const string fmt = "{0} = {1}\r\n (in the file {2})\r\n";
string ln;
ln = inp.ReadLine(); /// skip ItemNr
ln = inp.ReadLine(); if (ln != Name) { diff.AppendFormat(fmt, "Name", Name, ln); };
ln = inp.ReadLine(); if (ln != Description) { diff.AppendFormat(fmt, "Description", Description, ln); };
ln = inp.ReadLine(); /// skip CreationUser
ln = inp.ReadLine(); /// skip CreationTime
ln = inp.ReadLine(); /// skip LastChgUser
ln = inp.ReadLine(); /// skip LastChgTime
ln = inp.ReadLine(); if (ln != MetersKind.ToString()) { diff.AppendFormat(fmt, "MetersKind", MetersKind, ln); };
ln = inp.ReadLine(); if (ln != Watermeters) { diff.AppendFormat(fmt, "Watermeters", Watermeters, ln); };
ln = inp.ReadLine(); if (ln != Protected.ToString()) { diff.AppendFormat(fmt, "Protected", Protected, ln); };
ln = inp.ReadLine(); if (ln != MustBeComplete.ToString()) { diff.AppendFormat(fmt, "MustBeComplete", MustBeComplete, ln); };
ln = inp.ReadLine(); if (ln != ManualCtrlDisabled.ToString()) { diff.AppendFormat(fmt, "ManualCtrlDisabled", ManualCtrlDisabled, ln); };
ln = inp.ReadLine(); if (ln != DataEntry) { diff.AppendFormat(fmt, "DataEntry", DataEntry, ln); };
ln = inp.ReadLine(); if (ln != ResultsPrinter) { diff.AppendFormat(fmt, "ResultsPrinter", ResultsPrinter, ln); };
ln = inp.ReadLine(); if (ln != ResultsWriter) { diff.AppendFormat(fmt, "ResultsWriter", ResultsWriter, ln); };
ln = inp.ReadLine(); if (ln != TransitionStart) { diff.AppendFormat(fmt, "TransitionStart", TransitionStart, ln); };
ln = inp.ReadLine(); if (ln != TransitionEnd) { diff.AppendFormat(fmt, "TransitionEnd", TransitionEnd, ln); };
/// TODO Compare componentprocedure-s
while (ComponentProcedure.Import(inp, null) != null)
{
}
//foreach (var test in Tests)
//{
// string testDiff = test.Compare(inp);
// if (testDiff.Contains(
//}
//bool extraTestsInFile = true;
//while (Test.Import(inp, null) != null) { extraTestsInFile = true; }
return diff.ToString();
}
public override string ToString()
{
return string.Format("{0}, rev.{1}", Name, Revision);
+134 -65
View File
@@ -11,26 +11,29 @@ namespace Config.Entities
/// <summary>
/// Test, consisting of one or more repetitions of the test 'SingleTest'.
/// </summary>
public class Test : IHasItemNr
public class Test : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual int Part { get; set; } /// Part=0 ... test of all WM-s
/// Part>0 ... part of a set of tests with the same Name: subset of WM-s is given by MetersPath
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool Evaluate { get; set; }
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h]
public virtual float Qto { get; set; } /// Water flow high limit in [m3/h]
public virtual float Volume { get; set; } /// Test volume (target) in [l]
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
public virtual int Part { get; set; } /// Part=0 ... test of all WM-s
/// Part>0 ... part of a set of tests with the same Name: subset of WM-s is given by MetersPath
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool DoEvaluate { get; set; }
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h]
public virtual float Qto { get; set; } /// Water flow high limit in [m3/h]
public virtual float Volume { get; set; } /// Test volume (target) in [l]
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
public virtual string Method { get; set; }
public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0)
public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0)
public virtual float Uncertainty { get; set; } /// int [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0)
public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0)
public virtual float Uncertainty { get; set; } /// int [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual int Repeats { get; set; }
public virtual bool Draining { get; set; }
public virtual bool Zeroing { get; set; }
public virtual bool DoDraining { get; set; }
public virtual bool DoZeroing { get; set; }
public virtual bool DoControlWaterTemp { get; set; }
public virtual float TempLimLo { get; set; } /// Lower limit for the controlled temperature
public virtual float TempLimHi { get; set; } /// Upper limit for the controlled temperature
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
public virtual int MassRepeats { get; set; } /// Number of mass. measurements at the beginning/end of test, 0 = default (=5)
public virtual float MassSpread { get; set; } /// Max spread of mass. measurements at the beginning/end of test, 0 = default
@@ -67,10 +70,13 @@ namespace Config.Entities
/// Default values
///
Publish = (sbyte)Config.Entities.Publish.Always;
Evaluate = true;
DoEvaluate = true;
Repeats = 1;
Draining = false;
Zeroing = false;
DoDraining = false;
DoZeroing = false;
DoControlWaterTemp = false;
TempLimLo = 15.0f;
TempLimHi = 25.0f;
ErrLimLo = -2.0f; /// [%] lower error limit
ErrLimHi = 2.0f; /// [%] upper error limit
Uncertainty = 0;
@@ -104,14 +110,17 @@ namespace Config.Entities
result.Part = Part;
result.Publish = Publish;
result.Evaluate = Evaluate;
result.DoEvaluate = DoEvaluate;
result.Qfrom = Qfrom;
result.Qto = Qto;
result.Volume = Volume;
result.TstTime = TstTime;
result.Repeats = Repeats;
result.Draining = Draining;
result.Zeroing = Zeroing;
result.DoDraining = DoDraining;
result.DoZeroing = DoZeroing;
result.DoControlWaterTemp = DoControlWaterTemp;
result.TempLimLo = TempLimLo;
result.TempLimHi = TempLimHi;
result.PumpPower = PumpPower;
result.MassRepeats = MassRepeats;
result.MassSpread = MassSpread;
@@ -144,29 +153,34 @@ namespace Config.Entities
public virtual void Export(StreamWriter output)
{
CultureInfo ci = CultureInfo.InvariantCulture;
output.WriteLine(Name);
output.WriteLine(Part.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Publish.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Evaluate.ToString());
output.WriteLine(Qfrom.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Qto.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Volume.ToString(CultureInfo.InvariantCulture));
output.WriteLine(TstTime.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Part.ToString(ci));
output.WriteLine(Publish.ToString(ci));
output.WriteLine(DoEvaluate.ToString());
output.WriteLine(Qfrom.ToString(ci));
output.WriteLine(Qto.ToString(ci));
output.WriteLine(Volume.ToString(ci));
output.WriteLine(TstTime.ToString(ci));
output.WriteLine(Method);
output.WriteLine(ErrLimLo.ToString(CultureInfo.InvariantCulture));
output.WriteLine(ErrLimHi.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Uncertainty.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Repeats.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Draining.ToString());
output.WriteLine(Zeroing.ToString());
output.WriteLine(PumpPower.ToString(CultureInfo.InvariantCulture));
output.WriteLine(MassRepeats.ToString(CultureInfo.InvariantCulture));
output.WriteLine(MassSpread.ToString(CultureInfo.InvariantCulture));
output.WriteLine(((byte)MassMethod).ToString(CultureInfo.InvariantCulture));
output.WriteLine(TimeBeforeFlow.ToString(CultureInfo.InvariantCulture));
output.WriteLine(TimeFlow2Mass.ToString(CultureInfo.InvariantCulture));
output.WriteLine(TimePump2StartV.ToString(CultureInfo.InvariantCulture));
output.WriteLine(TimeStop2Mass.ToString(CultureInfo.InvariantCulture));
output.WriteLine(ErrLimLo.ToString(ci));
output.WriteLine(ErrLimHi.ToString(ci));
output.WriteLine(Uncertainty.ToString(ci));
output.WriteLine(Repeats.ToString(ci));
output.WriteLine(DoDraining.ToString());
output.WriteLine(DoZeroing.ToString());
output.WriteLine(DoControlWaterTemp.ToString());
output.WriteLine(TempLimLo.ToString(ci));
output.WriteLine(TempLimHi.ToString(ci));
output.WriteLine(PumpPower.ToString(ci));
output.WriteLine(MassRepeats.ToString(ci));
output.WriteLine(MassSpread.ToString(ci));
output.WriteLine(((byte)MassMethod).ToString(ci));
output.WriteLine(TimeBeforeFlow.ToString(ci));
output.WriteLine(TimeFlow2Mass.ToString(ci));
output.WriteLine(TimePump2StartV.ToString(ci));
output.WriteLine(TimeStop2Mass.ToString(ci));
output.WriteLine(FeedingPath);
output.WriteLine(BenchPath);
output.WriteLine(OutputPath);
@@ -183,33 +197,40 @@ namespace Config.Entities
public static Test Import(StreamReader input, Procedure newProcedure)
{
string firstLine = input.ReadLine();
if (string.IsNullOrEmpty(firstLine))
{
return null;
}
if (string.IsNullOrEmpty(firstLine)) return null;
CultureInfo ci = CultureInfo.InvariantCulture;
Test tst = new Test();
tst.Name = firstLine;
tst.Part = int.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.Publish = sbyte.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.Evaluate = bool.Parse(input.ReadLine());
tst.Qfrom = float.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.Qto = float.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.Volume = float.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.TstTime = float.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.Part = int.Parse(input.ReadLine(), ci);
tst.Publish = sbyte.Parse(input.ReadLine(), ci);
tst.DoEvaluate = bool.Parse(input.ReadLine());
tst.Qfrom = float.Parse(input.ReadLine(), ci);
tst.Qto = float.Parse(input.ReadLine(), ci);
tst.Volume = float.Parse(input.ReadLine(), ci);
tst.TstTime = float.Parse(input.ReadLine(), ci);
tst.Method = input.ReadLine();
tst.ErrLimLo = float.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.ErrLimHi = float.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.Uncertainty = float.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.Repeats = int.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.Draining = bool.Parse(input.ReadLine());
tst.Zeroing = bool.Parse(input.ReadLine());
tst.PumpPower = float.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.MassRepeats = int.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.MassSpread = float.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.MassMethod = (MassMethod)byte.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.TimeBeforeFlow = int.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.TimeFlow2Mass = int.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.TimePump2StartV = int.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.TimeStop2Mass = int.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.ErrLimLo = float.Parse(input.ReadLine(), ci);
tst.ErrLimHi = float.Parse(input.ReadLine(), ci);
tst.Uncertainty = float.Parse(input.ReadLine(), ci);
tst.Repeats = int.Parse(input.ReadLine(), ci);
tst.DoDraining = bool.Parse(input.ReadLine());
tst.DoZeroing = bool.Parse(input.ReadLine());
tst.DoControlWaterTemp = bool.Parse(input.ReadLine());
tst.TempLimLo = float.Parse(input.ReadLine(), ci);
tst.TempLimHi = float.Parse(input.ReadLine(), ci);
tst.PumpPower = float.Parse(input.ReadLine(), ci);
tst.MassRepeats = int.Parse(input.ReadLine(), ci);
tst.MassSpread = float.Parse(input.ReadLine(), ci);
tst.MassMethod = (MassMethod)byte.Parse(input.ReadLine(), ci);
tst.TimeBeforeFlow = int.Parse(input.ReadLine(), ci);
tst.TimeFlow2Mass = int.Parse(input.ReadLine(), ci);
tst.TimePump2StartV = int.Parse(input.ReadLine(), ci);
tst.TimeStop2Mass = int.Parse(input.ReadLine(), ci);
tst.FeedingPath = input.ReadLine();
tst.BenchPath = input.ReadLine();
tst.OutputPath = input.ReadLine();
@@ -232,11 +253,59 @@ namespace Config.Entities
return tst;
}
public virtual string Compare(StreamReader inp)
{
System.Text.StringBuilder diff = new System.Text.StringBuilder();
string fmt = string.Format("Test {0} : ", Name) + "{0} = {1}\r\n (in the file {2})\r\n";
string ln;
CultureInfo ci = CultureInfo.InvariantCulture;
string firstLine = inp.ReadLine();
if (string.IsNullOrEmpty(firstLine)) return string.Format("Test {0} is missing in the file\r\n", Name);
if (Name != firstLine) { diff.AppendFormat(fmt, "Name", Name, firstLine); };
ln = inp.ReadLine(); if (ln != Part.ToString(ci)) { diff.AppendFormat(fmt, "Part", Part.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Publish.ToString(ci)) { diff.AppendFormat(fmt, "Publish", Publish.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoEvaluate.ToString(ci)) { diff.AppendFormat(fmt, "Evaluate", DoEvaluate.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Qfrom.ToString(ci)) { diff.AppendFormat(fmt, "Qfrom", Qfrom.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Qto.ToString(ci)) { diff.AppendFormat(fmt, "Qto", Qto.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Volume.ToString(ci)) { diff.AppendFormat(fmt, "Volume", Volume.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TstTime.ToString(ci)) { diff.AppendFormat(fmt, "TstTime", TstTime.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Method) { diff.AppendFormat(fmt, "Method", Method, ln); };
ln = inp.ReadLine(); if (ln != ErrLimLo.ToString(ci)) { diff.AppendFormat(fmt, "ErrLimLo", ErrLimLo.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != ErrLimHi.ToString(ci)) { diff.AppendFormat(fmt, "ErrLimHi", ErrLimHi.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Uncertainty.ToString(ci)) { diff.AppendFormat(fmt, "Uncertainty", Uncertainty.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Repeats.ToString(ci)) { diff.AppendFormat(fmt, "Repeats", Repeats.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoDraining.ToString(ci)) { diff.AppendFormat(fmt, "Draining", DoDraining.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoZeroing.ToString(ci)) { diff.AppendFormat(fmt, "Zeroing", DoZeroing.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoControlWaterTemp.ToString()) { diff.AppendFormat(fmt, "DoControlWaterTemp", DoControlWaterTemp.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TempLimLo.ToString(ci)) { diff.AppendFormat(fmt, "TempLimLo", TempLimLo.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TempLimHi.ToString(ci)) { diff.AppendFormat(fmt, "TempLimHi", TempLimHi.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != PumpPower.ToString(ci)) { diff.AppendFormat(fmt, "PumpPower", PumpPower.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != MassRepeats.ToString(ci)) { diff.AppendFormat(fmt, "MassRepeats", MassRepeats.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != MassSpread.ToString(ci)) { diff.AppendFormat(fmt, "MassSpread", MassSpread.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != ((byte)MassMethod).ToString(ci)) { diff.AppendFormat(fmt, "MassMethod", ((byte)MassMethod).ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TimeBeforeFlow.ToString(ci)) { diff.AppendFormat(fmt, "TimeBeforeFlow", TimeBeforeFlow.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TimeFlow2Mass.ToString(ci)) { diff.AppendFormat(fmt, "TimeFlow2Mass", TimeFlow2Mass.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TimePump2StartV.ToString(ci)) { diff.AppendFormat(fmt, "TimePump2StartV", TimePump2StartV.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TimeStop2Mass.ToString(ci)) { diff.AppendFormat(fmt, "TimeStop2Mass", TimeStop2Mass.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != FeedingPath) { diff.AppendFormat(fmt, "FeedingPath", FeedingPath, ln); };
ln = inp.ReadLine(); if (ln != BenchPath) { diff.AppendFormat(fmt, "BenchPath", BenchPath, ln); };
ln = inp.ReadLine(); if (ln != OutputPath) { diff.AppendFormat(fmt, "OutputPath", OutputPath, ln); };
ln = inp.ReadLine(); if (ln != MetersPath) { diff.AppendFormat(fmt, "MetersPath", MetersPath, ln); };
ln = inp.ReadLine(); if (ln != RelTransBefore) { diff.AppendFormat(fmt, "RelTransBefore", RelTransBefore, ln); };
ln = inp.ReadLine(); if (ln != RelTransBetween) { diff.AppendFormat(fmt, "RelTransBetween", RelTransBetween, ln); };
ln = inp.ReadLine(); if (ln != RelTransAfter) { diff.AppendFormat(fmt, "RelTransAfter", RelTransAfter, ln); };
ln = inp.ReadLine(); if (ln != TransitionAfter) { diff.AppendFormat(fmt, "TransitionAfter", TransitionAfter, ln); };
return diff.ToString();
}
public override string ToString()
{
string partStr = (Part > 0) ? string.Format(", part {0}", Part) : string.Empty;
return string.Format("{0}(P.{1},{2}){3}", Name, ((Publish)Publish).ToString(), Evaluate ? "E" : "-", partStr);
return string.Format("{0}(P.{1},{2}){3}", Name, ((Publish)Publish).ToString(), DoEvaluate ? "E" : "-", partStr);
}
}
}
-176
View File
@@ -1,176 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
namespace Config.Entities
{
public class TestResult
{
public virtual int Id { get; protected set; }
public virtual string Name { get; set; }
public virtual int BatchNr { get; set; }
public virtual string PurchaseOrder { get; set; }
public virtual MetersKind MetersKind { get; set; }
public virtual IList<MeterTestResult> Meters { get; set; }
public virtual IList<MeterTestResult> CombinedMeters { get; set; }
/// Value copied from the procedure (Entities.Procedure)
public virtual string ProcedureName { get; set; }
public virtual string ProtocolTitle { get; set; }
/// Values copied from the test (Entities.Test)
public virtual int TestId { get; set; } /// Test entity ID to distinguish between tests with the same name
public virtual string TestName { get; set; }
public virtual int Part { get; set; }
public virtual bool DoNotEvaluate { get; set; } /// Not mapped to the database
public virtual bool DoNotPublish { get; set; } /// Not mapped to the database
public virtual float Qfrom { get; set; } /// [m3/h] Water flow low limit
public virtual float Qto { get; set; } /// [m3/h] Water flow high limit
public virtual float Volume { get; set; } /// [l] Target test volume
public virtual float TstTime { get; set; } /// [s] Test time estimate
public virtual int Repeats { get; set; }
public virtual bool Emptying { get; set; }
public virtual bool Zeroing { get; set; }
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
public virtual int Time2MassMsrmt { get; set; }
public virtual string Method { get; set; }
public virtual float ErrLimLo { get; set; } /// [%] Lower error limit (usually < 0)
public virtual float ErrLimHi { get; set; } /// [%] Upper error limit (usually > 0)
public virtual float Uncertainty { get; set; } /// [%] Makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
/// To be replaced by the virtual bench component parameters
public virtual string FeedingPath { get; set; }
public virtual string BenchPath { get; set; }
public virtual string OutputPath { get; set; }
public virtual string MetersPath { get; set; }
/// Results
public virtual DateTime TimeStart { get; set; } /// Date and time of the test start
public virtual DateTime TimeEnd { get; set; } /// Date and time of the test end
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
public virtual float AmbientTempAve { get; set; } /// [deg.C] Average ambient air temperature
public virtual float AmbientPressAve { get; set; } /// Average ambient air pressure
public virtual float AmbientHumiAve { get; set; } /// [%] Average ambient air relative humidity
public virtual float PressInAvrg { get; set; } /// [Bar] Input water pressure (average)
public virtual float PressInStart { get; set; } /// [Bar]
public virtual float PressInEnd { get; set; } /// [Bar]
public virtual float PressOutAvrg { get; set; } /// [Bar]
public virtual float PressOutStart { get; set; } /// [Bar]
public virtual float PressOutEnd { get; set; } /// [Bar]
public virtual float TempInAvrg { get; set; } /// [deg.C]
public virtual float TempInStart { get; set; } /// [deg.C]
public virtual float TempInEnd { get; set; } /// [deg.C]
public virtual float TempOutAvrg { get; set; } /// [deg.C]
public virtual float TempOutStart { get; set; } /// [deg.C]
public virtual float TempOutEnd { get; set; } /// [deg.C]
public virtual float TempDivAvrg { get; set; } /// [deg.C]
public virtual float TempDivStart { get; set; } /// [deg.C]
public virtual float TempDivEnd { get; set; } /// [deg.C]
public virtual float MassStartRaw { get; set; } /// [kg]
public virtual float MassStart { get; set; } /// [kg]
public virtual float MassEndRaw { get; set; } /// [kg]
public virtual float MassEnd { get; set; } /// [kg]
public virtual float MassDiff { get; set; } /// [kg]
public virtual float DensityIn { get; set; } /// [kg/m3]
public virtual float DensityOut { get; set; } /// [kg/m3]
public virtual float DensityDiv { get; set; } /// [kg/m3]
public virtual float Buoyancy { get; set; } ///TODO -> map
public virtual float FlowMass { get; set; } /// [kg/h] calculated from conventional true value
public virtual float FlowVolume { get; set; } /// [l/h] calculated from conventional true value
public virtual float VolumeCTV { get; set; } /// [l] Volume conventional true value
public virtual float VolumeMaster { get; set; } /// [l] Volume from the master flow meter
public virtual float Time { get; set; } /// [s] Measurement time in seconds
public virtual float ErrorMaster { get; set; } /// [%]
public virtual float PulsesMaster { get; set; }
public virtual float ConstMaster { get; set; } /// [pls/l] Pulses per liter master flow meter
public virtual float QRise { get; set; } /// Detected Q_rise of a composed meter
public virtual float QFall { get; set; } /// Detected Q_fall of a composed meter
public virtual float TimeDivStart0 { get; set; }
public virtual float TimeDivStart1 { get; set; }
public virtual float TimeDivStart2 { get; set; }
public virtual float TimeDivStart3 { get; set; }
public virtual float TimeDivStart4 { get; set; }
public virtual float TimeDivStart5 { get; set; }
public virtual float TimeDivEnd0 { get; set; }
public virtual float TimeDivEnd1 { get; set; }
public virtual float TimeDivEnd2 { get; set; }
public virtual float TimeDivEnd3 { get; set; }
public virtual float TimeDivEnd4 { get; set; }
public virtual float TimeDivEnd5 { get; set; }
public TestResult()
{
Meters = new List<MeterTestResult>();
CombinedMeters = new List<MeterTestResult>();
}
public TestResult(MetersKind kind)
: this()
{
MetersKind = kind;
if (kind == MetersKind.Single)
{
for (int i = 0; i < Config.Data.WMsCount; i++) Meters.Add(new MeterTestResult(this));
}
else if (kind == MetersKind.Combined)
{
for (int i = 0; i < 2 * Config.Data.CompoundWMsCount; i++) Meters.Add(new MeterTestResult(this));
for (int i = 0; i < Config.Data.CompoundWMsCount; i++) CombinedMeters.Add(new MeterTestResult(this));
}
else if (kind == MetersKind.HeatMeter)
{
/// TODO: Verify if this is OK
for (int i = 0; i < Config.Data.WMsCount; i++) Meters.Add(new MeterTestResult(this));
}
}
public TestResult(Test test, int repetitionNr, MetersKind kind)
: this(kind)
{
if (test.Repeats == 1)
{
Name = test.Name;
}
else
{
Name = string.Format("{0} ({1}/{2})", test.Name, repetitionNr, test.Repeats);
}
RepetitionNr = repetitionNr;
/// Copy test parameters from Entities.Procedure object
ProcedureName = test.Procedure.Name;
ProtocolTitle = test.Procedure.ProtocolTitle;
/// Copy test parameters from Entities.Test object
TestId = test.Id;
TestName = test.Name;
Part = test.Part;
Qfrom = test.Qfrom;
Qto = test.Qto;
Volume = test.Volume;
TstTime = test.TstTime;
Repeats = test.Repeats;
Emptying = test.Draining;
Zeroing = test.Zeroing;
PumpPower = PumpPower;
Time2MassMsrmt = test.TimeStop2Mass;
Method = test.Method;
ErrLimLo = test.ErrLimLo;
ErrLimHi = test.ErrLimHi;
Uncertainty = test.Uncertainty;
FeedingPath = test.FeedingPath;
BenchPath = test.BenchPath;
OutputPath = test.OutputPath;
MetersPath = test.MetersPath;
}
public override string ToString()
{
return string.Format("batch={0}, procedure={1}, test={2}, {3} {4}", BatchNr, ProcedureName, TestName, TimeStart.ToShortDateString(), TimeStart.ToShortTimeString());
}
}
}
+3 -2
View File
@@ -8,12 +8,13 @@ namespace Config.Entities
/// <summary>
/// Stores one transition sequence containing a list of transition steps
/// </summary>
public class TransitionSequence : IHasItemNr
public class TransitionSequence : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; } /// Short description
public virtual string OriName { get; set; } /// Not mapped to database
public virtual string Description { get; set; } /// Short description
public virtual IList<TransitionStep> TransitionSteps { get; set; }
public TransitionSequence()
+21 -2
View File
@@ -6,7 +6,7 @@ using System.Collections.Generic;
namespace Config.Entities
{
public class User //: Users.IUser
public class User
{
public virtual int Id { get; protected set; }
public virtual string UserName { get; set; } /// = name, alias, abbreviation
@@ -20,5 +20,24 @@ namespace Config.Entities
{
Groups = new List<Group>();
}
}
/// <summary>
/// Adds a group to the user.
/// </summary>
/// <param name="group">Group to be added</param>
public virtual void AddGroup(Group group)
{
Groups.Add(group);
}
/// <summary>
/// Encrypts and sets users password.
/// </summary>
/// <param name="password">Unencrypted password</param>
public virtual void SetPassword(string password)
{
Password = Users.Entities.User.getHash(password);
LastPwChange = DateTime.Now;
}
}
}
+3 -2
View File
@@ -6,12 +6,13 @@ using System.Collections.Generic;
namespace Config.Entities
{
public class VirtualBenchSequence : IHasItemNr
public class VirtualBenchSequence : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; } /// Short description
public virtual string OriName { get; set; } /// Not mapped to database
public virtual string Description { get; set; } /// Short description
public virtual IList<VirtualBenchStep> VirtualBenchSteps { get; set; }
public VirtualBenchSequence()
+17 -11
View File
@@ -131,9 +131,15 @@ namespace Config
{
using (var transaction = session.BeginTransaction())
{
session.SaveOrUpdate(obj);
try { transaction.Commit(); }
catch { }
try
{
session.SaveOrUpdate(obj);
transaction.Commit();
}
catch
{
transaction.Rollback();
}
}
}
@@ -171,16 +177,16 @@ namespace Config
///
/// Prepare all groups
///
var testers = new Users.Entities.Group((int)Users.Grp.GID.Testers, Strings.Tester);
var testingSpecialists = new Users.Entities.Group((int)Users.Grp.GID.TestingSpecialists, Strings.Testing_Specialist);
var headOfLab = new Users.Entities.Group((int)Users.Grp.GID.HeadOfLab, Strings.Head_of_Lab);
var maintenanceSpecialists = new Users.Entities.Group((int)Users.Grp.GID.MaintenanceSpecialists, Strings.Maintenance_Specialist);
var metrologists = new Users.Entities.Group((int)Users.Grp.GID.Metrologists, Strings.Metrologist);
var calibrationSpecialists = new Users.Entities.Group((int)Users.Grp.GID.CalibrationSpecialists, Strings.Calibration_Specialist);
var administrators = new Users.Entities.Group((int)Users.Grp.GID.Administrators, Strings.Administrator);
var testers = new Config.Entities.Group((int)Users.Grp.GID.Testers, Strings.Tester);
var testingSpecialists = new Config.Entities.Group((int)Users.Grp.GID.TestingSpecialists, Strings.Testing_Specialist);
var headOfLab = new Config.Entities.Group((int)Users.Grp.GID.HeadOfLab, Strings.Head_of_Lab);
var maintenanceSpecialists = new Config.Entities.Group((int)Users.Grp.GID.MaintenanceSpecialists, Strings.Maintenance_Specialist);
var metrologists = new Config.Entities.Group((int)Users.Grp.GID.Metrologists, Strings.Metrologist);
var calibrationSpecialists = new Config.Entities.Group((int)Users.Grp.GID.CalibrationSpecialists, Strings.Calibration_Specialist);
var administrators = new Config.Entities.Group((int)Users.Grp.GID.Administrators, Strings.Administrator);
/// Create the user 'admin' add his groups
var admin = new Users.Entities.User
var admin = new Config.Entities.User
{
UserName = Data.AdminUsername,
FullName = Strings.Administrator,
-29
View File
@@ -1,29 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Config.Entities;
namespace Config.Mappings
{
class MeterTestResultMap : ClassMap<MeterTestResult>
{
public MeterTestResultMap()
{
Id(x => x.Id);
References(x => x.TestResult);
Map(x => x.Disabled);
Map(x => x.SerialNr);
Map(x => x.EndState);
Map(x => x.VolumeStart);
Map(x => x.VolumeEnd);
Map(x => x.VolumeMeter);
Map(x => x.VolumeRef);
Map(x => x.VolumeErrorPct);
Map(x => x.PulsesMeter);
Map(x => x.PulsesPerLiter);
Map(x => x.PulsesMaster);
Map(x => x.Time);
}
}
}
+9 -2
View File
@@ -28,12 +28,19 @@ namespace Config.Mappings
Map(x => x.MetersKind);
Map(x => x.Watermeters);
Map(x => x.ProtocolTitle);
Map(x => x.DataEntry);
Map(x => x.Protected);
Map(x => x.MustBeComplete);
Map(x => x.ManualCtrlDisabled);
Map(x => x.DataEntry);
Map(x => x.ResultsPrinter);
Map(x => x.ResultsWriter);
Map(x => x.TransitionStart);
Map(x => x.TransitionEnd);
Map(x => x.AltProcName);
Map(x => x.AltProcPeriod);
////Map(x => x.MetrologicalClass);
////HasOne(x => x.WMType);
HasMany(x => x.MoreParams)
+9 -5
View File
@@ -1,6 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Author: Milan Hanajik
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Config.Entities;
@@ -16,15 +15,20 @@ namespace Config.Mappings
Map(x => x.Name);
Map(x => x.Part);
Map(x => x.Publish);
Map(x => x.Evaluate);
Map(x => x.DoEvaluate)
.Column("Evaluate");
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.Volume);
Map(x => x.TstTime);
Map(x => x.Repeats);
Map(x => x.Draining)
Map(x => x.DoDraining)
.Column("Emptying");
Map(x => x.Zeroing);
Map(x => x.DoZeroing)
.Column("Zeroing");
Map(x => x.DoControlWaterTemp);
Map(x => x.TempLimLo);
Map(x => x.TempLimHi);
Map(x => x.PumpPower);
Map(x => x.MassRepeats);
Map(x => x.MassSpread);
-109
View File
@@ -1,109 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Config.Entities;
namespace Config.Mappings
{
class TestResultMap : ClassMap<TestResult>
{
public TestResultMap()
{
Id(x => x.Id);
Map(x => x.Name);
Map(x => x.BatchNr);
Map(x => x.PurchaseOrder);
Map(x => x.MetersKind);
HasMany(x => x.Meters)
.Cascade.All();
HasMany(x => x.CombinedMeters)
.Cascade.All();
Map(x => x.ProcedureName);
Map(x => x.ProtocolTitle);
Map(x => x.TestId);
Map(x => x.TestName);
Map(x => x.Part);
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.Volume);
Map(x => x.TstTime);
Map(x => x.Repeats);
Map(x => x.Emptying);
Map(x => x.Zeroing);
Map(x => x.PumpPower);
Map(x => x.Time2MassMsrmt);
Map(x => x.Method);
Map(x => x.ErrLimLo);
Map(x => x.ErrLimHi);
Map(x => x.Uncertainty);
Map(x => x.FeedingPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.BenchPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.OutputPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.MetersPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.TimeStart);
Map(x => x.TimeEnd);
Map(x => x.RepetitionNr);
Map(x => x.AmbientTempAve);
Map(x => x.AmbientPressAve);
Map(x => x.AmbientHumiAve);
Map(x => x.PressInAvrg);
Map(x => x.PressInStart);
Map(x => x.PressInEnd);
Map(x => x.PressOutAvrg);
Map(x => x.PressOutStart);
Map(x => x.PressOutEnd);
Map(x => x.TempInAvrg);
Map(x => x.TempInStart);
Map(x => x.TempInEnd);
Map(x => x.TempOutAvrg);
Map(x => x.TempOutStart);
Map(x => x.TempOutEnd);
Map(x => x.TempDivAvrg);
Map(x => x.TempDivStart);
Map(x => x.TempDivEnd);
Map(x => x.MassStartRaw);
Map(x => x.MassStart);
Map(x => x.MassEndRaw);
Map(x => x.MassEnd);
Map(x => x.MassDiff);
Map(x => x.DensityIn);
Map(x => x.DensityOut);
Map(x => x.DensityDiv);
Map(x => x.FlowMass); /// from conventional true value
Map(x => x.FlowVolume); /// from conventional true value
Map(x => x.VolumeCTV); /// volume conventional true value
Map(x => x.VolumeMaster); /// volume from the master flow meter
Map(x => x.Time); /// measurement time in seconds
Map(x => x.ErrorMaster);
Map(x => x.PulsesMaster);
Map(x => x.ConstMaster); /// Pulses per liter master flow meter
Map(x => x.QRise);
Map(x => x.QFall);
Map(x => x.TimeDivStart0);
Map(x => x.TimeDivStart1);
Map(x => x.TimeDivStart2);
Map(x => x.TimeDivStart3);
Map(x => x.TimeDivStart4);
Map(x => x.TimeDivStart5);
Map(x => x.TimeDivEnd0);
Map(x => x.TimeDivEnd1);
Map(x => x.TimeDivEnd2);
Map(x => x.TimeDivEnd3);
Map(x => x.TimeDivEnd4);
Map(x => x.TimeDivEnd5);
}
}
}
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.12.537.0")]
[assembly: AssemblyFileVersion("2.12.537.0")]
[assembly: AssemblyVersion("2.14.595.0")]
[assembly: AssemblyFileVersion("2.14.595.0")]
+153
View File
@@ -0,0 +1,153 @@
<?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>
<data name="Administrator" xml:space="preserve">
<value>Amministratore</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>esperto in calibrazione</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>capo di laboratorio</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>esperto di manutenzione</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>metrologo</value>
</data>
<data name="Tester" xml:space="preserve">
<value>tester</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>esperto di prove </value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
<data name="Passed" xml:space="preserve">
<value>ok</value>
</data>
<data name="Cannot_open_DB_Cause_0" xml:space="preserve">
<value>Impossibile aprire il database\\r\\nCause:\\r\\n{0}</value>
</data>
<data name="Error" xml:space="preserve">
<value>Errore</value>
</data>
</root>
+3 -2
View File
@@ -29,7 +29,7 @@ namespace Results
public static BatchResults NewFromProcedure(int batchNr, int benchId, string user, int userNr, string programVer,
Config.Entities.Procedure procedure,
WaterMeterData[] waterMeterDatas, int[] waterMeterParts)
WaterMeterData[] waterMeterDatas, int[] waterMeterParts, double densityCorr)
{
BatchResults d = new BatchResults(waterMeterDatas.Length);
int year = DateTime.Now.Year;
@@ -46,8 +46,9 @@ namespace Results
ProcedureDescription = procedure.Description,
WatermetersStr = procedure.Watermeters,
ProcedureRevision = procedure.Revision,
ProtocolTitle = procedure.ProtocolTitle,
ProtocolTitle = string.Empty,
StartTime = DateTime.Now,
DensityCorr = (float)densityCorr,
Compound = (procedure.MetersKind == Config.Entities.MetersKind.Combined),
#if HEAT_METERS
HeatMeter = (procedure.MetersKind == Config.Entities.MetersKind.HeatMeter),
+70 -21
View File
@@ -20,12 +20,13 @@ namespace Results.Entities
public virtual string WatermetersStr { get; set; } /// CEVAK, not mapped to DB
public virtual string ProtocolTitle { get; set; }
public virtual string Remark { get; set; }
public virtual float Custom1 { get; set; }
public virtual float DensityCorr { get; set; } /// Density correction in [kg/m3]
public virtual float Custom2 { get; set; }
public virtual float Custom3 { get; set; }
public virtual DateTime StartTime { get; set; }
public virtual DateTime EndTime { get; set; }
public virtual bool RsltsSent { get; set; }
public virtual bool Dirty { get; set; }
public virtual bool RsltsSent { get; set; }
public virtual bool RsltsPrinted { get; set; }
public virtual IList<TestData> Tests { get; set; }
public virtual IList<WaterMeter> WaterMeters { get; set; }
@@ -40,29 +41,77 @@ namespace Results.Entities
TestRslts = new List<TestRslt>();
}
public virtual float AmbientTempAve()
public virtual double AmbTempMean()
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
foreach (var tr in TestRslts) sum += tr.AmbTempMean;
return sum / TestRslts.Count;
}
double timeSum = 0;
double sum = 0;
public virtual float AmbientPressAve()
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
foreach (var tr in TestRslts) sum += tr.AmbPressMean;
return sum / TestRslts.Count;
}
foreach (var tr in TestRslts)
{
if (tr.TestDone)
{
double duration = (tr.EndTime - tr.StartTime).TotalSeconds;
timeSum += duration;
sum += (tr.AmbTempMean * duration);
}
}
public virtual float AmbientHumiAve()
return (timeSum == 0) ? 0 : (sum / timeSum);
}
public virtual double AmbPressMean()
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
foreach (var tr in TestRslts) sum += tr.AmbHumiMean;
return sum / TestRslts.Count;
}
double timeSum = 0;
double sum = 0;
foreach (var tr in TestRslts)
{
if (tr.TestDone)
{
double duration = (tr.EndTime - tr.StartTime).TotalSeconds;
timeSum += duration;
sum += (tr.AmbPressMean * duration);
}
}
return (timeSum == 0) ? 0 : (sum / timeSum);
}
public virtual double AmbHumiMean()
{
double timeSum = 0;
double sum = 0;
foreach (var tr in TestRslts)
{
if (tr.TestDone)
{
double duration = (tr.EndTime - tr.StartTime).TotalSeconds;
timeSum += duration;
sum += (tr.AmbHumiMean * duration);
}
}
return (timeSum == 0) ? 0 : (sum / timeSum);
}
public virtual double Buoyancy()
{
double timeSum = 0;
double sum = 0;
foreach (var tr in TestRslts)
{
if (tr.TestData.Evaluate && tr.TestDone)
{
double duration = (tr.EndTime - tr.StartTime).TotalSeconds;
timeSum += duration;
sum += (tr.Buoyancy * duration);
}
}
return (timeSum == 0) ? 0 : (sum / timeSum);
}
public virtual TestRslt GetTestRslt(string name, int part)
{
+12
View File
@@ -65,6 +65,13 @@ namespace Results.Entities
public virtual WaterMeterData WaterMeterData() { return WaterMeter.WaterMeterData; }
public virtual Batch Batch() { return WaterMeter.Batch; }
public virtual bool IsPilotRslt()
{
return (CompoundMeterId == (byte)Config.Entities.CompoundMeterId.Single) ||
(CompoundMeterId == (byte)Config.Entities.CompoundMeterId.Compound) ||
(CompoundMeterId == (byte)Config.Entities.CompoundMeterId.HeatMeterEnergy);
}
public virtual string PassedColorStr()
{
#if PUCHONG_PT200
@@ -108,5 +115,10 @@ namespace Results.Entities
TestDone = src.TestDone;
Passed = src.Passed;
}
public override string ToString()
{
return (TestRslt != null) ? Name() : base.ToString();
}
}
}
+36 -24
View File
@@ -12,19 +12,22 @@ namespace Results.Entities
/// </summary>
public class TestData
{
public virtual int Id { get; protected set; }
public virtual string Name { get; set; }
public virtual int Repeats { get; set; }
public virtual double Qfrom { get; set; } /// [m3/h] flow range low limit
public virtual double Qto { get; set; } /// [m3/h] flow range high limit
public virtual double TargetVolume { get; set; } /// [l] target test volume
public virtual double TargetTime { get; set; } /// [s] target test time
public virtual string Method { get; set; }
public virtual double ErrLimLo { get; set; } /// [%] (usually < 0)
public virtual double ErrLimHi { get; set; } /// [%] (usually > 0)
public virtual double Uncertainty { get; set; } /// [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool Evaluate { get; set; }
public virtual int Id { get; protected set; }
public virtual string Name { get; set; }
public virtual int Repeats { get; set; }
public virtual double Qfrom { get; set; } /// [m3/h] flow range low limit
public virtual double Qto { get; set; } /// [m3/h] flow range high limit
public virtual double TargetVolume { get; set; } /// [l] target test volume
public virtual double TargetTime { get; set; } /// [s] target test time
public virtual string Method { get; set; }
public virtual double ErrLimLo { get; set; } /// [%] (usually < 0)
public virtual double ErrLimHi { get; set; } /// [%] (usually > 0)
public virtual double Uncertainty { get; set; } /// [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual bool DoControlWaterTemp { get; set; }
public virtual float TempLimLo { get; set; }
public virtual float TempLimHi { get; set; }
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool Evaluate { get; set; }
protected TestData()
@@ -36,18 +39,21 @@ namespace Results.Entities
public TestData(Config.Entities.Test test)
: this()
{
Name = test.Name;
Repeats = test.Repeats;
Qfrom = (double)test.Qfrom;
Qto = (double)test.Qto;
Name = test.Name;
Repeats = test.Repeats;
Qfrom = (double)test.Qfrom;
Qto = (double)test.Qto;
TargetVolume = (double)test.Volume;
TargetTime = (double)test.TstTime;
Method = test.Method;
ErrLimLo = (double)test.ErrLimLo;
ErrLimHi = (double)test.ErrLimHi;
Uncertainty = (double)test.Uncertainty;
Publish = test.Publish;
Evaluate = test.Evaluate;
TargetTime = (double)test.TstTime;
Method = test.Method;
ErrLimLo = (double)test.ErrLimLo;
ErrLimHi = (double)test.ErrLimHi;
Uncertainty = (double)test.Uncertainty;
DoControlWaterTemp = test.DoControlWaterTemp;
TempLimLo = test.TempLimLo;
TempLimHi = test.TempLimHi;
Publish = test.Publish;
Evaluate = test.DoEvaluate;
}
@@ -68,6 +74,12 @@ namespace Results.Entities
if (ErrLimLo != td.ErrLimLo) return false;
if (ErrLimHi != td.ErrLimHi) return false;
if (Uncertainty != td.Uncertainty) return false;
if (DoControlWaterTemp != td.DoControlWaterTemp) return false;
if (DoControlWaterTemp)
{
if (TempLimLo != td.TempLimLo) return false;
if (TempLimHi != td.TempLimHi) return false;
}
if (Publish != td.Publish) return false;
if (Evaluate != td.Evaluate) return false;
+13 -7
View File
@@ -17,6 +17,8 @@ namespace Results.Entities
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
/// Main results
public virtual bool TestDone { get; set; }
public virtual string Remark { get; set; }
public virtual DateTime StartTime { get; set; } /// Date and time of the test start
public virtual DateTime EndTime { get; set; } /// Date and time of the test end
public virtual int FlowSetTime { get; set; } /// [s] Measurement time in seconds
@@ -86,10 +88,11 @@ namespace Results.Entities
public virtual float TempDivEnd { get; set; } /// [°C]
public virtual float TempDivMin { get; set; } /// [°C]
public virtual float TempDivMax { get; set; } /// [°C]
public virtual float FlowStart { get; set; } /// [m3/h] minimum flow
public virtual float FlowEnd { get; set; } /// [m3/h] maximum flow
public virtual float FlowMin { get; set; } /// [m3/h] minimum flow
public virtual float FlowMax { get; set; } /// [m3/h] maximum flow
public virtual float FlowMean { get; set; } /// [m3/h] mean flow from the reference flowmeter
public virtual float FlowStart { get; set; } /// [m3/h] flow at the start of test from the reference flowmeter
public virtual float FlowEnd { get; set; } /// [m3/h] flow at the end of test from the reference flowmeter
public virtual float FlowMin { get; set; } /// [m3/h] not mapped to DB
public virtual float FlowMax { get; set; } /// [m3/h]
public virtual float Custom1 { get; set; } /// [°C] T ref hi mean
public virtual float Custom2 { get; set; } /// [°C] T ref hi start
@@ -137,6 +140,8 @@ namespace Results.Entities
Components = src.Components; /// ???
Part = src.Part;
RepetitionNr = src.RepetitionNr;
TestDone = src.TestDone;
Remark = src.Remark;
StartTime = src.StartTime;
EndTime = src.EndTime;
FlowSetTime = src.FlowSetTime;
@@ -202,10 +207,11 @@ namespace Results.Entities
TempDivEnd = src.TempDivEnd;
TempDivMin = src.TempDivMin;
TempDivMax = src.TempDivMax;
FlowStart = src.FlowStart;
FlowMean = src.FlowMean;
FlowStart = src.FlowStart;
FlowEnd = src.FlowEnd;
FlowMin = src.FlowMin;
FlowMax = src.FlowMax;
FlowMin = src.FlowMin;
FlowMax = src.FlowMax;
Custom1 = src.Custom1;
Custom2 = src.Custom2;
Custom3 = src.Custom3;
+49 -1
View File
@@ -1,4 +1,7 @@
using System;
///
/// Copyright (c) 2015-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Text;
using Config.Entities;
@@ -19,6 +22,8 @@ namespace Results.Entities
public virtual double QFall { get; set; } /// [m3/h] detected Q_fall of a composed meter
public virtual bool Passed { get; set; }
public virtual int ResultCode { get; set; }
public virtual string ArchivePath { get; set; }
public virtual string Remark { get; set; }
#if IPERL
public virtual int SerialNrEx { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
@@ -33,6 +38,7 @@ namespace Results.Entities
public virtual double Diff2Hz8Hz { get; set; }
public virtual bool Hz2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
public virtual int Hz2Correction { get; set; } /// iPerl Q2 correction used during the test
public virtual string FWVersion { get; set; }
#endif
#if ORACLE_DB
public virtual int Pruefindex { get; set; } /// Not mapped to DB !!! 0=unknown (saving to Oracle failed), >=1 ... pruefindex
@@ -87,6 +93,31 @@ namespace Results.Entities
return passed;
}
public virtual bool CompletedFromTests()
{
bool completed = true;
foreach (var mtr in MeterTestRslts)
{
if (mtr.Evaluate() && !mtr.TestDone)
{
completed = false;
break;
}
}
return completed;
}
public virtual string PassedColorStr()
{
#if PUCHONG_PT200
return Passed ? "OK|Green" : "NG|Red";
#else
return Passed ? "OK|Green" : "NOK|Red";
#endif
}
///
/// Not mapped to the database
///
@@ -100,7 +131,9 @@ namespace Results.Entities
public virtual MeterTestRslt GetMeterTestRslt(string testName, Config.Entities.CompoundMeterId meterId)
{
if (string.IsNullOrEmpty(testName)) return null;
if (Disabled) return null;
string testNameL = testName.ToLower();
foreach (var mtr in MeterTestRslts)
{
@@ -132,6 +165,18 @@ namespace Results.Entities
return null;
}
public virtual TestData GetTestData(string testName)
{
foreach (var mtr in MeterTestRslts)
{
if (mtr.TestRslt.TestData.Name == testName)
{
return mtr.TestRslt.TestData;
}
}
return null;
}
/// <summary>
@@ -158,6 +203,8 @@ namespace Results.Entities
QFall = src.QFall;
Passed = src.Passed;
ResultCode = src.ResultCode;
ArchivePath = src.ArchivePath;
Remark = src.Remark;
#if IPERL
SerialNrEx = src.SerialNrEx;
OrigCalibFactor = src.OrigCalibFactor;
@@ -171,6 +218,7 @@ namespace Results.Entities
Diff2Hz8Hz = src.Diff2Hz8Hz;
Hz2CorrectionDone = src.Hz2CorrectionDone;
Hz2Correction = src.Hz2Correction;
FWVersion = src.FWVersion;
#endif
#if ORACLE_DB
Pruefindex = src.Pruefindex;
+59 -89
View File
@@ -27,8 +27,9 @@ namespace Results.Forms
public TestsArrangement TestsArrangement;
public int NrMetersInOneGroup;
public IList<Results.ItemSpec> RsltItems_Screen_SingleWM;
public IList<Results.ItemSpec> RsltItems_Screen_CombinedWM;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_SingleWM;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_CombinedWM;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_HeatM;
public int[] RsltsClmnWidths { set { rsltsClmnWidths = value; } }
public int PopupResultsLeft;
@@ -42,7 +43,7 @@ namespace Results.Forms
/// Private members
///
Results.BatchResults results;
bool compound;
MetersKind metersKind;
ListView firstListView;
public int[] rsltsClmnWidths;
@@ -87,6 +88,23 @@ namespace Results.Forms
}
IList<Results.WMeterRsltItemSpec> GetRsltItems(MetersKind metersKind)
{
IList<Results.WMeterRsltItemSpec> srcItems;
switch (metersKind)
{
default:
case MetersKind.Single: srcItems = RsltItems_Screen_SingleWM; break;
case MetersKind.Combined: srcItems = RsltItems_Screen_CombinedWM; break;
case MetersKind.HeatMeter: srcItems = RsltItems_Screen_HeatM; break;
}
IList<Results.WMeterRsltItemSpec> copiedItems = new List<Results.WMeterRsltItemSpec>();
foreach (var it in srcItems) copiedItems.Add(it.Clone());
return copiedItems;
}
/// <summary>
/// Re-draw the results. Apply new settings if they changed.
/// </summary>
@@ -109,7 +127,7 @@ namespace Results.Forms
}
int metersInOneGroup = Math.Max(1, Math.Min(enabledWMsCount, NrMetersInOneGroup));
int nrGroups = Math.Max(1, (enabledWMsCount + NrMetersInOneGroup - 1) / metersInOneGroup);
int nrGroups = Math.Max(1, (enabledWMsCount + metersInOneGroup - 1) / metersInOneGroup);
if (MetersArrangement == MetersArrangement.Horizontally)
{
@@ -191,10 +209,8 @@ namespace Results.Forms
foreach (var mtr in wMtr.MeterTestRslts)
{
if ((mtr.CompoundMeterId == (byte)CompoundMeterId.Single || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
&& mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
if (mtr.IsPilotRslt() && mtr.TestDone && (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
{
testNames.Add(mtr.Name());
}
@@ -211,20 +227,21 @@ namespace Results.Forms
/// <returns>ListView object</returns>
ListView GetResultsTestsAreRows(Results.Entities.WaterMeter wMtr, int printedWMNr)
{
compound = wMtr.Compound();
metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single);
ListView lview = GetListView();
IList<Results.ItemSpec> items = (compound ? RsltItems_Screen_CombinedWM : RsltItems_Screen_SingleWM);
IList<Results.WMeterRsltItemSpec> items = GetRsltItems(metersKind);
if (items == null || items.Count == 0) return lview;
// Header
lview.Columns.Add(printedWMNr.ToString(), (rsltsClmnCount > 0) ? rsltsClmnWidths[0] : 40);
int i = 1;
int col = 1;
foreach (var item in items)
{
lview.Columns.Add(item.ClmnHeaderText, (rsltsClmnCount > i) ? rsltsClmnWidths[i] : 70);
i++;
lview.Columns.Add(item.Caption, (rsltsClmnCount > col) ? rsltsClmnWidths[col] : 70);
col++;
}
@@ -232,29 +249,16 @@ namespace Results.Forms
int ix = 0;
foreach (var mtr in wMtr.MeterTestRslts)
{
if ((mtr.CompoundMeterId == (byte)CompoundMeterId.Single || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
&& mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Config.Entities.Publish.Never
&& mtr.Publish() != Config.Entities.Publish.Internal)
{
ListViewItem lvi = new ListViewItem(testNames[ix++]);
foreach (var item in items)
for (int i = 0; i < items.Count; i++)
{
string str;
if (compound)
{
var main = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
var aux = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
str = (item.CanPrintCompoundMeter && main != null && aux != null)
? item.PrintCombined(main, aux, mtr)
: string.Empty;
}
else
{
str = item.CanPrintSingle ? item.Print(mtr) : string.Empty;
}
string str = items[i].Print(wMtr, mtr.Name());
/// Extract and use color information
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
@@ -288,11 +292,12 @@ namespace Results.Forms
/// <returns>ListView object</returns>
ListView GetResultsTestsAreColumns(Results.Entities.WaterMeter wMtr, int printedWMNr)
{
compound = wMtr.Compound();
metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single);
ListView lview = GetListView();
IList<Results.ItemSpec> items = (compound ? RsltItems_Screen_CombinedWM : RsltItems_Screen_SingleWM);
IList<Results.WMeterRsltItemSpec> items = GetRsltItems(metersKind);
if (items == null || items.Count == 0) return lview;
// Header
@@ -306,69 +311,34 @@ namespace Results.Forms
foreach (var item in items)
{
ListViewItem lvi = new ListViewItem(item.ClmnHeaderText);
if (compound)
ListViewItem lvi = new ListViewItem(item.Caption);
foreach (var mtr in wMtr.MeterTestRslts)
{
foreach (var mtr in wMtr.MeterTestRslts)
if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Config.Entities.Publish.Never &&
mtr.Publish() != Config.Entities.Publish.Internal)
{
if (mtr.CompoundMeterId == (byte)CompoundMeterId.Compound && mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
string str = items[i].Print(wMtr, mtr.Name());
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
var main = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
var aux = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
string str = (item.CanPrintCompoundMeter && main != null && aux != null)
? item.PrintCombined(main, aux, mtr)
: string.Empty;
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
}
}
else
{
foreach (var mtr in wMtr.MeterTestRslts)
{
if (mtr.TestDone && (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
{
string str = !item.CanPrintSingle ? string.Empty : item.Print(mtr);
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
}
}
}
lview.Items.Add(lvi);
}
+257
View File
@@ -0,0 +1,257 @@
namespace Results.Forms
{
partial class ResultsConfigCtrl
{
/// <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.availableTabControl = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.availableByQuantityTreeView = new System.Windows.Forms.TreeView();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.availableByCategoryTreeView = new System.Windows.Forms.TreeView();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.availableAlphabeticTreeView = new System.Windows.Forms.TreeView();
this.downButton = new System.Windows.Forms.Button();
this.upButton = new System.Windows.Forms.Button();
this.selectedResultsListViewEx = new Results.Forms.ListViewEx();
this.removeAllButton = new System.Windows.Forms.Button();
this.removeButton = new System.Windows.Forms.Button();
this.addButton = new System.Windows.Forms.Button();
this.selectedResultsLabel = new System.Windows.Forms.Label();
this.availableResultsLabel = new System.Windows.Forms.Label();
this.availableTabControl.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.SuspendLayout();
//
// availableTabControl
//
this.availableTabControl.Controls.Add(this.tabPage1);
this.availableTabControl.Controls.Add(this.tabPage2);
this.availableTabControl.Controls.Add(this.tabPage3);
this.availableTabControl.Enabled = false;
this.availableTabControl.Location = new System.Drawing.Point(9, 33);
this.availableTabControl.Name = "availableTabControl";
this.availableTabControl.SelectedIndex = 0;
this.availableTabControl.Size = new System.Drawing.Size(206, 453);
this.availableTabControl.TabIndex = 59;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.availableByQuantityTreeView);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(198, 427);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "A...Z";
this.tabPage1.UseVisualStyleBackColor = true;
//
// availableAlphabeticTreeView
//
this.availableByQuantityTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByQuantityTreeView.Location = new System.Drawing.Point(3, 3);
this.availableByQuantityTreeView.Name = "availableAlphabeticTreeView";
this.availableByQuantityTreeView.Size = new System.Drawing.Size(192, 421);
this.availableByQuantityTreeView.TabIndex = 0;
this.availableByQuantityTreeView.DoubleClick += new System.EventHandler(this.availableByQuantityTreeView_DoubleClick);
//
// tabPage2
//
this.tabPage2.Controls.Add(this.availableByCategoryTreeView);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(198, 427);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "by quantity";
this.tabPage2.UseVisualStyleBackColor = true;
//
// availableByQuantityTreeView
//
this.availableByCategoryTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByCategoryTreeView.Location = new System.Drawing.Point(3, 3);
this.availableByCategoryTreeView.Name = "availableByQuantityTreeView";
this.availableByCategoryTreeView.Size = new System.Drawing.Size(192, 421);
this.availableByCategoryTreeView.TabIndex = 0;
this.availableByCategoryTreeView.DoubleClick += new System.EventHandler(this.availableByCategoryTreeView_DoubleClick);
//
// tabPage3
//
this.tabPage3.Controls.Add(this.availableAlphabeticTreeView);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(198, 427);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "by category";
this.tabPage3.UseVisualStyleBackColor = true;
//
// availableByCategoryTreeView
//
this.availableAlphabeticTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableAlphabeticTreeView.Location = new System.Drawing.Point(0, 0);
this.availableAlphabeticTreeView.Name = "availableByCategoryTreeView";
this.availableAlphabeticTreeView.Size = new System.Drawing.Size(198, 427);
this.availableAlphabeticTreeView.TabIndex = 0;
this.availableAlphabeticTreeView.DoubleClick += new System.EventHandler(this.availableAlphabeticTreeView_DoubleClick);
//
// downButton
//
this.downButton.Enabled = false;
this.downButton.Location = new System.Drawing.Point(221, 351);
this.downButton.Name = "downButton";
this.downButton.Size = new System.Drawing.Size(93, 30);
this.downButton.TabIndex = 58;
this.downButton.Text = "Down";
this.downButton.UseVisualStyleBackColor = true;
this.downButton.Click += new System.EventHandler(this.downButton_Click);
//
// upButton
//
this.upButton.Enabled = false;
this.upButton.Location = new System.Drawing.Point(221, 315);
this.upButton.Name = "upButton";
this.upButton.Size = new System.Drawing.Size(93, 30);
this.upButton.TabIndex = 57;
this.upButton.Text = "Up";
this.upButton.UseVisualStyleBackColor = true;
this.upButton.Click += new System.EventHandler(this.upButton_Click);
//
// selectedResultsListViewEx
//
this.selectedResultsListViewEx.AllowColumnReorder = true;
this.selectedResultsListViewEx.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.selectedResultsListViewEx.DoubleClickActivation = false;
this.selectedResultsListViewEx.Enabled = false;
this.selectedResultsListViewEx.FullRowSelect = true;
this.selectedResultsListViewEx.GridLines = true;
this.selectedResultsListViewEx.Location = new System.Drawing.Point(322, 33);
this.selectedResultsListViewEx.Name = "selectedResultsListViewEx";
this.selectedResultsListViewEx.Size = new System.Drawing.Size(594, 453);
this.selectedResultsListViewEx.TabIndex = 56;
this.selectedResultsListViewEx.UseCompatibleStateImageBehavior = false;
this.selectedResultsListViewEx.View = System.Windows.Forms.View.Details;
this.selectedResultsListViewEx.DoubleClick += new System.EventHandler(this.selectedResultsListViewEx_DoubleClick);
//
// removeAllButton
//
this.removeAllButton.Enabled = false;
this.removeAllButton.Location = new System.Drawing.Point(221, 223);
this.removeAllButton.Name = "removeAllButton";
this.removeAllButton.Size = new System.Drawing.Size(94, 30);
this.removeAllButton.TabIndex = 55;
this.removeAllButton.Text = "<< R&emove all";
this.removeAllButton.UseVisualStyleBackColor = true;
this.removeAllButton.Click += new System.EventHandler(this.removeAllButton_Click);
//
// removeButton
//
this.removeButton.Enabled = false;
this.removeButton.Location = new System.Drawing.Point(221, 188);
this.removeButton.Name = "removeButton";
this.removeButton.Size = new System.Drawing.Size(93, 30);
this.removeButton.TabIndex = 54;
this.removeButton.Text = "< &Remove";
this.removeButton.UseVisualStyleBackColor = true;
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
//
// addButton
//
this.addButton.Enabled = false;
this.addButton.Location = new System.Drawing.Point(221, 153);
this.addButton.Name = "addButton";
this.addButton.Size = new System.Drawing.Size(93, 30);
this.addButton.TabIndex = 53;
this.addButton.Text = "&Add >";
this.addButton.UseVisualStyleBackColor = true;
this.addButton.Click += new System.EventHandler(this.addButton_Click);
//
// selectedResultsLabel
//
this.selectedResultsLabel.AutoSize = true;
this.selectedResultsLabel.Location = new System.Drawing.Point(321, 11);
this.selectedResultsLabel.Name = "selectedResultsLabel";
this.selectedResultsLabel.Size = new System.Drawing.Size(85, 13);
this.selectedResultsLabel.TabIndex = 52;
this.selectedResultsLabel.Text = "Selected results:";
//
// availableResultsLabel
//
this.availableResultsLabel.AutoSize = true;
this.availableResultsLabel.Location = new System.Drawing.Point(11, 11);
this.availableResultsLabel.Name = "availableResultsLabel";
this.availableResultsLabel.Size = new System.Drawing.Size(86, 13);
this.availableResultsLabel.TabIndex = 51;
this.availableResultsLabel.Text = "Available results:";
//
// ResultsConfigCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.availableTabControl);
this.Controls.Add(this.downButton);
this.Controls.Add(this.upButton);
this.Controls.Add(this.selectedResultsListViewEx);
this.Controls.Add(this.removeAllButton);
this.Controls.Add(this.removeButton);
this.Controls.Add(this.addButton);
this.Controls.Add(this.selectedResultsLabel);
this.Controls.Add(this.availableResultsLabel);
this.Name = "ResultsConfigCtrl";
this.Size = new System.Drawing.Size(925, 496);
this.Load += new System.EventHandler(this.ResultsConfigCtrl_Load);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.ResultsConfigCtrl_KeyPress);
this.availableTabControl.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TabControl availableTabControl;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TreeView availableByQuantityTreeView;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TreeView availableByCategoryTreeView;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TreeView availableAlphabeticTreeView;
private System.Windows.Forms.Button downButton;
private System.Windows.Forms.Button upButton;
private ListViewEx selectedResultsListViewEx;
private System.Windows.Forms.Button removeAllButton;
private System.Windows.Forms.Button removeButton;
private System.Windows.Forms.Button addButton;
private System.Windows.Forms.Label selectedResultsLabel;
private System.Windows.Forms.Label availableResultsLabel;
}
}
+511
View File
@@ -0,0 +1,511 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Config.Entities;
using Results.Resources;
namespace Results.Forms
{
public partial class ResultsConfigCtrl : UserControl
{
/// <summary>
/// ListViewEx columns
/// </summary>
enum Column
{
Item,
Caption,
Units,
Format,
Precision,
Width,
Alignment,
TestID,
Count,
}
Control[] editors; /// all editors except of units
ComboBox unitsCB; /// units combo box
public MetersKind MetersKind;
public IList<WMeterRsltItemSpec> SelectedItems;
public bool SupressTestIDColumn;
public bool Unlocked
{
set
{
availableTabControl.Enabled = value;
selectedResultsListViewEx.Enabled = value;
addButton.Enabled = value;
removeButton.Enabled = value;
removeAllButton.Enabled = value;
upButton.Enabled = value;
downButton.Enabled = value;
unlocked = value;
}
get { return unlocked; }
}
bool unlocked;
public ResultsConfigCtrl(bool supressTestIDColumn)
: this()
{
this.SupressTestIDColumn = supressTestIDColumn;
}
public ResultsConfigCtrl()
{
InitializeComponent();
}
void Localize()
{
Text = Strings.Configuration;
availableResultsLabel.Text = Strings.Available_results;
availableTabControl.TabPages[0].Text = Strings.Quantity;
availableTabControl.TabPages[1].Text = Strings.Category;
availableTabControl.TabPages[2].Text = "A...Z";
selectedResultsLabel.Text = Strings.Selected_results;
addButton.Text = Strings.Add;
removeButton.Text = Strings.Remove;
removeAllButton.Text = Strings.Remove_all;
upButton.Text = Strings.UpBtnText;
downButton.Text = Strings.DownBtnText;
}
private void ResultsConfigCtrl_Load(object sender, EventArgs e)
{
Localize();
/// Add columns to ListViewEx
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Item, Width = 120 });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Caption });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Units });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Format });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Precision });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Width });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Alignment });
if (!SupressTestIDColumn)
{
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Test_ID });
}
/// Create controls used by ListViewEx to edit items
unitsCB = new ComboBox();
ComboBox alignmentCB = new ComboBox();
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++)
{
alignmentCB.Items.Add(a.ToDescription());
}
editors = new Control[]
{
null,
new TextBox(), /// caption
unitsCB,
new TextBox(), /// format
new TextBox(), /// precision
new TextBox(), /// width
alignmentCB,
new TextBox(), /// testID
};
foreach (var edi in editors)
{
if (edi != null)
{
edi.Visible = false;
Controls.Add(edi);
}
}
selectedResultsListViewEx.SubItemClicked += new SubItemEventHandler(selectedResultsListViewEx_SubItemClicked);
selectedResultsListViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(selectedResultsListViewEx_SubItemEndEditing);
availableByQuantityTreeView.ShowNodeToolTips = true;
availableByCategoryTreeView.ShowNodeToolTips = true;
availableAlphabeticTreeView.ShowNodeToolTips = true;
RedrawAvailable();
RedrawSelected();
}
void selectedResultsListViewEx_SubItemClicked(object sender, SubItemEventArgs e)
{
if (e.SubItem == (int)Column.Units)
{
Config.Quantity quantity = (e.Item.Tag as WMeterRsltItemSpec).Quantity;
unitsCB.Items.Clear();
unitsCB.Items.Add(Config.Unit.None.ToDescription()); /// "---"
for (Config.Unit u = (Config.Unit)1; u < Config.Unit.Count; u++)
{
if (Config.Units.IsQuantity(u, quantity)) unitsCB.Items.Add(u.ToDescription());
}
selectedResultsListViewEx.StartEditing(unitsCB, e.Item, e.SubItem);
}
else if ((e.SubItem > 0) && (e.SubItem < (int)(SupressTestIDColumn ? Column.TestID : Column.Count)))
{
selectedResultsListViewEx.StartEditing(editors[e.SubItem], e.Item, e.SubItem);
}
}
void selectedResultsListViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e)
{
ListViewItem lvi = e.Item;
WMeterRsltItemSpec item = lvi.Tag as WMeterRsltItemSpec;
switch ((Column)e.SubItem)
{
case Column.Caption: item.Caption = e.DisplayText; return;
case Column.Units:
for (Config.Unit u = 0; u < Config.Unit.Count; u++)
{
if (u.ToDescription().Equals(unitsCB.Text))
{
item.Units = u;
return; /// OK
}
}
break; /// Error
case Column.Format: item.Format = e.DisplayText; return;
case Column.Precision: item.Precision = e.DisplayText; return;
case Column.Width:
{
int width;
if (Int32.TryParse(editors[e.SubItem].Text, out width) && width >= 0)
{
item.Width = width;
return; /// OK
}
break; /// Error
}
case Column.Alignment:
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++)
{
if (a.ToDescription().Equals(editors[e.SubItem].Text))
{
item.Alignment = a;
return;
}
}
break; /// Error
case Column.TestID: item.TestID = e.DisplayText; return;
default:
return; /// OK
}
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
e.Cancel = true;
return;
}
/// <summary>
/// Redraw available items (right hand side)
/// </summary>
void RedrawAvailable()
{
RedrawByQuantity(availableByQuantityTreeView);
RedrawByCategory(availableByCategoryTreeView);
RedrawInAlphabeticOrder(availableAlphabeticTreeView);
}
void RedrawInAlphabeticOrder(TreeView treeView)
{
treeView.Nodes.Clear();
IList<WMeterRsltItemSpec> alphabeticlList = WMeterRsltItemSpec.AllItems.OrderBy(x => x.Name).ToList();
///
foreach (var item in alphabeticlList)
{
TreeNode node = new TreeNode(item.Name);
node.Tag = item;
node.ToolTipText = item.ToolTipText;
treeView.Nodes.Add(node);
}
}
void RedrawByQuantity(TreeView treeView)
{
treeView.Nodes.Clear();
IList<Config.Quantity> quantities = new List<Config.Quantity>();
for (Config.Quantity q = 0; q < Config.Quantity.Count; q++) quantities.Add(q);
IList<Config.Quantity> sortedQuantities = quantities.OrderBy(x => x.ToDescription()).ToList();
foreach (var q in sortedQuantities)
{
int n = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Quantity == q) n++;
}
if (n > 0)
{
TreeNode[] array = new TreeNode[n];
int i = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Quantity == q)
{
TreeNode node = new TreeNode(ri.Name);
node.Tag = ri;
node.ToolTipText = ri.ToolTipText;
array[i++] = node;
}
}
treeView.Nodes.Add(new TreeNode(q.ToDescription(), array));
}
}
}
void RedrawByCategory(TreeView treeView)
{
treeView.Nodes.Clear();
IList<ItemCategory> categories = new List<ItemCategory>();
for (ItemCategory c = 0; c < ItemCategory.Count; c++) categories.Add(c);
IList<ItemCategory> sortedCategories = categories.OrderBy(x => x.ToDescription()).ToList();
foreach (var c in sortedCategories)
{
int n = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Category == c) n++;
}
if (n > 0)
{
TreeNode[] array = new TreeNode[n];
int i = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Category == c)
{
TreeNode node = new TreeNode(ri.Name);
node.Tag = ri;
node.ToolTipText = ri.ToolTipText;
array[i++] = node;
}
}
treeView.Nodes.Add(new TreeNode(c.ToDescription(), array));
}
}
}
/// <summary>
/// Redraw selected items (right hand side)
/// </summary>
void RedrawSelected()
{
selectedResultsListViewEx.Items.Clear();
if (SelectedItems == null) return;
foreach (var item in SelectedItems)
{
ListViewItem lvi = new ListViewItem(item.Name); /// Item
lvi.Tag = item;
lvi.SubItems.Add(item.Caption); /// Header
lvi.SubItems.Add(item.Units.ToDescription()); /// Units
lvi.SubItems.Add(item.Format); /// Format
lvi.SubItems.Add(item.Precision); /// Precision
lvi.SubItems.Add(item.Width.ToString()); /// Width
lvi.SubItems.Add(item.Alignment.ToDescription()); /// Alignment
if (!SupressTestIDColumn)
{
lvi.SubItems.Add(item.TestID); /// TestID
}
selectedResultsListViewEx.Items.Add(lvi);
}
}
void UpdateSelectedFromView()
{
}
void addButton_Click(object sender, EventArgs e)
{
switch (availableTabControl.SelectedIndex)
{
case 0:
availableByQuantityTreeView_DoubleClick(this, null);
break;
case 1:
availableByCategoryTreeView_DoubleClick(this, null);
break;
case 2:
availableAlphabeticTreeView_DoubleClick(this, null);
break;
default:
break;
}
}
private void availableByQuantityTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableByQuantityTreeView.SelectedNode != null &&
availableByQuantityTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableByQuantityTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
private void availableByCategoryTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableByCategoryTreeView.SelectedNode != null &&
availableByCategoryTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableByCategoryTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
private void availableAlphabeticTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableAlphabeticTreeView.SelectedNode != null &&
availableAlphabeticTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableAlphabeticTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
void AddItem(WMeterRsltItemSpec item)
{
WMeterRsltItemSpec newItem = item.Clone();
newItem.Caption = newItem.Name;
SelectedItems.Add(newItem);
RedrawSelected();
/// Select the last item
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[SelectedItems.Count - 1].Selected = true;
selectedResultsListViewEx.Items[SelectedItems.Count - 1].EnsureVisible();
}
private void selectedResultsListViewEx_DoubleClick(object sender, EventArgs e)
{
/// Double click works when just one item is selected
if (selectedResultsListViewEx.SelectedIndices.Count == 1)
{
SelectedItems.RemoveAt(selectedResultsListViewEx.SelectedIndices[0]);
RedrawAvailable();
RedrawSelected();
}
}
void removeButton_Click(object sender, EventArgs e)
{
/// Remove from the list (the last selected item first so that the indexes are not affected)
for (int i = selectedResultsListViewEx.SelectedIndices.Count - 1; i >= 0; i--)
{
SelectedItems.RemoveAt(selectedResultsListViewEx.SelectedIndices[i]);
}
RedrawAvailable();
RedrawSelected();
}
void removeAllButton_Click(object sender, EventArgs e)
{
/// Remove all items from 'Selected' list
SelectedItems.Clear();
RedrawAvailable();
RedrawSelected();
}
//void okButton_Click(object sender, EventArgs e)
//{
// DialogResult = DialogResult.OK;
// Close();
//}
private void ResultsConfigCtrl_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void upButton_Click(object sender, EventArgs e)
{
if (selectedResultsListViewEx.SelectedIndices.Count != 1) return;
int selIdx = selectedResultsListViewEx.SelectedIndices[0];
if (selIdx == 0)
{
/// Cannot move up
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[0].Selected = true;
return;
}
WMeterRsltItemSpec tmp = SelectedItems[selIdx - 1];
SelectedItems[selIdx - 1] = SelectedItems[selIdx];
SelectedItems[selIdx] = tmp;
RedrawSelected();
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[selIdx - 1].Selected = true;
selectedResultsListViewEx.Items[selIdx - 1].EnsureVisible();
}
private void downButton_Click(object sender, EventArgs e)
{
if (selectedResultsListViewEx.SelectedIndices.Count != 1) return;
int selIdx = selectedResultsListViewEx.SelectedIndices[0];
if (selIdx == SelectedItems.Count - 1)
{
/// Cannot move down
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[SelectedItems.Count - 1].Selected = true;
return;
}
WMeterRsltItemSpec tmp = SelectedItems[selIdx + 1];
SelectedItems[selIdx + 1] = SelectedItems[selIdx];
SelectedItems[selIdx] = tmp;
RedrawSelected();
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[selIdx + 1].Selected = true;
selectedResultsListViewEx.Items[selIdx + 1].EnsureVisible();
}
//private void cancelButton_Click(object sender, EventArgs e)
//{
// DialogResult = DialogResult.Cancel;
// Close();
//}
private void availableByCategoryTreeView_NodeMouseHover2(object sender, TreeNodeMouseHoverEventArgs e)
{
ToolTip toolTip = new ToolTip();
toolTip.SetToolTip(this, e.Node.ToolTipText);
}
}
}
+15 -454
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
/// Copyright (c) 2016-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -14,497 +14,58 @@ namespace Results.Forms
{
public partial class ResultsConfigDlg : Form
{
/// <summary>
/// ListViewEx columns
/// </summary>
enum Column
public IList<WMeterRsltItemSpec> SelectedItems
{
Item,
Caption,
Units,
Format,
Precision,
Width,
Alignment,
TestID,
Count,
set { resultsConfigCtrl.SelectedItems = value; }
get { return resultsConfigCtrl.SelectedItems; }
}
Control[] editors; /// all editors except of units
ComboBox unitsCB; /// units combo box
public IList<WMeterRsltItemSpec> AvailableItems;
public IList<WMeterRsltItemSpec> SelectedItems;
public MetersKind MetersKind;
bool supressTestIDColumn;
public MetersKind MetersKind
{
set { resultsConfigCtrl.MetersKind = value; }
}
public ResultsConfigDlg(bool supressTestIDColumn)
: this()
{
this.supressTestIDColumn = supressTestIDColumn;
resultsConfigCtrl.SupressTestIDColumn = supressTestIDColumn;
}
public ResultsConfigDlg()
{
InitializeComponent();
resultsConfigCtrl.Unlocked = true;
}
void Localize()
{
Text = Strings.Configuration;
availableResultsLabel.Text = Strings.Available_results;
availableTabControl.TabPages[0].Text = "A...Z";
availableTabControl.TabPages[1].Text = Strings.Quantity;
availableTabControl.TabPages[2].Text = Strings.Category;
selectedResultsLabel.Text = Strings.Selected_results;
addButton.Text = Strings.Add;
removeButton.Text = Strings.Remove;
removeAllButton.Text = Strings.Remove_all;
okButton.Text = Strings.OkBtnText;
cancelButton.Text = Strings.CancelBtnText;
upButton.Text = Strings.UpBtnText;
downButton.Text = Strings.DownBtnText;
}
void ResultsConfig_Load(object sender, EventArgs e)
{
Localize();
/// Add columns to ListViewEx
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Item, Width = 120 });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Caption });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Units });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Format });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Precision });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Width });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Alignment });
if (!supressTestIDColumn)
{
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Test_ID });
}
/// Create controls used by ListViewEx to edit items
unitsCB = new ComboBox();
ComboBox alignmentCB = new ComboBox();
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++)
{
alignmentCB.Items.Add(a.ToDescription());
}
editors = new Control[]
{
null,
new TextBox(), /// caption
unitsCB,
new TextBox(), /// format
new TextBox(), /// precision
new TextBox(), /// width
alignmentCB,
new TextBox(), /// testID
};
foreach (var edi in editors)
{
if (edi != null)
{
edi.Visible = false;
Controls.Add(edi);
}
}
selectedResultsListViewEx.SubItemClicked += new SubItemEventHandler(selectedResultsListViewEx_SubItemClicked);
selectedResultsListViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(selectedResultsListViewEx_SubItemEndEditing);
//availableAlphabeticTreeView.ShowNodeToolTips = true;
//availableByQuantityTreeView.ShowNodeToolTips = true;
//availableByCategoryTreeView.ShowNodeToolTips = true;
RedrawAvailable();
RedrawSelected();
}
void selectedResultsListViewEx_SubItemClicked(object sender, SubItemEventArgs e)
{
if (e.SubItem == (int)Column.Units)
{
Config.Quantity quantity = (e.Item.Tag as WMeterRsltItemSpec).Quantity;
unitsCB.Items.Clear();
unitsCB.Items.Add(Config.Unit.None.ToDescription()); /// "---"
for (Config.Unit u = (Config.Unit)1; u < Config.Unit.Count; u++)
{
if (Config.Units.IsQuantity(u, quantity)) unitsCB.Items.Add(u.ToDescription());
}
selectedResultsListViewEx.StartEditing(unitsCB, e.Item, e.SubItem);
}
else if ((e.SubItem > 0) && (e.SubItem < (int)(supressTestIDColumn ? Column.TestID : Column.Count)))
{
selectedResultsListViewEx.StartEditing(editors[e.SubItem], e.Item, e.SubItem);
}
}
void selectedResultsListViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e)
{
ListViewItem lvi = e.Item;
WMeterRsltItemSpec item = lvi.Tag as WMeterRsltItemSpec;
switch ((Column)e.SubItem)
{
case Column.Caption: item.Caption = e.DisplayText; return;
case Column.Units:
for (Config.Unit u = 0; u < Config.Unit.Count; u++)
{
if (u.ToDescription().Equals(unitsCB.Text))
{
item.Units = u;
return; /// OK
}
}
break; /// Error
case Column.Format: item.Format = e.DisplayText; return;
case Column.Precision: item.Precision = e.DisplayText; return;
case Column.Width:
{
int width;
if (Int32.TryParse(editors[e.SubItem].Text, out width) && width >= 0)
{
item.Width = width;
return; /// OK
}
break; /// Error
}
case Column.Alignment:
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++)
{
if (a.ToDescription().Equals(editors[e.SubItem].Text))
{
item.Alignment = a;
return;
}
}
break; /// Error
case Column.TestID: item.TestID = e.DisplayText; return;
default:
return; /// OK
}
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
e.Cancel = true;
return;
}
/// <summary>
/// Redraw available items (right hand side)
/// </summary>
void RedrawAvailable()
{
RedrawInAlphabeticOrder(availableAlphabeticTreeView);
RedrawByQuantity(availableByQuantityTreeView);
RedrawByCategory(availableByCategoryTreeView);
}
void RedrawInAlphabeticOrder(TreeView treeView)
{
treeView.Nodes.Clear();
IList<WMeterRsltItemSpec> alphabeticlList = WMeterRsltItemSpec.AllItems.OrderBy(x => x.Name).ToList();
///
foreach (var item in alphabeticlList)
{
TreeNode node = new TreeNode(item.Name);
node.Tag = item;
node.ToolTipText = item.ToolTipText;
availableAlphabeticTreeView.Nodes.Add(node);
}
}
void RedrawByQuantity(TreeView treeView)
{
treeView.Nodes.Clear();
IList<Config.Quantity> quantities = new List<Config.Quantity>();
for (Config.Quantity q = 0; q < Config.Quantity.Count; q++) quantities.Add(q);
IList<Config.Quantity> sortedQuantities = quantities.OrderBy(x => x.ToDescription()).ToList();
foreach (var q in sortedQuantities)
{
int n = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Quantity == q) n++;
}
if (n > 0)
{
TreeNode[] array = new TreeNode[n];
int i = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Quantity == q)
{
TreeNode node = new TreeNode(ri.Name);
node.Tag = ri;
node.ToolTipText = ri.ToolTipText;
array[i++] = node;
}
}
treeView.Nodes.Add(new TreeNode(q.ToDescription(), array));
}
}
}
void RedrawByCategory(TreeView treeView)
{
treeView.Nodes.Clear();
IList<ItemCategory> categories = new List<ItemCategory>();
for (ItemCategory c = 0; c < ItemCategory.Count; c++) categories.Add(c);
IList<ItemCategory> sortedCategories = categories.OrderBy(x => x.ToDescription()).ToList();
foreach (var c in sortedCategories)
{
int n = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Category == c) n++;
}
if (n > 0)
{
TreeNode[] array = new TreeNode[n];
int i = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Category == c)
{
TreeNode node = new TreeNode(ri.Name);
node.Tag = ri;
node.ToolTipText = ri.ToolTipText;
array[i++] = node;
}
}
treeView.Nodes.Add(new TreeNode(c.ToDescription(), array));
}
}
}
/// <summary>
/// Redraw selected items (right hand side)
/// </summary>
void RedrawSelected()
{
selectedResultsListViewEx.Items.Clear();
foreach (var item in SelectedItems)
{
ListViewItem lvi = new ListViewItem(item.Name); /// Item
lvi.Tag = item;
lvi.SubItems.Add(item.Caption); /// Header
lvi.SubItems.Add(item.Units.ToDescription()); /// Units
lvi.SubItems.Add(item.Format); /// Format
lvi.SubItems.Add(item.Precision); /// Precision
lvi.SubItems.Add(item.Width.ToString()); /// Width
lvi.SubItems.Add(item.Alignment.ToDescription()); /// Alignment
if (!supressTestIDColumn)
{
lvi.SubItems.Add(item.TestID); /// TestID
}
selectedResultsListViewEx.Items.Add(lvi);
}
}
void UpdateSelectedFromView()
{
}
void addButton_Click(object sender, EventArgs e)
{
switch (availableTabControl.SelectedIndex)
{
case 0:
availableAlphabeticTreeView_DoubleClick(this, null);
break;
case 1:
availableByQuantityTreeView_DoubleClick(this, null);
break;
case 2:
availableByCategoryTreeView_DoubleClick(this, null);
break;
default:
break;
}
}
private void availableAlphabeticTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableAlphabeticTreeView.SelectedNode != null &&
availableAlphabeticTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableAlphabeticTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
private void availableByQuantityTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableByQuantityTreeView.SelectedNode != null &&
availableByQuantityTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableByQuantityTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
private void availableByCategoryTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableByCategoryTreeView.SelectedNode != null &&
availableByCategoryTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableByCategoryTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
void AddItem(WMeterRsltItemSpec item)
{
WMeterRsltItemSpec newItem = item.Clone();
newItem.Caption = newItem.Name;
SelectedItems.Add(newItem);
RedrawSelected();
/// Select the last item
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[SelectedItems.Count - 1].Selected = true;
selectedResultsListViewEx.Items[SelectedItems.Count - 1].EnsureVisible();
}
private void selectedResultsListBox_DoubleClick(object sender, EventArgs e)
{
/// Double click works when just one item is selected
if (selectedResultsListViewEx.SelectedIndices.Count == 1)
{
SelectedItems.RemoveAt(selectedResultsListViewEx.SelectedIndices[0]);
RedrawAvailable();
RedrawSelected();
}
}
void removeButton_Click(object sender, EventArgs e)
{
/// Remove from the list (the last selected item first so that the indexes are not affected)
for (int i = selectedResultsListViewEx.SelectedIndices.Count - 1; i >= 0; i--)
{
SelectedItems.RemoveAt(selectedResultsListViewEx.SelectedIndices[i]);
}
RedrawAvailable();
RedrawSelected();
}
void removeAllButton_Click(object sender, EventArgs e)
{
/// Remove all items from 'Selected' list
SelectedItems.Clear();
RedrawAvailable();
RedrawSelected();
}
void okButton_Click(object sender, EventArgs e)
void okButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
Close();
}
private void ResultsConfigDlg_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void upButton_Click(object sender, EventArgs e)
{
if (selectedResultsListViewEx.SelectedIndices.Count != 1) return;
int selIdx = selectedResultsListViewEx.SelectedIndices[0];
if (selIdx == 0)
{
/// Cannot move up
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[0].Selected = true;
return;
}
WMeterRsltItemSpec tmp = SelectedItems[selIdx - 1];
SelectedItems[selIdx - 1] = SelectedItems[selIdx];
SelectedItems[selIdx] = tmp;
RedrawSelected();
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[selIdx - 1].Selected = true;
selectedResultsListViewEx.Items[selIdx - 1].EnsureVisible();
}
private void downButton_Click(object sender, EventArgs e)
{
if (selectedResultsListViewEx.SelectedIndices.Count != 1) return;
int selIdx = selectedResultsListViewEx.SelectedIndices[0];
if (selIdx == SelectedItems.Count - 1)
{
/// Cannot move down
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[SelectedItems.Count - 1].Selected = true;
return;
}
WMeterRsltItemSpec tmp = SelectedItems[selIdx + 1];
SelectedItems[selIdx + 1] = SelectedItems[selIdx];
SelectedItems[selIdx] = tmp;
RedrawSelected();
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[selIdx + 1].Selected = true;
selectedResultsListViewEx.Items[selIdx + 1].EnsureVisible();
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
private void tabPage1_Click(object sender, EventArgs e)
{
}
private void availableByCategoryTreeView_NodeMouseHover(object sender, TreeNodeMouseHoverEventArgs e)
{
ToolTip toolTip = new ToolTip();
toolTip.SetToolTip(this, e.Node.ToolTipText);
}
private void ResultsConfigDlg_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
}
}
+16 -211
View File
@@ -31,36 +31,17 @@ namespace Results.Forms
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.availableResultsLabel = new System.Windows.Forms.Label();
this.selectedResultsLabel = new System.Windows.Forms.Label();
this.removeAllButton = new System.Windows.Forms.Button();
this.removeButton = new System.Windows.Forms.Button();
this.addButton = new System.Windows.Forms.Button();
this.upButton = new System.Windows.Forms.Button();
this.downButton = new System.Windows.Forms.Button();
this.availableTabControl = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.availableAlphabeticTreeView = new System.Windows.Forms.TreeView();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.availableByQuantityTreeView = new System.Windows.Forms.TreeView();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.availableByCategoryTreeView = new System.Windows.Forms.TreeView();
this.selectedResultsListViewEx = new Results.Forms.ListViewEx();
this.availableTabControl.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.resultsConfigCtrl = new Results.Forms.ResultsConfigCtrl();
this.SuspendLayout();
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(373, 499);
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(939, 29);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(105, 30);
this.okButton.Size = new System.Drawing.Size(105, 42);
this.okButton.TabIndex = 4;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
@@ -68,186 +49,29 @@ namespace Results.Forms
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(494, 499);
this.cancelButton.Location = new System.Drawing.Point(939, 82);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(105, 30);
this.cancelButton.Size = new System.Drawing.Size(105, 42);
this.cancelButton.TabIndex = 5;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// availableResultsLabel
// resultsConfigCtrl
//
this.availableResultsLabel.AutoSize = true;
this.availableResultsLabel.Location = new System.Drawing.Point(12, 9);
this.availableResultsLabel.Name = "availableResultsLabel";
this.availableResultsLabel.Size = new System.Drawing.Size(86, 13);
this.availableResultsLabel.TabIndex = 8;
this.availableResultsLabel.Text = "Available results:";
//
// selectedResultsLabel
//
this.selectedResultsLabel.AutoSize = true;
this.selectedResultsLabel.Location = new System.Drawing.Point(284, 9);
this.selectedResultsLabel.Name = "selectedResultsLabel";
this.selectedResultsLabel.Size = new System.Drawing.Size(85, 13);
this.selectedResultsLabel.TabIndex = 9;
this.selectedResultsLabel.Text = "Selected results:";
//
// removeAllButton
//
this.removeAllButton.Location = new System.Drawing.Point(218, 221);
this.removeAllButton.Name = "removeAllButton";
this.removeAllButton.Size = new System.Drawing.Size(94, 30);
this.removeAllButton.TabIndex = 46;
this.removeAllButton.Text = "<< R&emove all";
this.removeAllButton.UseVisualStyleBackColor = true;
this.removeAllButton.Click += new System.EventHandler(this.removeAllButton_Click);
//
// removeButton
//
this.removeButton.Location = new System.Drawing.Point(218, 186);
this.removeButton.Name = "removeButton";
this.removeButton.Size = new System.Drawing.Size(93, 30);
this.removeButton.TabIndex = 45;
this.removeButton.Text = "< &Remove";
this.removeButton.UseVisualStyleBackColor = true;
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
//
// addButton
//
this.addButton.Location = new System.Drawing.Point(218, 151);
this.addButton.Name = "addButton";
this.addButton.Size = new System.Drawing.Size(93, 30);
this.addButton.TabIndex = 44;
this.addButton.Text = "&Add >";
this.addButton.UseVisualStyleBackColor = true;
this.addButton.Click += new System.EventHandler(this.addButton_Click);
//
// upButton
//
this.upButton.Location = new System.Drawing.Point(218, 313);
this.upButton.Name = "upButton";
this.upButton.Size = new System.Drawing.Size(93, 30);
this.upButton.TabIndex = 48;
this.upButton.Text = "Up";
this.upButton.UseVisualStyleBackColor = true;
this.upButton.Click += new System.EventHandler(this.upButton_Click);
//
// downButton
//
this.downButton.Location = new System.Drawing.Point(218, 349);
this.downButton.Name = "downButton";
this.downButton.Size = new System.Drawing.Size(93, 30);
this.downButton.TabIndex = 49;
this.downButton.Text = "Down";
this.downButton.UseVisualStyleBackColor = true;
this.downButton.Click += new System.EventHandler(this.downButton_Click);
//
// availableTabControl
//
this.availableTabControl.Controls.Add(this.tabPage1);
this.availableTabControl.Controls.Add(this.tabPage2);
this.availableTabControl.Controls.Add(this.tabPage3);
this.availableTabControl.Location = new System.Drawing.Point(6, 31);
this.availableTabControl.Name = "availableTabControl";
this.availableTabControl.SelectedIndex = 0;
this.availableTabControl.Size = new System.Drawing.Size(206, 453);
this.availableTabControl.TabIndex = 50;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.availableAlphabeticTreeView);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(198, 427);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "A...Z";
this.tabPage1.UseVisualStyleBackColor = true;
this.tabPage1.Click += new System.EventHandler(this.tabPage1_Click);
//
// availableAlphabeticTreeView
//
this.availableAlphabeticTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableAlphabeticTreeView.Location = new System.Drawing.Point(3, 3);
this.availableAlphabeticTreeView.Name = "availableAlphabeticTreeView";
this.availableAlphabeticTreeView.Size = new System.Drawing.Size(192, 421);
this.availableAlphabeticTreeView.TabIndex = 0;
this.availableAlphabeticTreeView.DoubleClick += new System.EventHandler(this.availableAlphabeticTreeView_DoubleClick);
//
// tabPage2
//
this.tabPage2.Controls.Add(this.availableByQuantityTreeView);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(198, 427);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "by quantity";
this.tabPage2.UseVisualStyleBackColor = true;
//
// availableByQuantityTreeView
//
this.availableByQuantityTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByQuantityTreeView.Location = new System.Drawing.Point(3, 3);
this.availableByQuantityTreeView.Name = "availableByQuantityTreeView";
this.availableByQuantityTreeView.Size = new System.Drawing.Size(192, 421);
this.availableByQuantityTreeView.TabIndex = 0;
this.availableByQuantityTreeView.DoubleClick += new System.EventHandler(this.availableByQuantityTreeView_DoubleClick);
//
// tabPage3
//
this.tabPage3.Controls.Add(this.availableByCategoryTreeView);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(198, 427);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "by category";
this.tabPage3.UseVisualStyleBackColor = true;
//
// availableByCategoryTreeView
//
this.availableByCategoryTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByCategoryTreeView.Location = new System.Drawing.Point(0, 0);
this.availableByCategoryTreeView.Name = "availableByCategoryTreeView";
this.availableByCategoryTreeView.Size = new System.Drawing.Size(198, 427);
this.availableByCategoryTreeView.TabIndex = 0;
this.availableByCategoryTreeView.NodeMouseHover += new System.Windows.Forms.TreeNodeMouseHoverEventHandler(this.availableByCategoryTreeView_NodeMouseHover);
this.availableByCategoryTreeView.DoubleClick += new System.EventHandler(this.availableByCategoryTreeView_DoubleClick);
//
// selectedResultsListViewEx
//
this.selectedResultsListViewEx.AllowColumnReorder = true;
this.selectedResultsListViewEx.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.selectedResultsListViewEx.DoubleClickActivation = false;
this.selectedResultsListViewEx.FullRowSelect = true;
this.selectedResultsListViewEx.Location = new System.Drawing.Point(317, 31);
this.selectedResultsListViewEx.Name = "selectedResultsListViewEx";
this.selectedResultsListViewEx.Size = new System.Drawing.Size(594, 453);
this.selectedResultsListViewEx.TabIndex = 47;
this.selectedResultsListViewEx.UseCompatibleStateImageBehavior = false;
this.selectedResultsListViewEx.View = System.Windows.Forms.View.Details;
this.selectedResultsListViewEx.SubItemClicked += new Results.Forms.SubItemEventHandler(this.selectedResultsListViewEx_SubItemClicked);
this.selectedResultsListViewEx.SubItemEndEditing += new Results.Forms.SubItemEndEditingEventHandler(this.selectedResultsListViewEx_SubItemEndEditing);
this.resultsConfigCtrl.Location = new System.Drawing.Point(-1, 1);
this.resultsConfigCtrl.Name = "resultsConfigCtrl";
this.resultsConfigCtrl.Size = new System.Drawing.Size(925, 496);
this.resultsConfigCtrl.TabIndex = 6;
//
// ResultsConfigDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(923, 543);
this.Controls.Add(this.availableTabControl);
this.Controls.Add(this.downButton);
this.Controls.Add(this.upButton);
this.Controls.Add(this.selectedResultsListViewEx);
this.Controls.Add(this.removeAllButton);
this.Controls.Add(this.removeButton);
this.Controls.Add(this.addButton);
this.Controls.Add(this.selectedResultsLabel);
this.Controls.Add(this.availableResultsLabel);
this.ClientSize = new System.Drawing.Size(1066, 498);
this.Controls.Add(this.resultsConfigCtrl);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
@@ -257,33 +81,14 @@ namespace Results.Forms
this.Text = "ResultsConfig";
this.Load += new System.EventHandler(this.ResultsConfig_Load);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.ResultsConfigDlg_KeyPress);
this.availableTabControl.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Label availableResultsLabel;
private System.Windows.Forms.Label selectedResultsLabel;
private System.Windows.Forms.Button removeAllButton;
private System.Windows.Forms.Button removeButton;
private System.Windows.Forms.Button addButton;
private ListViewEx selectedResultsListViewEx;
private System.Windows.Forms.Button upButton;
private System.Windows.Forms.Button downButton;
private System.Windows.Forms.TabControl availableTabControl;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TreeView availableAlphabeticTreeView;
private System.Windows.Forms.TreeView availableByQuantityTreeView;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TreeView availableByCategoryTreeView;
private System.Windows.Forms.Button cancelButton;
private ResultsConfigCtrl resultsConfigCtrl;
}
}
-3
View File
@@ -117,7 +117,4 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
+46 -9
View File
@@ -83,14 +83,14 @@ namespace Results
Lite_per_pulse_Read, /// 73
Result_code, /// 74
Remark, /// 75
TempHiMean, /// 76
TempHiStart, /// 77
TempHiEnd, /// 78
TempHiAve, /// 79
TempLoMean, /// 80
TempLoStart, /// 81
TempLoEnd, /// 82
TempLoAve, /// 83
T_Hi_mean, /// 76
T_Hi_start, /// 77
T_Hi_end, /// 78
T_Hi_avg, /// 79
T_Lo_mean, /// 80
T_Lo_start, /// 81
T_Lo_end, /// 82
T_Lo_avg, /// 83
P_delta_mean, /// 84
P_delta_start, /// 85
P_delta_end, /// 86
@@ -111,7 +111,44 @@ namespace Results
End_state_aux, /// 101
Q_rise, /// 102
Q_fall, /// 103
/// iPerl
OrigCalibFactor, /// 104
CalibFactor, /// 105
Q2ErrWOCorrection, /// 106
Q2CorrectionDone, /// 107
Q2CorrRFlow, /// 108
Q2CorrLFlow, /// 109
Q2CorrFlowRight, /// 110
Q_ref_mean, /// 111
T_up_start, /// 112
T_up_end, /// 113
T_up_avg, /// 114
T_down_start, /// 115
T_down_end, /// 116
T_down_avg, /// 117
T_div_start, /// 118
T_div_end, /// 119
T_div_avg, /// 120
P_up_avg, /// 121
P_down_avg, /// 122
P_delta_avg, /// 123
TestDone, /// 124
TestPassed, /// 125
/// iPerl
FW_Version, /// 126
Mass_start_raw, /// 127
Mass_start, /// 128
Mass_end_raw, /// 129
Mass_end, /// 130
Mass, /// 131
Buoyancy, /// 132
Density_correction, /// 133
Count,
}
}
+4 -2
View File
@@ -22,12 +22,14 @@ namespace Results.Mappings
Map(x => x.Remark)
.CustomType("StringClob")
.CustomSqlType("varchar(2000)");
Map(x => x.Custom1);
Map(x => x.DensityCorr)
.Column("Custom1"); ;
Map(x => x.Custom2);
Map(x => x.Custom3);
Map(x => x.StartTime);
Map(x => x.EndTime);
Map(x => x.RsltsSent);
Map(x => x.Dirty);
Map(x => x.RsltsSent);
Map(x => x.RsltsPrinted);
HasMany(x => x.Tests)
.Cascade.All();
+6 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Copyright (c) 2015-2017 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Results.Entities;
@@ -17,6 +17,10 @@ namespace Results.Mappings
Map(x => x.Part);
Map(x => x.RepetitionNr);
Map(x => x.TestDone);
Map(x => x.Remark)
.CustomType("StringClob")
.CustomSqlType("varchar(2000)");
Map(x => x.StartTime);
Map(x => x.EndTime);
Map(x => x.FlowSetTime);
@@ -84,6 +88,7 @@ namespace Results.Mappings
Map(x => x.TempDivEnd);
Map(x => x.TempDivMin);
Map(x => x.TempDivMax);
Map(x => x.FlowMean);
Map(x => x.FlowStart);
Map(x => x.FlowEnd);
Map(x => x.FlowMin);
+6 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Copyright (c) 2015-2017 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Results.Entities;
@@ -22,7 +22,10 @@ namespace Results.Mappings
Map(x => x.QFall);
Map(x => x.Passed);
Map(x => x.ResultCode);
Map(x => x.ArchivePath);
Map(x => x.Remark)
.CustomType("StringClob")
.CustomSqlType("varchar(2000)");
#if IPERL
Map(x => x.SerialNrEx);
Map(x => x.OrigCalibFactor);
@@ -36,6 +39,7 @@ namespace Results.Mappings
Map(x => x.Diff2Hz8Hz);
Map(x => x.Hz2CorrectionDone);
Map(x => x.Hz2Correction);
Map(x => x.FWVersion);
#endif
References(x => x.WaterMeterData);
References(x => x.Batch);
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -7,34 +7,38 @@ using System.Drawing;
using System.Drawing.Printing;
using System.IO;
using Config.Entities;
using TBF.Resources;
using Results.Resources;
namespace TBF.BenchControl.ResultsPrinters.Basic
namespace Results.Output.Printers.Enhanced
{
public class BasicPrintDocument : PrintDocument
public class EnhancedPrintDocument : PrintDocument
{
const string FontFamilyName = "Arial"; //"Times New Roman";
const int SpacingOne = 18;
const int SpacingOneAndHalf = (3 * SpacingOne) / 2;
/// Size of the printed area without margins, after taking into account 'pageOrientation'
readonly int printHeight;
readonly int printWidth;
readonly int topMargin;
readonly int bottomMargin;
readonly int leftMargin;
readonly int TitleX;
readonly int TitleY; /// Depends on the size of the header
readonly int HdrTop; /// = TitleY + 60
readonly int BodyTop; /// = HdrTop + 160
/// Size of the printed area without margins, after taking into account 'pageOrientation'
int printHeight;
int printWidth;
readonly int SpacingOne;
readonly int SpacingOneAndHalf;
readonly int SpacingOne4Header;
readonly int SpacingOneAndHalf4Header;
int CommonTop; /// = TitleY + 60
int BodyTop; /// = HdrTop + 160
///
int titleHeight;
int commonHeight;
/// <summary>
/// Property variable for the Font the user wishes to use
/// </summary>
Font font;
Font boldFont;
Font headerFont;
Font titleFont;
///
@@ -42,10 +46,15 @@ namespace TBF.BenchControl.ResultsPrinters.Basic
///
Results.Entities.Batch batch;
EnhancedPrinterCfg cfg;
///
/// Items to print
///
readonly IList<Results.ItemSpec> rsltItems;
string header;
IList<WMeterRsltItemSpec> commonItems;
IList<WMeterRsltItemSpec> testItems;
string footer;
///
/// Layout and status
@@ -61,33 +70,28 @@ namespace TBF.BenchControl.ResultsPrinters.Basic
/// Constructor
/// </summary>
/// <param name="textToPrint">Text to be printed</param>
public BasicPrintDocument(Results.Entities.Batch batch,
PageOrientation pageOrientation,
int topMargin, int bottomMargin, int leftMargin)
public EnhancedPrintDocument(Results.Entities.Batch batch, EnhancedPrinterCfg cfg)
{
this.batch = batch;
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
this.cfg = cfg;
topMargin = cfg.TopMargin;
bottomMargin = cfg.BottomMargin;
leftMargin = cfg.LeftMargin;
this.topMargin = topMargin;
this.bottomMargin = bottomMargin;
this.leftMargin = leftMargin;
header = string.IsNullOrEmpty(cfg.Header) ? string.Empty : cfg.Header.Replace("~", Environment.NewLine);
commonItems = Results.WMeterRsltItemSpec.FromStrArray(cfg.CommonItems);
testItems = Results.WMeterRsltItemSpec.FromStrArray(cfg.TestItems); /// TestID info will be overwritten later on
footer = string.IsNullOrEmpty(cfg.Footer) ? string.Empty : cfg.Footer.Replace("~", Environment.NewLine);
TitleX = leftMargin;
TitleY = topMargin; /// Depends on the size of the header
HdrTop = TitleY + 60;
BodyTop = HdrTop + 160;
if (batch.WaterMeters.Count > 0 && batch.WaterMeters[0].Compound())
{
rsltItems = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_CombinedWM);
}
else
{
rsltItems = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_SingleWM);
}
/// Initialize fonts
titleFont = new Font(cfg.TitFntFml, cfg.TitFntSz, (FontStyle)cfg.TitFntSty);
headerFont = new Font(cfg.HdrFntFml, cfg.HdrFntSz, (FontStyle)cfg.HdrFntSty);
font = new Font(cfg.BodyFntFml, cfg.BodyFntSz, (FontStyle)cfg.BodyFntSty);
/// Set print area size and margins (in dots using 100 dpi)
DefaultPageSettings.Landscape = (cfg.PageOrientation == PageOrientation.Landscape);
///
if (DefaultPageSettings.Landscape)
{
printHeight = base.DefaultPageSettings.PaperSize.Width - topMargin - bottomMargin;
@@ -99,22 +103,36 @@ namespace TBF.BenchControl.ResultsPrinters.Basic
printWidth = base.DefaultPageSettings.PaperSize.Width - leftMargin - leftMargin;
}
SpacingOne = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", font).Height;
SpacingOneAndHalf = (3 * SpacingOne) / 2;
SpacingOne4Header = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", headerFont).Height;
SpacingOneAndHalf4Header = (3 * SpacingOne4Header) / 2;
/// Calculate the tests count
int testsCount = 0;
if (batch.WaterMeters.Count > 0)
{
foreach (var mtr in batch.WaterMeters[0].MeterTestRslts)
{
if (mtr.Publish() == Config.Entities.Publish.Always) testsCount++;
if (mtr.Publish() == Config.Entities.Publish.Always && mtr.IsPilotRslt()) testsCount++;
}
}
if (batch.WaterMeters.Count > 0 && batch.WaterMeters[0].Compound()) testsCount /= 3;
/// Prepare document outline
TitleX = cfg.LeftMargin;
TitleY = cfg.TopMargin;
int wmSectionHeight = (testsCount + 4) * SpacingOne;
titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height;
CommonTop = TitleY + titleHeight + SpacingOne4Header;
commonHeight = commonItems.Count * SpacingOne;
BodyTop = CommonTop + commonHeight + SpacingOne4Header;
int wmSectionHeight = (testsCount + 1) * SpacingOne + 3 * SpacingOne4Header;
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
nrWMsOnNextPage = Math.Max(nrWMsOnNextPage, 1); /// Prevent division by zero if there are too many WM tests
nrWMsOnNextPage = Math.Max(nrWMsOnNextPage, 1); /// Prevent division by zero if there are too many WM tests
nrPages = 1 + (batch.WaterMeters.Count - nrWMsOnFirstPage + nrWMsOnNextPage - 1) / nrWMsOnNextPage;
@@ -130,10 +148,6 @@ namespace TBF.BenchControl.ResultsPrinters.Basic
protected override void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e)
{
base.OnBeginPrint(e);
if (font == null) { font = new Font(FontFamilyName, 10, FontStyle.Regular); }
if (boldFont == null) { boldFont = new Font(FontFamilyName, 10, FontStyle.Bold); }
if (titleFont == null) { titleFont = new Font(FontFamilyName, 18, FontStyle.Bold); }
}
/// <summary>
@@ -158,33 +172,24 @@ namespace TBF.BenchControl.ResultsPrinters.Basic
if (pageNr == 1)
{
///----------
/// Header
/// Title
///----------
RectangleF printArea = new RectangleF(TitleX, TitleY, printWidth, 40);
e.Graphics.DrawString(batch.ProtocolTitle, titleFont, Brushes.Black, printArea);
RectangleF printArea = new RectangleF(TitleX, TitleY, printWidth, titleHeight);
e.Graphics.DrawString(header, titleFont, Brushes.Black, printArea);
string[] leftColumn = new string[]
{
"Batch number: ",
"Date and time: ",
"Procedure: ",
Strings.User + ": ",
"Ambient temperature: ",
"Ambient pressure: ",
"Ambient humidity: ",
};
///----------------
/// Common items
///----------------
string[] leftColumn = new string[commonItems.Count];
string[] rightColumn = new string[commonItems.Count];
string[] rightColumn = new string[]
{
batch.BatchNr.ToString(),
//batch.EndTime.ToShortDateString() + " " + batch.EndTime.ToShortTimeString(),
string.Format("{0:yyyy.MM.dd HH:mm}", batch.EndTime),
batch.ProcedureName,
Users.GlobalData.CurrentUser.UserName,
batch.AmbientTempAve().ToString("F1") + " °C",
Config.Units.ConvertTo(Config.Unit.mbar, batch.AmbientPressAve()).ToString("F0") + " mbar",
batch.AmbientHumiAve().ToString("F0") + " %",
};
int cnt = 0;
foreach (var v in commonItems)
{
leftColumn[cnt] = v.Caption;
rightColumn[cnt] = (batch.WaterMeters.Count > 0) ? v.Print(batch.WaterMeters[0]) : string.Empty;
cnt++;
}
/// Determine max. left column width in characters
int maxLen = 0;
@@ -193,8 +198,8 @@ namespace TBF.BenchControl.ResultsPrinters.Basic
/// Write aligned columns
for (int i = 0; i < Math.Min(leftColumn.Length, rightColumn.Length); i++)
{
PrintAt(e, leftMargin, HdrTop + SpacingOne * i, leftColumn[i]);
PrintAt(e, 300, HdrTop + SpacingOne * i, rightColumn[i]);
PrintAt(e, leftMargin, CommonTop + SpacingOne * i, leftColumn[i]);
PrintAt(e, 300, CommonTop + SpacingOne * i, rightColumn[i]);
}
}
@@ -220,10 +225,12 @@ namespace TBF.BenchControl.ResultsPrinters.Basic
///----------
/// Footer
///----------
string footerText = string.Format("str. {1}/{2}", Strings.Page, pageNr++, nrPages);
int footerWidth = (int)e.Graphics.MeasureString(footerText, font).Width;
PrintAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - SpacingOne, footerText);
int footerWidth = (int)e.Graphics.MeasureString(footer, font).Width;
PrintAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - 2 * SpacingOne, footer);
string pageNrText = string.Format("{0} {1}/{2}", Strings.Page, pageNr++, nrPages);
int pageNrWidth = (int)e.Graphics.MeasureString(pageNrText, font).Width;
PrintAt(e, leftMargin + (printWidth - pageNrWidth) / 2, topMargin + printHeight - SpacingOne, pageNrText);
}
@@ -238,89 +245,61 @@ namespace TBF.BenchControl.ResultsPrinters.Basic
Results.Entities.WaterMeter wm, int printedWMNr, int top)
{
/// Determin column widths
float[] columnPos = new float[rsltItems.Count + 1];
float[] columnPos = new float[testItems.Count + 1];
columnPos[0] = (float)leftMargin;
for (int i = 0; i < rsltItems.Count; i++)
for (int i = 0; i < testItems.Count; i++)
{
float columnWidth = e.Graphics.MeasureString(rsltItems[i].ClmnHeaderText, font).Width;
float columnWidth = e.Graphics.MeasureString(testItems[i].Caption, headerFont).Width;
foreach (var mtr in wm.MeterTestRslts)
{
string itemText;
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
{
string itemText = testItems[i].Print(wm, mtr.Name());
if (!wm.Compound())
{
itemText = rsltItems[i].Print(mtr);
}
else if (mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
{
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
itemText = rsltItems[i].PrintCombined(mainMtr, auxMtr, mtr);
}
else
{
continue;
}
/// Strip color information
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
/// Strip color information
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
float width = e.Graphics.MeasureString(itemText, font).Width;
if (width > columnWidth) columnWidth = width;
float width = e.Graphics.MeasureString(itemText, font).Width;
if (width > columnWidth) columnWidth = width;
}
}
columnPos[i + 1] = columnPos[i] + columnWidth + 20.0f;
}
int tableLeftX = (int)columnPos[0];
int tableRightX = (int)columnPos[rsltItems.Count] - 20;
int tableRightX = (int)columnPos[testItems.Count] - 20;
string wmText = string.Format("Water meter {0}", printedWMNr);
PrintAt(e, leftMargin, top, wmText);
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
PrintHeaderAt(e, leftMargin, top, wmText);
if (!string.IsNullOrEmpty(wm.SerialNr))
{
PrintAt(e, leftMargin + (int)e.Graphics.MeasureString(wmText, font).Width, top,
string.Format(" s/n = {0}", wm.SerialNr));
PrintHeaderAt(e, leftMargin + (int)e.Graphics.MeasureString(wmText, headerFont).Width, top,
string.Format(" {0} = {1}", Strings.sn, wm.SerialNr));
}
/// Horizontal line
int horY = top + 25;
int horY = top + SpacingOneAndHalf4Header;
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
for (int i = 0; i < rsltItems.Count; i++)
for (int i = 0; i < testItems.Count; i++)
{
PrintAt(e, (int)columnPos[i], top + 27, rsltItems[i].ClmnHeaderText);
PrintHeaderAt(e, (int)columnPos[i], top + (int)(1.6 * SpacingOne4Header), testItems[i].Caption);
}
/// Horizontal line
horY = top + 27 + SpacingOne;
horY = top + (int)(2.8 * SpacingOne4Header);
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
int testsCount = 0;
foreach (var mtr in wm.MeterTestRslts)
{
if (mtr.Publish() == Config.Entities.Publish.Always)
if ((mtr != null) && (mtr.Publish() == Config.Entities.Publish.Always))
{
testsCount++;
for (int i = 0; i < rsltItems.Count; i++)
for (int i = 0; i < testItems.Count; i++)
{
string itemText;
if (!wm.Compound())
{
/// Single water meter
itemText = rsltItems[i].Print(mtr);
}
else if (mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
{
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
itemText = rsltItems[i].PrintCombined(mainMtr, auxMtr, mtr);
}
else
{
continue;
}
string itemText = testItems[i].Print(wm, mtr.Name());
/// Strip color information
string[] texts = itemText.Split(new char[] { '|' });
@@ -331,16 +310,16 @@ namespace TBF.BenchControl.ResultsPrinters.Basic
/// TODO: How to print colors?
}
PrintAt(e, (int)columnPos[i], top + 30 + SpacingOne * testsCount, itemText);
PrintAt(e, (int)columnPos[i], top + 2 * SpacingOne4Header + SpacingOne * testsCount, itemText);
}
}
}
/// Horizontal line
horY = top + 30 + SpacingOne * (testsCount + 1);
horY = top + 2 * SpacingOneAndHalf4Header + SpacingOne * testsCount;
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
return (testsCount + 4) * SpacingOne;
return (testsCount + 1) * SpacingOne + 3 * SpacingOne4Header;
}
@@ -352,21 +331,21 @@ namespace TBF.BenchControl.ResultsPrinters.Basic
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne);
e.Graphics.DrawString(text, this.font, Brushes.Black, printArea);
}
void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
void PrintHeaderAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
{
PrintBoldAt(e, p.X, p.Y, text);
PrintHeaderAt(e, p.X, p.Y, text);
}
void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
void PrintHeaderAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
e.Graphics.DrawString(text, this.boldFont, Brushes.Black, printArea);
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne4Header);
e.Graphics.DrawString(text, this.headerFont, Brushes.Black, printArea);
}
}
}
@@ -0,0 +1,33 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Results.Output.Printers.Enhanced
{
public class EnhancedPrinterCfg
{
public Config.Entities.PageOrientation PageOrientation;
public int TopMargin;
public int BottomMargin;
public int LeftMargin;
public string TitFntFml;
public int TitFntSz;
public int TitFntSty;
public string HdrFntFml;
public int HdrFntSz;
public int HdrFntSty;
public string BodyFntFml;
public int BodyFntSz;
public int BodyFntSty;
public bool SupressPrinting; /// Bypass printing when true
public System.Globalization.CultureInfo CultureInfo;
public string[] CommonItems;
public string[] TestItems;
public string Header; /// =Title
public string Footer;
}
}
@@ -235,13 +235,13 @@ namespace Results.Output.Printers.Munich
lineNr += (secondTableOffset * 2) / SpacingOne;
PrintAt(e, Tab1, lineNr * SpacingOne, "Temperatur");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientTempAve().ToString("F1") + " \x00b0C");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientHumiAve().ToString("F0") + " %");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbHumiMean().ToString("F0") + " %");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck");
PrintAt(e, Tab2, lineNr * SpacingOne, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbientPressAve()).ToString("F0") + " mbar");
PrintAt(e, Tab2, lineNr * SpacingOne, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbPressMean()).ToString("F0") + " mbar");
lineNr++;
PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
@@ -0,0 +1,351 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
using System.IO;
using Config.Entities;
using Results.Resources;
namespace Results.Output.Printers.OnePagePerMeter
{
public class EnhancedPrintDocument : PrintDocument
{
/// Size of the printed area without margins, after taking into account 'pageOrientation'
readonly int printHeight;
readonly int printWidth;
readonly int topMargin;
readonly int bottomMargin;
readonly int leftMargin;
readonly int TitleX;
readonly int TitleY; /// Depends on the size of the header
readonly int SpacingOne;
readonly int SpacingOneAndHalf;
readonly int SpacingOne4Header;
readonly int SpacingOneAndHalf4Header;
int CommonTop; /// = TitleY + 60
int BodyTop; /// = HdrTop + 160
///
int titleHeight;
int commonHeight;
/// <summary>
/// Property variable for the Font the user wishes to use
/// </summary>
Font font;
Font headerFont;
Font titleFont;
///
/// Data to print
///
Results.Entities.Batch batch;
EnhancedPrinterCfg cfg;
///
/// Items to print
///
string header;
IList<WMeterRsltItemSpec> commonItems;
IList<WMeterRsltItemSpec> testItems;
string footer;
///
/// Layout and status
///
int nrWMsOnFirstPage;
int nrWMsOnNextPage;
int nextWMNr; /// nr. of watermeter to be printed as the first one on the next page
int nrPages;
int pageNr; /// Page number to be printed at the bottom of the page
/// <summary>
/// Constructor
/// </summary>
/// <param name="textToPrint">Text to be printed</param>
public EnhancedPrintDocument(Results.Entities.Batch batch, EnhancedPrinterCfg cfg)
{
this.batch = batch;
this.cfg = cfg;
topMargin = cfg.TopMargin;
bottomMargin = cfg.BottomMargin;
leftMargin = cfg.LeftMargin;
header = string.IsNullOrEmpty(cfg.Header) ? string.Empty : cfg.Header.Replace("~", Environment.NewLine);
commonItems = Results.WMeterRsltItemSpec.FromStrArray(cfg.CommonItems);
testItems = Results.WMeterRsltItemSpec.FromStrArray(cfg.TestItems); /// TestID info will be overwritten later on
footer = string.IsNullOrEmpty(cfg.Footer) ? string.Empty : cfg.Footer.Replace("~", Environment.NewLine);
/// Initialize fonts
titleFont = new Font(cfg.TitFntFml, cfg.TitFntSz, (FontStyle)cfg.TitFntSty);
headerFont = new Font(cfg.HdrFntFml, cfg.HdrFntSz, (FontStyle)cfg.HdrFntSty);
font = new Font(cfg.BodyFntFml, cfg.BodyFntSz, (FontStyle)cfg.BodyFntSty);
/// Set print area size and margins (in dots using 100 dpi)
DefaultPageSettings.Landscape = (cfg.PageOrientation == PageOrientation.Landscape);
///
if (DefaultPageSettings.Landscape)
{
printHeight = base.DefaultPageSettings.PaperSize.Width - topMargin - bottomMargin;
printWidth = base.DefaultPageSettings.PaperSize.Height - leftMargin - leftMargin;
}
else
{
printHeight = base.DefaultPageSettings.PaperSize.Height - topMargin - bottomMargin;
printWidth = base.DefaultPageSettings.PaperSize.Width - leftMargin - leftMargin;
}
SpacingOne = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", font).Height;
SpacingOneAndHalf = (3 * SpacingOne) / 2;
SpacingOne4Header = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", headerFont).Height;
SpacingOneAndHalf4Header = (3 * SpacingOne4Header) / 2;
/// Calculate the tests count
int testsCount = 0;
if (batch.WaterMeters.Count > 0)
{
foreach (var mtr in batch.WaterMeters[0].MeterTestRslts)
{
if (mtr.Publish() == Config.Entities.Publish.Always && mtr.IsPilotRslt()) testsCount++;
}
}
/// Prepare document outline
TitleX = cfg.LeftMargin;
TitleY = cfg.TopMargin;
titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height;
CommonTop = TitleY + titleHeight + SpacingOne4Header;
commonHeight = commonItems.Count * SpacingOne;
BodyTop = CommonTop + commonHeight + SpacingOne4Header;
int wmSectionHeight = (testsCount + 1) * SpacingOne + 3 * SpacingOne4Header;
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
nrWMsOnNextPage = Math.Max(nrWMsOnNextPage, 1); /// Prevent division by zero if there are too many WM tests
nrPages = 1 + (batch.WaterMeters.Count - nrWMsOnFirstPage + nrWMsOnNextPage - 1) / nrWMsOnNextPage;
pageNr = 1;
nextWMNr = 0;
}
/// <summary>
/// Override the default onbeginPrint method of the PrintDocument Object
/// </summary>
/// <param name=e></param>
/// <remarks></remarks>
protected override void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e)
{
base.OnBeginPrint(e);
}
/// <summary>
/// Override the default OnPrintPage method of the PrintDocument.
/// </summary>
/// <param name=e></param>
/// <remarks>This provides the print logic for our document</remarks>
protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e)
{
/// Run base code
base.OnPrintPage(e);
if (File.Exists("C:\\TBF\\header.png"))
{
Image img = Image.FromFile("C:\\TBF\\header.png");
e.Graphics.DrawImage(new Bitmap(img), new Rectangle(0, 0, 827, 1169));
}
/// Use the StringFormat class for the text layout of our document
StringFormat format = new StringFormat(StringFormatFlags.LineLimit);
if (pageNr == 1)
{
///----------
/// Title
///----------
RectangleF printArea = new RectangleF(TitleX, TitleY, printWidth, titleHeight);
e.Graphics.DrawString(header, titleFont, Brushes.Black, printArea);
///----------------
/// Common items
///----------------
string[] leftColumn = new string[commonItems.Count];
string[] rightColumn = new string[commonItems.Count];
int cnt = 0;
foreach (var v in commonItems)
{
leftColumn[cnt] = v.Caption;
rightColumn[cnt] = (batch.WaterMeters.Count > 0) ? v.Print(batch.WaterMeters[0]) : string.Empty;
cnt++;
}
/// Determine max. left column width in characters
int maxLen = 0;
foreach (var s in leftColumn) if (s.Length > maxLen) maxLen = s.Length;
/// Write aligned columns
for (int i = 0; i < Math.Min(leftColumn.Length, rightColumn.Length); i++)
{
PrintAt(e, leftMargin, CommonTop + SpacingOne * i, leftColumn[i]);
PrintAt(e, 300, CommonTop + SpacingOne * i, rightColumn[i]);
}
}
///--------
/// Body
///--------
/// This variable represents the top coordinate of the area where WM results are printed
/// and it is updated (increased by) the value returned by PrintXyzWM() - the section size.
int nextWmTop = (pageNr == 1) ? BodyTop : TitleY;
int nrWMsOnPage = (pageNr == 1) ? nrWMsOnFirstPage : nrWMsOnNextPage;
for (int wmNr = nextWMNr; wmNr < Math.Min(nextWMNr + nrWMsOnPage, batch.WaterMeters.Count); wmNr++) /// wmNr is 0-based
{
int wmPosition = true ? batch.WaterMeters[wmNr].WMPosition : (wmNr + 1);
nextWmTop += PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop);
}
nextWMNr += nrWMsOnPage;
e.HasMorePages = (nextWMNr < batch.WaterMeters.Count);
///----------
/// Footer
///----------
int footerWidth = (int)e.Graphics.MeasureString(footer, font).Width;
PrintAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - 2 * SpacingOne, footer);
string pageNrText = string.Format("{0} {1}/{2}", Strings.Page, pageNr++, nrPages);
int pageNrWidth = (int)e.Graphics.MeasureString(pageNrText, font).Width;
PrintAt(e, leftMargin + (printWidth - pageNrWidth) / 2, topMargin + printHeight - SpacingOne, pageNrText);
}
/// <summary>
/// Print one water meter results
/// </summary>
/// <param name="wm">Water meter</param>
/// <param name="printedWMNr">Number of the water meter printed</param>
/// <param name="top">Top coordinate of watermeter data</param>
/// <returns>The height of the printed section</returns>
int PrintWM(System.Drawing.Printing.PrintPageEventArgs e,
Results.Entities.WaterMeter wm, int printedWMNr, int top)
{
/// Determin column widths
float[] columnPos = new float[testItems.Count + 1];
columnPos[0] = (float)leftMargin;
for (int i = 0; i < testItems.Count; i++)
{
float columnWidth = e.Graphics.MeasureString(testItems[i].Caption, headerFont).Width;
foreach (var mtr in wm.MeterTestRslts)
{
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
{
string itemText = testItems[i].Print(wm, mtr.Name());
/// Strip color information
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
float width = e.Graphics.MeasureString(itemText, font).Width;
if (width > columnWidth) columnWidth = width;
}
}
columnPos[i + 1] = columnPos[i] + columnWidth + 20.0f;
}
int tableLeftX = (int)columnPos[0];
int tableRightX = (int)columnPos[testItems.Count] - 20;
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
PrintHeaderAt(e, leftMargin, top, wmText);
if (!string.IsNullOrEmpty(wm.SerialNr))
{
PrintHeaderAt(e, leftMargin + (int)e.Graphics.MeasureString(wmText, headerFont).Width, top,
string.Format(" {0} = {1}", Strings.sn, wm.SerialNr));
}
/// Horizontal line
int horY = top + SpacingOneAndHalf4Header;
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
for (int i = 0; i < testItems.Count; i++)
{
PrintHeaderAt(e, (int)columnPos[i], top + (int)(1.6 * SpacingOne4Header), testItems[i].Caption);
}
/// Horizontal line
horY = top + (int)(2.8 * SpacingOne4Header);
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
int testsCount = 0;
foreach (var mtr in wm.MeterTestRslts)
{
if ((mtr != null) && (mtr.Publish() == Config.Entities.Publish.Always))
{
testsCount++;
for (int i = 0; i < testItems.Count; i++)
{
string itemText = testItems[i].Print(wm, mtr.Name());
/// Strip color information
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2)
{
itemText = texts[0];
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
/// TODO: How to print colors?
}
PrintAt(e, (int)columnPos[i], top + 2 * SpacingOne4Header + SpacingOne * testsCount, itemText);
}
}
}
/// Horizontal line
horY = top + 2 * SpacingOneAndHalf4Header + SpacingOne * testsCount;
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
return (testsCount + 1) * SpacingOne + 3 * SpacingOne4Header;
}
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
{
PrintAt(e, p.X, p.Y, text);
}
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne);
e.Graphics.DrawString(text, this.font, Brushes.Black, printArea);
}
void PrintHeaderAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
{
PrintHeaderAt(e, p.X, p.Y, text);
}
void PrintHeaderAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne4Header);
e.Graphics.DrawString(text, this.headerFont, Brushes.Black, printArea);
}
}
}
@@ -0,0 +1,33 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Results.Output.Printers.OnePagePerMeter
{
public class EnhancedPrinterCfg
{
public Config.Entities.PageOrientation PageOrientation;
public int TopMargin;
public int BottomMargin;
public int LeftMargin;
public string TitFntFml;
public int TitFntSz;
public int TitFntSty;
public string HdrFntFml;
public int HdrFntSz;
public int HdrFntSty;
public string BodyFntFml;
public int BodyFntSz;
public int BodyFntSty;
public bool SupressPrinting; /// Bypass printing when true
public System.Globalization.CultureInfo CultureInfo;
public string[] CommonItems;
public string[] TestItems;
public string Header; /// =Title
public string Footer;
}
}
+3 -3
View File
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sensus")]
[assembly: AssemblyProduct("Results")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyCopyright("Copyright © 2013 - 2017 Sensus Slovensko, a.s.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.12.544.0")]
[assembly: AssemblyFileVersion("2.12.544.0")]
[assembly: AssemblyVersion("2.14.619.0")]
[assembly: AssemblyFileVersion("2.14.619.0")]
+586 -1
View File
@@ -87,6 +87,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to aux..
/// </summary>
internal static string aux {
get {
return ResourceManager.GetString("aux", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Available results.
/// </summary>
@@ -168,6 +177,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Density correction.
/// </summary>
internal static string Density_correction {
get {
return ResourceManager.GetString("Density_correction", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Down.
/// </summary>
@@ -313,7 +331,7 @@ namespace Results.Resources {
}
/// <summary>
/// Looks up a localized string similar to Err.ref..
/// Looks up a localized string similar to E rel. ref..
/// </summary>
internal static string ErrRef {
get {
@@ -321,6 +339,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to fall.
/// </summary>
internal static string fall {
get {
return ResourceManager.GetString("fall", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Flow.
/// </summary>
@@ -339,6 +366,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to from.
/// </summary>
internal static string from {
get {
return ResourceManager.GetString("from", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to H amb.
/// </summary>
@@ -366,6 +402,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to main.
/// </summary>
internal static string main {
get {
return ResourceManager.GetString("main", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to M.Class.
/// </summary>
@@ -393,6 +438,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to No.
/// </summary>
internal static string No {
get {
return ResourceManager.GetString("No", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to OK.
/// </summary>
@@ -690,6 +744,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to rise.
/// </summary>
internal static string rise {
get {
return ResourceManager.GetString("rise", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Selected results.
/// </summary>
@@ -852,6 +915,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Test done.
/// </summary>
internal static string Test_done {
get {
return ResourceManager.GetString("Test_done", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test ID.
/// </summary>
@@ -870,6 +942,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Test passed.
/// </summary>
internal static string Test_passed {
get {
return ResourceManager.GetString("Test_passed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test vol..
/// </summary>
@@ -879,6 +960,411 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to to.
/// </summary>
internal static string to {
get {
return ResourceManager.GetString("to", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Relative error of a meter.
/// </summary>
internal static string Tooltip_E_rel {
get {
return ResourceManager.GetString("Tooltip_E_rel", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Relative error of the master meter.
/// </summary>
internal static string Tooltip_E_rel_ref {
get {
return ResourceManager.GetString("Tooltip_E_rel_ref", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ambient humidity during test.
/// </summary>
internal static string Tooltip_Hu_Amb_M {
get {
return ResourceManager.GetString("Tooltip_Hu_Amb_M", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ambient pressure during test.
/// </summary>
internal static string Tooltip_P_Amb_M {
get {
return ResourceManager.GetString("Tooltip_P_Amb_M", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure difference measured by delta P meter - actual.
/// </summary>
internal static string Tooltip_P_de_ac {
get {
return ResourceManager.GetString("Tooltip_P_de_ac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure difference measured by delta P meter - average.
/// </summary>
internal static string Tooltip_P_de_avg {
get {
return ResourceManager.GetString("Tooltip_P_de_avg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure difference measured by delta P meter - at the end of the test.
/// </summary>
internal static string Tooltip_P_de_en {
get {
return ResourceManager.GetString("Tooltip_P_de_en", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure difference measured by delta P meter - mean.
/// </summary>
internal static string Tooltip_P_de_me {
get {
return ResourceManager.GetString("Tooltip_P_de_me", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure difference measured by delta P meter - at the start of the test.
/// </summary>
internal static string Tooltip_P_de_st {
get {
return ResourceManager.GetString("Tooltip_P_de_st", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure at the outlet actual.
/// </summary>
internal static string Tooltip_P_dw_ac {
get {
return ResourceManager.GetString("Tooltip_P_dw_ac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Average pressure at the outlet.
/// </summary>
internal static string Tooltip_P_dw_avg {
get {
return ResourceManager.GetString("Tooltip_P_dw_avg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure at the outlet at end of the test.
/// </summary>
internal static string Tooltip_P_dw_en {
get {
return ResourceManager.GetString("Tooltip_P_dw_en", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mean pressure at the outlet.
/// </summary>
internal static string Tooltip_P_dw_me {
get {
return ResourceManager.GetString("Tooltip_P_dw_me", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure at the outlet at start of the test.
/// </summary>
internal static string Tooltip_P_dw_st {
get {
return ResourceManager.GetString("Tooltip_P_dw_st", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure at the inlet actual.
/// </summary>
internal static string Tooltip_P_up_ac {
get {
return ResourceManager.GetString("Tooltip_P_up_ac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Average pressure at the inlet.
/// </summary>
internal static string Tooltip_P_up_avg {
get {
return ResourceManager.GetString("Tooltip_P_up_avg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure at the inlet at end of the test.
/// </summary>
internal static string Tooltip_P_up_en {
get {
return ResourceManager.GetString("Tooltip_P_up_en", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mean pressure at the inlet.
/// </summary>
internal static string Tooltip_P_up_me {
get {
return ResourceManager.GetString("Tooltip_P_up_me", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure at the inlet at start of the test.
/// </summary>
internal static string Tooltip_P_up_st {
get {
return ResourceManager.GetString("Tooltip_P_up_st", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Flow calculated from conventional true mass and time.
/// </summary>
internal static string Tooltip_Q_m_r {
get {
return ResourceManager.GetString("Tooltip_Q_m_r", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Flow obtained from the master meter - actual.
/// </summary>
internal static string Tooltip_Q_riac {
get {
return ResourceManager.GetString("Tooltip_Q_riac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Flow obtained from the master meter - mean.
/// </summary>
internal static string Tooltip_Q_rim {
get {
return ResourceManager.GetString("Tooltip_Q_rim", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Flow calculated from conventional true volume and the time.
/// </summary>
internal static string Tooltip_Q_v_r {
get {
return ResourceManager.GetString("Tooltip_Q_v_r", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Serial number of the meter.
/// </summary>
internal static string Tooltip_sn {
get {
return ResourceManager.GetString("Tooltip_sn", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Serial number of the auxiliary meter of a compound water meter.
/// </summary>
internal static string Tooltip_sn_aux {
get {
return ResourceManager.GetString("Tooltip_sn_aux", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Serial number of the main meter of a compound water meter.
/// </summary>
internal static string Tooltip_sn_main {
get {
return ResourceManager.GetString("Tooltip_sn_main", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ambient temperature during test.
/// </summary>
internal static string Tooltip_T_Amb_M {
get {
return ResourceManager.GetString("Tooltip_T_Amb_M", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Actual temperature at the diverter.
/// </summary>
internal static string Tooltip_T_di_ac {
get {
return ResourceManager.GetString("Tooltip_T_di_ac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Average temperature at the diverter.
/// </summary>
internal static string Tooltip_T_di_avg {
get {
return ResourceManager.GetString("Tooltip_T_di_avg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature at the diverter at end of the test last 4 measurement before the end.
/// </summary>
internal static string Tooltip_T_di_en {
get {
return ResourceManager.GetString("Tooltip_T_di_en", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mean temperature at diverter.
/// </summary>
internal static string Tooltip_T_di_me {
get {
return ResourceManager.GetString("Tooltip_T_di_me", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature at the diverter at start of the test first 4 measurements from the start.
/// </summary>
internal static string Tooltip_T_di_st {
get {
return ResourceManager.GetString("Tooltip_T_di_st", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Actual temperature at the outlet.
/// </summary>
internal static string Tooltip_T_dw_ac {
get {
return ResourceManager.GetString("Tooltip_T_dw_ac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Average temperature at the outlet.
/// </summary>
internal static string Tooltip_T_dw_avg {
get {
return ResourceManager.GetString("Tooltip_T_dw_avg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature at the outlet at end of the test last 4 measurement before the end.
/// </summary>
internal static string Tooltip_T_dw_en {
get {
return ResourceManager.GetString("Tooltip_T_dw_en", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mean temperature at outlet.
/// </summary>
internal static string Tooltip_T_dw_me {
get {
return ResourceManager.GetString("Tooltip_T_dw_me", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature at the outlet at start of the test first 4 measurements from the start.
/// </summary>
internal static string Tooltip_T_dw_st {
get {
return ResourceManager.GetString("Tooltip_T_dw_st", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Actual temperature at the inlet.
/// </summary>
internal static string Tooltip_T_up_ac {
get {
return ResourceManager.GetString("Tooltip_T_up_ac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Average temperature at the inlet.
/// </summary>
internal static string Tooltip_T_up_avg {
get {
return ResourceManager.GetString("Tooltip_T_up_avg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature at the inlet at end of the test last 4 measurement before the end.
/// </summary>
internal static string Tooltip_T_up_en {
get {
return ResourceManager.GetString("Tooltip_T_up_en", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mean temperature at inlet.
/// </summary>
internal static string Tooltip_T_up_me {
get {
return ResourceManager.GetString("Tooltip_T_up_me", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature at the inlet at start of the test first 4 measurements from the start.
/// </summary>
internal static string Tooltip_T_up_st {
get {
return ResourceManager.GetString("Tooltip_T_up_st", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Volume measured by the tested meter.
/// </summary>
internal static string Tooltip_Vol_Mt {
get {
return ResourceManager.GetString("Tooltip_Vol_Mt", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Reference volume for tested meter.
/// </summary>
internal static string Tooltip_Vol_rm {
get {
return ResourceManager.GetString("Tooltip_Vol_rm", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Uncertainty.
/// </summary>
@@ -933,6 +1419,87 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Ro.
/// </summary>
internal static string VName_Dens {
get {
return ResourceManager.GetString("VName_Dens", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to E.
/// </summary>
internal static string VName_Error {
get {
return ResourceManager.GetString("VName_Error", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Q.
/// </summary>
internal static string VName_Flow {
get {
return ResourceManager.GetString("VName_Flow", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Hu..
/// </summary>
internal static string VName_Humi {
get {
return ResourceManager.GetString("VName_Humi", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mass.
/// </summary>
internal static string VName_Mass {
get {
return ResourceManager.GetString("VName_Mass", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Press..
/// </summary>
internal static string VName_Press {
get {
return ResourceManager.GetString("VName_Press", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temp..
/// </summary>
internal static string VName_Temp {
get {
return ResourceManager.GetString("VName_Temp", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tau.
/// </summary>
internal static string VName_TstTime {
get {
return ResourceManager.GetString("VName_TstTime", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Vol..
/// </summary>
internal static string VName_Vol {
get {
return ResourceManager.GetString("VName_Vol", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Vol.ref..
/// </summary>
@@ -969,6 +1536,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Water Meter.
/// </summary>
internal static string Water_Meter {
get {
return ResourceManager.GetString("Water_Meter", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Width.
/// </summary>
@@ -1004,5 +1580,14 @@ namespace Results.Resources {
return ResourceManager.GetString("Year", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Yes.
/// </summary>
internal static string Yes {
get {
return ResourceManager.GetString("Yes", resourceCulture);
}
}
}
}
+15
View File
@@ -195,4 +195,19 @@
<data name="Quantity" xml:space="preserve">
<value>Veličina</value>
</data>
<data name="sn" xml:space="preserve">
<value>sériové číslo</value>
</data>
<data name="Water_Meter" xml:space="preserve">
<value>Vodoměr</value>
</data>
<data name="Batch_nr" xml:space="preserve">
<value>Číslo dávky</value>
</data>
<data name="from" xml:space="preserve">
<value>od</value>
</data>
<data name="to" xml:space="preserve">
<value>do</value>
</data>
</root>
+30
View File
@@ -381,4 +381,34 @@
<data name="Quantity" xml:space="preserve">
<value>Größe</value>
</data>
<data name="Page" xml:space="preserve">
<value>Blz.</value>
</data>
<data name="Water_Meter" xml:space="preserve">
<value>Wasserzähler</value>
</data>
<data name="aux" xml:space="preserve">
<value>Nebenz.</value>
</data>
<data name="main" xml:space="preserve">
<value>Hauptz.</value>
</data>
<data name="fall" xml:space="preserve">
<value>fall</value>
</data>
<data name="from" xml:space="preserve">
<value>von</value>
</data>
<data name="rise" xml:space="preserve">
<value>steig</value>
</data>
<data name="to" xml:space="preserve">
<value>bis</value>
</data>
<data name="VName_Mass" xml:space="preserve">
<value>Masse</value>
</data>
<data name="Density_correction" xml:space="preserve">
<value>Dichtekorektur</value>
</data>
</root>
+540
View File
@@ -0,0 +1,540 @@
<?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>
<data name="Add" xml:space="preserve">
<value>aggiungere &gt;</value>
</data>
<data name="Alignment" xml:space="preserve">
<value>allineamento</value>
</data>
<data name="Approval" xml:space="preserve">
<value>Approvazione</value>
</data>
<data name="Available_results" xml:space="preserve">
<value>Risultati disponibili</value>
</data>
<data name="Batch_nr" xml:space="preserve">
<value>lotto n.</value>
</data>
<data name="Bench" xml:space="preserve">
<value>banco</value>
</data>
<data name="CancelBtnText" xml:space="preserve">
<value>Annulla</value>
</data>
<data name="Caption" xml:space="preserve">
<value>didascalia</value>
</data>
<data name="Configuration" xml:space="preserve">
<value>configurazione</value>
</data>
<data name="Density" xml:space="preserve">
<value>densità</value>
</data>
<data name="DownBtnText" xml:space="preserve">
<value>Giù</value>
</data>
<data name="End" xml:space="preserve">
<value>Fine</value>
</data>
<data name="EndState_aux" xml:space="preserve">
<value>fine stato ausiliario</value>
</data>
<data name="EndState_main" xml:space="preserve">
<value>fine stato principale</value>
</data>
<data name="End_state" xml:space="preserve">
<value>fine stato</value>
</data>
<data name="ErrLimHi" xml:space="preserve">
<value>limite errore massimo</value>
</data>
<data name="ErrLimLo" xml:space="preserve">
<value>limite errore minimo</value>
</data>
<data name="Error" xml:space="preserve">
<value>Errore</value>
</data>
<data name="ErrRef" xml:space="preserve">
<value>Err. Ref.</value>
</data>
<data name="Err_aux" xml:space="preserve">
<value>errore ausiliario</value>
</data>
<data name="Err_main" xml:space="preserve">
<value>errore principale</value>
</data>
<data name="Flow" xml:space="preserve">
<value>flusso</value>
</data>
<data name="Format" xml:space="preserve">
<value>formato</value>
</data>
<data name="H_amb" xml:space="preserve">
<value>h ambiente</value>
</data>
<data name="Item" xml:space="preserve">
<value>Oggetto</value>
</data>
<data name="MClass" xml:space="preserve">
<value>classe metrologica</value>
</data>
<data name="OkBtnText" xml:space="preserve">
<value>ok</value>
</data>
<data name="PO" xml:space="preserve">
<value>PO</value>
</data>
<data name="Pos" xml:space="preserve">
<value>pos.</value>
</data>
<data name="Precision" xml:space="preserve">
<value>posizione</value>
</data>
<data name="Procedure" xml:space="preserve">
<value>procedura</value>
</data>
<data name="Producer" xml:space="preserve">
<value>produttore</value>
</data>
<data name="Protocol" xml:space="preserve">
<value>protocollo</value>
</data>
<data name="Pulses" xml:space="preserve">
<value>impulsi </value>
</data>
<data name="PulsesLiter" xml:space="preserve">
<value>impulsi /l</value>
</data>
<data name="P_amb" xml:space="preserve">
<value>P ambiente</value>
</data>
<data name="P_dn_end" xml:space="preserve">
<value>P verso il basso</value>
</data>
<data name="P_dn" xml:space="preserve">
<value>P basso</value>
</data>
<data name="P_dn_start" xml:space="preserve">
<value>P inizio discesa</value>
</data>
<data name="P_up_end" xml:space="preserve">
<value>P fine salita</value>
</data>
<data name="P_up" xml:space="preserve">
<value>P su</value>
</data>
<data name="P_up_start" xml:space="preserve">
<value>P inizio su</value>
</data>
<data name="Q_fall" xml:space="preserve">
<value>caduta di Q</value>
</data>
<data name="Q_from" xml:space="preserve">
<value>da Q</value>
</data>
<data name="Q_rise" xml:space="preserve">
<value>Q aumento</value>
</data>
<data name="Q_to" xml:space="preserve">
<value>Q a</value>
</data>
<data name="RefPulses" xml:space="preserve">
<value>riferimento impulsi</value>
</data>
<data name="Remove" xml:space="preserve">
<value>&lt; rimuovere</value>
</data>
<data name="Remove_all" xml:space="preserve">
<value>rimuovere tutto</value>
</data>
<data name="Result" xml:space="preserve">
<value>risultato</value>
</data>
<data name="Selected_results" xml:space="preserve">
<value>selezionare risultati</value>
</data>
<data name="sn" xml:space="preserve">
<value>s/n</value>
</data>
<data name="sn_aux" xml:space="preserve">
<value>s/n ausiliari</value>
</data>
<data name="sn_main" xml:space="preserve">
<value>s/n principale</value>
</data>
<data name="Start" xml:space="preserve">
<value>avvio</value>
</data>
<data name="Test" xml:space="preserve">
<value>test o prova</value>
</data>
<data name="Test_ID" xml:space="preserve">
<value>prova ID</value>
</data>
<data name="Test_method" xml:space="preserve">
<value>metodo di prova</value>
</data>
<data name="Test_vol" xml:space="preserve">
<value>test vol</value>
</data>
<data name="T_amb" xml:space="preserve">
<value>T amb</value>
</data>
<data name="T_div" xml:space="preserve">
<value>T div</value>
</data>
<data name="T_end" xml:space="preserve">
<value>T fine</value>
</data>
<data name="T_in" xml:space="preserve">
<value>T dentro</value>
</data>
<data name="T_out" xml:space="preserve">
<value>T fuori</value>
</data>
<data name="T_s" xml:space="preserve">
<value>T [s]</value>
</data>
<data name="T_start" xml:space="preserve">
<value>T inizio</value>
</data>
<data name="Uncertainty" xml:space="preserve">
<value>incertezza</value>
</data>
<data name="Units" xml:space="preserve">
<value>unità predefinite</value>
</data>
<data name="UpBtnText" xml:space="preserve">
<value>Su</value>
</data>
<data name="User" xml:space="preserve">
<value>utente</value>
</data>
<data name="User_nr" xml:space="preserve">
<value>utente nr.</value>
</data>
<data name="Ver" xml:space="preserve">
<value>ver</value>
</data>
<data name="VolRef" xml:space="preserve">
<value>riferimento vol.</value>
</data>
<data name="Volume" xml:space="preserve">
<value>Volume</value>
</data>
<data name="Width" xml:space="preserve">
<value>larghezza</value>
</data>
<data name="WMs" xml:space="preserve">
<value>WMs</value>
</data>
<data name="WM_Type" xml:space="preserve">
<value>WM tipo</value>
</data>
<data name="Year" xml:space="preserve">
<value>Anno</value>
</data>
<data name="Results" xml:space="preserve">
<value>risultati</value>
</data>
<data name="Remark" xml:space="preserve">
<value>nota</value>
</data>
<data name="Result_code" xml:space="preserve">
<value>codice risultato</value>
</data>
<data name="Mounting" xml:space="preserve">
<value>montaggio</value>
</data>
<data name="Energy" xml:space="preserve">
<value>energia</value>
</data>
<data name="Energy_ref" xml:space="preserve">
<value>energia ref</value>
</data>
<data name="P_delta" xml:space="preserve">
<value>P delta</value>
</data>
<data name="P_delta_end" xml:space="preserve">
<value>P delta fine</value>
</data>
<data name="P_delta_mean" xml:space="preserve">
<value>P delta significa</value>
</data>
<data name="P_delta_start" xml:space="preserve">
<value>P delta inizio</value>
</data>
<data name="Meter_type" xml:space="preserve">
<value>tipo misura</value>
</data>
<data name="Compound" xml:space="preserve">
<value>composto</value>
</data>
<data name="Heat_meter" xml:space="preserve">
<value>calorimetro</value>
</data>
<data name="Single" xml:space="preserve">
<value>singolo</value>
</data>
<data name="Page" xml:space="preserve">
<value>pagina</value>
</data>
<data name="End_volume" xml:space="preserve">
<value>fine volume</value>
</data>
<data name="Start_volume" xml:space="preserve">
<value>inizio volume</value>
</data>
<data name="End_volume_aux" xml:space="preserve">
<value>fine volume ausiliario</value>
</data>
<data name="End_volume_main" xml:space="preserve">
<value>fine volume principale</value>
</data>
<data name="Start_volume_aux" xml:space="preserve">
<value>inizio volume ausiliario</value>
</data>
<data name="Start_volume_main" xml:space="preserve">
<value>inizio volume principale</value>
</data>
<data name="Volume_aux" xml:space="preserve">
<value>volume ausiliario</value>
</data>
<data name="Volume_main" xml:space="preserve">
<value>volume principale</value>
</data>
<data name="End_mass" xml:space="preserve">
<value>Peso finale</value>
</data>
<data name="Start_mass" xml:space="preserve">
<value>Peso iniziale </value>
</data>
<data name="Category" xml:space="preserve">
<value>Categoria</value>
</data>
<data name="Quantity" xml:space="preserve">
<value>Quantita'</value>
</data>
<data name="Water_Meter" xml:space="preserve">
<value>Contatore acqua</value>
</data>
<data name="VName_Flow" xml:space="preserve">
<value>Q</value>
</data>
<data name="VName_Press" xml:space="preserve">
<value>Pressione </value>
</data>
<data name="VName_Temp" xml:space="preserve">
<value>Temperatura</value>
</data>
<data name="VName_Dens" xml:space="preserve">
<value>Ro</value>
</data>
<data name="VName_Humi" xml:space="preserve">
<value>Hu.</value>
</data>
<data name="VName_Mass" xml:space="preserve">
<value>Peso</value>
</data>
<data name="VName_TstTime" xml:space="preserve">
<value>Tau</value>
</data>
<data name="VName_Vol" xml:space="preserve">
<value>Volume</value>
</data>
<data name="Tooltip_P_de_ac" xml:space="preserve">
<value>Differenza di pressione misurata dal delta P del contatore - valore reale</value>
</data>
<data name="Tooltip_P_de_avg" xml:space="preserve">
<value>Differenza di pressione misurata dal delta P del contatore - valore medio</value>
</data>
<data name="Tooltip_P_de_en" xml:space="preserve">
<value>Differenza di pressione misurata dal delta P del contatore - </value>
</data>
<data name="Tooltip_P_de_me" xml:space="preserve">
<value>Differenza di pressione misurata dal delta P del contatore - media ntegrata</value>
</data>
<data name="Tooltip_P_de_st" xml:space="preserve">
<value>Differenza di pressione misurata dal delta P del contatore - all'inizio del test</value>
</data>
<data name="Tooltip_P_dw_ac" xml:space="preserve">
<value>Pressione reale all'uscita</value>
</data>
<data name="Tooltip_P_dw_avg" xml:space="preserve">
<value>Pressione media all'uscita</value>
</data>
<data name="Tooltip_P_dw_en" xml:space="preserve">
<value>Pressione all'uscita ala fine del test</value>
</data>
<data name="Tooltip_P_dw_me" xml:space="preserve">
<value>Media integrata pressione all'uscita</value>
</data>
<data name="Tooltip_P_dw_st" xml:space="preserve">
<value>Pressione all'uscita all'inizio del test</value>
</data>
<data name="Tooltip_P_up_ac" xml:space="preserve">
<value>Pressione reale all'ingresso</value>
</data>
<data name="Tooltip_P_up_avg" xml:space="preserve">
<value>Pressione media all'ingresso</value>
</data>
<data name="Tooltip_P_up_en" xml:space="preserve">
<value>Pressione all'ingresso alla fine del ttest</value>
</data>
<data name="Tooltip_P_up_me" xml:space="preserve">
<value>Pressione media integrata all'ingreso</value>
</data>
<data name="Tooltip_P_up_st" xml:space="preserve">
<value>Pressione all'ingresso all'inizio del test</value>
</data>
<data name="Tooltip_Q_m_r" xml:space="preserve">
<value>Portata calcolata dalla massa e tempo</value>
</data>
<data name="Tooltip_Q_riac" xml:space="preserve">
<value>Portata ottenuta dal contatore master - reale</value>
</data>
<data name="Tooltip_Q_rim" xml:space="preserve">
<value>Portata ottenuta d contatore master - media integrata</value>
</data>
<data name="Tooltip_Q_v_r" xml:space="preserve">
<value>Portata calcolata dalla massa e tempo convenzionale</value>
</data>
<data name="Tooltip_T_di_ac" xml:space="preserve">
<value>Temperatura reale sul deviatore </value>
</data>
<data name="Tooltip_T_di_avg" xml:space="preserve">
<value>Temperatura media sul deviatore</value>
</data>
<data name="Tooltip_T_di_en" xml:space="preserve">
<value>Temperatura sul deviatore alla fine del test </value>
</data>
<data name="Test_done" xml:space="preserve">
<value>Test terminato</value>
</data>
<data name="Test_passed" xml:space="preserve">
<value>Test OK</value>
</data>
<data name="No" xml:space="preserve">
<value>No</value>
</data>
<data name="Yes" xml:space="preserve">
<value>Sì</value>
</data>
</root>
+18
View File
@@ -420,4 +420,22 @@
<data name="Volume_main" xml:space="preserve">
<value>Objętość główna</value>
</data>
<data name="aux" xml:space="preserve">
<value>dodatkowy</value>
</data>
<data name="main" xml:space="preserve">
<value>główny</value>
</data>
<data name="fall" xml:space="preserve">
<value>obniżanie</value>
</data>
<data name="from" xml:space="preserve">
<value>od</value>
</data>
<data name="rise" xml:space="preserve">
<value>zwiększanie</value>
</data>
<data name="to" xml:space="preserve">
<value>do</value>
</data>
</root>
+196 -1
View File
@@ -172,7 +172,7 @@
<value>Error</value>
</data>
<data name="ErrRef" xml:space="preserve">
<value>Err.ref.</value>
<value>E rel. ref.</value>
</data>
<data name="Err_aux" xml:space="preserve">
<value>Err. aux.</value>
@@ -432,4 +432,199 @@
<data name="Quantity" xml:space="preserve">
<value>Quantity</value>
</data>
<data name="Water_Meter" xml:space="preserve">
<value>Water Meter</value>
</data>
<data name="VName_Flow" xml:space="preserve">
<value>Q</value>
</data>
<data name="VName_Press" xml:space="preserve">
<value>Press.</value>
</data>
<data name="VName_Temp" xml:space="preserve">
<value>Temp.</value>
</data>
<data name="VName_Dens" xml:space="preserve">
<value>Ro</value>
</data>
<data name="VName_Humi" xml:space="preserve">
<value>Hu.</value>
</data>
<data name="VName_Mass" xml:space="preserve">
<value>Mass</value>
</data>
<data name="VName_TstTime" xml:space="preserve">
<value>Tau</value>
</data>
<data name="VName_Vol" xml:space="preserve">
<value>Vol.</value>
</data>
<data name="Tooltip_P_de_ac" xml:space="preserve">
<value>Pressure difference measured by delta P meter - actual</value>
</data>
<data name="Tooltip_P_de_avg" xml:space="preserve">
<value>Pressure difference measured by delta P meter - average</value>
</data>
<data name="Tooltip_P_de_en" xml:space="preserve">
<value>Pressure difference measured by delta P meter - at the end of the test</value>
</data>
<data name="Tooltip_P_de_me" xml:space="preserve">
<value>Pressure difference measured by delta P meter - mean</value>
</data>
<data name="Tooltip_P_de_st" xml:space="preserve">
<value>Pressure difference measured by delta P meter - at the start of the test</value>
</data>
<data name="Tooltip_P_dw_ac" xml:space="preserve">
<value>Pressure at the outlet actual</value>
</data>
<data name="Tooltip_P_dw_avg" xml:space="preserve">
<value>Average pressure at the outlet</value>
</data>
<data name="Tooltip_P_dw_en" xml:space="preserve">
<value>Pressure at the outlet at end of the test</value>
</data>
<data name="Tooltip_P_dw_me" xml:space="preserve">
<value>Mean pressure at the outlet</value>
</data>
<data name="Tooltip_P_dw_st" xml:space="preserve">
<value>Pressure at the outlet at start of the test</value>
</data>
<data name="Tooltip_P_up_ac" xml:space="preserve">
<value>Pressure at the inlet actual</value>
</data>
<data name="Tooltip_P_up_avg" xml:space="preserve">
<value>Average pressure at the inlet</value>
</data>
<data name="Tooltip_P_up_en" xml:space="preserve">
<value>Pressure at the inlet at end of the test</value>
</data>
<data name="Tooltip_P_up_me" xml:space="preserve">
<value>Mean pressure at the inlet</value>
</data>
<data name="Tooltip_P_up_st" xml:space="preserve">
<value>Pressure at the inlet at start of the test</value>
</data>
<data name="Tooltip_Q_m_r" xml:space="preserve">
<value>Flow calculated from conventional true mass and time</value>
</data>
<data name="Tooltip_Q_riac" xml:space="preserve">
<value>Flow obtained from the master meter - actual</value>
</data>
<data name="Tooltip_Q_rim" xml:space="preserve">
<value>Flow obtained from the master meter - mean</value>
</data>
<data name="Tooltip_Q_v_r" xml:space="preserve">
<value>Flow calculated from conventional true volume and the time</value>
</data>
<data name="Tooltip_T_di_ac" xml:space="preserve">
<value>Actual temperature at the diverter</value>
</data>
<data name="Tooltip_T_di_avg" xml:space="preserve">
<value>Average temperature at the diverter</value>
</data>
<data name="Tooltip_T_di_en" xml:space="preserve">
<value>Temperature at the diverter at end of the test last 4 measurement before the end</value>
</data>
<data name="Tooltip_T_di_me" xml:space="preserve">
<value>Mean temperature at diverter</value>
</data>
<data name="Tooltip_T_di_st" xml:space="preserve">
<value>Temperature at the diverter at start of the test first 4 measurements from the start</value>
</data>
<data name="Tooltip_T_dw_ac" xml:space="preserve">
<value>Actual temperature at the outlet</value>
</data>
<data name="Tooltip_T_dw_avg" xml:space="preserve">
<value>Average temperature at the outlet</value>
</data>
<data name="Tooltip_T_dw_en" xml:space="preserve">
<value>Temperature at the outlet at end of the test last 4 measurement before the end</value>
</data>
<data name="Tooltip_T_dw_me" xml:space="preserve">
<value>Mean temperature at outlet</value>
</data>
<data name="Tooltip_T_dw_st" xml:space="preserve">
<value>Temperature at the outlet at start of the test first 4 measurements from the start</value>
</data>
<data name="Tooltip_T_up_ac" xml:space="preserve">
<value>Actual temperature at the inlet</value>
</data>
<data name="Tooltip_T_up_avg" xml:space="preserve">
<value>Average temperature at the inlet</value>
</data>
<data name="Tooltip_T_up_en" xml:space="preserve">
<value>Temperature at the inlet at end of the test last 4 measurement before the end</value>
</data>
<data name="Tooltip_T_up_me" xml:space="preserve">
<value>Mean temperature at inlet</value>
</data>
<data name="Tooltip_T_up_st" xml:space="preserve">
<value>Temperature at the inlet at start of the test first 4 measurements from the start</value>
</data>
<data name="aux" xml:space="preserve">
<value>aux.</value>
</data>
<data name="main" xml:space="preserve">
<value>main</value>
</data>
<data name="Tooltip_E_rel" xml:space="preserve">
<value>Relative error of a meter</value>
</data>
<data name="Tooltip_E_rel_ref" xml:space="preserve">
<value>Relative error of the master meter</value>
</data>
<data name="Tooltip_sn" xml:space="preserve">
<value>Serial number of the meter</value>
</data>
<data name="Tooltip_sn_aux" xml:space="preserve">
<value>Serial number of the auxiliary meter of a compound water meter</value>
</data>
<data name="Tooltip_sn_main" xml:space="preserve">
<value>Serial number of the main meter of a compound water meter</value>
</data>
<data name="Tooltip_Vol_Mt" xml:space="preserve">
<value>Volume measured by the tested meter</value>
</data>
<data name="Tooltip_Vol_rm" xml:space="preserve">
<value>Reference volume for tested meter</value>
</data>
<data name="VName_Error" xml:space="preserve">
<value>E</value>
</data>
<data name="fall" xml:space="preserve">
<value>fall</value>
</data>
<data name="from" xml:space="preserve">
<value>from</value>
</data>
<data name="rise" xml:space="preserve">
<value>rise</value>
</data>
<data name="to" xml:space="preserve">
<value>to</value>
</data>
<data name="Tooltip_Hu_Amb_M" xml:space="preserve">
<value>Ambient humidity during test</value>
</data>
<data name="Tooltip_P_Amb_M" xml:space="preserve">
<value>Ambient pressure during test</value>
</data>
<data name="Tooltip_T_Amb_M" xml:space="preserve">
<value>Ambient temperature during test</value>
</data>
<data name="Test_done" xml:space="preserve">
<value>Test done</value>
</data>
<data name="Test_passed" xml:space="preserve">
<value>Test passed</value>
</data>
<data name="No" xml:space="preserve">
<value>No</value>
</data>
<data name="Yes" xml:space="preserve">
<value>Yes</value>
</data>
<data name="Density_correction" xml:space="preserve">
<value>Density correction</value>
</data>
</root>
+9
View File
@@ -420,4 +420,13 @@
<data name="Volume_main" xml:space="preserve">
<value>Объем главн.</value>
</data>
<data name="aux" xml:space="preserve">
<value>доп.</value>
</data>
<data name="main" xml:space="preserve">
<value>главн.</value>
</data>
<data name="VName_Vol" xml:space="preserve">
<value>Объем</value>
</data>
</root>
+19 -1
View File
@@ -77,6 +77,12 @@
<Compile Include="Forms\ListViewEx.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Forms\ResultsConfigCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\ResultsConfigCtrl.Designer.cs">
<DependentUpon>ResultsConfigCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Forms\ResultsConfigDlg.cs">
<SubType>Form</SubType>
</Compile>
@@ -94,9 +100,17 @@
<Compile Include="Output\Printers\Cevak\PrintDocumentCevak.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Output\Printers\Enhanced\EnhancedPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Output\Printers\Enhanced\EnhancedPrinterCfg.cs" />
<Compile Include="Output\Printers\Munich\MunichPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Output\Printers\OnePagePerMeter\EnhancedPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Output\Printers\OnePagePerMeter\EnhancedPrinterCfg.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ItemSpec.cs" />
<Compile Include="Properties\Resources.Designer.cs">
@@ -123,9 +137,9 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="FileWriters\" />
<Folder Include="Output\FileWriters\Basic\" />
<Folder Include="Output\FileWriters\Enhanced\" />
<Folder Include="Output\FileWriters\OneFilePerMeter\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Forms\BatchResultsDlg.resx">
@@ -134,6 +148,9 @@
<EmbeddedResource Include="Forms\ListViewEx.resx">
<DependentUpon>ListViewEx.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ResultsConfigCtrl.resx">
<DependentUpon>ResultsConfigCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ResultsConfigDlg.resx">
<DependentUpon>ResultsConfigDlg.cs</DependentUpon>
</EmbeddedResource>
@@ -145,6 +162,7 @@
<EmbeddedResource Include="Resources\Strings.de.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Strings.it.resx" />
<EmbeddedResource Include="Resources\Strings.pl.resx" />
<EmbeddedResource Include="Resources\Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
+188 -101
View File
@@ -99,20 +99,32 @@ namespace Results
}
///
/// Constructorwithot ToolTip text
/// Constructor without ToolTip text
///
public WMeterRsltItemSpec(ItemID itemId, string name, Quantity quantity, ItemCategory category, PrintDlgt printDlgt)
{
Uid = (int)itemId;
OldUid = itemId.ToString().Replace("__", "/").Replace('_', ' ');
Name = name;
ToolTipText = string.Format("{0} bla, bla, bla", Name);
ToolTipText = null;
Quantity = quantity;
Category = category;
this.printDlgt = printDlgt;
}
/// <summary>
/// Get precision string
/// </summary>
/// <param name="p1">Parameter</param>
/// <param name="p2">Default value when p1 is empty</param>
/// <returns>Precision</returns>
static string GetPr(string p1, string p2)
{
return string.IsNullOrEmpty(p1) ? p2 : p1;
}
/// Static list of all available items
public static readonly IList<WMeterRsltItemSpec> AllItems;
@@ -128,50 +140,122 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Procedure_name, Strings.Procedure, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.ProcedureName()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_number, Strings.Batch_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => w.BatchNr().ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_method, Strings.Test_method + " *", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Method()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density, Strings.Density + " *", Quantity.Density, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).DensityOut.ToString(string.IsNullOrEmpty(p) ? "F1" : p))); /// [kg/m3]
/// Target values
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, Strings.Q_from + "()", Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qfrom().ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, Strings.Q_to + "()", Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qto().ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TargetVolume()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Lo, Strings.ErrLimLo + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimLo()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Hi, Strings.ErrLimHi + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimHi()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Uncertainty().ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
///
/// Volume
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TargetVolume()).ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, string.Format("{0} Mt. ()", Strings.VName_Vol), Strings.Tooltip_Vol_Mt, Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_volume, string.Format("{0} rm ()", Strings.VName_Vol), Strings.Tooltip_Vol_rm, Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeRef).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.main), Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.aux), Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_main, Strings.Start_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(GetPr(p, "F3"))));
/// Test results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_start_time, Strings.T_start + "()", Quantity.DateTime, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).StartTime.ToString() : string.Format(f, w.GetTestRslt(t).StartTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_end_time, Strings.T_end + "()", Quantity.DateTime, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).EndTime.ToString() : string.Format(f, w.GetTestRslt(t).EndTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).TestTime.ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, Strings.Flow + "()", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Utils.DoubleToStr(Config.Units.ConvertTo(u, w.GetTestRslt(t).FlowVolume), 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_mean, Strings.T_in + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempUpMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_mean, Strings.T_out + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDownMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div, Strings.T_div + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDivMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up, Strings.P_up + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_start, Strings.P_up_start + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_end, Strings.P_up_end + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down, Strings.P_dn + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_start, Strings.P_dn_start + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_end, Strings.P_dn_end + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean, Strings.P_delta + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_start, Strings.P_delta_start + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_end, Strings.P_delta_end + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error, Strings.ErrRef + "()", Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrorMaster).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_temperature, Strings.T_amb + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientTempAve()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbTempMean).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_pressure, Strings.P_amb + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientPressAve()).ToString(string.IsNullOrEmpty(p) ? "F0" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbPressMean).ToString(string.IsNullOrEmpty(p) ? "F0" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_humidity, Strings.H_amb + "()", Quantity.Humidity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientHumiAve()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbHumiMean).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
///
/// Mass
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_start_raw, string.Format("{0} ST raw ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).MassStartRaw).ToString(GetPr(p, "F4"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_start, string.Format("{0} ST ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).MassStart).ToString(GetPr(p, "F4"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_end_raw, string.Format("{0} EN raw ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).MassEndRaw).ToString(GetPr(p, "F4"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_end, string.Format("{0} EN ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).MassEnd).ToString(GetPr(p, "F4"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass, string.Format("{0} ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).MassEnd - w.GetTestRslt(t).MassStart).ToString(GetPr(p, "F4"))));
/// Single and combined meter results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, Strings.Volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_volume, Strings.VolRef + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeRef).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
#if TURA_IPERL || TURA_SPECIAL
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, Strings.Error + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
#else
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, Strings.Error + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
///
/// Density
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density, Strings.Density + " ()", Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).DensityOut.ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density_correction, Strings.Density_correction + " ()", Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => w.Batch.DensityCorr.ToString(GetPr(p, "F3"))));
///
/// Time (duration), date and time
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_start_time, Strings.T_start + "()", Quantity.DateTime, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).StartTime.ToString() : string.Format(f, w.GetTestRslt(t).StartTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_end_time, Strings.T_end + "()", Quantity.DateTime, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).EndTime.ToString() : string.Format(f, w.GetTestRslt(t).EndTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).TestTime.ToString(GetPr(p, "F2"))));
///
/// Flow
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qfrom().ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qto().ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Utils.DoubleToStr(Config.Units.ConvertTo(u, w.GetTestRslt(t).FlowVolume), 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, string.Format("{0} {1}", Strings.VName_Flow, Strings.rise), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : Utils.DoubleToStr(w.QRise, 4)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, string.Format("{0} {1}", Strings.VName_Flow, Strings.fall), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QFall == 0) ? "-" : Utils.DoubleToStr(w.QFall, 4)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} rim ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Utils.DoubleToStr(Config.Units.ConvertTo(u, w.GetTestRslt(t).FlowMean), 4)));
///
/// Temperature
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_mean, string.Format("{0} UP ME ()", Strings.VName_Temp), Strings.Tooltip_T_up_me, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempUpMean).ToString(GetPr(p, "F2"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_start, string.Format("{0} UP ST ()", Strings.VName_Temp), Strings.Tooltip_T_up_st, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempUpStart).ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_end, string.Format("{0} UP EN ()", Strings.VName_Temp), Strings.Tooltip_T_up_en, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempUpEnd).ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_avg, string.Format("{0} UP avg ()", Strings.VName_Temp), Strings.Tooltip_T_up_avg, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).TempUpStart + w.GetTestRslt(t).TempUpEnd) / 2).ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_mean, string.Format("{0} DW ME ()", Strings.VName_Temp), Strings.Tooltip_T_dw_me, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDownMean).ToString(GetPr(p, "F2"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_start, string.Format("{0} DW ST ()", Strings.VName_Temp), Strings.Tooltip_T_dw_st, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDownStart).ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_end, string.Format("{0} DW EN ()", Strings.VName_Temp), Strings.Tooltip_T_dw_en, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDownEnd).ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_avg, string.Format("{0} DW avg ()", Strings.VName_Temp), Strings.Tooltip_T_dw_avg, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).TempDownStart + w.GetTestRslt(t).TempDownEnd) / 2).ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div, string.Format("{0} DI ME ()", Strings.VName_Temp), Strings.Tooltip_T_di_me, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDivMean).ToString(GetPr(p, "F2"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_start, string.Format("{0} DI ST ()", Strings.VName_Temp), Strings.Tooltip_T_di_st, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDivStart).ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_end, string.Format("{0} DI EN ()", Strings.VName_Temp), Strings.Tooltip_T_di_en, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDivEnd).ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_avg, string.Format("{0} DI avg ()", Strings.VName_Temp), Strings.Tooltip_T_di_avg, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).TempDivStart + w.GetTestRslt(t).TempDivEnd) / 2).ToString(GetPr(p, "F1"))));
#if HEAT_METERS
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_mean, string.Format("{0} hi me", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom1).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_start, string.Format("{0} hi st", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom2).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_end, string.Format("{0} hi en", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom3).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_avg, string.Format("{0} hi av", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).Custom2 + w.GetTestRslt(t).Custom3) / 2).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_mean, string.Format("{0} lo me", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom6).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_start, string.Format("{0} lo st", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom7).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_end, string.Format("{0} lo en", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom8).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_avg, string.Format("{0} lo av", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).Custom7 + w.GetTestRslt(t).Custom8) / 2).ToString(GetPr(p, "F3"))));
#endif
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed, Strings.Result + "()", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr()));
///
/// Pressure
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up, string.Format("{0} UP ME ()", Strings.VName_Press), Strings.Tooltip_P_up_me, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpMean).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_start, string.Format("{0} UP ST ()", Strings.VName_Press), Strings.Tooltip_P_up_st, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpStart).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_end, string.Format("{0} UP EN ()", Strings.VName_Press), Strings.Tooltip_P_up_en, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpEnd).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_avg, string.Format("{0} UP avg ()", Strings.VName_Press), Strings.Tooltip_P_up_avg, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).PressUpStart + w.GetTestRslt(t).PressUpEnd) / 2).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down, string.Format("{0} DW ME ()", Strings.VName_Press), Strings.Tooltip_P_dw_me, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownMean).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_start, string.Format("{0} DW ST ()", Strings.VName_Press), Strings.Tooltip_P_dw_st, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownStart).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_end, string.Format("{0} DW EN ()", Strings.VName_Press), Strings.Tooltip_P_dw_en, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownEnd).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_avg, string.Format("{0} DW avg ()", Strings.VName_Press), Strings.Tooltip_P_dw_avg, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).PressDownStart + w.GetTestRslt(t).PressDownEnd) / 2).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean, string.Format("{0} DE ME ()", Strings.VName_Press), Strings.Tooltip_P_de_me, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaMean).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_start, string.Format("{0} DE ST ()", Strings.VName_Press), Strings.Tooltip_P_de_st, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaStart).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_end, string.Format("{0} DE EN ()", Strings.VName_Press), Strings.Tooltip_P_de_en, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaEnd).ToString(GetPr(p, "F3"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_avg, string.Format("{0} DE avg ()", Strings.VName_Press), Strings.Tooltip_P_de_avg, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).PressDeltaStart + w.GetTestRslt(t).PressDeltaEnd) / 2).ToString(GetPr(p, "F3"))));
///
/// Ambient temperature/pressure/humidity/Buoyancy
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_temperature, string.Format("{0} Amb M", Strings.VName_Temp), Strings.Tooltip_T_Amb_M, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbTempMean()).ToString(GetPr(p, "F1")) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbTempMean).ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_pressure, string.Format("{0} Amb M", Strings.VName_Press), Strings.Tooltip_P_Amb_M, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbPressMean()).ToString(GetPr(p, "F0")) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbPressMean).ToString(GetPr(p, "F0"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_humidity, string.Format("{0} Amb M", Strings.VName_Humi), Strings.Tooltip_Hu_Amb_M, Quantity.Humidity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbHumiMean()).ToString(GetPr(p, "F1")) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbHumiMean).ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Buoyancy, "Buoyancy ()", Quantity.Number, ItemCategory.TestResult, (w, t, u, f, p) => string.IsNullOrEmpty(t) ? w.Batch.Buoyancy().ToString(GetPr(p, "F5")) : ((w.GetTestRslt(t) != null) ? w.GetTestRslt(t).Buoyancy.ToString(GetPr(p, "F5")) : "")));
///
/// Error
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Lo, Strings.ErrLimLo + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimLo()).ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Hi, Strings.ErrLimHi + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimHi()).ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Uncertainty().ToString(GetPr(p, "F2"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error, string.Format("{0} rel.ref. ()", Strings.VName_Error), Strings.Tooltip_E_rel_ref, Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrorMaster).ToString(GetPr(p, "F3"))));
#if TURA_IPERL || TURA_SPECIAL
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(GetPr(p, "F2"))));
#else
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(GetPr(p, "F2"))));
#endif
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed, Strings.Result, Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => string.IsNullOrEmpty(t) ? w.PassedColorStr() : ((w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr())));
///
/// Water meter info
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeter_type, Strings.WM_Type, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.ProductName));
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeter_type, Strings.WM_Type, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.ProductName));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Producer, Strings.Producer, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.Producer));
AllItems.Add(new WMeterRsltItemSpec(ItemID.DN, "DN", Quantity.Length, ItemCategory.MeterData, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? Config.Units.ConvertTo(u, w.WaterMeterData.DN).ToString()
@@ -199,7 +283,7 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Certificate, "Certificate", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.Certificate));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses_per_liter, Strings.PulsesLiter, Quantity.PulsePerLtr, ItemCategory.MeterData, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? w.WaterMeterData.PulsesPerLtr.ToString()
: w.WaterMeterData.PulsesPerLtr.ToString(p)));
: w.WaterMeterData.PulsesPerLtr.ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text1, "Text1", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.WaterMeterData.Text1));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text2, "Text2", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.WaterMeterData.Text2));
@@ -208,7 +292,7 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text5, "Text5", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.WaterMeterData.Text5));
/// Water meters results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr, Strings.sn, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.SerialNr));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr, Strings.sn, Strings.Tooltip_sn, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.SerialNr));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Purchase_order, Strings.PO, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.PurchaseOrder));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Year_of_production, Strings.Year, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => w.YearOfProduction.ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.WM_Position, Strings.Pos, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => w.WMPosition.ToString()));
@@ -221,14 +305,11 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_pulses, Strings.RefPulses + "()", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PulsesMaster.ToString()));
/// Water meters results (combined)
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, Strings.Q_rise, Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (w.QRise == 0) ? "-" : Utils.DoubleToStr(w.QRise, 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, Strings.Q_fall, Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (w.QFall == 0) ? "-" : Utils.DoubleToStr(w.QFall, 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_main, Strings.Err_main + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : (string.IsNullOrEmpty(p) ? w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error.ToString()
: w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error.ToString(p))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_main, Strings.Err_main + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : (string.IsNullOrEmpty(p) ? w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error.ToString() : w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error.ToString(p))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_aux, Strings.Err_aux + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : (string.IsNullOrEmpty(p) ? w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).Error.ToString()
: w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).Error.ToString(p))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_main, Strings.sn_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.SerialNr));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_aux, Strings.sn_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.SerialNrAux));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_main, string.Format("{0} {1}", Strings.sn, Strings.main), Strings.Tooltip_sn_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.SerialNr));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_aux, string.Format("{0} {1}", Strings.sn, Strings.aux), Strings.Tooltip_sn_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.SerialNrAux));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_main, Strings.EndState_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.EndState));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_aux, Strings.EndState_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.EndStateAux));
@@ -248,27 +329,23 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Remark, Strings.Remark, Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => w.Batch.Remark));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Meter_type, Strings.Meter_type, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.WaterMeterData.Compound ? Strings.Compound : (w.WaterMeterData.HeatMeter ? Strings.Heat_meter : Strings.Single)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, Strings.Volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, Strings.Volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_main, Strings.Start_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
#if HEAT_METERS
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiMean, "T hi me", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom1).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiStart, "T hi st", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiEnd, "T hi en", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom3).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiAve, "T hi av", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).Custom2 + w.GetTestRslt(t).Custom3) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoMean, "T lo me", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom6).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoStart, "T lo st", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom7).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoEnd, "T lo en", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom8).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoAve, "T lo av", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).Custom7 + w.GetTestRslt(t).Custom8) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeMeter).ToString(GetPr(p, "F1"))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef).ToString(GetPr(p, "F1"))));
#endif
#if IPERL
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactor, "iPerl OrigCalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => (w.OrigCalibFactor.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactor, "iPerl CalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => (w.CalibFactor.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2ErrWOCorrection.ToString(GetPr(p, "F2")))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrectionDone ? "yes" : "no")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2CorrRFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrRFlow.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2CorrLFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrLFlow.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrFlowRight, "iPerl Q2CorrFlowRight", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrFlowRight.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.FW_Version, "iPerl FW version", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => (w.FWVersion)));
#endif
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestDone, Strings.Test_done + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) != null && w.GetMeterTestRslt(t).TestDone) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestPassed, Strings.Test_passed + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) != null && w.GetMeterTestRslt(t).Passed) ? Strings.Yes : Strings.No));
}
/// <summary>
@@ -310,14 +387,44 @@ namespace Results
{
try
{
if (strArray[i].Contains("~"))
WMeterRsltItemSpec item;
string[] field = strArray[i].Split(new char[] { '~' });
if (!strArray[i].Contains("~"))
{
///
/// Old style results item specification -> convert it
///
bool added = false;
foreach (var it in AllItems)
{
if (strArray[i].Equals(it.OldUid))
{
item = it.Clone();
item.Caption = item.Name.Replace("()", "").Replace(" *", "");
item.Units = 0; /// use default units
item.Format = null; /// the same like format string "{0}"
item.Precision = null;
item.Width = 0; /// do not ad any extra spaces
item.Alignment = Alignment.Left;
result.Add(item);
added = true;
break;
}
}
if (!added)
{
item = GetItem(0);
item.Caption = "Prs.Err.";
item.Format = string.Format("Parse error: {0}", strArray[i]);
result.Add(item);
}
}
else if ((item = GetItem(int.Parse(field[0]))) != null)
{
///
/// Load the new style results item specification
///
string[] field = strArray[i].Split(new char[] { '~' });
WMeterRsltItemSpec item = GetItem(int.Parse(field[0]));
item.Caption = field[1];
item.TestID = field[2];
item.Units = 0;
@@ -336,36 +443,16 @@ namespace Results
result.Add(item);
}
else
{
///
/// Try to load the old style results item specification
///
bool added = false;
foreach (var it in AllItems)
{
if (strArray[i].Equals(it.OldUid))
{
WMeterRsltItemSpec item = it.Clone();
item.Caption = item.Name.Replace("()", "").Replace(" *", "");
item.Units = 0; /// use default units
item.Format = null; /// the same like format string "{0}"
item.Precision = null;
item.Width = 0; /// do not ad any extra spaces
item.Alignment = Alignment.Left;
result.Add(item);
added = true;
break;
}
}
if (!added)
{
WMeterRsltItemSpec item = GetItem(0);
item.Caption = "Prs.Err.";
item.Format = string.Format("Parse error: {0}", strArray[i]);
result.Add(item);
}
}
else
{
///
/// Create an item with parse error information
///
WMeterRsltItemSpec item2 = GetItem(0);
item2.Caption = "Prs.Err.";
item2.Format = string.Format("Parse error: {0}", strArray[i]);
result.Add(item2);
}
}
catch
{
+202 -156
View File
@@ -28,162 +28,204 @@
/// </summary>
private void InitializeComponent()
{
this.connectionStringTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameLabel = new System.Windows.Forms.Label();
this.connectionStringLabel = new System.Windows.Forms.Label();
this.connectionStringTextBox2 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox3 = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.benchNameTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameTextBox2 = new System.Windows.Forms.TextBox();
this.benchNameTextBox3 = new System.Windows.Forms.TextBox();
this.languageLabel = new System.Windows.Forms.Label();
this.languageTextBox = new System.Windows.Forms.TextBox();
this.formatLabel = new System.Windows.Forms.Label();
this.timePeriodFormatTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// connectionStringTextBox1
//
this.connectionStringTextBox1.Location = new System.Drawing.Point(157, 45);
this.connectionStringTextBox1.Name = "connectionStringTextBox1";
this.connectionStringTextBox1.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox1.TabIndex = 0;
//
// benchNameLabel
//
this.benchNameLabel.AutoSize = true;
this.benchNameLabel.Location = new System.Drawing.Point(26, 20);
this.benchNameLabel.Name = "benchNameLabel";
this.benchNameLabel.Size = new System.Drawing.Size(67, 13);
this.benchNameLabel.TabIndex = 1;
this.benchNameLabel.Text = "Bench name";
//
// connectionStringLabel
//
this.connectionStringLabel.AutoSize = true;
this.connectionStringLabel.Location = new System.Drawing.Point(154, 20);
this.connectionStringLabel.Name = "connectionStringLabel";
this.connectionStringLabel.Size = new System.Drawing.Size(89, 13);
this.connectionStringLabel.TabIndex = 3;
this.connectionStringLabel.Text = "Connection string";
//
// connectionStringTextBox2
//
this.connectionStringTextBox2.Location = new System.Drawing.Point(157, 71);
this.connectionStringTextBox2.Name = "connectionStringTextBox2";
this.connectionStringTextBox2.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox2.TabIndex = 2;
//
// connectionStringTextBox3
//
this.connectionStringTextBox3.Location = new System.Drawing.Point(157, 97);
this.connectionStringTextBox3.Name = "connectionStringTextBox3";
this.connectionStringTextBox3.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox3.TabIndex = 4;
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(506, 194);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(95, 38);
this.okButton.TabIndex = 6;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(617, 194);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(95, 38);
this.cancelButton.TabIndex = 7;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// benchNameTextBox1
//
this.benchNameTextBox1.Location = new System.Drawing.Point(29, 45);
this.benchNameTextBox1.Name = "benchNameTextBox1";
this.benchNameTextBox1.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox1.TabIndex = 8;
//
// benchNameTextBox2
//
this.benchNameTextBox2.Location = new System.Drawing.Point(29, 71);
this.benchNameTextBox2.Name = "benchNameTextBox2";
this.benchNameTextBox2.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox2.TabIndex = 9;
//
// benchNameTextBox3
//
this.benchNameTextBox3.Location = new System.Drawing.Point(29, 97);
this.benchNameTextBox3.Name = "benchNameTextBox3";
this.benchNameTextBox3.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox3.TabIndex = 10;
//
// languageLabel
//
this.languageLabel.AutoSize = true;
this.languageLabel.Location = new System.Drawing.Point(26, 183);
this.languageLabel.Name = "languageLabel";
this.languageLabel.Size = new System.Drawing.Size(55, 13);
this.languageLabel.TabIndex = 11;
this.languageLabel.Text = "Language";
//
// languageTextBox
//
this.languageTextBox.Location = new System.Drawing.Point(29, 207);
this.languageTextBox.Name = "languageTextBox";
this.languageTextBox.Size = new System.Drawing.Size(100, 20);
this.languageTextBox.TabIndex = 12;
//
// formatLabel
//
this.formatLabel.AutoSize = true;
this.formatLabel.Location = new System.Drawing.Point(26, 129);
this.formatLabel.Name = "formatLabel";
this.formatLabel.Size = new System.Drawing.Size(39, 13);
this.formatLabel.TabIndex = 13;
this.formatLabel.Text = "Format";
//
// timePeriodFormatTextBox
//
this.timePeriodFormatTextBox.Location = new System.Drawing.Point(29, 151);
this.timePeriodFormatTextBox.Name = "timePeriodFormatTextBox";
this.timePeriodFormatTextBox.Size = new System.Drawing.Size(683, 20);
this.timePeriodFormatTextBox.TabIndex = 14;
//
// DatabaseSettingsDlg
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(743, 254);
this.Controls.Add(this.timePeriodFormatTextBox);
this.Controls.Add(this.formatLabel);
this.Controls.Add(this.languageTextBox);
this.Controls.Add(this.languageLabel);
this.Controls.Add(this.benchNameTextBox3);
this.Controls.Add(this.benchNameTextBox2);
this.Controls.Add(this.benchNameTextBox1);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.connectionStringTextBox3);
this.Controls.Add(this.connectionStringLabel);
this.Controls.Add(this.connectionStringTextBox2);
this.Controls.Add(this.benchNameLabel);
this.Controls.Add(this.connectionStringTextBox1);
this.Name = "DatabaseSettingsDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Database Settings";
this.Load += new System.EventHandler(this.DatabaseSettings_Load);
this.ResumeLayout(false);
this.PerformLayout();
this.connectionStringTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameLabel = new System.Windows.Forms.Label();
this.connectionStringLabel = new System.Windows.Forms.Label();
this.connectionStringTextBox2 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox3 = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.benchNameTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameTextBox2 = new System.Windows.Forms.TextBox();
this.benchNameTextBox3 = new System.Windows.Forms.TextBox();
this.languageLabel = new System.Windows.Forms.Label();
this.languageTextBox = new System.Windows.Forms.TextBox();
this.formatLabel = new System.Windows.Forms.Label();
this.timePeriodFormatTextBox = new System.Windows.Forms.TextBox();
this.benchNameTextBox5 = new System.Windows.Forms.TextBox();
this.benchNameTextBox4 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox5 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox4 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// connectionStringTextBox1
//
this.connectionStringTextBox1.Location = new System.Drawing.Point(157, 45);
this.connectionStringTextBox1.Name = "connectionStringTextBox1";
this.connectionStringTextBox1.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox1.TabIndex = 3;
//
// benchNameLabel
//
this.benchNameLabel.AutoSize = true;
this.benchNameLabel.Location = new System.Drawing.Point(26, 20);
this.benchNameLabel.Name = "benchNameLabel";
this.benchNameLabel.Size = new System.Drawing.Size(67, 13);
this.benchNameLabel.TabIndex = 0;
this.benchNameLabel.Text = "Bench name";
//
// connectionStringLabel
//
this.connectionStringLabel.AutoSize = true;
this.connectionStringLabel.Location = new System.Drawing.Point(154, 20);
this.connectionStringLabel.Name = "connectionStringLabel";
this.connectionStringLabel.Size = new System.Drawing.Size(89, 13);
this.connectionStringLabel.TabIndex = 1;
this.connectionStringLabel.Text = "Connection string";
//
// connectionStringTextBox2
//
this.connectionStringTextBox2.Location = new System.Drawing.Point(157, 71);
this.connectionStringTextBox2.Name = "connectionStringTextBox2";
this.connectionStringTextBox2.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox2.TabIndex = 5;
//
// connectionStringTextBox3
//
this.connectionStringTextBox3.Location = new System.Drawing.Point(157, 97);
this.connectionStringTextBox3.Name = "connectionStringTextBox3";
this.connectionStringTextBox3.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox3.TabIndex = 7;
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(506, 250);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(95, 38);
this.okButton.TabIndex = 16;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(617, 250);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(95, 38);
this.cancelButton.TabIndex = 17;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// benchNameTextBox1
//
this.benchNameTextBox1.Location = new System.Drawing.Point(29, 45);
this.benchNameTextBox1.Name = "benchNameTextBox1";
this.benchNameTextBox1.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox1.TabIndex = 2;
//
// benchNameTextBox2
//
this.benchNameTextBox2.Location = new System.Drawing.Point(29, 71);
this.benchNameTextBox2.Name = "benchNameTextBox2";
this.benchNameTextBox2.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox2.TabIndex = 4;
//
// benchNameTextBox3
//
this.benchNameTextBox3.Location = new System.Drawing.Point(29, 97);
this.benchNameTextBox3.Name = "benchNameTextBox3";
this.benchNameTextBox3.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox3.TabIndex = 6;
//
// languageLabel
//
this.languageLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.languageLabel.AutoSize = true;
this.languageLabel.Location = new System.Drawing.Point(26, 239);
this.languageLabel.Name = "languageLabel";
this.languageLabel.Size = new System.Drawing.Size(55, 13);
this.languageLabel.TabIndex = 14;
this.languageLabel.Text = "Language";
//
// languageTextBox
//
this.languageTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.languageTextBox.Location = new System.Drawing.Point(29, 263);
this.languageTextBox.Name = "languageTextBox";
this.languageTextBox.Size = new System.Drawing.Size(100, 20);
this.languageTextBox.TabIndex = 15;
//
// formatLabel
//
this.formatLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.formatLabel.AutoSize = true;
this.formatLabel.Location = new System.Drawing.Point(26, 185);
this.formatLabel.Name = "formatLabel";
this.formatLabel.Size = new System.Drawing.Size(39, 13);
this.formatLabel.TabIndex = 12;
this.formatLabel.Text = "Format";
//
// timePeriodFormatTextBox
//
this.timePeriodFormatTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.timePeriodFormatTextBox.Location = new System.Drawing.Point(29, 207);
this.timePeriodFormatTextBox.Name = "timePeriodFormatTextBox";
this.timePeriodFormatTextBox.Size = new System.Drawing.Size(683, 20);
this.timePeriodFormatTextBox.TabIndex = 13;
//
// benchNameTextBox5
//
this.benchNameTextBox5.Location = new System.Drawing.Point(29, 149);
this.benchNameTextBox5.Name = "benchNameTextBox5";
this.benchNameTextBox5.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox5.TabIndex = 10;
//
// benchNameTextBox4
//
this.benchNameTextBox4.Location = new System.Drawing.Point(29, 123);
this.benchNameTextBox4.Name = "benchNameTextBox4";
this.benchNameTextBox4.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox4.TabIndex = 8;
//
// connectionStringTextBox5
//
this.connectionStringTextBox5.Location = new System.Drawing.Point(157, 149);
this.connectionStringTextBox5.Name = "connectionStringTextBox5";
this.connectionStringTextBox5.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox5.TabIndex = 11;
//
// connectionStringTextBox4
//
this.connectionStringTextBox4.Location = new System.Drawing.Point(157, 123);
this.connectionStringTextBox4.Name = "connectionStringTextBox4";
this.connectionStringTextBox4.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox4.TabIndex = 9;
//
// DatabaseSettingsDlg
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(743, 310);
this.Controls.Add(this.benchNameTextBox5);
this.Controls.Add(this.benchNameTextBox4);
this.Controls.Add(this.connectionStringTextBox5);
this.Controls.Add(this.connectionStringTextBox4);
this.Controls.Add(this.timePeriodFormatTextBox);
this.Controls.Add(this.formatLabel);
this.Controls.Add(this.languageTextBox);
this.Controls.Add(this.languageLabel);
this.Controls.Add(this.benchNameTextBox3);
this.Controls.Add(this.benchNameTextBox2);
this.Controls.Add(this.benchNameTextBox1);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.connectionStringTextBox3);
this.Controls.Add(this.connectionStringLabel);
this.Controls.Add(this.connectionStringTextBox2);
this.Controls.Add(this.benchNameLabel);
this.Controls.Add(this.connectionStringTextBox1);
this.Name = "DatabaseSettingsDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Database Settings";
this.Load += new System.EventHandler(this.DatabaseSettings_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -203,5 +245,9 @@
private System.Windows.Forms.TextBox languageTextBox;
private System.Windows.Forms.Label formatLabel;
private System.Windows.Forms.TextBox timePeriodFormatTextBox;
private System.Windows.Forms.TextBox benchNameTextBox5;
private System.Windows.Forms.TextBox benchNameTextBox4;
private System.Windows.Forms.TextBox connectionStringTextBox5;
private System.Windows.Forms.TextBox connectionStringTextBox4;
}
}
+8 -6
View File
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ResultsBrowser.Resources;
@@ -24,10 +18,14 @@ namespace ResultsBrowser.Forms
benchNameTextBox1.Text = Program.LocalSettings.Bench1;
benchNameTextBox2.Text = Program.LocalSettings.Bench2;
benchNameTextBox3.Text = Program.LocalSettings.Bench3;
benchNameTextBox4.Text = Program.LocalSettings.Bench4;
benchNameTextBox5.Text = Program.LocalSettings.Bench5;
connectionStringTextBox1.Text = Program.LocalSettings.ConnectionString1;
connectionStringTextBox2.Text = Program.LocalSettings.ConnectionString2;
connectionStringTextBox3.Text = Program.LocalSettings.ConnectionString3;
connectionStringTextBox4.Text = Program.LocalSettings.ConnectionString4;
connectionStringTextBox5.Text = Program.LocalSettings.ConnectionString5;
timePeriodFormatTextBox.Text = Program.LocalSettings.TimePeriodFormat;
@@ -50,10 +48,14 @@ namespace ResultsBrowser.Forms
Program.LocalSettings.Bench1 = benchNameTextBox1.Text;
Program.LocalSettings.Bench2 = benchNameTextBox2.Text;
Program.LocalSettings.Bench3 = benchNameTextBox3.Text;
Program.LocalSettings.Bench4 = benchNameTextBox4.Text;
Program.LocalSettings.Bench5 = benchNameTextBox5.Text;
Program.LocalSettings.ConnectionString1 = connectionStringTextBox1.Text;
Program.LocalSettings.ConnectionString2 = connectionStringTextBox2.Text;
Program.LocalSettings.ConnectionString3 = connectionStringTextBox3.Text;
Program.LocalSettings.ConnectionString4 = connectionStringTextBox4.Text;
Program.LocalSettings.ConnectionString5 = connectionStringTextBox5.Text;
Program.LocalSettings.TimePeriodFormat = timePeriodFormatTextBox.Text;
+6
View File
@@ -27,15 +27,21 @@ namespace ResultsBrowser
public string Bench1;
public string Bench2;
public string Bench3;
public string Bench4;
public string Bench5;
/// Database settings of servers.
public string ConnectionString1;
public string ConnectionString2;
public string ConnectionString3;
public string ConnectionString4;
public string ConnectionString5;
public bool Bench1Selected;
public bool Bench2Selected;
public bool Bench3Selected;
public bool Bench4Selected;
public bool Bench5Selected;
public string TimePeriodFormat;
@@ -232,13 +232,13 @@ namespace ResultsBrowser.Output.Printers.QueryResults
lineNr += (secondTableOffset * 2) / SpacingOne;
PrintAt(e, Tab1, lineNr * SpacingOne, "Temperatur");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientTempAve().ToString("F1") + " \x00b0C");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientHumiAve().ToString("F0") + " %");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbHumiMean().ToString("F0") + " %");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientPressAve().ToString("F0") + " mbar");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbPressMean().ToString("F0") + " mbar");
lineNr++;
PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.12.542.0")]
[assembly: AssemblyFileVersion("2.12.542.0")]
[assembly: AssemblyVersion("2.14.572.0")]
[assembly: AssemblyFileVersion("2.14.572.0")]
+813
View File
@@ -0,0 +1,813 @@
<?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>
<data name="Confirmation" xml:space="preserve">
<value>conferma</value>
</data>
<data name="Do_you_want_to_save_the_procedure" xml:space="preserve">
<value>vuoi salvare la procedura?</value>
</data>
<data name="Error" xml:space="preserve">
<value>errore</value>
</data>
<data name="Error_loading_users_from_the_database" xml:space="preserve">
<value>errore del caricamento del data base</value>
</data>
<data name="Failed_to_create_a_sample_database" xml:space="preserve">
<value>Impossibile creare un database di esempio:</value>
</data>
<data name="Failed_to_export_the_database" xml:space="preserve">
<value>impossibile esportare il database</value>
</data>
<data name="Invalid_user_password_or_bench" xml:space="preserve">
<value>utente password o banco non valido</value>
</data>
<data name="Test_bench" xml:space="preserve">
<value>banco prova</value>
</data>
<data name="MaxChars" xml:space="preserve">
<value>max _X_ caratteri alfanumerici</value>
</data>
<data name="close" xml:space="preserve">
<value>Chiudi</value>
</data>
<data name="Diverter" xml:space="preserve">
<value>deviatore</value>
</data>
<data name="Emptying_valve" xml:space="preserve">
<value>valvola di svuotamento</value>
</data>
<data name="Name" xml:space="preserve">
<value>nome</value>
</data>
<data name="Reference" xml:space="preserve">
<value>riferimento</value>
</data>
<data name="Reg_valve" xml:space="preserve">
<value>regolazione valvola</value>
</data>
<data name="Balance" xml:space="preserve">
<value>bilancia</value>
</data>
<data name="Duration_s" xml:space="preserve">
<value>durata [s]</value>
</data>
<data name="no" xml:space="preserve">
<value>no</value>
</data>
<data name="New_bench_path_name" xml:space="preserve">
<value>P banco</value>
</data>
<data name="New_feeding_path_name" xml:space="preserve">
<value>P di avanzamento</value>
</data>
<data name="New_output_path_name" xml:space="preserve">
<value>PQ</value>
</data>
<data name="New_procedure_name" xml:space="preserve">
<value>procedura</value>
</data>
<data name="New_sensors_path_name" xml:space="preserve">
<value>P sens</value>
</data>
<data name="New_test_name" xml:space="preserve">
<value>prova</value>
</data>
<data name="New_name_copy" xml:space="preserve">
<value>Copia</value>
</data>
<data name="Correction_g" xml:space="preserve">
<value>correzione [g]</value>
</data>
<data name="Nr" xml:space="preserve">
<value>numero</value>
</data>
<data name="Mass_kg" xml:space="preserve">
<value>massa [kg]</value>
</data>
<data name="AddBtnText" xml:space="preserve">
<value>inserisci</value>
</data>
<data name="CancelBtnText" xml:space="preserve">
<value>Annulla</value>
</data>
<data name="CloseBtnText" xml:space="preserve">
<value>Chiudi</value>
</data>
<data name="LockBtnText" xml:space="preserve">
<value>serratura</value>
</data>
<data name="RemoveBtnText" xml:space="preserve">
<value>rimuovere</value>
</data>
<data name="OkBtnText" xml:space="preserve">
<value>ok</value>
</data>
<data name="Correction_lph" xml:space="preserve">
<value>correzione [l/h]</value>
</data>
<data name="Correction_mbar" xml:space="preserve">
<value>correzione [mbar]</value>
</data>
<data name="Flow_m3h" xml:space="preserve">
<value>flusso [m3/h]</value>
</data>
<data name="Invalid_username_or_password" xml:space="preserve">
<value>Username o password non validi</value>
</data>
<data name="CopyBtnText" xml:space="preserve">
<value>copia</value>
</data>
<data name="DownBtnText" xml:space="preserve">
<value>Giù</value>
</data>
<data name="EditBtnText" xml:space="preserve">
<value>Modifica</value>
</data>
<data name="UpBtnText" xml:space="preserve">
<value>Su</value>
</data>
<data name="NoDatabaseMsg" xml:space="preserve">
<value>Impossibile collegarsi al database</value>
</data>
<data name="ConfigureDatabaseText" xml:space="preserve">
<value>configurare il banco prova (richiesta password)</value>
</data>
<data name="ExitBtnText" xml:space="preserve">
<value>uscita</value>
</data>
<data name="Enter_password" xml:space="preserve">
<value>password di ingresso</value>
</data>
<data name="Invalid_password" xml:space="preserve">
<value>Password non valida</value>
</data>
<data name="Bench_name_conflict_Use_another_name_pls" xml:space="preserve">
<value>conflitto nome per banco prova, cambiare nome</value>
</data>
<data name="DB_was_successfully_created" xml:space="preserve">
<value>Il database è stato creato con successo!</value>
</data>
<data name="DB_will_be_overwritten" xml:space="preserve">
<value>il database verrà sovrascritto</value>
</data>
<data name="Do_you_want_to_proceed" xml:space="preserve">
<value>vuoi procedere?</value>
</data>
<data name="Notification" xml:space="preserve">
<value>notifica</value>
</data>
<data name="NoBenchMsg" xml:space="preserve">
<value>nessun banco prova nella configurazione del programma</value>
</data>
<data name="DescriptionColHdr" xml:space="preserve">
<value>Descrizione</value>
</data>
<data name="Procedure" xml:space="preserve">
<value>procedura</value>
</data>
<data name="Test" xml:space="preserve">
<value>tester</value>
</data>
<data name="Corrected" xml:space="preserve">
<value>corretto</value>
</data>
<data name="Measured" xml:space="preserve">
<value>misurato</value>
</data>
<data name="Bench_is_not_running" xml:space="preserve">
<value>il banco prova non è in funzionamento tuttavia è possibile modificare le impostazioni per risolvere il problema</value>
</data>
<data name="Emptying_chdr" xml:space="preserve">
<value>svuotamento</value>
</data>
<data name="Bench_chdr" xml:space="preserve">
<value>banco</value>
</data>
<data name="Err_cor_neg_pct_chdr" xml:space="preserve">
<value>correzione errore - [%]</value>
</data>
<data name="Err_cor_pos_pct_chdr" xml:space="preserve">
<value>correzione errore + [%]</value>
</data>
<data name="Err_limit_neg_pct_chdr" xml:space="preserve">
<value>limite errore - [%]</value>
</data>
<data name="Err_limit_pos_pct_chdr" xml:space="preserve">
<value>limite errore + [%]</value>
</data>
<data name="Feeding_chdr" xml:space="preserve">
<value>alimentazione</value>
</data>
<data name="Red_type_chdr" xml:space="preserve">
<value>tipo rosso</value>
</data>
<data name="Error_while_creating_DB_Reason" xml:space="preserve">
<value>errore durante la creazione del data base , motivi:</value>
</data>
<data name="Metrology" xml:space="preserve">
<value>metrologia</value>
</data>
<data name="_offline" xml:space="preserve">
<value>(disconnesso)</value>
</data>
<data name="Administrator" xml:space="preserve">
<value>Amministratore</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>esperto di calibrazione</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>capo del laboratorio</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>esperto in manutenzione</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>metrologista</value>
</data>
<data name="Close_emptying_valve" xml:space="preserve">
<value>chiudere la valvola di svuotamento</value>
</data>
<data name="Get_mass_of_water_in_the_tank" xml:space="preserve">
<value>prendi la massa d'acqua nel serbatoio</value>
</data>
<data name="Ignore" xml:space="preserve">
<value>Ignora</value>
</data>
<data name="Loading_the_procedure" xml:space="preserve">
<value>scarica la procedura</value>
</data>
<data name="Make_tank_empty" xml:space="preserve">
<value>svuotare il serbatoio</value>
</data>
<data name="Measure_the_mass" xml:space="preserve">
<value>misura la massa</value>
</data>
<data name="Ready" xml:space="preserve">
<value>pronto</value>
</data>
<data name="BackBtnText" xml:space="preserve">
<value>&lt; indietro</value>
</data>
<data name="FinishBtnText" xml:space="preserve">
<value>finire</value>
</data>
<data name="NextBtnText" xml:space="preserve">
<value>avanti &gt;</value>
</data>
<data name="Flow_selection" xml:space="preserve">
<value>selezionare il flusso</value>
</data>
<data name="Method_chdr" xml:space="preserve">
<value>metodo di prova</value>
</data>
<data name="RelativeQfrom" xml:space="preserve">
<value>Q relativo da</value>
</data>
<data name="RelativeQto" xml:space="preserve">
<value>Q relativo a</value>
</data>
<data name="Combined_meters" xml:space="preserve">
<value>misuratori combinati</value>
</data>
<data name="DetectionThresholdPct" xml:space="preserve">
<value>soglia di rilevazione [%]</value>
</data>
<data name="RateOfChangePct" xml:space="preserve">
<value>tasso di cambio [%]</value>
</data>
<data name="Component" xml:space="preserve">
<value>componenti</value>
</data>
<data name="_none_" xml:space="preserve">
<value>&lt;none&gt;</value>
</data>
<data name="Method_selection" xml:space="preserve">
<value>selezione del metodo di prova</value>
</data>
<data name="Clear_results" xml:space="preserve">
<value>cancella risultati</value>
</data>
<data name="Configure" xml:space="preserve">
<value>configurare</value>
</data>
<data name="Arrangement_of_meters" xml:space="preserve">
<value>disposizioni di misuratori testati</value>
</data>
<data name="Arrangement_of_tests" xml:space="preserve">
<value>disposizione dei test</value>
</data>
<data name="Horizontally" xml:space="preserve">
<value>orizzontalmente</value>
</data>
<data name="Configuration" xml:space="preserve">
<value>configurazione</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
<data name="ClearBtnText" xml:space="preserve">
<value>chiaro</value>
</data>
<data name="Emptying_tank" xml:space="preserve">
<value>svuotare il serbatorio</value>
</data>
<data name="Measuring_the_weight" xml:space="preserve">
<value>misurazione del peso</value>
</data>
<data name="Emptying_i_n" xml:space="preserve">
<value>svuotamento {0}: passo {1}/{2}</value>
</data>
<data name="Activity" xml:space="preserve">
<value>Attività</value>
</data>
<data name="Approval_info" xml:space="preserve">
<value>Info approvazione</value>
</data>
<data name="Metrological_class" xml:space="preserve">
<value>classe metrologica</value>
</data>
<data name="Producer" xml:space="preserve">
<value>produttore</value>
</data>
<data name="Printer" xml:space="preserve">
<value>stampante</value>
</data>
<data name="Version" xml:space="preserve">
<value>versione</value>
</data>
<data name="nothing_to_configure" xml:space="preserve">
<value>&lt;niente da configurare&gt;</value>
</data>
<data name="Fill_with_water" xml:space="preserve">
<value>riempire il banco prova con acqua?</value>
</data>
<data name="NoBtn" xml:space="preserve">
<value>no</value>
</data>
<data name="Question" xml:space="preserve">
<value>domanda</value>
</data>
<data name="Bench_parameters" xml:space="preserve">
<value>parametri del banco</value>
</data>
<data name="Connection_string" xml:space="preserve">
<value>stringa di connessione</value>
</data>
<data name="Create_DB" xml:space="preserve">
<value>Crea DB</value>
</data>
<data name="Database_type" xml:space="preserve">
<value>tipo di database</value>
</data>
<data name="Logging" xml:space="preserve">
<value>registrazione</value>
</data>
<data name="Mode" xml:space="preserve">
<value>modalità</value>
</data>
<data name="NewTabBtnText" xml:space="preserve">
<value>nuova scheda</value>
</data>
<data name="New_transition_name" xml:space="preserve">
<value>nuovo nome di transizione</value>
</data>
<data name="Detection_completed" xml:space="preserve">
<value>rilevazione completata</value>
</data>
<data name="Emergency_STOP" xml:space="preserve">
<value>STOP di emergenza</value>
</data>
<data name="Add" xml:space="preserve">
<value>&amp;Aggiungi &gt;</value>
</data>
<data name="Available_results" xml:space="preserve">
<value>Risultati disponibili:</value>
</data>
<data name="Remove" xml:space="preserve">
<value>&lt; &amp;rimuovere</value>
</data>
<data name="Remove_all" xml:space="preserve">
<value>r&amp;imuovere tutto</value>
</data>
<data name="Message" xml:space="preserve">
<value>messaggio</value>
</data>
<data name="dflt" xml:space="preserve">
<value>dflt</value>
</data>
<data name="Detection_failed" xml:space="preserve">
<value>rilevazione fallita</value>
</data>
<data name="Camera_error" xml:space="preserve">
<value>errore della fotocamera</value>
</data>
<data name="remaining_time" xml:space="preserve">
<value>tempo restante</value>
</data>
<data name="LessBtnText" xml:space="preserve">
<value>di meno</value>
</data>
<data name="MoreBtnText" xml:space="preserve">
<value>di più</value>
</data>
<data name="Changes_will_be_lost_Do_you_want_to_proceed" xml:space="preserve">
<value>le modifiche andranno perse vuoi procedere?</value>
</data>
<data name="Flowmeter" xml:space="preserve">
<value>misuratore di flusso</value>
</data>
<data name="CombinedBtnText" xml:space="preserve">
<value>combinato</value>
</data>
<data name="Device" xml:space="preserve">
<value>Dispositivo</value>
</data>
<data name="PrinterBtnText" xml:space="preserve">
<value>stampante</value>
</data>
<data name="Aux_Water_Meter" xml:space="preserve">
<value>contatore acqua ausiliario</value>
</data>
<data name="Aux_Water_Meter_State" xml:space="preserve">
<value>stato contatore acqua ausiliario</value>
</data>
<data name="Data" xml:space="preserve">
<value>dati</value>
</data>
<data name="End_State" xml:space="preserve">
<value>fine stato</value>
</data>
<data name="Main_Water_Meter" xml:space="preserve">
<value>contatore acqua principale</value>
</data>
<data name="Main_Water_Meter_State" xml:space="preserve">
<value>stato contatore acqua principale</value>
</data>
<data name="Protocol" xml:space="preserve">
<value>protocollo</value>
</data>
<data name="Serial_Number" xml:space="preserve">
<value>Numero Seriale</value>
</data>
<data name="Aux_WM_SerialNr" xml:space="preserve">
<value>numero seriale contatore acqua ausiliario</value>
</data>
<data name="Main_WM_SerialNr" xml:space="preserve">
<value>numero seriale contatore acqua principale</value>
</data>
<data name="Adjustment_in_progress" xml:space="preserve">
<value>aggiustamento in corso</value>
</data>
<data name="Error_pct" xml:space="preserve">
<value>Errore [%]</value>
</data>
<data name="Duration_Leak_s" xml:space="preserve">
<value>durata delle perdite [s]</value>
</data>
<data name="Duration_PMax_s" xml:space="preserve">
<value>durata portata massima [s]</value>
</data>
<data name="Closing_valve_Pump_off" xml:space="preserve">
<value>chiudere la valvola di ingresso spegnendo la pompa</value>
</data>
<data name="Purchase_Order" xml:space="preserve">
<value>ordine acquisto</value>
</data>
<data name="Ambient_humidity_" xml:space="preserve">
<value>Umidità dell'ambiente:</value>
</data>
<data name="Ambient_pressure_" xml:space="preserve">
<value>Pressione dell'ambiente:</value>
</data>
<data name="Ambient_temperature_" xml:space="preserve">
<value>Temperatura dell'ambiente:</value>
</data>
<data name="Approval_" xml:space="preserve">
<value>Approvazione:</value>
</data>
<data name="Date_and_time_" xml:space="preserve">
<value>Data e ora:</value>
</data>
<data name="End" xml:space="preserve">
<value>Fine</value>
</data>
<data name="AtTemperature_C" xml:space="preserve">
<value>@temperatura [gradiC]</value>
</data>
<data name="Density_kg_m3" xml:space="preserve">
<value>densità [kg/m3]</value>
</data>
<data name="Density" xml:space="preserve">
<value>densità</value>
</data>
<data name="Nr_meters_in_a_group" xml:space="preserve">
<value>numero contatori di un gruppo:</value>
</data>
<data name="End_Condition" xml:space="preserve">
<value>condizioni finali</value>
</data>
<data name="Communication" xml:space="preserve">
<value>Comunicazione</value>
</data>
<data name="Aux_" xml:space="preserve">
<value>ausiliario:</value>
</data>
<data name="Main_" xml:space="preserve">
<value>principale:</value>
</data>
<data name="cold" xml:space="preserve">
<value>freddo</value>
</data>
<data name="hot" xml:space="preserve">
<value>caldo</value>
</data>
<data name="Product_name" xml:space="preserve">
<value>nome prodotto</value>
</data>
<data name="Address" xml:space="preserve">
<value>Indirizzo</value>
</data>
<data name="Approval_date" xml:space="preserve">
<value>Data di approvazione</value>
</data>
<data name="Approval_ID" xml:space="preserve">
<value>ID approvazione</value>
</data>
<data name="Approved_by" xml:space="preserve">
<value>Approvato da</value>
</data>
<data name="Evaluate" xml:space="preserve">
<value>Valuta</value>
</data>
<data name="iPerl_Communication_in_progress" xml:space="preserve">
<value>iPerl comunicazione in corso</value>
</data>
<data name="Language" xml:space="preserve">
<value>lingua</value>
</data>
<data name="Available_Components_" xml:space="preserve">
<value>componenti disponibili:</value>
</data>
<data name="Database_Settings" xml:space="preserve">
<value>impostazioni del data base</value>
</data>
<data name="About_Test_Bench_Framework" xml:space="preserve">
<value>informazioni circa la prova del banco </value>
</data>
<data name="BuildDateStr" xml:space="preserve">
<value>data di costruzione _BUILD_DATE_</value>
</data>
<data name="CopyrightStr" xml:space="preserve">
<value>Copyright © 2013 - {0}</value>
</data>
<data name="Edit_User" xml:space="preserve">
<value>Copyright © 2013 - {0}</value>
</data>
<data name="Groups" xml:space="preserve">
<value>gruppi</value>
</data>
<data name="An_unhandled_error_occured" xml:space="preserve">
<value>Si è verificato un errore imprevisto</value>
</data>
<data name="IgnoreBtnText" xml:space="preserve">
<value>Ignora</value>
</data>
<data name="Add_filter" xml:space="preserve">
<value>aggiungi filtro</value>
</data>
<data name="Clear_filters" xml:space="preserve">
<value>cancella filtro</value>
</data>
<data name="Execute_query" xml:space="preserve">
<value>fai il quesito</value>
</data>
<data name="Export_query_results" xml:space="preserve">
<value>esporta il risultato del quesito</value>
</data>
<data name="Filters" xml:space="preserve">
<value>filtri</value>
</data>
<data name="Format_of_results" xml:space="preserve">
<value>formato dei risultati</value>
</data>
<data name="Load_filters" xml:space="preserve">
<value>carica i filtri</value>
</data>
<data name="Print_query_results" xml:space="preserve">
<value>stampa i risultati dei quesiti</value>
</data>
<data name="Query_results" xml:space="preserve">
<value>risultati quesiti</value>
</data>
<data name="Results_Browser" xml:space="preserve">
<value>browser dei risultati</value>
</data>
<data name="Save_filters" xml:space="preserve">
<value>salva filtri</value>
</data>
<data name="Settings" xml:space="preserve">
<value>impostazioni</value>
</data>
<data name="Test_benches" xml:space="preserve">
<value>banco di prova</value>
</data>
<data name="RetryDatabaseText" xml:space="preserve">
<value>riprova</value>
</data>
<data name="Selected_results" xml:space="preserve">
<value>selezionare risultati</value>
</data>
<data name="SingleBtnText" xml:space="preserve">
<value>singolo</value>
</data>
<data name="UnlockBtnText" xml:space="preserve">
<value>sbloccare</value>
</data>
<data name="Water_Meter" xml:space="preserve">
<value>contatore acqua</value>
</data>
<data name="Date" xml:space="preserve">
<value>Data </value>
</data>
<data name="From" xml:space="preserve">
<value>da</value>
</data>
<data name="To" xml:space="preserve">
<value>a</value>
</data>
<data name="Statistics" xml:space="preserve">
<value>statistiche</value>
</data>
<data name="Columns" xml:space="preserve">
<value>Colonne</value>
</data>
<data name="Rows" xml:space="preserve">
<value>righe</value>
</data>
<data name="Select_a_filter" xml:space="preserve">
<value>seleziona un filtro</value>
</data>
<data name="Error_displaying_results" xml:space="preserve">
<value>Errore nella visualizzazione dei risultati</value>
</data>
<data name="All_files" xml:space="preserve">
<value>tutti i files</value>
</data>
<data name="Error_saving_file" xml:space="preserve">
<value>Errore nel salvataggio del file</value>
</data>
<data name="Error_serializing_filters" xml:space="preserve">
<value>errore durante la serializzazione dei filtri</value>
</data>
<data name="Query_files" xml:space="preserve">
<value>files su quesiti</value>
</data>
<data name="No_program_settings_found" xml:space="preserve">
<value>non è stata trovata nessuna impostazione del programma</value>
</data>
<data name="Using_default_settings" xml:space="preserve">
<value>utilizzo delle impostazione predefinite</value>
</data>
<data name="Selected_language_not_supported" xml:space="preserve">
<value>lingua selezionata non supportata</value>
</data>
<data name="Using_English" xml:space="preserve">
<value>usare inglese</value>
</data>
<data name="Warning" xml:space="preserve">
<value>Attenzione</value>
</data>
<data name="Count" xml:space="preserve">
<value>contare</value>
</data>
<data name="Format" xml:space="preserve">
<value>formato</value>
</data>
<data name="Page_orientation" xml:space="preserve">
<value>orientamento della pagina</value>
</data>
<data name="Yes_Portrait_No_Landscape" xml:space="preserve">
<value>si = ritratto no = paesaggio</value>
</data>
<data name="Print" xml:space="preserve">
<value>Stampa</value>
</data>
</root>
+1
View File
@@ -209,6 +209,7 @@
</Compile>
<EmbeddedResource Include="Resources\Strings.cs.resx" />
<EmbeddedResource Include="Resources\Strings.de.resx" />
<EmbeddedResource Include="Resources\Strings.it.resx" />
<EmbeddedResource Include="Resources\Strings.pl.resx" />
<EmbeddedResource Include="Resources\Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
+42 -12
View File
@@ -45,6 +45,8 @@
this.executeQueryBtn = new System.Windows.Forms.Button();
this.addFilterBtn = new System.Windows.Forms.Button();
this.testBenchesGroupBox = new System.Windows.Forms.GroupBox();
this.checkBox5 = new System.Windows.Forms.RadioButton();
this.checkBox4 = new System.Windows.Forms.RadioButton();
this.checkBox3 = new System.Windows.Forms.RadioButton();
this.checkBox2 = new System.Windows.Forms.RadioButton();
this.checkBox1 = new System.Windows.Forms.RadioButton();
@@ -151,7 +153,7 @@
//
// statisticsBtn
//
this.statisticsBtn.Location = new System.Drawing.Point(8, 562);
this.statisticsBtn.Location = new System.Drawing.Point(8, 581);
this.statisticsBtn.Name = "statisticsBtn";
this.statisticsBtn.Size = new System.Drawing.Size(125, 33);
this.statisticsBtn.TabIndex = 10;
@@ -161,7 +163,7 @@
//
// printQueryResultsBtn
//
this.printQueryResultsBtn.Location = new System.Drawing.Point(8, 487);
this.printQueryResultsBtn.Location = new System.Drawing.Point(8, 506);
this.printQueryResultsBtn.Name = "printQueryResultsBtn";
this.printQueryResultsBtn.Size = new System.Drawing.Size(125, 33);
this.printQueryResultsBtn.TabIndex = 9;
@@ -171,7 +173,7 @@
//
// exportQueryResultsBtn
//
this.exportQueryResultsBtn.Location = new System.Drawing.Point(8, 448);
this.exportQueryResultsBtn.Location = new System.Drawing.Point(8, 467);
this.exportQueryResultsBtn.Name = "exportQueryResultsBtn";
this.exportQueryResultsBtn.Size = new System.Drawing.Size(125, 33);
this.exportQueryResultsBtn.TabIndex = 8;
@@ -181,7 +183,7 @@
//
// formatOfResultsBtn
//
this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 255);
this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 274);
this.formatOfResultsBtn.Name = "formatOfResultsBtn";
this.formatOfResultsBtn.Size = new System.Drawing.Size(125, 33);
this.formatOfResultsBtn.TabIndex = 7;
@@ -191,7 +193,7 @@
//
// clearFiltersBtn
//
this.clearFiltersBtn.Location = new System.Drawing.Point(8, 177);
this.clearFiltersBtn.Location = new System.Drawing.Point(8, 196);
this.clearFiltersBtn.Name = "clearFiltersBtn";
this.clearFiltersBtn.Size = new System.Drawing.Size(125, 33);
this.clearFiltersBtn.TabIndex = 2;
@@ -211,7 +213,7 @@
//
// saveConfigBtn
//
this.saveConfigBtn.Location = new System.Drawing.Point(8, 294);
this.saveConfigBtn.Location = new System.Drawing.Point(8, 313);
this.saveConfigBtn.Name = "saveConfigBtn";
this.saveConfigBtn.Size = new System.Drawing.Size(125, 33);
this.saveConfigBtn.TabIndex = 5;
@@ -221,7 +223,7 @@
//
// loadConfigBtn
//
this.loadConfigBtn.Location = new System.Drawing.Point(8, 333);
this.loadConfigBtn.Location = new System.Drawing.Point(8, 352);
this.loadConfigBtn.Name = "loadConfigBtn";
this.loadConfigBtn.Size = new System.Drawing.Size(125, 33);
this.loadConfigBtn.TabIndex = 4;
@@ -231,7 +233,7 @@
//
// executeQueryBtn
//
this.executeQueryBtn.Location = new System.Drawing.Point(8, 409);
this.executeQueryBtn.Location = new System.Drawing.Point(8, 428);
this.executeQueryBtn.Name = "executeQueryBtn";
this.executeQueryBtn.Size = new System.Drawing.Size(125, 33);
this.executeQueryBtn.TabIndex = 6;
@@ -241,7 +243,7 @@
//
// addFilterBtn
//
this.addFilterBtn.Location = new System.Drawing.Point(8, 216);
this.addFilterBtn.Location = new System.Drawing.Point(8, 235);
this.addFilterBtn.Name = "addFilterBtn";
this.addFilterBtn.Size = new System.Drawing.Size(125, 33);
this.addFilterBtn.TabIndex = 3;
@@ -251,20 +253,46 @@
//
// testBenchesGroupBox
//
this.testBenchesGroupBox.Controls.Add(this.checkBox5);
this.testBenchesGroupBox.Controls.Add(this.checkBox4);
this.testBenchesGroupBox.Controls.Add(this.checkBox3);
this.testBenchesGroupBox.Controls.Add(this.checkBox2);
this.testBenchesGroupBox.Controls.Add(this.checkBox1);
this.testBenchesGroupBox.Location = new System.Drawing.Point(8, 54);
this.testBenchesGroupBox.Name = "testBenchesGroupBox";
this.testBenchesGroupBox.Size = new System.Drawing.Size(125, 99);
this.testBenchesGroupBox.Size = new System.Drawing.Size(125, 135);
this.testBenchesGroupBox.TabIndex = 1;
this.testBenchesGroupBox.TabStop = false;
this.testBenchesGroupBox.Text = "Test benches";
//
// checkBox5
//
this.checkBox5.AutoSize = true;
this.checkBox5.Location = new System.Drawing.Point(23, 106);
this.checkBox5.Name = "checkBox5";
this.checkBox5.Size = new System.Drawing.Size(85, 17);
this.checkBox5.TabIndex = 4;
this.checkBox5.TabStop = true;
this.checkBox5.Text = "radioButton5";
this.checkBox5.UseVisualStyleBackColor = true;
this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged);
//
// checkBox4
//
this.checkBox4.AutoSize = true;
this.checkBox4.Location = new System.Drawing.Point(23, 86);
this.checkBox4.Name = "checkBox4";
this.checkBox4.Size = new System.Drawing.Size(85, 17);
this.checkBox4.TabIndex = 3;
this.checkBox4.TabStop = true;
this.checkBox4.Text = "radioButton4";
this.checkBox4.UseVisualStyleBackColor = true;
this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged);
//
// checkBox3
//
this.checkBox3.AutoSize = true;
this.checkBox3.Location = new System.Drawing.Point(23, 69);
this.checkBox3.Location = new System.Drawing.Point(23, 65);
this.checkBox3.Name = "checkBox3";
this.checkBox3.Size = new System.Drawing.Size(85, 17);
this.checkBox3.TabIndex = 2;
@@ -276,7 +304,7 @@
// checkBox2
//
this.checkBox2.AutoSize = true;
this.checkBox2.Location = new System.Drawing.Point(23, 46);
this.checkBox2.Location = new System.Drawing.Point(23, 44);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(85, 17);
this.checkBox2.TabIndex = 1;
@@ -344,5 +372,7 @@
private System.Windows.Forms.Button printQueryResultsBtn;
private System.Windows.Forms.Button statisticsBtn;
private System.Windows.Forms.ListView resultsListView;
private System.Windows.Forms.RadioButton checkBox5;
private System.Windows.Forms.RadioButton checkBox4;
}
}
+68 -6
View File
@@ -5,6 +5,7 @@ using NHibernate;
using Results.Entities;
using ResultsBrowser.Filters;
using ResultsBrowser.Resources;
using System.IO;
namespace ResultsBrowser
{
@@ -49,6 +50,8 @@ namespace ResultsBrowser
checkBox1.Checked = Program.LocalSettings.Bench1Selected;
checkBox2.Checked = Program.LocalSettings.Bench2Selected;
checkBox3.Checked = Program.LocalSettings.Bench3Selected;
checkBox4.Checked = Program.LocalSettings.Bench4Selected;
checkBox5.Checked = Program.LocalSettings.Bench5Selected;
if (args.Length == 1 && args[0].IndexOf(".qry") == args[0].Length - 4)
{
@@ -69,10 +72,14 @@ namespace ResultsBrowser
checkBox1.Text = Program.LocalSettings.Bench1;
checkBox2.Text = Program.LocalSettings.Bench2;
checkBox3.Text = Program.LocalSettings.Bench3;
checkBox4.Text = Program.LocalSettings.Bench4;
checkBox5.Text = Program.LocalSettings.Bench5;
checkBox1.Visible = !string.IsNullOrEmpty(checkBox1.Text);
checkBox2.Visible = !string.IsNullOrEmpty(checkBox2.Text);
checkBox3.Visible = !string.IsNullOrEmpty(checkBox3.Text);
checkBox4.Visible = !string.IsNullOrEmpty(checkBox4.Text);
checkBox5.Visible = !string.IsNullOrEmpty(checkBox5.Text);
}
string BenchName()
@@ -110,12 +117,16 @@ namespace ResultsBrowser
private void checkBox1_CheckedChanged(object sender, EventArgs e) { SaveCheckBoxes(); }
private void checkBox2_CheckedChanged(object sender, EventArgs e) { SaveCheckBoxes(); }
private void checkBox3_CheckedChanged(object sender, EventArgs e) { SaveCheckBoxes(); }
private void checkBox4_CheckedChanged(object sender, EventArgs e) { SaveCheckBoxes(); }
private void checkBox5_CheckedChanged(object sender, EventArgs e) { SaveCheckBoxes(); }
void SaveCheckBoxes()
{
Program.LocalSettings.Bench1Selected = checkBox1.Checked;
Program.LocalSettings.Bench2Selected = checkBox2.Checked;
Program.LocalSettings.Bench3Selected = checkBox3.Checked;
Program.LocalSettings.Bench4Selected = checkBox4.Checked;
Program.LocalSettings.Bench5Selected = checkBox5.Checked;
Program.LocalSettings.Save();
}
@@ -214,7 +225,9 @@ namespace ResultsBrowser
Results.DB.ConnectionString = checkBox1.Checked ? Program.LocalSettings.ConnectionString1 :
(checkBox2.Checked ? Program.LocalSettings.ConnectionString2 :
(checkBox3.Checked ? Program.LocalSettings.ConnectionString3 :
Program.LocalSettings.ConnectionString1));
(checkBox4.Checked ? Program.LocalSettings.ConnectionString4 :
(checkBox5.Checked ? Program.LocalSettings.ConnectionString5 :
Program.LocalSettings.ConnectionString1))));
ISession[] sessions = new ISession[] { Results.DB.CreateSession() };
@@ -259,8 +272,15 @@ namespace ResultsBrowser
ListViewItem lvi = null;
foreach (var item in items)
{
if (lvi == null) lvi = new ListViewItem(item.Print(wm));
else lvi.SubItems.Add(item.Print(wm));
/// Get text and strip color information
string itemText = item.Print(wm);
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
if (lvi == null)
lvi = new ListViewItem(itemText);
else
lvi.SubItems.Add(itemText);
}
if (lvi != null) resultsListView.Items.Add(lvi);
}
@@ -276,8 +296,6 @@ namespace ResultsBrowser
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg();
dlg.MetersKind = Config.Entities.MetersKind.Single;
dlg.SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
dlg.AvailableItems = new List<Results.WMeterRsltItemSpec>();
foreach (var v in Results.WMeterRsltItemSpec.AllItems) dlg.AvailableItems.Add(v);
if (dlg.ShowDialog() == DialogResult.OK)
{
@@ -288,8 +306,52 @@ namespace ResultsBrowser
private void exportQueryResultsBtn_Click(object sender, EventArgs e)
{
if (waterMeters == null || waterMeters.Count == 0) return;
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
if (waterMeters == null || waterMeters.Count == 0 || items.Count == 0) return;
SaveFileDialog dlg = new SaveFileDialog();
if (dlg.ShowDialog() == DialogResult.OK)
{
using (TextWriter writer = new StreamWriter(dlg.FileName))
{
try
{
for (int i = 0; i < items.Count; i++)
{
writer.Write(items[i].Caption);
if (i == items.Count - 1)
writer.WriteLine(); /// New line after the last item
else
writer.Write(";"); /// Semicolon between two items
}
foreach (var wm in waterMeters)
{
for (int i = 0; i < items.Count; i++)
{
/// Get text and strip color information
string itemText = items[i].Print(wm);
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
writer.Write(itemText);
if (i == items.Count - 1)
writer.WriteLine(); /// New line after the last item
else
writer.Write(";"); /// Semicolon between two items
}
}
}
catch (Exception exc)
{
MessageBox.Show(exc.Message, Strings.Error_displaying_results, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
}
private void printQueryResultsBtn_Click(object sender, EventArgs e)
@@ -11,6 +11,9 @@ namespace TBF.BenchControl.Ambient.Comet
{
public class AmbientCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AmbientCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new AmbientCfgCtrl(); }
///
@@ -20,7 +20,7 @@ namespace TBF.BenchControl.Ambient.Comet
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(AmbientCfg), component, this);
return ComponentCfgBase.CreateFromDbEntity(AmbientCfg.Serializer, component, this);
}
}
}
@@ -11,6 +11,9 @@ namespace TBF.BenchControl.Ambient.Greco
{
public class AmbientCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AmbientCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new AmbientCfgCtrl(); }
///
@@ -20,7 +20,7 @@ namespace TBF.BenchControl.Ambient.Greco
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(AmbientCfg), component, this);
return ComponentCfgBase.CreateFromDbEntity(AmbientCfg.Serializer, component, this);
}
}
}
@@ -14,6 +14,9 @@ namespace TBF.BenchControl.BenchInfo.Munich
/// </summary>
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new ComponentCfgCtrl(); }
///
@@ -21,7 +21,7 @@ namespace TBF.BenchControl.BenchInfo.Munich
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(ComponentCfg), component, this);
return ComponentCfgBase.CreateFromDbEntity(ComponentCfg.Serializer, component, this);
}
}
}
@@ -14,6 +14,9 @@ namespace TBF.BenchControl.BenchInfo.Polska
/// </summary>
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new ComponentCfgCtrl(); }
///
@@ -20,7 +20,7 @@ namespace TBF.BenchControl.BenchInfo.Polska
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(ComponentCfg), component, this);
return ComponentCfgBase.CreateFromDbEntity(ComponentCfg.Serializer, component, this);
}
}
}
@@ -12,7 +12,7 @@ namespace TBF.BenchControl
{
public class ComponentCfgBase
{
[XmlIgnore]
[XmlIgnore]
public string Name
{
get { return name; }
@@ -94,28 +94,32 @@ namespace TBF.BenchControl
}
protected virtual XmlSerializer GetSerializer() { return new XmlSerializer(GetType()); }
public Component CreateDbEntity()
{
using (var writer = new StringWriter())
{
(new XmlSerializer(GetType())).Serialize(writer, this);
GetSerializer().Serialize(writer, this);
return Component.CreateFromCfg(Name, factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString());
}
}
public static IComponentCfg CreateFromDbEntity(Type type, Component cmpntEntity, IComponentFactory factory)
public static IComponentCfg CreateFromDbEntity(XmlSerializer s, Component cmpntEntity, IComponentFactory factory)
{
using (var reader = new StringReader(cmpntEntity.Parameters))
{
IComponentCfg config = (IComponentCfg)(new XmlSerializer(type)).Deserialize(reader);
config.Name = cmpntEntity.Name;
config.ParentName = cmpntEntity.ParentName;
config.ItemNr = cmpntEntity.ItemNr;
config.DebugLevel = cmpntEntity.Mode;
config.LogLevel = cmpntEntity.Logging;
config.Corrections = cmpntEntity.Corrections;
config.Factory = factory;
IComponentCfg config = s.Deserialize(reader) as IComponentCfg;
if (config != null)
{
config.Name = cmpntEntity.Name;
config.ParentName = cmpntEntity.ParentName;
config.ItemNr = cmpntEntity.ItemNr;
config.DebugLevel = cmpntEntity.Mode;
config.LogLevel = cmpntEntity.Logging;
config.Corrections = cmpntEntity.Corrections;
config.Factory = factory;
}
return config;
}
}
@@ -2,11 +2,15 @@
/// Copyright (c) 2016 Sensus Metering Systems
///
using TBF.BenchControl.Generic;
using System.Xml.Serialization;
namespace TBF.BenchControl.Configs.NameOnly
{
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// Private parameterless constructor invoked by all other (public) constructors
@@ -1,51 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Config.Entities;
namespace TBF.BenchControl
{
/// <summary>
/// This class keeps the current values used or measured by the test bench.
/// </summary>
public class Current
{
/// <summary>
/// Procedure, Tests and TestResults data
/// </summary>
public static Procedure Procedure;
public static Test Test;
public static int TestId = 0;
public static TestResult TestResult;
public static int TestResultId = 0;
/// <summary>
/// Measured data
/// </summary>
public static double StartMass;
public static double StopMass;
static Current()
{
}
/// Constructor
public Current()
{
/// There should always be some raw data
}
/// <summary>
/// Processes current 'tick' data during measurement.
/// </summary>
public static void ProcessTickData()
{
}
}
}
@@ -55,7 +55,9 @@ namespace TBF.BenchControl.DB.SensusOracle
{
public int PruefungsNr;
public string QBezeichnung;
public TestInfo(int p, string q) { PruefungsNr = p; QBezeichnung = q; }
public override string ToString() { return string.Format("({0},{1})", PruefungsNr, QBezeichnung); }
}
///
@@ -527,7 +529,7 @@ namespace TBF.BenchControl.DB.SensusOracle
logger.WriteLine(string.Format("IdProduziert={0}", 0)); /// 61
logger.WriteLine(string.Format("Calibration_alt={0}", wMtr.OrigCalibFactor));
logger.WriteLine(string.Format("Calibration={0}", wMtr.CalibFactor));
logger.WriteLine(string.Format("Firmware={0}", "05.66")); /// 05.66
logger.WriteLine(string.Format("Firmware={0}", wMtr.FWVersion)); /// 5.066
logger.WriteLine(string.Format("FlexFlowFehler={0}", 0)); /// 0
logger.WriteLine(string.Format("FlexFlowAuftrag={0}", 0)); /// 4248189
logger.WriteLine(string.Format("JustierWert=0,2")); /// 0,2
@@ -550,180 +552,25 @@ namespace TBF.BenchControl.DB.SensusOracle
logger.WriteLine(string.Format("Datum={0}", batch.StartTime.ToString("dd.MM.yyyy")));
logger.WriteLine(string.Format("GesamtDauer={0}", batch.EndTime.Subtract(batch.StartTime).TotalSeconds));
logger.WriteLine(string.Format("Dichtprüfung={0}", 0)); /// 1
///
logger.WriteLine(string.Format("Q-5_geprüft={0}", 0)); /// 0
///
logger.WriteLine(string.Format("Q-4_geprüft={0}", 0)); /// 0
///
logger.WriteLine(string.Format("Q-3_geprüft={0}", 0)); /// 0
///
logger.WriteLine(string.Format("Q-2_geprüft={0}", 0)); /// 0
///
logger.WriteLine(string.Format("Q-1_geprüft={0}", 1)); /// 1
logger.WriteLine(string.Format("Prüfvolumen-1={0}", 0)); /// 0,00000
logger.WriteLine(string.Format("Prüfmasse-1={0}", 0)); /// 0,00000
logger.WriteLine(string.Format("Temp1_P-1={0}", 0)); /// 19,8
logger.WriteLine(string.Format("Temp2_P-1={0}", 0)); /// 19,8
logger.WriteLine(string.Format("Temp3_P-1={0}", 0)); /// 19,8
logger.WriteLine(string.Format("Temp4_P-1={0}", 0)); /// 19,8
logger.WriteLine(string.Format("Temp5_P-1={0}", 0)); /// 19,8
logger.WriteLine(string.Format("Temp6_P-1={0}", 0)); /// 19,8
logger.WriteLine(string.Format("Temp7_P-1={0}", 0)); /// 0,0
logger.WriteLine(string.Format("Temp8_P-1={0}", 0)); /// 0,0
logger.WriteLine(string.Format("Druck1_P-1={0}", adj.TestRslt.PressUpMean.ToString(Program.AltCulture)));
logger.WriteLine(string.Format("Druck2_P-1={0}", adj.TestRslt.PressDownMean.ToString(Program.AltCulture)));
logger.WriteLine(string.Format("K-Faktor-1={0}", 0)); /// 0,00000000
logger.WriteLine(string.Format("Q_Waage-1={0}", 0)); /// 3880,87469
logger.WriteLine(string.Format("Q_Vergleich-1={0}", 0)); /// 3869,47056
logger.WriteLine(string.Format("Fehler_Vergleich-1={0}", 0)); /// -0,29472
logger.WriteLine(string.Format("VZ_ZeitImpulse-1={0}", 0)); /// 500,14362
logger.WriteLine(string.Format("VZ_Impulse-1={0}", 0)); /// 645097
logger.WriteLine(string.Format("ZeitImpulse_VZ-1={0}", 0)); /// 976843
logger.WriteLine(string.Format("VorwahlZähler-1={0}", 0)); /// 0,00000
logger.WriteLine(string.Format("VZ_Nummer-1={0}", 0)); /// 1
logger.WriteLine(string.Format("Anfangsgewicht-1={0}", 0)); /// 0,00000
logger.WriteLine(string.Format("Endgewicht-1={0}", 0)); /// 0,00000
logger.WriteLine(string.Format("MinDurchfluss-1={0}", 0)); /// 3862,00000
logger.WriteLine(string.Format("MaxDurchfluss-1={0}", 0)); /// 3876,00000
logger.WriteLine(string.Format("Q_Einstellzeit-1={0}", 0)); /// 7,28
logger.WriteLine(string.Format("Pumpennummer-1={0}", 0)); /// 2
logger.WriteLine(string.Format("Drehzahl-1={0}", 0)); /// 2269
logger.WriteLine(string.Format("DAW_Wert-1={0}", 0)); /// 1501
logger.WriteLine(string.Format("Leitfähigkeit-1={0}", 0)); /// 545,05
logger.WriteLine(string.Format("LuftDruck-1={0}", 0)); /// 0,0
logger.WriteLine(string.Format("LuftFeuchtigkeit-1={0}", 0)); /// 0,0
logger.WriteLine(string.Format("HyDruck-1={0}", 0)); /// 6,2
logger.WriteLine(string.Format("VorratsDruckHy-1={0}", 0)); /// 6,3
logger.WriteLine(string.Format("Anfangsgewicht2_-1={0}", 0)); /// 0,00000
logger.WriteLine(string.Format("Endgewicht2_-1={0}", 0)); /// 0,00000
logger.WriteLine(string.Format("Prüfmasse2_-1={0}", 0)); /// 0,00000
logger.WriteLine(string.Format("GegenWaage-1={0}", 0)); /// 0
///
logger.WriteLine(string.Format("Q0_geprüft={0}", 0)); /// 0
///
logger.WriteLine(string.Format("Q1_geprüft={0}", 1)); /// 1
logger.WriteLine(string.Format("Prüfvolumen1={0}", 0)); /// 3,73655
logger.WriteLine(string.Format("Prüfmasse1={0}", 0)); /// 3,72610
logger.WriteLine(string.Format("Temp1_P1={0}", 0)); /// 20,0
logger.WriteLine(string.Format("Temp2_P1={0}", 0)); /// 20,0
logger.WriteLine(string.Format("Temp3_P1={0}", 0)); /// 20,0
logger.WriteLine(string.Format("Temp4_P1={0}", 0)); /// 20,0
logger.WriteLine(string.Format("Temp5_P1={0}", 0)); /// 20,0
logger.WriteLine(string.Format("Temp6_P1={0}", 0)); /// 20,0
logger.WriteLine(string.Format("Temp7_P1={0}", 0)); /// 0,0
logger.WriteLine(string.Format("Temp8_P1={0}", 0)); /// 0,0
logger.WriteLine(string.Format("Druck1_P1={0}", q1.TestRslt.PressUpMean.ToString(Program.AltCulture)));
logger.WriteLine(string.Format("Druck2_P1={0}", q1.TestRslt.PressDownMean.ToString(Program.AltCulture)));
logger.WriteLine(string.Format("K-Faktor1={0}", 0)); /// 0,99820080
logger.WriteLine(string.Format("Q_Waage1={0}", 0)); /// 26,89887
logger.WriteLine(string.Format("Q_Vergleich1={0}", 0)); /// 26,83427
logger.WriteLine(string.Format("Fehler_Vergleich1={0}", 0)); /// -0,24014
logger.WriteLine(string.Format("VZ_ZeitImpulse1={0}", 0)); /// 500,07962
logger.WriteLine(string.Format("VZ_Impulse1={0}", 0)); /// 4473091
logger.WriteLine(string.Format("ZeitImpulse_VZ1={0}", 0)); /// 976718
logger.WriteLine(string.Format("VorwahlZähler1={0}", 0)); /// 0,00000
logger.WriteLine(string.Format("VZ_Nummer1={0}", 0)); /// 3
logger.WriteLine(string.Format("Anfangsgewicht1={0}", 0)); /// 4,66535
logger.WriteLine(string.Format("Endgewicht1={0}", 0)); /// 8,39145
logger.WriteLine(string.Format("MinDurchfluss1={0}", 0)); /// 26,73800
logger.WriteLine(string.Format("MaxDurchfluss1={0}", 0)); /// 27,04800
logger.WriteLine(string.Format("Q_Einstellzeit1={0}", 0)); /// 4,17
logger.WriteLine(string.Format("Pumpennummer1={0}", 0)); /// 3
logger.WriteLine(string.Format("Drehzahl1={0}", 0)); /// 1743
logger.WriteLine(string.Format("DAW_Wert1={0}", 0)); /// 2700
logger.WriteLine(string.Format("Leitfähigkeit1={0}", 0)); /// 543,10
logger.WriteLine(string.Format("LuftDruck1={0}", 0)); /// 0,0
logger.WriteLine(string.Format("LuftFeuchtigkeit1={0}", 0)); /// 0,0
logger.WriteLine(string.Format("HyDruck1={0}", 0)); /// 6,2
logger.WriteLine(string.Format("VorratsDruckHy1={0}", 0)); /// 6,3
logger.WriteLine(string.Format("Anfangsgewicht2_1={0}", 0)); /// 37,94400
logger.WriteLine(string.Format("Endgewicht2_1={0}", 0)); /// 37,94200
logger.WriteLine(string.Format("Prüfmasse2_1={0}", 0)); /// -0,00200
logger.WriteLine(string.Format("GegenWaage1={0}", 0)); /// 1
///
logger.WriteLine(string.Format("Q2_geprüft={0}", 1)); /// 1
logger.WriteLine(string.Format("Prüfvolumen2={0}", 0)); /// 4,65370
logger.WriteLine(string.Format("Prüfmasse2={0}", 0)); /// 4,64078
logger.WriteLine(string.Format("Temp1_P2={0}", 0)); /// 19,9
logger.WriteLine(string.Format("Temp2_P2={0}", 0)); /// 19,9
logger.WriteLine(string.Format("Temp3_P2={0}", 0)); /// 19,9
logger.WriteLine(string.Format("Temp4_P2={0}", 0)); /// 19,9
logger.WriteLine(string.Format("Temp5_P2={0}", 0)); /// 19,9
logger.WriteLine(string.Format("Temp6_P2={0}", 0)); /// 19,9
logger.WriteLine(string.Format("Temp7_P2={0}", 0)); /// 0,0
logger.WriteLine(string.Format("Temp8_P2={0}", 0)); /// 0,0
logger.WriteLine(string.Format("Druck1_P2={0}", q2.TestRslt.PressUpMean.ToString(Program.AltCulture)));
logger.WriteLine(string.Format("Druck2_P2={0}", q2.TestRslt.PressDownMean.ToString(Program.AltCulture)));
logger.WriteLine(string.Format("K-Faktor2={0}", 0)); /// 0,99822140
logger.WriteLine(string.Format("Q_Waage2={0}", 0)); /// 41,84627
logger.WriteLine(string.Format("Q_Vergleich2={0}", 0)); /// 41,68738
logger.WriteLine(string.Format("Fehler_Vergleich2={0}", 0)); /// -0,37970
logger.WriteLine(string.Format("VZ_ZeitImpulse2={0}", 0)); /// 400,35379
logger.WriteLine(string.Format("VZ_Impulse2={0}", 0)); /// 166897
logger.WriteLine(string.Format("ZeitImpulse_VZ2={0}", 0)); /// 781941
logger.WriteLine(string.Format("VorwahlZähler2={0}", 0)); /// 0,00000
logger.WriteLine(string.Format("VZ_Nummer2={0}", 0)); /// 2
logger.WriteLine(string.Format("Anfangsgewicht2={0}", 0)); /// 0,02457
logger.WriteLine(string.Format("Endgewicht2={0}", 0)); /// 4,66535
logger.WriteLine(string.Format("MinDurchfluss2={0}", 0)); /// 40,43333
logger.WriteLine(string.Format("MaxDurchfluss2={0}", 0)); /// 42,23333
logger.WriteLine(string.Format("Q_Einstellzeit2={0}", 0)); /// 3,80
logger.WriteLine(string.Format("Pumpennummer2={0}", 0)); /// 3
logger.WriteLine(string.Format("Drehzahl2={0}", 0)); /// 1743
logger.WriteLine(string.Format("DAW_Wert2={0}", 0)); /// 500
logger.WriteLine(string.Format("Leitfähigkeit2={0}", 0)); /// 543,10
logger.WriteLine(string.Format("LuftDruck2={0}", 0)); /// 0,0
logger.WriteLine(string.Format("LuftFeuchtigkeit2={0}", 0)); /// 0,0
logger.WriteLine(string.Format("HyDruck2={0}", 0)); /// 6,2
logger.WriteLine(string.Format("VorratsDruckHy2={0}", 0)); /// 6,3
logger.WriteLine(string.Format("Anfangsgewicht2_2={0}", 0)); /// 37,95000
logger.WriteLine(string.Format("Endgewicht2_2={0}", 0)); /// 37,94400
logger.WriteLine(string.Format("Prüfmasse2_2={0}", 0)); /// -0,00600
logger.WriteLine(string.Format("GegenWaage2={0}", 0)); /// 1
///
logger.WriteLine(string.Format("Q3_geprüft={0}", 1)); /// 1
logger.WriteLine(string.Format("Prüfvolumen3={0}", 0)); /// 107,76493
logger.WriteLine(string.Format("Prüfmasse3={0}", 0)); /// 107,46800
logger.WriteLine(string.Format("Temp1_P3={0}", 0)); /// 19,8
logger.WriteLine(string.Format("Temp2_P3={0}", 0)); /// 19,8
logger.WriteLine(string.Format("Temp3_P3={0}", 0)); /// 19,8
logger.WriteLine(string.Format("Temp4_P3={0}", 0)); /// 19,8
logger.WriteLine(string.Format("Temp5_P3={0}", 0)); /// 19,8
logger.WriteLine(string.Format("Temp6_P3={0}", 0)); /// 19,8
logger.WriteLine(string.Format("Temp7_P3={0}", 0)); /// 0,0
logger.WriteLine(string.Format("Temp8_P3={0}", 0)); /// 0,0
logger.WriteLine(string.Format("Druck1_P3={0}", q3.TestRslt.PressUpMean.ToString(Program.AltCulture)));
logger.WriteLine(string.Format("Druck2_P3={0}", q3.TestRslt.PressDownMean.ToString(Program.AltCulture)));
logger.WriteLine(string.Format("K-Faktor3={0}", 0)); /// 0,99824190
logger.WriteLine(string.Format("Q_Waage3={0}", 0)); /// 3874,27093
logger.WriteLine(string.Format("Q_Vergleich3={0}", 0)); /// 3867,08324
logger.WriteLine(string.Format("Fehler_Vergleich3={0}", 0)); /// -0,18552
logger.WriteLine(string.Format("VZ_ZeitImpulse3={0}", 0)); /// 100,13594
logger.WriteLine(string.Format("VZ_Impulse3={0}", 0)); /// 129078
logger.WriteLine(string.Format("ZeitImpulse_VZ3={0}", 0)); /// 195578
logger.WriteLine(string.Format("VorwahlZähler3={0}", 0)); /// 0,00000
logger.WriteLine(string.Format("VZ_Nummer3={0}", 0)); /// 1
logger.WriteLine(string.Format("Anfangsgewicht3={0}", 0)); /// 11,20800
logger.WriteLine(string.Format("Endgewicht3={0}", 0)); /// 118,67600
logger.WriteLine(string.Format("MinDurchfluss3={0}", 0)); /// 3862,00000
logger.WriteLine(string.Format("MaxDurchfluss3={0}", 0)); /// 3872,00000
logger.WriteLine(string.Format("Q_Einstellzeit3={0}", 0)); /// 26,37
logger.WriteLine(string.Format("Pumpennummer3={0}", 0)); /// 2
logger.WriteLine(string.Format("Drehzahl3={0}", 0)); /// 2269
logger.WriteLine(string.Format("DAW_Wert3={0}", 0)); /// 1501
logger.WriteLine(string.Format("Leitfähigkeit3={0}", 0)); /// 543,10
logger.WriteLine(string.Format("LuftDruck3={0}", 0)); /// 0,0
logger.WriteLine(string.Format("LuftFeuchtigkeit3={0}", 0)); /// 0,0
logger.WriteLine(string.Format("HyDruck3={0}", 0)); /// 6,2
logger.WriteLine(string.Format("VorratsDruckHy3={0}", 0)); /// 6,3
logger.WriteLine(string.Format("Anfangsgewicht2_3={0}", 0)); /// 0,00818
logger.WriteLine(string.Format("Endgewicht2_3={0}", 0)); /// 0,00800
logger.WriteLine(string.Format("Prüfmasse2_3={0}", 0)); /// -0,00018
logger.WriteLine(string.Format("GegenWaage3={0}", 0)); /// 1
///
logger.WriteLine(string.Format("Q4_geprüft={0}", 0)); /// 0
///
logger.WriteLine(string.Format("Q5_geprüft={0}", 0)); /// 0
for (int i = -5; i <= 5; i++)
{
Results.Entities.TestRslt tr;
if (i == -1) tr = wm0.GetTestRslt("Adjustment");
else if (i >= 1 && i <= 3) tr = wm0.GetTestRslt(string.Format("Q{0}", i));
else tr = null;
if (tr != null)
{
logger.WriteLine(string.Format("Q{0}_geprüft=1", i));
WriteOneToDisk(logger, i, tr);
}
else
{
logger.WriteLine(string.Format("Q{0}_geprüft=0", i));
}
}
///
logger.WriteLine(string.Format("FüllenDruck={0}", 0)); /// 0,00
logger.WriteLine(string.Format("EvakVorneDruck={0}", 0)); /// 0,00
@@ -742,8 +589,8 @@ namespace TBF.BenchControl.DB.SensusOracle
logger.WriteLine(string.Empty);
logger.WriteLine("[allgemein]");
///
logger.WriteLine(string.Format("Prüfer={0}", 6)); /// 1047
logger.WriteLine(string.Format("PrüferID={0}", 6)); /// 246
logger.WriteLine(string.Format("Prüfer={0}", batch.UserName));
logger.WriteLine(string.Format("PrüferID={0}", batch.UserNumber));
logger.WriteLine(string.Format("AuftragKompakt={0}", 0)); /// 4248189
logger.WriteLine(string.Format("VariantenCode={0}", "IP")); /// IPRO04CMECAZDKAMMXB1AA2011201101AEUAA1XX314NM1XXXLX
logger.WriteLine(string.Format("SollStückzahl={0}", 3)); /// 1000
@@ -775,6 +622,50 @@ namespace TBF.BenchControl.DB.SensusOracle
}
static void WriteOneToDisk(StreamWriter logger, int i, Results.Entities.TestRslt tr)
{
logger.WriteLine(string.Format("Prüfvolumen{0}={1}", i, Config.Units.ConvertTo(Unit.l, tr.TestData.TargetVolume).ToString(Program.AltCulture)));
logger.WriteLine(string.Format("Prüfmasse{0}={1}", i, 0)); /// 3,72610
logger.WriteLine(string.Format("Temp1_P{0}={1}", i, 0)); /// 20,0
logger.WriteLine(string.Format("Temp2_P{0}={1}", i, 0)); /// 20,0
logger.WriteLine(string.Format("Temp3_P{0}={1}", i, 0)); /// 20,0
logger.WriteLine(string.Format("Temp4_P{0}={1}", i, 0)); /// 20,0
logger.WriteLine(string.Format("Temp5_P{0}={1}", i, 0)); /// 20,0
logger.WriteLine(string.Format("Temp6_P{0}={1}", i, 0)); /// 20,0
logger.WriteLine(string.Format("Temp7_P{0}={1}", i, 0)); /// 0,0
logger.WriteLine(string.Format("Temp8_P{0}={1}", i, 0)); /// 0,0
logger.WriteLine(string.Format("Druck1_P{0}={1}", i, Config.Units.ConvertTo(Unit.bar, tr.PressUpMean).ToString(Program.AltCulture)));
logger.WriteLine(string.Format("Druck2_P{0}={1}", i, Config.Units.ConvertTo(Unit.bar, tr.PressDownMean).ToString(Program.AltCulture)));
logger.WriteLine(string.Format("K-Faktor{0}={1}", i, 0)); /// 0,99820080
logger.WriteLine(string.Format("Q_Waage{0}={1}", i, 0)); /// 26,89887
logger.WriteLine(string.Format("Q_Vergleich{0}={1}", i, 0)); /// 26,83427
logger.WriteLine(string.Format("Fehler_Vergleich{0}={1}", i, 0)); /// -0,24014
logger.WriteLine(string.Format("VZ_ZeitImpulse{0}={1}", i, 0)); /// 500,07962
logger.WriteLine(string.Format("VZ_Impulse{0}={1}", i, 0)); /// 4473091
logger.WriteLine(string.Format("ZeitImpulse_VZ{0}={1}", i, 0)); /// 976718
logger.WriteLine(string.Format("VorwahlZähler{0}={1}", i, 0)); /// 0,00000
logger.WriteLine(string.Format("VZ_Nummer{0}={1}", i, 0)); /// 3
logger.WriteLine(string.Format("Anfangsgewicht{0}={1}", i, 0)); /// 4,66535
logger.WriteLine(string.Format("Endgewicht{0}={1}", i, 0)); /// 8,39145
logger.WriteLine(string.Format("MinDurchfluss{0}={1}", i, Config.Units.ConvertTo(Unit.lph, tr.FlowMin).ToString(Program.AltCulture)));
logger.WriteLine(string.Format("MaxDurchfluss{0}={1}", i, Config.Units.ConvertTo(Unit.lph, tr.FlowMax).ToString(Program.AltCulture)));
logger.WriteLine(string.Format("Q_Einstellzeit{0}={1}", i, 0)); /// 4,17
logger.WriteLine(string.Format("Pumpennummer{0}={1}", i, 0)); /// 3
logger.WriteLine(string.Format("Drehzahl{0}={1}", i, 0)); /// 1743
logger.WriteLine(string.Format("DAW_Wert{0}={1}", i, 0)); /// 2700
logger.WriteLine(string.Format("Leitfähigkeit{0}={1}", i, 0)); /// 543,10
logger.WriteLine(string.Format("LuftDruck{0}={1}", i, 0)); /// 0,0
logger.WriteLine(string.Format("LuftFeuchtigkeit{0}={1}", i, 0)); /// 0,0
logger.WriteLine(string.Format("HyDruck{0}={1}", i, 0)); /// 6,2
logger.WriteLine(string.Format("VorratsDruckHy{0}={1}", i, 0)); /// 6,3
logger.WriteLine(string.Format("Anfangsgewicht2_{0}={1}", i, 0)); /// 37,94400
logger.WriteLine(string.Format("Endgewicht2_{0}={1}", i, 0)); /// 37,94200
logger.WriteLine(string.Format("Prüfmasse2_{0}={1}", i, 0)); /// -0,00200
logger.WriteLine(string.Format("GegenWaage{0}={1}", i, 0)); /// 1
}
#if ORACLE_DB
public static Retv WriteResultsToDatabase(OracleConnection conn, Results.Entities.Batch batch, bool safeMode)
{
@@ -1073,18 +964,46 @@ namespace TBF.BenchControl.DB.SensusOracle
}
foreach (var testInfo in testInfos)
{
Results.Entities.MeterTestRslt mtr = wm.GetMeterTestRslt(testInfo.QBezeichnung);
if (mtr == null)
Results.Entities.TestData tData = wm.GetTestData(testInfo.QBezeichnung);
Results.Entities.MeterTestRslt mtr;
if (tData == null)
{
throw new Exception(string.Format("'{0}' test results missing, watermeter {1}", testInfo.QBezeichnung, wm.WMPosition));
}
else if (tData.Repeats == 1)
{
mtr = wm.GetMeterTestRslt(testInfo.QBezeichnung);
if (mtr == null) throw new Exception(string.Format("'{0}' test results missing, watermeter {1}", testInfo.QBezeichnung, wm.WMPosition));
}
else
{
Results.Entities.MeterTestRslt firstMtr = wm.GetMeterTestRslt(Utils.TestTitle(tData, 1));
if (firstMtr == null) throw new Exception(string.Format("'{0}' test results missing, watermeter {1}", Utils.TestTitle(tData, 1), wm.WMPosition));
mtr = new Results.Entities.MeterTestRslt();
mtr.CopyContentFrom(firstMtr);
mtr.TestRslt = firstMtr.TestRslt;
mtr.WaterMeter = firstMtr.WaterMeter;
for (int i = 2; i <= tData.Repeats; i++)
{
Results.Entities.MeterTestRslt nextMtr = wm.GetMeterTestRslt(Utils.TestTitle(tData, i));
if (nextMtr == null) throw new Exception(string.Format("'{0}' test results missing, watermeter {1}", Utils.TestTitle(tData, i), wm.WMPosition));
mtr.TestTime += nextMtr.TestTime;
mtr.VolumeMeter += nextMtr.VolumeMeter;
mtr.VolumeRef += nextMtr.VolumeRef;
mtr.VolumeEnd = nextMtr.VolumeEnd;
mtr.Passed = (mtr.Passed && nextMtr.Passed);
}
mtr.Error = Formulas.ErrorFromVolumes(mtr.VolumeMeter, mtr.VolumeRef);
}
SaveMeterTestResult(conn, mtr, testInfo.PruefungsNr, max_Pruefindex);
}
{
double q2ErrWOCorrection = Math.Min(100.0, Math.Max(-100.0, wm.Q2ErrWOCorrection));
@@ -1116,7 +1035,7 @@ namespace TBF.BenchControl.DB.SensusOracle
/// </summary>
/// <param name="q">q = 0, 1, 2 or 3 (Adj., Q1, Q2, Q3)</param>
/// <returns>Nr. of rows updated</returns>
static int SaveMeterTestResult(OracleConnection conn, Results.Entities.MeterTestRslt mtr, int qq, int max_Pruefindex) ///
static int SaveMeterTestResult(OracleConnection conn, Results.Entities.MeterTestRslt mtr, int pruefungsNr, int max_Pruefindex) ///
{
double Q_wm = 3600.0 * mtr.VolumeMeter / mtr.TestTime; /// in [l/hour]
double Q_wm_with_upper_bound = Math.Min(2 * 1000 * mtr.TestRslt.FlowVolume, Math.Max(0.0, Q_wm));
@@ -1129,7 +1048,7 @@ namespace TBF.BenchControl.DB.SensusOracle
OracleParameter parm;
parm = new OracleParameter("VT_Fernum", OracleDbType.Varchar2); parm.Value = mtr.WaterMeter.SerialNr; cmd.Parameters.Add(parm); ///:1
parm = new OracleParameter("Pruefindex", OracleDbType.Int32); parm.Value = max_Pruefindex; cmd.Parameters.Add(parm); ///:2
parm = new OracleParameter("PruefungsNr", OracleDbType.Int32); parm.Value = qq; cmd.Parameters.Add(parm); ///:3
parm = new OracleParameter("PruefungsNr", OracleDbType.Int32); parm.Value = pruefungsNr; cmd.Parameters.Add(parm); ///:3
parm = new OracleParameter("ANBID", OracleDbType.Int32); parm.Value = Anbid_StaraTura; cmd.Parameters.Add(parm); ///:4
parm = new OracleParameter("ID_WZTyp", OracleDbType.Int32); parm.Value = mtr.WaterMeter.WaterMeterData.WMTypeId; cmd.Parameters.Add(parm); ///:5
parm = new OracleParameter("Rev_WZTyp", OracleDbType.Int32); parm.Value = mtr.WaterMeter.WaterMeterData.WMTypeRev; cmd.Parameters.Add(parm); ///:6
@@ -1138,17 +1057,18 @@ namespace TBF.BenchControl.DB.SensusOracle
parm = new OracleParameter("Q_Fehler", OracleDbType.Double); parm.Value = Math.Min(100.0, Math.Max(-100.0, mtr.Error)); cmd.Parameters.Add(parm); ///:9
parm = new OracleParameter("Q_Best", OracleDbType.Int32); parm.Value = mtr.Passed ? 1 : 0; cmd.Parameters.Add(parm); ///:10
parm = new OracleParameter("NIZ", OracleDbType.Int32); parm.Value = 0; cmd.Parameters.Add(parm); ///:11
parm = new OracleParameter("AnfangZStand", OracleDbType.Double); parm.Value = 0;/*TODO*/ cmd.Parameters.Add(parm); ///:12
parm = new OracleParameter("EndZStand", OracleDbType.Double); parm.Value = 0;/*TODO*/ cmd.Parameters.Add(parm); ///:13
/// KorrErrQok
/// KorrErrQ
/// KorrQWz
parm = new OracleParameter("TIZ", OracleDbType.Double); parm.Value = Math.Min(100000, mtr.TestTime); cmd.Parameters.Add(parm);
parm = new OracleParameter("AnfangZStand", OracleDbType.Double); parm.Value = mtr.VolumeStart; cmd.Parameters.Add(parm); ///:12
parm = new OracleParameter("EndZStand", OracleDbType.Double); parm.Value = mtr.VolumeEnd; cmd.Parameters.Add(parm); ///:13
/// KorrErrQok bool true = Q2 within limits, 'passed' in case of Q1, Q3, Q4
/// KorrErrQ double 'Q2 error before correction' when correction done or 'Q2 error' when correction not done
/// = q2.WaterMeter.Q2CorrectionDone ? q2.WaterMeter.Q2ErrWOCorrection.ToString(Program.AltCulture) : q2.Error.ToString(Program.AltCulture)));
/// KorrQWz double
parm = new OracleParameter("TIZ", OracleDbType.Double); parm.Value = Math.Min(100000, mtr.TestTime); cmd.Parameters.Add(parm);
/// Vol_WZ_US
/// TempMittel_US
int retv = cmd.ExecuteNonQuery();
log.DebugFormat("VT_PRUEFREIHE_IST_PD inserted, PcbNr={0}, q={1}, error={2}", mtr.WaterMeter.SerialNr, qq, mtr.Error);
log.DebugFormat("VT_PRUEFREIHE_IST_PD inserted, PcbNr={0}, pruefungsNr={1}, error={2}", mtr.WaterMeter.SerialNr, pruefungsNr, mtr.Error);
return retv;
}
#endif
@@ -30,6 +30,9 @@ namespace TBF.BenchControl.DB.SensusOracle
public class DatabaseCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(DatabaseCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new DatabaseCfgCtrl(); }
@@ -21,7 +21,7 @@ namespace TBF.BenchControl.DB.SensusOracle
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(DatabaseCfg), component, this);
return ComponentCfgBase.CreateFromDbEntity(DatabaseCfg.Serializer, component, this);
}
}
}
@@ -11,6 +11,9 @@ namespace TBF.BenchControl.Danfoss.VLT2800
{
public class PumpCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PumpCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new PumpCfgCtrl(); }
///
@@ -20,7 +20,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(PumpCfg), component, this);
return ComponentCfgBase.CreateFromDbEntity(PumpCfg.Serializer, component, this);
}
}
}
@@ -11,7 +11,7 @@ using TBF.Resources;
namespace TBF.BenchControl.DataEntry.Combined
{
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
@@ -41,6 +41,7 @@ namespace TBF.BenchControl.DataEntry.Combined
public CycleBeginningForm()
{
InitializeComponent();
ControlBox = false;
TextBoxesCount = 3;
mainLabels = new Label[] { mainSN1Label, mainSN2Label, mainSN3Label };
@@ -70,7 +71,7 @@ namespace TBF.BenchControl.DataEntry.Combined
ShuffleTextBoxes(compoundWaterMetersCount);
//Height = 147 + WaterMetersCount * 90;
Height = 110 + WaterMetersCount * 157;
}
/// <summary>
@@ -108,7 +109,6 @@ namespace TBF.BenchControl.DataEntry.Combined
auxComboBoxes[i].Items.Add(Program.LocalSettings.LastAuxSNTexts[i]);
}
}
}
void Localize()
@@ -33,6 +33,7 @@ namespace TBF.BenchControl.DataEntry.Combined
public CycleEndForm()
{
InitializeComponent();
ControlBox = false;
MainStateText = new string[Config.Data.CompoundWMsCount];
AuxStateText = new string[Config.Data.CompoundWMsCount];
@@ -23,11 +23,7 @@ namespace TBF.BenchControl.DataEntry.Combined
string purchaseOrder;
public string PurchaseOrder { get { return purchaseOrder; } }
string[] serialNr;
public string SerialNr(int wmNr) { return (wmNr >= 0 && wmNr < serialNr.Length) ? serialNr[wmNr] : string.Empty; }
bool[] disabled;
public bool Disabled(int wmNr) { return (wmNr >= 0 && wmNr < disabled.Length) ? disabled[wmNr] : false; }
bool[] disabled; /// This array is shared between forms
string[] wmCycleEndState;
public string WMCycleEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmCycleEndState.Length) ? wmCycleEndState[wmNr] : string.Empty; }
@@ -72,7 +68,6 @@ namespace TBF.BenchControl.DataEntry.Combined
{
entryFormCfg = cfg as EntryFormCfg;
serialNr = new string[Config.Data.CompoundWMsCount * 2];
disabled = new bool[Config.Data.CompoundWMsCount];
wmStartState = new double[Config.Data.CompoundWMsCount * 2];
wmStartStateStr = new string[Config.Data.CompoundWMsCount * 2];
@@ -197,13 +192,14 @@ namespace TBF.BenchControl.DataEntry.Combined
{
purchaseOrder = dlg.PurchaseOrder;
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length / 2); i++)
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++)
{
if (waterMeters[i] != null)
{
serialNr[2 * i] = waterMeters[i].SerialNr = dlg.MainSNText[i];
serialNr[2 * i + 1] = waterMeters[i].SerialNrAux = dlg.AuxSNText[i];
disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i];
waterMeters[i].SerialNr = dlg.MainSNText[i];
waterMeters[i].SerialNrAux = dlg.AuxSNText[i];
disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i];
}
}
}
@@ -11,6 +11,9 @@ namespace TBF.BenchControl.DataEntry.Combined
{
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
///
@@ -20,7 +20,7 @@ namespace TBF.BenchControl.DataEntry.Combined
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(EntryFormCfg), component, this);
return ComponentCfgBase.CreateFromDbEntity(EntryFormCfg.Serializer, component, this);
}
}
}
@@ -55,6 +55,7 @@ namespace TBF.BenchControl.DataEntry.Combined
public TestStartEndForm()
{
InitializeComponent();
ControlBox = false;
TextBoxesCount = 3;
@@ -11,7 +11,7 @@ using TBF.Resources;
namespace TBF.BenchControl.DataEntry.HeatMeters12
{
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
@@ -49,6 +49,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
public CycleBeginningForm()
{
InitializeComponent();
ControlBox = false;
labels = new Label[] { label1, label2, label3, label4, label5, label6,
label7, label8, label9, label10, label11, label12 };
@@ -28,9 +28,11 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleEndForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
EndStateText = new string[WaterMetersCount];
ControlBox = false;
this.WaterMetersCount = waterMetersCount;
EndStateText = new string[WaterMetersCount];
completed = false;
StartForceCloseHandler();
}
@@ -26,11 +26,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
string purchaseOrder;
public string PurchaseOrder { get { return purchaseOrder; } }
string[] serialNr;
public string SerialNr(int wmNr) { return (wmNr >= 0 && wmNr < serialNr.Length) ? serialNr[wmNr] : string.Empty; }
bool[] disabled;
public bool Disabled(int wmNr) { return (wmNr >= 0 && wmNr < disabled.Length) ? disabled[wmNr] : false; }
bool[] disabled; /// This array is shared between forms
string[] wmCycleEndState;
public string WMCycleEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmCycleEndState.Length) ? wmCycleEndState[wmNr] : string.Empty; }
@@ -87,7 +83,6 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
{
entryFormCfg = cfg as EntryFormCfg;
serialNr = new string[Config.Data.HeatMetersCount];
disabled = new bool[Config.Data.HeatMetersCount];
wmStartState = new double[Config.Data.HeatMetersCount];
wmStartStateStr = new string[Config.Data.HeatMetersCount];
@@ -237,7 +232,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
{
if (waterMeters[i] != null)
{
serialNr[i] = waterMeters[i].SerialNr = dlg.SNText[i];
waterMeters[i].SerialNr = dlg.SNText[i];
disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i];
}
}
@@ -11,6 +11,9 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
{
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
///
@@ -23,7 +23,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
IComponentCfg cfg = ComponentCfgBase.CreateFromDbEntity(typeof(EntryFormCfg), component, this);
IComponentCfg cfg = ComponentCfgBase.CreateFromDbEntity(EntryFormCfg.Serializer, component, this);
(cfg as EntryFormCfg).Units = (cfg as EntryFormCfg).DefaultUnits;
return cfg;
}
@@ -60,6 +60,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
public TestStartEndForm()
{
InitializeComponent();
ControlBox = false;
TextBoxesCount = 12;
@@ -11,7 +11,7 @@ using TBF.Resources;
namespace TBF.BenchControl.DataEntry.HeatMeters6
{
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
@@ -49,6 +49,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
public CycleBeginningForm()
{
InitializeComponent();
ControlBox = false;
labels = new Label[] { label1, label2, label3, label4, label5, label6 };
comboBoxes = new ComboBox[] { comboBox1, comboBox2, comboBox3, comboBox4, comboBox5, comboBox6 };
@@ -28,9 +28,11 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleEndForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
EndStateText = new string[WaterMetersCount];
ControlBox = false;
this.WaterMetersCount = waterMetersCount;
EndStateText = new string[WaterMetersCount];
completed = false;
StartForceCloseHandler();
}
@@ -26,11 +26,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
string purchaseOrder;
public string PurchaseOrder { get { return purchaseOrder; } }
string[] serialNr;
public string SerialNr(int wmNr) { return (wmNr >= 0 && wmNr < serialNr.Length) ? serialNr[wmNr] : string.Empty; }
bool[] disabled;
public bool Disabled(int wmNr) { return (wmNr >= 0 && wmNr < disabled.Length) ? disabled[wmNr] : false; }
bool[] disabled; /// This array is shared between forms
string[] wmCycleEndState;
public string WMCycleEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmCycleEndState.Length) ? wmCycleEndState[wmNr] : string.Empty; }
@@ -87,7 +83,6 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
{
entryFormCfg = cfg as EntryFormCfg;
serialNr = new string[Config.Data.HeatMetersCount];
disabled = new bool[Config.Data.HeatMetersCount];
wmStartState = new double[Config.Data.HeatMetersCount];
wmStartStateStr = new string[Config.Data.HeatMetersCount];
@@ -237,7 +232,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
{
if (waterMeters[i] != null)
{
serialNr[i] = waterMeters[i].SerialNr = dlg.SNText[i];
waterMeters[i].SerialNr = dlg.SNText[i];
disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i];
}
}
@@ -11,6 +11,9 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
{
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
///
@@ -23,7 +23,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
IComponentCfg cfg = ComponentCfgBase.CreateFromDbEntity(typeof(EntryFormCfg), component, this);
IComponentCfg cfg = ComponentCfgBase.CreateFromDbEntity(EntryFormCfg.Serializer, component, this);
(cfg as EntryFormCfg).Units = (cfg as EntryFormCfg).DefaultUnits;
return cfg;
}
@@ -60,6 +60,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
public TestStartEndForm()
{
InitializeComponent();
ControlBox = false;
TextBoxesCount = 6;

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