Compare commits

..
Author SHA1 Message Date
Milan Hanajik 5883234a23 Reconfigured for Torino50 2017-04-24 11:02:47 +02:00
274 changed files with 8130 additions and 9715 deletions
+6 -2
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;GENESIS;IPERL;LANG_DE</DefineConstants>
<DefineConstants>TRACE;DEBUG;TORINO50</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -28,7 +28,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;GENESIS;IPERL;LANG_DE</DefineConstants>
<DefineConstants>TRACE;TORINO50</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -78,10 +78,12 @@
<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" />
@@ -99,9 +101,11 @@
<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" />
+2 -2
View File
@@ -20,13 +20,13 @@ 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 || SLM_150 || PETERBURG_200
#elif FUZHOU300 || FUZHOU150 || PT200IL || PUCHONG_PT200 || GENESIS || BERLIN
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 || PETERBURG_50
#elif TORINO50 || BADGER_MALA_TRAT
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
+3 -4
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -11,9 +11,8 @@ namespace Config.Entities
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 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; }
+7 -16
View File
@@ -42,25 +42,16 @@ namespace Config.Entities
{
Active,
History,
Template,
Count,
}
/// <summary> Kind of meters for the procedure / test </summary>
public enum MetersKind
{
#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
Single,
Combined,
HeatMeter,
}
public enum CompoundMeterId : byte
@@ -236,11 +227,10 @@ namespace Config.Entities
public enum Progress
{
JustStarted,
TransitionBefore,
TransitionBefore,
SwitchingFlowDetection,
FlowSetting,
Aborted, /// Use as an argument when a test was aborted
Test,
Test,
TransitionAfter,
Completed,
Count,
@@ -364,3 +354,4 @@ namespace Config.Entities
Count
}
}
+1 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -11,7 +11,6 @@ namespace Config.Entities
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; }
+2 -12
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
@@ -10,15 +10,5 @@ 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;
}
}
}
}
+1 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016-2017 Sensus Metering Systems
/// Copyright (c) 2016 Sensus Metering Systems
///
using System;
@@ -10,7 +10,6 @@ namespace Config.Entities
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]
+67
View File
@@ -0,0 +1,67 @@
///
/// 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;
}
}
}
+1 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -11,7 +11,6 @@ namespace Config.Entities
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; }
+1 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -11,7 +11,6 @@ namespace Config.Entities
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; }
+4 -15
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -27,14 +27,11 @@ 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; } /// Initial version of this procedure was a copy of another procedure
public virtual bool ObtainedByCopy { get; set; }
///
public virtual MetersKind MetersKind { get; set; } /// single / compound / heat meters
public virtual MetersKind MetersKind { get; set; }
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
@@ -91,9 +88,7 @@ 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;
@@ -118,9 +113,6 @@ namespace Config.Entities
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);
@@ -151,9 +143,6 @@ namespace Config.Entities
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();
+27 -42
View File
@@ -16,24 +16,21 @@ namespace Config.Entities
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 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 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 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 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 bool Draining { 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 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
@@ -70,13 +67,10 @@ namespace Config.Entities
/// Default values
///
Publish = (sbyte)Config.Entities.Publish.Always;
DoEvaluate = true;
Evaluate = true;
Repeats = 1;
DoDraining = false;
DoZeroing = false;
DoControlWaterTemp = false;
TempLimLo = 15.0f;
TempLimHi = 25.0f;
Draining = false;
Zeroing = false;
ErrLimLo = -2.0f; /// [%] lower error limit
ErrLimHi = 2.0f; /// [%] upper error limit
Uncertainty = 0;
@@ -110,17 +104,14 @@ namespace Config.Entities
result.Part = Part;
result.Publish = Publish;
result.DoEvaluate = DoEvaluate;
result.Evaluate = Evaluate;
result.Qfrom = Qfrom;
result.Qto = Qto;
result.Volume = Volume;
result.TstTime = TstTime;
result.Repeats = Repeats;
result.DoDraining = DoDraining;
result.DoZeroing = DoZeroing;
result.DoControlWaterTemp = DoControlWaterTemp;
result.TempLimLo = TempLimLo;
result.TempLimHi = TempLimHi;
result.Draining = Draining;
result.Zeroing = Zeroing;
result.PumpPower = PumpPower;
result.MassRepeats = MassRepeats;
result.MassSpread = MassSpread;
@@ -156,7 +147,7 @@ namespace Config.Entities
output.WriteLine(Name);
output.WriteLine(Part.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Publish.ToString(CultureInfo.InvariantCulture));
output.WriteLine(DoEvaluate.ToString());
output.WriteLine(Evaluate.ToString());
output.WriteLine(Qfrom.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Qto.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Volume.ToString(CultureInfo.InvariantCulture));
@@ -166,12 +157,9 @@ namespace Config.Entities
output.WriteLine(ErrLimHi.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Uncertainty.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Repeats.ToString(CultureInfo.InvariantCulture));
output.WriteLine(DoDraining.ToString());
output.WriteLine(DoZeroing.ToString());
output.WriteLine(DoControlWaterTemp.ToString());
output.WriteLine(TempLimLo.ToString(CultureInfo.InvariantCulture));
output.WriteLine(TempLimHi.ToString(CultureInfo.InvariantCulture));
output.WriteLine(PumpPower.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));
@@ -202,7 +190,7 @@ namespace Config.Entities
tst.Name = firstLine;
tst.Part = int.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.Publish = sbyte.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.DoEvaluate = bool.Parse(input.ReadLine());
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);
@@ -212,11 +200,8 @@ namespace Config.Entities
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.DoDraining = bool.Parse(input.ReadLine());
tst.DoZeroing = bool.Parse(input.ReadLine());
tst.DoControlWaterTemp = bool.Parse(input.ReadLine());
tst.TempLimLo = float.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
tst.TempLimHi = float.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);
@@ -251,7 +236,7 @@ namespace Config.Entities
{
string partStr = (Part > 0) ? string.Format(", part {0}", Part) : string.Empty;
return string.Format("{0}(P.{1},{2}){3}", Name, ((Publish)Publish).ToString(), DoEvaluate ? "E" : "-", partStr);
return string.Format("{0}(P.{1},{2}){3}", Name, ((Publish)Publish).ToString(), Evaluate ? "E" : "-", partStr);
}
}
}
+176
View File
@@ -0,0 +1,176 @@
///
/// 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());
}
}
}
+1 -2
View File
@@ -13,8 +13,7 @@ namespace Config.Entities
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 string Description { get; set; } /// Short description
public virtual string Description { get; set; } /// Short description
public virtual IList<TransitionStep> TransitionSteps { get; set; }
public TransitionSequence()
+2 -21
View File
@@ -6,7 +6,7 @@ using System.Collections.Generic;
namespace Config.Entities
{
public class User
public class User //: Users.IUser
{
public virtual int Id { get; protected set; }
public virtual string UserName { get; set; } /// = name, alias, abbreviation
@@ -20,24 +20,5 @@ 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;
}
}
}
}
+1 -2
View File
@@ -11,8 +11,7 @@ namespace Config.Entities
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 string Description { get; set; } /// Short description
public virtual string Description { get; set; } /// Short description
public virtual IList<VirtualBenchStep> VirtualBenchSteps { get; set; }
public VirtualBenchSequence()
+11 -17
View File
@@ -131,15 +131,9 @@ namespace Config
{
using (var transaction = session.BeginTransaction())
{
try
{
session.SaveOrUpdate(obj);
transaction.Commit();
}
catch
{
transaction.Rollback();
}
session.SaveOrUpdate(obj);
try { transaction.Commit(); }
catch { }
}
}
@@ -177,16 +171,16 @@ namespace Config
///
/// Prepare all groups
///
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);
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);
/// Create the user 'admin' add his groups
var admin = new Config.Entities.User
var admin = new Users.Entities.User
{
UserName = Data.AdminUsername,
FullName = Strings.Administrator,
+29
View File
@@ -0,0 +1,29 @@
///
/// 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);
}
}
}
+1 -5
View File
@@ -29,11 +29,7 @@ namespace Config.Mappings
Map(x => x.MetersKind);
Map(x => x.Watermeters);
Map(x => x.ProtocolTitle);
Map(x => x.Protected);
Map(x => x.MustBeComplete);
Map(x => x.ManualCtrlDisabled);
Map(x => x.DataEntry);
Map(x => x.DataEntry);
Map(x => x.ResultsPrinter);
Map(x => x.ResultsWriter);
Map(x => x.TransitionStart);
+5 -9
View File
@@ -1,5 +1,6 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Author: Milan Hanajik
///
using FluentNHibernate.Mapping;
using Config.Entities;
@@ -15,20 +16,15 @@ namespace Config.Mappings
Map(x => x.Name);
Map(x => x.Part);
Map(x => x.Publish);
Map(x => x.DoEvaluate)
.Column("Evaluate");
Map(x => x.Evaluate);
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.Volume);
Map(x => x.TstTime);
Map(x => x.Repeats);
Map(x => x.DoDraining)
Map(x => x.Draining)
.Column("Emptying");
Map(x => x.DoZeroing)
.Column("Zeroing");
Map(x => x.DoControlWaterTemp);
Map(x => x.TempLimLo);
Map(x => x.TempLimHi);
Map(x => x.Zeroing);
Map(x => x.PumpPower);
Map(x => x.MassRepeats);
Map(x => x.MassSpread);
+109
View File
@@ -0,0 +1,109 @@
///
/// 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.14.573.0")]
[assembly: AssemblyFileVersion("2.14.573.0")]
[assembly: AssemblyVersion("2.12.537.0")]
[assembly: AssemblyFileVersion("2.12.537.0")]
+20 -42
View File
@@ -20,13 +20,12 @@ 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 Custom1 { get; set; }
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 Dirty { get; set; }
public virtual bool RsltsSent { 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; }
@@ -41,50 +40,29 @@ namespace Results.Entities
TestRslts = new List<TestRslt>();
}
public virtual double AmbTempMean()
public virtual float AmbientTempAve()
{
double timeSum = 0;
double sum = 0;
if (TestRslts.Count == 0) return 0;
float sum = 0;
foreach (var tr in TestRslts) sum += tr.AmbTempMean;
return sum / TestRslts.Count;
}
foreach (var tr in TestRslts)
{
double time = (tr.EndTime - tr.StartTime).TotalSeconds;
timeSum += time;
sum += (tr.AmbTempMean * time);
}
return (timeSum == 0) ? 0 : (sum / timeSum);
}
public virtual double AmbPressMean()
public virtual float AmbientPressAve()
{
double timeSum = 0;
double sum = 0;
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)
{
double time = (tr.EndTime - tr.StartTime).TotalSeconds;
timeSum += time;
sum += (tr.AmbPressMean * time);
}
return (timeSum == 0) ? 0 : (sum / timeSum);
}
public virtual double AmbHumiMean()
public virtual float AmbientHumiAve()
{
double timeSum = 0;
double sum = 0;
foreach (var tr in TestRslts)
{
double time = (tr.EndTime - tr.StartTime).TotalSeconds;
timeSum += time;
sum += (tr.AmbHumiMean * time);
}
return (timeSum == 0) ? 0 : (sum / timeSum);
}
if (TestRslts.Count == 0) return 0;
float sum = 0;
foreach (var tr in TestRslts) sum += tr.AmbHumiMean;
return sum / TestRslts.Count;
}
public virtual TestRslt GetTestRslt(string name, int part)
{
+24 -36
View File
@@ -12,22 +12,19 @@ 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 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; }
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; }
protected TestData()
@@ -39,21 +36,18 @@ 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;
DoControlWaterTemp = test.DoControlWaterTemp;
TempLimLo = test.TempLimLo;
TempLimHi = test.TempLimHi;
Publish = test.Publish;
Evaluate = test.DoEvaluate;
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;
}
@@ -74,12 +68,6 @@ 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;
+7 -13
View File
@@ -17,8 +17,6 @@ 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
@@ -88,11 +86,10 @@ 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 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 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 Custom1 { get; set; } /// [°C] T ref hi mean
public virtual float Custom2 { get; set; } /// [°C] T ref hi start
@@ -140,8 +137,6 @@ 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;
@@ -207,11 +202,10 @@ namespace Results.Entities
TempDivEnd = src.TempDivEnd;
TempDivMin = src.TempDivMin;
TempDivMax = src.TempDivMax;
FlowMean = src.FlowMean;
FlowStart = src.FlowStart;
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;
-13
View File
@@ -19,7 +19,6 @@ 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 Remark { get; set; }
#if IPERL
public virtual int SerialNrEx { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
@@ -88,17 +87,6 @@ namespace Results.Entities
return passed;
}
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
///
@@ -170,7 +158,6 @@ namespace Results.Entities
QFall = src.QFall;
Passed = src.Passed;
ResultCode = src.ResultCode;
Remark = src.Remark;
#if IPERL
SerialNrEx = src.SerialNrEx;
OrigCalibFactor = src.OrigCalibFactor;
+85 -67
View File
@@ -27,9 +27,8 @@ namespace Results.Forms
public TestsArrangement TestsArrangement;
public int NrMetersInOneGroup;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_SingleWM;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_CombinedWM;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_HeatM;
public IList<Results.ItemSpec> RsltItems_Screen_SingleWM;
public IList<Results.ItemSpec> RsltItems_Screen_CombinedWM;
public int[] RsltsClmnWidths { set { rsltsClmnWidths = value; } }
public int PopupResultsLeft;
@@ -43,7 +42,7 @@ namespace Results.Forms
/// Private members
///
Results.BatchResults results;
MetersKind metersKind;
bool compound;
ListView firstListView;
public int[] rsltsClmnWidths;
@@ -88,23 +87,6 @@ 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>
@@ -127,7 +109,7 @@ namespace Results.Forms
}
int metersInOneGroup = Math.Max(1, Math.Min(enabledWMsCount, NrMetersInOneGroup));
int nrGroups = Math.Max(1, (enabledWMsCount + metersInOneGroup - 1) / metersInOneGroup);
int nrGroups = Math.Max(1, (enabledWMsCount + NrMetersInOneGroup - 1) / metersInOneGroup);
if (MetersArrangement == MetersArrangement.Horizontally)
{
@@ -229,21 +211,20 @@ namespace Results.Forms
/// <returns>ListView object</returns>
ListView GetResultsTestsAreRows(Results.Entities.WaterMeter wMtr, int printedWMNr)
{
metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single);
compound = wMtr.Compound();
ListView lview = GetListView();
IList<Results.WMeterRsltItemSpec> items = GetRsltItems(metersKind);
IList<Results.ItemSpec> items = (compound ? RsltItems_Screen_CombinedWM : RsltItems_Screen_SingleWM);
if (items == null || items.Count == 0) return lview;
// Header
lview.Columns.Add(printedWMNr.ToString(), (rsltsClmnCount > 0) ? rsltsClmnWidths[0] : 40);
int col = 1;
int i = 1;
foreach (var item in items)
{
lview.Columns.Add(item.Caption, (rsltsClmnCount > col) ? rsltsClmnWidths[col] : 70);
col++;
lview.Columns.Add(item.ClmnHeaderText, (rsltsClmnCount > i) ? rsltsClmnWidths[i] : 70);
i++;
}
@@ -251,21 +232,29 @@ namespace Results.Forms
int ix = 0;
foreach (var mtr in wMtr.MeterTestRslts)
{
if (mtr != null &&
(mtr.CompoundMeterId == (byte)CompoundMeterId.Single ||
mtr.CompoundMeterId == (byte)CompoundMeterId.Compound ||
mtr.CompoundMeterId == (byte)CompoundMeterId.HeatMeterEnergy) &&
mtr.TestDone &&
mtr.Publish() != Config.Entities.Publish.Never &&
mtr.Publish() != Config.Entities.Publish.Internal)
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))
{
ListViewItem lvi = new ListViewItem(testNames[ix++]);
for (int i = 0; i < items.Count; i++)
foreach (var item in items)
{
string str = items[i].Print(wMtr, mtr.Name());
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;
}
/// Extract and use color information
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
@@ -299,12 +288,11 @@ namespace Results.Forms
/// <returns>ListView object</returns>
ListView GetResultsTestsAreColumns(Results.Entities.WaterMeter wMtr, int printedWMNr)
{
metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single);
compound = wMtr.Compound();
ListView lview = GetListView();
IList<Results.WMeterRsltItemSpec> items = GetRsltItems(metersKind);
IList<Results.ItemSpec> items = (compound ? RsltItems_Screen_CombinedWM : RsltItems_Screen_SingleWM);
if (items == null || items.Count == 0) return lview;
// Header
@@ -318,39 +306,69 @@ namespace Results.Forms
foreach (var item in items)
{
ListViewItem lvi = new ListViewItem(item.Caption);
foreach (var mtr in wMtr.MeterTestRslts)
ListViewItem lvi = new ListViewItem(item.ClmnHeaderText);
if (compound)
{
if (mtr != null &&
(mtr.CompoundMeterId == (byte)CompoundMeterId.Single ||
mtr.CompoundMeterId == (byte)CompoundMeterId.Compound ||
mtr.CompoundMeterId == (byte)CompoundMeterId.HeatMeterEnergy) &&
mtr.TestDone &&
mtr.Publish() != Config.Entities.Publish.Never &&
mtr.Publish() != Config.Entities.Publish.Internal)
foreach (var mtr in wMtr.MeterTestRslts)
{
string str = items[i].Print(wMtr, mtr.Name());
if (mtr.CompoundMeterId == (byte)CompoundMeterId.Compound && mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
{
var main = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
var aux = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
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);
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);
}
}
}
}
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
@@ -1,257 +0,0 @@
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.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.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.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;
//
// 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.DoubleClick += new System.EventHandler(this.availableByCategoryTreeView_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 availableAlphabeticTreeView;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TreeView availableByQuantityTreeView;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TreeView availableByCategoryTreeView;
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;
}
}
-517
View File
@@ -1,517 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using Results;
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 = "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;
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);
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();
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:
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 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);
}
}
}
+454 -15
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016-2017 Sensus Metering Systems
/// Copyright (c) 2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -14,58 +14,497 @@ namespace Results.Forms
{
public partial class ResultsConfigDlg : Form
{
public IList<WMeterRsltItemSpec> SelectedItems
/// <summary>
/// ListViewEx columns
/// </summary>
enum Column
{
set { resultsConfigCtrl.SelectedItems = value; }
get { return resultsConfigCtrl.SelectedItems; }
Item,
Caption,
Units,
Format,
Precision,
Width,
Alignment,
TestID,
Count,
}
public MetersKind MetersKind
{
set { resultsConfigCtrl.MetersKind = value; }
}
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 ResultsConfigDlg(bool supressTestIDColumn)
: this()
{
resultsConfigCtrl.SupressTestIDColumn = supressTestIDColumn;
this.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 okButton_Click(object sender, EventArgs e)
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)
{
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 ResultsConfigDlg_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
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);
}
}
}
+211 -16
View File
@@ -31,17 +31,36 @@ 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.resultsConfigCtrl = new Results.Forms.ResultsConfigCtrl();
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.SuspendLayout();
//
// okButton
//
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.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.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(105, 42);
this.okButton.Size = new System.Drawing.Size(105, 30);
this.okButton.TabIndex = 4;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
@@ -49,29 +68,186 @@ namespace Results.Forms
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
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(939, 82);
this.cancelButton.Location = new System.Drawing.Point(494, 499);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(105, 42);
this.cancelButton.Size = new System.Drawing.Size(105, 30);
this.cancelButton.TabIndex = 5;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// resultsConfigCtrl
// availableResultsLabel
//
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;
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);
//
// ResultsConfigDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1066, 498);
this.Controls.Add(this.resultsConfigCtrl);
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.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
@@ -81,14 +257,33 @@ 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 ResultsConfigCtrl resultsConfigCtrl;
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;
}
}
+3
View File
@@ -117,4 +117,7 @@
<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>
+9 -32
View File
@@ -83,14 +83,14 @@ namespace Results
Lite_per_pulse_Read, /// 73
Result_code, /// 74
Remark, /// 75
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
TempHiMean, /// 76
TempHiStart, /// 77
TempHiEnd, /// 78
TempHiAve, /// 79
TempLoMean, /// 80
TempLoStart, /// 81
TempLoEnd, /// 82
TempLoAve, /// 83
P_delta_mean, /// 84
P_delta_start, /// 85
P_delta_end, /// 86
@@ -111,30 +111,7 @@ 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
Count,
}
}
+1 -2
View File
@@ -27,8 +27,7 @@ namespace Results.Mappings
Map(x => x.Custom3);
Map(x => x.StartTime);
Map(x => x.EndTime);
Map(x => x.Dirty);
Map(x => x.RsltsSent);
Map(x => x.RsltsSent);
Map(x => x.RsltsPrinted);
HasMany(x => x.Tests)
.Cascade.All();
+1 -6
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2017 Sensus Metering Systems
/// Copyright (c) 2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Results.Entities;
@@ -17,10 +17,6 @@ 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);
@@ -88,7 +84,6 @@ 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);
+2 -4
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2017 Sensus Metering Systems
/// Copyright (c) 2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Results.Entities;
@@ -22,9 +22,7 @@ namespace Results.Mappings
Map(x => x.QFall);
Map(x => x.Passed);
Map(x => x.ResultCode);
Map(x => x.Remark)
.CustomType("StringClob")
.CustomSqlType("varchar(2000)");
#if IPERL
Map(x => x.SerialNrEx);
Map(x => x.OrigCalibFactor);
@@ -1,342 +0,0 @@
///
/// 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.Enhanced
{
public class EnhancedPrintDocument : PrintDocument
{
const string FontFamilyName = "Arial"; //"Times New Roman";
const int SpacingOne = 18;
const int SpacingOneAndHalf = (3 * SpacingOne) / 2;
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;
/// <summary>
/// Property variable for the Font the user wishes to use
/// </summary>
Font font;
Font boldFont;
Font titleFont;
///
/// Data to print
///
Results.Entities.Batch batch;
///
/// 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,
PageOrientation pageOrientation,
int topMargin,
int bottomMargin,
int leftMargin,
string header,
IList<WMeterRsltItemSpec> commonItems,
IList<WMeterRsltItemSpec> testItems,
string footer)
{
this.batch = batch;
this.topMargin = topMargin;
this.bottomMargin = bottomMargin;
this.leftMargin = leftMargin;
this.header = header;
this.commonItems = commonItems;
this.testItems = testItems;
this.footer = footer;
TitleX = leftMargin;
TitleY = topMargin; /// Depends on the size of the header
HdrTop = TitleY + 60;
BodyTop = HdrTop + 160;
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
/// Set print area size and margins (in dots using 100 dpi)
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;
}
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 (batch.WaterMeters.Count > 0 && batch.WaterMeters[0].Compound()) testsCount /= 3;
int wmSectionHeight = (testsCount + 4) * SpacingOne;
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);
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>
/// 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)
{
///----------
/// Header
///----------
RectangleF printArea = new RectangleF(TitleX, TitleY, printWidth, 40);
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, HdrTop + SpacingOne * i, leftColumn[i]);
PrintAt(e, 300, HdrTop + 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, font).Width;
foreach (var mtr in wm.MeterTestRslts)
{
if ((mtr != null) && (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);
PrintAt(e, leftMargin, top, wmText);
if (!string.IsNullOrEmpty(wm.SerialNr))
{
PrintAt(e, leftMargin + (int)e.Graphics.MeasureString(wmText, font).Width, top,
string.Format(" {0} = {1}", Strings.sn, wm.SerialNr));
}
/// Horizontal line
int horY = top + 25;
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
for (int i = 0; i < testItems.Count; i++)
{
PrintAt(e, (int)columnPos[i], top + 27, testItems[i].Caption);
}
/// Horizontal line
horY = top + 27 + SpacingOne;
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 + 30 + SpacingOne * testsCount, itemText);
}
}
}
/// Horizontal line
horY = top + 30 + SpacingOne * (testsCount + 1);
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
return (testsCount + 4) * SpacingOne;
}
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, 667, SpacingOne);
e.Graphics.DrawString(text, this.font, Brushes.Black, printArea);
}
void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
{
PrintBoldAt(e, p.X, p.Y, text);
}
void PrintBoldAt(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);
}
}
}
@@ -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.AmbTempMean().ToString("F1") + " \x00b0C");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientTempAve().ToString("F1") + " \x00b0C");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbHumiMean().ToString("F0") + " %");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientHumiAve().ToString("F0") + " %");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck");
PrintAt(e, Tab2, lineNr * SpacingOne, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbPressMean()).ToString("F0") + " mbar");
PrintAt(e, Tab2, lineNr * SpacingOne, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbientPressAve()).ToString("F0") + " mbar");
lineNr++;
PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
+3 -3
View File
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sensus")]
[assembly: AssemblyProduct("Results")]
[assembly: AssemblyCopyright("Copyright © 2013 - 2017 Sensus Slovensko, a.s.")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[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.14.573.0")]
[assembly: AssemblyFileVersion("2.14.573.0")]
[assembly: AssemblyVersion("2.12.544.0")]
[assembly: AssemblyFileVersion("2.12.544.0")]
+1 -541
View File
@@ -87,15 +87,6 @@ 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>
@@ -322,7 +313,7 @@ namespace Results.Resources {
}
/// <summary>
/// Looks up a localized string similar to E rel. ref..
/// Looks up a localized string similar to Err.ref..
/// </summary>
internal static string ErrRef {
get {
@@ -330,15 +321,6 @@ 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>
@@ -357,15 +339,6 @@ 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>
@@ -393,15 +366,6 @@ 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>
@@ -726,15 +690,6 @@ 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>
@@ -924,411 +879,6 @@ 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>
@@ -1383,87 +933,6 @@ 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>
@@ -1500,15 +969,6 @@ 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>
-15
View File
@@ -195,19 +195,4 @@
<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>
-24
View File
@@ -381,28 +381,4 @@
<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>
</root>
-18
View File
@@ -420,22 +420,4 @@
<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>
+1 -181
View File
@@ -172,7 +172,7 @@
<value>Error</value>
</data>
<data name="ErrRef" xml:space="preserve">
<value>E rel. ref.</value>
<value>Err.ref.</value>
</data>
<data name="Err_aux" xml:space="preserve">
<value>Err. aux.</value>
@@ -432,184 +432,4 @@
<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>
</root>
-9
View File
@@ -420,13 +420,4 @@
<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>
+2 -14
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;GENESIS;IPERL;LANG_DE</DefineConstants>
<DefineConstants>TRACE;DEBUG;TORINO50</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
@@ -27,7 +27,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;GENESIS;IPERL;LANG_DE</DefineConstants>
<DefineConstants>TRACE;TORINO50</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -77,12 +77,6 @@
<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>
@@ -100,9 +94,6 @@
<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\Munich\MunichPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
@@ -143,9 +134,6 @@
<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>
+61 -108
View File
@@ -99,14 +99,14 @@ namespace Results
}
///
/// Constructor without ToolTip text
/// Constructorwithot 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 = null;
ToolTipText = string.Format("{0} bla, bla, bla", Name);
Quantity = quantity;
Category = category;
this.printDlgt = printDlgt;
@@ -130,105 +130,48 @@ namespace Results
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]
///
/// 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(string.IsNullOrEmpty(p) ? "F1" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(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)));
/// 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)));
///
/// 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(string.IsNullOrEmpty(p) ? "F2" : p)));
/// 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)));
///
/// 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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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) => (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) => (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(string.IsNullOrEmpty(p) ? "F2" : p)));
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(string.IsNullOrEmpty(p) ? "F1" : p)));
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(string.IsNullOrEmpty(p) ? "F1" : p)));
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(string.IsNullOrEmpty(p) ? "F1" : p)));
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(string.IsNullOrEmpty(p) ? "F2" : p)));
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(string.IsNullOrEmpty(p) ? "F1" : p)));
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(string.IsNullOrEmpty(p) ? "F1" : p)));
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(string.IsNullOrEmpty(p) ? "F1" : p)));
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(string.IsNullOrEmpty(p) ? "F2" : p)));
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(string.IsNullOrEmpty(p) ? "F1" : p)));
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(string.IsNullOrEmpty(p) ? "F1" : p)));
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(string.IsNullOrEmpty(p) ? "F1" : p)));
#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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
#endif
///
/// 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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
///
/// Ambient temperature/pressure/humidity
///
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(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, 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(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, 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(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbHumiMean).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
///
/// 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(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)));
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(string.IsNullOrEmpty(p) ? "F3" : p)));
/// 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, 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(string.IsNullOrEmpty(p) ? "F2" : p)));
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, 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(string.IsNullOrEmpty(p) ? "F2" : p)));
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)));
#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())));
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()));
///
/// 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()
@@ -265,7 +208,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, Strings.Tooltip_sn, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.SerialNr));
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.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()));
@@ -278,11 +221,14 @@ 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.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.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_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, 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.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.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));
@@ -302,19 +248,26 @@ 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)));
#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(string.IsNullOrEmpty(p) ? "F2" : p))));
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.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)));
#endif
}
+156 -202
View File
@@ -28,204 +28,162 @@
/// </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.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();
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();
}
@@ -245,9 +203,5 @@
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;
}
}
+6 -8
View File
@@ -1,4 +1,10 @@
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;
@@ -18,14 +24,10 @@ 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;
@@ -48,14 +50,10 @@ 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,21 +27,15 @@ 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.AmbTempMean().ToString("F1") + " \x00b0C");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientTempAve().ToString("F1") + " \x00b0C");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbHumiMean().ToString("F0") + " %");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientHumiAve().ToString("F0") + " %");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbPressMean().ToString("F0") + " mbar");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientPressAve().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.14.572.0")]
[assembly: AssemblyFileVersion("2.14.572.0")]
[assembly: AssemblyVersion("2.12.542.0")]
[assembly: AssemblyFileVersion("2.12.542.0")]
+2 -2
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;GENESIS;IPERL;LANG_DE</DefineConstants>
<DefineConstants>TRACE;DEBUG;TORINO50</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -31,7 +31,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;GENESIS;IPERL;LANG_DE</DefineConstants>
<DefineConstants>TRACE;TORINO50</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+12 -42
View File
@@ -45,8 +45,6 @@
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();
@@ -153,7 +151,7 @@
//
// statisticsBtn
//
this.statisticsBtn.Location = new System.Drawing.Point(8, 581);
this.statisticsBtn.Location = new System.Drawing.Point(8, 562);
this.statisticsBtn.Name = "statisticsBtn";
this.statisticsBtn.Size = new System.Drawing.Size(125, 33);
this.statisticsBtn.TabIndex = 10;
@@ -163,7 +161,7 @@
//
// printQueryResultsBtn
//
this.printQueryResultsBtn.Location = new System.Drawing.Point(8, 506);
this.printQueryResultsBtn.Location = new System.Drawing.Point(8, 487);
this.printQueryResultsBtn.Name = "printQueryResultsBtn";
this.printQueryResultsBtn.Size = new System.Drawing.Size(125, 33);
this.printQueryResultsBtn.TabIndex = 9;
@@ -173,7 +171,7 @@
//
// exportQueryResultsBtn
//
this.exportQueryResultsBtn.Location = new System.Drawing.Point(8, 467);
this.exportQueryResultsBtn.Location = new System.Drawing.Point(8, 448);
this.exportQueryResultsBtn.Name = "exportQueryResultsBtn";
this.exportQueryResultsBtn.Size = new System.Drawing.Size(125, 33);
this.exportQueryResultsBtn.TabIndex = 8;
@@ -183,7 +181,7 @@
//
// formatOfResultsBtn
//
this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 274);
this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 255);
this.formatOfResultsBtn.Name = "formatOfResultsBtn";
this.formatOfResultsBtn.Size = new System.Drawing.Size(125, 33);
this.formatOfResultsBtn.TabIndex = 7;
@@ -193,7 +191,7 @@
//
// clearFiltersBtn
//
this.clearFiltersBtn.Location = new System.Drawing.Point(8, 196);
this.clearFiltersBtn.Location = new System.Drawing.Point(8, 177);
this.clearFiltersBtn.Name = "clearFiltersBtn";
this.clearFiltersBtn.Size = new System.Drawing.Size(125, 33);
this.clearFiltersBtn.TabIndex = 2;
@@ -213,7 +211,7 @@
//
// saveConfigBtn
//
this.saveConfigBtn.Location = new System.Drawing.Point(8, 313);
this.saveConfigBtn.Location = new System.Drawing.Point(8, 294);
this.saveConfigBtn.Name = "saveConfigBtn";
this.saveConfigBtn.Size = new System.Drawing.Size(125, 33);
this.saveConfigBtn.TabIndex = 5;
@@ -223,7 +221,7 @@
//
// loadConfigBtn
//
this.loadConfigBtn.Location = new System.Drawing.Point(8, 352);
this.loadConfigBtn.Location = new System.Drawing.Point(8, 333);
this.loadConfigBtn.Name = "loadConfigBtn";
this.loadConfigBtn.Size = new System.Drawing.Size(125, 33);
this.loadConfigBtn.TabIndex = 4;
@@ -233,7 +231,7 @@
//
// executeQueryBtn
//
this.executeQueryBtn.Location = new System.Drawing.Point(8, 428);
this.executeQueryBtn.Location = new System.Drawing.Point(8, 409);
this.executeQueryBtn.Name = "executeQueryBtn";
this.executeQueryBtn.Size = new System.Drawing.Size(125, 33);
this.executeQueryBtn.TabIndex = 6;
@@ -243,7 +241,7 @@
//
// addFilterBtn
//
this.addFilterBtn.Location = new System.Drawing.Point(8, 235);
this.addFilterBtn.Location = new System.Drawing.Point(8, 216);
this.addFilterBtn.Name = "addFilterBtn";
this.addFilterBtn.Size = new System.Drawing.Size(125, 33);
this.addFilterBtn.TabIndex = 3;
@@ -253,46 +251,20 @@
//
// 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, 135);
this.testBenchesGroupBox.Size = new System.Drawing.Size(125, 99);
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, 65);
this.checkBox3.Location = new System.Drawing.Point(23, 69);
this.checkBox3.Name = "checkBox3";
this.checkBox3.Size = new System.Drawing.Size(85, 17);
this.checkBox3.TabIndex = 2;
@@ -304,7 +276,7 @@
// checkBox2
//
this.checkBox2.AutoSize = true;
this.checkBox2.Location = new System.Drawing.Point(23, 44);
this.checkBox2.Location = new System.Drawing.Point(23, 46);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(85, 17);
this.checkBox2.TabIndex = 1;
@@ -372,7 +344,5 @@
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;
}
}
+6 -68
View File
@@ -5,7 +5,6 @@ using NHibernate;
using Results.Entities;
using ResultsBrowser.Filters;
using ResultsBrowser.Resources;
using System.IO;
namespace ResultsBrowser
{
@@ -50,8 +49,6 @@ 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)
{
@@ -72,14 +69,10 @@ 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()
@@ -117,16 +110,12 @@ 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();
}
@@ -225,9 +214,7 @@ namespace ResultsBrowser
Results.DB.ConnectionString = checkBox1.Checked ? Program.LocalSettings.ConnectionString1 :
(checkBox2.Checked ? Program.LocalSettings.ConnectionString2 :
(checkBox3.Checked ? Program.LocalSettings.ConnectionString3 :
(checkBox4.Checked ? Program.LocalSettings.ConnectionString4 :
(checkBox5.Checked ? Program.LocalSettings.ConnectionString5 :
Program.LocalSettings.ConnectionString1))));
Program.LocalSettings.ConnectionString1));
ISession[] sessions = new ISession[] { Results.DB.CreateSession() };
@@ -272,15 +259,8 @@ namespace ResultsBrowser
ListViewItem lvi = null;
foreach (var item in items)
{
/// 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) lvi = new ListViewItem(item.Print(wm));
else lvi.SubItems.Add(item.Print(wm));
}
if (lvi != null) resultsListView.Items.Add(lvi);
}
@@ -296,6 +276,8 @@ 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)
{
@@ -306,52 +288,8 @@ namespace ResultsBrowser
private void exportQueryResultsBtn_Click(object sender, EventArgs e)
{
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
if (waterMeters == null || waterMeters.Count == 0) return;
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)
@@ -0,0 +1,51 @@
///
/// 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()
{
}
}
}
@@ -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,7 +41,6 @@ namespace TBF.BenchControl.DataEntry.Combined
public CycleBeginningForm()
{
InitializeComponent();
ControlBox = false;
TextBoxesCount = 3;
mainLabels = new Label[] { mainSN1Label, mainSN2Label, mainSN3Label };
@@ -33,7 +33,6 @@ namespace TBF.BenchControl.DataEntry.Combined
public CycleEndForm()
{
InitializeComponent();
ControlBox = false;
MainStateText = new string[Config.Data.CompoundWMsCount];
AuxStateText = new string[Config.Data.CompoundWMsCount];
@@ -55,7 +55,6 @@ 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,7 +49,6 @@ 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,11 +28,9 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleEndForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
ControlBox = false;
this.WaterMetersCount = waterMetersCount;
EndStateText = new string[WaterMetersCount];
EndStateText = new string[WaterMetersCount];
completed = false;
StartForceCloseHandler();
}
@@ -60,7 +60,6 @@ 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,7 +49,6 @@ 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,11 +28,9 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleEndForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
ControlBox = false;
this.WaterMetersCount = waterMetersCount;
EndStateText = new string[WaterMetersCount];
EndStateText = new string[WaterMetersCount];
completed = false;
StartForceCloseHandler();
}
@@ -60,7 +60,6 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
public TestStartEndForm()
{
InitializeComponent();
ControlBox = false;
TextBoxesCount = 6;
@@ -10,7 +10,7 @@ using TBF.Resources;
namespace TBF.BenchControl.DataEntry.Munich
{
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
@@ -25,7 +25,6 @@ namespace TBF.BenchControl.DataEntry.Munich
public CycleBeginningForm()
{
InitializeComponent();
ControlBox = false;
MainSNText = new string[Config.Data.CompoundWMsCount];
AuxSNText = new string[Config.Data.CompoundWMsCount];
@@ -35,7 +35,6 @@ namespace TBF.BenchControl.DataEntry.Munich
public CycleEndForm()
{
InitializeComponent();
ControlBox = false;
MainStateText = new string[Config.Data.CompoundWMsCount];
AuxStateText = new string[Config.Data.CompoundWMsCount];
@@ -8,7 +8,7 @@ using TBF.Resources;
namespace TBF.BenchControl.DataEntry.Munich3
{
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
@@ -29,11 +29,9 @@ namespace TBF.BenchControl.DataEntry.Munich3
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleBeginningForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
ControlBox = false;
this.WaterMetersCount = waterMetersCount;
SNText = new string[WaterMetersCount];
SNText = new string[WaterMetersCount];
Disabled = new bool[WaterMetersCount];
completed = false;
StartForceCloseHandler();
@@ -36,11 +36,9 @@ namespace TBF.BenchControl.DataEntry.Munich3
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleEndForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
ControlBox = false;
this.WaterMetersCount = waterMetersCount;
EndStateText = new string[WaterMetersCount];
EndStateText = new string[WaterMetersCount];
YearOfProduction = new int[WaterMetersCount];
completed = false;
StartForceCloseHandler();
@@ -41,14 +41,12 @@ namespace TBF.BenchControl.DataEntry.Munich3
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public TestStartEndForm(int waterMetersCount, bool[] disabled)
{
InitializeComponent();
ControlBox = false;
endStates = false;
this.WaterMetersCount = waterMetersCount;
this.disabled = disabled;
InitializeComponent();
WMStartState = new float[waterMetersCount];
WMStartStateStr = new string[waterMetersCount];
completed = false;
@@ -11,7 +11,7 @@ using TBF.Resources;
namespace TBF.BenchControl.DataEntry.Standard12
{
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
@@ -49,7 +49,6 @@ namespace TBF.BenchControl.DataEntry.Standard12
public CycleBeginningForm()
{
InitializeComponent();
ControlBox = false;
labels = new Label[] { label1, label2, label3, label4, label5, label6,
label7, label8, label9, label10, label11, label12 };
@@ -28,11 +28,9 @@ namespace TBF.BenchControl.DataEntry.Standard12
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleEndForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
ControlBox = false;
this.WaterMetersCount = waterMetersCount;
EndStateText = new string[WaterMetersCount];
EndStateText = new string[WaterMetersCount];
completed = false;
StartForceCloseHandler();
}
@@ -49,7 +49,6 @@ namespace TBF.BenchControl.DataEntry.Standard12
public TestStartEndForm()
{
InitializeComponent();
ControlBox = false;
TextBoxesCount = 12;
@@ -51,7 +51,6 @@ namespace TBF.BenchControl.DataEntry.Standard24
public AdvancedFixedStartTestForm()
{
InitializeComponent();
ControlBox = false;
TextBoxesCount = 24;
@@ -9,7 +9,7 @@ using TBF.Resources;
namespace TBF.BenchControl.DataEntry.Standard24
{
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
@@ -37,7 +37,6 @@ namespace TBF.BenchControl.DataEntry.Standard24
public CycleBeginningForm()
{
InitializeComponent();
ControlBox = false;
textBoxesCount = 24;
labels = new Label[]
@@ -28,12 +28,9 @@ namespace TBF.BenchControl.DataEntry.Standard24
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleEndForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
ControlBox = false;
this.WaterMetersCount = waterMetersCount;
EndStateText = new string[WaterMetersCount];
EndStateText = new string[WaterMetersCount];
completed = false;
StartForceCloseHandler();
}
@@ -49,7 +49,6 @@ namespace TBF.BenchControl.DataEntry.Standard24
public TestStartEndForm()
{
InitializeComponent();
ControlBox = false;
TextBoxesCount = 24;
@@ -9,7 +9,7 @@ using TBF.Resources;
namespace TBF.BenchControl.DataEntry.Standard48
{
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
@@ -37,7 +37,6 @@ namespace TBF.BenchControl.DataEntry.Standard48
public CycleBeginningForm()
{
InitializeComponent();
ControlBox = false;
textBoxesCount = 48;
labels = new Label[]
@@ -28,13 +28,10 @@ namespace TBF.BenchControl.DataEntry.Standard48
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleEndForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
ControlBox = false;
this.WaterMetersCount = waterMetersCount;
EndStateText = new string[WaterMetersCount];
completed = false;
EndStateText = new string[WaterMetersCount];
completed = false;
StartForceCloseHandler();
}
@@ -49,7 +49,6 @@ namespace TBF.BenchControl.DataEntry.Standard48
public TestStartEndForm()
{
InitializeComponent();
ControlBox = false;
TextBoxesCount = 24;
@@ -9,7 +9,7 @@ using TBF.Resources;
namespace TBF.BenchControl.DataEntry.Standard6
{
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
@@ -33,17 +33,15 @@ namespace TBF.BenchControl.DataEntry.Standard6
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleBeginningForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
ControlBox = false;
this.WaterMetersCount = waterMetersCount;
SNText = new string[WaterMetersCount];
SNText = new string[WaterMetersCount];
Disabled = new bool[WaterMetersCount];
completed = false;
enabledComboBoxes = new List<ComboBox>();
Height = 147 + WaterMetersCount * 90;
completed = false;
StartForceCloseHandler();
}
@@ -28,13 +28,10 @@ namespace TBF.BenchControl.DataEntry.Standard6
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleEndForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
ControlBox = false;
this.WaterMetersCount = waterMetersCount;
EndStateText = new string[WaterMetersCount];
completed = false;
EndStateText = new string[WaterMetersCount];
completed = false;
StartForceCloseHandler();
}
@@ -35,24 +35,20 @@ namespace TBF.BenchControl.DataEntry.Standard6
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
/// <summary>
/// Constructor to fill in start states
/// </summary>
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public TestStartEndForm(int waterMetersCount, bool[] disabled)
{
InitializeComponent();
ControlBox = false;
endStates = false;
this.WaterMetersCount = waterMetersCount;
this.disabled = disabled;
InitializeComponent();
WMStartState = new float[waterMetersCount];
WMStartStateStr = new string[waterMetersCount];
completed = false;
StartForceCloseHandler();
}
@@ -8,7 +8,7 @@ using TBF.Resources;
namespace TBF.BenchControl.DataEntry.WMStates
{
public partial class WMSNsAndStatesForm : Form, GenericDevices.IHasCompleted
public partial class WMSNsAndStatesForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(WMSNsAndStatesForm));
@@ -31,14 +31,11 @@ namespace TBF.BenchControl.DataEntry.WMStates
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public WMSNsAndStatesForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
ControlBox = false;
this.WaterMetersCount = waterMetersCount;
SNText = new string[WaterMetersCount];
SNText = new string[WaterMetersCount];
WMState = new float[WaterMetersCount];
completed = false;
completed = false;
StartForceCloseHandler();
//Height = 55 + WaterMetersCount * 105;
@@ -28,13 +28,10 @@ namespace TBF.BenchControl.DataEntry.WMStates
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public WMStatesForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
ControlBox = false;
this.WaterMetersCount = waterMetersCount;
WMState = new float[WaterMetersCount];
completed = false;
WMState = new float[WaterMetersCount];
completed = false;
StartForceCloseHandler();
}
@@ -9,7 +9,7 @@ using TBF.Resources;
namespace TBF.BenchControl.DataEntry.iPerl
{
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
@@ -30,8 +30,6 @@ namespace TBF.BenchControl.DataEntry.iPerl
public CycleBeginningForm()
{
InitializeComponent();
ControlBox = false;
completed = false;
StartForceCloseHandler();
}
@@ -28,11 +28,9 @@ namespace TBF.BenchControl.DataEntry.iPerl
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleEndForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
ControlBox = false;
this.WaterMetersCount = waterMetersCount;
EndStateText = new string[WaterMetersCount];
EndStateText = new string[WaterMetersCount];
completed = false;
StartForceCloseHandler();
}
@@ -226,7 +226,45 @@ namespace TBF.BenchControl.DataEntry.iPerl
{
foreach (var wm in batchResults.WaterMeters)
{
if (wm != null && !wm.Disabled) wm.PurchaseOrder = PurchaseOrder;
if (wm != null && !wm.Disabled)
{
wm.PurchaseOrder = PurchaseOrder;
if (Sequences.SequenceBase.WaterMeters != null &&
wm.WMPosition > 0 &&
wm.WMPosition <= Sequences.SequenceBase.WaterMeters.Count)
{
WaterMeters.iPerl.WaterMeter iPerl = Sequences.SequenceBase.WaterMeters[wm.WMPosition - 1] as WaterMeters.iPerl.WaterMeter;
if (iPerl != null)
{
#if IPERL
wm.OrigCalibFactor = iPerl.OriginalCalibFactor;
wm.CalibFactor = iPerl.CalibrationFactor;
wm.Q2ErrWOCorrection = iPerl.Q2ErrorWOCorrection;
wm.Q2CorrectionDone = iPerl.Q2CorrectionDone;
wm.Q2Correction = iPerl.Q2Correction;
wm.Q2CorrRFlow = iPerl.Q2CorrRFlow;
wm.Q2CorrLFlow = iPerl.Q2CorrLFlow;
wm.Diff2Hz8Hz = iPerl.Diff2Hz8Hz;
wm.Hz2CorrectionDone = iPerl.Hz2CorrectionDone;
wm.Hz2Correction = iPerl.Hz2CorrectionFactor;
if (iPerl.CalibrationStruct == null)
{
wm.Q2CorrFlowRight = 0;
}
else if (iPerl.CalibrationStruct.FlowArrow == WaterMeters.iPerl.FlowArrow.Left)
{
wm.Q2CorrFlowRight = iPerl.PositiveCounting ? 1 : 2;
}
else
{
wm.Q2CorrFlowRight = iPerl.PositiveCounting ? 2 : 1;
}
#endif
}
}
}
}
}
}
@@ -49,7 +49,6 @@ namespace TBF.BenchControl.DataEntry.iPerl
public TestStartEndForm()
{
InitializeComponent();
ControlBox = false;
TextBoxesCount = 24;
@@ -19,7 +19,7 @@ namespace TBF.BenchControl.Elde
EnduranceCycleStop = 13,
}
#if FUZHOU300 || PT200IL || TORINO50 || BADGER_MALA_TRAT || TURA_IPERL || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_PT200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERBURG_50 || PETERBURG_200
#if FUZHOU300 || PT200IL || TORINO50 || BADGER_MALA_TRAT || TURA_IPERL || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_PT200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN
public enum StatusP : ulong
{
RefFlowMeterMask = 0x7,
@@ -65,7 +65,6 @@ namespace TBF.BenchControl.Elde
public float VyslExt(int wmNr0, int what) { return controlCom.VyslExt(wmNr0, what); }
public uint[] CyclePar { get { return controlCom.CyclePar; } set { controlCom.CyclePar = value; } }
public uint[] WMeterCont { get { return controlCom.WMeterCont; } }
public bool ManualUIAllowed { get { return controlCom.ManualUIAllowed; } set { controlCom.ManualUIAllowed = value; } }
/// <summary> Extracted from the StatusP in RunDeviceBefore </summary>
public bool EmergencyStop { get { return emergencyStop; } }
@@ -122,14 +121,14 @@ namespace TBF.BenchControl.Elde
public uint[,] RegValveCalib = new uint[8, 2];
public float[,] TempCalibData = new float[8, 5];
// Array length is the reference flowmeters count plus one
#if DN100 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200 || PETERBURG_200
// Array length is the reference flowmeters count plus one
#if DN100 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[6] { 1, 1, 1, 1, 1, 1 };
#elif GENESIS || BERLIN
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[7] { 1, 1, 1, 1, 1, 1, 1 };
#elif MUNICH || TORINO50 || BADGER_MALA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272 || TURA_IPERL || TURA_SPECIAL || MURES_PT40 || FUZHOU_40 || SLM_50 || SLM_150 || PETERBURG_50
#elif MUNICH || TORINO50 || BADGER_MALA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272 || TURA_IPERL || TURA_SPECIAL || MURES_PT40 || FUZHOU_40 || SLM_50
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
#elif SLM_END || WARSAW_END
@@ -219,10 +218,6 @@ namespace TBF.BenchControl.Elde
}
}
public void SetReservoirTemp(int nr, float temp)
{
controlCom.SetReservoirTemp(nr, temp);
}
public ControlBoardDev()
{
@@ -269,8 +264,8 @@ namespace TBF.BenchControl.Elde
ControlComponent3Munich.UserControl1 ctrlBrdComponent,
#elif FUZHOU300
ControlComponent3F300.UserControl1 ctrlBrdComponent,
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERBURG_200
ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent,
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN
ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent,
#else /// all newer benches
ControlComponent_Torino2015.UserControl1 ctrlBrdComponent,
#endif
@@ -72,16 +72,6 @@ namespace TBF.BenchControl.Elde
public uint[] CyclePar { get { return cyclePar; } set { cyclePar = value; } } /// dummy
public uint[] WMeterCont { get { return wMeterCont; } } /// dummy
///
public bool ManualUIAllowed
{
get { return manualUIAllowed; }
set { manualUIAllowed = value; }
}
bool manualUIAllowed = true;
public void SetReservoirTemp(int nr, float temp) { }
///
/// Private initialization data updated by contructors of children components
@@ -32,7 +32,7 @@ namespace TBF.BenchControl.Elde
public float ReferenceFreq { get { return 1000.0f * ctrlBrdComponent.referenceFreq[0]; } } /// In [Hz] 0..2500, nom.=2000
#endif
public int EtPulses(int wmNr0) { return (int)ctrlBrdComponent.etPulses[wmNr0]; }
#if FUZHOU300 || PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERBURG_50 || PETERBURG_200
#if FUZHOU300 || PT200IL || PUCHONG_PT200 || GENESIS || BERLIN
public int EtPulses2 { get { return (int)ctrlBrdComponent.EtPulses2; } }
#else
public int EtPulses2 { get { return 0; } }
@@ -71,7 +71,7 @@ namespace TBF.BenchControl.Elde
#if DN100 || MUNICH || BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU40 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200 || TORINO50 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40
public float TotalRefVolume { get { return ctrlBrdComponent.ReferenceVolume; } }
public float MassRefVolume { get { return ctrlBrdComponent.ReferenceVolume; } }
#else /// all new test benches
#else
public float TotalRefVolume { get { return ctrlBrdComponent.ReferenceVolume[0]; } }
public float MassRefVolume { get { return ctrlBrdComponent.ReferenceVolume[1]; } }
#endif
@@ -83,12 +83,7 @@ namespace TBF.BenchControl.Elde
public uint[] CyclePar { get { return new uint[163]; } set { return; }} /// Dummy
public uint[] WMeterCont { get { return new uint[3]; } } /// Dummy
#endif
public bool ManualUIAllowed
{
get { return ctrlBrdComponent.Dovolene; }
set { ctrlBrdComponent.Dovolene = value; }
}
public float VyslExt(int wmNr0, int what) { return ctrlBrdComponent.VyslExt[wmNr0, what]; }
public void SetWeight(int pos, double mass)
{
@@ -96,13 +91,6 @@ namespace TBF.BenchControl.Elde
log.DebugFormat("SetWeight(pos={0}, mass={1}", pos, mass);
}
public void SetReservoirTemp(int nr, float temp)
{
#if GENESIS
if (nr > 0 && nr <= 3) ctrlBrdComponent.TankTemp[nr - 1] = temp;
#endif
}
///
/// Reference to the control board component
@@ -113,8 +101,8 @@ namespace TBF.BenchControl.Elde
private ControlComponent3Munich.UserControl1 ctrlBrdComponent;
#elif FUZHOU300
private ControlComponent3F300.UserControl1 ctrlBrdComponent;
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERBURG_200
private ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent;
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN
private ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent;
#else /// newer benches
private ControlComponent_Torino2015.UserControl1 ctrlBrdComponent;
#endif
@@ -129,8 +117,8 @@ namespace TBF.BenchControl.Elde
public ControlComWrap(ControlComponent3Munich.UserControl1 ctrlBrdComponent)
#elif FUZHOU300
public ControlComWrap(ControlComponent3F300.UserControl1 ctrlBrdComponent)
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERBURG_200
public ControlComWrap(ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent)
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN
public ControlComWrap(ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent)
#else /// all newer benches
public ControlComWrap(ControlComponent_Torino2015.UserControl1 ctrlBrdComponent)
#endif
@@ -180,8 +168,8 @@ namespace TBF.BenchControl.Elde
log.FatalFormat("Component: {0}", ControlComponent3Munich.UserControl1.ProgVersion);
#elif FUZHOU300
log.FatalFormat("Component: {0}", ControlComponent3F300.UserControl1.ProgVersion);
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERBURG_200
log.FatalFormat("Component: {0}", ControlComponent_Izrael2014.UserControl1.ProgVersion);
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN
log.FatalFormat("Component: {0}", ControlComponent_Izrael2014.UserControl1.ProgVersion);
#else /// newer benches
log.FatalFormat("Component: {0}", ControlComponent_Torino2015.UserControl1.ProgVersion);
#endif
@@ -334,11 +322,11 @@ namespace TBF.BenchControl.Elde
#elif BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU40 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200 || TORINO50 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods,
filterConstant, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif GENESIS || BERLIN || SLM_150 || PETERBURG_200
#elif GENESIS || BERLIN
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF), (ulong)(route >> 64), pulsesArr, (uint)testMethods,
filterConstant, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#else /// if TURA_IPERL || TURA_SPECIAL || MALTA_WSD25 || SLM_50 || SLM_END || WARSAW_END || PETERBURG_50
#else /// if TURA_IPERL || TURA_SPECIAL || MALTA_WSD25 || SLM_50 || SLM_END || WARSAW_END
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods,
filterConstant, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
@@ -1,137 +0,0 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using Dirichlet.Numerics;
using log4net;
using TBF.BenchControl.GenericDevices;
using TBF.Resources;
namespace TBF.BenchControl.Elde.CoverTest
{
public class CoverTest : ComponentBase, IOperation, ISequenceCondition
{
private static readonly ILog log = LogManager.GetLogger(typeof(CoverTest));
private static readonly ILog bypassLog = LogManager.GetLogger("BypassLog");
public override string ToString() { return string.Format("CoverTest({0})", Cfg.ToString(1)); }
readonly CoverTestCfg coverTestCfg;
readonly ControlBoardDev controlBoard;
readonly int bitPosition; /// 0 .. 63
readonly ulong mask; /// derived from bitPosition in the constructor
readonly ulong target;
readonly string message;
readonly Users.Grp.GID bypassLevel;
public CoverTest()
{
}
public CoverTest(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
: base(cfg)
{
coverTestCfg = cfg as CoverTestCfg;
controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
bitPosition = coverTestCfg.BitPosition;
mask = (((ulong)1) << coverTestCfg.BitPosition);
target = coverTestCfg.Invert ? 0 : mask;
message = coverTestCfg.Message;
bypassLevel = coverTestCfg.BypassLevel;
log.Debug(this.ToString());
}
public int ConditionsCount { get { return 1; } }
/// Strings are added to the combo-box for transition sequence condition selection
public string ConditionName(int i)
{
if (i < 1 && i >= 0)
return Name;
else
return string.Empty;
}
/// Operation to be executed as a part of a transition sequence
public IOperation ConditionOp(int i)
{
if (i < 1 && i >= 0)
return this;
else
return null;
}
CoverTestForm modelessDlg;
bool completed = false;
delegate void CoverTestFormDlgt(CoverTest myRef);
///
void OpenFormDlg(CoverTest myRef)
{
myRef.modelessDlg = new CoverTestForm(message, bypassLevel, bypassLog);
modelessDlg.Show();
}
public IOperation CoverTestOp()
{
return this;
}
/// <summary>Start this operation</summary>
public void Start()
{
log.DebugFormat("Start()");
completed = false;
Program.MainWnd.Invoke(new CoverTestFormDlgt(OpenFormDlg), this);
}
/// <summary>Run this operation</summary>
/// <returns>Event.ResultsPrinted</returns>
public Event Run()
{
bool conditionMet = ((controlBoard.DigitalInputs & mask) == target);
if (completed || conditionMet)
{
completed = true;
}
if (completed || modelessDlg.Completed)
{
completed = true;
CloseModelessDlg();
log.DebugFormat("Run() ... conditionMet={0} completed={1} ... Event.ConditionMet", conditionMet, completed);
return Event.ConditionMet;
}
log.DebugFormat("Run() ... conditionMet={0} completed={1} ... Event.ConditionNotMet", conditionMet, completed);
return Event.ConditionNotMet;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
log.DebugFormat("Stop()");
CloseModelessDlg();
}
void CloseModelessDlg()
{
if (modelessDlg is GenericDevices.IHasCompleted)
{
UiBridge.Bridge.OnCloseQandAForm(this, null);
modelessDlg = null;
}
}
}
}
@@ -1,55 +0,0 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.IO;
using System.Collections.Generic;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.Elde.CoverTest
{
public class CoverTestCfg : ComponentCfgBase, IChildComponentCfg
{
public IComponentCfgCtrl GetControl() { return new CoverTestCfgCtrl(); }
///
/// Serialized parameters
///
public int BitPosition;
public bool Invert;
public string Message;
public Users.Grp.GID BypassLevel;
/// Private parameterless constructor invoked by all other (public) constructors
CoverTestCfg()
{
Name = "CoverTest";
ParentName = "CB";
/// Default values for closed cover test
BitPosition = 22;
Invert = false;
Message = Strings.Close_the_cover;
BypassLevel = Users.Grp.GID.TestingSpecialists;
}
public CoverTestCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return string.Format("{0} ({1}) Bit={2}, Inv={3}, Message={4}, BypassLelvel={5}",
Name,
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
BitPosition,
Invert ? "yes" : "no",
Message,
BypassLevel);
}
}
}
@@ -1,133 +0,0 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Windows.Forms;
using log4net;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.CoverTest
{
public partial class CoverTestCfgCtrl : UserControl, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(CoverTestCfgCtrl));
ComponentParametersDlg parent;
public bool ShowMore { get { return false; } }
CoverTestCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as CoverTestCfg;
Redraw();
}
}
public CoverTestCfgCtrl()
{
InitializeComponent();
}
private void PumpCfgCtrl_Load(object sender, EventArgs e)
{
parent = ParentForm as ComponentParametersDlg;
if (parent == null) return;
if (parent.TbfComponents != null)
{
foreach (var cmpnt in parent.TbfComponents)
{
if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.ControlBoardFactory)
{
parentNameComboBox.Items.Add(cmpnt.Name);
}
}
}
for (Users.Grp.GID gid = 0; gid < Users.Grp.GID.NrOfGroups; gid++)
{
bypassLevelComboBox.Items.Add(gid.ToString());
}
Redraw();
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName;
bitPositionTextBox.Text = config.BitPosition.ToString();
invertCheckBox.Checked = config.Invert;
messageTextBox.Text = config.Message;
bypassLevelComboBox.Text = config.BypassLevel.ToString();
}
public void Unlock()
{
nameTextBox.Enabled = true;
parentNameComboBox.Enabled = true;
bitPositionTextBox.Enabled = true;
invertCheckBox.Enabled = true;
messageTextBox.Enabled = true;
bypassLevelComboBox.Enabled = true;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
config.Name = nameTextBox.Text;
config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text;
config.BitPosition = int.Parse(bitPositionTextBox.Text);
config.Invert = invertCheckBox.Checked;
config.Message = messageTextBox.Text;
for (Users.Grp.GID gid = 0; gid < Users.Grp.GID.NrOfGroups; gid++)
{
if (bypassLevelComboBox.Text == gid.ToString())
{
config.BypassLevel = gid;
break;
}
}
return flags;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
int dummy;
if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid 'Parent name'";
}
if (!int.TryParse(bitPositionTextBox.Text, out dummy) || dummy < 0 || dummy >= 64)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Bit position' should be between 0 and 63";
}
if (!bypassLevelComboBox.Items.Contains(bypassLevelComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid 'Bypass level'";
}
return flags;
}
}
}
@@ -1,194 +0,0 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
namespace TBF.BenchControl.Elde.CoverTest
{
partial class CoverTestCfgCtrl
{
/// <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.bitPositionTextBox = new System.Windows.Forms.TextBox();
this.bitPositionLabel = new System.Windows.Forms.Label();
this.parentNameLabel = new System.Windows.Forms.Label();
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.parentNameComboBox = new System.Windows.Forms.ComboBox();
this.delayLabel = new System.Windows.Forms.Label();
this.messageTextBox = new System.Windows.Forms.TextBox();
this.bypassLevelComboBox = new System.Windows.Forms.ComboBox();
this.bypassLevelLabel = new System.Windows.Forms.Label();
this.invertCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// bitPositionTextBox
//
this.bitPositionTextBox.Enabled = false;
this.bitPositionTextBox.Location = new System.Drawing.Point(122, 99);
this.bitPositionTextBox.Name = "bitPositionTextBox";
this.bitPositionTextBox.Size = new System.Drawing.Size(46, 20);
this.bitPositionTextBox.TabIndex = 6;
//
// bitPositionLabel
//
this.bitPositionLabel.AutoSize = true;
this.bitPositionLabel.Location = new System.Drawing.Point(36, 102);
this.bitPositionLabel.Name = "bitPositionLabel";
this.bitPositionLabel.Size = new System.Drawing.Size(58, 13);
this.bitPositionLabel.TabIndex = 5;
this.bitPositionLabel.Text = "Bit position";
//
// parentNameLabel
//
this.parentNameLabel.AutoSize = true;
this.parentNameLabel.Location = new System.Drawing.Point(36, 76);
this.parentNameLabel.Name = "parentNameLabel";
this.parentNameLabel.Size = new System.Drawing.Size(67, 13);
this.parentNameLabel.TabIndex = 3;
this.parentNameLabel.Text = "Parent name";
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(122, 47);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(36, 50);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(119, 21);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// parentNameComboBox
//
this.parentNameComboBox.Enabled = false;
this.parentNameComboBox.FormattingEnabled = true;
this.parentNameComboBox.Location = new System.Drawing.Point(122, 73);
this.parentNameComboBox.Name = "parentNameComboBox";
this.parentNameComboBox.Size = new System.Drawing.Size(130, 21);
this.parentNameComboBox.TabIndex = 4;
//
// delayLabel
//
this.delayLabel.AutoSize = true;
this.delayLabel.Location = new System.Drawing.Point(36, 127);
this.delayLabel.Name = "delayLabel";
this.delayLabel.Size = new System.Drawing.Size(50, 13);
this.delayLabel.TabIndex = 8;
this.delayLabel.Text = "Message";
//
// messageTextBox
//
this.messageTextBox.Enabled = false;
this.messageTextBox.Location = new System.Drawing.Point(122, 124);
this.messageTextBox.Name = "messageTextBox";
this.messageTextBox.Size = new System.Drawing.Size(130, 20);
this.messageTextBox.TabIndex = 9;
//
// bypassLevelComboBox
//
this.bypassLevelComboBox.Enabled = false;
this.bypassLevelComboBox.FormattingEnabled = true;
this.bypassLevelComboBox.Location = new System.Drawing.Point(122, 150);
this.bypassLevelComboBox.Name = "bypassLevelComboBox";
this.bypassLevelComboBox.Size = new System.Drawing.Size(130, 21);
this.bypassLevelComboBox.TabIndex = 11;
//
// bypassLevelLabel
//
this.bypassLevelLabel.AutoSize = true;
this.bypassLevelLabel.Location = new System.Drawing.Point(36, 153);
this.bypassLevelLabel.Name = "bypassLevelLabel";
this.bypassLevelLabel.Size = new System.Drawing.Size(66, 13);
this.bypassLevelLabel.TabIndex = 10;
this.bypassLevelLabel.Text = "Bypass level";
//
// invertCheckBox
//
this.invertCheckBox.AutoSize = true;
this.invertCheckBox.Enabled = false;
this.invertCheckBox.Location = new System.Drawing.Point(190, 101);
this.invertCheckBox.Name = "invertCheckBox";
this.invertCheckBox.Size = new System.Drawing.Size(67, 17);
this.invertCheckBox.TabIndex = 7;
this.invertCheckBox.Text = "Invert bit";
this.invertCheckBox.UseVisualStyleBackColor = true;
//
// CoverTestCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.invertCheckBox);
this.Controls.Add(this.bypassLevelComboBox);
this.Controls.Add(this.bypassLevelLabel);
this.Controls.Add(this.messageTextBox);
this.Controls.Add(this.delayLabel);
this.Controls.Add(this.parentNameComboBox);
this.Controls.Add(this.bitPositionTextBox);
this.Controls.Add(this.bitPositionLabel);
this.Controls.Add(this.parentNameLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "CoverTestCfgCtrl";
this.Size = new System.Drawing.Size(300, 200);
this.Load += new System.EventHandler(this.PumpCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox bitPositionTextBox;
private System.Windows.Forms.Label bitPositionLabel;
private System.Windows.Forms.Label parentNameLabel;
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.ComboBox parentNameComboBox;
private System.Windows.Forms.Label delayLabel;
private System.Windows.Forms.TextBox messageTextBox;
private System.Windows.Forms.ComboBox bypassLevelComboBox;
private System.Windows.Forms.Label bypassLevelLabel;
private System.Windows.Forms.CheckBox invertCheckBox;
}
}
@@ -1,94 +0,0 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Drawing;
using System.Windows.Forms;
using log4net;
using TBF.Resources;
namespace TBF.BenchControl.Elde.CoverTest
{
public partial class CoverTestForm : Form, GenericDevices.IHasCompleted
{
ILog bypassLog;
string message;
/// Set to 'true' when the form closes
public bool Completed { get { return completed; } }
bool completed;
Users.Grp.GID bypassLevel;
public CoverTestForm(string message, Users.Grp.GID bypassLevel, ILog bypassLog)
{
InitializeComponent();
ControlBox = false;
this.message = message;
this.bypassLevel = bypassLevel;
this.bypassLog = bypassLog;
Localize();
messageLabel.Text = this.message;
float textWidth = Graphics.FromImage(new Bitmap(1, 1)).MeasureString(messageLabel.Text, messageLabel.Font).Width;
int rqrdFormWidth = (int)textWidth + 80; /// Form width calculated from the text width
if (rqrdFormWidth > Width)
{
int shift = (rqrdFormWidth - Width) / 2;
Width = rqrdFormWidth;
bypassButton.Left += shift;
}
completed = false;
StartForceCloseHandler();
}
void Localize()
{
Text = Strings.Message;
bypassButton.Text = Strings.Bypass;
}
private void bypassButton_Click(object sender, EventArgs e)
{
if (!Users.GlobalData.CurrentUser.IsMemberOf(bypassLevel))
{
if ((new Users.Forms.LoginDlg(bypassLevel)).ShowDialog() != DialogResult.OK)
{
return;
}
else
{
if (Program.MainWnd != null) Program.MainWnd.UpdateUser();
}
}
bypassLog.InfoFormat("{0} bypassed by {1}", message, Users.GlobalData.CurrentUser.UserName);
completed = true;
Close();
}
#region Forced close handling
public void StartForceCloseHandler()
{
UiBridge.Bridge.CloseQandAFormHandler += delegate(object sender, EventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
else OnForceClose(sender, args);
};
}
private void OnForceClose(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
Close();
}
#endregion
}
}
@@ -1,81 +0,0 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
namespace TBF.BenchControl.Elde.CoverTest
{
partial class CoverTestForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.bypassButton = new System.Windows.Forms.Button();
this.messageLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// bypassButton
//
this.bypassButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.bypassButton.ForeColor = System.Drawing.Color.Black;
this.bypassButton.Location = new System.Drawing.Point(126, 99);
this.bypassButton.Name = "bypassButton";
this.bypassButton.Size = new System.Drawing.Size(200, 63);
this.bypassButton.TabIndex = 1;
this.bypassButton.Text = "Bypass";
this.bypassButton.UseVisualStyleBackColor = true;
this.bypassButton.Click += new System.EventHandler(this.bypassButton_Click);
//
// messageLabel
//
this.messageLabel.AutoSize = true;
this.messageLabel.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.messageLabel.Location = new System.Drawing.Point(34, 39);
this.messageLabel.Name = "messageLabel";
this.messageLabel.Size = new System.Drawing.Size(91, 23);
this.messageLabel.TabIndex = 4;
this.messageLabel.Text = "Message";
//
// CoverTestForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.DarkOrange;
this.ClientSize = new System.Drawing.Size(454, 201);
this.Controls.Add(this.messageLabel);
this.Controls.Add(this.bypassButton);
this.Name = "CoverTestForm";
this.Text = "Message";
this.TopMost = true;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button bypassButton;
private System.Windows.Forms.Label messageLabel;
}
}
@@ -1,26 +0,0 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.CoverTest
{
public class Factory : IComponentFactory
{
public string ClassName { get { return "Elde.CoverTest"; } }
public void ResetStaticProperties() { CoverTest.ResetStaticProperties(); }
public IComponent DummyComponent() { return new CoverTest(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new CoverTest(cfg, components); }
public IComponentCfg DefaultConfig() { return new CoverTestCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(CoverTestCfg), component, this);
}
}
}

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